3 # If these # comments don't work, trim them. Don't worry about any other
4 # shell scripts, Configure will trim # comments from them for you.
6 # (If you are trying to port this package to a machine without sh,
7 # I would suggest you have a look at the prototypical config_h.SH file
8 # and edit it to reflect your system. Some packages may include samples
9 # of config.h for certain machines, so you might look for one of those.)
11 # Yes, you may rip this off to use in other distribution packages. This
12 # script belongs to the public domain and cannot be copyrighted.
14 # (Note: this Configure script was generated automatically. Rather than
15 # working with this copy of Configure, you may wish to get metaconfig.
16 # The dist-3.0 package (which contains metaconfig) was posted in
17 # comp.sources.misc and is available on CPAN under authors/id/RAM so
18 # you may fetch it yourself from your nearest archive site.)
21 # Though this script was generated by metaconfig, it is OK to send
22 # patches against it. It's up to the Configure pumpkin to backport
23 # the patch to the metaunits if it is accepted.
24 # See Porting/pumpkin.pod for more information on metaconfig.
27 # $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $
29 # Generated on Mon Oct 23 17:35:45 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=''
408 endhostent_r_proto=''
414 endprotoent_r_proto=''
420 endservent_r_proto=''
472 gethostbyaddr_r_proto=''
474 gethostbyname_r_proto=''
476 gethostent_r_proto=''
488 getnetbyaddr_r_proto=''
490 getnetbyname_r_proto=''
504 d_getprotobyname_r=''
505 getprotobyname_r_proto=''
506 d_getprotobynumber_r=''
507 getprotobynumber_r_proto=''
509 getprotoent_r_proto=''
521 getservbyname_r_proto=''
523 getservbyport_r_proto=''
525 getservent_r_proto=''
549 d_libm_lib_version=''
562 d_malloc_good_size=''
604 d_old_pthread_create_joinable=''
605 old_pthread_create_joinable=''
607 d_pthread_attr_setscope=''
646 sethostent_r_proto=''
663 setprotoent_r_proto=''
675 setservent_r_proto=''
708 d_sprintf_returns_strlen=''
723 d_stdio_ptr_lval_nochange_cnt=''
724 d_stdio_ptr_lval_sets_cnt=''
927 d_inc_version_list=''
929 inc_version_list_init=''
948 ignore_versioned_solibs=''
1012 d_perl_otherlibdirs=''
1020 api_versionstring=''
1026 version_patchlevel_string=''
1030 d_nv_preserves_uv=''
1031 d_nv_zero_is_allbits_zero=''
1042 nv_preserves_uv_bits=''
1114 installsitehtml1dir=''
1117 installsitehtml3dir=''
1124 installsiteman1dir=''
1127 installsiteman3dir=''
1132 installsitescript=''
1147 d_stdio_stream_array=''
1148 stdio_stream_array=''
1159 ccflags_uselargefiles=''
1160 ldflags_uselargefiles=''
1161 libswanted_uselargefiles=''
1181 installvendorarch=''
1188 installvendorhtml1dir=''
1190 vendorhtml1direxp=''
1191 installvendorhtml3dir=''
1193 vendorhtml3direxp=''
1199 installvendorman1dir=''
1202 installvendorman3dir=''
1209 installvendorscript=''
1221 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1224 : We must find out about Eunice early
1226 if test -f /etc/unixtovms; then
1227 eunicefix=/etc/unixtovms
1229 if test -f /etc/unixtovms.exe; then
1230 eunicefix=/etc/unixtovms.exe
1233 : Set executable suffix now -- needed before hints available
1234 if test -f "/libs/version.library"; then
1237 elif test -f "/system/gnu_library/bin/ar.pm"; then
1240 elif test -n "$DJGPP"; then
1243 elif test -d c:/. -o -n "$is_os2" ; then
1252 : set useposix=false in your hint file to disable the POSIX extension.
1254 : set useopcode=false in your hint file to disable the Opcode extension.
1256 : Trailing extension. Override this in a hint file, if needed.
1257 : Extra object files, if any, needed on this platform.
1260 : Possible local include directories to search.
1261 : Set locincpth to "" in a hint file to defeat local include searches.
1262 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1263 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1265 : no include file wanted by default
1268 : Enable -DEBUGGING and -DDEBUGGING from the command line
1274 : change the next line if compiling for Xenix/286 on Xenix/386
1275 xlibpth='/usr/lib/386 /lib/386'
1276 : Possible local library directories to search.
1277 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1278 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1280 : general looking path for locating libraries
1281 glibpth="/lib /usr/lib $xlibpth"
1282 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1283 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1284 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1286 : Private path used by Configure to find libraries. Its value
1287 : is prepended to libpth. This variable takes care of special
1288 : machines, like the mips. Usually, it should be empty.
1291 : default library list
1293 : some systems want to use only the non-versioned libso:s
1294 ignore_versioned_solibs=''
1299 ccflags_uselargefiles=''
1300 ldflags_uselargefiles=''
1301 libswanted_uselargefiles=''
1302 : set usemultiplicity on the Configure command line to enable multiplicity.
1303 : set usesocks on the Configure command line to enable socks.
1304 : set usethreads on the Configure command line to enable threads.
1305 usereentrant='undef'
1306 : full support for void wanted by default
1309 : List of libraries we want.
1310 : If anyone needs extra -lxxx, put those in a hint file.
1311 libswanted="sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun"
1312 libswanted="$libswanted m crypt sec util c cposix posix ucb bsd BSD"
1313 : We probably want to search /usr/shlib before most other libraries.
1314 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1315 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1316 glibpth="/usr/shlib $glibpth"
1317 : Do not use vfork unless overridden by a hint file.
1320 : Find the basic shell for Bourne shell scripts
1324 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1327 if test -f "$xxx"; then
1330 : Build up a list and do a single loop so we can 'break' out.
1331 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1332 for xxx in sh bash ksh pdksh ash; do
1334 try="$try ${p}/${xxx}"
1338 if test -f "$xxx"; then
1341 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1344 elif test -f "$xxx.exe"; then
1355 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1357 Usually it's in /bin/sh. How did you even get this far?
1358 Please contact me (Perl Maintainers) at perlbug@perl.org and
1359 we'll try to straighten this all out.
1365 : see if sh knows # comments
1366 if `$sh -c '#' >/dev/null 2>&1`; then
1370 test -f $xcat$_exe || xcat=/usr/bin/cat
1371 if test ! -f $xcat$_exe; then
1372 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1373 if test -f $p/cat$_exe; then
1378 if test ! -f $xcat$_exe; then
1379 echo "Can't find cat anywhere!"
1383 echo "#!$xcat" >sharp
1387 if test -s today; then
1390 echo "#! $xcat" > sharp
1394 if test -s today; then
1402 echo "Your $sh doesn't grok # comments--I will strip them later on."
1405 echo "exec grep -v '^[ ]*#'" >spitshell
1407 $eunicefix spitshell
1408 spitshell=`pwd`/spitshell
1410 echo "I presume that if # doesn't work, #! won't work either!"
1415 : figure out how to guarantee sh startup
1417 '') startsh=${sharpbang}${sh} ;;
1429 : echo "Yup, it does."
1431 echo "Hmm... '$startsh' does not guarantee sh startup..."
1432 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1437 : Save command line options in file UU/cmdline.opt for later use in
1438 : generating config.sh.
1439 cat > cmdline.opt <<EOSH
1440 # Configure command line arguments.
1449 cat >>cmdline.opt <<EOSH
1450 config_arg$argn='$arg'
1452 # Extreme backslashitis: replace each ' by '"'"'
1453 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1456 arg_exp=`cat cmdl.opt`
1457 args_exp="$args_exp$args_sep'$arg_exp'"
1458 argn=`expr $argn + 1`
1461 # args_exp is good for restarting self: eval "set X $args_exp"; shift; $0 "$@"
1462 # used by ./hints/os2.sh
1465 : produce awk script to parse command line options
1466 cat >options.awk <<'EOF'
1468 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1470 len = length(optstr);
1471 for (i = 1; i <= len; i++) {
1472 c = substr(optstr, i, 1);
1473 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1484 if (substr(str, 1, 1) != "-") {
1485 printf("'%s'\n", str);
1489 for (i = 2; i <= len; i++) {
1490 c = substr(str, i, 1);
1492 printf("-%s\n", substr(str, i));
1498 printf("'%s'\n", substr(str, i + 1));
1511 : process the command line options
1512 set X `for arg in "$@"; do echo "X$arg"; done |
1513 sed -e s/X// | awk -f options.awk`
1518 : set up default values
1528 rm -f optdef.sh posthint.sh
1529 cat >optdef.sh <<EOS
1535 while test $# -gt 0; do
1537 -d) shift; fastread=yes;;
1538 -e) shift; alldone=cont;;
1542 if test -r "$1"; then
1545 echo "$me: cannot read config file $1." >&2
1550 -h) shift; error=true;;
1551 -r) shift; reuseval=true;;
1552 -s) shift; silent=true; realsilent=true;;
1553 -E) shift; alldone=exit;;
1554 -K) shift; knowitall=true;;
1555 -O) shift; override=true;;
1556 -S) shift; silent=true; extractsh=true;;
1561 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1562 echo "$me: ignoring -D $1" >&2
1565 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1566 *) echo "$1='define'" >> optdef.sh;;
1573 *=) echo "$1" >> optdef.sh;;
1575 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1576 echo "$me: ignoring -U $1" >&2
1578 *) echo "$1='undef'" >> optdef.sh;;
1589 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1593 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1594 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1600 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1601 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1602 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1603 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1604 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1605 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1611 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1613 echo "$yyy=''" >> posthint.sh ;;
1618 echo "$yyy='$zzz'" >> posthint.sh ;;
1620 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1622 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1627 echo "$yyy=$zzz" >> posthint.sh ;;
1628 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1632 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1635 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1643 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1644 [-U symbol] [-U symbol=] [-A command:symbol...]
1645 -d : use defaults for all answers.
1646 -e : go on without questioning past the production of config.sh.
1647 -f : specify an alternate default configuration file.
1648 -h : print this help message and exit (with an error status).
1649 -r : reuse C symbols value if possible (skips costly nm extraction).
1650 -s : silent mode, only echoes questions and essential information.
1651 -D : define symbol to have some value:
1652 -D symbol symbol gets the value 'define'
1653 -D symbol=value symbol gets the value 'value'
1654 -E : stop at the end of questions, after having produced config.sh.
1655 -K : do not use unless you know what you are doing.
1656 -O : let -D and -U override definitions from loaded configuration file.
1657 -S : perform variable substitutions on all .SH files (can mix with -f)
1658 -U : undefine symbol:
1659 -U symbol symbol gets the value 'undef'
1660 -U symbol= symbol gets completely empty
1661 -A : manipulate symbol after the platform specific hints have been applied:
1662 -A symbol=value append " "value to symbol
1663 -A append:symbol=value append value to symbol
1664 -A define:symbol=value define symbol to have value
1665 -A clear:symbol define symbol to be ''
1666 -A define:symbol define symbol to be 'define'
1667 -A eval:symbol=value define symbol to be eval of value
1668 -A prepend:symbol=value prepend value to symbol
1669 -A undef:symbol define symbol to be 'undef'
1670 -A undef:symbol= define symbol to be ''
1671 -V : print version number and exit (with a zero status).
1678 case "$fastread$alldone" in
1681 case "$extractsh" in
1684 if test ! -t 0; then
1685 echo "Say 'sh Configure', not 'sh <Configure'"
1695 true) exec 1>/dev/null;;
1698 : run the defines and the undefines, if any, but leave the file out there...
1701 : create the posthint manipulation script and leave the file out there...
1706 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1707 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1708 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1709 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1710 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1713 : Some greps do not return status, grrr.
1714 echo "grimblepritz" >grimble
1715 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1717 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1723 : the following should work in any shell
1727 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1728 cat >contains <<'EOSS'
1729 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1734 : Find the path to the source tree
1737 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1741 *) src=`cd ../$src && pwd` ;;
1754 if test -f $rsrc/Configure && \
1755 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1757 : found it, so we are ok.
1760 for src in . .. ../.. ../../.. ../../../..; do
1761 if test -f ../$src/Configure && \
1762 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1773 Sorry, I can't seem to locate the source dir for $package. Please start
1774 Configure with an explicit path -- i.e. /some/path/Configure.
1782 echo "Sources for $package found in \"$src\"." >&4
1786 : script used to extract .SH files with variable substitutions
1787 cat >extract <<'EOS'
1789 echo "Doing variable substitutions on .SH files..."
1790 if test -f MANIFEST; then
1791 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1793 echo "(Looking for .SH files under the source directory.)"
1794 set x `(cd "$src"; find . -name "*.SH" -print)`
1798 0) set x `(cd "$src"; echo *.SH)`; shift;;
1800 if test ! -f "$src/$1"; then
1806 while test $name; do
1807 if test ! -d "$name"; then
1808 create="$name $create";
1809 name=`echo $name | sed -e "s|^[^/]*$||"`;
1810 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1815 for file in $create; do
1824 dir=`expr X$file : 'X\(.*\)/'`
1825 file=`expr X$file : 'X.*/\(.*\)'`
1826 (cd "$dir" && . ./$file)
1836 dir=`expr X$file : 'X\(.*\)/'`
1837 file=`expr X$file : 'X.*/\(.*\)'`
1838 (set x $dir; shift; eval $mkdir_p)
1839 sh <"$src/$dir/$file"
1848 if test -f "$src/config_h.SH"; then
1849 if test ! -f config.h; then
1850 : oops, they left it out of MANIFEST, probably, so do it anyway.
1851 . "$src/config_h.SH"
1856 : extract files and exit if asked to do so
1857 case "$extractsh" in
1859 case "$realsilent" in
1863 case "$config_sh" in
1864 '') config_sh='config.sh';;
1867 echo "Fetching answers from $config_sh..."
1870 test "$override" && . ./optdef.sh
1874 echo "Extraction done."
1879 : Eunice requires " " instead of "", can you believe it
1882 echo "Beginning of configuration questions for $package."
1884 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1886 : first determine how to suppress newline on echo command
1888 echo "Checking echo to see how to suppress newlines..."
1889 (echo "hi there\c" ; echo " ") >.echotmp
1890 if $contains c .echotmp >/dev/null 2>&1 ; then
1901 echo $n "The star should be here-->$c"
1905 : Now test for existence of everything in MANIFEST
1907 if test -f "$rsrc/MANIFEST"; then
1908 echo "First let's make sure your kit is complete. Checking..." >&4
1909 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | (split -l 50 2>/dev/null || split -50)
1912 for filelist in x??; do
1913 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` >/dev/null 2>>"$tmppwd/missing")
1915 if test -s missing; then
1919 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1921 You have the option of continuing the configuration process, despite the
1922 distinct possibility that your kit is damaged, by typing 'y'es. If you
1923 do, don't blame me if something goes wrong. I advise you to type 'n'o
1924 and contact the author (perlbug@perl.org).
1927 echo $n "Continue? [n] $c" >&4
1931 echo "Continuing..." >&4
1935 echo "ABORTING..." >&4
1940 echo "Looks good..."
1943 echo "There is no MANIFEST file. I hope your kit is complete !"
1948 : Find the appropriate value for a newline for tr
1949 if test -n "$DJGPP"; then
1952 if test X"$trnl" = X; then
1953 case "`echo foo|tr '\n' x 2>/dev/null`" in
1957 if test X"$trnl" = X; then
1958 case "`echo foo|tr '\012' x 2>/dev/null`" in
1959 foox) trnl='\012' ;;
1962 if test X"$trnl" = X; then
1963 case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
1964 fooxy) trnl='\n\r' ;;
1967 if test X"$trnl" = X; then
1970 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1976 : compute the number of columns on the terminal for proper question formatting
1981 : set up the echo used in my read
1982 myecho="case \"\$xxxm\" in
1983 '') echo $n \"\$rp $c\" >&4;;
1985 '') echo $n \"[\$xxxm] $c\";;
1987 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1989 echo $n \"[\$xxxm] $c\" >&4
1991 echo $n \"\$rp [\$xxxm] $c\" >&4
1997 : now set up to do reads with possible shell escape and default assignment
2003 case "\$fastread" in
2004 yes) case "\$dflt" in
2007 case "\$silent-\$rp" in
2012 *) case "\$silent" in
2013 true) case "\$rp" in
2018 while expr "X\$ans" : "X!" >/dev/null; do
2022 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2030 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2039 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2044 echo "(OK, I'll run with -d after this question.)" >&4
2047 echo "*** Sorry, \$1 not supported yet." >&4
2057 echo "*** Substitution done -- please confirm."
2059 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2064 echo "*** Error -- try again."
2071 case "\$ans\$xxxm\$nostick" in
2083 : create .config dir to save info across Configure sessions
2084 test -d ../.config || mkdir ../.config
2085 cat >../.config/README <<EOF
2086 This directory created by Configure to save information that should
2087 persist across sessions for $package.
2089 You may safely delete it if you wish.
2092 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2094 $define|true|[yY]*) ;;
2095 *) case "$xversion" in
2098 *** WHOA THERE!!! ***
2100 This is an UNSTABLE DEVELOPMENT release.
2101 The version of this $package distribution is $xversion, that is, odd,
2102 (as opposed to even) and that signifies a development release.
2103 If you want a maintenance release, you want an even-numbered version.
2105 Do ***NOT*** install this into production use.
2106 Data corruption and crashes are possible.
2108 It is most seriously suggested that you do not continue any further
2109 unless you want to help in developing and debugging Perl.
2111 If you *still* want to build perl, you can answer 'y' now,
2112 or pass -Dusedevel to Configure.
2115 rp='Do you really want to continue?'
2119 [yY]) echo >&4 "Okay, continuing."
2120 usedevel="$define" ;;
2121 *) echo >&4 "Okay, bye."
2131 case "$versiononly" in
2132 '') versiononly="$define" ;;
2134 case "$installusrbinperl" in
2135 '') installusrbinperl="$undef" ;;
2140 : general instructions
2143 user=`(logname) 2>/dev/null`
2145 '') user=`whoami 2>&1`;;
2147 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2150 rp='Would you like to see the instructions?'
2161 This installation shell script will examine your system and ask you questions
2162 to determine how the perl5 package should be installed. If you get
2163 stuck on a question, you may use a ! shell escape to start a subshell or
2164 execute a command. Many of the questions will have default answers in square
2165 brackets; typing carriage return will give you the default.
2167 On some of the questions which ask for file or directory names you are allowed
2168 to use the ~name construct to specify the login directory belonging to "name",
2169 even if you don't have a shell which knows about that. Questions where this is
2170 allowed will be marked "(~name ok)".
2174 dflt='Type carriage return to continue'
2178 The prompter used in this script allows you to use shell variables and
2179 backticks in your answers. You may use $1, $2, etc... to refer to the words
2180 in the default answer, as if the default line was a set of arguments given to a
2181 script shell. This means you may also use $* to repeat the whole default line,
2182 so you do not have to re-type everything to add something to the default.
2184 Everytime there is a substitution, you will have to confirm. If there is an
2185 error (e.g. an unmatched backtick), the default answer will remain unchanged
2186 and you will be prompted again.
2188 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2189 the questions and use the computed defaults (or the previous answers if there
2190 was already a config.sh file). Type 'Configure -h' for a list of options.
2191 You may also start interactively and then answer '& -d' at any prompt to turn
2192 on the non-interactive behaviour for the remainder of the execution.
2198 Much effort has been expended to ensure that this shell script will run on any
2199 Unix system. If despite that it blows up on yours, your best bet is to edit
2200 Configure and run it again. If you can't run Configure for some reason,
2201 you'll have to generate a config.sh file by hand. Whatever problems you
2202 have, let me (perlbug@perl.org) know how I blew it.
2204 This installation script affects things in two ways:
2206 1) it may do direct variable substitutions on some of the files included
2208 2) it builds a config.h file for inclusion in C programs. You may edit
2209 any of these files as the need arises after running this script.
2211 If you make a mistake on a question, there is no easy way to back up to it
2212 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2213 files. Configure will offer to let you do this before it runs the SH files.
2216 dflt='Type carriage return to continue'
2218 case "$firsttime" in
2219 true) echo $user >>../.config/instruct;;
2223 : find out where common programs are
2225 echo "Locating common programs..." >&4
2238 if test -d \$dir/\$thing; then
2244 for thisthing in \$dir/\$thing; do
2245 : just loop through to pick last item
2247 if test -f \$thisthing; then
2250 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2253 elif test -f \$dir/\$thing.exe; then
2254 if test -n "$DJGPP"; then
2255 echo \$dir/\$thing.exe
2256 elif test "$eunicefix" != ":"; then
2257 : on Eunice apparently
2311 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2312 pth="$pth /lib /usr/lib"
2313 for file in $loclist; do
2317 if test -f "$xxx"; then
2320 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2321 xxx=`./loc $file $file $pth`
2324 '') xxx=`./loc $file $file $pth`;;
2325 *) xxx=`./loc $xxx $xxx $pth`;;
2327 eval $file=$xxx$_exe
2331 echo $file is in $xxx.
2334 echo $file is in $xxx.
2337 echo "I don't know where '$file' is, and my life depends on it." >&4
2338 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2344 echo "Don't worry if any of the following aren't found..."
2346 for file in $trylist; do
2350 if test -f "$xxx"; then
2353 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2354 xxx=`./loc $file $file $pth`
2357 '') xxx=`./loc $file $file $pth`;;
2358 *) xxx=`./loc $xxx $xxx $pth`;;
2360 eval $file=$xxx$_exe
2364 echo $file is in $xxx.
2367 echo $file is in $xxx.
2370 echo "I don't see $file out there, $say."
2377 echo "Substituting grep for egrep."
2384 echo "Substituting cp for ln."
2393 echo "I can't find make or gmake, and my life depends on it." >&4
2394 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2402 *) # We can't have osname yet.
2403 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2404 # Assume that gmake, if found, is definitely GNU make
2405 # and prefer it over the system make.
2406 echo "Substituting gmake for make."
2414 echo "Hopefully test is built into your sh."
2417 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2418 echo "Using the test built into your sh."
2426 echo "Hopefully echo is built into your sh."
2431 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2432 $echo $n "hi there$c" >foo1
2433 echo $n "hi there$c" >foo2
2434 if cmp foo1 foo2 >/dev/null 2>&1; then
2435 echo "They are compatible. In fact, they may be identical."
2442 They are not compatible! You are probably running ksh on a non-USG system.
2443 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2444 have echo built in and we may have to run some Bourne shell scripts. That
2445 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2448 $echo $n "The star should be here-->$c"
2458 cat <<'EOSC' >>trygcc
2463 int main(int argc, char *argv[]) {
2467 if $cc -o try $ccflags $ldflags try.c; then
2470 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2476 case "`$cc -v -c try.c 2>&1`" in
2479 if $test X"$trygcc" = Xyes; then
2480 if gcc -o try -c try.c; then
2482 echo "You seem to have a working gcc, though." >&4
2483 rp="Would you like to use it?"
2485 if $test -f myread; then
2488 if $test -f UU/myread; then
2491 echo "Cannot find myread, sorry. Aborting." >&2
2496 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2497 if $test -f usethreads.cbu; then
2500 *** However, any setting of the C compiler flags (e.g. for thread support)
2501 *** has been lost. It may be necessary to pass -Dcc=gcc to Configure
2502 *** (together with e.g. -Dusethreads).
2518 cat <<'EOSC' >>checkcc
2523 int main(int argc, char *argv[]) {
2527 if $cc -o try $ccflags $ldflags try.c; then
2530 if $test X"$despair" = Xyes; then
2531 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2534 You need to find a working C compiler.
2535 Either (purchase and) install the C compiler supplied by your OS vendor,
2536 or for a free C compiler try http://gcc.gnu.org/
2537 I cannot continue any further, aborting.
2546 : determine whether symbolic links are supported
2549 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2550 echo "Symbolic links are supported." >&4
2553 echo "Symbolic links are NOT supported." >&4
2558 : determine whether symbolic links are supported
2562 echo "Checking how to test for symbolic links..." >&4
2564 if $test "X$issymlink" = X; then
2566 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2567 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2569 if test $? = 0; then
2572 echo "Your builtin 'test -h' may be broken." >&4
2575 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2578 if test -f "$p/$test"; then
2587 echo "Trying external '$test -h'." >&4
2588 issymlink="$test -h"
2589 if $test ! -h sym >/dev/null 2>&1; then
2590 echo "External '$test -h' is broken, too." >&4
2598 if $test "X$issymlink" = X; then
2599 if $test -L sym 2>/dev/null; then
2600 issymlink="$test -L"
2601 echo "The builtin '$test -L' worked." >&4
2604 if $test "X$issymlink" != X; then
2605 echo "You can test for symbolic links with '$issymlink'." >&4
2607 echo "I do not know how you can test for symbolic links." >&4
2611 *) echo "No symbolic links, so not testing for their testing..." >&4
2617 case "$mksymlinks" in
2620 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2623 *) case "$lns:$issymlink" in
2624 *"ln"*" -s:"*"test -"?)
2625 echo "Creating the symbolic links..." >&4
2626 echo "(First creating the subdirectories...)" >&4
2628 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2630 test -z "$directory" && break
2634 if test ! -d t/base; then
2635 echo "Failed to create the subdirectories. Aborting." >&4
2638 echo "(Then creating the symlinks...)" >&4
2639 awk '{print $1}' $src/MANIFEST | while true; do
2641 test -z "$filename" && break
2642 if test -f $filename; then
2643 if $issymlink $filename; then
2647 if test -f $filename; then
2648 echo "$filename already exists, not symlinking."
2650 ln -s $src/$filename $filename
2654 if test ! -f t/base/lex.t; then
2655 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2660 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2669 case "$usecrosscompile" in
2671 $echo "Cross-compiling..."
2674 *-*-gcc) # A cross-compiling gcc, probably.
2675 targetarch=`$echo $cc|$sed 's/-gcc$//'`
2677 # leave out ld, choosing it is more complex
2679 ranlib=$targetarch-ranlib
2680 $echo 'extern int foo;' > try.c
2681 set X `$cc -v -E try.c 2>&1 | $awk '/^#include </,/^End of search /'|$grep '/include'`
2683 if $test $# -gt 0; then
2685 incpth="`$echo $incpth|$sed 's/^ //'`"
2686 echo "Guessing incpth '$incpth'." >&4
2688 j="`$echo $i|$sed 's,/include$,/lib,'`"
2689 if $test -d $j; then
2693 libpth="`$echo $libpth|$sed 's/^ //'`"
2694 echo "Guessing libpth '$libpth'." >&4
2699 case "$targetarch" in
2700 '') echo "Targetarch not defined." >&4; croak=y ;;
2701 *) echo "Using targetarch $targetarch." >&4 ;;
2704 '') echo "Incpth not defined." >&4; croak=y ;;
2705 *) echo "Using incpth '$incpth'." >&4 ;;
2708 '') echo "Libpth not defined." >&4; croak=y ;;
2709 *) echo "Using libpth '$libpth'." >&4 ;;
2712 '') for i in $incpth; do
2713 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
2715 echo "Guessing usrinc $usrinc." >&4
2720 '') echo "Usrinc not defined." >&4; croak=y ;;
2723 *) echo "Using usrinc $usrinc." >&4 ;;
2725 case "$targethost" in
2726 '') echo "Targethost not defined." >&4; croak=y ;;
2727 *) echo "Using targethost $targethost." >&4
2732 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2735 /*) run=$src/Cross/run
2736 targetmkdir=$src/Cross/mkdir
2738 from=$src/Cross/from
2740 *) pwd=`$test -f ../Configure & cd ..; pwd`
2742 targetmkdir=$pwd/Cross/mkdir
2744 from=$pwd/Cross/from
2747 case "$targetrun" in
2748 '') targetrun=ssh ;;
2753 case "$targetfrom" in
2754 '') targetfrom=scp ;;
2758 from=$from-$targetfrom
2759 case "$targetdir" in
2761 echo "Guessing targetdir $targetdir." >&4
2764 case "$targetuser" in
2766 echo "Guessing targetuser $targetuser." >&4
2769 case "$targetfrom" in
2773 case "$targetrun" in
2785 '') cwd=$targetdir ;;
2789 if $test ! -f \$exe.xok; then
2793 $targetrun -l $targetuser $targethost "cd \$cwd && ./\$exe \$@"
2796 *) echo "Unknown targetrun '$targetrun'" >&4
2800 case "$targetmkdir" in
2802 cat >$targetmkdir <<EOF
2804 $targetrun -l $targetuser $targethost "mkdir -p \$@"
2806 $chmod a+rx $targetmkdir
2808 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
2820 $targetmkdir \`dirname \$f\`
2821 $targetto $q \$f $targetuser@$targethost:\$f || exit 1
2824 $targetmkdir $targetdir/\`dirname \$f\`
2825 $targetto $q \$f $targetuser@$targethost:$targetdir/\$f || exit 1
2838 $mkdir -p $targetdir/\`dirname \$f\`
2839 $cp \$f $targetdir/\$f || exit 1
2842 $targetmkdir $targetdir/\`dirname \$f\`
2843 $cp \$f $targetdir/\$f || exit 1
2850 *) echo "Unknown targetto '$targetto'" >&4
2854 case "$targetfrom" in
2861 $targetfrom $q $targetuser@$targethost:$targetdir/\$f . || exit 1
2866 cp) cat >$from <<EOF
2871 cp $targetdir/\$f . || exit 1
2876 *) echo "Unknown targetfrom '$targetfrom'" >&4
2880 if $test ! -f $run; then
2881 echo "Target 'run' script '$run' not found." >&4
2885 if $test ! -f $to; then
2886 echo "Target 'to' script '$to' not found." >&4
2890 if $test ! -f $from; then
2891 echo "Target 'from' script '$from' not found." >&4
2895 if $test ! -f $run -o ! -f $to -o ! -f $from; then
2899 Using '$run' for remote execution,
2900 and '$from' and '$to'
2901 for remote file transfer.
2907 usecrosscompile='undef'
2912 : see whether [:lower:] and [:upper:] are supported character classes
2914 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2916 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2920 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
2921 # (0xd9 and 0xe2), therefore that is a nice testing point.
2922 if test "X$up" = X -o "X$low" = X; then
2923 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
2929 if test "X$up" = X -o "X$low" = X; then
2930 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
2936 if test "X$up" = X -o "X$low" = X; then
2937 case "`echo RS | od -x 2>/dev/null`" in
2939 echo "Hey, this might be EBCDIC." >&4
2940 if test "X$up" = X -o "X$low" = X; then
2941 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2942 rs) up='[A-IJ-RS-Z]'
2947 if test "X$up" = X -o "X$low" = X; then
2948 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
2958 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
2960 echo "Using $up and $low to convert case." >&4
2963 echo "I don't know how to translate letters from upper to lower case." >&4
2964 echo "Your tr is not acting any way I know of." >&4
2968 : set up the translation script tr, must be called with ./tr of course
2972 '[A-Z][a-z]') exec $tr '$up' '$low';;
2973 '[a-z][A-Z]') exec $tr '$low' '$up';;
2980 : Try to determine whether config.sh was made on this system
2981 case "$config_sh" in
2983 myuname=`$uname -a 2>/dev/null`
2984 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
2985 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
2986 # because the A-Z/a-z are not consecutive.
2987 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
2988 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
2989 newmyuname="$myuname"
2991 case "$knowitall" in
2993 if test -f ../config.sh; then
2994 if $contains myuname= ../config.sh >/dev/null 2>&1; then
2995 eval "`grep myuname= ../config.sh`"
2997 if test "X$myuname" = "X$newmyuname"; then
3005 : Get old answers from old config file if Configure was run on the
3006 : same system, otherwise use the hints.
3009 if test -f config.sh; then
3011 rp="I see a config.sh file. Shall I use it to set the defaults?"
3014 n*|N*) echo "OK, I'll ignore it."
3015 mv config.sh config.sh.old
3016 myuname="$newmyuname"
3018 *) echo "Fetching default answers from your old config.sh file..." >&4
3026 : Older versions did not always set $sh. Catch re-use of such
3036 if test ! -f config.sh; then
3039 First time through, eh? I have some defaults handy for some systems
3040 that need some extra help getting the Configure answers right:
3043 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3045 : Half the following guesses are probably wrong... If you have better
3046 : tests or hints, please send them to perlbug@perl.org
3047 : The metaconfig authors would also appreciate a copy...
3048 $test -f /irix && osname=irix
3049 $test -f /xenix && osname=sco_xenix
3050 $test -f /dynix && osname=dynix
3051 $test -f /dnix && osname=dnix
3052 $test -f /lynx.os && osname=lynxos
3053 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3054 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3055 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3056 $test -f /bin/mips && /bin/mips && osname=mips
3057 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
3058 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
3059 $test -d /usr/apollo/bin && osname=apollo
3060 $test -f /etc/saf/_sactab && osname=svr4
3061 $test -d /usr/include/minix && osname=minix
3062 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3063 if $test -d /MachTen -o -d /MachTen_Folder; then
3065 if $test -x /sbin/version; then
3066 osvers=`/sbin/version | $awk '{print $2}' |
3067 $sed -e 's/[A-Za-z]$//'`
3068 elif $test -x /usr/etc/version; then
3069 osvers=`/usr/etc/version | $awk '{print $2}' |
3070 $sed -e 's/[A-Za-z]$//'`
3076 $test -f /sys/posix.dll &&
3077 $test -f /usr/bin/what &&
3078 set X `/usr/bin/what /sys/posix.dll` &&
3079 $test "$3" = UWIN &&
3083 if $test -f $uname; then
3091 umips) osname=umips ;;
3094 [23]100) osname=mips ;;
3095 next*) osname=next ;;
3097 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3098 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3101 elif $test -f /etc/kconfig; then
3103 if test "$lns" = "$ln -s"; then
3105 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3107 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3114 if test -n "$DJGPP"; then
3123 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3125 # oslevel can fail with:
3126 # oslevel: Unable to acquire lock.
3127 *not\ found) osvers="$4"."$3" ;;
3128 '<3240'|'<>3240') osvers=3.2.0 ;;
3129 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3130 '=3250'|'>3250') osvers=3.2.5 ;;
3134 bsd386) osname=bsd386
3137 cygwin*) osname=cygwin
3140 *dc.osx) osname=dcosx
3146 domainos) osname=apollo
3152 dragonfly) osname=dragonfly
3155 dynixptx*) osname=dynixptx
3156 osvers=`echo "$4"|sed 's/^v//'`
3158 freebsd) osname=freebsd
3160 genix) osname=genix ;;
3164 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3180 netbsd*) osname=netbsd
3183 news-os) osvers="$3"
3185 4*) osname=newsos4 ;;
3189 next*) osname=next ;;
3190 nonstop-ux) osname=nonstopux ;;
3191 openbsd) osname=openbsd
3197 POSIX-BC | posix-bc ) osname=posix-bc
3200 powerux | power_ux | powermax_os | powermaxos | \
3201 powerunix | power_unix) osname=powerux
3207 solaris) osname=solaris
3209 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3216 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3220 titanos) osname=titanos
3229 ultrix) osname=ultrix
3232 osf1|mls+) case "$5" in
3235 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3238 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3241 hp*) osname=hp_osf1 ;;
3242 mips) osname=mips_osf1 ;;
3245 # UnixWare 7.1.2 is known as Open UNIX 8
3246 openunix|unixware) osname=svr5
3254 $2) case "$osname" in
3258 : svr4.x or possibly later
3268 if test -f /stand/boot ; then
3269 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3270 if test -n "$INITPROG" -a -f "$INITPROG"; then
3271 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3272 if test -n "$isesix"; then
3280 *) if test -f /etc/systemid; then
3282 set `echo $3 | $sed 's/\./ /g'` $4
3283 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3285 elif $test -f $src/hints/sco_$1_$2.sh; then
3287 elif $test -f $src/hints/sco_$1.sh; then
3292 '') : Still unknown. Probably a generic Sys V.
3301 *) case "$osname" in
3302 '') : Still unknown. Probably a generic BSD.
3310 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3311 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3312 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3315 $rm -f UU/kernel.what
3316 elif test -d c:/. -o -n "$is_os2" ; then
3323 case "$targetarch" in
3326 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3331 : Now look for a hint file osname_osvers, unless one has been
3332 : specified already.
3335 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3336 : Also try without trailing minor version numbers.
3337 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3338 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3339 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3340 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3343 *) case "$osvers" in
3346 *) if $test -f $src/hints/$file.sh ; then
3348 elif $test -f $src/hints/$xfile.sh ; then
3350 elif $test -f $src/hints/$xxfile.sh ; then
3352 elif $test -f $src/hints/$xxxfile.sh ; then
3354 elif $test -f $src/hints/$xxxxfile.sh ; then
3356 elif $test -f "$src/hints/${osname}.sh" ; then
3365 if $test -f Policy.sh ; then
3368 none) dflt="Policy" ;;
3369 *) dflt="Policy $dflt" ;;
3374 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3378 if $test -f Policy.sh ; then
3381 There's also a Policy hint file available, which should make the
3382 site-specific (policy) questions easier to answer.
3389 You may give one or more space-separated answers, or "none" if appropriate.
3390 If you have a handcrafted Policy.sh file or a Policy.sh file generated by a
3391 previous run of Configure, you may specify it as well as or instead of
3392 OS-specific hints. If hints are provided for your OS, you should use them:
3393 although Perl can probably be built without hints on many platforms, using
3394 hints often improve performance and may enable features that Configure can't
3395 set up on its own. If there are no hints that match your OS, specify "none";
3396 DO NOT give a wrong version or a wrong OS.
3400 rp="Which of these apply, if any?"
3403 for file in $tans; do
3404 if $test X$file = XPolicy -a -f Policy.sh; then
3406 $cat Policy.sh >> UU/config.sh
3407 elif $test -f $src/hints/$file.sh; then
3408 . $src/hints/$file.sh
3409 $cat $src/hints/$file.sh >> UU/config.sh
3410 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3413 : Give one chance to correct a possible typo.
3414 echo "$file.sh does not exist"
3416 rp="hint to use instead?"
3418 for file in $ans; do
3419 if $test -f "$src/hints/$file.sh"; then
3420 . $src/hints/$file.sh
3421 $cat $src/hints/$file.sh >> UU/config.sh
3422 elif $test X$ans = X -o X$ans = Xnone ; then
3425 echo "$file.sh does not exist -- ignored."
3432 : Remember our hint file for later.
3433 if $test -f "$src/hints/$file.sh" ; then
3443 echo "Fetching default answers from $config_sh..." >&4
3447 cp $config_sh config.sh 2>/dev/null
3457 test "$override" && . ./optdef.sh
3459 : Restore computed paths
3460 for file in $loclist $trylist; do
3461 eval $file="\$_$file"
3466 Configure uses the operating system name and version to set some defaults.
3467 The default value is probably right if the name rings a bell. Otherwise,
3468 since spelling matters for me, either accept the default or answer "none"
3475 ''|' '|none) dflt=none ;;
3476 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3479 *) dflt="$osname" ;;
3481 rp="Operating system name?"
3485 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3491 ''|' '|none) dflt=none ;;
3492 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3493 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3495 ''|' ') dflt=none ;;
3500 *) dflt="$osvers" ;;
3502 rp="Operating system version?"
3512 : who configured the system
3513 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3516 cf_by=`(logname) 2>/dev/null`
3519 cf_by=`(whoami) 2>/dev/null`
3521 "") cf_by=unknown ;;
3526 : decide how portable to be. Allow command line overrides.
3527 case "$d_portable" in
3529 *) d_portable="$define" ;;
3532 : set up shell script to do ~ expansion
3538 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3541 if $test -f /bin/csh; then
3542 /bin/csh -f -c "glob \$1"
3547 name=\`$expr x\$1 : '..\([^/]*\)'\`
3548 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3549 if $test ! -d "\$dir"; then
3551 echo "\$me: can't locate home directory for: \$name" >&2
3556 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3572 : now set up to get a file name
3576 cat <<'EOSC' >>getfile
3592 : getfile will accept an answer from the comma-separated list
3593 : enclosed in parentheses even if it does not meet other criteria.
3594 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3595 fn=`echo $fn | sed 's/(.*)//'`
3601 loc_file=`expr $fn : '.*:\(.*\)'`
3602 fn=`expr $fn : '\(.*\):.*'`
3610 */*) fullpath=true;;
3619 *e*) exp_file=true;;
3622 *p*) nopath_ok=true;;
3627 *d*) type='Directory';;
3628 *l*) type='Locate';;
3633 Locate) what='File';;
3638 case "$d_portable" in
3646 while test "$type"; do
3651 true) rp="$rp (~name ok)";;
3654 if test -f UU/getfile.ok && \
3655 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3674 value=`UU/filexp $ans`
3677 if test "$ans" != "$value"; then
3678 echo "(That expands to $value on this system.)"
3692 /*) value="$ansexp" ;;
3693 [a-zA-Z]:/*) value="$ansexp" ;;
3698 echo "I shall only accept a full path name, as in /bin/ls." >&4
3699 echo "Use a ! shell escape if you wish to check pathnames." >&4
3702 echo "Please give a full path name, starting with slash." >&4
3705 echo "Note that using ~name is ok provided it expands well." >&4
3718 for fp in $gfpth; do
3719 if test "X$fp" = X.; then
3724 if test -f "$pf"; then
3726 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3728 echo "($value is not a plain file, but that's ok.)"
3731 if test X"$type" = X; then
3738 for fp in $gfpth; do
3739 if test "X$fp" = X.; then
3744 direxp="$fp/$ansexp"
3746 if test -d "$direxp"; then
3754 if test -d "$ansexp"; then
3755 echo "(Looking for $loc_file in directory $value.)"
3756 value="$value/$loc_file"
3757 ansexp="$ansexp/$loc_file"
3759 if test -f "$ansexp"; then
3762 case "$nopath_ok" in
3763 true) case "$value" in
3765 *) echo "Assuming $value will be in people's path."
3781 if test "$fastread" = yes; then
3786 rp="$what $value doesn't exist. Use that name anyway?"
3805 test "X$gfpthkeep" != Xy && gfpth=""
3808 : determine root of directory hierarchy where package will be installed.
3811 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
3814 dflt=`echo "$prefix" | sed 's/.$//'`
3822 By default, $package will be installed in $dflt/bin, manual pages
3823 under $dflt/man, etc..., i.e. with $dflt as prefix for all
3824 installation directories. Typically this is something like /usr/local.
3825 If you wish to have binaries under /usr/bin but other parts of the
3826 installation under /usr/local, that's ok: you will be prompted
3827 separately for each of the installation directories, the prefix being
3828 only used to set the defaults.
3832 rp='Installation prefix to use?'
3840 *) oldprefix="$prefix";;
3849 *) afsroot=$afsroot ;;
3855 $define|true) afs=true ;;
3856 $undef|false) afs=false ;;
3857 *) if test -d $afsroot; then
3865 echo "AFS may be running... I'll be extra cautious then..." >&4
3867 echo "AFS does not seem to be running..." >&4
3870 : determine installation prefix for where package is to be installed.
3874 Since you are running AFS, I need to distinguish the directory in which
3875 files will reside from the directory in which they are installed (and from
3876 which they are presumably copied to the former directory by occult means).
3879 case "$installprefix" in
3880 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
3881 *) dflt="$installprefix";;
3886 In some special cases, particularly when building $package for distribution,
3887 it is convenient to distinguish the directory in which files should be
3888 installed from the directory ($prefix) in which they will
3889 eventually reside. For most users, these two directories are the same.
3892 case "$installprefix" in
3894 *) dflt=$installprefix;;
3898 rp='What installation prefix should I use for installing files?'
3900 installprefix="$ans"
3901 installprefixexp="$ansexp"
3903 : Perform the prefixexp/installprefixexp correction if necessary
3904 cat <<EOS >installprefix
3907 cat <<'EOSC' >>installprefix
3908 : Change installation prefix, if necessary.
3909 if $test X"$prefix" != X"$installprefix"; then
3910 eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`"
3912 eval "install${prefixvar}=\"\$${prefixvar}exp\""
3915 chmod +x installprefix
3916 $eunicefix installprefix
3918 : Set variables such as privlib and privlibexp from the output of ./getfile
3919 : performing the prefixexp/installprefixexp correction if necessary.
3920 cat <<EOS >setprefixvar
3923 cat <<'EOSC' >>setprefixvar
3924 eval "${prefixvar}=\"\$ans\""
3925 eval "${prefixvar}exp=\"\$ansexp\""
3928 chmod +x setprefixvar
3929 $eunicefix setprefixvar
3931 : set up the script used to warn in case of inconsistency
3938 echo "*** WHOA THERE!!! ***" >&4
3939 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
3940 rp=" Keep the $hint value?"
3943 y) td=$was; tu=$was;;
3947 : function used to set $1 to $val
3948 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
3950 $define$undef) . ./whoa; eval "$var=\$td";;
3951 $undef$define) . ./whoa; eval "$var=\$tu";;
3952 *) eval "$var=$val";;
3956 $define|true|[yY]*) dflt='y';;
3961 Perl can be built to use the SOCKS proxy protocol library. To do so,
3962 Configure must be run with -Dusesocks. If you use SOCKS you also need
3963 to use the PerlIO abstraction layer, this will be implicitly selected.
3965 If this doesn't make any sense to you, just accept the default '$dflt'.
3967 rp='Build Perl for SOCKS?'
3970 y|Y) val="$define" ;;
3977 $define|true|[yY]*) useperlio="$define";;
3980 case "$useperlio" in
3981 $define|true|[yY]*|'') dflt='y';;
3986 Previous version of $package used the standard IO mechanisms as
3987 defined in <stdio.h>. Versions 5.003_02 and later of $package allow
3988 alternate IO mechanisms via the PerlIO abstraction layer, but the
3989 stdio mechanism is still available if needed. The abstraction layer
3990 can use AT&T's sfio (if you already have sfio installed) or regular stdio.
3991 Using PerlIO with sfio may cause problems with some extension modules.
3993 If this doesn't make any sense to you, just accept the default '$dflt'.
3995 rp='Use the PerlIO abstraction layer?'
4002 echo "Ok, doing things the stdio way."
4011 case "$useperlio" in
4012 $define|true|[yY]*) ;;
4015 You are using the SOCKS proxy protocol library which means that you
4016 should also use the PerlIO layer. You may be headed for trouble.
4025 case "$usethreads" in
4026 $define|true|[yY]*) dflt='y';;
4027 *) # Catch case where user specified ithreads or 5005threads but
4028 # forgot -Dusethreads (A.D. 4/2002)
4029 case "$useithreads$use5005threads" in
4031 case "$useperlio" in
4032 "$define") dflt='y' ;;
4042 Perl can be built to take advantage of threads on some systems.
4043 To do so, Configure can be run with -Dusethreads.
4045 Note that Perl built with threading support runs slightly slower
4046 and uses more memory than plain Perl. The current implementation
4047 is believed to be stable, but it is fairly new, and so should be
4048 treated with caution.
4050 If this doesn't make any sense to you, just accept the default '$dflt'.
4052 rp='Build a threading Perl?'
4055 y|Y) val="$define" ;;
4061 case "$usethreads" in
4065 Since release 5.6, Perl has had two different threading implementations,
4066 the newer interpreter-based version (ithreads) with one interpreter per
4067 thread, and the older 5.005 version (5005threads).
4068 The 5005threads version is effectively unmaintained and will probably be
4069 removed in Perl 5.10, so there should be no need to build a Perl using it
4070 unless needed for backwards compatibility with some existing 5.005threads
4074 : Default to ithreads unless overridden on command line or with
4077 case "$use5005threads" in
4078 $define|true|[yY]*) dflt='n';;
4080 case "$useithreads" in
4081 $undef|false|[nN]*) dflt='n';;
4083 rp='Use the newer interpreter-based ithreads?'
4086 y|Y) val="$define" ;;
4091 : Now set use5005threads to the opposite value.
4092 case "$useithreads" in
4093 $define) val="$undef" ;;
4100 useithreads="$undef"
4101 use5005threads="$undef"
4105 case "$useithreads$use5005threads" in
4109 You cannot have both the ithreads and the 5.005 threads enabled
4110 at the same time. Disabling the 5.005 threads since they are
4111 much less stable than the ithreads.
4114 use5005threads="$undef"
4118 if test X"$usethreads" = "X$define" -a "X$useperlio" = "Xundef"; then
4121 *** To build with ithreads you must also use the PerlIO layer.
4122 *** Cannot continue, aborting.
4128 case "$d_oldpthreads" in
4129 '') : Configure tests would be welcome here. For now, assume undef.
4131 *) val="$d_oldpthreads" ;;
4137 : Look for a hint-file generated 'call-back-unit'. If the
4138 : user has specified that a threading perl is to be built,
4139 : we may need to set or change some other defaults.
4140 if $test -f usethreads.cbu; then
4141 echo "Your platform has some specific hints regarding threaded builds, using them..."
4144 case "$usethreads" in
4145 "$define"|true|[yY]*)
4147 (Your platform does not have any specific hints for threaded builds.
4148 Assuming POSIX threads, then.)
4156 Perl can be built so that multiple Perl interpreters can coexist
4157 within the same Perl executable.
4160 case "$useithreads" in
4163 This multiple interpreter support is required for interpreter-based threads.
4167 *) case "$usemultiplicity" in
4168 $define|true|[yY]*) dflt='y';;
4172 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
4173 rp='Build Perl for multiplicity?'
4176 y|Y) val="$define" ;;
4185 case "$usemorebits" in
4186 "$define"|true|[yY]*)
4187 use64bitint="$define"
4188 uselongdouble="$define"
4189 usemorebits="$define"
4191 *) usemorebits="$undef"
4195 : make some quick guesses about what we are up against
4197 $echo $n "Hmm... $c"
4207 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
4208 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
4210 echo "Looks kind of like an OSF/1 system, but we'll see..."
4212 elif test `echo abc | $tr a-z A-Z` = Abc ; then
4213 xxx=`./loc addbib blurfl $pth`
4214 if $test -f $xxx; then
4215 echo "Looks kind of like a USG system with BSD features, but we'll see..."
4219 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
4220 echo "Looks kind of like an extended USG system, but we'll see..."
4222 echo "Looks kind of like a USG system, but we'll see..."
4226 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
4227 echo "Looks kind of like a BSD system, but we'll see..."
4231 echo "Looks kind of like a Version 7 system, but we'll see..."
4234 case "$eunicefix" in
4237 There is, however, a strange, musty smell in the air that reminds me of
4238 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
4242 : it so happens the Eunice I know will not run shell scripts in Unix format
4246 echo "Congratulations. You aren't running Eunice."
4250 : Detect OS2. The p_ variable is set above in the Head.U unit.
4251 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
4252 : semicolon as a patch separator
4257 I have the feeling something is not exactly right, however...don't tell me...
4258 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
4259 (Or you may be running DOS with DJGPP.)
4264 if test -f /xenix; then
4265 echo "Actually, this looks more like a XENIX system..."
4270 echo "It's not Xenix..."
4275 if test -f /venix; then
4276 echo "Actually, this looks more like a VENIX system..."
4283 echo "Nor is it Venix..."
4286 chmod +x bsd usg v7 osf1 eunice xenix venix os2
4287 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
4294 rp="Use which C compiler?"
4298 : See if they have not cc but they do have gcc
4300 : Look for a hint-file generated 'call-back-unit'. Now that the
4301 : user has specified the compiler, we may need to set or change some
4303 if $test -f cc.cbu; then
4309 echo "Checking for GNU cc in disguise and/or its version number..." >&4
4313 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
4315 printf("%s\n", __VERSION__);
4317 printf("%s\n", "1");
4323 if $cc -o try $ccflags $ldflags try.c; then
4324 gccversion=`$run ./try`
4325 case "$gccversion" in
4326 '') echo "You are not using GNU cc." ;;
4327 *) echo "You are using GNU cc $gccversion."
4333 echo "*** WHOA THERE!!! ***" >&4
4334 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
4335 case "$knowitall" in
4337 echo " You'd better start hunting for one and let me know about it." >&4
4343 case "$gccversion" in
4344 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
4346 case "$gccversion" in
4347 '') gccosandvers='' ;;
4348 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
4349 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
4351 case "$gccosandvers" in
4352 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
4353 $osname$osvers) ;; # looking good
4354 $osname*) cat <<EOM >&4
4356 *** WHOA THERE!!! ***
4358 Your gcc has not been compiled for the exact release of
4359 your operating system ($gccosandvers versus $osname$osvers).
4361 In general it is a good idea to keep gcc synchronized with
4362 the operating system because otherwise serious problems
4363 may ensue when trying to compile software, like Perl.
4365 I'm trying to be optimistic here, though, and will continue.
4366 If later during the configuration and build icky compilation
4367 problems appear (headerfile conflicts being the most common
4368 manifestation), I suggest reinstalling the gcc to match
4369 your operating system release.
4373 *) gccosandvers='' ;; # failed to parse, better be silent
4381 # gcc 3.* complain about adding -Idirectories that they already know about,
4382 # so we will take those off from locincpth.
4383 case "$gccversion" in
4385 echo "main(){}">try.c
4386 for incdir in $locincpth; do
4387 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
4388 grep '^c[cp]p*[01]: warning: changing search order '`
4389 if test "X$warn" != X; then
4390 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
4396 : What should the include directory be ?
4398 $echo $n "Hmm... $c"
4402 if $test -f /bin/mips && /bin/mips; then
4403 echo "Looks like a MIPS system..."
4404 $cat >usr.c <<'EOCP'
4405 #ifdef SYSTYPE_BSD43
4409 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4410 dflt='/bsd43/usr/include'
4414 mips_type='System V'
4416 $rm -f usr.c usr.out
4417 echo "and you're compiling with the $mips_type compiler and libraries."
4421 echo "Doesn't look like a MIPS system."
4431 case "$xxx_prompt" in
4434 rp='Where are the include files you want to use?'
4442 : see how we invoke the C preprocessor
4444 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4445 cat <<'EOT' >testcpp.c
4451 if test ! -f cppstdin; then
4452 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4453 # AIX cc -E doesn't show the absolute headerfile
4454 # locations but we'll cheat by using the -M flag.
4455 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
4457 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4460 echo "Keeping your $hint cppstdin wrapper."
4463 wrapper=`pwd`/cppstdin
4467 if $test "X$cppstdin" != "X" && \
4468 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4469 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4471 echo "You used to use $cppstdin $cppminus so we'll use that again."
4473 '') echo "But let's see if we can live without a wrapper..." ;;
4475 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4476 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4478 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4481 echo "(However, $cpprun $cpplast does not work, let's see...)"
4489 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4496 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4497 $cc -E <testcpp.c >testcpp.out 2>&1; \
4498 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4499 echo "Yup, it does."
4502 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4503 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4504 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4505 echo "Yup, it does."
4508 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4509 $cc -P <testcpp.c >testcpp.out 2>&1; \
4510 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4511 echo "Yipee, that works!"
4514 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4515 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4516 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4517 echo "At long last!"
4520 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4521 $cpp <testcpp.c >testcpp.out 2>&1; \
4522 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4526 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4527 $cpp - <testcpp.c >testcpp.out 2>&1; \
4528 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4529 echo "Hooray, it works! I was beginning to wonder."
4532 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4533 $wrapper <testcpp.c >testcpp.out 2>&1; \
4534 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4540 rp="No dice. I can't find a C preprocessor. Name one:"
4544 $x_cpp <testcpp.c >testcpp.out 2>&1
4545 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4546 echo "OK, that will do." >&4
4548 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4563 echo "Perhaps can we force $cc -E using a wrapper..."
4564 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4565 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4571 echo "Nope, we'll have to live without it..."
4585 "$wrapper"|'cppstdin') ;;
4586 *) $rm -f $wrapper;;
4588 $rm -f testcpp.c testcpp.out
4590 : Set private lib path
4593 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4598 '') dlist="$loclibpth $plibpth $glibpth";;
4599 *) dlist="$libpth";;
4602 : Now check and see which directories actually exist, avoiding duplicates
4606 if $test -d $xxx; then
4609 *) libpth="$libpth $xxx";;
4615 Some systems have incompatible or broken versions of libraries. Among
4616 the directories listed in the question below, please remove any you
4617 know not to be holding relevant libraries, and add any that are needed.
4618 Say "none" for none.
4629 rp="Directories to use for library searches?"
4636 : compute shared library extension
4639 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4649 On some systems, shared libraries may be available. Answer 'none' if
4650 you want to suppress searching of shared libraries for the remainder
4651 of this configuration.
4654 rp='What is the file extension used for shared libraries?'
4658 : Define several unixisms.
4659 : Hints files or command line option can be used to override them.
4660 : The convoluted testing is in case hints files set either the old
4663 '') case "$exe_ext" in
4665 *) _exe="$exe_ext" ;;
4670 '') case "$lib_ext" in
4677 '') case "$obj_ext" in
4684 '') case "$path_sep" in
4695 : Which makefile gets called first. This is used by make depend.
4696 case "$firstmakefile" in
4697 '') firstmakefile='makefile';;
4701 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
4704 case "$uselongdouble" in
4705 $define|true|[yY]*) dflt='y';;
4710 Perl can be built to take advantage of long doubles which
4711 (if available) may give more accuracy and range for floating point numbers.
4713 If this doesn't make any sense to you, just accept the default '$dflt'.
4715 rp='Try to use long doubles if available?'
4718 y|Y) val="$define" ;;
4724 case "$uselongdouble" in
4725 true|[yY]*) uselongdouble="$define" ;;
4728 : Look for a hint-file generated 'call-back-unit'. If the
4729 : user has specified that long doubles should be used,
4730 : we may need to set or change some other defaults.
4731 if $test -f uselongdouble.cbu; then
4732 echo "Your platform has some specific hints regarding long doubles, using them..."
4733 . ./uselongdouble.cbu
4735 case "$uselongdouble" in
4738 (Your platform does not have any specific hints for long doubles.)
4744 : Looking for optional libraries
4746 echo "Checking for optional libraries..." >&4
4751 case "$libswanted" in
4752 '') libswanted='c_s';;
4755 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
4761 for thisdir in $libpth $xlibpth; do
4762 test -d $thisdir && libspath="$libspath $thisdir"
4764 for thislib in $libswanted; do
4765 for thisdir in $libspath; do
4767 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4768 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
4769 $test -f "$xxx" && eval $libscheck
4770 $test -f "$xxx" && libstyle=shared
4772 if test ! -f "$xxx"; then
4773 xxx=$thisdir/lib$thislib.$so
4774 $test -f "$xxx" && eval $libscheck
4775 $test -f "$xxx" && libstyle=shared
4777 if test ! -f "$xxx"; then
4778 xxx=$thisdir/lib$thislib$_a
4779 $test -f "$xxx" && eval $libscheck
4780 $test -f "$xxx" && libstyle=static
4782 if test ! -f "$xxx"; then
4783 xxx=$thisdir/$thislib$_a
4784 $test -f "$xxx" && eval $libscheck
4785 $test -f "$xxx" && libstyle=static
4787 if test ! -f "$xxx"; then
4788 xxx=$thisdir/lib${thislib}_s$_a
4789 $test -f "$xxx" && eval $libscheck
4790 $test -f "$xxx" && libstyle=static
4791 $test -f "$xxx" && thislib=${thislib}_s
4793 if test ! -f "$xxx"; then
4794 xxx=$thisdir/Slib$thislib$_a
4795 $test -f "$xxx" && eval $libscheck
4796 $test -f "$xxx" && libstyle=static
4798 if $test -f "$xxx"; then
4800 shared) echo "Found -l$thislib (shared)." ;;
4801 static) echo "Found -l$thislib." ;;
4802 *) echo "Found -l$thislib ($libstyle)." ;;
4806 *) dflt="$dflt -l$thislib"
4807 libsfound="$libsfound $xxx"
4809 libsfiles="$libsfiles $yyy"
4810 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
4811 case " $libsdirs " in
4813 *) libsdirs="$libsdirs $yyy" ;;
4820 if $test ! -f "$xxx"; then
4821 echo "No -l$thislib."
4832 ' '|'') dflt='none';;
4837 In order to compile $package on your machine, a number of libraries
4838 are usually needed. Include any other special libraries here as well.
4839 Say "none" for none. The default list is almost always right.
4843 rp="What libraries to use?"
4850 : determine optimization, if desired, or use for debug flag also
4852 ' '|$undef) dflt='none';;
4854 *) dflt="$optimize";;
4858 By default, $package compiles with the -O flag to use the optimizer.
4859 Alternately, you might want to use the symbolic debugger, which uses
4860 the -g flag (on traditional Unix systems). Either flag can be
4861 specified here. To use neither flag, specify the word "none".
4864 rp="What optimizer/debugger flag should be used?"
4868 'none') optimize=" ";;
4871 : Check what DEBUGGING is required from the command line
4872 : -DEBUGGING or -DDEBUGGING or
4873 : -DEBUGGING=both = -g + -DDEBUGGING
4874 : -DEBUGGING=-g or -Doptimize=-g = -g
4875 : -DEBUGGING=none or -UDEBUGGING =
4876 : -DEBUGGING=old or -DEBUGGING=default = ? $optimize
4879 *) DEBUGGING=$EBUGGING ;;
4882 case "$DEBUGGING" in
4886 *) optimize="$optimize -g" ;;
4890 *-g*) set `echo "X $optimize " | sed 's/ -g / /'`
4898 case "$DEBUGGING" in
4899 both|$define) dflt='-DDEBUGGING'
4902 : We will not override a previous value, but we might want to
4903 : augment a hint file
4905 default|recommended)
4906 case "$gccversion" in
4907 1*) dflt="$dflt -fpcc-struct-return" ;;
4909 case "$optimize:$DEBUGGING" in
4910 *-g*:old) dflt="$dflt -DDEBUGGING";;
4912 case "$gccversion" in
4913 2*) if test -d /etc/conf/kconfig.d &&
4914 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
4916 # Interactive Systems (ISC) POSIX mode.
4921 case "$gccversion" in
4925 echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
4926 echo 'int main(void) { return 0; }' > gcctest.c
4927 if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
4928 echo "Yes, it does." 2>&1
4931 echo "Leaving current flags $ccflags alone." 2>&1
4933 *) dflt="$dflt -fno-strict-aliasing" ;;
4936 echo "Nope, it doesn't, but that's ok." 2>&1
4940 # For gcc, adding -pipe speeds up compilations for some, but apparently
4941 # some assemblers can't read from stdin. (It also slows down compilations
4942 # in other cases, but those are apparently rarer these days.) AD 5/2004.
4943 case "$gccversion" in
4945 echo "Checking if your compiler accepts -pipe" 2>&1
4946 echo 'int main(void) { return 0; }' > gcctest.c
4947 if $cc -pipe -o gcctest gcctest.c; then
4948 echo "Yes, it does." 2>&1
4951 echo "Leaving current flags $ccflags alone." 2>&1
4953 *) dflt="$dflt -pipe" ;;
4956 echo "Nope, it doesn't, but that's ok." 2>&1
4963 case "$mips_type" in
4964 *BSD*|'') inclwanted="$locincpth $usrinc";;
4965 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
4967 for thisincl in $inclwanted; do
4968 if $test -d $thisincl; then
4969 if $test x$thisincl != x$usrinc; then
4971 *" -I$thisincl "*);;
4972 *) dflt="$dflt -I$thisincl ";;
4978 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
4980 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
4988 *) dflt="$dflt -D$2";;
4992 set signal.h LANGUAGE_C; eval $inctest
4996 ccflags="$ccflags -DSOCKS"
5001 default|recommended) dflt="$ccflags $dflt" ;;
5002 *) dflt="$ccflags";;
5011 Your C compiler may want other flags. For this question you should include
5012 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
5013 but you should NOT include libraries or ld flags like -lwhatever. If you
5014 want $package to honor its debug switch, you should include -DDEBUGGING here.
5015 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
5017 To use no flags, specify the word "none".
5023 rp="Any additional cc flags?"
5030 : the following weeds options from ccflags that are of no interest to cpp
5032 '') cppflags="$ccflags" ;;
5033 *) cppflags="$cppflags $ccflags" ;;
5035 case "$gccversion" in
5036 1*) cppflags="$cppflags -D__GNUC__"
5038 case "$mips_type" in
5040 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
5046 echo "Let me guess what the preprocessor flags are..." >&4
5060 *) ftry="$previous $flag";;
5062 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
5063 >cpp1.out 2>/dev/null && \
5064 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
5065 >cpp2.out 2>/dev/null && \
5066 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
5067 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
5069 cppflags="$cppflags $ftry"
5079 *-*) echo "They appear to be: $cppflags";;
5081 $rm -f cpp.c cpp?.out
5085 : flags used in final linking phase
5087 '') if ./venix; then
5093 *-posix*) dflt="$dflt -posix" ;;
5096 *) dflt="$ldflags";;
5099 : Try to guess additional flags to pick up local libraries.
5100 for thislibdir in $libpth; do
5101 case " $loclibpth " in
5104 *"-L$thislibdir "*) ;;
5105 *) dflt="$dflt -L$thislibdir" ;;
5117 Your C linker may need flags. For this question you should
5118 include -L/whatever and any other flags used by the C linker, but you
5119 should NOT include libraries like -lwhatever.
5121 Make sure you include the appropriate -L/path flags if your C linker
5122 does not normally search all of the directories you specified above,
5125 To use no flags, specify the word "none".
5129 rp="Any additional ld flags (NOT including libraries)?"
5135 rmlist="$rmlist pdp11"
5139 echo "Checking your choice of C compiler and flags for coherency..." >&4
5140 $cat > try.c <<'EOF'
5142 int main() { printf("Ok\n"); return(0); }
5144 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
5146 $cat >try.msg <<'EOM'
5147 I've tried to compile and run the following simple program:
5150 $cat try.c >> try.msg
5152 $cat >> try.msg <<EOM
5159 and I got the following output:
5163 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5164 if $sh -c "$run ./try" >>try.msg 2>&1; then
5168 *) echo 'The program compiled OK, but produced no output.' >> try.msg
5171 cat >> try.msg <<'EOQS'
5172 If $libs contains -lsfio, and sfio is mis-configured, then it
5173 sometimes (apparently) runs and exits with a 0 status, but with no
5174 output! It may have to do with sfio's use of _exit vs. exit.
5177 rp="You have a big problem. Shall I abort Configure"
5184 echo "The program compiled OK, but exited with status $?." >>try.msg
5185 rp="You have a problem. Shall I abort Configure"
5189 echo "I can't compile the test program." >>try.msg
5190 rp="You have a BIG problem. Shall I abort Configure"
5196 case "$knowitall" in
5198 echo "(The supplied flags or libraries might be incorrect.)"
5206 *) echo "Ok. Stopping Configure." >&4
5211 n) echo "OK, that should do.";;
5213 $rm -f try try.* core
5215 : define a shorthand compile call
5219 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5220 : define a shorthand compile call for compilations that should be ok.
5224 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5226 : determine filename position in cpp output
5228 echo "Computing filename position in cpp output for #include directives..." >&4
5230 vos) testaccess=-e ;;
5233 echo '#include <stdio.h>' > foo.c
5236 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5237 $grep '^[ ]*#.*stdio\.h' | \
5238 while read cline; do
5241 while $test \$# -gt 0; do
5242 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5247 pos=\`expr \$pos + 1\`
5259 *) pos="${fieldn}th";;
5261 echo "Your cpp writes the filename in the $pos field of the line."
5264 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
5265 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
5268 : locate header file
5273 for usrincdir in $usrinc
5275 if test -f \$usrincdir/\$wanted; then
5276 echo "\$usrincdir/\$wanted"
5280 awkprg='{ print \$$fieldn }'
5281 echo "#include <\$wanted>" > foo\$\$.c
5282 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5283 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5284 while read cline; do
5285 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5287 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5288 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5293 # status = 0: grep returned 0 lines, case statement not executed
5294 # status = 1: headerfile found
5295 # status = 2: while loop executed, no headerfile found
5299 if test \$status -eq 1; then
5306 : define an alternate in-header-list? function
5307 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5308 cont=true; xxf="echo \"<\$1> found.\" >&4";
5309 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5310 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5312 case $# in 4) instead=instead;; *) instead="at last";; esac;
5313 while $test "$cont"; do
5315 var=$2; eval "was=\$$2";
5316 if $test "$xxx" && $test -r "$xxx";
5318 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5321 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5322 set $yyy; shift; shift; yyy=$@;
5323 case $# in 0) cont="";;
5324 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5325 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5326 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5327 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5331 do set $yyy; var=$2; eval "was=\$$2";
5332 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5333 set $yyy; shift; shift; yyy=$@;
5336 : see if stdlib is available
5337 set stdlib.h i_stdlib
5340 : check for lengths of integral types
5344 echo "Checking to see how big your integers are..." >&4
5353 printf("intsize=%d;\n", (int)sizeof(int));
5354 printf("longsize=%d;\n", (int)sizeof(long));
5355 printf("shortsize=%d;\n", (int)sizeof(short));
5360 if eval $compile_ok && $run ./try > /dev/null; then
5362 echo "Your integers are $intsize bytes long."
5363 echo "Your long integers are $longsize bytes long."
5364 echo "Your short integers are $shortsize bytes long."
5368 Help! I can't compile and run the intsize test program: please enlighten me!
5369 (This is probably a misconfiguration in your system or libraries, and
5370 you really ought to fix it. Still, I'll try anyway.)
5374 rp="What is the size of an integer (in bytes)?"
5378 rp="What is the size of a long integer (in bytes)?"
5382 rp="What is the size of a short integer (in bytes)?"
5390 : check for long long
5392 echo "Checking to see if you have long long..." >&4
5393 echo 'int main() { long long x = 7; return 0; }' > try.c
5395 if eval $compile; then
5397 echo "You have long long."
5400 echo "You do not have long long."
5406 : check for length of long long
5407 case "${d_longlong}${longlongsize}" in
5410 echo "Checking to see how big your long longs are..." >&4
5411 $cat >try.c <<'EOCP'
5415 printf("%d\n", (int)sizeof(long long));
5420 if eval $compile_ok; then
5421 longlongsize=`$run ./try`
5422 echo "Your long longs are $longlongsize bytes long."
5426 echo "(I can't seem to compile the test program. Guessing...)"
5427 rp="What is the size of a long long (in bytes)?"
5431 if $test "X$longsize" = "X$longlongsize"; then
5432 echo "(That isn't any different from an ordinary long.)"
5438 : see if inttypes.h is available
5439 : we want a real compile instead of Inhdr because some systems
5440 : have an inttypes.h which includes non-existent headers
5443 #include <inttypes.h>
5445 static int32_t foo32 = 0x12345678;
5449 if eval $compile; then
5450 echo "<inttypes.h> found." >&4
5453 echo "<inttypes.h> NOT found." >&4
5462 echo "Checking to see if you have int64_t..." >&4
5464 #include <sys/types.h>
5465 #$i_inttypes I_INTTYPES
5467 #include <inttypes.h>
5469 int main() { int64_t x = 7; }
5472 if eval $compile; then
5474 echo "You have int64_t."
5477 echo "You do not have int64_t."
5485 echo "Checking which 64-bit integer type we could use..." >&4
5491 val='"unsigned int"'
5496 *) case "$longsize" in
5500 val='"unsigned long"'
5505 *) case "$d_longlong:$longlongsize" in
5510 val='"unsigned long long"'
5515 *) case "$d_int64_t" in
5534 '') echo "Alas, no 64-bit integer types in sight." >&4
5537 *) echo "We could use '$quadtype' for 64-bit integers." >&4
5543 case "$uselonglong" in
5544 "$define"|true|[yY]*)
5547 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
5549 use64bitint="$define"
5552 case "$use64bits" in
5553 "$define"|true|[yY]*)
5556 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
5558 use64bitint="$define"
5561 case "$use64bitints" in
5562 "$define"|true|[yY]*)
5565 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
5567 use64bitint="$define"
5570 case "$use64bitsint" in
5571 "$define"|true|[yY]*)
5574 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
5576 use64bitint="$define"
5579 case "$uselonglongs" in
5580 "$define"|true|[yY]*)
5583 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
5585 use64bitint="$define"
5588 case "$use64bitsall" in
5589 "$define"|true|[yY]*)
5592 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
5594 use64bitall="$define"
5599 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
5601 case "$use64bitall" in
5602 "$define"|true|[yY]*) use64bitint="$define" ;;
5608 You have natively 64-bit long integers.
5612 *) case "$use64bitint" in
5613 "$define"|true|[yY]*) dflt='y';;
5622 Perl can be built to take advantage of 64-bit integer types
5623 on some systems. To do so, Configure can be run with -Duse64bitint.
5624 Choosing this option will most probably introduce binary incompatibilities.
5626 If this doesn't make any sense to you, just accept the default '$dflt'.
5627 (The default has been chosen based on your configuration.)
5629 rp='Try to use 64-bit integers, if available?'
5632 [yY]*) val="$define" ;;
5640 case "$use64bitall" in
5641 "$define"|true|[yY]*) dflt='y' ;;
5642 *) case "$longsize" in
5650 You may also choose to try maximal 64-bitness. It means using as much
5651 64-bitness as possible on the platform. This in turn means even more
5652 binary incompatibilities. On the other hand, your platform may not
5653 have any more 64-bitness available than what you already have chosen.
5655 If this doesn't make any sense to you, just accept the default '$dflt'.
5656 (The default has been chosen based on your configuration.)
5658 rp='Try to use maximal 64-bit support, if available?'
5661 [yY]*) val="$define" ;;
5666 case "$use64bitall" in
5668 case "$use64bitint" in
5672 Since you have chosen a maximally 64-bit build, I'm also turning on
5673 the use of 64-bit integers.
5675 use64bitint="$define" ;;
5680 : Look for a hint-file generated 'call-back-unit'. If the
5681 : user has specified that a 64-bit perl is to be built,
5682 : we may need to set or change some other defaults.
5683 if $test -f use64bitint.cbu; then
5684 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
5687 case "$use64bitint" in
5688 "$define"|true|[yY]*)
5690 4) case "$archname64" in
5691 '') archname64=64int ;;
5698 : Look for a hint-file generated 'call-back-unit'. If the
5699 : user has specified that a maximally 64-bit perl is to be built,
5700 : we may need to set or change some other defaults.
5701 if $test -f use64bitall.cbu; then
5702 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
5705 case "$use64bitall" in
5706 "$define"|true|[yY]*)
5708 4) case "$archname64" in
5709 ''|64int) archname64=64all ;;
5716 case "$d_quad:$use64bitint" in
5720 *** You have chosen to use 64-bit integers,
5721 *** but none can be found.
5722 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
5723 *** Cannot continue, aborting.
5730 : check for length of double
5732 case "$doublesize" in
5734 echo "Checking to see how big your double precision numbers are..." >&4
5743 printf("%d\n", (int)sizeof(double));
5748 if eval $compile_ok; then
5749 doublesize=`$run ./try`
5750 echo "Your double is $doublesize bytes long."
5753 echo "(I can't seem to compile the test program. Guessing...)"
5754 rp="What is the size of a double precision number (in bytes)?"
5762 : check for long doubles
5764 echo "Checking to see if you have long double..." >&4
5765 echo 'int main() { long double x = 7.0; }' > try.c
5767 if eval $compile; then
5769 echo "You have long double."
5772 echo "You do not have long double."
5778 : check for length of long double
5779 case "${d_longdbl}${longdblsize}" in
5782 echo "Checking to see how big your long doubles are..." >&4
5783 $cat >try.c <<'EOCP'
5787 printf("%d\n", sizeof(long double));
5792 if eval $compile; then
5793 longdblsize=`$run ./try`
5794 echo "Your long doubles are $longdblsize bytes long."
5798 echo "(I can't seem to compile the test program. Guessing...)" >&4
5799 rp="What is the size of a long double (in bytes)?"
5803 if $test "X$doublesize" = "X$longdblsize"; then
5804 echo "That isn't any different from an ordinary double."
5805 echo "I'll keep your setting anyway, but you may see some"
5806 echo "harmless compilation warnings."
5812 : determine the architecture name
5814 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
5815 tarch=`arch`"-$osname"
5816 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
5817 if uname -m > tmparch 2>&1 ; then
5818 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
5819 -e 's/$/'"-$osname/" tmparch`
5827 case "$myarchname" in
5830 echo "(Your architecture name used to be $myarchname.)"
5834 case "$targetarch" in
5836 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
5841 *) dflt="$archname";;
5843 rp='What is your architecture name'
5846 case "$usethreads" in
5848 echo "Threads selected." >&4
5850 *-thread*) echo "...and architecture name already has -thread." >&4
5852 *) archname="$archname-thread"
5853 echo "...setting architecture name to $archname." >&4
5858 case "$usemultiplicity" in
5860 echo "Multiplicity selected." >&4
5862 *-multi*) echo "...and architecture name already has -multi." >&4
5864 *) archname="$archname-multi"
5865 echo "...setting architecture name to $archname." >&4
5870 case "$use64bitint$use64bitall" in
5872 case "$archname64" in
5874 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
5877 case "$use64bitint" in
5878 "$define") echo "64 bit integers selected." >&4 ;;
5880 case "$use64bitall" in
5881 "$define") echo "Maximal 64 bitness selected." >&4 ;;
5884 *-$archname64*) echo "...and architecture name already has $archname64." >&4
5886 *) archname="$archname-$archname64"
5887 echo "...setting architecture name to $archname." >&4
5893 case "$uselongdouble" in
5895 echo "Long doubles selected." >&4
5896 case "$longdblsize" in
5898 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
5902 *-ld*) echo "...and architecture name already has -ld." >&4
5904 *) archname="$archname-ld"
5905 echo "...setting architecture name to $archname." >&4
5912 case "$useperlio" in
5914 echo "Perlio selected." >&4
5917 echo "Perlio not selected, using stdio." >&4
5919 *-stdio*) echo "...and architecture name already has -stdio." >&4
5921 *) archname="$archname-stdio"
5922 echo "...setting architecture name to $archname." >&4
5927 if $test -f archname.cbu; then
5928 echo "Your platform has some specific hints for architecture name, using them..."
5932 : set the prefixit variable, to compute a suitable default value
5933 prefixit='case "$3" in
5935 case "$oldprefix" in
5936 "") eval "$1=\"\$$2\"";;
5943 ""|" ") eval "$1=\"\$$2\"";;
5949 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
5951 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
5952 /*-$oldprefix/*|\~*-$oldprefix/*)
5953 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
5954 *) eval "$1=\"\$$2\"";;
5958 : get the patchlevel
5960 echo "Getting the current patchlevel..." >&4
5961 if $test -r $rsrc/patchlevel.h;then
5962 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
5963 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
5964 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
5965 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
5966 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
5967 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
5968 perl_patchlevel=`egrep 'define PERL_PATCHNUM [0-9][0-9]|,"MAINT[0-9][0-9]*"' $rsrc/patchlevel.h|sed 's/[^0-9]//g'`
5977 $echo "(You do not have patchlevel.h. Eek.)"
5979 if $test -r $rsrc/.patch ; then
5980 if $test "X$perl_patchlevel" = "X" || $test "`cat $rsrc/.patch`" -gt "$perl_patchlevel" ; then
5981 perl_patchlevel=`cat $rsrc/.patch`
5984 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
5985 version_patchlevel_string="version $patchlevel subversion $subversion"
5986 case "$perl_patchlevel" in
5988 *) version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel" ;;
5991 $echo "(You have $package $version_patchlevel_string.)"
5995 : XXX Should be a Configure test for double-dots in filenames.
5996 version=`echo $revision $patchlevel $subversion | \
5997 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
5998 api_versionstring=`echo $api_revision $api_version $api_subversion | \
5999 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
6002 version=`echo $revision $patchlevel $subversion | \
6003 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
6004 api_versionstring=`echo $api_revision $api_version $api_subversion | \
6005 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
6008 : Special case the 5.005_xx maintenance series, which used 5.005
6009 : without any subversion label as a subdirectory in $sitelib
6010 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
6011 api_versionstring='5.005'
6014 : determine installation style
6015 : For now, try to deduce it from prefix unless it is already set.
6016 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
6017 case "$installstyle" in
6018 '') case "$prefix" in
6019 *perl*) dflt='lib';;
6020 *) dflt='lib/perl5' ;;
6023 *) dflt="$installstyle" ;;
6025 : Probably not worth prompting for this since we prompt for all
6026 : the directories individually, and the prompt would be too long and
6030 : determine where public executables go
6035 rp='Pathname where the public executables will reside?'
6037 if $test "X$ansexp" != "X$binexp"; then
6041 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
6042 : XXX If this is fixed, also fix the "start perl" hunk below, which relies on
6043 : this via initialinstalllocation
6046 case "$userelocatableinc" in
6047 $define|true|[yY]*) dflt='y' ;;
6052 Would you like to build Perl so that the installation is relocatable, so that
6053 library paths in @INC are determined relative to the path of the perl binary?
6054 This is not advised for system Perl installs, or if you need to run setid
6055 scripts or scripts under taint mode.
6057 If this doesn't make any sense to you, just accept the default '$dflt'.
6059 rp='Use relocatable @INC?'
6062 y|Y) val="$define" ;;
6065 set userelocatableinc
6068 initialinstalllocation="$binexp"
6069 : Default prefix is now "up one level from where the binaries are"
6070 case "$userelocatableinc" in
6076 installprefixexp=".../.."
6080 : determine where private library files go
6081 : Usual default is /usr/local/lib/perl5/$version.
6082 : Also allow things like /opt/perl/lib/$version, since
6083 : /opt/perl/lib/perl5... would be redundant.
6084 : The default "style" setting is made in installstyle.U
6085 case "$installstyle" in
6086 *lib/perl5*) set dflt privlib lib/$package/$version ;;
6087 *) set dflt privlib lib/$version ;;
6092 There are some auxiliary files for $package that need to be put into a
6093 private library directory that is accessible by everyone.
6098 rp='Pathname where the private library files will reside?'
6103 : set the prefixup variable, to restore leading tilda escape
6104 prefixup='case "$prefixexp" in
6106 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
6109 : determine where public architecture dependent libraries go
6112 : privlib default is /usr/local/lib/$package/$version
6113 : archlib default is /usr/local/lib/$package/$version/$archname
6114 : privlib may have an optional trailing /share.
6115 tdflt=`echo $privlib | $sed 's,/share$,,'`
6116 tdflt=$tdflt/$archname
6125 $spackage contains architecture-dependent library files. If you are
6126 sharing libraries in a heterogeneous environment, you might store
6127 these files in a separate location. Otherwise, you can just include
6128 them with the rest of the public library files.
6133 rp='Where do you want to put the public architecture-dependent libraries?'
6137 if $test X"$archlib" = X"$privlib"; then
6143 : see if setuid scripts can be secure
6146 Some kernels have a bug that prevents setuid #! scripts from being
6147 secure. Some sites have disabled setuid #! scripts because of this.
6149 First let's decide if your kernel supports secure setuid #! scripts.
6150 (If setuid #! scripts would be secure but have been disabled anyway,
6151 don't say that they are secure if asked.)
6156 if $test -d /dev/fd; then
6157 echo "#!$ls" >reflect
6158 chmod +x,u+s reflect
6159 ./reflect >flect 2>&1
6160 if $contains "/dev/fd" flect >/dev/null; then
6161 echo "Congratulations, your kernel has secure setuid scripts!" >&4
6165 If you are not sure if they are secure, I can check but I'll need a
6166 username and password different from the one you are using right now.
6167 If you don't have such a username or don't want me to test, simply
6171 rp='Other username to test security of setuid scripts with?'
6176 case "$d_suidsafe" in
6177 '') echo "I'll assume setuid scripts are *not* secure." >&4
6180 echo "Well, the $hint value is *not* secure." >&4
6182 *) echo "Well, the $hint value *is* secure." >&4
6187 $rm -f reflect flect
6188 echo "#!$ls" >reflect
6189 chmod +x,u+s reflect
6192 echo '"su" will (probably) prompt you for '"$ans's password."
6193 su $ans -c './reflect >flect'
6194 if $contains "/dev/fd" flect >/dev/null; then
6195 echo "Okay, it looks like setuid scripts are secure." >&4
6198 echo "I don't think setuid scripts are secure." >&4
6203 rp='Does your kernel have *secure* setuid scripts?'
6206 [yY]*) val="$define";;
6211 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
6212 echo "(That's for file descriptors, not floppy disks.)"
6218 $rm -f reflect flect
6220 : now see if they want to do setuid emulation
6223 case "$d_suidsafe" in
6226 echo "No need to emulate SUID scripts since they are secure here." >&4
6230 Some systems have disabled setuid scripts, especially systems where
6231 setuid scripts cannot be secure. On systems where setuid scripts have
6232 been disabled, the setuid/setgid bits on scripts are currently
6233 useless. It is possible for $package to detect those bits and emulate
6234 setuid/setgid in a secure fashion. This emulation will only work if
6235 setuid scripts have been disabled in your kernel.
6239 "$define") dflt=y ;;
6242 rp="Do you want to do setuid/setgid emulation?"
6245 [yY]*) val="$define";;
6253 : Find perl5.005 or later.
6254 echo "Looking for a previously installed perl5.005 or later... "
6256 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
6257 : Check if this perl is recent and can load a simple module
6258 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6261 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6271 '') echo "None found. That's ok.";;
6272 *) echo "Using $perl5." ;;
6277 After $package is installed, you may wish to install various
6278 add-on modules and utilities. Typically, these add-ons will
6279 be installed under $prefix with the rest
6280 of this package. However, you may wish to install such add-ons
6281 elsewhere under a different prefix.
6283 If you do not wish to put everything under a single prefix, that's
6284 ok. You will be prompted for the individual locations; this siteprefix
6285 is only used to suggest the defaults.
6287 The default should be fine for most people.
6291 rp='Installation prefix to use for add-on modules and utilities?'
6292 : XXX Here might be another good place for an installstyle setting.
6293 case "$siteprefix" in
6295 *) dflt=$siteprefix ;;
6298 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6300 case "$siteprefix" in
6304 *) oldsiteprefix="$prefix";;
6309 siteprefixexp="$ansexp"
6311 : determine where site specific libraries go.
6312 : Usual default is /usr/local/lib/perl5/site_perl/$version
6313 : The default "style" setting is made in installstyle.U
6314 : XXX No longer works with Prefixit stuff.
6315 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6317 '') case "$installstyle" in
6318 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
6319 *) dflt=$siteprefix/lib/site_$prog/$version ;;
6327 The installation process will create a directory for
6328 site-specific extensions and modules. Most users find it convenient
6329 to place all site-specific files in this directory rather than in the
6330 main distribution directory.
6334 rp='Pathname for the site-specific library files?'
6338 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6340 : Determine list of previous versions to include in @INC
6341 $cat > getverlist <<EOPL
6344 \$api_versionstring = "$api_versionstring";
6345 \$version = "$version";
6346 \$stem = "$sitelib_stem";
6347 \$archname = "$archname";
6349 $cat >> getverlist <<'EOPL'
6350 # The list found is store twice for each entry: the original name, and
6351 # the binary broken down version as pack "sss", so sorting is easy and
6352 # unambiguous. This will work for all versions that have a maximum of
6353 # three digit groups, separate by '.'s or '_'s. Names are extended with
6354 # ".0.0" to ensure at least three elements for the pack.
6355 # -- H.Merijn Brand (m)'06 23-10-2006
6357 # Can't have leading @ because metaconfig interprets it as a command!
6358 ;@inc_version_list=();
6359 # XXX Redo to do opendir/readdir?
6362 ;@candidates = map {
6363 [ $_, pack "sss", split m/[._]/, "$_.0.0" ] } glob("5.*");
6369 ($pversion, $aversion, $vsn5005) = map {
6370 pack "sss", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005";
6371 foreach $d (@candidates) {
6372 if ($d->[1] lt $pversion) {
6373 if ($d->[1] ge $aversion) {
6374 unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]);
6376 elsif ($d->[1] ge $vsn5005) {
6377 unshift(@inc_version_list, grep { -d } $d->[0]);
6381 # Skip newer version. I.e. don't look in
6382 # 5.7.0 if we're installing 5.6.1.
6386 if (@inc_version_list) {
6387 print join(' ', @inc_version_list);
6390 # Blank space to preserve value for next Configure run.
6395 case "$inc_version_list" in
6396 '') if test -x "$perl5$exe_ext"; then
6397 dflt=`$perl5 getverlist`
6402 $undef) dflt='none' ;;
6403 *) eval dflt=\"$inc_version_list\" ;;
6406 ''|' ') dflt=none ;;
6413 In order to ease the process of upgrading, this version of perl
6414 can be configured to use modules built and installed with earlier
6415 versions of perl that were installed under $prefix. Specify here
6416 the list of earlier versions that this version of perl should check.
6417 If Configure detected no earlier versions of perl installed under
6418 $prefix, then the list will be empty. Answer 'none' to tell perl
6419 to not search earlier versions.
6421 The default should almost always be sensible, so if you're not sure,
6422 just accept the default.
6425 rp='List of earlier versions to include in @INC?'
6428 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
6429 *) inc_version_list="$ans" ;;
6431 case "$inc_version_list" in
6433 inc_version_list_init='0'
6434 d_inc_version_list="$undef"
6436 *) inc_version_list_init=`echo $inc_version_list |
6437 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
6438 d_inc_version_list="$define"
6443 : see if this is a malloc.h system
6444 : we want a real compile instead of Inhdr because some systems have a
6445 : malloc.h that just gives a compile error saying to use stdlib.h instead
6450 int main () { return 0; }
6453 if eval $compile; then
6454 echo "<malloc.h> found." >&4
6457 echo "<malloc.h> NOT found." >&4
6464 : check for void type
6466 echo "Checking to see how well your C compiler groks the void type..." >&4
6467 case "$voidflags" in
6479 extern void moo(); /* function returning void */
6480 void (*goo)(); /* ptr to func returning void */
6482 void *hue; /* generic ptr */
6495 int main() { sub(); }
6497 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
6498 voidflags=$defvoidused
6499 echo "Good. It appears to support void to the level $package wants.">&4
6500 if $contains warning .out >/dev/null 2>&1; then
6501 echo "However, you might get some warnings that look like this:"
6505 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
6506 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
6507 echo "It supports 1..."
6508 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
6509 echo "It also supports 2..."
6510 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
6512 echo "And it supports 4 but not 8 definitely."
6514 echo "It doesn't support 4..."
6515 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
6517 echo "But it supports 8."
6520 echo "Neither does it support 8."
6524 echo "It does not support 2..."
6525 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
6527 echo "But it supports 4 and 8."
6529 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
6531 echo "And it supports 4 but has not heard about 8."
6533 echo "However it supports 8 but not 4."
6538 echo "There is no support at all for void."
6543 case "$voidflags" in
6546 Support flag bits are:
6547 1: basic void declarations.
6548 2: arrays of pointers to functions returning void.
6549 4: operations between pointers to and addresses of void functions.
6550 8: generic void pointers.
6553 rp="Your void support flags add up to what?"
6560 : check for length of pointer
6564 echo "Checking to see how big your pointers are..." >&4
6565 if test "$voidflags" -gt 7; then
6566 echo '#define VOID_PTR char *' > try.c
6568 echo '#define VOID_PTR void *' > try.c
6578 printf("%d\n", (int)sizeof(VOID_PTR));
6583 if eval $compile_ok; then
6584 ptrsize=`$run ./try`
6585 echo "Your pointers are $ptrsize bytes long."
6588 echo "(I can't seem to compile the test program. Guessing...)" >&4
6589 rp="What is the size of a pointer (in bytes)?"
6596 case "$use64bitall" in
6597 "$define"|true|[yY]*)
6601 *** You have chosen a maximally 64-bit build,
6602 *** but your pointers are only 4 bytes wide.
6603 *** Please rerun Configure without -Duse64bitall.
6608 *** Since you have quads, you could possibly try with -Duse64bitint.
6613 *** Cannot continue, aborting.
6624 : determine whether to use malloc wrapping
6626 case "$usemallocwrap" in
6627 [yY]*|true|$define) dflt='y' ;;
6628 [nN]*|false|$undef) dflt='n' ;;
6629 *) case "$usedevel" in
6630 [yY]*|true|$define) dflt='y' ;;
6635 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
6637 usemallocwrap="$ans"
6640 usemallocwrap="$define" ;;
6642 usemallocwrap="$undef" ;;
6645 : determine which malloc to compile in
6647 case "$usemymalloc" in
6648 [yY]*|true|$define) dflt='y' ;;
6649 [nN]*|false|$undef) dflt='n' ;;
6650 *) case "$ptrsize" in
6656 rp="Do you wish to attempt to use the malloc that comes with $package?"
6662 mallocsrc='malloc.c'
6663 mallocobj="malloc$_o"
6664 d_mymalloc="$define"
6667 : Remove malloc from list of libraries to use
6668 echo "Removing unneeded -lmalloc from library list" >&4
6669 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
6672 echo "libs = $libs" >&4
6684 : compute the return types of malloc and free
6686 $cat >malloc.c <<END
6690 #include <sys/types.h>
6704 case "$malloctype" in
6706 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
6713 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
6717 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
6724 echo "Your system uses $freetype free(), it would seem." >&4
6726 : determine where site specific architecture-dependent libraries go.
6727 : sitelib default is /usr/local/lib/perl5/site_perl/$version
6728 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6729 : sitelib may have an optional trailing /share.
6731 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
6732 dflt="$dflt/$archname"
6737 set sitearch sitearch none
6741 The installation process will also create a directory for
6742 architecture-dependent site-specific extensions and modules.
6746 rp='Pathname for the site-specific architecture-dependent library files?'
6750 if $test X"$sitearch" = X"$sitelib"; then
6753 d_sitearch="$define"
6758 The installation process will also create a directory for
6759 vendor-supplied add-ons. Vendors who supply perl with their system
6760 may find it convenient to place all vendor-supplied files in this
6761 directory rather than in the main distribution directory. This will
6762 ease upgrades between binary-compatible maintenance versions of perl.
6764 Of course you may also use these directories in whatever way you see
6765 fit. For example, you might use them to access modules shared over a
6766 company-wide network.
6768 The default answer should be fine for most people.
6769 This causes further questions about vendor add-ons to be skipped
6770 and no vendor-specific directories will be configured for perl.
6773 rp='Do you want to configure vendor-specific add-on directories?'
6774 case "$usevendorprefix" in
6775 define|true|[yY]*) dflt=y ;;
6776 *) : User may have set vendorprefix directly on Configure command line.
6777 case "$vendorprefix" in
6786 rp='Installation prefix to use for vendor-supplied add-ons?'
6787 case "$vendorprefix" in
6789 *) dflt=$vendorprefix ;;
6792 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6794 case "$vendorprefix" in
6798 *) oldvendorprefix="$prefix";;
6802 usevendorprefix="$define"
6804 vendorprefixexp="$ansexp"
6806 *) usevendorprefix="$undef"
6812 case "$vendorprefix" in
6813 '') d_vendorlib="$undef"
6817 *) d_vendorlib="$define"
6818 : determine where vendor-supplied modules go.
6819 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
6820 case "$vendorlib" in
6822 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6823 case "$installstyle" in
6824 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
6825 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
6828 *) dflt="$vendorlib"
6832 rp='Pathname for the vendor-supplied library files?'
6835 vendorlibexp="$ansexp"
6838 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
6842 case "$vendorprefix" in
6843 '') d_vendorarch="$undef"
6847 *) d_vendorarch="$define"
6848 : determine where vendor-supplied architecture-dependent libraries go.
6849 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
6850 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
6851 : vendorlib may have an optional trailing /share.
6852 case "$vendorarch" in
6853 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
6854 dflt="$dflt/$archname"
6856 *) dflt="$vendorarch" ;;
6859 rp='Pathname for vendor-supplied architecture-dependent files?'
6862 vendorarchexp="$ansexp"
6865 prefixvar=vendorarch
6868 : Final catch-all directories to search
6871 Lastly, you can have perl look in other directories for extensions and
6872 modules in addition to those already specified.
6873 These directories will be searched after
6877 test X"$vendorlib" != "X" && echo ' ' $vendorlib
6878 test X"$vendorarch" != "X" && echo ' ' $vendorarch
6880 case "$otherlibdirs" in
6881 ''|' ') dflt='none' ;;
6882 *) dflt="$otherlibdirs" ;;
6885 Enter a colon-separated set of extra paths to include in perl's @INC
6886 search path, or enter 'none' for no extra paths.
6890 rp='Colon-separated list of additional directories for perl to search?'
6893 ' '|''|none) otherlibdirs=' ' ;;
6894 *) otherlibdirs="$ans" ;;
6896 case "$otherlibdirs" in
6900 set d_perl_otherlibdirs
6903 : Cruising for prototypes
6905 echo "Checking out function prototypes..." >&4
6906 $cat >prototype.c <<EOCP
6911 int main(int argc, char *argv[]) {
6914 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
6915 echo "Your C compiler appears to support function prototypes."
6918 echo "Your C compiler doesn't seem to understand function prototypes."
6925 case "$prototype" in
6927 *) ansi2knr='ansi2knr'
6932 This version of $package can only be compiled by a compiler that
6933 understands function prototypes. Unfortunately, your C compiler
6935 doesn't seem to understand them. Sorry about that.
6937 If GNU cc is available for your system, perhaps you could try that instead.
6939 Eventually, we hope to support building Perl with pre-ANSI compilers.
6940 If you would like to help in that effort, please contact <perlbug@perl.org>.
6942 Aborting Configure now.
6954 Perl can be built with extra modules or bundles of modules which
6955 will be fetched from the CPAN and installed alongside Perl.
6957 Notice that you will need access to the CPAN; either via the Internet,
6958 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
6959 be asked later to configure the CPAN.pm module which will in turn do
6960 the installation of the rest of the extra modules or bundles.)
6962 Notice also that if the modules require any external software such as
6963 libraries and headers (the libz library and the zlib.h header for the
6964 Compress::Zlib module, for example) you MUST have any such software
6965 already installed, this configuration process will NOT install such
6968 If this doesn't make any sense to you, just accept the default '$dflt'.
6970 rp='Install any extra modules (y or n)?'
6976 Please list any extra modules or bundles to be installed from CPAN,
6977 with spaces between the names. The names can be in any format the
6978 'install' command of CPAN.pm will understand. (Answer 'none',
6979 without the quotes, to install no extra modules or bundles.)
6989 $rm -f ../extras.lst
6991 *) echo "(Saving the list of extras for later...)"
6992 echo "$extras" > ../extras.lst
7000 : determine where html pages for programs go
7001 set html1dir html1dir none
7005 If you wish to install html files for programs in $spackage, indicate
7006 the appropriate directory here. To skip installing html files,
7010 ''|none|$undef|' ') dflt=none ;;
7011 *) dflt=$html1dir ;;
7014 rp="Directory for the main $spackage html pages?"
7018 : Use ' ' for none so value is preserved next time through Configure
7019 $test X"$html1dir" = "X" && html1dir=' '
7021 : determine where html pages for libraries and modules go
7022 set html3dir html3dir none
7026 If you wish to install html files for modules associated with $spackage,
7027 indicate the appropriate directory here. To skip installing html files,
7030 : There is no obvious default. If they have specified html1dir, then
7031 : try to key off that, possibly changing .../html1 into .../html3.
7033 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
7034 *) dflt=$html3dir ;;
7037 rp="Directory for the $spackage module html pages?"
7041 : Use ' ' for none so value is preserved next time through Configure
7042 $test X"$html3dir" = "X" && html3dir=' '
7044 : determine whether to install perl also as /usr/bin/perl
7047 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
7049 Many scripts expect perl to be installed as /usr/bin/perl.
7051 If you want to, I can install the perl you are about to compile
7052 as /usr/bin/perl (in addition to $bin/perl).
7054 if test -f /usr/bin/perl; then
7057 However, please note that because you already have a /usr/bin/perl,
7058 overwriting that with a new Perl would very probably cause problems.
7059 Therefore I'm assuming you don't want to do that (unless you insist).
7062 case "$installusrbinperl" in
7063 "$define"|[yY]*) dflt='y';;
7069 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
7072 case "$installusrbinperl" in
7073 "$undef"|[nN]*) dflt='n';;
7077 rp="Do you want to install perl as /usr/bin/perl?"
7080 [yY]*) val="$define";;
7086 set installusrbinperl
7090 echo "Checking for GNU C Library..." >&4
7092 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
7093 alone are insufficient to distinguish different versions, such as
7094 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
7095 libc version 2.1.0. A. Dougherty, June 3, 2002.
7101 # ifdef __GLIBC_MINOR__
7102 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus)
7103 # include <gnu/libc-version.h>
7104 printf("%s\n", gnu_get_libc_version());
7106 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
7109 printf("%d\n", __GLIBC__);
7118 if eval $compile_ok && $run ./try > glibc.ver; then
7120 gnulibc_version=`$cat glibc.ver`
7121 echo "You are using the GNU C Library version $gnulibc_version"
7125 echo "You are not using the GNU C Library"
7127 $rm -f try try.* glibc.ver
7131 : see if nm is to be used to determine whether a symbol is defined or not
7135 case "$d_gnulibc" in
7138 echo "nm probably won't work on the GNU C Library." >&4
7144 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
7146 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
7147 echo "'nm' won't be sufficient on this sytem." >&4
7153 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
7154 if $test $dflt -gt 20; then
7164 true|$define) dflt=y;;
7171 I can use $nm to extract the symbols from your C libraries. This
7172 is a time consuming task which may generate huge output on the disk (up
7173 to 3 megabytes) but that should make the symbols extraction faster. The
7174 alternative is to skip the 'nm' extraction part and to compile a small
7175 test program instead to determine whether each symbol is present. If
7176 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
7177 this may be the best solution.
7179 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
7182 rp="Shall I use $nm to extract C symbols from the libraries?"
7185 [Nn]*) usenm=false;;
7194 : nm options which may be necessary
7196 '') if $test -f /mach_boot; then
7198 elif $test -d /usr/ccs/lib; then
7199 nm_opt='-p' # Solaris (and SunOS?)
7200 elif $test -f /dgux; then
7202 elif $test -f /lib64/rld; then
7203 nm_opt='-p' # 64-bit Irix
7209 : nm options which may be necessary for shared libraries but illegal
7210 : for archive libraries. Thank you, Linux.
7211 case "$nm_so_opt" in
7212 '') case "$myuname" in
7214 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
7215 nm_so_opt='--dynamic'
7224 : get list of predefined functions in a handy place
7229 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
7235 *) for thislib in $libs; do
7238 : Handle C library specially below.
7241 thislib=`echo $thislib | $sed -e 's/^-l//'`
7242 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
7244 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
7246 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
7248 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
7250 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
7252 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
7254 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
7259 libnames="$libnames $try"
7261 *) libnames="$libnames $thislib" ;;
7270 for xxx in $libpth; do
7271 $test -r $1 || set $xxx/libc.$so
7272 : The messy sed command sorts on library version numbers.
7274 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
7275 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
7277 s/[0-9][0-9]*/0000&/g
7278 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
7281 $sort | $sed -e 's/^.* //'`
7284 $test -r $1 || set /usr/ccs/lib/libc.$so
7285 $test -r $1 || set /lib/libsys_s$_a
7291 if $test -r "$1"; then
7292 echo "Your (shared) C library seems to be in $1."
7294 elif $test -r /lib/libc && $test -r /lib/clib; then
7295 echo "Your C library seems to be in both /lib/clib and /lib/libc."
7297 libc='/lib/clib /lib/libc'
7298 if $test -r /lib/syslib; then
7299 echo "(Your math library is in /lib/syslib.)"
7300 libc="$libc /lib/syslib"
7302 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7303 echo "Your C library seems to be in $libc, as you said before."
7304 elif $test -r $incpath/usr/lib/libc$_a; then
7305 libc=$incpath/usr/lib/libc$_a;
7306 echo "Your C library seems to be in $libc. That's fine."
7307 elif $test -r /lib/libc$_a; then
7309 echo "Your C library seems to be in $libc. You're normal."
7311 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
7313 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
7314 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
7315 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
7317 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7319 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7322 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
7324 if $test -r "$tans"; then
7325 echo "Your C library seems to be in $tans, of all places."
7331 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7335 If the guess above is wrong (which it might be if you're using a strange
7336 compiler, or your machine supports multiple models), you can override it here.
7341 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
7343 I can't seem to find your C library. I've looked in the following places:
7346 $sed 's/^/ /' libpath
7349 None of these seems to contain your C library. I need to get its name...
7354 rp='Where is your C library?'
7359 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
7360 set X `cat libnames`
7363 case $# in 1) xxx=file; esac
7364 echo "Extracting names from the following $xxx for later perusal:" >&4
7366 $sed 's/^/ /' libnames >&4
7368 $echo $n "This may take a while...$c" >&4
7372 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
7373 *) $nm $nm_opt $file 2>/dev/null;;
7378 $grep fprintf libc.tmp > libc.ptf
7379 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
7380 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
7382 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
7384 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7386 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
7388 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7390 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
7392 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7394 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
7396 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7398 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
7400 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7402 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
7404 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7406 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
7407 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
7409 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7411 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
7413 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7415 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
7417 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7419 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
7421 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7423 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
7425 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7427 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
7429 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7431 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
7433 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7435 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
7437 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7440 $nm -p $* 2>/dev/null >libc.tmp
7441 $grep fprintf libc.tmp > libc.ptf
7442 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
7443 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
7449 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
7451 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
7452 for thisname in $libnames $libc; do
7453 $ar t $thisname >>libc.tmp
7455 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
7457 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
7458 # Repeat libc to extract forwarders to DLL entries too
7459 for thisname in $libnames $libc; do
7460 $ar tv $thisname >>libc.tmp
7461 # Revision 50 of EMX has bug in $ar.
7462 # it will not extract forwarders to DLL entries
7463 # Use emximp which will extract exactly them.
7464 emximp -o tmp.imp $thisname \
7466 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
7467 < tmp.imp >>libc.tmp
7470 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
7473 echo "$ar didn't seem to work right." >&4
7474 echo "Maybe this is a Cray...trying bld instead..." >&4
7475 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
7477 for thisname in $libnames; do
7479 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
7480 $ar t $thisname >>libc.tmp
7484 echo "That didn't work either. Giving up." >&4
7494 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
7495 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
7497 *) if $test -f /lib/syscalls.exp; then
7499 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
7500 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' /lib/syscalls.exp >>libc.list
7506 $rm -f libnames libpath
7508 : see if dld is available
7512 : is a C symbol defined?
7515 -v) tf=libc.tmp; tdc="";;
7516 -a) tf=libc.tmp; tdc="[]";;
7517 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
7520 case "$reuseval-$4" in
7522 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
7527 if $test "$runnm" = true; then
7528 if $contains $tlook $tf >/dev/null 2>&1; then
7530 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
7531 echo "void *(*(p()))$tdc { extern void *$1$tdc; return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7532 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
7533 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
7534 $rm -f try$_exe try.c core core.* try.core;
7537 echo "void *(*(p()))$tdc { extern void *$1$tdc; return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7538 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
7539 $rm -f try$_exe try.c;
7544 $define) tval=true;;
7551 : define an is-in-libc? function
7552 inlibc='echo " "; td=$define; tu=$undef;
7553 sym=$1; var=$2; eval "was=\$$2";
7555 case "$reuseval$was" in
7565 echo "$sym() found." >&4;
7566 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
7568 echo "$sym() NOT found." >&4;
7569 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
7573 $define) echo "$sym() found." >&4;;
7574 *) echo "$sym() NOT found." >&4;;
7580 echo "Checking for C++..." >&4
7594 if eval $compile_ok && $run ./try >cplusplus$$; then
7595 val=`$cat cplusplus$$`
7596 echo "You are using a C++ compiler."
7599 echo "You are not using a C++ compiler."
7601 $rm -f try try.* cplusplus$$
7605 : see if dlopen exists
7607 xxx_ccflags="$ccflags"
7609 : with g++ one needs -shared to get is-in-libc to work for dlopen
7610 case "$gccversion" in
7612 *) case "$d_cplusplus" in
7613 "$define") ccflags="$ccflags -shared" ;;
7620 ccflags="$xxx_ccflags"
7622 : see if this is a unistd.h system
7623 set unistd.h i_unistd
7626 : determine which dynamic loading, if any, to compile in
7628 dldir="ext/DynaLoader"
7641 $define) dflt='y' ;;
7644 $define) dflt='y' ;;
7646 : Does a dl_xxx.xs file exist for this operating system
7647 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
7650 rp="Do you wish to use dynamic loading?"
7657 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
7658 dflt="$dldir/dl_${osname}.xs"
7659 elif $test "$d_dlopen" = "$define" ; then
7660 dflt="$dldir/dl_dlopen.xs"
7661 elif $test "$i_dld" = "$define" ; then
7662 dflt="$dldir/dl_dld.xs"
7667 *) dflt="$dldir/$dlsrc"
7670 echo "The following dynamic loading files are available:"
7671 : Can not go over to $dldir because getfile has path hard-coded in.
7672 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
7673 rp="Source file to use for dynamic loading"
7679 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
7683 Some systems may require passing special flags to $cc -c to
7684 compile modules that will be used to create a shared library.
7685 To use no flags, say "none".
7688 case "$cccdlflags" in
7689 '') case "$gccversion" in
7690 '') case "$osname" in
7692 next) dflt='none' ;;
7693 irix*) dflt='-KPIC' ;;
7694 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
7695 sunos) dflt='-pic' ;;
7699 *) case "$osname" in
7700 darwin) dflt='none' ;;
7701 svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
7706 *) dflt="$cccdlflags" ;;
7708 rp="Any special flags to pass to $cc -c to compile shared library modules?"
7711 none) cccdlflags=' ' ;;
7712 *) cccdlflags="$ans" ;;
7717 Some systems use ld to create libraries that can be dynamically loaded,
7718 while other systems (such as those using ELF) use $cc.
7722 '') $cat >try.c <<EOM
7723 /* Test for whether ELF binaries are produced */
7735 int i = open("a.out",O_RDONLY);
7738 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
7739 exit(0); /* succeed (yes, it's ELF) */
7744 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
7746 You appear to have ELF support. I'll use $cc to build dynamic libraries.
7750 echo "I'll use ld to build dynamic libraries."
7759 rp="What command should be used to create dynamic libraries?"
7765 Some systems may require passing special flags to $ld to create a
7766 library that can be dynamically loaded. If your ld flags include
7767 -L/other/path options to locate libraries outside your loader's normal
7768 search path, you may need to specify those -L options here as well. To
7769 use no flags, say "none".
7772 case "$lddlflags" in
7773 '') case "$osname" in
7774 beos) dflt='-nostart' ;;
7776 case "$gccversion" in
7777 '') dflt="$dflt +vnocompatwarnings" ;;
7780 linux|irix*|gnu*) dflt='-shared' ;;
7781 next) dflt='none' ;;
7782 solaris) dflt='-G' ;;
7783 sunos) dflt='-assert nodefinitions' ;;
7784 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
7788 *) dflt="$lddlflags" ;;
7791 : Try to guess additional flags to pick up local libraries.
7792 : Be careful not to append to a plain 'none'
7796 for thisflag in $ldflags; do
7801 *) dflt="$dflt $thisflag" ;;
7808 ''|' ') dflt='none' ;;
7811 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
7814 none) lddlflags=' ' ;;
7815 *) lddlflags="$ans" ;;
7820 Some systems may require passing special flags to $cc to indicate that
7821 the resulting executable will use dynamic linking. To use no flags,
7825 case "$ccdlflags" in
7826 '') case "$osname" in
7827 linux|hpux|gnu*) dflt='-Wl,-E' ;;
7828 next|sunos) dflt='none' ;;
7832 *) dflt="$ccdlflags" ;;
7834 rp="Any special flags to pass to $cc to use dynamic linking?"
7837 none) ccdlflags=' ' ;;
7838 *) ccdlflags="$ans" ;;
7852 # No dynamic loading being used, so don't bother even to prompt.
7855 *) case "$useshrplib" in
7856 '') case "$osname" in
7857 svr4*|nonstopux|dgux|dynixptx|esix|powerux|beos|cygwin*)
7859 also='Building a shared libperl is required for dynamic loading to work on your system.'
7864 also='Building a shared libperl is needed for MAB support.'
7882 The perl executable is normally obtained by linking perlmain.c with
7883 libperl${_a}, any static extensions (usually just DynaLoader), and
7884 any other libraries needed on this system (such as -lm, etc.). Since
7885 your system supports dynamic loading, it is probably possible to build
7886 a shared libperl.$so. If you will have more than one executable linked
7887 to libperl.$so, this will significantly reduce the size of each
7888 executable, but it may have a noticeable effect on performance. The
7889 default is probably sensible for your system.
7893 rp="Build a shared libperl.$so (y/n)"
7897 useshrplib='true' ;;
7898 *) useshrplib='false' ;;
7903 case "$useshrplib" in
7907 # Figure out a good name for libperl.so. Since it gets stored in
7908 # a version-specific architecture-dependent library, the version
7909 # number isn't really that important, except for making cc/ld happy.
7911 # A name such as libperl.so.3.1
7912 majmin="libperl.$so.$patchlevel.$subversion"
7913 # A name such as libperl.so.301
7914 majonly=`echo $patchlevel $subversion |
7915 $awk '{printf "%d%02d", $1, $2}'`
7916 majonly=libperl.$so.$majonly
7917 # I'd prefer to keep the os-specific stuff here to a minimum, and
7918 # rely on figuring it out from the naming of libc.
7919 case "${osname}${osvers}" in
7922 # XXX How handle the --version stuff for MAB?
7924 linux*|gnu*) # ld won't link with a bare -lperl otherwise.
7927 cygwin*) # ld links against an importlib
7928 dflt=libperl$lib_ext
7930 *) # Try to guess based on whether libc has major.minor.
7932 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
7933 *libc.$so.[0-9]*) dflt=$majonly ;;
7934 *) dflt=libperl.$so ;;
7944 I need to select a good name for the shared libperl. If your system uses
7945 library names with major and minor numbers, then you might want something
7946 like $majmin. Alternatively, if your system uses a single version
7947 number for shared libraries, then you might want to use $majonly.
7948 Or, your system might be quite happy with a simple libperl.$so.
7950 Since the shared libperl will get installed into a version-specific
7951 architecture-dependent directory, the version number of the shared perl
7952 library probably isn't important, so the default should be o.k.
7955 rp='What name do you want to give to the shared libperl?'
7958 echo "Ok, I'll use $libperl"
7961 libperl="libperl${_a}"
7965 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
7969 WARNING: Use of the shrpdir variable for the installation location of
7970 the shared $libperl is not supported. It was never documented and
7971 will not work in this version. Let me (perlbug@perl.org)
7972 know of any problems this may cause.
7978 But your current setting of $shrpdir is
7979 the default anyway, so it's harmless.
7984 Further, your current attempted setting of $shrpdir
7985 conflicts with the value of $archlibexp/CORE
7986 that installperl will use.
7993 # How will the perl executable find the installed shared $libperl?
7994 # Add $xxx to ccdlflags.
7995 # If we can't figure out a command-line option, use $shrpenv to
7996 # set env LD_RUN_PATH. The main perl makefile uses this.
7997 shrpdir=$archlibexp/CORE
8000 if "$useshrplib"; then
8003 # We'll set it in Makefile.SH...
8008 freebsd|netbsd|openbsd|interix|dragonfly)
8009 xxx="-Wl,-R$shrpdir"
8011 bsdos|linux|irix*|dec_osf|gnu*)
8012 xxx="-Wl,-rpath,$shrpdir"
8015 # next doesn't like the default...
8018 # beos doesn't like the default, either.
8021 # hpux doesn't like the default, either.
8022 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
8025 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
8031 # Only add $xxx if it isn't already in ccdlflags.
8032 case " $ccdlflags " in
8034 *) ccdlflags="$ccdlflags $xxx"
8037 Adding $xxx to the flags
8038 passed to $ld so that the perl executable will find the
8039 installed shared $libperl.
8047 # Fix ccdlflags in AIX for building external extensions.
8048 # (For building Perl itself bare -bE:perl.exp is needed,
8049 # Makefile.SH takes care of this.)
8051 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8053 # Respect a hint or command-line value.
8055 '') shrpenv="$tmp_shrpenv" ;;
8057 case "$ldlibpthname" in
8058 '') ldlibpthname=LD_LIBRARY_PATH ;;
8059 none) ldlibpthname='' ;;
8062 : determine where manual pages are on this system
8066 syspath='/usr/share/man/man1 /usr/man/man1'
8067 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8068 syspath="$syspath /usr/man/u_man/man1"
8069 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8070 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8071 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8072 sysman=`./loc . /usr/man/man1 $syspath`
8075 if $test -d "$sysman"; then
8076 echo "System manual is in $sysman." >&4
8078 echo "Could not find manual pages in source form." >&4
8081 : determine where manual pages go
8082 set man1dir man1dir none
8086 $spackage has manual pages available in source form.
8090 echo "However, you don't have nroff, so they're probably useless to you."
8092 '') man1dir="none";;
8095 echo "If you don't want the manual sources installed, answer 'none'."
8100 lookpath="$prefixexp/share/man/man1"
8101 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8102 lookpath="$lookpath $prefixexp/man/p_man/man1"
8103 lookpath="$lookpath $prefixexp/man/u_man/man1"
8104 lookpath="$lookpath $prefixexp/man/man.1"
8106 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8107 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8117 rp="Where do the main $spackage manual pages (source) go?"
8119 if $test "X$man1direxp" != "X$ansexp"; then
8130 : What suffix to use on installed man pages
8137 rp="What suffix should be used for the main $spackage man pages?"
8139 '') case "$man1dir" in
8153 *) dflt="$man1ext";;
8160 : see if we can have long filenames
8162 first=123456789abcdef
8164 if (echo hi >$first) 2>/dev/null; then
8165 if $test -f 123456789abcde; then
8166 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8169 echo 'You can have filenames longer than 14 characters.'>&4
8174 You can't have filenames longer than 14 chars.
8175 You can't even think about them!
8181 $rm -rf 123456789abcde*
8183 : determine where library module manual pages go
8184 set man3dir man3dir none
8188 $spackage has manual pages for many of the library modules.
8194 However, you don't have nroff, so they're probably useless to you.
8197 '') man3dir="none";;
8201 case "$d_flexfnam" in
8204 However, your system can't handle the long file names like File::Basename.3.
8207 '') man3dir="none";;
8211 echo "If you don't want the manual sources installed, answer 'none'."
8212 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8214 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
8215 if $test -d "$privlib/man/man3"; then
8218 WARNING: Previous versions of perl installed man3 pages into
8219 $privlib/man/man3. This version will suggest a
8220 new default of $dflt.
8224 rp='Do you wish to preserve the old behavior?(y/n)'
8227 y*) dflt="$privlib/man/man3" ;;
8232 *) dflt="$man3dir" ;;
8239 rp="Where do the $package library man pages (source) go?"
8249 : What suffix to use on installed man pages
8255 rp="What suffix should be used for the $package library man pages?"
8257 '') case "$man3dir" in
8271 *) dflt="$man3ext";;
8278 : see if we have to deal with yellow pages, now NIS.
8279 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
8280 if $test -f /usr/etc/nibindd; then
8282 echo "I'm fairly confident you're on a NeXT."
8284 rp='Do you get the hosts file via NetInfo?'
8293 y*) hostcat='nidump hosts .';;
8294 *) case "$hostcat" in
8295 nidump*) hostcat='';;
8305 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
8313 rp='Are you getting the hosts file via yellow pages?'
8316 y*) hostcat='ypcat hosts';;
8317 *) hostcat='cat /etc/hosts';;
8323 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
8326 '') test -f /etc/group && groupcat='cat /etc/group';;
8329 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
8332 : now get the host name
8334 echo "Figuring out host name..." >&4
8335 case "$myhostname" in
8337 echo 'Maybe "hostname" will work...'
8338 if tans=`sh -c hostname 2>&1` ; then
8346 if $test "$cont"; then
8348 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
8349 if tans=`cat /etc/systemid 2>&1` ; then
8351 phostname='cat /etc/systemid'
8352 echo "Whadyaknow. Xenix always was a bit strange..."
8355 elif $test -r /etc/systemid; then
8356 echo "(What is a non-Xenix system doing with /etc/systemid?)"
8359 if $test "$cont"; then
8360 echo 'No, maybe "uuname -l" will work...'
8361 if tans=`sh -c 'uuname -l' 2>&1` ; then
8363 phostname='uuname -l'
8365 echo 'Strange. Maybe "uname -n" will work...'
8366 if tans=`sh -c 'uname -n' 2>&1` ; then
8368 phostname='uname -n'
8370 echo 'Oh well, maybe I can mine it out of whoami.h...'
8371 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
8372 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
8373 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
8375 case "$myhostname" in
8376 '') echo "Does this machine have an identity crisis or something?"
8379 echo "Well, you said $myhostname before..."
8380 phostname='echo $myhostname';;
8386 case "$myhostname" in
8387 '') myhostname=noname ;;
8389 : you do not want to know about this
8394 if $test "$myhostname" ; then
8396 rp='Your host name appears to be "'$myhostname'".'" Right?"
8404 : bad guess or no guess
8405 while $test "X$myhostname" = X ; do
8407 rp="Please type the (one word) name of your host:"
8412 : translate upper to lower if necessary
8413 case "$myhostname" in
8415 echo "(Normalizing case in your host name)"
8416 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
8420 case "$myhostname" in
8422 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
8423 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
8424 echo "(Trimming domain name from host name--host name is now $myhostname)"
8426 *) case "$mydomain" in
8429 test "X$hostcat" = "Xypcat hosts" &&
8430 ypmatch "$myhostname" hosts 2>/dev/null |\
8431 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
8434 test "X$hostcat" != "X" &&
8435 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
8436 /[ ]$myhostname[ . ]/p" > hosts
8439 if $test -f hosts; then
8440 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
8441 END { print sum }" hosts` = x1 || tmp_re="[ ]"
8442 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
8443 hosts | $sort | $uniq | \
8444 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
8445 case `$echo X$dflt` in
8446 X*\ *) echo "(Several hosts in the database matched hostname)"
8449 X.) echo "(You do not have fully-qualified names in the hosts database)"
8453 echo "(I cannot locate a hosts database anywhere)"
8458 tans=`./loc resolv.conf X /etc /usr/etc`
8459 if $test -f "$tans"; then
8460 echo "(Attempting domain name extraction from $tans)"
8461 dflt=.`$sed -n -e 's/ / /g' \
8462 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
8463 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8465 .) dflt=.`$sed -n -e 's/ / /g' \
8466 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
8467 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8474 .) echo "(No help from resolv.conf either -- attempting clever guess)"
8475 dflt=.`sh -c domainname 2>/dev/null`
8478 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
8482 case "$dflt$osname" in
8483 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
8484 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
8488 .) echo "(Lost all hope -- silly guess then)"
8494 *) dflt="$mydomain";;
8498 rp="What is your domain name?"
8508 : translate upper to lower if necessary
8511 echo "(Normalizing case in your domain name)"
8512 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
8516 : a little sanity check here
8517 case "$phostname" in
8520 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
8521 $myhostname$mydomain|$myhostname) ;;
8523 case "$phostname" in
8525 echo "(That doesn't agree with your whoami.h file, by the way.)"
8528 echo "(That doesn't agree with your $phostname command, by the way.)"
8538 I need to get your e-mail address in Internet format if possible, i.e.
8539 something like user@host.domain. Please answer accurately since I have
8540 no easy means to double check it. The default value provided below
8541 is most probably close to reality but may not be valid from outside
8542 your organization...
8546 while test "$cont"; do
8548 '') dflt="$cf_by@$myhostname$mydomain";;
8549 *) dflt="$cf_email";;
8551 rp='What is your e-mail address?'
8557 rp='Address does not look like an Internet one. Use it anyway?'
8573 If you or somebody else will be maintaining perl at your site, please
8574 fill in the correct e-mail address here so that they may be contacted
8575 if necessary. Currently, the "perlbug" program included with perl
8576 will send mail to this address in addition to perlbug@perl.org. You may
8577 enter "none" for no administrator.
8580 case "$perladmin" in
8581 '') dflt="$cf_email";;
8582 *) dflt="$perladmin";;
8584 rp='Perl administrator e-mail address'
8588 : determine whether to only install version-specific parts.
8591 Do you want to install only the version-specific parts of the perl
8592 distribution? Usually you do *not* want to do this.
8594 case "$versiononly" in
8595 "$define"|[Yy]*|true) dflt='y' ;;
8598 rp="Do you want to install only the version-specific parts of perl?"
8601 [yY]*) val="$define";;
8607 case "$versiononly" in
8608 "$define") inc_version_list=''
8609 inc_version_list_init=0
8613 : figure out how to guarantee perl startup
8614 : XXX Note that this currently takes advantage of the bug that binexp ignores
8615 : the Configure -Dinstallprefix setting, which in turn means that under
8616 : relocatable @INC, initialinstalllocation is what binexp started as.
8617 case "$startperl" in
8619 case "$sharpbang" in
8623 I can use the #! construct to start perl on your system. This will
8624 make startup of perl scripts faster, but may cause problems if you
8625 want to share those scripts and perl is not in a standard place
8626 ($initialinstalllocation/perl) on all your platforms. The alternative
8627 is to force a shell by starting the script with a single ':' character.
8630 case "$versiononly" in
8631 "$define") dflt="$initialinstalllocation/perl$version";;
8632 *) dflt="$initialinstalllocation/perl";;
8634 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
8637 none) startperl=": # use perl";;
8638 *) startperl="#!$ans"
8639 if $test 30 -lt `echo "$ans" | wc -c`; then
8642 WARNING: Some systems limit the #! command to 32 characters.
8643 If you experience difficulty running Perl scripts with #!, try
8644 installing Perl in a directory with a shorter pathname.
8650 *) startperl=": # use perl"
8655 echo "I'll use $startperl to start perl scripts."
8657 : figure best path for perl in scripts
8660 case "$versiononly" in
8661 "$define") perlpath="$initialinstalllocation/perl$version";;
8662 *) perlpath="$initialinstalllocation/perl";;
8664 case "$startperl" in
8669 I will use the "eval 'exec'" idiom to start Perl on your system.
8670 I can use the full path of your Perl binary for this purpose, but
8671 doing so may cause problems if you want to share those scripts and
8672 Perl is not always in a standard place ($initialinstalllocation/perl).
8675 dflt="$initialinstalllocation/perl"
8676 rp="What path shall I use in \"eval 'exec'\"?"
8683 case "$startperl" in
8685 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
8688 : determine where public executable scripts go
8689 set scriptdir scriptdir
8691 case "$scriptdir" in
8694 : guess some guesses
8695 $test -d /usr/share/scripts && dflt=/usr/share/scripts
8696 $test -d /usr/share/bin && dflt=/usr/share/bin
8697 $test -d /usr/local/script && dflt=/usr/local/script
8698 $test -d /usr/local/scripts && dflt=/usr/local/scripts
8699 $test -d $prefixexp/script && dflt=$prefixexp/script
8703 *) dflt="$scriptdir"
8708 Some installations have a separate directory just for executable scripts so
8709 that they can mount it across multiple architectures but keep the scripts in
8710 one spot. You might, for example, have a subdirectory of /usr/share for this.
8711 Or you might just lump your scripts in with all your other executables.
8715 rp='Where do you keep publicly executable scripts?'
8717 if $test "X$ansexp" != "X$scriptdirexp"; then
8723 : A little fix up for an irregularly named variable.
8724 installscript="$installscriptdir"
8726 : determine where add-on public executables go
8728 '') dflt=$siteprefix/bin ;;
8732 rp='Pathname where the add-on public executables should be installed?'
8737 : determine where add-on html pages go
8738 : There is no standard location, so try to copy the previously-selected
8739 : directory structure for the core html pages.
8740 case "$sitehtml1dir" in
8741 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
8742 *) dflt=$sitehtml1dir ;;
8745 ''|' ') dflt=none ;;
8748 rp='Pathname where the site-specific html pages should be installed?'
8750 prefixvar=sitehtml1dir
8753 : determine where add-on library html pages go
8754 : There is no standard location, so try to copy the previously-selected
8755 : directory structure for the core html pages.
8756 case "$sitehtml3dir" in
8757 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
8758 *) dflt=$sitehtml3dir ;;
8761 ''|' ') dflt=none ;;
8764 rp='Pathname where the site-specific library html pages should be installed?'
8766 prefixvar=sitehtml3dir
8769 : determine where add-on manual pages go
8770 case "$siteman1dir" in
8771 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
8772 *) dflt=$siteman1dir ;;
8775 ''|' ') dflt=none ;;
8778 rp='Pathname where the site-specific manual pages should be installed?'
8780 prefixvar=siteman1dir
8783 : determine where add-on library man pages go
8784 case "$siteman3dir" in
8785 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
8786 *) dflt=$siteman3dir ;;
8789 ''|' ') dflt=none ;;
8792 rp='Pathname where the site-specific library manual pages should be installed?'
8794 prefixvar=siteman3dir
8797 : determine where add-on public executable scripts go
8798 case "$sitescript" in
8799 '') dflt=$siteprefix/script
8800 $test -d $dflt || dflt=$sitebin ;;
8801 *) dflt="$sitescript" ;;
8804 rp='Pathname where add-on public executable scripts should be installed?'
8806 prefixvar=sitescript
8809 case "$usefaststdio" in
8810 $define|true|[yY]*|'')
8811 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
8821 Perl can be built to use 'fast stdio', which means using the stdio
8822 library but also directly manipulating the stdio buffers to enable
8823 faster I/O. Using stdio is better for backward compatibility (especially
8824 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
8825 interface has been preferred instead of stdio.
8827 If this doesn't make any sense to you, just accept the default '$dflt'.
8829 rp='Use the "fast stdio" if available?'
8832 y|Y) val="$define" ;;
8839 : define an is-a-typedef? function
8840 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8842 "") inclist="sys/types.h";;
8844 eval "varval=\$$var";
8848 for inc in $inclist; do
8849 echo "#include <$inc>" >>temp.c;
8851 echo "#ifdef $type" >> temp.c;
8852 echo "printf(\"We have $type\");" >> temp.c;
8853 echo "#endif" >> temp.c;
8854 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8855 if $contains $type temp.E >/dev/null 2>&1; then
8861 *) eval "$var=\$varval";;
8864 : define an is-a-typedef? function that prompts if the type is not available.
8865 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8867 "") inclist="sys/types.h";;
8869 eval "varval=\$$var";
8873 for inc in $inclist; do
8874 echo "#include <$inc>" >>temp.c;
8876 echo "#ifdef $type" >> temp.c;
8877 echo "printf(\"We have $type\");" >> temp.c;
8878 echo "#endif" >> temp.c;
8879 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8881 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
8882 if $contains $type temp.E >/dev/null 2>&1; then
8883 echo "$type found." >&4;
8886 echo "$type NOT found." >&4;
8892 *) eval "$var=\$varval";;
8895 : see what type lseek is declared as in the kernel
8896 rp="What is the type used for lseek's offset on this system?"
8897 set off_t lseektype long stdio.h sys/types.h
8901 echo "Checking to see how big your file offsets are..." >&4
8903 #include <sys/types.h>
8907 printf("%d\n", (int)sizeof($lseektype));
8912 if eval $compile_ok; then
8913 lseeksize=`$run ./try`
8914 echo "Your file offsets are $lseeksize bytes long."
8918 echo "(I can't seem to compile the test program. Guessing...)"
8919 rp="What is the size of your file offsets (in bytes)?"
8925 : see what type file positions are declared as in the library
8926 rp="What is the type for file position used by fsetpos()?"
8927 set fpos_t fpostype long stdio.h sys/types.h
8932 *_t) zzz="$fpostype" ;;
8935 echo "Checking the size of $zzz..." >&4
8937 #include <sys/types.h>
8944 printf("%d\n", (int)sizeof($fpostype));
8949 if eval $compile_ok; then
8953 echo "(I can't execute the test program--guessing $fpossize.)" >&4
8956 echo "Your $zzz is $fpossize bytes long."
8962 echo "(I can't compile the test program. Guessing...)" >&4
8963 rp="What is the size of your file positions (in bytes)?"
8968 # Backward compatibility (uselfs is deprecated).
8970 "$define"|true|[yY]*)
8973 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
8975 uselargefiles="$define"
8979 case "$lseeksize:$fpossize" in
8982 You can have files larger than 2 gigabytes.
8985 *) case "$uselargefiles" in
8986 "$undef"|false|[nN]*) dflt='n' ;;
8991 Perl can be built to understand large files (files larger than 2 gigabytes)
8992 on some systems. To do so, Configure can be run with -Duselargefiles.
8994 If this doesn't make any sense to you, just accept the default '$dflt'.
8996 rp='Try to understand large files, if available?'
8999 y|Y) val="$define" ;;
9006 : Look for a hint-file generated 'call-back-unit'. If the
9007 : user has specified that a large files perl is to be built,
9008 : we may need to set or change some other defaults.
9009 if $test -f uselargefiles.cbu; then
9010 echo "Your platform has some specific hints regarding large file builds, using them..."
9011 . ./uselargefiles.cbu
9013 case "$uselargefiles" in
9015 if $test -f uselargefiles.cbu; then
9017 echo "Rechecking to see how big your file offsets are..." >&4
9019 #include <sys/types.h>
9023 printf("%d\n", (int)sizeof($lseektype));
9028 if eval $compile_ok; then
9029 lseeksize=`$run ./try`
9030 $echo "Your file offsets are now $lseeksize bytes long."
9034 echo "(I can't seem to compile the test program. Guessing...)"
9035 rp="What is the size of your file offsets (in bytes)?"
9040 *_t) zzz="$fpostype" ;;
9043 $echo $n "Rechecking the size of $zzz...$c" >&4
9045 #include <sys/types.h>
9052 printf("%d\n", (int)sizeof($fpostype));
9057 if eval $compile_ok; then
9062 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9065 echo " $fpossize bytes." >&4
9071 echo "(I can't compile the test program. Guessing...)" >&4
9072 rp="What is the size of your file positions (in bytes)?"
9081 case "$vendorprefix" in
9082 '') d_vendorbin="$undef"
9086 *) d_vendorbin="$define"
9087 : determine where vendor-supplied executables go.
9088 case "$vendorbin" in
9089 '') dflt=$vendorprefix/bin ;;
9090 *) dflt="$vendorbin" ;;
9093 rp='Pathname for the vendor-supplied executables directory?'
9096 vendorbinexp="$ansexp"
9102 case "$vendorprefix" in
9103 '') vendorhtml1dir=''
9104 vendorhtml1direxp=''
9106 *) : determine where vendor-supplied html pages go.
9107 : There is no standard location, so try to copy the previously-selected
9108 : directory structure for the core html pages.
9109 : XXX Better default suggestions would be welcome.
9110 case "$vendorhtml1dir" in
9111 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9112 *) dflt=$vendorhtml1dir ;;
9115 ''|' ') dflt=none ;;
9118 rp='Pathname for the vendor-supplied html pages?'
9120 vendorhtml1dir="$ans"
9121 vendorhtml1direxp="$ansexp"
9124 : Use ' ' for none so value is preserved next time through Configure
9125 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9126 prefixvar=vendorhtml1dir
9129 case "$vendorprefix" in
9130 '') vendorhtml3dir=''
9131 vendorhtml3direxp=''
9133 *) : determine where vendor-supplied module html pages go.
9134 : There is no standard location, so try to copy the previously-selected
9135 : directory structure for the core html pages.
9136 : XXX Better default suggestions would be welcome.
9137 case "$vendorhtml3dir" in
9138 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9139 *) dflt=$vendorhtml3dir ;;
9142 ''|' ') dflt=none ;;
9145 rp='Pathname for the vendor-supplied html pages?'
9147 vendorhtml3dir="$ans"
9148 vendorhtml3direxp="$ansexp"
9151 : Use ' ' for none so value is preserved next time through Configure
9152 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9153 prefixvar=vendorhtml3dir
9156 case "$vendorprefix" in
9157 '') vendorman1dir=''
9160 *) : determine where vendor-supplied manual pages go.
9161 case "$vendorman1dir" in
9162 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9163 *) dflt=$vendorman1dir ;;
9166 ''|' ') dflt=none ;;
9169 rp='Pathname for the vendor-supplied manual section 1 pages?'
9171 vendorman1dir="$ans"
9172 vendorman1direxp="$ansexp"
9175 : Use ' ' for none so value is preserved next time through Configure
9176 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
9177 prefixvar=vendorman1dir
9180 case "$vendorprefix" in
9181 '') vendorman3dir=''
9184 *) : determine where vendor-supplied module manual pages go.
9185 case "$vendorman3dir" in
9186 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9187 *) dflt=$vendorman3dir ;;
9190 ''|' ') dflt=none ;;
9193 rp='Pathname for the vendor-supplied manual section 3 pages?'
9195 vendorman3dir="$ans"
9196 vendorman3direxp="$ansexp"
9199 : Use ' ' for none so value is preserved next time through Configure
9200 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
9201 prefixvar=vendorman3dir
9204 case "$vendorprefix" in
9205 '') d_vendorscript="$undef"
9209 *) d_vendorscript="$define"
9210 : determine where vendor-supplied scripts go.
9211 case "$vendorscript" in
9212 '') dflt=$vendorprefix/script
9213 $test -d $dflt || dflt=$vendorbin ;;
9214 *) dflt="$vendorscript" ;;
9218 The installation process will create a directory for
9219 vendor-supplied scripts.
9223 rp='Pathname for the vendor-supplied scripts directory?'
9226 vendorscriptexp="$ansexp"
9229 prefixvar=vendorscript
9232 : see if qgcvt exists
9238 if $test X"$d_longdbl" = X"$define"; then
9240 echo "Checking how to print long doubles..." >&4
9242 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
9243 $cat >try.c <<'EOCP'
9244 #include <sys/types.h>
9248 printf("%.3f\n", d);
9252 if eval $compile; then
9256 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
9257 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
9258 echo "We will use %f."
9264 if $test X"$sPRIfldbl" = X; then
9265 $cat >try.c <<'EOCP'
9266 #include <sys/types.h>
9269 long double d = 123.456;
9270 printf("%.3Lf\n", d);
9274 if eval $compile; then
9278 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
9279 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
9280 echo "We will use %Lf."
9286 if $test X"$sPRIfldbl" = X; then
9287 $cat >try.c <<'EOCP'
9288 #include <sys/types.h>
9291 long double d = 123.456;
9292 printf("%.3llf\n", d);
9296 if eval $compile; then
9300 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
9301 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
9302 echo "We will use %llf."
9308 if $test X"$sPRIfldbl" = X; then
9309 $cat >try.c <<'EOCP'
9310 #include <sys/types.h>
9313 long double d = 123.456;
9314 printf("%.3lf\n", d);
9318 if eval $compile; then
9322 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
9323 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
9324 echo "We will use %lf."
9330 if $test X"$sPRIfldbl" = X; then
9331 echo "Cannot figure out how to print long doubles." >&4
9333 sSCNfldbl=$sPRIfldbl # expect consistency
9340 case "$sPRIfldbl" in
9341 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
9342 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
9343 d_SCNfldbl="$undef";
9345 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
9346 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
9347 d_SCNfldbl="$define";
9351 : Check how to convert floats to strings.
9353 if test "X$d_Gconvert" = X; then
9356 echo "Checking for an efficient way to convert floats to strings."
9358 case "$uselongdouble" in
9359 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
9361 case "$d_longdbl" in
9362 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
9364 case "$d_PRIgldbl" in
9365 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
9369 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
9370 char *myname = "gconvert";
9373 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
9374 char *myname = "gcvt";
9377 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
9378 char *myname = "qgcvt";
9379 #define DOUBLETYPE long double
9382 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9384 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
9386 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
9389 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
9391 char *myname = "sprintf";
9395 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9396 #define DOUBLETYPE long double
9398 #define DOUBLETYPE double
9404 #define I_STDLIB $i_stdlib
9410 checkit(expect, got)
9414 if (strcmp(expect, got)) {
9415 printf("%s oddity: Expected %s, got %s\n",
9416 myname, expect, got);
9426 /* This must be 1st test on (which?) platform */
9427 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
9428 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
9429 checkit("0.1", buf);
9431 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
9432 checkit("0.01", buf);
9434 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
9435 checkit("0.001", buf);
9437 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
9438 checkit("0.0001", buf);
9440 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
9441 if (strlen(buf) > 5)
9442 checkit("9e-005", buf); /* for Microsoft ?? */
9444 checkit("9e-05", buf);
9446 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
9449 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
9450 checkit("1.1", buf);
9452 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
9453 checkit("1.01", buf);
9455 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
9456 checkit("1.001", buf);
9458 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
9459 checkit("1.0001", buf);
9461 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
9462 checkit("1.00001", buf);
9464 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
9465 checkit("1.000001", buf);
9467 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
9470 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
9473 /* Some Linux gcvt's give 1.e+5 here. */
9474 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
9475 checkit("100000", buf);
9477 /* Some Linux gcvt's give -1.e+5 here. */
9478 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
9479 checkit("-100000", buf);
9481 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
9482 checkit("123.456", buf);
9484 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
9485 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
9486 /* 34 should be enough to scare even long double
9487 * places into using the e notation. */
9488 if (strlen(buf) > 5)
9489 checkit("1e+034", buf); /* for Microsoft */
9491 checkit("1e+34", buf);
9493 /* For Perl, if you add additional tests here, also add them to
9494 * t/base/num.t for benefit of platforms not using Configure or
9495 * overriding d_Gconvert */
9500 : first add preferred functions to our list
9502 for xxx_convert in $gconvert_preference; do
9503 case $xxx_convert in
9504 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
9505 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
9508 : then add any others
9509 for xxx_convert in gconvert gcvt sprintf; do
9512 *) xxx_list="$xxx_list $xxx_convert" ;;
9516 case "$d_longdbl$uselongdouble" in
9518 : again, add prefered functions to our list first
9520 for xxx_convert in $gconvert_ld_preference; do
9521 case $xxx_convert in
9522 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9523 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
9526 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
9527 for xxx_convert in qgcvt sprintf $xxx_list; do
9528 case "$xxx_ld_list" in
9529 $xxx_convert*|*" $xxx_convert"*) ;;
9530 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9533 : if sprintf cannot do long doubles, move it to the end
9534 if test "$d_PRIgldbl" != "$define"; then
9535 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
9537 : if no qgcvt, remove it
9538 if test "$d_qgcvt" != "$define"; then
9539 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
9542 xxx_list="$xxx_ld_list"
9546 for xxx_convert in $xxx_list; do
9547 echo "Trying $xxx_convert..."
9549 set try -DTRY_$xxx_convert
9550 if eval $compile; then
9551 echo "$xxx_convert() found." >&4
9553 echo "I'll use $xxx_convert to convert floats into a string." >&4
9556 echo "...But $xxx_convert didn't work as I expected."
9560 echo "$xxx_convert NOT found." >&4
9564 if test X$xxx_convert = X; then
9565 echo "*** WHOA THERE!!! ***" >&4
9566 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
9570 case "$xxx_convert" in
9571 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
9572 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
9573 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
9574 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
9575 "$define$define$define")
9576 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
9577 "$define$define$undef")
9578 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
9579 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
9586 : see if _fwalk exists
9590 : Initialize h_fcntl
9593 : Initialize h_sysfile
9596 : access call always available on UNIX
9600 : locate the flags for 'access()'
9604 $cat >access.c <<EOCP
9605 #include <sys/types.h>
9610 #include <sys/file.h>
9623 : check sys/file.h first, no particular reason here
9624 if $test `./findhdr sys/file.h` && \
9625 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
9627 echo "<sys/file.h> defines the *_OK access constants." >&4
9628 elif $test `./findhdr fcntl.h` && \
9629 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
9631 echo "<fcntl.h> defines the *_OK access constants." >&4
9632 elif $test `./findhdr unistd.h` && \
9633 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
9634 echo "<unistd.h> defines the *_OK access constants." >&4
9636 echo "I can't find the four *_OK access constants--I'll use mine." >&4
9642 : see if accessx exists
9643 set accessx d_accessx
9646 : see if aintl exists
9650 : see if alarm exists
9654 : see if POSIX threads are available
9655 set pthread.h i_pthread
9658 : define a fucntion to check prototypes
9659 $cat > protochk <<EOSH
9662 optimize="$optimize"
9664 prototype="$prototype"
9667 usethreads=$usethreads
9668 i_pthread=$i_pthread
9669 pthread_h_first=$pthread_h_first
9672 $cat >> protochk <<'EOSH'
9677 while test $# -ge 2; do
9679 $define) echo "#include <$2>" >> try.c ;;
9680 literal) echo "$2" >> try.c ;;
9682 # Extra magic for the benefit of systems that need pthread.h
9683 # to be included early to correctly detect threadsafe functions.
9684 # Such functions must guarantee themselves, though, that the usethreads
9685 # and i_pthread have been defined, before calling protochk.
9686 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
9687 echo "#include <pthread.h>" >> try.c
9692 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
9693 cat >> try.c <<'EOCP'
9694 #ifdef CAN_PROTOTYPE
9695 #define _(args) args
9700 echo "$foo" >> try.c
9701 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
9702 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
9710 hasproto='varname=$1; func=$2; shift; shift;
9711 while $test $# -ge 2; do
9713 $define) echo "#include <$2>";;
9717 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
9718 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
9719 echo "$func() prototype found.";
9722 echo "$func() prototype NOT found.";
9727 $rm -f try.c tryout.c'
9729 : see if sys/types.h has to be included
9730 set sys/types.h i_systypes
9733 : see if sys/select.h has to be included
9734 set sys/select.h i_sysselct
9737 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
9738 while $test $# -ge 2; do
9740 $define) echo "#include <$2>";;
9744 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
9746 if eval $compile; then
9755 : see if we should include time.h, sys/time.h, or both
9757 if test "X$timeincl" = X; then
9758 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
9759 $echo $n "I'm now running the test program...$c"
9761 #include <sys/types.h>
9766 #ifdef SYSTIMEKERNEL
9769 #include <sys/time.h>
9772 #include <sys/select.h>
9785 struct timezone tzp;
9787 if (foo.tm_sec == foo.tm_sec)
9790 if (bar.tv_sec == bar.tv_sec)
9797 for s_timezone in '-DS_TIMEZONE' ''; do
9799 for s_timeval in '-DS_TIMEVAL' ''; do
9800 for i_systimek in '' '-DSYSTIMEKERNEL'; do
9801 for i_time in '' '-DI_TIME'; do
9802 for i_systime in '-DI_SYSTIME' ''; do
9805 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
9806 if eval $compile; then
9807 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
9811 $echo $n "Succeeded with $flags$c"
9823 *SYSTIMEKERNEL*) i_systimek="$define"
9824 timeincl=`./findhdr sys/time.h`
9825 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
9826 *) i_systimek="$undef";;
9829 *I_TIME*) i_time="$define"
9830 timeincl=`./findhdr time.h`" $timeincl"
9831 echo "We'll include <time.h>." >&4;;
9832 *) i_time="$undef";;
9835 *I_SYSTIME*) i_systime="$define"
9836 timeincl=`./findhdr sys/time.h`" $timeincl"
9837 echo "We'll include <sys/time.h>." >&4;;
9838 *) i_systime="$undef";;
9842 : see if struct tm knows about tm_zone
9843 case "$i_systime$i_time" in
9846 echo "Checking to see if your struct tm has tm_zone field..." >&4
9847 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
9855 case "$d_tm_tm_zone" in
9856 "$define") echo "Yes, it does." ;;
9857 *) echo "No, it doesn't." ;;
9859 : see if struct tm knows about tm_gmtoff
9860 case "$i_systime$i_time" in
9863 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
9864 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
9872 case "$d_tm_tm_gmtoff" in
9873 "$define") echo "Yes, it does." ;;
9874 *) echo "No, it doesn't." ;;
9877 : see if asctime_r exists
9878 set asctime_r d_asctime_r
9880 case "$d_asctime_r" in
9882 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
9883 case "$d_asctime_r_proto:$usethreads" in
9884 ":define") d_asctime_r_proto=define
9885 set d_asctime_r_proto asctime_r $hdrs
9889 case "$d_asctime_r_proto" in
9891 case "$asctime_r_proto" in
9892 ''|0) try='char* asctime_r(const struct tm*, char*);'
9893 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SB ;;
9895 case "$asctime_r_proto" in
9896 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
9897 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SBI ;;
9899 case "$asctime_r_proto" in
9900 ''|0) try='int asctime_r(const struct tm*, char*);'
9901 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SB ;;
9903 case "$asctime_r_proto" in
9904 ''|0) try='int asctime_r(const struct tm*, char*, int);'
9905 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SBI ;;
9907 case "$asctime_r_proto" in
9908 ''|0) d_asctime_r=undef
9910 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
9911 * ) case "$asctime_r_proto" in
9912 REENTRANT_PROTO*) ;;
9913 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
9915 echo "Prototype: $try" ;;
9918 *) case "$usethreads" in
9919 define) echo "asctime_r has no prototype, not using it." >&4 ;;
9926 *) asctime_r_proto=0
9930 : see if atolf exists
9934 : see if atoll exists
9938 : Look for GCC-style attribute format
9939 case "$d_attribute_format" in
9942 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
9943 $cat >attrib.c <<'EOCP'
9945 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
9947 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
9948 if $contains 'warning' attrib.out >/dev/null 2>&1; then
9949 echo "Your C compiler doesn't support __attribute__((format))."
9952 echo "Your C compiler supports __attribute__((format))."
9956 echo "Your C compiler doesn't seem to understand __attribute__ at all."
9960 *) val="$d_attribute_format" ;;
9962 set d_attribute_format
9966 : Look for GCC-style attribute malloc
9967 case "$d_attribute_malloc" in
9970 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
9971 $cat >attrib.c <<'EOCP'
9973 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
9975 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
9976 if $contains 'warning' attrib.out >/dev/null 2>&1; then
9977 echo "Your C compiler doesn't support __attribute__((malloc))."
9980 echo "Your C compiler supports __attribute__((malloc))."
9984 echo "Your C compiler doesn't seem to understand __attribute__ at all."
9988 *) val="$d_attribute_malloc" ;;
9990 set d_attribute_malloc
9994 : Look for GCC-style attribute nonnull
9995 case "$d_attribute_nonnull" in
9998 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
9999 $cat >attrib.c <<'EOCP'
10001 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
10003 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10004 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10005 echo "Your C compiler doesn't support __attribute__((nonnull))."
10008 echo "Your C compiler supports __attribute__((nonnull))."
10012 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10016 *) val="$d_attribute_nonnull" ;;
10018 set d_attribute_nonnull
10022 : Look for GCC-style attribute noreturn
10023 case "$d_attribute_noreturn" in
10026 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
10027 $cat >attrib.c <<'EOCP'
10029 void fall_over_dead( void ) __attribute__((noreturn));
10031 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10032 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10033 echo "Your C compiler doesn't support __attribute__((noreturn))."
10036 echo "Your C compiler supports __attribute__((noreturn))."
10040 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10044 *) val="$d_attribute_noreturn" ;;
10046 set d_attribute_noreturn
10050 : Look for GCC-style attribute pure
10051 case "$d_attribute_pure" in
10054 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
10055 $cat >attrib.c <<'EOCP'
10057 int square( int n ) __attribute__((pure));
10059 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10060 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10061 echo "Your C compiler doesn't support __attribute__((pure))."
10064 echo "Your C compiler supports __attribute__((pure))."
10068 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10072 *) val="$d_attribute_pure" ;;
10074 set d_attribute_pure
10078 : Look for GCC-style attribute unused
10079 case "$d_attribute_unused" in
10082 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
10083 $cat >attrib.c <<'EOCP'
10085 int do_something( int dummy __attribute__((unused)), int n );
10087 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10088 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10089 echo "Your C compiler doesn't support __attribute__((unused))."
10092 echo "Your C compiler supports __attribute__((unused))."
10096 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10100 *) val="$d_attribute_unused" ;;
10102 set d_attribute_unused
10106 : Look for GCC-style attribute warn_unused_result
10107 case "$d_attribute_warn_unused_result" in
10110 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
10111 $cat >attrib.c <<'EOCP'
10113 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
10115 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10116 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10117 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
10120 echo "Your C compiler supports __attribute__((warn_unused_result))."
10124 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10128 *) val="$d_attribute_warn_unused_result" ;;
10130 set d_attribute_warn_unused_result
10134 : see if bcmp exists
10138 : see if bcopy exists
10142 : see if getpgrp exists
10143 set getpgrp d_getpgrp
10146 case "$d_getpgrp" in
10149 echo "Checking to see which flavor of getpgrp is in use..."
10151 #$i_unistd I_UNISTD
10152 #include <sys/types.h>
10154 # include <unistd.h>
10156 #$i_stdlib I_STDLIB
10158 #include <stdlib.h>
10162 if (getuid() == 0) {
10163 printf("(I see you are running Configure as super-user...)\n");
10166 #ifdef TRY_BSD_PGRP
10167 if (getpgrp(1) == 0)
10176 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10177 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
10179 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10180 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
10183 echo "I can't seem to compile and run the test program."
10185 xxx="a USG one, i.e. you use getpgrp()."
10187 # SVR4 systems can appear rather BSD-ish.
10188 case "$i_unistd" in
10190 xxx="a BSD one, i.e. you use getpgrp(pid)."
10194 xxx="probably a USG one, i.e. you use getpgrp()."
10199 echo "Assuming your getpgrp is $xxx" >&4
10208 : see if setpgrp exists
10209 set setpgrp d_setpgrp
10212 case "$d_setpgrp" in
10215 echo "Checking to see which flavor of setpgrp is in use..."
10217 #$i_unistd I_UNISTD
10218 #include <sys/types.h>
10220 # include <unistd.h>
10222 #$i_stdlib I_STDLIB
10224 #include <stdlib.h>
10228 if (getuid() == 0) {
10229 printf("(I see you are running Configure as super-user...)\n");
10232 #ifdef TRY_BSD_PGRP
10233 if (-1 == setpgrp(1, 1))
10236 if (setpgrp() != -1)
10242 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10243 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
10245 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10246 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
10249 echo "(I can't seem to compile and run the test program.)"
10251 xxx="a USG one, i.e. you use setpgrp()."
10253 # SVR4 systems can appear rather BSD-ish.
10254 case "$i_unistd" in
10256 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
10260 xxx="probably a USG one, i.e. you use setpgrp()."
10265 echo "Assuming your setpgrp is $xxx" >&4
10273 : Look for GCC-style __builtin_choose_expr
10274 case "$d_builtin_choose_expr" in
10277 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
10278 $cat >try.c <<'EOCP'
10279 #include <assert.h>
10280 #include <stdlib.h>
10283 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
10286 assert( SYRINX(1) == 2112 );
10287 assert( SYRINX(1) != 5150 );
10288 assert( SYRINX(0) == 5150 );
10289 assert( SYRINX(0) != 2112 );
10290 puts( "All good!" );
10296 if eval $compile; then
10297 echo "Your C compiler supports __builtin_choose_expr."
10300 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
10304 *) val="$d_builtin_choose_expr" ;;
10307 set d_builtin_choose_expr
10309 $rm -f try.* try core core.try.*
10311 : Look for GCC-style __builtin_expect
10312 case "$d_builtin_expect" in
10315 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
10316 $cat >builtin.c <<'EOCP'
10319 if ( __builtin_expect(n, 0) ) n = 1;
10323 if eval $compile; then
10324 echo "Your C compiler supports __builtin_choose_expr."
10327 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
10331 *) val="$d_builtin_expect" ;;
10334 set d_builtin_expect
10336 $rm -f try.* try core core.try.*
10338 : see if bzero exists
10342 : see if stdarg is available
10344 if $test `./findhdr stdarg.h`; then
10345 echo "<stdarg.h> found." >&4
10348 echo "<stdarg.h> NOT found." >&4
10352 : see if varags is available
10354 if $test `./findhdr varargs.h`; then
10355 echo "<varargs.h> found." >&4
10357 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
10360 : set up the varargs testing programs
10361 $cat > varargs.c <<EOP
10363 #include <stdarg.h>
10366 #include <varargs.h>
10370 int f(char *p, ...)
10384 p = va_arg(ap, char *);
10390 $cat > varargs <<EOP
10392 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
10401 : now check which varargs header should be included
10406 if `./varargs I_STDARG`; then
10408 elif `./varargs I_VARARGS`; then
10413 if `./varargs I_VARARGS`; then
10420 echo "I could not find the definition for va_dcl... You have problems..." >&4
10421 val="$undef"; set i_stdarg; eval $setvar
10422 val="$undef"; set i_varargs; eval $setvar
10427 case "$i_varhdr" in
10429 val="$define"; set i_stdarg; eval $setvar
10430 val="$undef"; set i_varargs; eval $setvar
10433 val="$undef"; set i_stdarg; eval $setvar
10434 val="$define"; set i_varargs; eval $setvar
10437 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
10441 : see if the Compiler supports C99 variadic macros
10442 case "$i_stdarg$i_stdlib" in
10444 echo "You have <stdarg.h> and <stdlib.h>, so checking for C99 variadic macros." >&4
10447 #include <stdarg.h>
10449 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
10453 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
10459 if eval $compile && $run ./try 2>&1 >/dev/null; then
10460 case "`$run ./try`" in
10462 echo "You have C99 variadic macros." >&4
10463 d_c99_variadic_macros="$define"
10466 echo "You don't have functional C99 variadic macros." >&4
10467 d_c99_variadic_macros="$undef"
10471 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
10472 d_c99_variadic_macros="$undef"
10474 $rm -f try.* try core core.try.*
10477 echo "You don't have <stdarg.h> and <stdlib.h>, so not checking for C99 variadic macros." >&4
10478 d_c99_variadic_macros="$undef"
10482 : see if signal is declared as pointer to function returning int or void
10484 xxx=`./findhdr signal.h`
10485 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
10486 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10487 echo "You have int (*signal())() instead of void." >&4
10489 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10490 echo "You have void (*signal())()." >&4
10492 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
10493 echo "You have int (*signal())() instead of void." >&4
10495 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
10496 echo "You have void (*signal())()." >&4
10499 case "$d_voidsig" in
10501 echo "I can't determine whether signal handler returns void or int..." >&4
10503 rp="What type does your signal handler return?"
10506 v*) val="$define";;
10510 echo "As you already told me, signal handler returns void." >&4
10513 *) echo "As you already told me, signal handler returns int." >&4
10520 case "$d_voidsig" in
10521 "$define") signal_t="void";;
10522 *) signal_t="int";;
10526 : check for ability to cast large floats to 32-bit ints.
10528 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
10529 if $test "$intsize" -ge 4; then
10536 #$i_stdlib I_STDLIB
10538 #include <stdlib.h>
10540 #include <sys/types.h>
10541 #include <signal.h>
10542 $signal_t blech(int s) { exit(3); }
10549 signal(SIGFPE, blech);
10551 /* Don't let compiler optimize the test away. Store the number
10552 in a writable string for gcc to pass to sscanf under HP/UX.
10554 sprintf(str, "2147483647");
10555 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
10559 /* x86 processors will probably give 0x8000 0000, which is a
10560 sign change. We don't want that. We want to mimic SPARC
10561 behavior here, which is to preserve the sign and give
10564 if (i32 != ($xxx) f)
10570 if eval $compile_ok; then
10574 echo "(I can't seem to compile the test program--assuming it can't)"
10579 echo "Yup, it can."
10582 echo "Nope, it can't."
10589 : check for ability to cast negative floats to unsigned
10591 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
10594 #$i_stdlib I_STDLIB
10596 #include <stdlib.h>
10598 #include <sys/types.h>
10599 #include <signal.h>
10600 $signal_t blech(int s) { exit(7); }
10601 $signal_t blech_in_list(int s) { exit(4); }
10602 unsigned long dummy_long(unsigned long p) { return p; }
10603 unsigned int dummy_int(unsigned int p) { return p; }
10604 unsigned short dummy_short(unsigned short p) { return p; }
10608 unsigned long along;
10610 unsigned short ashort;
10614 /* Frustrate gcc-2.7.2's optimizer which failed this test with
10615 a direct f = -123. assignment. gcc-2.8.0 reportedly
10616 optimized the whole file away
10618 /* Store the number in a writable string for gcc to pass to
10619 sscanf under HP/UX.
10621 sprintf(str, "-123");
10622 sscanf(str, "%lf", &f); /* f = -123.; */
10624 signal(SIGFPE, blech);
10625 along = (unsigned long)f;
10626 aint = (unsigned int)f;
10627 ashort = (unsigned short)f;
10628 if (along != (unsigned long)-123)
10630 if (aint != (unsigned int)-123)
10632 if (ashort != (unsigned short)-123)
10634 sprintf(str, "1073741824.");
10635 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
10638 along = (unsigned long)f;
10639 if (along != 0x80000000)
10643 along = (unsigned long)f;
10644 if (along != 0x7fffffff)
10648 along = (unsigned long)f;
10649 if (along != 0x80000001)
10653 signal(SIGFPE, blech_in_list);
10654 sprintf(str, "123.");
10655 sscanf(str, "%lf", &f); /* f = 123.; */
10656 along = dummy_long((unsigned long)f);
10657 aint = dummy_int((unsigned int)f);
10658 ashort = dummy_short((unsigned short)f);
10659 if (along != (unsigned long)123)
10661 if (aint != (unsigned int)123)
10663 if (ashort != (unsigned short)123)
10670 if eval $compile_ok; then
10674 echo "(I can't seem to compile the test program--assuming it can't)"
10677 case "$castflags" in
10679 echo "Yup, it can."
10682 echo "Nope, it can't."
10689 : see if vprintf exists
10691 if set vprintf val -f d_vprintf; eval $csym; $val; then
10692 echo 'vprintf() found.' >&4
10695 #include <varargs.h>
10696 #$i_stdlib I_STDLIB
10698 #include <stdlib.h>
10701 int main() { xxx("foo"); }
10710 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
10714 if eval $compile && $run ./try; then
10715 echo "Your vsprintf() returns (int)." >&4
10718 echo "Your vsprintf() returns (char*)." >&4
10722 echo 'vprintf() NOT found.' >&4
10733 : see if chown exists
10737 : see if chroot exists
10738 set chroot d_chroot
10741 : see if chsize exists
10742 set chsize d_chsize
10745 : see if class exists
10749 : see if clearenv exists
10750 set clearenv d_clearenv
10753 hasstruct='varname=$1; struct=$2; shift; shift;
10754 while $test $# -ge 2; do
10756 $define) echo "#include <$2>";;
10760 echo "int main () { struct $struct foo; }" >> try.c;
10762 if eval $compile; then
10769 $rm -f try.c try.o'
10773 : see whether socket exists
10775 $echo $n "Hmm... $c" >&4
10776 if set socket val -f d_socket; eval $csym; $val; then
10777 echo "Looks like you have Berkeley networking support." >&4
10779 if set setsockopt val -f; eval $csym; $val; then
10782 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
10783 d_oldsock="$define"
10786 if $contains socklib libc.list >/dev/null 2>&1; then
10787 echo "Looks like you have Berkeley networking support." >&4
10789 : we will have to assume that it supports the 4.2 BSD interface
10792 echo "You don't have Berkeley networking in libc$_a..." >&4
10793 if test "X$d_socket" = "X$define"; then
10794 echo "...but you seem to believe that you have sockets." >&4
10796 for net in net socket
10798 if test -f /usr/lib/lib$net$_a; then
10799 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
10800 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
10801 if $contains socket libc.list >/dev/null 2>&1; then
10806 echo "...but the Wollongong group seems to have hacked it in." >&4
10807 sockethdr="-I/usr/netinclude"
10810 echo "Found Berkeley sockets interface in lib$net." >&4
10811 if $contains setsockopt libc.list >/dev/null 2>&1; then
10814 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
10815 d_oldsock="$define"
10821 if test "X$d_socket" != "X$define"; then
10822 echo "or anywhere else I see." >&4
10830 : see if socketpair exists
10831 set socketpair d_sockpair
10836 echo "Checking the availability of certain socket constants..." >&4
10837 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
10838 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
10840 #include <sys/types.h>
10841 #include <sys/socket.h>
10847 set try; if eval $compile; then
10850 set d_${enum}; eval $setvar
10854 : see if this is a sys/uio.h system
10855 set sys/uio.h i_sysuio
10860 echo "Checking to see if your system supports struct cmsghdr..." >&4
10861 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
10863 case "$d_cmsghdr_s" in
10864 "$define") echo "Yes, it does." ;;
10865 *) echo "No, it doesn't." ;;
10869 : check for const keyword
10871 echo 'Checking to see if your C compiler knows about "const"...' >&4
10872 $cat >const.c <<'EOCP'
10873 typedef struct spug { int drokk; } spug;
10877 const spug y = { 0 };
10880 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
10882 echo "Yup, it does."
10885 echo "Nope, it doesn't."
10890 : see if copysignl exists
10891 set copysignl d_copysignl
10894 : see if crypt exists
10899 $define) cryptlib='' ;;
10900 *) if set crypt val -f d_crypt; eval $csym; $val; then
10901 echo 'crypt() found.' >&4
10905 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
10906 if $test -z "$cryptlib"; then
10907 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
10911 if $test -z "$cryptlib"; then
10912 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
10916 if $test -z "$cryptlib"; then
10917 cryptlib=`./loc libcrypt$_a "" $libpth`
10921 if $test -z "$cryptlib"; then
10922 echo 'crypt() NOT found.' >&4
10933 : see if this is a crypt.h system
10934 set crypt.h i_crypt
10937 : see if crypt_r exists
10938 set crypt_r d_crypt_r
10940 case "$d_crypt_r" in
10942 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
10943 case "$d_crypt_r_proto:$usethreads" in
10944 ":define") d_crypt_r_proto=define
10945 set d_crypt_r_proto crypt_r $hdrs
10949 case "$d_crypt_r_proto" in
10951 case "$crypt_r_proto" in
10952 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
10953 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCS ;;
10955 case "$crypt_r_proto" in
10956 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
10957 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCD ;;
10959 case "$crypt_r_proto" in
10960 ''|0) d_crypt_r=undef
10962 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
10963 * ) case "$crypt_r_proto" in
10964 REENTRANT_PROTO*) ;;
10965 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
10967 echo "Prototype: $try" ;;
10970 *) case "$usethreads" in
10971 define) echo "crypt_r has no prototype, not using it." >&4 ;;
10982 : get csh whereabouts
10984 'csh') val="$undef" ;;
10985 *) val="$define" ;;
10989 : Respect a hint or command line value for full_csh.
10990 case "$full_csh" in
10991 '') full_csh=$csh ;;
10994 : see if ctermid exists
10995 set ctermid d_ctermid
10998 : see if ctermid_r exists
10999 set ctermid_r d_ctermid_r
11001 case "$d_ctermid_r" in
11003 hdrs="$i_systypes sys/types.h define stdio.h "
11004 case "$d_ctermid_r_proto:$usethreads" in
11005 ":define") d_ctermid_r_proto=define
11006 set d_ctermid_r_proto ctermid_r $hdrs
11010 case "$d_ctermid_r_proto" in
11012 case "$ctermid_r_proto" in
11013 ''|0) try='char* ctermid_r(char*);'
11014 ./protochk "extern $try" $hdrs && ctermid_r_proto=B_B ;;
11016 case "$ctermid_r_proto" in
11017 ''|0) d_ctermid_r=undef
11019 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
11020 * ) case "$ctermid_r_proto" in
11021 REENTRANT_PROTO*) ;;
11022 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
11024 echo "Prototype: $try" ;;
11027 *) case "$usethreads" in
11028 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
11035 *) ctermid_r_proto=0
11039 : see if ctime_r exists
11040 set ctime_r d_ctime_r
11042 case "$d_ctime_r" in
11044 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
11045 case "$d_ctime_r_proto:$usethreads" in
11046 ":define") d_ctime_r_proto=define
11047 set d_ctime_r_proto ctime_r $hdrs
11051 case "$d_ctime_r_proto" in
11053 case "$ctime_r_proto" in
11054 ''|0) try='char* ctime_r(const time_t*, char*);'
11055 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SB ;;
11057 case "$ctime_r_proto" in
11058 ''|0) try='char* ctime_r(const time_t*, char*, int);'
11059 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SBI ;;
11061 case "$ctime_r_proto" in
11062 ''|0) try='int ctime_r(const time_t*, char*);'
11063 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SB ;;
11065 case "$ctime_r_proto" in
11066 ''|0) try='int ctime_r(const time_t*, char*, int);'
11067 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SBI ;;
11069 case "$ctime_r_proto" in
11070 ''|0) d_ctime_r=undef
11072 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
11073 * ) case "$ctime_r_proto" in
11074 REENTRANT_PROTO*) ;;
11075 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
11077 echo "Prototype: $try" ;;
11080 *) case "$usethreads" in
11081 define) echo "ctime_r has no prototype, not using it." >&4 ;;
11092 : see if cuserid exists
11093 set cuserid d_cuserid
11096 : see if this is a limits.h system
11097 set limits.h i_limits
11100 : see if this is a float.h system
11101 set float.h i_float
11104 : See if number of significant digits in a double precision number is known
11106 $cat >dbl_dig.c <<EOM
11107 #$i_limits I_LIMITS
11110 #include <limits.h>
11116 printf("Contains DBL_DIG");
11119 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
11120 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
11121 echo "DBL_DIG found." >&4
11124 echo "DBL_DIG NOT found." >&4
11131 : see if dbm.h is available
11132 : see if dbmclose exists
11133 set dbmclose d_dbmclose
11136 case "$d_dbmclose" in
11146 *) set rpcsvc/dbm.h i_rpcsvcdbm
11151 *) echo "We won't be including <dbm.h>"
11161 : see if prototype for dbminit is available
11163 set d_dbminitproto dbminit $i_dbm dbm.h
11166 : see if difftime exists
11167 set difftime d_difftime
11170 : see if this is a dirent system
11172 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
11174 echo "<dirent.h> found." >&4
11177 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
11178 echo "<sys/dir.h> found." >&4
11181 xinc=`./findhdr sys/ndir.h`
11183 echo "<dirent.h> NOT found." >&4
11188 : Look for type of directory structure.
11190 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11192 case "$direntrytype" in
11194 case "$i_dirent" in
11195 $define) guess1='struct dirent' ;;
11196 *) guess1='struct direct' ;;
11199 *) guess1="$direntrytype"
11204 'struct dirent') guess2='struct direct' ;;
11205 *) guess2='struct dirent' ;;
11208 if $contains "$guess1" try.c >/dev/null 2>&1; then
11209 direntrytype="$guess1"
11210 echo "Your directory entries are $direntrytype." >&4
11211 elif $contains "$guess2" try.c >/dev/null 2>&1; then
11212 direntrytype="$guess2"
11213 echo "Your directory entries seem to be $direntrytype." >&4
11215 echo "I don't recognize your system's directory entries." >&4
11216 rp="What type is used for directory entries on this system?"
11219 direntrytype="$ans"
11224 : see if the directory entry stores field length
11226 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11227 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
11228 echo "Good, your directory entry keeps length information in d_namlen." >&4
11231 echo "Your directory entry does not know about the d_namlen field." >&4
11238 : see if this is an sysdir system
11239 set sys/dir.h i_sysdir
11242 : see if this is an sysndir system
11243 set sys/ndir.h i_sysndir
11248 $cat >dirfd.c <<EOM
11250 #$i_stdlib I_STDLIB
11252 #include <stdlib.h>
11254 #$i_dirent I_DIRENT /**/
11255 #$i_sysdir I_SYS_DIR /**/
11256 #$i_sysndir I_SYS_NDIR /**/
11257 #$i_systypes I_SYS_TYPES /**/
11258 #if defined(I_SYS_TYPES)
11259 #include <sys/types.h>
11261 #if defined(I_DIRENT)
11262 #include <dirent.h>
11263 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
11264 #include <sys/dir.h>
11268 #include <sys/ndir.h>
11272 #include <ndir.h> /* may be wrong in the future */
11274 #include <sys/dir.h>
11280 DIR *dirp = opendir(".");
11281 if (dirfd(dirp) >= 0)
11289 if eval $compile; then
11293 $define) echo "dirfd() found." >&4 ;;
11294 *) echo "dirfd() NOT found." >&4 ;;
11300 : see if dlerror exists
11303 set dlerror d_dlerror
11307 : see if dlfcn is available
11308 set dlfcn.h i_dlfcn
11315 On a few systems, the dynamically loaded modules that perl generates and uses
11316 will need a different extension than shared libs. The default will probably
11322 *) dflt="$dlext" ;;
11324 rp='What is the extension of dynamically loaded modules'
11333 : Check if dlsym need a leading underscore
11339 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
11340 $cat >dyna.c <<'EOM'
11347 #$i_stdlib I_STDLIB
11349 #include <stdlib.h>
11353 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
11355 #include <sys/types.h>
11360 extern int fred() ;
11369 int mode = RTLD_LAZY ;
11371 handle = dlopen("./dyna.$dlext", mode) ;
11372 if (handle == NULL) {
11377 symbol = dlsym(handle, "fred") ;
11378 if (symbol == NULL) {
11379 /* try putting a leading underscore */
11380 symbol = dlsym(handle, "_fred") ;
11381 if (symbol == NULL) {
11394 : Call the object file tmp-dyna.o in case dlext=o.
11395 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
11396 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
11397 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
11398 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
11401 1) echo "Test program failed using dlopen." >&4
11402 echo "Perhaps you should not use dynamic loading." >&4;;
11403 2) echo "Test program failed using dlsym." >&4
11404 echo "Perhaps you should not use dynamic loading." >&4;;
11405 3) echo "dlsym needs a leading underscore" >&4
11407 4) echo "dlsym doesn't need a leading underscore." >&4;;
11410 echo "I can't compile and run the test program." >&4
11411 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
11416 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
11421 : see if drand48_r exists
11422 set drand48_r d_drand48_r
11424 case "$d_drand48_r" in
11426 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
11427 case "$d_drand48_r_proto:$usethreads" in
11428 ":define") d_drand48_r_proto=define
11429 set d_drand48_r_proto drand48_r $hdrs
11433 case "$d_drand48_r_proto" in
11435 case "$drand48_r_proto" in
11436 ''|0) try='int drand48_r(struct drand48_data*, double*);'
11437 ./protochk "extern $try" $hdrs && drand48_r_proto=I_ST ;;
11439 case "$drand48_r_proto" in
11440 ''|0) d_drand48_r=undef
11442 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
11443 * ) case "$drand48_r_proto" in
11444 REENTRANT_PROTO*) ;;
11445 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
11447 echo "Prototype: $try" ;;
11450 *) case "$usethreads" in
11451 define) echo "drand48_r has no prototype, not using it." >&4 ;;
11458 *) drand48_r_proto=0
11462 : see if prototype for drand48 is available
11464 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
11467 : see if dup2 exists
11471 : see if eaccess exists
11472 set eaccess d_eaccess
11475 : see if endgrent exists
11476 set endgrent d_endgrent
11479 : see if this is an grp system
11485 xxx=`./findhdr grp.h`
11486 $cppstdin $cppflags $cppminus < $xxx >$$.h
11488 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
11500 set d_grpasswd; eval $setvar
11504 : see if endgrent_r exists
11505 set endgrent_r d_endgrent_r
11507 case "$d_endgrent_r" in
11509 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
11510 case "$d_endgrent_r_proto:$usethreads" in
11511 ":define") d_endgrent_r_proto=define
11512 set d_endgrent_r_proto endgrent_r $hdrs
11516 case "$d_endgrent_r_proto" in
11518 case "$endgrent_r_proto" in
11519 ''|0) try='int endgrent_r(FILE**);'
11520 ./protochk "extern $try" $hdrs && endgrent_r_proto=I_H ;;
11522 case "$endgrent_r_proto" in
11523 ''|0) try='void endgrent_r(FILE**);'
11524 ./protochk "extern $try" $hdrs && endgrent_r_proto=V_H ;;
11526 case "$endgrent_r_proto" in
11527 ''|0) d_endgrent_r=undef
11529 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
11530 * ) case "$endgrent_r_proto" in
11531 REENTRANT_PROTO*) ;;
11532 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
11534 echo "Prototype: $try" ;;
11537 *) case "$usethreads" in
11538 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
11545 *) endgrent_r_proto=0
11549 : see if endhostent exists
11550 set endhostent d_endhent
11553 : see if this is a netdb.h system
11554 set netdb.h i_netdb
11557 : see if endhostent_r exists
11558 set endhostent_r d_endhostent_r
11560 case "$d_endhostent_r" in
11562 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11563 case "$d_endhostent_r_proto:$usethreads" in
11564 ":define") d_endhostent_r_proto=define
11565 set d_endhostent_r_proto endhostent_r $hdrs
11569 case "$d_endhostent_r_proto" in
11571 case "$endhostent_r_proto" in
11572 ''|0) try='int endhostent_r(struct hostent_data*);'
11573 ./protochk "extern $try" $hdrs && endhostent_r_proto=I_D ;;
11575 case "$endhostent_r_proto" in
11576 ''|0) try='void endhostent_r(struct hostent_data*);'
11577 ./protochk "extern $try" $hdrs && endhostent_r_proto=V_D ;;
11579 case "$endhostent_r_proto" in
11580 ''|0) d_endhostent_r=undef
11581 endhostent_r_proto=0
11582 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
11583 * ) case "$endhostent_r_proto" in
11584 REENTRANT_PROTO*) ;;
11585 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
11587 echo "Prototype: $try" ;;
11590 *) case "$usethreads" in
11591 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
11593 d_endhostent_r=undef
11594 endhostent_r_proto=0
11598 *) endhostent_r_proto=0
11602 : see if endnetent exists
11603 set endnetent d_endnent
11606 : see if endnetent_r exists
11607 set endnetent_r d_endnetent_r
11609 case "$d_endnetent_r" in
11611 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11612 case "$d_endnetent_r_proto:$usethreads" in
11613 ":define") d_endnetent_r_proto=define
11614 set d_endnetent_r_proto endnetent_r $hdrs
11618 case "$d_endnetent_r_proto" in
11620 case "$endnetent_r_proto" in
11621 ''|0) try='int endnetent_r(struct netent_data*);'
11622 ./protochk "extern $try" $hdrs && endnetent_r_proto=I_D ;;
11624 case "$endnetent_r_proto" in
11625 ''|0) try='void endnetent_r(struct netent_data*);'
11626 ./protochk "extern $try" $hdrs && endnetent_r_proto=V_D ;;
11628 case "$endnetent_r_proto" in
11629 ''|0) d_endnetent_r=undef
11630 endnetent_r_proto=0
11631 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
11632 * ) case "$endnetent_r_proto" in
11633 REENTRANT_PROTO*) ;;
11634 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
11636 echo "Prototype: $try" ;;
11639 *) case "$usethreads" in
11640 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
11642 d_endnetent_r=undef
11643 endnetent_r_proto=0
11647 *) endnetent_r_proto=0
11651 : see if endprotoent exists
11652 set endprotoent d_endpent
11655 : see if endprotoent_r exists
11656 set endprotoent_r d_endprotoent_r
11658 case "$d_endprotoent_r" in
11660 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11661 case "$d_endprotoent_r_proto:$usethreads" in
11662 ":define") d_endprotoent_r_proto=define
11663 set d_endprotoent_r_proto endprotoent_r $hdrs
11667 case "$d_endprotoent_r_proto" in
11669 case "$endprotoent_r_proto" in
11670 ''|0) try='int endprotoent_r(struct protoent_data*);'
11671 ./protochk "extern $try" $hdrs && endprotoent_r_proto=I_D ;;
11673 case "$endprotoent_r_proto" in
11674 ''|0) try='void endprotoent_r(struct protoent_data*);'
11675 ./protochk "extern $try" $hdrs && endprotoent_r_proto=V_D ;;
11677 case "$endprotoent_r_proto" in
11678 ''|0) d_endprotoent_r=undef
11679 endprotoent_r_proto=0
11680 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
11681 * ) case "$endprotoent_r_proto" in
11682 REENTRANT_PROTO*) ;;
11683 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
11685 echo "Prototype: $try" ;;
11688 *) case "$usethreads" in
11689 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
11691 d_endprotoent_r=undef
11692 endprotoent_r_proto=0
11696 *) endprotoent_r_proto=0
11700 : see if endpwent exists
11701 set endpwent d_endpwent
11704 : see if this is a pwd.h system
11710 xxx=`./findhdr pwd.h`
11711 $cppstdin $cppflags $cppminus < $xxx >$$.h
11713 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
11721 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
11729 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
11737 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
11745 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
11753 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
11761 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
11769 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
11781 set d_pwquota; eval $setvar
11782 set d_pwage; eval $setvar
11783 set d_pwchange; eval $setvar
11784 set d_pwclass; eval $setvar
11785 set d_pwexpire; eval $setvar
11786 set d_pwcomment; eval $setvar
11787 set d_pwgecos; eval $setvar
11788 set d_pwpasswd; eval $setvar
11792 : see if endpwent_r exists
11793 set endpwent_r d_endpwent_r
11795 case "$d_endpwent_r" in
11797 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
11798 case "$d_endpwent_r_proto:$usethreads" in
11799 ":define") d_endpwent_r_proto=define
11800 set d_endpwent_r_proto endpwent_r $hdrs
11804 case "$d_endpwent_r_proto" in
11806 case "$endpwent_r_proto" in
11807 ''|0) try='int endpwent_r(FILE**);'
11808 ./protochk "extern $try" $hdrs && endpwent_r_proto=I_H ;;
11810 case "$endpwent_r_proto" in
11811 ''|0) try='void endpwent_r(FILE**);'
11812 ./protochk "extern $try" $hdrs && endpwent_r_proto=V_H ;;
11814 case "$endpwent_r_proto" in
11815 ''|0) d_endpwent_r=undef
11817 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
11818 * ) case "$endpwent_r_proto" in
11819 REENTRANT_PROTO*) ;;
11820 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
11822 echo "Prototype: $try" ;;
11825 *) case "$usethreads" in
11826 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
11833 *) endpwent_r_proto=0
11837 : see if endservent exists
11838 set endservent d_endsent
11841 : see if endservent_r exists
11842 set endservent_r d_endservent_r
11844 case "$d_endservent_r" in
11846 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11847 case "$d_endservent_r_proto:$usethreads" in
11848 ":define") d_endservent_r_proto=define
11849 set d_endservent_r_proto endservent_r $hdrs
11853 case "$d_endservent_r_proto" in
11855 case "$endservent_r_proto" in
11856 ''|0) try='int endservent_r(struct servent_data*);'
11857 ./protochk "extern $try" $hdrs && endservent_r_proto=I_D ;;
11859 case "$endservent_r_proto" in
11860 ''|0) try='void endservent_r(struct servent_data*);'
11861 ./protochk "extern $try" $hdrs && endservent_r_proto=V_D ;;
11863 case "$endservent_r_proto" in
11864 ''|0) d_endservent_r=undef
11865 endservent_r_proto=0
11866 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
11867 * ) case "$endservent_r_proto" in
11868 REENTRANT_PROTO*) ;;
11869 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
11871 echo "Prototype: $try" ;;
11874 *) case "$usethreads" in
11875 define) echo "endservent_r has no prototype, not using it." >&4 ;;
11877 d_endservent_r=undef
11878 endservent_r_proto=0
11882 *) endservent_r_proto=0
11886 : Locate the flags for 'open()'
11889 #include <sys/types.h>
11894 #include <sys/file.h>
11896 #$i_stdlib I_STDLIB
11898 #include <stdlib.h>
11909 : check sys/file.h first to get FREAD on Sun
11910 if $test `./findhdr sys/file.h` && \
11911 set try -DI_SYS_FILE && eval $compile; then
11913 echo "<sys/file.h> defines the O_* constants..." >&4
11914 if $run ./try; then
11915 echo "and you have the 3 argument form of open()." >&4
11918 echo "but not the 3 argument form of open(). Oh, well." >&4
11921 elif $test `./findhdr fcntl.h` && \
11922 set try -DI_FCNTL && eval $compile; then
11924 echo "<fcntl.h> defines the O_* constants..." >&4
11925 if $run ./try; then
11926 echo "and you have the 3 argument form of open()." >&4
11929 echo "but not the 3 argument form of open(). Oh, well." >&4
11934 echo "I can't find the O_* constant definitions! You got problems." >&4
11940 : see which of string.h or strings.h is needed
11942 strings=`./findhdr string.h`
11943 if $test "$strings" && $test -r "$strings"; then
11944 echo "Using <string.h> instead of <strings.h>." >&4
11948 strings=`./findhdr strings.h`
11949 if $test "$strings" && $test -r "$strings"; then
11950 echo "Using <strings.h> instead of <string.h>." >&4
11952 echo "No string header found -- You'll surely have problems." >&4
11957 case "$i_string" in
11958 "$undef") strings=`./findhdr strings.h`;;
11959 *) strings=`./findhdr string.h`;;
11962 : see if this is a sys/file.h system
11967 : do we need to include sys/file.h ?
11971 if $h_sysfile; then
11973 echo "We'll be including <sys/file.h>." >&4
11976 echo "We won't be including <sys/file.h>." >&4
11986 : see if fcntl.h is there
11991 : see if we can include fcntl.h
11997 echo "We'll be including <fcntl.h>." >&4
12000 if $h_sysfile; then
12001 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
12003 echo "We won't be including <fcntl.h>." >&4
12015 : check for non-blocking I/O stuff
12016 case "$h_sysfile" in
12017 true) echo "#include <sys/file.h>" > head.c;;
12020 true) echo "#include <fcntl.h>" > head.c;;
12021 *) echo "#include <sys/fcntl.h>" > head.c;;
12026 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
12027 case "$o_nonblock" in
12029 $cat head.c > try.c
12030 $cat >>try.c <<EOCP
12032 #$i_stdlib I_STDLIB
12034 #include <stdlib.h>
12042 printf("O_NONBLOCK\n");
12046 printf("O_NDELAY\n");
12050 printf("FNDELAY\n");
12057 if eval $compile_ok; then
12058 o_nonblock=`$run ./try`
12059 case "$o_nonblock" in
12060 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
12061 *) echo "Seems like we can use $o_nonblock.";;
12064 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
12067 *) echo "Using $hint value $o_nonblock.";;
12069 $rm -f try try.* .out core
12072 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
12075 $cat head.c > try.c
12076 $cat >>try.c <<EOCP
12078 #include <sys/types.h>
12079 #include <signal.h>
12081 #$i_stdlib I_STDLIB
12083 #include <stdlib.h>
12089 #define MY_O_NONBLOCK $o_nonblock
12090 #ifndef errno /* XXX need better Configure test */
12093 #$i_unistd I_UNISTD
12095 #include <unistd.h>
12097 #$i_string I_STRING
12099 #include <string.h>
12101 #include <strings.h>
12103 $signal_t blech(int x) { exit(3); }
12105 $cat >> try.c <<'EOCP'
12113 pipe(pd); /* Down: child -> parent */
12114 pipe(pu); /* Up: parent -> child */
12117 close(pd[1]); /* Parent reads from pd[0] */
12118 close(pu[0]); /* Parent writes (blocking) to pu[1] */
12120 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
12125 signal(SIGALRM, blech);
12127 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
12129 sprintf(string, "%d\n", ret);
12130 write(2, string, strlen(string));
12133 if (errno == EAGAIN) {
12134 printf("EAGAIN\n");
12139 if (errno == EWOULDBLOCK)
12140 printf("EWOULDBLOCK\n");
12143 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
12144 sleep(2); /* Give it time to close our pipe */
12146 ret = read(pd[0], buf, 1); /* Should read EOF */
12148 sprintf(string, "%d\n", ret);
12149 write(4, string, strlen(string));
12153 close(pd[0]); /* We write to pd[1] */
12154 close(pu[1]); /* We read from pu[0] */
12155 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
12156 close(pd[1]); /* Pipe pd is now fully closed! */
12157 exit(0); /* Bye bye, thank you for playing! */
12161 if eval $compile_ok; then
12162 echo "$startsh" >mtry
12163 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
12165 ./mtry >/dev/null 2>&1
12167 0) eagain=`$cat try.out`;;
12168 1) echo "Could not perform non-blocking setting!";;
12169 2) echo "I did a successful read() for something that was not there!";;
12170 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
12171 4) echo "Could not find F_SETFL!";;
12172 *) echo "Something terribly wrong happened during testing.";;
12174 rd_nodata=`$cat try.ret`
12175 echo "A read() system call with no data present returns $rd_nodata."
12176 case "$rd_nodata" in
12179 echo "(That's peculiar, fixing that to be -1.)"
12185 echo "Forcing errno EAGAIN on read() with no data available."
12189 echo "Your read() sets errno to $eagain when no data is available."
12192 status=`$cat try.err`
12194 0) echo "And it correctly returns 0 to signal EOF.";;
12195 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
12196 *) echo "However, your read() returns '$status' on EOF??";;
12199 if test "$status" = "$rd_nodata"; then
12200 echo "WARNING: you can't distinguish between EOF and no data!"
12204 echo "I can't compile the test program--assuming errno EAGAIN will do."
12211 echo "Using $hint value $eagain."
12212 echo "Your read() returns $rd_nodata when no data is present."
12213 case "$d_eofnblk" in
12214 "$define") echo "And you can see EOF because read() returns 0.";;
12215 "$undef") echo "But you can't see EOF status from read() returned value.";;
12217 echo "(Assuming you can't see EOF status from read anyway.)"
12223 $rm -f try try.* .out core head.c mtry
12225 : see if _ptr and _cnt from stdio act std
12228 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
12229 echo "(Looks like you have stdio.h from BSD.)"
12230 case "$stdio_ptr" in
12231 '') stdio_ptr='((fp)->_p)'
12234 *) ptr_lval=$d_stdio_ptr_lval;;
12236 case "$stdio_cnt" in
12237 '') stdio_cnt='((fp)->_r)'
12240 *) cnt_lval=$d_stdio_cnt_lval;;
12242 case "$stdio_base" in
12243 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
12245 case "$stdio_bufsiz" in
12246 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
12248 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
12249 echo "(Looks like you have stdio.h from Linux.)"
12250 case "$stdio_ptr" in
12251 '') stdio_ptr='((fp)->_IO_read_ptr)'
12254 *) ptr_lval=$d_stdio_ptr_lval;;
12256 case "$stdio_cnt" in
12257 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
12260 *) cnt_lval=$d_stdio_cnt_lval;;
12262 case "$stdio_base" in
12263 '') stdio_base='((fp)->_IO_read_base)';;
12265 case "$stdio_bufsiz" in
12266 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
12269 case "$stdio_ptr" in
12270 '') stdio_ptr='((fp)->_ptr)'
12273 *) ptr_lval=$d_stdio_ptr_lval;;
12275 case "$stdio_cnt" in
12276 '') stdio_cnt='((fp)->_cnt)'
12279 *) cnt_lval=$d_stdio_cnt_lval;;
12281 case "$stdio_base" in
12282 '') stdio_base='((fp)->_base)';;
12284 case "$stdio_bufsiz" in
12285 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
12289 : test whether _ptr and _cnt really work
12290 echo "Checking how std your stdio is..." >&4
12293 #$i_stdlib I_STDLIB
12295 #include <stdlib.h>
12297 #define FILE_ptr(fp) $stdio_ptr
12298 #define FILE_cnt(fp) $stdio_cnt
12300 FILE *fp = fopen("try.c", "r");
12303 18 <= FILE_cnt(fp) &&
12304 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12312 if eval $compile && $to try.c; then
12313 if $run ./try; then
12314 echo "Your stdio acts pretty std."
12317 echo "Your stdio isn't very std."
12320 echo "Your stdio doesn't appear very std."
12324 # glibc 2.2.90 and above apparently change stdio streams so Perl's
12325 # direct buffer manipulation no longer works. The Configure tests
12326 # should be changed to correctly detect this, but until then,
12327 # the following check should at least let perl compile and run.
12328 # (This quick fix should be updated before 5.8.1.)
12329 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
12330 # A. Dougherty, June 3, 2002.
12331 case "$d_gnulibc" in
12333 case "$gnulibc_version" in
12337 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
12346 : Can _ptr be used as an lvalue?
12347 case "$d_stdstdio$ptr_lval" in
12348 $define$define) val=$define ;;
12351 set d_stdio_ptr_lval
12354 : Can _cnt be used as an lvalue?
12355 case "$d_stdstdio$cnt_lval" in
12356 $define$define) val=$define ;;
12359 set d_stdio_cnt_lval
12363 : test whether setting _ptr sets _cnt as a side effect
12364 d_stdio_ptr_lval_sets_cnt="$undef"
12365 d_stdio_ptr_lval_nochange_cnt="$undef"
12366 case "$d_stdio_ptr_lval$d_stdstdio" in
12368 echo "Checking to see what happens if we set the stdio ptr..." >&4
12371 /* Can we scream? */
12372 /* Eat dust sed :-) */
12373 /* In the buffer space, no one can hear you scream. */
12374 #$i_stdlib I_STDLIB
12376 #include <stdlib.h>
12378 #define FILE_ptr(fp) $stdio_ptr
12379 #define FILE_cnt(fp) $stdio_cnt
12380 #include <sys/types.h>
12382 FILE *fp = fopen("try.c", "r");
12387 puts("Fail even to read");
12390 c = getc(fp); /* Read away the first # */
12392 puts("Fail even to read");
12396 18 <= FILE_cnt(fp) &&
12397 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12399 puts("Fail even to read");
12402 ptr = (char*) FILE_ptr(fp);
12403 cnt = (size_t)FILE_cnt(fp);
12405 FILE_ptr(fp) += 42;
12407 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
12408 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
12411 if (FILE_cnt(fp) <= 20) {
12412 printf ("Fail (<20 chars to test)");
12415 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
12416 puts("Fail compare");
12419 if (cnt == FILE_cnt(fp)) {
12420 puts("Pass_unchanged");
12423 if (FILE_cnt(fp) == (cnt - 42)) {
12424 puts("Pass_changed");
12427 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
12433 if eval $compile && $to try.c; then
12434 case `$run ./try` in
12436 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
12437 d_stdio_ptr_lval_sets_cnt="$define" ;;
12439 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
12440 d_stdio_ptr_lval_nochange_cnt="$define" ;;
12442 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
12444 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
12447 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
12453 : see if _base is also standard
12455 case "$d_stdstdio" in
12459 #$i_stdlib I_STDLIB
12461 #include <stdlib.h>
12463 #define FILE_base(fp) $stdio_base
12464 #define FILE_bufsiz(fp) $stdio_bufsiz
12466 FILE *fp = fopen("try.c", "r");
12469 19 <= FILE_bufsiz(fp) &&
12470 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
12477 if eval $compile && $to try.c; then
12478 if $run ./try; then
12479 echo "And its _base field acts std."
12482 echo "But its _base field isn't std."
12485 echo "However, it seems to be lacking the _base field."
12493 : see if fast_stdio exists
12495 case "$d_stdstdio:$d_stdio_ptr_lval" in
12497 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
12499 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
12510 : see if fchdir exists
12511 set fchdir d_fchdir
12514 : see if fchmod exists
12515 set fchmod d_fchmod
12518 : see if fchown exists
12519 set fchown d_fchown
12522 : see if this is an fcntl system
12527 : See if fcntl-based locking works.
12529 #$i_stdlib I_STDLIB
12531 #include <stdlib.h>
12533 #include <unistd.h>
12535 #include <signal.h>
12536 $signal_t blech(int x) { exit(3); }
12538 #if defined(F_SETLK) && defined(F_SETLKW)
12539 struct flock flock;
12541 fd = open("try.c", O_RDONLY);
12542 flock.l_type = F_RDLCK;
12543 flock.l_whence = SEEK_SET;
12544 flock.l_start = flock.l_len = 0;
12545 signal(SIGALRM, blech);
12547 retval = fcntl(fd, F_SETLK, &flock);
12549 (retval < 0 ? exit(2) : exit(0));
12555 echo "Checking if fcntl-based file locking works... "
12559 if eval $compile_ok; then
12560 if $run ./try; then
12561 echo "Yes, it seems to work."
12564 echo "Nope, it didn't work."
12569 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
12570 *** This is (almost) impossible.
12571 *** If your NFS lock daemons are not feeling well, something like
12572 *** this may happen, please investigate. Cannot continue, aborting.
12580 echo "I'm unable to compile the test program, so I'll assume not."
12585 echo "Nope, since you don't even have fcntl()."
12588 set d_fcntl_can_lock
12593 : check for fd_set items
12596 Checking to see how well your C compiler handles fd_set and friends ...
12599 #$i_stdlib I_STDLIB
12601 #include <stdlib.h>
12603 #$i_systime I_SYS_TIME
12604 #$i_sysselct I_SYS_SELECT
12605 #$d_socket HAS_SOCKET
12606 #include <sys/types.h>
12608 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
12611 #include <sys/time.h>
12613 #ifdef I_SYS_SELECT
12614 #include <sys/select.h>
12623 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
12631 if eval $compile; then
12632 d_fds_bits="$define"
12634 echo "Well, your system knows about the normal fd_set typedef..." >&4
12635 if $run ./try; then
12636 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
12637 d_fd_macros="$define"
12640 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
12642 d_fd_macros="$undef"
12646 Hmm, your compiler has some difficulty with fd_set. Checking further...
12649 if eval $compile; then
12650 d_fds_bits="$undef"
12652 echo "Well, your system has some sort of fd_set available..." >&4
12653 if $run ./try; then
12654 echo "and you have the normal fd_set macros." >&4
12655 d_fd_macros="$define"
12658 but not the normal fd_set macros! Gross! More work for me...
12660 d_fd_macros="$undef"
12663 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
12665 d_fds_bits="$undef"
12666 d_fd_macros="$undef"
12671 : see if fgetpos exists
12672 set fgetpos d_fgetpos
12675 : see if finite exists
12676 set finite d_finite
12679 : see if finitel exists
12680 set finitel d_finitel
12683 : see if flock exists
12687 : see if prototype for flock is available
12689 set d_flockproto flock $i_sysfile sys/file.h
12692 : see if fork exists
12696 : see if fp_class exists
12697 set fp_class d_fp_class
12700 : see if pathconf exists
12701 set pathconf d_pathconf
12704 : see if fpathconf exists
12705 set fpathconf d_fpathconf
12708 : see if fpclass exists
12709 set fpclass d_fpclass
12712 : see if fpclassify exists
12713 set fpclassify d_fpclassify
12716 : see if fpclassl exists
12717 set fpclassl d_fpclassl
12721 : check for fpos64_t
12723 echo "Checking to see if you have fpos64_t..." >&4
12726 int main() { fpos64_t x = 7; }
12729 if eval $compile; then
12731 echo "You have fpos64_t."
12734 echo "You do not have fpos64_t."
12735 case "$fpossize" in
12736 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
12743 : see if frexpl exists
12744 set frexpl d_frexpl
12747 : see if this is a sys/param system
12748 set sys/param.h i_sysparam
12751 : see if this is a sys/mount.h system
12752 set sys/mount.h i_sysmount
12757 echo "Checking to see if your system supports struct fs_data..." >&4
12758 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
12760 case "$d_fs_data_s" in
12761 "$define") echo "Yes, it does." ;;
12762 *) echo "No, it doesn't." ;;
12765 : see if fseeko exists
12766 set fseeko d_fseeko
12768 case "$longsize" in
12769 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
12772 : see if fsetpos exists
12773 set fsetpos d_fsetpos
12777 : see if fstatfs exists
12778 set fstatfs d_fstatfs
12782 : see if statvfs exists
12783 set statvfs d_statvfs
12786 : see if fstatvfs exists
12787 set fstatvfs d_fstatvfs
12791 : see if fsync exists
12795 : see if ftello exists
12796 set ftello d_ftello
12798 case "$longsize" in
12799 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
12803 : check for a working futimes
12805 echo "Checking for a working futimes()" >&4
12808 #include <sys/time.h>
12815 fd = open ("try.c", O_RDWR);
12816 if (-1 == fd) exit (1);
12817 rv = futimes (fd, NULL);
12818 exit (rv == -1 ? errno : 0);
12822 if eval $compile; then
12826 0) echo "Yes, it does" >&4
12827 d_futimes="$define"
12829 *) echo "No, it has futimes, but it isn't working ($rc) (probably harmless)\n" >&4
12833 echo "No, it does not (probably harmless)\n" >&4
12835 $rm -f try.* try core core.try.*
12837 : see if getcwd exists
12838 set getcwd d_getcwd
12841 : see if getespwnam exists
12842 set getespwnam d_getespwnam
12846 : see if getfsstat exists
12847 set getfsstat d_getfsstat
12850 : see if getgrent exists
12851 set getgrent d_getgrent
12854 : see if getgrent_r exists
12855 set getgrent_r d_getgrent_r
12857 case "$d_getgrent_r" in
12859 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12860 case "$d_getgrent_r_proto:$usethreads" in
12861 ":define") d_getgrent_r_proto=define
12862 set d_getgrent_r_proto getgrent_r $hdrs
12866 case "$d_getgrent_r_proto" in
12868 case "$getgrent_r_proto" in
12869 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
12870 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBWR ;;
12872 case "$getgrent_r_proto" in
12873 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
12874 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIR ;;
12876 case "$getgrent_r_proto" in
12877 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
12878 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBW ;;
12880 case "$getgrent_r_proto" in
12881 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
12882 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBI ;;
12884 case "$getgrent_r_proto" in
12885 ''|0) try='int getgrent_r(struct group*, char*, int);'
12886 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBI ;;
12888 case "$getgrent_r_proto" in
12889 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
12890 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIH ;;
12892 case "$getgrent_r_proto" in
12893 ''|0) d_getgrent_r=undef
12895 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
12896 * ) case "$getgrent_r_proto" in
12897 REENTRANT_PROTO*) ;;
12898 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
12900 echo "Prototype: $try" ;;
12903 *) case "$usethreads" in
12904 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
12911 *) getgrent_r_proto=0
12915 : see if getgrgid_r exists
12916 set getgrgid_r d_getgrgid_r
12918 case "$d_getgrgid_r" in
12920 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12921 case "$d_getgrgid_r_proto:$usethreads" in
12922 ":define") d_getgrgid_r_proto=define
12923 set d_getgrgid_r_proto getgrgid_r $hdrs
12927 case "$d_getgrgid_r_proto" in
12929 case "$getgrgid_r_proto" in
12930 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
12931 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
12933 case "$getgrgid_r_proto" in
12934 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
12935 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
12937 case "$getgrgid_r_proto" in
12938 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
12939 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
12941 case "$getgrgid_r_proto" in
12942 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
12943 ./protochk "extern $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
12945 case "$getgrgid_r_proto" in
12946 ''|0) d_getgrgid_r=undef
12948 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
12949 * ) case "$getgrgid_r_proto" in
12950 REENTRANT_PROTO*) ;;
12951 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
12953 echo "Prototype: $try" ;;
12956 *) case "$usethreads" in
12957 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
12964 *) getgrgid_r_proto=0
12968 : see if getgrnam_r exists
12969 set getgrnam_r d_getgrnam_r
12971 case "$d_getgrnam_r" in
12973 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12974 case "$d_getgrnam_r_proto:$usethreads" in
12975 ":define") d_getgrnam_r_proto=define
12976 set d_getgrnam_r_proto getgrnam_r $hdrs
12980 case "$d_getgrnam_r_proto" in
12982 case "$getgrnam_r_proto" in
12983 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
12984 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
12986 case "$getgrnam_r_proto" in
12987 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
12988 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
12990 case "$getgrnam_r_proto" in
12991 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
12992 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CBI ;;
12994 case "$getgrnam_r_proto" in
12995 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
12996 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
12998 case "$getgrnam_r_proto" in
12999 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
13000 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
13002 case "$getgrnam_r_proto" in
13003 ''|0) d_getgrnam_r=undef
13005 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
13006 * ) case "$getgrnam_r_proto" in
13007 REENTRANT_PROTO*) ;;
13008 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
13010 echo "Prototype: $try" ;;
13013 *) case "$usethreads" in
13014 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
13021 *) getgrnam_r_proto=0
13025 : see if gethostbyaddr exists
13026 set gethostbyaddr d_gethbyaddr
13029 : see if gethostbyname exists
13030 set gethostbyname d_gethbyname
13033 : see if gethostent exists
13034 set gethostent d_gethent
13037 : see how we will look up host name
13040 if set gethostname val -f d_gethname; eval $csym; $val; then
13041 echo 'gethostname() found.' >&4
13042 d_gethname="$define"
13045 if set uname val -f d_uname; eval $csym; $val; then
13048 uname() was found, but you're running xenix, and older versions of xenix
13049 have a broken uname(). If you don't really know whether your xenix is old
13050 enough to have a broken system call, use the default answer.
13055 "$define") dflt=n;;
13057 rp='Is your uname() broken?'
13060 n*) d_uname="$define"; call=uname;;
13063 echo 'uname() found.' >&4
13070 case "$d_gethname" in
13071 '') d_gethname="$undef";;
13074 '') d_uname="$undef";;
13076 case "$d_uname$d_gethname" in
13081 Every now and then someone has a $call() that lies about the hostname
13082 but can't be fixed for political or economic reasons. If you wish, I can
13083 pretend $call() isn't there and maybe compute hostname at run-time
13084 thanks to the '$phostname' command.
13087 rp="Shall I ignore $call() from now on?"
13090 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
13093 case "$phostname" in
13094 '') aphostname='';;
13095 *) case "$aphostname" in
13097 *) set X $phostname
13101 file=`./loc $file $file $pth`
13102 aphostname=`echo $file $*`
13107 case "$d_uname$d_gethname" in
13110 case "$phostname" in
13112 echo "There will be no way for $package to get your hostname." >&4;;
13114 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
13118 case "$d_phostname" in
13119 '') d_phostname="$undef";;
13122 : see if gethostbyaddr_r exists
13123 set gethostbyaddr_r d_gethostbyaddr_r
13125 case "$d_gethostbyaddr_r" in
13127 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13128 case "$d_gethostbyaddr_r_proto:$usethreads" in
13129 ":define") d_gethostbyaddr_r_proto=define
13130 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
13134 case "$d_gethostbyaddr_r_proto" in
13136 case "$gethostbyaddr_r_proto" in
13137 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13138 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
13140 case "$gethostbyaddr_r_proto" in
13141 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
13142 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
13144 case "$gethostbyaddr_r_proto" in
13145 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
13146 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
13148 case "$gethostbyaddr_r_proto" in
13149 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
13150 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
13152 case "$gethostbyaddr_r_proto" in
13153 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
13154 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
13156 case "$gethostbyaddr_r_proto" in
13157 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
13158 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
13160 case "$gethostbyaddr_r_proto" in
13161 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
13162 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
13164 case "$gethostbyaddr_r_proto" in
13165 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
13166 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
13168 case "$gethostbyaddr_r_proto" in
13169 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
13170 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
13172 case "$gethostbyaddr_r_proto" in
13173 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
13174 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
13176 case "$gethostbyaddr_r_proto" in
13177 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13178 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
13180 case "$gethostbyaddr_r_proto" in
13181 ''|0) d_gethostbyaddr_r=undef
13182 gethostbyaddr_r_proto=0
13183 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
13184 * ) case "$gethostbyaddr_r_proto" in
13185 REENTRANT_PROTO*) ;;
13186 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
13188 echo "Prototype: $try" ;;
13191 *) case "$usethreads" in
13192 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
13194 d_gethostbyaddr_r=undef
13195 gethostbyaddr_r_proto=0
13199 *) gethostbyaddr_r_proto=0
13203 : see if gethostbyname_r exists
13204 set gethostbyname_r d_gethostbyname_r
13206 case "$d_gethostbyname_r" in
13208 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13209 case "$d_gethostbyname_r_proto:$usethreads" in
13210 ":define") d_gethostbyname_r_proto=define
13211 set d_gethostbyname_r_proto gethostbyname_r $hdrs
13215 case "$d_gethostbyname_r_proto" in
13217 case "$gethostbyname_r_proto" in
13218 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
13219 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
13221 case "$gethostbyname_r_proto" in
13222 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
13223 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
13225 case "$gethostbyname_r_proto" in
13226 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
13227 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
13229 case "$gethostbyname_r_proto" in
13230 ''|0) d_gethostbyname_r=undef
13231 gethostbyname_r_proto=0
13232 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
13233 * ) case "$gethostbyname_r_proto" in
13234 REENTRANT_PROTO*) ;;
13235 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
13237 echo "Prototype: $try" ;;
13240 *) case "$usethreads" in
13241 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
13243 d_gethostbyname_r=undef
13244 gethostbyname_r_proto=0
13248 *) gethostbyname_r_proto=0
13252 : see if gethostent_r exists
13253 set gethostent_r d_gethostent_r
13255 case "$d_gethostent_r" in
13257 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13258 case "$d_gethostent_r_proto:$usethreads" in
13259 ":define") d_gethostent_r_proto=define
13260 set d_gethostent_r_proto gethostent_r $hdrs
13264 case "$d_gethostent_r_proto" in
13266 case "$gethostent_r_proto" in
13267 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
13268 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
13270 case "$gethostent_r_proto" in
13271 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
13272 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBIE ;;
13274 case "$gethostent_r_proto" in
13275 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
13276 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBIE ;;
13278 case "$gethostent_r_proto" in
13279 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
13280 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBI ;;
13282 case "$gethostent_r_proto" in
13283 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
13284 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBI ;;
13286 case "$gethostent_r_proto" in
13287 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
13288 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SD ;;
13290 case "$gethostent_r_proto" in
13291 ''|0) d_gethostent_r=undef
13292 gethostent_r_proto=0
13293 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
13294 * ) case "$gethostent_r_proto" in
13295 REENTRANT_PROTO*) ;;
13296 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
13298 echo "Prototype: $try" ;;
13301 *) case "$usethreads" in
13302 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
13304 d_gethostent_r=undef
13305 gethostent_r_proto=0
13309 *) gethostent_r_proto=0
13313 : see if prototypes for various gethostxxx netdb.h functions are available
13315 set d_gethostprotos gethostent $i_netdb netdb.h
13318 : see if getitimer exists
13319 set getitimer d_getitimer
13322 : see if getlogin exists
13323 set getlogin d_getlogin
13326 : see if getlogin_r exists
13327 set getlogin_r d_getlogin_r
13329 case "$d_getlogin_r" in
13331 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
13332 case "$d_getlogin_r_proto:$usethreads" in
13333 ":define") d_getlogin_r_proto=define
13334 set d_getlogin_r_proto getlogin_r $hdrs
13338 case "$d_getlogin_r_proto" in
13340 case "$getlogin_r_proto" in
13341 ''|0) try='int getlogin_r(char*, size_t);'
13342 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BW ;;
13344 case "$getlogin_r_proto" in
13345 ''|0) try='int getlogin_r(char*, int);'
13346 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BI ;;
13348 case "$getlogin_r_proto" in
13349 ''|0) try='char* getlogin_r(char*, size_t);'
13350 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BW ;;
13352 case "$getlogin_r_proto" in
13353 ''|0) try='char* getlogin_r(char*, int);'
13354 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BI ;;
13356 case "$getlogin_r_proto" in
13357 ''|0) d_getlogin_r=undef
13359 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
13360 * ) case "$getlogin_r_proto" in
13361 REENTRANT_PROTO*) ;;
13362 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
13364 echo "Prototype: $try" ;;
13367 *) case "$usethreads" in
13368 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
13375 *) getlogin_r_proto=0
13379 : see if getmnt exists
13380 set getmnt d_getmnt
13383 : see if getmntent exists
13384 set getmntent d_getmntent
13387 : see if getnetbyaddr exists
13388 set getnetbyaddr d_getnbyaddr
13391 : see if getnetbyname exists
13392 set getnetbyname d_getnbyname
13395 : see if getnetent exists
13396 set getnetent d_getnent
13399 : see if getnetbyaddr_r exists
13400 set getnetbyaddr_r d_getnetbyaddr_r
13402 case "$d_getnetbyaddr_r" in
13404 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13405 case "$d_getnetbyaddr_r_proto:$usethreads" in
13406 ":define") d_getnetbyaddr_r_proto=define
13407 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
13411 case "$d_getnetbyaddr_r_proto" in
13413 case "$getnetbyaddr_r_proto" in
13414 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
13415 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
13417 case "$getnetbyaddr_r_proto" in
13418 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
13419 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
13421 case "$getnetbyaddr_r_proto" in
13422 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
13423 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
13425 case "$getnetbyaddr_r_proto" in
13426 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
13427 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
13429 case "$getnetbyaddr_r_proto" in
13430 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
13431 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
13433 case "$getnetbyaddr_r_proto" in
13434 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
13435 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
13437 case "$getnetbyaddr_r_proto" in
13438 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
13439 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
13441 case "$getnetbyaddr_r_proto" in
13442 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
13443 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
13445 case "$getnetbyaddr_r_proto" in
13446 ''|0) d_getnetbyaddr_r=undef
13447 getnetbyaddr_r_proto=0
13448 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
13449 * ) case "$getnetbyaddr_r_proto" in
13450 REENTRANT_PROTO*) ;;
13451 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
13453 echo "Prototype: $try" ;;
13456 *) case "$usethreads" in
13457 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
13459 d_getnetbyaddr_r=undef
13460 getnetbyaddr_r_proto=0
13464 *) getnetbyaddr_r_proto=0
13468 : see if getnetbyname_r exists
13469 set getnetbyname_r d_getnetbyname_r
13471 case "$d_getnetbyname_r" in
13473 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13474 case "$d_getnetbyname_r_proto:$usethreads" in
13475 ":define") d_getnetbyname_r_proto=define
13476 set d_getnetbyname_r_proto getnetbyname_r $hdrs
13480 case "$d_getnetbyname_r_proto" in
13482 case "$getnetbyname_r_proto" in
13483 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
13484 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
13486 case "$getnetbyname_r_proto" in
13487 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
13488 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
13490 case "$getnetbyname_r_proto" in
13491 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
13492 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
13494 case "$getnetbyname_r_proto" in
13495 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
13496 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
13498 case "$getnetbyname_r_proto" in
13499 ''|0) d_getnetbyname_r=undef
13500 getnetbyname_r_proto=0
13501 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
13502 * ) case "$getnetbyname_r_proto" in
13503 REENTRANT_PROTO*) ;;
13504 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
13506 echo "Prototype: $try" ;;
13509 *) case "$usethreads" in
13510 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
13512 d_getnetbyname_r=undef
13513 getnetbyname_r_proto=0
13517 *) getnetbyname_r_proto=0
13521 : see if getnetent_r exists
13522 set getnetent_r d_getnetent_r
13524 case "$d_getnetent_r" in
13526 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13527 case "$d_getnetent_r_proto:$usethreads" in
13528 ":define") d_getnetent_r_proto=define
13529 set d_getnetent_r_proto getnetent_r $hdrs
13533 case "$d_getnetent_r_proto" in
13535 case "$getnetent_r_proto" in
13536 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
13537 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
13539 case "$getnetent_r_proto" in
13540 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
13541 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBIE ;;
13543 case "$getnetent_r_proto" in
13544 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
13545 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBIE ;;
13547 case "$getnetent_r_proto" in
13548 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
13549 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBI ;;
13551 case "$getnetent_r_proto" in
13552 ''|0) try='int getnetent_r(struct netent*, char*, int);'
13553 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBI ;;
13555 case "$getnetent_r_proto" in
13556 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
13557 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SD ;;
13559 case "$getnetent_r_proto" in
13560 ''|0) d_getnetent_r=undef
13561 getnetent_r_proto=0
13562 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
13563 * ) case "$getnetent_r_proto" in
13564 REENTRANT_PROTO*) ;;
13565 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
13567 echo "Prototype: $try" ;;
13570 *) case "$usethreads" in
13571 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
13573 d_getnetent_r=undef
13574 getnetent_r_proto=0
13578 *) getnetent_r_proto=0
13582 : see if prototypes for various getnetxxx netdb.h functions are available
13584 set d_getnetprotos getnetent $i_netdb netdb.h
13587 : see if getpagesize exists
13588 set getpagesize d_getpagsz
13592 : see if getprotobyname exists
13593 set getprotobyname d_getpbyname
13596 : see if getprotobynumber exists
13597 set getprotobynumber d_getpbynumber
13600 : see if getprotoent exists
13601 set getprotoent d_getpent
13604 : see if getpgid exists
13605 set getpgid d_getpgid
13608 : see if getpgrp2 exists
13609 set getpgrp2 d_getpgrp2
13612 : see if getppid exists
13613 set getppid d_getppid
13616 : see if getpriority exists
13617 set getpriority d_getprior
13620 : see if getprotobyname_r exists
13621 set getprotobyname_r d_getprotobyname_r
13623 case "$d_getprotobyname_r" in
13625 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13626 case "$d_getprotobyname_r_proto:$usethreads" in
13627 ":define") d_getprotobyname_r_proto=define
13628 set d_getprotobyname_r_proto getprotobyname_r $hdrs
13632 case "$d_getprotobyname_r_proto" in
13634 case "$getprotobyname_r_proto" in
13635 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
13636 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
13638 case "$getprotobyname_r_proto" in
13639 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
13640 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
13642 case "$getprotobyname_r_proto" in
13643 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
13644 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
13646 case "$getprotobyname_r_proto" in
13647 ''|0) d_getprotobyname_r=undef
13648 getprotobyname_r_proto=0
13649 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
13650 * ) case "$getprotobyname_r_proto" in
13651 REENTRANT_PROTO*) ;;
13652 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
13654 echo "Prototype: $try" ;;
13657 *) case "$usethreads" in
13658 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
13660 d_getprotobyname_r=undef
13661 getprotobyname_r_proto=0
13665 *) getprotobyname_r_proto=0
13669 : see if getprotobynumber_r exists
13670 set getprotobynumber_r d_getprotobynumber_r
13672 case "$d_getprotobynumber_r" in
13674 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13675 case "$d_getprotobynumber_r_proto:$usethreads" in
13676 ":define") d_getprotobynumber_r_proto=define
13677 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
13681 case "$d_getprotobynumber_r_proto" in
13683 case "$getprotobynumber_r_proto" in
13684 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
13685 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
13687 case "$getprotobynumber_r_proto" in
13688 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
13689 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
13691 case "$getprotobynumber_r_proto" in
13692 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
13693 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
13695 case "$getprotobynumber_r_proto" in
13696 ''|0) d_getprotobynumber_r=undef
13697 getprotobynumber_r_proto=0
13698 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
13699 * ) case "$getprotobynumber_r_proto" in
13700 REENTRANT_PROTO*) ;;
13701 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
13703 echo "Prototype: $try" ;;
13706 *) case "$usethreads" in
13707 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
13709 d_getprotobynumber_r=undef
13710 getprotobynumber_r_proto=0
13714 *) getprotobynumber_r_proto=0
13718 : see if getprotoent_r exists
13719 set getprotoent_r d_getprotoent_r
13721 case "$d_getprotoent_r" in
13723 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13724 case "$d_getprotoent_r_proto:$usethreads" in
13725 ":define") d_getprotoent_r_proto=define
13726 set d_getprotoent_r_proto getprotoent_r $hdrs
13730 case "$d_getprotoent_r_proto" in
13732 case "$getprotoent_r_proto" in
13733 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
13734 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
13736 case "$getprotoent_r_proto" in
13737 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
13738 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBI ;;
13740 case "$getprotoent_r_proto" in
13741 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
13742 ./protochk "extern $try" $hdrs && getprotoent_r_proto=S_SBI ;;
13744 case "$getprotoent_r_proto" in
13745 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
13746 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SD ;;
13748 case "$getprotoent_r_proto" in
13749 ''|0) d_getprotoent_r=undef
13750 getprotoent_r_proto=0
13751 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
13752 * ) case "$getprotoent_r_proto" in
13753 REENTRANT_PROTO*) ;;
13754 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
13756 echo "Prototype: $try" ;;
13759 *) case "$usethreads" in
13760 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
13762 d_getprotoent_r=undef
13763 getprotoent_r_proto=0
13767 *) getprotoent_r_proto=0
13771 : see if prototypes for various getprotoxxx netdb.h functions are available
13773 set d_getprotoprotos getprotoent $i_netdb netdb.h
13776 : see if getprpwnam exists
13777 set getprpwnam d_getprpwnam
13780 : see if getpwent exists
13781 set getpwent d_getpwent
13784 : see if getpwent_r exists
13785 set getpwent_r d_getpwent_r
13787 case "$d_getpwent_r" in
13789 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13790 case "$d_getpwent_r_proto:$usethreads" in
13791 ":define") d_getpwent_r_proto=define
13792 set d_getpwent_r_proto getpwent_r $hdrs
13796 case "$d_getpwent_r_proto" in
13798 case "$getpwent_r_proto" in
13799 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
13800 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBWR ;;
13802 case "$getpwent_r_proto" in
13803 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
13804 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIR ;;
13806 case "$getpwent_r_proto" in
13807 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
13808 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBW ;;
13810 case "$getpwent_r_proto" in
13811 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
13812 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBI ;;
13814 case "$getpwent_r_proto" in
13815 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
13816 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBI ;;
13818 case "$getpwent_r_proto" in
13819 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
13820 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIH ;;
13822 case "$getpwent_r_proto" in
13823 ''|0) d_getpwent_r=undef
13825 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
13826 * ) case "$getpwent_r_proto" in
13827 REENTRANT_PROTO*) ;;
13828 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
13830 echo "Prototype: $try" ;;
13833 *) case "$usethreads" in
13834 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
13841 *) getpwent_r_proto=0
13845 : see if getpwnam_r exists
13846 set getpwnam_r d_getpwnam_r
13848 case "$d_getpwnam_r" in
13850 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13851 case "$d_getpwnam_r_proto:$usethreads" in
13852 ":define") d_getpwnam_r_proto=define
13853 set d_getpwnam_r_proto getpwnam_r $hdrs
13857 case "$d_getpwnam_r_proto" in
13859 case "$getpwnam_r_proto" in
13860 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
13861 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
13863 case "$getpwnam_r_proto" in
13864 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
13865 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
13867 case "$getpwnam_r_proto" in
13868 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
13869 ./protochk "extern $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
13871 case "$getpwnam_r_proto" in
13872 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
13873 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
13875 case "$getpwnam_r_proto" in
13876 ''|0) d_getpwnam_r=undef
13878 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
13879 * ) case "$getpwnam_r_proto" in
13880 REENTRANT_PROTO*) ;;
13881 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
13883 echo "Prototype: $try" ;;
13886 *) case "$usethreads" in
13887 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
13894 *) getpwnam_r_proto=0
13898 : see if getpwuid_r exists
13899 set getpwuid_r d_getpwuid_r
13901 case "$d_getpwuid_r" in
13903 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13904 case "$d_getpwuid_r_proto:$usethreads" in
13905 ":define") d_getpwuid_r_proto=define
13906 set d_getpwuid_r_proto getpwuid_r $hdrs
13910 case "$d_getpwuid_r_proto" in
13912 case "$getpwuid_r_proto" in
13913 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
13914 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
13916 case "$getpwuid_r_proto" in
13917 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
13918 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
13920 case "$getpwuid_r_proto" in
13921 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
13922 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
13924 case "$getpwuid_r_proto" in
13925 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
13926 ./protochk "extern $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
13928 case "$getpwuid_r_proto" in
13929 ''|0) d_getpwuid_r=undef
13931 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
13932 * ) case "$getpwuid_r_proto" in
13933 REENTRANT_PROTO*) ;;
13934 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
13936 echo "Prototype: $try" ;;
13939 *) case "$usethreads" in
13940 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
13947 *) getpwuid_r_proto=0
13952 : see if getservbyname exists
13953 set getservbyname d_getsbyname
13956 : see if getservbyport exists
13957 set getservbyport d_getsbyport
13960 : see if getservent exists
13961 set getservent d_getsent
13964 : see if getservbyname_r exists
13965 set getservbyname_r d_getservbyname_r
13967 case "$d_getservbyname_r" in
13969 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13970 case "$d_getservbyname_r_proto:$usethreads" in
13971 ":define") d_getservbyname_r_proto=define
13972 set d_getservbyname_r_proto getservbyname_r $hdrs
13976 case "$d_getservbyname_r_proto" in
13978 case "$getservbyname_r_proto" in
13979 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
13980 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
13982 case "$getservbyname_r_proto" in
13983 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
13984 ./protochk "extern $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
13986 case "$getservbyname_r_proto" in
13987 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
13988 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
13990 case "$getservbyname_r_proto" in
13991 ''|0) d_getservbyname_r=undef
13992 getservbyname_r_proto=0
13993 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
13994 * ) case "$getservbyname_r_proto" in
13995 REENTRANT_PROTO*) ;;
13996 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
13998 echo "Prototype: $try" ;;
14001 *) case "$usethreads" in
14002 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
14004 d_getservbyname_r=undef
14005 getservbyname_r_proto=0
14009 *) getservbyname_r_proto=0
14013 : see if getservbyport_r exists
14014 set getservbyport_r d_getservbyport_r
14016 case "$d_getservbyport_r" in
14018 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14019 case "$d_getservbyport_r_proto:$usethreads" in
14020 ":define") d_getservbyport_r_proto=define
14021 set d_getservbyport_r_proto getservbyport_r $hdrs
14025 case "$d_getservbyport_r_proto" in
14027 case "$getservbyport_r_proto" in
14028 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
14029 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
14031 case "$getservbyport_r_proto" in
14032 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
14033 ./protochk "extern $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
14035 case "$getservbyport_r_proto" in
14036 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
14037 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
14039 case "$getservbyport_r_proto" in
14040 ''|0) d_getservbyport_r=undef
14041 getservbyport_r_proto=0
14042 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
14043 * ) case "$getservbyport_r_proto" in
14044 REENTRANT_PROTO*) ;;
14045 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
14047 echo "Prototype: $try" ;;
14050 *) case "$usethreads" in
14051 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
14053 d_getservbyport_r=undef
14054 getservbyport_r_proto=0
14058 *) getservbyport_r_proto=0
14062 : see if getservent_r exists
14063 set getservent_r d_getservent_r
14065 case "$d_getservent_r" in
14067 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14068 case "$d_getservent_r_proto:$usethreads" in
14069 ":define") d_getservent_r_proto=define
14070 set d_getservent_r_proto getservent_r $hdrs
14074 case "$d_getservent_r_proto" in
14076 case "$getservent_r_proto" in
14077 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
14078 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBWR ;;
14080 case "$getservent_r_proto" in
14081 ''|0) try='int getservent_r(struct servent*, char*, int);'
14082 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBI ;;
14084 case "$getservent_r_proto" in
14085 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
14086 ./protochk "extern $try" $hdrs && getservent_r_proto=S_SBI ;;
14088 case "$getservent_r_proto" in
14089 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
14090 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SD ;;
14092 case "$getservent_r_proto" in
14093 ''|0) d_getservent_r=undef
14094 getservent_r_proto=0
14095 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
14096 * ) case "$getservent_r_proto" in
14097 REENTRANT_PROTO*) ;;
14098 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
14100 echo "Prototype: $try" ;;
14103 *) case "$usethreads" in
14104 define) echo "getservent_r has no prototype, not using it." >&4 ;;
14106 d_getservent_r=undef
14107 getservent_r_proto=0
14111 *) getservent_r_proto=0
14115 : see if prototypes for various getservxxx netdb.h functions are available
14117 set d_getservprotos getservent $i_netdb netdb.h
14120 : see if getspnam exists
14121 set getspnam d_getspnam
14124 : see if this is a shadow.h system
14125 set shadow.h i_shadow
14128 : see if getspnam_r exists
14129 set getspnam_r d_getspnam_r
14131 case "$d_getspnam_r" in
14133 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
14134 case "$d_getspnam_r_proto:$usethreads" in
14135 ":define") d_getspnam_r_proto=define
14136 set d_getspnam_r_proto getspnam_r $hdrs
14140 case "$d_getspnam_r_proto" in
14142 case "$getspnam_r_proto" in
14143 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
14144 ./protochk "extern $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
14146 case "$getspnam_r_proto" in
14147 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
14148 ./protochk "extern $try" $hdrs && getspnam_r_proto=S_CSBI ;;
14150 case "$getspnam_r_proto" in
14151 ''|0) d_getspnam_r=undef
14153 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
14154 * ) case "$getspnam_r_proto" in
14155 REENTRANT_PROTO*) ;;
14156 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
14158 echo "Prototype: $try" ;;
14161 *) case "$usethreads" in
14162 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
14169 *) getspnam_r_proto=0
14173 : see if gettimeofday or ftime exists
14174 set gettimeofday d_gettimeod
14176 case "$d_gettimeod" in
14182 val="$undef"; set d_ftime; eval $setvar
14185 case "$d_gettimeod$d_ftime" in
14188 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
14192 : see if gmtime_r exists
14193 set gmtime_r d_gmtime_r
14195 case "$d_gmtime_r" in
14197 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14198 case "$d_gmtime_r_proto:$usethreads" in
14199 ":define") d_gmtime_r_proto=define
14200 set d_gmtime_r_proto gmtime_r $hdrs
14204 case "$d_gmtime_r_proto" in
14206 case "$gmtime_r_proto" in
14207 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
14208 ./protochk "extern $try" $hdrs && gmtime_r_proto=S_TS ;;
14210 case "$gmtime_r_proto" in
14211 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
14212 ./protochk "extern $try" $hdrs && gmtime_r_proto=I_TS ;;
14214 case "$gmtime_r_proto" in
14215 ''|0) d_gmtime_r=undef
14217 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
14218 * ) case "$gmtime_r_proto" in
14219 REENTRANT_PROTO*) ;;
14220 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
14222 echo "Prototype: $try" ;;
14225 *) case "$usethreads" in
14226 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
14233 *) gmtime_r_proto=0
14237 : see if hasmntopt exists
14238 set hasmntopt d_hasmntopt
14241 : see if this is a netinet/in.h or sys/in.h system
14242 set netinet/in.h i_niin sys/in.h i_sysin
14245 : see if arpa/inet.h has to be included
14246 set arpa/inet.h i_arpainet
14249 : see if htonl --and friends-- exists
14254 : Maybe they are macros.
14257 $cat >htonl.c <<EOM
14259 #include <sys/types.h>
14260 #$i_niin I_NETINET_IN
14262 #$i_arpainet I_ARPA_INET
14263 #ifdef I_NETINET_IN
14264 #include <netinet/in.h>
14267 #include <sys/in.h>
14270 #include <arpa/inet.h>
14273 printf("Defined as a macro.");
14276 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
14277 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
14279 echo "But it seems to be defined as a macro." >&4
14287 : see if ilogbl exists
14288 set ilogbl d_ilogbl
14293 if set index val -f; eval $csym; $val; then
14294 if set strchr val -f d_strchr; eval $csym; $val; then
14295 if $contains strchr "$strings" >/dev/null 2>&1 ; then
14298 echo "strchr() found." >&4
14302 echo "index() found." >&4
14307 echo "index() found." >&4
14310 if set strchr val -f d_strchr; eval $csym; $val; then
14313 echo "strchr() found." >&4
14315 echo "No index() or strchr() found!" >&4
14320 set d_strchr; eval $setvar
14322 set d_index; eval $setvar
14324 : check whether inet_aton exists
14325 set inet_aton d_inetaton
14330 $cat >isascii.c <<EOCP
14333 #$i_stdlib I_STDLIB
14335 #include <stdlib.h>
14346 if eval $compile; then
14347 echo "isascii() found." >&4
14350 echo "isascii() NOT found." >&4
14357 : see if isfinite exists
14358 set isfinite d_isfinite
14361 : see if isinf exists
14365 : see if isnan exists
14369 : see if isnanl exists
14370 set isnanl d_isnanl
14373 : see if killpg exists
14374 set killpg d_killpg
14377 : see if lchown exists
14379 $cat > try.c <<'EOCP'
14380 /* System header to define __stub macros and hopefully few prototypes,
14381 which can conflict with char lchown(); below. */
14382 #include <assert.h>
14383 /* Override any gcc2 internal prototype to avoid an error. */
14384 /* We use char because int might match the return type of a gcc2
14385 builtin and then its argument prototype would still apply. */
14388 /* The GNU C library defines this for functions which it implements
14389 to always fail with ENOSYS. Some functions are actually named
14390 something starting with __ and the normal name is an alias. */
14391 #if defined (__stub_lchown) || defined (__stub___lchown)
14399 if eval $compile; then
14400 $echo "lchown() found." >&4
14403 $echo "lchown() NOT found." >&4
14409 : See if number of significant digits in a double precision number is known
14411 $cat >ldbl_dig.c <<EOM
14412 #$i_limits I_LIMITS
14415 #include <limits.h>
14421 printf("Contains LDBL_DIG");
14424 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
14425 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
14426 echo "LDBL_DIG found." >&4
14429 echo "LDBL_DIG NOT found." >&4
14436 : see if this is a math.h system
14440 d_libm_lib_version="$undef"
14443 : check to see if math.h defines _LIB_VERSION
14445 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
14447 #include <unistd.h>
14449 int main (int argc, char *argv[])
14451 printf ("%d\n", _LIB_VERSION);
14456 if eval $compile; then
14458 echo "Yes, it does ($foo)" >&4
14459 d_libm_lib_version="$define"
14461 echo "No, it does not (probably harmless)\n" >&4
14463 $rm -f try.* try core core.try.*
14468 : see if link exists
14472 : see if localtime_r exists
14473 set localtime_r d_localtime_r
14475 case "$d_localtime_r" in
14477 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14478 case "$d_localtime_r_proto:$usethreads" in
14479 ":define") d_localtime_r_proto=define
14480 set d_localtime_r_proto localtime_r $hdrs
14484 case "$d_localtime_r_proto" in
14486 case "$localtime_r_proto" in
14487 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
14488 ./protochk "extern $try" $hdrs && localtime_r_proto=S_TS ;;
14490 case "$localtime_r_proto" in
14491 ''|0) try='int localtime_r(const time_t*, struct tm*);'
14492 ./protochk "extern $try" $hdrs && localtime_r_proto=I_TS ;;
14494 case "$localtime_r_proto" in
14495 ''|0) d_localtime_r=undef
14496 localtime_r_proto=0
14497 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
14498 * ) case "$localtime_r_proto" in
14499 REENTRANT_PROTO*) ;;
14500 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
14502 echo "Prototype: $try" ;;
14505 *) case "$usethreads" in
14506 define) echo "localtime_r has no prototype, not using it." >&4 ;;
14508 d_localtime_r=undef
14509 localtime_r_proto=0
14513 *) localtime_r_proto=0
14517 : see if localeconv exists
14518 set localeconv d_locconv
14521 : see if lockf exists
14525 : see if prototype for lseek is available
14527 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
14530 : see if lstat exists
14534 : see if madvise exists
14535 set madvise d_madvise
14538 : see if malloc_size exists
14539 set malloc_size d_malloc_size
14542 : see if malloc_size_good exists
14543 set malloc_good_size d_malloc_good_size
14546 : see if mblen exists
14550 : see if mbstowcs exists
14551 set mbstowcs d_mbstowcs
14554 : see if mbtowc exists
14555 set mbtowc d_mbtowc
14558 : see if memchr exists
14559 set memchr d_memchr
14562 : see if memcmp exists
14563 set memcmp d_memcmp
14566 : see if memcpy exists
14567 set memcpy d_memcpy
14570 : see if memmove exists
14571 set memmove d_memmove
14574 : see if memset exists
14575 set memset d_memset
14578 : see if mkdir exists
14582 : see if mkdtemp exists
14583 set mkdtemp d_mkdtemp
14586 : see if mkfifo exists
14587 set mkfifo d_mkfifo
14590 : see if mkstemp exists
14591 set mkstemp d_mkstemp
14594 : see if mkstemps exists
14595 set mkstemps d_mkstemps
14598 : see if mktime exists
14599 set mktime d_mktime
14602 : see if this is a sys/mman.h system
14603 set sys/mman.h i_sysmman
14606 : see if mmap exists
14609 : see what shmat returns
14610 : default to something harmless
14612 case "$i_sysmman$d_mmap" in
14614 $cat >mmap.c <<'END'
14615 #include <sys/mman.h>
14618 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
14623 echo "and it returns ($mmaptype)." >&4
14629 : see if sqrtl exists
14633 : see if scalbnl exists
14634 set scalbnl d_scalbnl
14637 : see if modfl exists
14641 : see if prototype for modfl is available
14643 set d_modflproto modfl $i_math math.h
14646 d_modfl_pow32_bug="$undef"
14648 case "$d_longdbl$d_modfl" in
14651 Checking to see whether your modfl() is okay for large values...
14657 if $test "X$d_modflproto" != "X$define"; then
14658 $cat >>try.c <<EOCP
14659 /* Sigh. many current glibcs provide the function, but do not prototype it. */
14660 long double modfl (long double, long double *);
14663 $cat >>try.c <<EOCP
14665 long double nv = 4294967303.15;
14671 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
14675 case "$osname:$gccversion" in
14676 aix:) saveccflags="$ccflags"
14677 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
14680 if eval $compile; then
14683 *" 4294967303.150000 1.150000 4294967302.000000")
14684 echo >&4 "Your modfl() is broken for large values."
14685 d_modfl_pow32_bug="$define"
14687 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
14691 *" 4294967303.150000 0.150000 4294967303.000000")
14692 echo >&4 "Your modfl() seems okay for large values."
14694 *) echo >&4 "I don't understand your modfl() at all."
14698 $rm -f try.* try core core.try.*
14700 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
14703 case "$osname:$gccversion" in
14704 aix:) ccflags="$saveccflags" ;; # restore
14709 if $test "$uselongdouble" = "$define"; then
14711 if $test "$d_sqrtl" != "$define"; then
14712 message="$message sqrtl"
14714 if $test "$d_modfl" != "$define"; then
14715 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
14716 echo "You have both aintl and copysignl, so I can emulate modfl."
14718 message="$message modfl"
14721 if $test "$d_frexpl" != "$define"; then
14722 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
14723 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
14725 message="$message frexpl"
14729 if $test "$message" != ""; then
14732 *** You requested the use of long doubles but you do not seem to have
14733 *** the following mathematical functions needed for long double support:
14735 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
14736 *** Cannot continue, aborting.
14744 : see if mprotect exists
14745 set mprotect d_mprotect
14748 : see if msgctl exists
14749 set msgctl d_msgctl
14752 : see if msgget exists
14753 set msgget d_msgget
14756 : see if msgsnd exists
14757 set msgsnd d_msgsnd
14760 : see if msgrcv exists
14761 set msgrcv d_msgrcv
14764 : see how much of the 'msg*(2)' library is present.
14767 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
14768 *"$undef"*) h_msg=false;;
14772 case "`ipcs 2>&1`" in
14773 "SVID messages"*"not configured"*)
14774 echo "Your $osname does not have the msg*(2) configured." >&4
14777 set msgctl d_msgctl
14779 set msgget d_msgget
14781 set msgsnd d_msgsnd
14783 set msgrcv d_msgrcv
14789 : we could also check for sys/ipc.h ...
14790 if $h_msg && $test `./findhdr sys/msg.h`; then
14791 echo "You have the full msg*(2) library." >&4
14794 echo "You don't have the full msg*(2) library." >&4
14802 echo "Checking to see if your system supports struct msghdr..." >&4
14803 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
14805 case "$d_msghdr_s" in
14806 "$define") echo "Yes, it does." ;;
14807 *) echo "No, it doesn't." ;;
14811 : see if msync exists
14815 : see if munmap exists
14816 set munmap d_munmap
14819 : see if nice exists
14823 : see if this is a langinfo.h system
14824 set langinfo.h i_langinfo
14827 : see if nl_langinfo exists
14828 set nl_langinfo d_nl_langinfo
14831 : check for length of character
14833 case "$charsize" in
14835 echo "Checking to see how big your characters are (hey, you never know)..." >&4
14838 #$i_stdlib I_STDLIB
14840 #include <stdlib.h>
14844 printf("%d\n", (int)sizeof(char));
14849 if eval $compile_ok; then
14853 echo "(I can't seem to compile the test program. Guessing...)"
14860 rp="What is the size of a character (in bytes)?"
14865 : check for volatile keyword
14867 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
14868 $cat >try.c <<'EOCP'
14871 typedef struct _goo_struct goo_struct;
14872 goo_struct * volatile goo = ((goo_struct *)0);
14873 struct _goo_struct {
14878 typedef unsigned short foo_t;
14879 char *volatile foo;
14881 volatile foo_t blech;
14885 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
14887 echo "Yup, it does."
14890 echo "Nope, it doesn't."
14898 $echo "Choosing the C types to be used for Perl's internal types..." >&4
14900 case "$use64bitint:$d_quad:$quadtype" in
14903 uvtype="$uquadtype"
14908 uvtype="unsigned long"
14914 case "$uselongdouble:$d_longdbl" in
14916 nvtype="long double"
14917 nvsize=$longdblsize
14924 $echo "(IV will be "$ivtype", $ivsize bytes)"
14925 $echo "(UV will be "$uvtype", $uvsize bytes)"
14926 $echo "(NV will be "$nvtype", $nvsize bytes)"
14929 #$i_inttypes I_INTTYPES
14931 #include <inttypes.h>
14936 int8_t i = INT8_MAX;
14937 uint8_t u = UINT8_MAX;
14938 printf("int8_t\n");
14941 int16_t i = INT16_MAX;
14942 uint16_t i = UINT16_MAX;
14943 printf("int16_t\n");
14946 int32_t i = INT32_MAX;
14947 uint32_t u = UINT32_MAX;
14948 printf("int32_t\n");
14954 '') case "$charsize" in
14956 u8type="unsigned char"
14965 if eval $compile; then
14966 case "`$run ./try`" in
14967 int8_t) i8type=int8_t
14977 '') if $test $charsize -ge 1; then
14979 u8type="unsigned char"
14987 '') case "$shortsize" in
14989 u16type="unsigned short"
14997 '') set try -DINT16
14998 if eval $compile; then
14999 case "`$run ./try`" in
15011 '') if $test $shortsize -ge 2; then
15013 u16type="unsigned short"
15021 '') case "$longsize" in
15023 u32type="unsigned long"
15027 *) case "$intsize" in
15029 u32type="unsigned int"
15039 '') set try -DINT32
15040 if eval $compile; then
15041 case "`$run ./try`" in
15053 '') if $test $intsize -ge 4; then
15055 u32type="unsigned int"
15063 '') case "$d_quad:$quadtype" in
15065 i64type="$quadtype"
15066 u64type="$uquadtype"
15074 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
15075 : volatile so that the compiler has to store it out to memory.
15076 if test X"$d_volatile" = X"$define"; then
15081 #$i_stdlib I_STDLIB
15083 #include <stdlib.h>
15085 #include <sys/types.h>
15086 #include <signal.h>
15088 $volatile int bletched = 0;
15089 $signal_t blech(int s) { bletched = 1; }
15094 int n = 8 * $uvsize;
15097 signal(SIGFPE, blech);
15100 for (i = 0; i < n; i++) {
15101 u = u << 1 | ($uvtype)1;
15103 if (($uvtype)d != u)
15107 d = ($nvtype)(u - 1);
15108 if (($uvtype)d != (u - 1))
15116 printf("%d\n", ((i == n) ? -n : i));
15122 d_nv_preserves_uv="$undef"
15123 if eval $compile; then
15124 nv_preserves_uv_bits="`$run ./try`"
15126 case "$nv_preserves_uv_bits" in
15128 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
15129 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
15130 d_nv_preserves_uv="$define"
15132 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
15133 d_nv_preserves_uv="$undef" ;;
15134 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
15135 nv_preserves_uv_bits="$undef" ;;
15140 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
15141 : volatile so that the compiler has to store it out to memory.
15142 if test X"$d_volatile" = X"$define"; then
15147 #$i_stdlib I_STDLIB
15149 #include <stdlib.h>
15151 #$i_string I_STRING
15153 # include <string.h>
15155 # include <strings.h>
15157 #include <sys/types.h>
15158 #include <signal.h>
15160 $volatile int bletched = 0;
15161 $signal_t blech(int s) { bletched = 1; }
15164 int checkit($nvtype d, char *where) {
15165 unsigned char *p = (char *)&d;
15166 unsigned char *end = p + sizeof(d);
15176 printf("No - %s: 0x", where);
15178 printf ("%02X", *p++);
15183 int main(int argc, char **argv) {
15186 fail += checkit(d, "0.0");
15188 /* The compiler shouldn't be assuming that bletched is 0 */
15191 fail += checkit(d, "bleched");
15194 signal(SIGFPE, blech);
15197 /* Paranoia - the compiler should have no way of knowing that ANSI says
15198 that argv[argc] will always be NULL. Actually, if it did assume this it
15199 would be buggy, as this is C and main() can be called from elsewhere in
15201 d = argv[argc] ? 1 : 0;
15204 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
15207 fail += checkit(d, "ternary");
15209 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
15212 printf("No - memset doesn't give 0.0\n");
15213 /* This might just blow up: */
15214 printf("(gives %g)\n", d);
15220 printf("No - something bleched\n");
15225 printf("No - %d fail(s)\n", fail);
15234 d_nv_zero_is_allbits_zero="$undef"
15235 if eval $compile; then
15241 0.0 is represented as all bits zero in memory
15243 d_nv_zero_is_allbits_zero="$define"
15246 0.0 is not represented as all bits zero in memory
15248 d_nv_zero_is_allbits_zero="$undef"
15253 0.0 is not represented as all bits zero in memory
15255 d_nv_zero_is_allbits_zero="$undef"
15263 : check for off64_t
15265 echo "Checking to see if you have off64_t..." >&4
15267 #include <sys/types.h>
15268 #include <unistd.h>
15269 int main() { off64_t x = 7; }
15272 if eval $compile; then
15274 echo "You have off64_t."
15277 echo "You do not have off64_t."
15278 case "$lseeksize" in
15279 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
15286 : how to create joinable pthreads
15287 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
15289 echo "Checking what constant to use for creating joinable pthreads..." >&4
15290 $cat >try.c <<'EOCP'
15291 #include <pthread.h>
15293 int detachstate = JOINABLE;
15296 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
15297 if eval $compile; then
15298 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
15299 val="$undef" # Yes, undef.
15300 set d_old_pthread_create_joinable
15303 set old_pthread_create_joinable
15306 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
15307 if eval $compile; then
15308 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
15310 set d_old_pthread_create_joinable
15312 val=PTHREAD_CREATE_UNDETACHED
15313 set old_pthread_create_joinable
15316 set try -DJOINABLE=__UNDETACHED
15317 if eval $compile; then
15318 echo "You seem to use __UNDETACHED." >&4
15320 set d_old_pthread_create_joinable
15323 set old_pthread_create_joinable
15326 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
15328 set d_old_pthread_create_joinable
15331 set old_pthread_create_joinable
15338 d_old_pthread_create_joinable="$undef"
15339 old_pthread_create_joinable=""
15342 : see if pause exists
15346 : see if pipe exists
15350 : see if poll exists
15354 : see if readlink exists
15355 set readlink d_readlink
15361 case "$d_readlink" in
15363 if $issymlink /proc/self/exe ; then
15364 $ls -l /proc/self/exe > reflect
15365 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
15366 echo "You have Linux-like /proc/self/exe."
15367 procselfexe='"/proc/self/exe"'
15371 if $issymlink /proc/curproc/file ; then
15372 $ls -l /proc/curproc/file > reflect
15373 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
15374 echo "You have BSD-like /proc/curproc/file."
15375 procselfexe='"/proc/curproc/file"'
15385 : see whether the pthread_atfork exists
15387 #include <pthread.h>
15390 #ifdef PTHREAD_ATFORK
15391 pthread_atfork(NULL,NULL,NULL);
15396 : see if pthread_atfork exists
15397 set try -DPTHREAD_ATFORK
15398 if eval $compile; then
15403 case "$usethreads" in
15406 $define) echo 'pthread_atfork found.' >&4 ;;
15407 *) echo 'pthread_atfork NOT found.' >&4 ;;
15410 set d_pthread_atfork
15413 : see if pthread_attr_setscope exists
15414 set pthread_attr_setscope d_pthread_attr_setscope
15418 : see whether the various POSIXish _yields exist
15420 #include <pthread.h>
15426 #ifdef PTHREAD_YIELD
15429 #ifdef PTHREAD_YIELD_NULL
15430 pthread_yield(NULL);
15436 : see if sched_yield exists
15437 set try -DSCHED_YIELD
15438 if eval $compile; then
15440 sched_yield='sched_yield()'
15444 case "$usethreads" in
15447 $define) echo 'sched_yield() found.' >&4 ;;
15448 *) echo 'sched_yield() NOT found.' >&4 ;;
15454 : see if pthread_yield exists
15455 set try -DPTHREAD_YIELD
15456 if eval $compile; then
15458 case "$sched_yield" in
15459 '') sched_yield='pthread_yield()' ;;
15462 set try -DPTHREAD_YIELD_NULL
15463 if eval $compile; then
15465 case "$sched_yield" in
15466 '') sched_yield='pthread_yield(NULL)' ;;
15472 case "$usethreads" in
15475 $define) echo 'pthread_yield() found.' >&4 ;;
15476 *) echo 'pthread_yield() NOT found.' >&4 ;;
15480 set d_pthread_yield
15483 case "$sched_yield" in
15484 '') sched_yield=undef ;;
15489 : see if random_r exists
15490 set random_r d_random_r
15492 case "$d_random_r" in
15494 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
15495 case "$d_random_r_proto:$usethreads" in
15496 ":define") d_random_r_proto=define
15497 set d_random_r_proto random_r $hdrs
15501 case "$d_random_r_proto" in
15503 case "$random_r_proto" in
15504 ''|0) try='int random_r(int*, struct random_data*);'
15505 ./protochk "extern $try" $hdrs && random_r_proto=I_iS ;;
15507 case "$random_r_proto" in
15508 ''|0) try='int random_r(long*, struct random_data*);'
15509 ./protochk "extern $try" $hdrs && random_r_proto=I_lS ;;
15511 case "$random_r_proto" in
15512 ''|0) try='int random_r(struct random_data*, int32_t*);'
15513 ./protochk "extern $try" $hdrs && random_r_proto=I_St ;;
15515 case "$random_r_proto" in
15516 ''|0) d_random_r=undef
15518 echo "Disabling random_r, cannot determine prototype." >&4 ;;
15519 * ) case "$random_r_proto" in
15520 REENTRANT_PROTO*) ;;
15521 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
15523 echo "Prototype: $try" ;;
15526 *) case "$usethreads" in
15527 define) echo "random_r has no prototype, not using it." >&4 ;;
15534 *) random_r_proto=0
15538 : see if readdir and friends exist
15539 set readdir d_readdir
15541 set seekdir d_seekdir
15543 set telldir d_telldir
15545 set rewinddir d_rewinddir
15548 : see if readdir64_r exists
15549 set readdir64_r d_readdir64_r
15551 case "$d_readdir64_r" in
15553 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
15554 case "$d_readdir64_r_proto:$usethreads" in
15555 ":define") d_readdir64_r_proto=define
15556 set d_readdir64_r_proto readdir64_r $hdrs
15560 case "$d_readdir64_r_proto" in
15562 case "$readdir64_r_proto" in
15563 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
15564 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TSR ;;
15566 case "$readdir64_r_proto" in
15567 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
15568 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TS ;;
15570 case "$readdir64_r_proto" in
15571 ''|0) d_readdir64_r=undef
15572 readdir64_r_proto=0
15573 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
15574 * ) case "$readdir64_r_proto" in
15575 REENTRANT_PROTO*) ;;
15576 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
15578 echo "Prototype: $try" ;;
15581 *) case "$usethreads" in
15582 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
15584 d_readdir64_r=undef
15585 readdir64_r_proto=0
15589 *) readdir64_r_proto=0
15593 : see if readdir_r exists
15594 set readdir_r d_readdir_r
15596 case "$d_readdir_r" in
15598 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
15599 case "$d_readdir_r_proto:$usethreads" in
15600 ":define") d_readdir_r_proto=define
15601 set d_readdir_r_proto readdir_r $hdrs
15605 case "$d_readdir_r_proto" in
15607 case "$readdir_r_proto" in
15608 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
15609 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TSR ;;
15611 case "$readdir_r_proto" in
15612 ''|0) try='int readdir_r(DIR*, struct dirent*);'
15613 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TS ;;
15615 case "$readdir_r_proto" in
15616 ''|0) d_readdir_r=undef
15618 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
15619 * ) case "$readdir_r_proto" in
15620 REENTRANT_PROTO*) ;;
15621 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
15623 echo "Prototype: $try" ;;
15626 *) case "$usethreads" in
15627 define) echo "readdir_r has no prototype, not using it." >&4 ;;
15634 *) readdir_r_proto=0
15638 : see if readv exists
15642 : see if recvmsg exists
15643 set recvmsg d_recvmsg
15646 : see if rename exists
15647 set rename d_rename
15650 : see if rmdir exists
15654 : see if memory.h is available.
15659 : See if it conflicts with string.h
15665 $cppstdin $cppflags $cppminus < $strings > mem.h
15666 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
15668 echo "We won't be including <memory.h>."
15678 : can bcopy handle overlapping blocks?
15681 case "$d_memmove" in
15682 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
15683 *) case "$d_bcopy" in
15685 echo "Checking to see if bcopy() can do overlapping copies..." >&4
15687 #$i_memory I_MEMORY
15688 #$i_stdlib I_STDLIB
15689 #$i_string I_STRING
15690 #$i_unistd I_UNISTD
15692 $cat >>try.c <<'EOCP'
15695 # include <memory.h>
15698 # include <stdlib.h>
15701 # include <string.h>
15703 # include <strings.h>
15706 # include <unistd.h> /* Needed for NetBSD */
15710 char buf[128], abc[128];
15716 /* Copy "abcde..." string to char abc[] so that gcc doesn't
15717 try to store the string in read-only memory. */
15718 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
15720 for (align = 7; align >= 0; align--) {
15721 for (len = 36; len; len--) {
15723 bcopy(abc, b, len);
15724 for (off = 1; off <= len; off++) {
15725 bcopy(b, b+off, len);
15726 bcopy(b+off, b, len);
15727 if (bcmp(b, abc, len))
15736 if eval $compile_ok; then
15737 if ./try 2>/dev/null; then
15738 echo "Yes, it can."
15741 echo "It can't, sorry."
15744 echo "(I can't compile the test program, so we'll assume not...)"
15748 $rm -f try.* try core
15754 : can memcpy handle overlapping blocks?
15757 case "$d_memmove" in
15758 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
15759 *) case "$d_memcpy" in
15761 echo "Checking to see if memcpy() can do overlapping copies..." >&4
15763 #$i_memory I_MEMORY
15764 #$i_stdlib I_STDLIB
15765 #$i_string I_STRING
15766 #$i_unistd I_UNISTD
15768 $cat >>try.c <<'EOCP'
15771 # include <memory.h>
15774 # include <stdlib.h>
15777 # include <string.h>
15779 # include <strings.h>
15782 # include <unistd.h> /* Needed for NetBSD */
15786 char buf[128], abc[128];
15792 /* Copy "abcde..." string to char abc[] so that gcc doesn't
15793 try to store the string in read-only memory. */
15794 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
15796 for (align = 7; align >= 0; align--) {
15797 for (len = 36; len; len--) {
15799 memcpy(b, abc, len);
15800 for (off = 1; off <= len; off++) {
15801 memcpy(b+off, b, len);
15802 memcpy(b, b+off, len);
15803 if (memcmp(b, abc, len))
15812 if eval $compile_ok; then
15813 if ./try 2>/dev/null; then
15814 echo "Yes, it can."
15817 echo "It can't, sorry."
15820 echo "(I can't compile the test program, so we'll assume not...)"
15824 $rm -f try.* try core
15830 : can memcmp be trusted to compare relative magnitude?
15832 case "$d_memcmp" in
15835 echo "Checking if your memcmp() can compare relative magnitude..." >&4
15837 #$i_memory I_MEMORY
15838 #$i_stdlib I_STDLIB
15839 #$i_string I_STRING
15840 #$i_unistd I_UNISTD
15842 $cat >>try.c <<'EOCP'
15845 # include <memory.h>
15848 # include <stdlib.h>
15851 # include <string.h>
15853 # include <strings.h>
15856 # include <unistd.h> /* Needed for NetBSD */
15862 if ((a < b) && memcmp(&a, &b, 1) < 0)
15868 if eval $compile_ok; then
15869 if $run ./try 2>/dev/null; then
15870 echo "Yes, it can."
15873 echo "No, it can't (it uses signed chars)."
15876 echo "(I can't compile the test program, so we'll assume not...)"
15880 $rm -f try.* try core
15884 : see if prototype for sbrk is available
15886 set d_sbrkproto sbrk $i_unistd unistd.h
15889 : see if select exists
15890 set select d_select
15893 : see if semctl exists
15894 set semctl d_semctl
15897 : see if semget exists
15898 set semget d_semget
15901 : see if semop exists
15905 : see how much of the 'sem*(2)' library is present.
15908 case "$d_semctl$d_semget$d_semop" in
15909 *"$undef"*) h_sem=false;;
15913 case "`ipcs 2>&1`" in
15914 "SVID messages"*"not configured"*)
15915 echo "Your $osname does not have the sem*(2) configured." >&4
15918 set semctl d_semctl
15920 set semget d_semget
15928 : we could also check for sys/ipc.h ...
15929 if $h_sem && $test `./findhdr sys/sem.h`; then
15930 echo "You have the full sem*(2) library." >&4
15933 echo "You don't have the full sem*(2) library." >&4
15939 : see whether sys/sem.h defines union semun
15941 $cat > try.c <<'END'
15942 #include <sys/types.h>
15943 #include <sys/ipc.h>
15944 #include <sys/sem.h>
15945 int main () { union semun semun; semun.buf = 0; }
15948 if eval $compile; then
15949 echo "You have union semun in <sys/sem.h>." >&4
15952 echo "You do not have union semun in <sys/sem.h>." >&4
15959 : see how to do semctl IPC_STAT
15966 # define S_IRUSR S_IREAD
15967 # define S_IWUSR S_IWRITE
15968 # define S_IXUSR S_IEXEC
15970 # define S_IRUSR 0400
15971 # define S_IWUSR 0200
15972 # define S_IXUSR 0100
15974 # define S_IRGRP (S_IRUSR>>3)
15975 # define S_IWGRP (S_IWUSR>>3)
15976 # define S_IXGRP (S_IXUSR>>3)
15977 # define S_IROTH (S_IRUSR>>6)
15978 # define S_IWOTH (S_IWUSR>>6)
15979 # define S_IXOTH (S_IXUSR>>6)
15982 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
15983 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
15984 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
15987 : see whether semctl IPC_STAT can use union semun
15988 case "$d_semctl_semun" in
15992 #include <sys/types.h>
15993 #include <sys/ipc.h>
15994 #include <sys/sem.h>
15995 #include <sys/stat.h>
16002 #$d_union_semun HAS_UNION_SEMUN
16005 #ifndef HAS_UNION_SEMUN
16008 struct semid_ds *buf;
16009 unsigned short *array;
16015 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16016 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16018 struct semid_ds argbuf;
16021 st = semctl(sem, 0, IPC_STAT, arg);
16025 # endif /* IPC_STAT */
16026 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16028 if (semctl(sem, 0, IPC_RMID, arg) != 0)
16029 # endif /* IPC_RMID */
16030 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16032 #endif /* IPC_PRIVATE && ... */
16033 printf("semget failed: errno = %d\n", errno);
16038 if eval $compile; then
16041 semun) val="$define" ;;
16049 case "$d_semctl_semun" in
16051 echo "You can use union semun for semctl IPC_STAT." >&4
16054 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
16059 : see whether semctl IPC_STAT can use struct semid_ds pointer
16060 case "$d_semctl_semid_ds" in
16063 $cat > try.c <<'END'
16064 #include <sys/types.h>
16065 #include <sys/ipc.h>
16066 #include <sys/sem.h>
16067 #include <sys/stat.h>
16075 struct semid_ds arg;
16078 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16079 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16082 st = semctl(sem, 0, IPC_STAT, &arg);
16084 printf("semid_ds\n");
16086 # endif /* IPC_STAT */
16087 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16089 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
16090 # endif /* IPC_RMID */
16091 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16093 #endif /* IPC_PRIVATE && ... */
16094 printf("semget failed: errno = %d\n", errno);
16100 if eval $compile; then
16103 semid_ds) val="$define" ;;
16107 set d_semctl_semid_ds
16111 case "$d_semctl_semid_ds" in
16113 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
16115 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
16122 # We do not have the full sem*(2) library, so assume we can not
16128 set d_semctl_semid_ds
16133 : see if sendmsg exists
16134 set sendmsg d_sendmsg
16137 : see if setegid exists
16138 set setegid d_setegid
16141 : see if seteuid exists
16142 set seteuid d_seteuid
16145 : see if setgrent exists
16146 set setgrent d_setgrent
16149 : see if setgrent_r exists
16150 set setgrent_r d_setgrent_r
16152 case "$d_setgrent_r" in
16154 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
16155 case "$d_setgrent_r_proto:$usethreads" in
16156 ":define") d_setgrent_r_proto=define
16157 set d_setgrent_r_proto setgrent_r $hdrs
16161 case "$d_setgrent_r_proto" in
16163 case "$setgrent_r_proto" in
16164 ''|0) try='int setgrent_r(FILE**);'
16165 ./protochk "extern $try" $hdrs && setgrent_r_proto=I_H ;;
16167 case "$setgrent_r_proto" in
16168 ''|0) try='void setgrent_r(FILE**);'
16169 ./protochk "extern $try" $hdrs && setgrent_r_proto=V_H ;;
16171 case "$setgrent_r_proto" in
16172 ''|0) d_setgrent_r=undef
16174 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
16175 * ) case "$setgrent_r_proto" in
16176 REENTRANT_PROTO*) ;;
16177 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
16179 echo "Prototype: $try" ;;
16182 *) case "$usethreads" in
16183 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
16190 *) setgrent_r_proto=0
16194 : see if sethostent exists
16195 set sethostent d_sethent
16198 : see if sethostent_r exists
16199 set sethostent_r d_sethostent_r
16201 case "$d_sethostent_r" in
16203 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16204 case "$d_sethostent_r_proto:$usethreads" in
16205 ":define") d_sethostent_r_proto=define
16206 set d_sethostent_r_proto sethostent_r $hdrs
16210 case "$d_sethostent_r_proto" in
16212 case "$sethostent_r_proto" in
16213 ''|0) try='int sethostent_r(int, struct hostent_data*);'
16214 ./protochk "extern $try" $hdrs && sethostent_r_proto=I_ID ;;
16216 case "$sethostent_r_proto" in
16217 ''|0) try='void sethostent_r(int, struct hostent_data*);'
16218 ./protochk "extern $try" $hdrs && sethostent_r_proto=V_ID ;;
16220 case "$sethostent_r_proto" in
16221 ''|0) d_sethostent_r=undef
16222 sethostent_r_proto=0
16223 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
16224 * ) case "$sethostent_r_proto" in
16225 REENTRANT_PROTO*) ;;
16226 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
16228 echo "Prototype: $try" ;;
16231 *) case "$usethreads" in
16232 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
16234 d_sethostent_r=undef
16235 sethostent_r_proto=0
16239 *) sethostent_r_proto=0
16243 : see if setitimer exists
16244 set setitimer d_setitimer
16247 : see if setlinebuf exists
16248 set setlinebuf d_setlinebuf
16251 : see if setlocale exists
16252 set setlocale d_setlocale
16255 : see if locale.h is available
16256 set locale.h i_locale
16259 : see if setlocale_r exists
16260 set setlocale_r d_setlocale_r
16262 case "$d_setlocale_r" in
16264 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
16265 case "$d_setlocale_r_proto:$usethreads" in
16266 ":define") d_setlocale_r_proto=define
16267 set d_setlocale_r_proto setlocale_r $hdrs
16271 case "$d_setlocale_r_proto" in
16273 case "$setlocale_r_proto" in
16274 ''|0) try='int setlocale_r(int, const char*, char*, int);'
16275 ./protochk "extern $try" $hdrs && setlocale_r_proto=I_ICBI ;;
16277 case "$setlocale_r_proto" in
16278 ''|0) d_setlocale_r=undef
16279 setlocale_r_proto=0
16280 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
16281 * ) case "$setlocale_r_proto" in
16282 REENTRANT_PROTO*) ;;
16283 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
16285 echo "Prototype: $try" ;;
16288 *) case "$usethreads" in
16289 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
16291 d_setlocale_r=undef
16292 setlocale_r_proto=0
16296 *) setlocale_r_proto=0
16300 : see if setnetent exists
16301 set setnetent d_setnent
16304 : see if setnetent_r exists
16305 set setnetent_r d_setnetent_r
16307 case "$d_setnetent_r" in
16309 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16310 case "$d_setnetent_r_proto:$usethreads" in
16311 ":define") d_setnetent_r_proto=define
16312 set d_setnetent_r_proto setnetent_r $hdrs
16316 case "$d_setnetent_r_proto" in
16318 case "$setnetent_r_proto" in
16319 ''|0) try='int setnetent_r(int, struct netent_data*);'
16320 ./protochk "extern $try" $hdrs && setnetent_r_proto=I_ID ;;
16322 case "$setnetent_r_proto" in
16323 ''|0) try='void setnetent_r(int, struct netent_data*);'
16324 ./protochk "extern $try" $hdrs && setnetent_r_proto=V_ID ;;
16326 case "$setnetent_r_proto" in
16327 ''|0) d_setnetent_r=undef
16328 setnetent_r_proto=0
16329 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
16330 * ) case "$setnetent_r_proto" in
16331 REENTRANT_PROTO*) ;;
16332 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
16334 echo "Prototype: $try" ;;
16337 *) case "$usethreads" in
16338 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
16340 d_setnetent_r=undef
16341 setnetent_r_proto=0
16345 *) setnetent_r_proto=0
16349 : see if setprotoent exists
16350 set setprotoent d_setpent
16353 : see if setpgid exists
16354 set setpgid d_setpgid
16357 : see if setpgrp2 exists
16358 set setpgrp2 d_setpgrp2
16361 : see if setpriority exists
16362 set setpriority d_setprior
16365 : see if setproctitle exists
16366 set setproctitle d_setproctitle
16369 : see if setprotoent_r exists
16370 set setprotoent_r d_setprotoent_r
16372 case "$d_setprotoent_r" in
16374 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16375 case "$d_setprotoent_r_proto:$usethreads" in
16376 ":define") d_setprotoent_r_proto=define
16377 set d_setprotoent_r_proto setprotoent_r $hdrs
16381 case "$d_setprotoent_r_proto" in
16383 case "$setprotoent_r_proto" in
16384 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
16385 ./protochk "extern $try" $hdrs && setprotoent_r_proto=I_ID ;;
16387 case "$setprotoent_r_proto" in
16388 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
16389 ./protochk "extern $try" $hdrs && setprotoent_r_proto=V_ID ;;
16391 case "$setprotoent_r_proto" in
16392 ''|0) d_setprotoent_r=undef
16393 setprotoent_r_proto=0
16394 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
16395 * ) case "$setprotoent_r_proto" in
16396 REENTRANT_PROTO*) ;;
16397 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
16399 echo "Prototype: $try" ;;
16402 *) case "$usethreads" in
16403 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
16405 d_setprotoent_r=undef
16406 setprotoent_r_proto=0
16410 *) setprotoent_r_proto=0
16414 : see if setpwent exists
16415 set setpwent d_setpwent
16418 : see if setpwent_r exists
16419 set setpwent_r d_setpwent_r
16421 case "$d_setpwent_r" in
16423 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
16424 case "$d_setpwent_r_proto:$usethreads" in
16425 ":define") d_setpwent_r_proto=define
16426 set d_setpwent_r_proto setpwent_r $hdrs
16430 case "$d_setpwent_r_proto" in
16432 case "$setpwent_r_proto" in
16433 ''|0) try='int setpwent_r(FILE**);'
16434 ./protochk "extern $try" $hdrs && setpwent_r_proto=I_H ;;
16436 case "$setpwent_r_proto" in
16437 ''|0) try='void setpwent_r(FILE**);'
16438 ./protochk "extern $try" $hdrs && setpwent_r_proto=V_H ;;
16440 case "$setpwent_r_proto" in
16441 ''|0) d_setpwent_r=undef
16443 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
16444 * ) case "$setpwent_r_proto" in
16445 REENTRANT_PROTO*) ;;
16446 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
16448 echo "Prototype: $try" ;;
16451 *) case "$usethreads" in
16452 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
16459 *) setpwent_r_proto=0
16463 : see if setregid exists
16464 set setregid d_setregid
16466 set setresgid d_setresgid
16469 : see if setreuid exists
16470 set setreuid d_setreuid
16472 set setresuid d_setresuid
16475 : see if setrgid exists
16476 set setrgid d_setrgid
16479 : see if setruid exists
16480 set setruid d_setruid
16483 : see if setservent exists
16484 set setservent d_setsent
16487 : see if setservent_r exists
16488 set setservent_r d_setservent_r
16490 case "$d_setservent_r" in
16492 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16493 case "$d_setservent_r_proto:$usethreads" in
16494 ":define") d_setservent_r_proto=define
16495 set d_setservent_r_proto setservent_r $hdrs
16499 case "$d_setservent_r_proto" in
16501 case "$setservent_r_proto" in
16502 ''|0) try='int setservent_r(int, struct servent_data*);'
16503 ./protochk "extern $try" $hdrs && setservent_r_proto=I_ID ;;
16505 case "$setservent_r_proto" in
16506 ''|0) try='void setservent_r(int, struct servent_data*);'
16507 ./protochk "extern $try" $hdrs && setservent_r_proto=V_ID ;;
16509 case "$setservent_r_proto" in
16510 ''|0) d_setservent_r=undef
16511 setservent_r_proto=0
16512 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
16513 * ) case "$setservent_r_proto" in
16514 REENTRANT_PROTO*) ;;
16515 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
16517 echo "Prototype: $try" ;;
16520 *) case "$usethreads" in
16521 define) echo "setservent_r has no prototype, not using it." >&4 ;;
16523 d_setservent_r=undef
16524 setservent_r_proto=0
16528 *) setservent_r_proto=0
16532 : see if setsid exists
16533 set setsid d_setsid
16536 : see if setvbuf exists
16537 set setvbuf d_setvbuf
16540 : see if sfio.h is available
16545 : see if sfio library is available
16556 : Ok, but do we want to use it.
16560 true|$define|[yY]*) dflt='y';;
16563 echo "$package can use the sfio library, but it is experimental."
16564 case "$useperlio" in
16566 echo "For sfio also the PerlIO abstraction layer is needed."
16567 echo "Earlier you said you wouldn't want that."
16570 rp="You seem to have sfio available, do you want to try using it?"
16573 y|Y) echo "Ok, turning on both sfio and PerlIO, then."
16574 useperlio="$define"
16577 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
16582 *) case "$usesfio" in
16583 true|$define|[yY]*)
16584 echo "Sorry, cannot find sfio on this machine." >&4
16585 echo "Ignoring your setting of usesfio=$usesfio." >&4
16594 $define) usesfio='true';;
16595 *) usesfio='false';;
16599 *) : Remove sfio from list of libraries to use
16602 echo "Removing unneeded -lsfio from library list" >&4
16603 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
16606 echo "libs = $libs" >&4
16613 : see if shmctl exists
16614 set shmctl d_shmctl
16617 : see if shmget exists
16618 set shmget d_shmget
16621 : see if shmat exists
16624 : see what shmat returns
16627 $cat >shmat.c <<'END'
16628 #include <sys/shm.h>
16631 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
16636 echo "and it returns ($shmattype)." >&4
16637 : see if a prototype for shmat is available
16638 xxx=`./findhdr sys/shm.h`
16639 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
16640 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
16651 set d_shmatprototype
16654 : see if shmdt exists
16658 : see how much of the 'shm*(2)' library is present.
16661 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
16662 *"$undef"*) h_shm=false;;
16666 case "`ipcs 2>&1`" in
16667 "SVID shared memory"*"not configured"*)
16668 echo "Your $osname does not have the shm*(2) configured." >&4
16671 set shmctl d_shmctl
16673 set shmget d_shmget
16683 : we could also check for sys/ipc.h ...
16684 if $h_shm && $test `./findhdr sys/shm.h`; then
16685 echo "You have the full shm*(2) library." >&4
16688 echo "You don't have the full shm*(2) library." >&4
16695 : see if we have sigaction
16696 if set sigaction val -f d_sigaction; eval $csym; $val; then
16697 echo 'sigaction() found.' >&4
16700 #include <sys/types.h>
16701 #include <signal.h>
16702 #$i_stdlib I_STDLIB
16704 #include <stdlib.h>
16708 struct sigaction act, oact;
16710 oact.sa_handler = 0;
16711 /* so that act and oact are used */
16712 exit(act.sa_flags == 0 && oact.sa_handler == 0);
16716 if eval $compile_ok; then
16719 echo "But you don't seem to have a useable struct sigaction." >&4
16723 echo 'sigaction NOT found.' >&4
16726 set d_sigaction; eval $setvar
16727 $rm -f try try$_o try.c
16729 : see if sigprocmask exists
16730 set sigprocmask d_sigprocmask
16733 : see if sigsetjmp exists
16735 case "$d_sigsetjmp" in
16738 #include <setjmp.h>
16739 #$i_stdlib I_STDLIB
16741 #include <stdlib.h>
16747 if (sigsetjmp(env,1))
16750 siglongjmp(env, 1);
16755 if eval $compile; then
16756 if $run ./try >/dev/null 2>&1; then
16757 echo "POSIX sigsetjmp found." >&4
16761 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
16767 echo "sigsetjmp not found." >&4
16771 *) val="$d_sigsetjmp"
16772 case "$d_sigsetjmp" in
16773 $define) echo "POSIX sigsetjmp found." >&4;;
16774 $undef) echo "sigsetjmp not found." >&4;;
16782 : see if snprintf exists
16783 set snprintf d_snprintf
16786 : see if vsnprintf exists
16787 set vsnprintf d_vsnprintf
16790 case "$d_snprintf-$d_vsnprintf" in
16793 Checking whether your snprintf() and vsnprintf() work okay...
16795 $cat >try.c <<'EOCP'
16796 /* v?snprintf testing logic courtesy of Russ Allbery.
16797 * According to C99:
16798 * - if the buffer is too short it still must be \0-terminated
16799 * - if the buffer is too short the potentially required length
16800 * must be returned and not -1
16801 * - if the buffer is NULL the potentially required length
16802 * must be returned and not -1 or core dump
16805 #include <stdarg.h>
16809 int test (char *format, ...)
16814 va_start (args, format);
16815 count = vsnprintf (buf, sizeof buf, format, args);
16822 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
16823 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
16827 if eval $compile; then
16830 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
16832 Your snprintf() and snprintf() don't seem to be working okay.
16834 d_snprintf="$undef"
16835 d_vsnprintf="$undef"
16839 echo "(I can't seem to compile the test program--assuming they don't)"
16840 d_snprintf="$undef"
16841 d_vsnprintf="$undef"
16843 $rm -f try.* try core core.try.*
16847 : see if sockatmark exists
16848 set sockatmark d_sockatmark
16851 : see if prototype for sockatmark is available
16853 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
16856 : see if socks5_init exists
16857 set socks5_init d_socks5_init
16860 : see if sprintf returns the length of the string in the buffer as per ANSI
16861 $echo "Checking whether sprintf returns the length of the string..." >&4
16864 #$i_stdlib I_STDLIB
16866 #include <stdlib.h>
16868 #$i_string I_STRING
16870 # include <string.h>
16872 # include <strings.h>
16881 int check (size_t expect, int test) {
16882 size_t got = strlen(buffer);
16886 printf("expected %ld, got %ld in test %d '%s'\n", (long) expect, (long) got,
16891 int main(int argc, char **argv) {
16894 check(sprintf(buffer, ""), ++test);
16895 check(sprintf(buffer, "%s %s", "perl", "rules"), ++test);
16896 check(sprintf(buffer, "I like %g", atan2(0,-1)), ++test);
16903 d_sprintf_returns_strlen="$undef"
16904 if eval $compile; then
16908 sprintf returns the length of the string (as ANSI says it should)
16910 d_sprintf_returns_strlen="$define"
16913 sprintf does not return the length of the string (how old is this system?)
16915 d_sprintf_returns_strlen="$undef"
16922 : see if srand48_r exists
16923 set srand48_r d_srand48_r
16925 case "$d_srand48_r" in
16927 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
16928 case "$d_srand48_r_proto:$usethreads" in
16929 ":define") d_srand48_r_proto=define
16930 set d_srand48_r_proto srand48_r $hdrs
16934 case "$d_srand48_r_proto" in
16936 case "$srand48_r_proto" in
16937 ''|0) try='int srand48_r(long, struct drand48_data*);'
16938 ./protochk "extern $try" $hdrs && srand48_r_proto=I_LS ;;
16940 case "$srand48_r_proto" in
16941 ''|0) d_srand48_r=undef
16943 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
16944 * ) case "$srand48_r_proto" in
16945 REENTRANT_PROTO*) ;;
16946 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
16948 echo "Prototype: $try" ;;
16951 *) case "$usethreads" in
16952 define) echo "srand48_r has no prototype, not using it." >&4 ;;
16959 *) srand48_r_proto=0
16963 : see if srandom_r exists
16964 set srandom_r d_srandom_r
16966 case "$d_srandom_r" in
16968 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
16969 case "$d_srandom_r_proto:$usethreads" in
16970 ":define") d_srandom_r_proto=define
16971 set d_srandom_r_proto srandom_r $hdrs
16975 case "$d_srandom_r_proto" in
16977 case "$srandom_r_proto" in
16978 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
16979 ./protochk "extern $try" $hdrs && srandom_r_proto=I_TS ;;
16981 case "$srandom_r_proto" in
16982 ''|0) d_srandom_r=undef
16984 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
16985 * ) case "$srandom_r_proto" in
16986 REENTRANT_PROTO*) ;;
16987 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
16989 echo "Prototype: $try" ;;
16992 *) case "$usethreads" in
16993 define) echo "srandom_r has no prototype, not using it." >&4 ;;
17000 *) srandom_r_proto=0
17004 : see if prototype for setresgid is available
17006 set d_sresgproto setresgid $i_unistd unistd.h
17009 : see if prototype for setresuid is available
17011 set d_sresuproto setresuid $i_unistd unistd.h
17014 : see if sys/stat.h is available
17015 set sys/stat.h i_sysstat
17019 : see if stat knows about block sizes
17021 echo "Checking to see if your struct stat has st_blocks field..." >&4
17022 set d_statblks stat st_blocks $i_sysstat sys/stat.h
17026 : see if this is a sys/vfs.h system
17027 set sys/vfs.h i_sysvfs
17031 : see if this is a sys/statfs.h system
17032 set sys/statfs.h i_sysstatfs
17037 echo "Checking to see if your system supports struct statfs..." >&4
17038 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
17040 case "$d_statfs_s" in
17041 "$define") echo "Yes, it does." ;;
17042 *) echo "No, it doesn't." ;;
17047 : see if struct statfs knows about f_flags
17048 case "$d_statfs_s" in
17051 echo "Checking to see if your struct statfs has f_flags field..." >&4
17052 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
17056 set d_statfs_f_flags
17060 case "$d_statfs_f_flags" in
17061 "$define") echo "Yes, it does." ;;
17062 *) echo "No, it doesn't." ;;
17066 Checking how to access stdio streams by file descriptor number...
17068 case "$stdio_stream_array" in
17069 '') $cat >try.c <<EOCP
17072 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
17076 for s in _iob __iob __sF
17078 set try -DSTDIO_STREAM_ARRAY=$s
17079 if eval $compile; then
17080 case "`$run ./try`" in
17081 yes) stdio_stream_array=$s; break ;;
17085 $rm -f try.* try$exe_ext
17087 case "$stdio_stream_array" in
17089 I can't figure out how to access stdio streams by file descriptor number.
17091 d_stdio_stream_array="$undef"
17094 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
17096 d_stdio_stream_array="$define"
17100 : see if strcoll exists
17101 set strcoll d_strcoll
17104 : check for structure copying
17106 echo "Checking to see if your C compiler can copy structs..." >&4
17107 $cat >try.c <<'EOCP'
17117 if $cc -c try.c >/dev/null 2>&1 ; then
17119 echo "Yup, it can."
17122 echo "Nope, it can't."
17128 : see if strerror and/or sys_errlist[] exist
17130 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
17131 if set strerror val -f d_strerror; eval $csym; $val; then
17132 echo 'strerror() found.' >&4
17133 d_strerror="$define"
17134 d_strerrm='strerror(e)'
17135 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17136 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
17137 d_syserrlst="$define"
17139 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
17140 d_syserrlst="$undef"
17142 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
17143 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
17144 echo 'strerror() found in string header.' >&4
17145 d_strerror="$define"
17146 d_strerrm='strerror(e)'
17147 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17148 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
17149 d_syserrlst="$define"
17151 echo "(You don't appear to have any sys_errlist[], how can this be?)"
17152 d_syserrlst="$undef"
17154 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17155 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
17156 d_strerror="$undef"
17157 d_syserrlst="$define"
17158 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
17160 echo 'strerror() and sys_errlist[] NOT found.' >&4
17161 d_strerror="$undef"
17162 d_syserrlst="$undef"
17163 d_strerrm='"unknown"'
17167 : see if strerror_r exists
17168 set strerror_r d_strerror_r
17170 case "$d_strerror_r" in
17172 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
17173 case "$d_strerror_r_proto:$usethreads" in
17174 ":define") d_strerror_r_proto=define
17175 set d_strerror_r_proto strerror_r $hdrs
17179 case "$d_strerror_r_proto" in
17181 case "$strerror_r_proto" in
17182 ''|0) try='int strerror_r(int, char*, size_t);'
17183 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBW ;;
17185 case "$strerror_r_proto" in
17186 ''|0) try='int strerror_r(int, char*, int);'
17187 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBI ;;
17189 case "$strerror_r_proto" in
17190 ''|0) try='char* strerror_r(int, char*, size_t);'
17191 ./protochk "extern $try" $hdrs && strerror_r_proto=B_IBW ;;
17193 case "$strerror_r_proto" in
17194 ''|0) d_strerror_r=undef
17196 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
17197 * ) case "$strerror_r_proto" in
17198 REENTRANT_PROTO*) ;;
17199 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
17201 echo "Prototype: $try" ;;
17204 *) case "$usethreads" in
17205 define) echo "strerror_r has no prototype, not using it." >&4 ;;
17212 *) strerror_r_proto=0
17216 : see if strftime exists
17217 set strftime d_strftime
17220 : see if strlcat exists
17221 set strlcat d_strlcat
17224 : see if strlcpy exists
17225 set strlcpy d_strlcpy
17228 : see if strtod exists
17229 set strtod d_strtod
17232 : see if strtol exists
17233 set strtol d_strtol
17236 : see if strtold exists
17237 set strtold d_strtold
17240 : see if strtoll exists
17241 set strtoll d_strtoll
17244 case "$d_longlong-$d_strtoll" in
17247 Checking whether your strtoll() works okay...
17249 $cat >try.c <<'EOCP'
17252 #define strtoll __strtoll
17255 #define strtoll _strtoll
17258 extern long long int strtoll(char *s, char **, int);
17259 static int bad = 0;
17260 int check(char *s, long long ell, int een) {
17263 gll = strtoll(s, 0, 10);
17264 if (!((gll == ell) && (errno == een)))
17268 check(" 1", 1LL, 0);
17269 check(" 0", 0LL, 0);
17270 check("-1", -1LL, 0);
17271 check("-9223372036854775808", -9223372036854775808LL, 0);
17272 check("-9223372036854775808", -9223372036854775808LL, 0);
17273 check(" 9223372036854775807", 9223372036854775807LL, 0);
17274 check("-9223372036854775808", -9223372036854775808LL, 0);
17275 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
17276 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
17282 if eval $compile; then
17285 ok) echo "Your strtoll() seems to be working okay." ;;
17287 Your strtoll() doesn't seem to be working okay.
17293 echo "(I can't seem to compile the test program--assuming it doesn't)"
17299 : see if strtoq exists
17300 set strtoq d_strtoq
17303 : see if strtoul exists
17304 set strtoul d_strtoul
17307 case "$d_strtoul" in
17310 Checking whether your strtoul() works okay...
17312 $cat >try.c <<'EOCP'
17315 extern unsigned long int strtoul(char *s, char **, int);
17316 static int bad = 0;
17317 void check(char *s, unsigned long eul, int een) {
17320 gul = strtoul(s, 0, 10);
17321 if (!((gul == eul) && (errno == een)))
17325 check(" 1", 1L, 0);
17326 check(" 0", 0L, 0);
17328 case "$longsize" in
17330 $cat >>try.c <<'EOCP'
17331 check("18446744073709551615", 18446744073709551615UL, 0);
17332 check("18446744073709551616", 18446744073709551615UL, ERANGE);
17333 #if 0 /* strtoul() for /^-/ strings is undefined. */
17334 check("-1", 18446744073709551615UL, 0);
17335 check("-18446744073709551614", 2, 0);
17336 check("-18446744073709551615", 1, 0);
17337 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
17338 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
17343 $cat >>try.c <<'EOCP'
17344 check("4294967295", 4294967295UL, 0);
17345 check("4294967296", 4294967295UL, ERANGE);
17346 #if 0 /* strtoul() for /^-/ strings is undefined. */
17347 check("-1", 4294967295UL, 0);
17348 check("-4294967294", 2, 0);
17349 check("-4294967295", 1, 0);
17350 check("-4294967296", 4294967295UL, ERANGE);
17351 check("-4294967297", 4294967295UL, ERANGE);
17356 : Should we write these tests to be more portable by sprintf-ing
17357 : ~0 and then manipulating that char string as input for strtol?
17360 $cat >>try.c <<'EOCP'
17367 if eval $compile; then
17368 case "`$run ./try`" in
17369 ok) echo "Your strtoul() seems to be working okay." ;;
17371 Your strtoul() doesn't seem to be working okay.
17380 : see if strtoull exists
17381 set strtoull d_strtoull
17384 case "$d_longlong-$d_strtoull" in
17387 Checking whether your strtoull() works okay...
17389 $cat >try.c <<'EOCP'
17392 #define strtoull __strtoull
17395 extern unsigned long long int strtoull(char *s, char **, int);
17396 static int bad = 0;
17397 int check(char *s, long long eull, int een) {
17400 gull = strtoull(s, 0, 10);
17401 if (!((gull == eull) && (errno == een)))
17405 check(" 1", 1LL, 0);
17406 check(" 0", 0LL, 0);
17407 check("18446744073709551615", 18446744073709551615ULL, 0);
17408 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
17409 #if 0 /* strtoull() for /^-/ strings is undefined. */
17410 check("-1", 18446744073709551615ULL, 0);
17411 check("-18446744073709551614", 2LL, 0);
17412 check("-18446744073709551615", 1LL, 0);
17413 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
17414 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
17421 if eval $compile; then
17422 case "`$run ./try`" in
17423 ok) echo "Your strtoull() seems to be working okay." ;;
17425 Your strtoull() doesn't seem to be working okay.
17427 d_strtoull="$undef"
17434 : see if strtouq exists
17435 set strtouq d_strtouq
17438 case "$d_strtouq" in
17441 Checking whether your strtouq() works okay...
17443 $cat >try.c <<'EOCP'
17446 extern unsigned long long int strtouq(char *s, char **, int);
17447 static int bad = 0;
17448 void check(char *s, unsigned long long eull, int een) {
17449 unsigned long long gull;
17451 gull = strtouq(s, 0, 10);
17452 if (!((gull == eull) && (errno == een)))
17456 check(" 1", 1LL, 0);
17457 check(" 0", 0LL, 0);
17458 check("18446744073709551615", 18446744073709551615ULL, 0);
17459 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
17460 #if 0 /* strtouq() for /^-/ strings is undefined. */
17461 check("-1", 18446744073709551615ULL, 0);
17462 check("-18446744073709551614", 2LL, 0);
17463 check("-18446744073709551615", 1LL, 0);
17464 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
17465 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
17473 if eval $compile; then
17474 case "`$run ./try`" in
17475 ok) echo "Your strtouq() seems to be working okay." ;;
17477 Your strtouq() doesn't seem to be working okay.
17486 : see if strxfrm exists
17487 set strxfrm d_strxfrm
17490 : see if symlink exists
17491 set symlink d_symlink
17494 : see if syscall exists
17495 set syscall d_syscall
17498 : see if prototype for syscall is available
17500 set d_syscallproto syscall $i_unistd unistd.h
17503 : see if sysconf exists
17504 set sysconf d_sysconf
17507 : see if system exists
17508 set system d_system
17511 : see if tcgetpgrp exists
17512 set tcgetpgrp d_tcgetpgrp
17515 : see if tcsetpgrp exists
17516 set tcsetpgrp d_tcsetpgrp
17519 : see if prototype for telldir is available
17521 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
17524 : see if time exists
17526 if test "X$d_time" = X -o X"$timetype" = X; then
17527 if set time val -f d_time; eval $csym; $val; then
17528 echo 'time() found.' >&4
17530 rp="What is the type returned by time() on this system?"
17531 set time_t timetype long stdio.h sys/types.h
17534 echo 'time() not found, hope that will do.' >&4
17542 : see if this is a sys/times.h system
17543 set sys/times.h i_systimes
17546 : see if times exists
17548 if set times val -f d_times; eval $csym; $val; then
17549 echo 'times() found.' >&4
17552 case "$i_systimes" in
17553 "$define") inc='sys/times.h';;
17555 rp="What is the type returned by times() on this system?"
17556 set clock_t clocktype long stdio.h sys/types.h $inc
17559 echo 'times() NOT found, hope that will do.' >&4
17564 : see if tmpnam_r exists
17565 set tmpnam_r d_tmpnam_r
17567 case "$d_tmpnam_r" in
17569 hdrs="$i_systypes sys/types.h define stdio.h "
17570 case "$d_tmpnam_r_proto:$usethreads" in
17571 ":define") d_tmpnam_r_proto=define
17572 set d_tmpnam_r_proto tmpnam_r $hdrs
17576 case "$d_tmpnam_r_proto" in
17578 case "$tmpnam_r_proto" in
17579 ''|0) try='char* tmpnam_r(char*);'
17580 ./protochk "extern $try" $hdrs && tmpnam_r_proto=B_B ;;
17582 case "$tmpnam_r_proto" in
17583 ''|0) d_tmpnam_r=undef
17585 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
17586 * ) case "$tmpnam_r_proto" in
17587 REENTRANT_PROTO*) ;;
17588 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
17590 echo "Prototype: $try" ;;
17593 *) case "$usethreads" in
17594 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
17601 *) tmpnam_r_proto=0
17605 : see if truncate exists
17606 set truncate d_truncate
17609 : see if ttyname_r exists
17610 set ttyname_r d_ttyname_r
17612 case "$d_ttyname_r" in
17614 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
17615 case "$d_ttyname_r_proto:$usethreads" in
17616 ":define") d_ttyname_r_proto=define
17617 set d_ttyname_r_proto ttyname_r $hdrs
17621 case "$d_ttyname_r_proto" in
17623 case "$ttyname_r_proto" in
17624 ''|0) try='int ttyname_r(int, char*, size_t);'
17625 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBW ;;
17627 case "$ttyname_r_proto" in
17628 ''|0) try='int ttyname_r(int, char*, int);'
17629 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBI ;;
17631 case "$ttyname_r_proto" in
17632 ''|0) try='char* ttyname_r(int, char*, int);'
17633 ./protochk "extern $try" $hdrs && ttyname_r_proto=B_IBI ;;
17635 case "$ttyname_r_proto" in
17636 ''|0) d_ttyname_r=undef
17638 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
17639 * ) case "$ttyname_r_proto" in
17640 REENTRANT_PROTO*) ;;
17641 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
17643 echo "Prototype: $try" ;;
17646 *) case "$usethreads" in
17647 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
17654 *) ttyname_r_proto=0
17658 : see if tzname[] exists
17660 if set tzname val -a d_tzname; eval $csym; $val; then
17662 echo 'tzname[] found.' >&4
17665 echo 'tzname[] NOT found.' >&4
17671 next|rhapsody|darwin) multiarch="$define" ;;
17673 case "$multiarch" in
17674 ''|[nN]*) multiarch="$undef" ;;
17677 : check for ordering of bytes in a UV
17679 case "$usecrosscompile$multiarch" in
17682 You seem to be either cross-compiling or doing a multiarchitecture build,
17683 skipping the byteorder check.
17689 case "$byteorder" in
17692 In the following, larger digits indicate more significance. A big-endian
17693 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
17694 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
17695 machines may have weird orders like 3412. A Cray will report 87654321,
17696 an Alpha will report 12345678. If the test program works the default is
17698 I'm now running the test program...
17702 #$i_stdlib I_STDLIB
17704 #include <stdlib.h>
17706 #include <sys/types.h>
17707 typedef $uvtype UV;
17717 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
17719 u.l = (UV)0x04030201;
17720 for (i = 0; i < $uvsize; i++)
17721 printf("%c", u.c[i]+'0');
17728 if eval $compile && ./try > /dev/null; then
17731 [1-4][1-4][1-4][1-4]|12345678|87654321)
17732 echo "(The test program ran ok.)"
17733 echo "byteorder=$dflt"
17736 ????|????????) echo "(The test program ran ok.)" ;;
17737 *) echo "(The test program didn't run right for some reason.)" ;;
17742 (I can't seem to compile the test program. Guessing big-endian...)
17745 case "$xxx_prompt" in
17747 rp="What is the order of bytes in $uvtype?"
17763 Checking to see whether you can access character data unalignedly...
17765 case "$d_u32align" in
17766 '') $cat >try.c <<EOCP
17768 #$i_stdlib I_STDLIB
17770 #include <stdlib.h>
17772 #define U32 $u32type
17773 #define BYTEORDER 0x$byteorder
17775 #include <signal.h>
17777 $signal_t bletch(int s) { exit(4); }
17780 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
17785 if (sizeof(U32) != 4) {
17786 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
17793 signal(SIGBUS, bletch);
17805 for (i = 0; i < 4; i++) {
17806 up = (U32*)(buf + i);
17807 if (! ((*up == 1 << (8*i)) || /* big-endian */
17808 (*up == 1 << (8*(3-i))) /* little-endian */
17812 printf("read failed (%x)\n", *up);
17818 for (i = 0; i < 4; i++) {
17819 up = (U32*)(buf + i);
17821 if (*up != 0xBeef) {
17822 printf("write failed (%x)\n", *up);
17836 if eval $compile_ok; then
17837 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
17838 $run ./try 2>&1 >/dev/null
17841 You can access character data pretty unalignedly.
17843 d_u32align="$undef"
17846 It seems that you must access character data in an aligned manner.
17848 d_u32align="$define"
17852 rp='Can you access character data at unaligned addresses?'
17856 [yY]*) d_u32align="$undef" ;;
17857 *) d_u32align="$define" ;;
17860 $rm -f core core.try.* try.core
17864 : see if ualarm exists
17865 set ualarm d_ualarm
17868 : see if umask exists
17872 : see if unordered exists
17873 set unordered d_unordered
17876 : see if unsetenv exists
17877 set unsetenv d_unsetenv
17880 : see if usleep exists
17881 set usleep d_usleep
17884 : see if prototype for usleep is available
17886 set d_usleepproto usleep $i_unistd unistd.h
17889 : see if ustat exists
17893 : backward compatibility for d_hvfork
17894 if test X$d_hvfork != X; then
17895 d_vfork="$d_hvfork"
17898 : see if there is a vfork
17903 : Ok, but do we want to use it. vfork is reportedly unreliable in
17904 : perl on Solaris 2.x, and probably elsewhere.
17908 case "$usevfork" in
17914 Perl can only use a vfork() that doesn't suffer from strict
17915 restrictions on calling functions or modifying global data in
17916 the child. For example, glibc-2.1 contains such a vfork()
17917 that is unsuitable. If your system provides a proper fork()
17918 call, chances are that you do NOT want perl to use vfork().
17921 rp="Do you still want to use vfork()?"
17926 echo "Ok, we won't use vfork()."
17935 $define) usevfork='true';;
17936 *) usevfork='false';;
17939 : see if closedir exists
17940 set closedir d_closedir
17943 case "$d_closedir" in
17946 echo "Checking whether closedir() returns a status..." >&4
17948 #$i_dirent I_DIRENT /**/
17949 #$i_sysdir I_SYS_DIR /**/
17950 #$i_sysndir I_SYS_NDIR /**/
17951 #$i_systypes I_SYS_TYPES /**/
17953 #if defined(I_SYS_TYPES)
17954 #include <sys/types.h>
17956 #if defined(I_DIRENT)
17957 #include <dirent.h>
17958 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
17959 #include <sys/dir.h>
17963 #include <sys/ndir.h>
17967 #include <ndir.h> /* may be wrong in the future */
17969 #include <sys/dir.h>
17974 int main() { return closedir(opendir(".")); }
17977 if eval $compile_ok; then
17978 if $run ./try > /dev/null 2>&1 ; then
17979 echo "Yes, it does."
17982 echo "No, it doesn't."
17986 echo "(I can't seem to compile the test program--assuming it doesn't)"
17994 set d_void_closedir
17997 : see if there is a wait4
18001 : see if waitpid exists
18002 set waitpid d_waitpid
18005 : see if wcstombs exists
18006 set wcstombs d_wcstombs
18009 : see if wctomb exists
18010 set wctomb d_wctomb
18013 : see if writev exists
18014 set writev d_writev
18017 : preserve RCS keywords in files with variable substitution, grrr
18022 Revision='$Revision'
18024 : check for alignment requirements
18026 case "$usecrosscompile$multiarch" in
18029 You seem to be either cross-compiling or doing a multiarchitecture build,
18030 skipping the memory alignment check.
18033 case "$alignbytes" in
18034 '') alignbytes=8 ;;
18038 case "$alignbytes" in
18039 '') echo "Checking alignment constraints..." >&4
18040 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
18041 $cat >try.c <<'EOCP'
18042 typedef long double NV;
18045 $cat >try.c <<'EOCP'
18049 $cat >>try.c <<'EOCP'
18057 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
18062 if eval $compile_ok; then
18066 echo "(I can't seem to compile the test program...)"
18069 *) dflt="$alignbytes"
18072 rp="Doubles must be aligned on a how-many-byte boundary?"
18080 : set the base revision
18083 : how do we concatenate cpp tokens here?
18085 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
18086 $cat >cpp_stuff.c <<'EOCP'
18087 #define RCAT(a,b)a/**/b
18088 #define ACAT(a,b)a ## b
18092 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
18093 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
18094 echo "Oh! Smells like ANSI's been here." >&4
18095 echo "We can catify or stringify, separately or together!"
18097 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
18098 echo "Ah, yes! The good old days!" >&4
18099 echo "However, in the good old days we don't know how to stringify and"
18100 echo "catify at the same time."
18104 Hmm, I don't seem to be able to concatenate tokens with your cpp.
18105 You're going to have to edit the values of CAT[2-5] in config.h...
18107 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
18111 : see if this is a db.h system
18117 : Check db version.
18119 echo "Checking Berkeley DB version ..." >&4
18125 #include <sys/types.h>
18127 #$i_stdlib I_STDLIB
18129 #include <stdlib.h>
18132 int main(int argc, char *argv[])
18134 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
18135 int Major, Minor, Patch ;
18136 unsigned long Version ;
18137 (void)db_version(&Major, &Minor, &Patch) ;
18139 printf("%d %d %d %d %d %d\n",
18140 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
18141 Major, Minor, Patch);
18144 printf("You have Berkeley DB Version 2 or greater.\n");
18146 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
18147 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
18148 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
18149 Major, Minor, Patch) ;
18151 /* check that db.h & libdb are compatible */
18152 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
18153 printf("db.h and libdb are incompatible.\n") ;
18157 printf("db.h and libdb are compatible.\n") ;
18159 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
18160 + DB_VERSION_PATCH ;
18162 /* needs to be >= 2.3.4 */
18163 if (Version < 2003004) {
18164 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
18165 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
18171 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
18176 printf("You have Berkeley DB Version 1.\n");
18177 exit(0); /* DB version < 2: the coast is clear. */
18179 exit(1); /* <db.h> not Berkeley DB? */
18185 if eval $compile_ok && $run ./try; then
18186 echo 'Looks OK.' >&4
18188 db_version_major=$1
18189 db_version_minor=$2
18190 db_version_patch=$3
18192 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
18196 : Remove db from list of libraries to use
18197 echo "Removing unusable -ldb from library list" >&4
18198 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
18201 echo "libs = $libs" >&4
18211 : Check the return type needed for hash
18213 echo "Checking return type needed for hash for Berkeley DB ..." >&4
18219 #include <sys/types.h>
18222 #ifndef DB_VERSION_MAJOR
18223 u_int32_t hash_cb (ptr, size)
18231 info.hash = hash_cb;
18235 if $cc $ccflags -c try.c >try.out 2>&1 ; then
18236 if $contains warning try.out >>/dev/null 2>&1 ; then
18239 db_hashtype='u_int32_t'
18242 : XXX Maybe we should just give up here.
18243 db_hashtype=u_int32_t
18245 echo "Help: I can't seem to compile the db test program." >&4
18246 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
18249 echo "Your version of Berkeley DB uses $db_hashtype for hash."
18251 *) db_hashtype=u_int32_t
18256 : Check the return type needed for prefix
18258 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
18264 #include <sys/types.h>
18267 #ifndef DB_VERSION_MAJOR
18268 size_t prefix_cb (key1, key2)
18276 info.prefix = prefix_cb;
18280 if $cc $ccflags -c try.c >try.out 2>&1 ; then
18281 if $contains warning try.out >>/dev/null 2>&1 ; then
18282 db_prefixtype='int'
18284 db_prefixtype='size_t'
18287 db_prefixtype='size_t'
18288 : XXX Maybe we should just give up here.
18290 echo "Help: I can't seem to compile the db test program." >&4
18291 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
18294 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
18296 *) db_prefixtype='size_t'
18301 : How can we generate normalized random numbers ?
18303 echo "Looking for a random number function..." >&4
18304 case "$randfunc" in
18306 if set drand48 val -f; eval $csym; $val; then
18308 echo "Good, found drand48()." >&4
18309 elif set random val -f; eval $csym; $val; then
18311 echo "OK, found random()." >&4
18314 echo "Yick, looks like I have to use rand()." >&4
18325 *-Dmy_rand=*|*-Dmy_srand=*)
18326 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
18327 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
18328 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
18329 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
18333 while $test "$cont"; do
18334 rp="Use which function to generate random numbers?"
18336 if $test "$ans" = "$dflt"; then
18342 if set $ans val -f; eval $csym; $val; then
18346 rp="I cannot find function $ans. Use that name anyway?"
18355 case "$randfunc" in
18357 drand01="drand48()"
18363 case "$randbits" in
18365 echo "Checking to see how many bits your $randfunc() function produces..." >&4
18367 #$i_unistd I_UNISTD
18368 #$i_stdlib I_STDLIB
18371 # include <unistd.h>
18374 # include <stdlib.h>
18379 register unsigned long tmp;
18380 register unsigned long max = 0L;
18382 for (i = 1000; i; i--) {
18383 tmp = (unsigned long) $randfunc();
18384 if (tmp > max) max = tmp;
18386 for (i = 0; max; i++)
18392 if eval $compile_ok; then
18396 echo "(I can't seem to compile the test program...)"
18403 rp="How many bits does your $randfunc() function produce?"
18407 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
18408 seedfunc="s$randfunc"
18409 randseedtype=unsigned
18413 rp="How many bits does your $randfunc() function produce?"
18416 seedfunc="s$randfunc"
18417 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
18418 if set $seedfunc val -f; eval $csym; $val; then
18419 echo "(Using $seedfunc() to seed random generator)"
18421 echo "(Warning: no $seedfunc() to seed random generator)"
18424 randseedtype=unsigned
18432 echo "Determining whether or not we are on an EBCDIC system..." >&4
18433 $cat >try.c <<'EOM'
18436 if ('M'==0xd4) return 0;
18443 if eval $compile_ok; then
18444 if $run ./try; then
18445 echo "You seem to speak EBCDIC." >&4
18448 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
18451 echo "I'm unable to compile the test program." >&4
18452 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
18460 Checking how to flush all pending stdio output...
18462 # I only know how to find the first 32 possibly open files on SunOS.
18463 # See also hints/sunos_4_1.sh and util.c --AD
18465 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
18467 $cat >>try.c <<EOCP
18469 #$i_stdlib I_STDLIB
18471 #include <stdlib.h>
18473 #$i_unistd I_UNISTD
18475 # include <unistd.h>
18477 #$d_sysconf HAS_SYSCONF
18478 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
18479 #ifdef HAS_STDIO_STREAM_ARRAY
18480 # define STDIO_STREAM_ARRAY $stdio_stream_array
18485 p = fopen("try.out", "w");
18489 # ifdef TRY_FPRINTF
18493 #ifdef TRY_FFLUSH_NULL
18496 #ifdef TRY_FFLUSH_ALL
18498 long open_max = -1;
18499 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
18500 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
18502 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
18503 open_max = sysconf(_SC_OPEN_MAX);
18506 open_max = FOPEN_MAX;
18509 open_max = OPEN_MAX;
18518 # ifdef HAS_STDIO_STREAM_ARRAY
18519 if (open_max > 0) {
18521 for (i = 0; i < open_max; i++)
18522 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
18523 STDIO_STREAM_ARRAY[i]._file < open_max &&
18524 STDIO_STREAM_ARRAY[i]._flag)
18525 fflush(&STDIO_STREAM_ARRAY[i]);
18533 : first we have to find out how _not_ to flush
18535 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
18537 set try -DTRY_FPUTC
18538 if eval $compile; then
18539 $run ./try 2>/dev/null
18542 if $test ! -s try.out -a "X$code" = X42; then
18548 set try -DTRY_FPRINTF
18549 if eval $compile; then
18550 $run ./try 2>/dev/null
18553 if $test ! -s try.out -a "X$code" = X42; then
18554 output=-DTRY_FPRINTF
18560 : check for fflush NULL behaviour
18561 case "$fflushNULL" in
18562 '') set try -DTRY_FFLUSH_NULL $output
18563 if eval $compile; then
18564 $run ./try 2>/dev/null
18567 if $test -s try.out -a "X$code" = X42; then
18568 fflushNULL="`$cat try.out`"
18570 if $test "X$code" != X42; then
18572 (If this test failed, don't worry, we'll try another method shortly.)
18577 $rm -f core try.core core.try.*
18578 case "$fflushNULL" in
18580 Your fflush(NULL) works okay for output streams.
18581 Let's see if it clobbers input pipes...
18583 # As of mid-March 2000 all versions of Solaris appear to have a stdio
18584 # bug that improperly flushes the input end of pipes. So we avoid the
18585 # autoflush on fork/system/exec support for now. :-(
18586 $cat >tryp.c <<EOCP
18589 main(int argc, char **argv)
18595 while ((i = getc(stdin)) != -1
18596 && (*bp++ = i) != '\n'
18597 && bp < &buf[1024])
18600 fprintf(stdout, "%s", buf);
18608 fflushNULL="$define"
18610 if eval $compile; then
18612 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
18613 if cmp tryp.c tryp.out >/dev/null 2>&1; then
18615 fflush(NULL) seems to behave okay with input streams.
18617 fflushNULL="$define"
18620 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
18622 fflushNULL="$undef"
18625 $rm -f core tryp.c tryp.core core.tryp.*
18628 Your fflush(NULL) isn't working (contrary to ANSI C).
18630 fflushNULL="$undef"
18633 Cannot figure out whether your fflush(NULL) works or not.
18634 I'm assuming it doesn't (contrary to ANSI C).
18636 fflushNULL="$undef"
18640 $define|true|[yY]*)
18641 fflushNULL="$define"
18644 fflushNULL="$undef"
18647 : check explicit looping only if NULL did not work, and if the pipe
18648 : bug does not show up on an explicit flush too
18649 case "$fflushNULL" in
18651 $cat >tryp.c <<EOCP
18654 main(int argc, char **argv)
18660 while ((i = getc(stdin)) != -1
18661 && (*bp++ = i) != '\n'
18662 && bp < &buf[1024])
18665 fprintf(stdout, "%s", buf);
18674 if eval $compile; then
18676 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
18677 if cmp tryp.c tryp.out >/dev/null 2>&1; then
18679 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
18681 : now check for fflushall behaviour
18682 case "$fflushall" in
18683 '') set try -DTRY_FFLUSH_ALL $output
18684 if eval $compile; then
18686 (Now testing the other method--but note that this also may fail.)
18688 $run ./try 2>/dev/null
18691 if $test -s try.out -a "X$code" = X42; then
18692 fflushall="`$cat try.out`"
18695 $rm -f core try.core core.try.*
18696 case "$fflushall" in
18698 Whew. Flushing explicitly all the stdio streams works.
18700 fflushall="$define"
18703 Sigh. Flushing explicitly all the stdio streams doesn't work.
18708 Cannot figure out whether flushing stdio streams explicitly works or not.
18709 I'm assuming it doesn't.
18715 "$define"|true|[yY]*)
18716 fflushall="$define"
18724 All is futile. Even fflush(stdin) clobbers input pipes!
18731 $rm -f core tryp.c tryp.core core.tryp.*
18733 *) fflushall="$undef"
18737 case "$fflushNULL$fflushall" in
18740 OK, I give up. I cannot figure out how to flush pending stdio output.
18741 We won't be flushing handles at all before fork/exec/popen.
18745 $rm -f try.* try$exe_ext
18747 : Store the full pathname to the ar program for use in the C program
18748 : Respect a hint or command line value for full_ar.
18753 : Store the full pathname to the sed program for use in the C program
18756 : see what type gids are declared as in the kernel
18758 echo "Looking for the type for group ids returned by getgid()."
18759 set gid_t gidtype xxx stdio.h sys/types.h
18763 xxx=`./findhdr sys/user.h`
18764 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
18766 unsigned) dflt="$1 $2" ;;
18770 *) dflt="$gidtype";;
18773 gid_t) echo "gid_t found." ;;
18774 *) rp="What is the type for group ids returned by getgid()?"
18782 *_t) zzz="$gidtype" ;;
18785 echo "Checking the size of $zzz..." >&4
18787 #include <sys/types.h>
18789 #$i_stdlib I_STDLIB
18791 #include <stdlib.h>
18794 printf("%d\n", (int)sizeof($gidtype));
18799 if eval $compile_ok; then
18803 echo "(I can't execute the test program--guessing $gidsize.)" >&4
18806 echo "Your $zzz is $gidsize bytes long."
18811 echo "(I can't compile the test program--guessing $gidsize.)" >&4
18817 *_t) zzz="$gidtype" ;;
18820 echo "Checking the sign of $zzz..." >&4
18822 #include <sys/types.h>
18833 if eval $compile; then
18837 echo "(I can't execute the test program--guessing unsigned.)" >&4
18841 1) echo "Your $zzz is unsigned." ;;
18842 -1) echo "Your $zzz is signed." ;;
18848 echo "(I can't compile the test program--guessing unsigned.)" >&4
18854 if $test X"$quadtype" != X; then
18856 echo "Checking how to print 64-bit integers..." >&4
18858 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
18859 $cat >try.c <<'EOCP'
18860 #include <sys/types.h>
18863 int q = 12345678901;
18864 printf("%ld\n", q);
18868 if eval $compile; then
18872 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
18873 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
18874 echo "We will use %d."
18880 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
18881 $cat >try.c <<'EOCP'
18882 #include <sys/types.h>
18885 long q = 12345678901;
18886 printf("%ld\n", q);
18890 if eval $compile; then
18894 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
18895 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
18896 echo "We will use %ld."
18902 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
18903 $cat >try.c <<'EOCP'
18904 #include <sys/types.h>
18905 #include <inttypes.h>
18908 int64_t q = 12345678901;
18909 printf("%" PRId64 "\n", q);
18913 if eval $compile; then
18917 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
18918 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
18919 echo "We will use the C9X style."
18925 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
18927 #include <sys/types.h>
18930 $quadtype q = 12345678901;
18931 printf("%Ld\n", q);
18935 if eval $compile; then
18939 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
18940 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
18941 echo "We will use %Ld."
18947 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
18948 $cat >try.c <<'EOCP'
18949 #include <sys/types.h>
18952 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
18953 printf("%lld\n", q);
18957 if eval $compile; then
18961 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
18962 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
18963 echo "We will use the %lld style."
18969 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
18971 #include <sys/types.h>
18974 $quadtype q = 12345678901;
18975 printf("%qd\n", q);
18979 if eval $compile; then
18983 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
18984 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
18985 echo "We will use %qd."
18991 if $test X"$sPRId64" = X; then
18992 echo "Cannot figure out how to print 64-bit integers." >&4
19000 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
19001 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
19003 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
19004 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
19010 $echo "Checking the format strings to be used for Perl's internal types..." >&4
19012 if $test X"$ivsize" = X8; then
19013 ivdformat="$sPRId64"
19014 uvuformat="$sPRIu64"
19015 uvoformat="$sPRIo64"
19016 uvxformat="$sPRIx64"
19017 uvXUformat="$sPRIXU64"
19019 if $test X"$ivsize" = X"$longsize"; then
19026 if $test X"$ivsize" = X"$intsize"; then
19034 if $test X"$ivsize" = X"$shortsize"; then
19045 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
19046 nveformat="$sPRIeldbl"
19047 nvfformat="$sPRIfldbl"
19048 nvgformat="$sPRIgldbl"
19049 nvEUformat="$sPRIEUldbl"
19050 nvFUformat="$sPRIFUldbl"
19051 nvGUformat="$sPRIGUldbl"
19061 case "$ivdformat" in
19062 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
19069 $echo "Checking the format string to be used for gids..." >&4
19072 -1) if $test X"$gidsize" = X"$ivsize"; then
19073 gidformat="$ivdformat"
19075 if $test X"$gidsize" = X"$longsize"; then
19078 if $test X"$gidsize" = X"$intsize"; then
19081 if $test X"$gidsize" = X"$shortsize"; then
19088 *) if $test X"$gidsize" = X"$uvsize"; then
19089 gidformat="$uvuformat"
19091 if $test X"$gidsize" = X"$longsize"; then
19094 if $test X"$gidsize" = X"$intsize"; then
19097 if $test X"$gidsize" = X"$shortsize"; then
19106 : see if getgroups exists
19107 set getgroups d_getgrps
19110 : see if setgroups exists
19111 set setgroups d_setgrps
19115 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
19117 case "$d_getgrps$d_setgrps" in
19119 case "$groupstype" in
19120 '') dflt="$gidtype" ;;
19121 *) dflt="$groupstype" ;;
19124 What type of pointer is the second argument to getgroups() and setgroups()?
19125 Usually this is the same as group ids, $gidtype, but not always.
19128 rp='What type pointer is the second argument to getgroups() and setgroups()?'
19132 *) groupstype="$gidtype";;
19136 if $test $patchlevel -lt 9; then
19137 : MAD is not available in 5.8.x or earlier.
19141 $define|true|[yY]*) dflt='y' ;;
19146 Would you like to build with Misc Attribute Decoration? This is development
19147 work leading to a Perl 5 to Perl 6 convertor, which imposes a space and speed
19148 overhead on the interpreter.
19150 If this doesn't make any sense to you, just accept the default '$dflt'.
19152 rp='Build Perl with MAD?'
19157 madlyh='madly.h madly.act madly.tab'
19159 madlyobj="madly$_o" ;;
19169 echo "Checking if your $make program sets \$(MAKE)..." >&4
19170 case "$make_set_make" in
19172 $sed 's/^X //' > testmake.mak << 'EOF'
19174 X @echo 'maketemp="$(MAKE)"'
19176 case "`$make -f testmake.mak 2>/dev/null`" in
19177 *maketemp=*) make_set_make='#' ;;
19178 *) make_set_make="MAKE=$make" ;;
19180 $rm -f testmake.mak
19183 case "$make_set_make" in
19184 '#') echo "Yup, it does.";;
19185 *) echo "Nope, it doesn't.";;
19188 : see what type is used for mode_t
19189 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
19190 set mode_t modetype int stdio.h sys/types.h
19193 : see if we need va_copy
19195 case "$i_stdarg" in
19198 #include <stdarg.h>
19200 #$i_stdlib I_STDLIB
19202 #include <stdlib.h>
19204 #include <signal.h>
19207 ivfprintf(FILE *f, const char *fmt, va_list *valp)
19209 return vfprintf(f, fmt, *valp);
19213 myvfprintf(FILE *f, const char *fmt, va_list val)
19215 return ivfprintf(f, fmt, &val);
19219 myprintf(char *fmt, ...)
19222 va_start(val, fmt);
19223 return myvfprintf(stdout, fmt, val);
19227 main(int ac, char **av)
19229 signal(SIGSEGV, exit);
19231 myprintf("%s%cs all right, then\n", "that", '\'');
19236 if eval $compile && $run ./try 2>&1 >/dev/null; then
19237 case "`$run ./try`" in
19238 "that's all right, then")
19244 yes) echo "It seems that you don't need va_copy()." >&4
19245 need_va_copy="$undef"
19247 *) echo "It seems that va_copy() or similar will be needed." >&4
19248 need_va_copy="$define"
19251 $rm -f try.* core core.* *.core *.core.*
19253 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
19257 : see what type is used for size_t
19258 rp="What is the type used for the length parameter for string functions?"
19259 set size_t sizetype 'unsigned int' stdio.h sys/types.h
19262 : check for type of arguments to gethostbyaddr.
19263 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
19264 case "$d_gethbyaddr" in
19268 Checking to see what type of arguments are accepted by gethostbyaddr().
19270 hdrs="$define sys/types.h
19271 $d_socket sys/socket.h
19272 $i_niin netinet/in.h
19274 $i_unistd unistd.h"
19275 : The first arg can 'char *' or 'void *'
19276 : The second arg is some of integral type
19277 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
19278 for yyy in size_t long int; do
19279 case "$netdb_host_type" in
19280 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
19281 if ./protochk "$try" $hdrs; then
19282 echo "Your system accepts $xxx for the first arg."
19283 echo "...and $yyy for the second arg."
19284 netdb_host_type="$xxx"
19285 netdb_hlen_type="$yyy"
19291 : In case none of those worked, prompt the user.
19292 case "$netdb_host_type" in
19293 '') rp='What is the type for the 1st argument to gethostbyaddr?'
19296 netdb_host_type=$ans
19297 rp='What is the type for the 2nd argument to gethostbyaddr?'
19300 netdb_hlen_type=$ans
19304 *) : no gethostbyaddr, so pick harmless defaults
19305 netdb_host_type='char *'
19306 netdb_hlen_type="$sizetype"
19309 # Remove the "const" if needed. -- but then we'll have a
19311 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
19314 : check for type of argument to gethostbyname.
19315 if test "X$netdb_name_type" = X ; then
19316 case "$d_gethbyname" in
19320 Checking to see what type of argument is accepted by gethostbyname().
19322 hdrs="$define sys/types.h
19323 $d_socket sys/socket.h
19324 $i_niin netinet/in.h
19326 $i_unistd unistd.h"
19327 for xxx in "const char *" "char *"; do
19328 case "$netdb_name_type" in
19329 '') try="extern struct hostent *gethostbyname($xxx);"
19330 if ./protochk "$try" $hdrs; then
19331 echo "Your system accepts $xxx."
19332 netdb_name_type="$xxx"
19337 : In case none of those worked, prompt the user.
19338 case "$netdb_name_type" in
19339 '') rp='What is the type for the 1st argument to gethostbyname?'
19342 netdb_name_type=$ans
19346 *) : no gethostbyname, so pick harmless default
19347 netdb_name_type='char *'
19352 : check for type of 1st argument to getnetbyaddr.
19353 if test "X$netdb_net_type" = X ; then
19354 case "$d_getnbyaddr" in
19358 Checking to see what type of 1st argument is accepted by getnetbyaddr().
19360 hdrs="$define sys/types.h
19361 $d_socket sys/socket.h
19362 $i_niin netinet/in.h
19364 $i_unistd unistd.h"
19365 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
19366 case "$netdb_net_type" in
19367 '') try="extern struct netent *getnetbyaddr($xxx, int);"
19368 if ./protochk "$try" $hdrs; then
19369 echo "Your system accepts $xxx."
19370 netdb_net_type="$xxx"
19375 : In case none of those worked, prompt the user.
19376 case "$netdb_net_type" in
19377 '') rp='What is the type for the 1st argument to getnetbyaddr?'
19380 netdb_net_type=$ans
19384 *) : no getnetbyaddr, so pick harmless default
19385 netdb_net_type='long'
19389 : locate the preferred pager for this system
19396 [a-zA-Z]:/*) dflt=$pg;;
19400 [a-zA-Z]:/*) dflt=$more;;
19404 [a-zA-Z]:/*) dflt=$less;;
19407 '') dflt=/usr/ucb/more;;
19411 : Instruct ./getfile to trust the hinted or previous pager value,
19412 : even if it does not begin with a slash. For example, on os2,
19413 : pager might be cmd /c more. See comments in UU/getfile.
19418 rp='What pager is used on your system?'
19422 : see what type pids are declared as in the kernel
19423 rp="What is the type of process ids on this system?"
19424 set pid_t pidtype int stdio.h sys/types.h
19427 : see if ar generates random libraries by itself
19429 echo "Checking how to generate random libraries on your machine..." >&4
19430 echo 'int bar1() { return bar2(); }' > bar1.c
19431 echo 'int bar2() { return 2; }' > bar2.c
19433 #$i_stdlib I_STDLIB
19435 #include <stdlib.h>
19437 int main() { printf("%d\n", bar1()); exit(0); }
19439 $cc $ccflags -c bar1.c >/dev/null 2>&1
19440 $cc $ccflags -c bar2.c >/dev/null 2>&1
19441 $cc $ccflags -c foo.c >/dev/null 2>&1
19442 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
19443 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19444 $run ./foobar >/dev/null 2>&1; then
19445 echo "$ar appears to generate random libraries itself."
19447 if [ "X$ranlib" = "X" ]; then
19450 elif $ar s bar$_a >/dev/null 2>&1 &&
19451 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19452 $run ./foobar >/dev/null 2>&1; then
19453 echo "a table of contents needs to be added with '$ar s'."
19456 elif $ar ts bar$_a >/dev/null 2>&1 &&
19457 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19458 $run ./foobar >/dev/null 2>&1; then
19459 echo "a table of contents needs to be added with '$ar ts'."
19466 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
19467 $test -f $ranlib || ranlib=''
19470 if $test -n "$ranlib"; then
19471 echo "your system has '$ranlib'; we'll use that."
19474 echo "your system doesn't seem to support random libraries"
19475 echo "so we'll use lorder and tsort to order the libraries."
19482 : check for type of arguments to select.
19483 case "$selecttype" in
19484 '') case "$d_select" in
19488 Checking to see what type of arguments are accepted by select().
19490 hdrs="$define sys/types.h
19491 $i_systime sys/time.h
19492 $i_sysselct sys/select.h
19493 $d_socket sys/socket.h"
19494 : The first arg can be int, unsigned, or size_t
19495 : The last arg may or may not be 'const'
19497 : void pointer has been seen but using that
19498 : breaks the selectminbits test
19499 for xxx in 'fd_set *' 'int *'; do
19500 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
19501 for tmo in 'struct timeval *' 'const struct timeval *'; do
19503 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
19504 if ./protochk "$try" $hdrs; then
19505 echo "Your system accepts $xxx."
19514 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
19515 case "$d_fd_set" in
19516 $define) dflt="fd_set *" ;;
19525 *) : no select, so pick a harmless default
19532 : check for the select 'width'
19533 case "$selectminbits" in
19534 '') safebits=`expr $ptrsize \* 8`
19535 case "$d_select" in
19539 Checking to see on how many bits at a time your select() operates...
19542 #include <sys/types.h>
19544 #$i_systime I_SYS_TIME
19545 #$i_systimek I_SYS_TIME_KERNEL
19550 # ifdef I_SYS_TIME_KERNEL
19553 # include <sys/time.h>
19554 # ifdef I_SYS_TIME_KERNEL
19558 #$i_sysselct I_SYS_SELECT
19559 #ifdef I_SYS_SELECT
19560 #include <sys/select.h>
19562 #$d_socket HAS_SOCKET
19564 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
19567 #$i_stdlib I_STDLIB
19569 #include <stdlib.h>
19572 #define S sizeof(*(b))
19574 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
19575 #define NBITS (NBYTES * 8)
19577 char *s = (char *)malloc(NBYTES);
19586 fp = fopen("try.c", "r");
19592 b = ($selecttype)s;
19593 for (i = 0; i < NBITS; i++)
19597 select(fd + 1, b, 0, 0, &t);
19598 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
19600 printf("%d\n", i + 1);
19605 if eval $compile_ok; then
19606 selectminbits=`$run ./try`
19607 case "$selectminbits" in
19609 Cannot figure out on how many bits at a time your select() operates.
19610 I'll play safe and guess it is $safebits bits.
19612 selectminbits=$safebits
19613 bits="$safebits bits"
19616 *) bits="$selectminbits bits" ;;
19618 echo "Your select() operates on $bits at a time." >&4
19620 rp='What is the minimum number of bits your select() operates on?'
19621 case "$byteorder" in
19622 12345678) dflt=64 ;;
19628 selectminbits="$val"
19632 *) : no select, so pick a harmless default
19633 selectminbits=$safebits
19639 : Trace out the files included by signal.h, then look for SIGxxx names.
19640 : Remove SIGARRAYSIZE used by HPUX.
19641 : Remove SIGSTKSIZE used by Linux.
19642 : Remove SIGSTKSZ used by Posix.
19643 : Remove SIGTYP void lines used by OS2.
19644 : Some cpps, like os390, dont give the file name anywhere
19645 if [ "X$fieldn" = X ]; then
19646 : Just make some guesses. We check them later.
19647 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
19649 xxx=`echo '#include <signal.h>' |
19650 $cppstdin $cppminus $cppflags 2>/dev/null |
19651 $grep '^[ ]*#.*include' |
19652 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
19654 : Check this list of files to be sure we have parsed the cpp output ok.
19655 : This will also avoid potentially non-existent files, such
19658 for xx in $xxx /dev/null ; do
19659 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
19661 : If we have found no files, at least try signal.h
19662 case "$xxxfiles" in
19663 '') xxxfiles=`./findhdr signal.h` ;;
19666 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
19667 print substr($2, 4, 20)
19669 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
19670 print substr($3, 4, 20)
19672 : Append some common names just in case the awk scan failed.
19673 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
19674 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
19675 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
19676 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
19677 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
19679 : generate a few handy files for later
19680 $cat > signal.c <<EOCP
19681 #include <sys/types.h>
19682 #include <signal.h>
19683 #$i_stdlib I_STDLIB
19685 #include <stdlib.h>
19690 /* Strange style to avoid deeply-nested #if/#else/#endif */
19693 # define NSIG (_NSIG)
19699 # define NSIG (SIGMAX+1)
19705 # define NSIG (SIG_MAX+1)
19711 # define NSIG (_SIG_MAX+1)
19717 # define NSIG (MAXSIG+1)
19723 # define NSIG (MAX_SIG+1)
19728 # ifdef SIGARRAYSIZE
19729 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
19735 # define NSIG (_sys_nsig) /* Solaris 2.5 */
19739 /* Default to some arbitrary number that's big enough to get most
19740 of the common signals.
19746 printf("NSIG %d\n", NSIG);
19752 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
19754 printf "#ifdef SIG"; printf $1; printf "\n"
19755 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
19756 printf $1; printf ");\n"
19760 printf "#endif /* JUST_NSIG */\n";
19761 printf "exit(0);\n}\n";
19764 $cat >signal.awk <<'EOP'
19765 BEGIN { ndups = 0 }
19766 $1 ~ /^NSIG$/ { nsig = $2 }
19767 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
19768 if ($2 > maxsig) { maxsig = $2 }
19769 if (sig_name[$2]) {
19770 dup_name[ndups] = $1
19771 dup_num[ndups] = $2
19783 printf("NSIG %d\n", nsig);
19784 for (n = 1; n < nsig; n++) {
19786 printf("%s %d\n", sig_name[n], sig_num[n])
19789 printf("NUM%d %d\n", n, n)
19792 for (n = 0; n < ndups; n++) {
19793 printf("%s %d\n", dup_name[n], dup_num[n])
19797 $cat >signal_cmd <<EOS
19799 if $test -s signal.lst; then
19800 echo "Using your existing signal.lst file"
19805 $cat >>signal_cmd <<'EOS'
19808 if eval $compile_ok; then
19809 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) | $uniq | $awk -f signal.awk >signal.lst
19811 echo "(I can't seem be able to compile the whole test program)" >&4
19812 echo "(I'll try it in little pieces.)" >&4
19813 set signal -DJUST_NSIG
19814 if eval $compile_ok; then
19815 $run ./signal$_exe > signal.nsg
19818 echo "I can't seem to figure out how many signals you have." >&4
19819 echo "Guessing 50." >&4
19820 echo 'NSIG 50' > signal.nsg
19822 : Now look at all the signal names, one at a time.
19823 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
19824 $cat > signal.c <<EOCP
19825 #include <sys/types.h>
19826 #include <signal.h>
19829 printf("$xx %d\n", SIG${xx});
19834 if eval $compile; then
19835 echo "SIG${xx} found."
19836 $run ./signal$_exe >> signal.ls1
19838 echo "SIG${xx} NOT found."
19841 if $test -s signal.ls1; then
19842 $cat signal.nsg signal.ls1 |
19843 $sort -n | $uniq | $awk -f signal.awk >signal.lst
19847 if $test -s signal.lst; then
19850 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
19851 echo 'kill -l' >signal
19852 set X `csh -f <signal`
19856 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
19858 echo $@ | $tr ' ' $trnl | \
19859 $awk '{ printf "%s %d\n", $1, ++s; }
19860 END { printf "NSIG %d\n", ++s }' >signal.lst
19862 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
19864 chmod a+x signal_cmd
19865 $eunicefix signal_cmd
19867 : generate list of signal names
19869 case "$sig_name_init" in
19871 *) case "$sig_num_init" in
19872 ''|*,*) doinit=yes ;;
19877 echo "Generating a list of signal names and numbers..." >&4
19879 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
19880 sig_name=`$awk 'BEGIN { printf "ZERO " }
19881 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
19882 sig_num=`$awk 'BEGIN { printf "0 " }
19883 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
19884 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
19885 !/^NSIG/ { printf "\"%s\", ", $1 }
19886 END { printf "0\n" }' signal.lst`
19887 sig_num_init=`$awk 'BEGIN { printf "0, " }
19888 !/^NSIG/ { printf "%d, ", $2}
19889 END { printf "0\n"}' signal.lst`
19892 echo "The following $sig_count signals are available:"
19894 echo $sig_name | $awk \
19895 'BEGIN { linelen = 0 }
19897 for (i = 1; i <= NF; i++) {
19898 name = "SIG" $i " "
19899 linelen = linelen + length(name)
19900 if (linelen > 70) {
19902 linelen = length(name)
19908 sig_size=`echo $sig_name | awk '{print NF}'`
19909 $rm -f signal signal.c signal.awk signal.lst signal_cmd
19912 case "$sizetype" in
19913 *_t) zzz="$sizetype" ;;
19914 *) zzz="filesize" ;;
19916 echo "Checking the size of $zzz..." >&4
19918 #include <sys/types.h>
19920 #$i_stdlib I_STDLIB
19922 #include <stdlib.h>
19925 printf("%d\n", (int)sizeof($sizetype));
19930 if eval $compile_ok; then
19934 echo "(I can't execute the test program--guessing $sizesize.)" >&4
19937 echo "Your $zzz size is $sizesize bytes."
19942 echo "(I can't compile the test program--guessing $sizesize.)" >&4
19946 : check for socklen_t
19948 echo "Checking to see if you have socklen_t..." >&4
19950 #include <sys/types.h>
19951 #$d_socket HAS_SOCKET
19953 #include <sys/socket.h>
19955 int main() { socklen_t x = 16; }
19958 if eval $compile; then
19960 echo "You have socklen_t."
19963 echo "You do not have socklen_t."
19964 case "$sizetype" in
19965 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
19972 : see if this is a socks.h system
19973 set socks.h i_socks
19976 : check for type of the size argument to socket calls
19977 case "$d_socket" in
19981 Checking to see what type is the last argument of accept().
19984 case "$d_socklen_t" in
19985 "$define") yyy="$yyy socklen_t"
19987 yyy="$yyy $sizetype int long unsigned"
19988 for xxx in $yyy; do
19989 case "$socksizetype" in
19990 '') try="extern int accept(int, struct sockaddr *, $xxx *);"
19991 case "$usesocks" in
19993 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
19994 echo "Your system accepts '$xxx *' for the last argument of accept()."
19995 socksizetype="$xxx"
19998 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
19999 echo "Your system accepts '$xxx *' for the last argument of accept()."
20000 socksizetype="$xxx"
20007 : In case none of those worked, prompt the user.
20008 case "$socksizetype" in
20009 '') rp='What is the type for socket address structure sizes?'
20016 *) : no sockets, so pick relatively harmless default
20021 : see what type is used for signed size_t
20022 set ssize_t ssizetype int stdio.h sys/types.h
20027 #$i_stdlib I_STDLIB
20029 #include <stdlib.h>
20031 #include <sys/types.h>
20032 #define Size_t $sizetype
20033 #define SSize_t $dflt
20036 if (sizeof(Size_t) == sizeof(SSize_t))
20038 else if (sizeof(Size_t) == sizeof(int))
20047 if eval $compile_ok && $run ./try > /dev/null; then
20048 ssizetype=`$run ./try`
20049 echo "I'll be using $ssizetype for functions returning a byte count." >&4
20052 Help! I can't compile and run the ssize_t test program: please enlighten me!
20053 (This is probably a misconfiguration in your system or libraries, and
20054 you really ought to fix it. Still, I'll try anyway.)
20056 I need a type that is the same size as $sizetype, but is guaranteed to
20057 be signed. Common values are ssize_t, int and long.
20060 rp="What signed type is the same size as $sizetype?"
20066 : see what type of char stdio uses.
20068 echo '#include <stdio.h>' > stdio.c
20069 $cppstdin $cppminus < stdio.c > stdioh
20070 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
20071 echo "Your stdio uses unsigned chars." >&4
20072 stdchar="unsigned char"
20074 echo "Your stdio uses signed chars." >&4
20077 $rm -f stdio.* stdioh
20079 : see what type uids are declared as in the kernel
20081 echo "Looking for the type for user ids returned by getuid()."
20082 set uid_t uidtype xxx stdio.h sys/types.h
20086 xxx=`./findhdr sys/user.h`
20087 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
20089 unsigned) dflt="$1 $2" ;;
20093 *) dflt="$uidtype";;
20096 uid_t) echo "uid_t found." ;;
20097 *) rp="What is the type for user ids returned by getuid()?"
20105 *_t) zzz="$uidtype" ;;
20108 echo "Checking the size of $zzz..." >&4
20110 #include <sys/types.h>
20112 #$i_stdlib I_STDLIB
20114 #include <stdlib.h>
20117 printf("%d\n", (int)sizeof($uidtype));
20122 if eval $compile_ok; then
20126 echo "(I can't execute the test program--guessing $uidsize.)" >&4
20129 echo "Your $zzz is $uidsize bytes long."
20134 echo "(I can't compile the test program--guessing $uidsize.)" >&4
20139 *_t) zzz="$uidtype" ;;
20142 echo "Checking the sign of $zzz..." >&4
20144 #include <sys/types.h>
20155 if eval $compile; then
20159 echo "(I can't execute the test program--guessing unsigned.)" >&4
20163 1) echo "Your $zzz is unsigned." ;;
20164 -1) echo "Your $zzz is signed." ;;
20170 echo "(I can't compile the test program--guessing unsigned.)" >&4
20176 $echo "Checking the format string to be used for uids..." >&4
20179 -1) if $test X"$uidsize" = X"$ivsize"; then
20180 uidformat="$ivdformat"
20182 if $test X"$uidsize" = X"$longsize"; then
20185 if $test X"$uidsize" = X"$intsize"; then
20188 if $test X"$uidsize" = X"$shortsize"; then
20195 *) if $test X"$uidsize" = X"$uvsize"; then
20196 uidformat="$uvuformat"
20198 if $test X"$uidsize" = X"$longsize"; then
20201 if $test X"$uidsize" = X"$intsize"; then
20204 if $test X"$uidsize" = X"$shortsize"; then
20214 case "$usesitecustomize" in
20215 $define|true|[Yy]*)
20216 usesitecustomize="$define"
20219 usesitecustomize="$undef"
20223 : determine compiler compiler
20232 if $test -f "$byacc$_exe"; then
20234 comp="byacc or $comp"
20236 if $test -f "$bison$_exe"; then
20237 comp="$comp or bison -y"
20239 rp="Which compiler compiler ($comp) shall I use?"
20248 echo "(Adding -y option to bison to get yacc-compatible behaviour.)"
20254 : see if this is a fp.h system
20258 : see if this is a fp_class.h system
20259 set fp_class.h i_fp_class
20262 : see if gdbm.h is available
20267 : see if gdbm_open exists
20268 set gdbm_open d_gdbm_open
20270 case "$d_gdbm_open" in
20273 echo "We won't be including <gdbm.h>"
20282 : see if this is a ieeefp.h system
20283 case "$i_ieeefp" in
20284 '' ) set ieeefp.h i_ieeefp
20289 : see if this is a libutil.h system
20290 set libutil.h i_libutil
20293 : see if mach cthreads are available
20294 if test "X$usethreads" = "X$define"; then
20295 set mach/cthreads.h i_machcthr
20298 i_machcthr="$undef"
20303 : see if this is a mntent.h system
20304 set mntent.h i_mntent
20307 : see if ndbm.h is available
20313 # Some Linux distributions such as RedHat 7.1 put the
20314 # ndbm.h header in /usr/include/gdbm/ndbm.h.
20315 if $test -f /usr/include/gdbm/ndbm.h; then
20316 echo '<gdbm/ndbm.h> found.'
20317 ccflags="$ccflags -I/usr/include/gdbm"
20318 cppflags="$cppflags -I/usr/include/gdbm"
20326 : see if dbm_open exists
20327 set dbm_open d_dbm_open
20329 case "$d_dbm_open" in
20332 echo "We won't be including <ndbm.h>"
20341 : see if net/errno.h is available
20343 set net/errno.h val
20346 : Unfortunately, it causes problems on some systems. Arrgh.
20349 cat > try.c <<'EOM'
20352 #include <net/errno.h>
20358 if $cc $ccflags -c try.c >/dev/null 2>&1; then
20359 echo "We'll be including <net/errno.h>." >&4
20361 echo "We won't be including <net/errno.h>." >&4
20370 : see if netinet/tcp.h is available
20371 set netinet/tcp.h i_netinettcp
20374 : see if this is a poll.h system
20378 : see if this is a prot.h system
20383 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
20384 $cat <<'EOSH' > Cppsym.know
20385 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
20386 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
20387 alliant alpha am29000 AM29000 AMD64 amd64 amiga AMIGAOS AMIX
20388 ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
20389 BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
20390 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
20391 bull c cadmus clipper CMU COFF COMPILER_VERSION
20392 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
20393 CYGWIN DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
20394 Dynix DynixPTX ELF encore EPI EXTENSIONS FAVOR_BSD
20395 FILE_OFFSET_BITS FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
20397 GNU_SOURCE GNUC GNUC_MINOR GNU_LIBRARY GO32 gould GOULD_PN
20398 H3050R H3050RX hbullx20 hcx host_mips
20399 hp200 hp300 hp700 HP700 hp800 hp9000
20400 hp9000s200 hp9000s300 hp9000s400 hp9000s500
20401 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
20402 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
20403 IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
20404 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
20405 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
20406 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
20407 Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
20408 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
20409 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
20410 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
20411 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
20412 MATH_HAS_NO_SIDE_EFFECTS
20413 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
20414 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
20415 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
20416 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
20417 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
20418 NetBSD news1500 news1700 news1800 news1900 news3700
20419 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
20420 ns32016 ns32332 ns32k nsc32000
20421 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
20422 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
20423 pc532 pdp11 PGC PIC plexus PORTAR posix
20424 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
20425 POSIX_C_SOURCE POSIX_SOURCE POWER
20426 PROTOTYPES PWB pyr QNX R3000 REENTRANT RES Rhapsody RISC6000
20427 riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
20428 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
20429 sony sony_news sonyrisc sparc sparclite spectrum
20430 stardent stdc STDC_EXT stratos sun sun3 sun386
20431 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
20432 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
20433 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
20434 sysV68 sysV88 Tek4132 Tek4300 titan
20435 TM3200 TM5400 TM5600
20436 tower tower32 tower32_200 tower32_600 tower32_700
20437 tower32_800 tower32_850 tss
20438 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
20439 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
20440 unix UNIX95 UNIX99 unixpc unos
20441 USE_BSD USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE USE_LARGEFILE64
20442 USE_MISC USE_POSIX USE_POSIX199309 USE_POSIX199506 USE_POSIX2
20443 USE_REENTRANT USE_SVID USE_UNIX98 USE_XOPEN USE_XOPEN_EXTENDED
20445 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms x86_64 xenix Xenix286
20446 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
20447 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
20450 # Maybe put other stuff here too.
20451 cat <<EOSH >>Cppsym.know
20454 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
20455 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
20456 $cat Cppsym.know > Cppsym.c
20457 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
20458 $rm -f Cppsym.a Cppsym.b Cppsym.c
20459 cat <<EOSH > Cppsym
20461 if $test \$# -gt 0; then
20462 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
20463 if $test -s Cppsym.got; then
20470 $tr " " "$trnl" | ./Cppsym.try
20476 cat <<EOSH > Cppsym.try
20478 cat <<'EOCP' > try.c
20481 #define STRINGIFY(a) "a"
20483 #if cpp_stuff == 42
20484 #define StGiFy(a) #a
20485 #define STRINGIFY(a) StGiFy(a)
20487 #if $cpp_stuff != 1 && $cpp_stuff != 42
20488 # include "Bletch: How does this C preprocessor stringify macros?"
20494 cat <<'EOSH' >> Cppsym.try
20496 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
20497 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
20498 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
20499 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
20501 echo 'return 0;}' >> try.c
20503 cat <<EOSH >> Cppsym.try
20505 case "$osname-$gccversion" in
20506 irix-) ccflags="\$ccflags -woff 1178" ;;
20507 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
20509 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs && $run ./try | $sed 's/ /\\\\ /g'
20511 chmod +x Cppsym.try
20512 $eunicefix Cppsym.try
20513 ./Cppsym < Cppsym.know > Cppsym.true
20514 : Add in any linux cpp "predefined macros":
20515 case "$osname::$gccversion" in
20518 rm -f $tHdrH'.h' $tHdrH
20520 if cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
20521 sed 's/#define[\ \ ]*//;s/[\ \ ].*$//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
20522 if [ -s $tHdrH'_cppsym.real' ]; then
20523 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
20526 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
20529 : now check the C compiler for additional symbols
20530 postprocess_cc_v=''
20532 aix) postprocess_cc_v="|$tr , ' '" ;;
20539 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
20542 -D*) echo "\$i" | $sed 's/^-D//';;
20543 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
20548 postprocess_cc_v=''
20551 ./ccsym > ccsym1.raw
20552 if $test -s ccsym1.raw; then
20553 $sort ccsym1.raw | $uniq >ccsym.raw
20555 mv ccsym1.raw ccsym.raw
20558 $awk '/\=/ { print $0; next }
20559 { print $0"=1" }' ccsym.raw >ccsym.list
20560 $comm -13 Cppsym.true ccsym.list >ccsym.own
20561 $comm -12 Cppsym.true ccsym.list >ccsym.com
20562 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
20564 if $test -z ccsym.raw; then
20565 echo "Your C compiler doesn't seem to define any symbols!" >&4
20567 echo "However, your C preprocessor defines the following symbols:"
20570 cppsymbols=`$cat Cppsym.true`
20571 cppsymbols=`echo $cppsymbols`
20572 cppccsymbols="$cppsymbols"
20574 if $test -s ccsym.com; then
20575 echo "Your C compiler and pre-processor define these symbols:"
20576 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
20579 cppccsymbols=`$cat ccsym.com`
20580 cppccsymbols=`echo $cppccsymbols`
20581 $test "$silent" || sleep 1
20583 if $test -s ccsym.cpp; then
20584 $test "$also" && echo " "
20585 echo "Your C pre-processor ${also}defines the following symbols:"
20586 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
20588 cppsymbols=`$cat ccsym.cpp`
20589 cppsymbols=`echo $cppsymbols`
20590 $test "$silent" || sleep 1
20592 if $test -s ccsym.own; then
20593 $test "$also" && echo " "
20594 echo "Your C compiler ${also}defines the following cpp symbols:"
20595 $sed -e 's/\(..*\)=1/\1/' ccsym.own
20596 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
20597 ccsymbols=`$cat ccsym.own`
20598 ccsymbols=`echo $ccsymbols`
20599 $test "$silent" || sleep 1
20603 : see if this is a termio system
20607 if $test `./findhdr termios.h`; then
20608 set tcsetattr i_termios
20614 "$define") echo "You have POSIX termios.h... good!" >&4;;
20615 *) if ./Cppsym pyr; then
20616 case "`/bin/universe`" in
20617 ucb) if $test `./findhdr sgtty.h`; then
20619 echo "<sgtty.h> found." >&4
20621 echo "System is pyramid with BSD universe."
20622 echo "<sgtty.h> not found--you could have problems." >&4
20624 *) if $test `./findhdr termio.h`; then
20626 echo "<termio.h> found." >&4
20628 echo "System is pyramid with USG universe."
20629 echo "<termio.h> not found--you could have problems." >&4
20633 if $test `./findhdr termio.h`; then
20634 echo "<termio.h> found." >&4
20636 elif $test `./findhdr sgtty.h`; then
20637 echo "<sgtty.h> found." >&4
20640 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
20643 if $test `./findhdr sgtty.h`; then
20644 echo "<sgtty.h> found." >&4
20646 elif $test `./findhdr termio.h`; then
20647 echo "<termio.h> found." >&4
20650 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
20654 set i_termio; eval $setvar
20655 val=$val2; set i_sgtty; eval $setvar
20656 val=$val3; set i_termios; eval $setvar
20658 : see if stddef is available
20659 set stddef.h i_stddef
20662 : see if this is a sunmath.h system
20663 set sunmath.h i_sunmath
20666 : see if sys/access.h is available
20667 set sys/access.h i_sysaccess
20670 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
20671 set sys/filio.h i_sysfilio
20674 if $test `./findhdr sys/ioctl.h`; then
20676 echo '<sys/ioctl.h> found.' >&4
20679 if $test $i_sysfilio = "$define"; then
20680 echo '<sys/ioctl.h> NOT found.' >&4
20682 $test $i_sgtty = "$define" && xxx="sgtty.h"
20683 $test $i_termio = "$define" && xxx="termio.h"
20684 $test $i_termios = "$define" && xxx="termios.h"
20685 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
20691 : see if socket ioctl defs are in sys/sockio.h
20693 xxx=`./findhdr sys/sockio.h`
20694 if $test "$xxx"; then
20695 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
20697 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
20700 echo "No socket ioctls found in <sys/sockio.h>." >&4
20705 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
20712 : see if this is a syslog.h system
20713 set syslog.h i_syslog
20717 : see if this is a sys/mode.h system
20718 set sys/mode.h i_sysmode
20721 : see if sys/resource.h has to be included
20722 set sys/resource.h i_sysresrc
20725 : see if sys/security.h is available
20726 set sys/security.h i_syssecrt
20729 : see if this is a sys/statvfs.h system
20730 set sys/statvfs.h i_sysstatvfs
20733 : see if this is a sys/un.h system
20734 set sys/un.h i_sysun
20738 : see if this is a sys/utsname.h system
20739 set sys/utsname.h i_sysutsname
20742 : see if this is a syswait system
20743 set sys/wait.h i_syswait
20746 : see if this is a ustat.h system
20747 set ustat.h i_ustat
20750 : see if this is an utime system
20751 set utime.h i_utime
20754 : see if this is a values.h system
20755 set values.h i_values
20758 : see if this is a vfork system
20761 set vfork.h i_vfork
20770 echo "Looking for extensions..." >&4
20771 : If we are using the old config.sh, known_extensions may contain
20772 : old or inaccurate or duplicate values.
20773 known_extensions=''
20774 nonxs_extensions=''
20775 : We do not use find because it might not be available.
20776 : We do not just use MANIFEST because the user may have dropped
20777 : some additional extensions into the source tree and expect them
20780 : Function to recursively find available extensions, ignoring DynaLoader
20781 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
20785 DynaLoader|dynaload) ;;
20787 if $test -f $xxx/$xxx.xs; then
20788 known_extensions="$known_extensions $1$xxx";
20789 elif $test -f $xxx/Makefile.PL; then
20790 nonxs_extensions="$nonxs_extensions $1$xxx";
20792 if $test -d $xxx -a $# -lt 10; then
20795 eval $find_extensions;
20807 eval $find_extensions
20808 # Special case: Add in threads/shared since it is not picked up by the
20809 # recursive find above (and adding in general recursive finding breaks
20810 # SDBM_File/sdbm). A.D. 10/25/2001.
20811 known_extensions="$known_extensions threads/shared"
20812 set X $nonxs_extensions
20814 nonxs_extensions="$*"
20815 set X $known_extensions
20817 known_extensions="$*"
20820 : Now see which are supported on this system.
20822 for xxx in $known_extensions ; do
20826 $define) avail_ext="$avail_ext $xxx" ;;
20829 GDBM_File|gdbm_fil)
20831 $define) avail_ext="$avail_ext $xxx" ;;
20834 I18N/Langinfo|i18n_lan)
20835 case "$i_langinfo$d_nl_langinfo" in
20836 $define$define) avail_ext="$avail_ext $xxx" ;;
20839 NDBM_File|ndbm_fil)
20842 case "$osname-$use64bitint" in
20845 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
20848 *) avail_ext="$avail_ext $xxx" ;;
20853 ODBM_File|odbm_fil)
20854 case "${i_dbm}${i_rpcsvcdbm}" in
20856 case "$osname-$use64bitint" in
20859 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
20862 *) avail_ext="$avail_ext $xxx" ;;
20868 case "$useposix" in
20869 true|define|y) avail_ext="$avail_ext $xxx" ;;
20873 case "$useopcode" in
20874 true|define|y) avail_ext="$avail_ext $xxx" ;;
20878 case "$d_socket" in
20881 beos) ;; # not unless BONE
20882 *) avail_ext="$avail_ext $xxx" ;;
20887 Sys/Syslog|sys/syslog)
20888 : XXX syslog requires socket
20889 case "$d_socket" in
20890 true|$define|y) avail_ext="$avail_ext $xxx" ;;
20894 case "$usethreads" in
20896 case "$useithreads" in
20897 $undef|false|[nN]*) avail_ext="$avail_ext $xxx" ;;
20901 XS/APItest|xs/apitest)
20902 # This is just for testing. Skip it unless we have dynamic loading.
20905 $define) avail_ext="$avail_ext $xxx" ;;
20908 XS/Typemap|xs/typemap)
20909 # This is just for testing. Skip it unless we have dynamic loading.
20911 $define) avail_ext="$avail_ext $xxx" ;;
20914 threads|threads/shared)
20915 # threads and threads::shared are special cases.
20916 # To stop people from asking "Perl 5.8.0 was supposed
20917 # to have this new fancy threads implementation but my
20918 # perl doesn't have it" and from people trying to
20919 # (re)install the threads module using CPAN.pm and
20920 # CPAN.pm then offering to reinstall Perl 5.8.0,
20921 # the threads.pm and threads/shared.pm will always be
20922 # there, croaking informatively ("you need to rebuild
20923 # all of Perl with threads, sorry") when threads haven't
20924 # been compiled in.
20926 avail_ext="$avail_ext $xxx"
20929 : XXX Do we need a useipcsysv variable here
20930 case "${d_msg}${d_sem}${d_shm}" in
20931 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
20934 *) avail_ext="$avail_ext $xxx"
20943 case "$onlyextensions" in
20945 *) keepextensions=''
20946 echo "You have requested that only certains extensions be included..." >&4
20947 for i in $onlyextensions; do
20948 case " $avail_ext " in
20950 echo "Keeping extension $i."
20951 keepextensions="$keepextensions $i"
20953 *) echo "Ignoring extension $i." ;;
20956 avail_ext="$keepextensions"
20960 case "$noextensions" in
20962 *) keepextensions=''
20963 echo "You have requested that certain extensions be ignored..." >&4
20964 for i in $avail_ext; do
20965 case " $noextensions " in
20966 *" $i "*) echo "Ignoring extension $i." ;;
20967 *) echo "Keeping extension $i.";
20968 keepextensions="$keepextensions $i"
20972 avail_ext="$keepextensions"
20976 : Now see which nonxs extensions are supported on this system.
20977 : For now assume all are.
20979 for xxx in $nonxs_extensions ; do
20981 *) nonxs_ext="$nonxs_ext $xxx"
20993 A number of extensions are supplied with $package. You may choose to
20994 compile these extensions for dynamic loading (the default), compile
20995 them into the $package executable (static loading), or not include
20996 them at all. Answer "none" to include no extensions.
20997 Note that DynaLoader is always built and need not be mentioned here.
21000 case "$dynamic_ext" in
21002 : Exclude those listed in static_ext
21004 for xxx in $avail_ext; do
21005 case " $static_ext " in
21007 *) dflt="$dflt $xxx" ;;
21014 *) dflt="$dynamic_ext"
21015 # Perhaps we are reusing an old out-of-date config.sh.
21018 if test X"$dynamic_ext" != X"$avail_ext"; then
21020 NOTICE: Your previous config.sh list may be incorrect.
21021 The extensions now available to you are
21023 but the default list from your previous config.sh is
21035 rp="What extensions do you wish to load dynamically?"
21038 none) dynamic_ext=' ' ;;
21039 *) dynamic_ext="$ans" ;;
21042 case "$static_ext" in
21044 : Exclude those already listed in dynamic linking
21046 for xxx in $avail_ext; do
21047 case " $dynamic_ext " in
21049 *) dflt="$dflt $xxx" ;;
21056 *) dflt="$static_ext"
21063 rp="What extensions do you wish to load statically?"
21066 none) static_ext=' ' ;;
21067 *) static_ext="$ans" ;;
21072 A number of extensions are supplied with $package. Answer "none"
21073 to include no extensions.
21074 Note that DynaLoader is always built and need not be mentioned here.
21077 case "$static_ext" in
21078 '') dflt="$avail_ext" ;;
21079 *) dflt="$static_ext"
21080 # Perhaps we are reusing an old out-of-date config.sh.
21083 if test X"$static_ext" != X"$avail_ext"; then
21085 NOTICE: Your previous config.sh list may be incorrect.
21086 The extensions now available to you are
21088 but the default list from your previous config.sh is
21097 : Exclude those that are not xs extensions
21101 rp="What extensions do you wish to include?"
21104 none) static_ext=' ' ;;
21105 *) static_ext="$ans" ;;
21110 # Encode is a special case. If we are building Encode as a static
21111 # extension, we need to explicitly list its subextensions as well.
21112 # For other nested extensions, this is handled automatically by
21113 # the appropriate Makefile.PL.
21114 case " $static_ext " in
21115 *" Encode "*) # Add the subextensions of Encode
21117 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
21118 static_ext="$static_ext Encode/$xxx"
21124 set X $dynamic_ext $static_ext $nonxs_ext
21128 # Sanity check: We require an extension suitable for use with
21129 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
21130 # should show up as failures in the test suite, but it's helpful to
21131 # catch them now.) The 'extensions' list is normally sorted
21132 # alphabetically, so we need to accept either
21133 # DB_File ... Fcntl ... IO ....
21134 # or something like
21135 # Fcntl ... NDBM_File ... IO ....
21136 case " $extensions" in
21137 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
21138 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
21139 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
21140 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
21141 echo "WARNING: The Perl you are building will be quite crippled." >& 4
21145 : Remove libraries needed only for extensions
21146 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
21147 : The exception is SunOS 4.x, which needs them.
21148 case "${osname}X${osvers}" in
21152 *) case "$usedl" in
21153 $define|true|[yY]*)
21154 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
21158 *) perllibs="$libs"
21164 : Remove build directory name from cppstdin so it can be used from
21165 : either the present location or the final installed location.
21167 : Get out of the UU directory to get correct path name.
21169 case "$cppstdin" in
21171 echo "Stripping down cppstdin path name"
21177 : end of configuration questions
21179 echo "End of configuration questions."
21182 : back to where it started
21183 if test -d ../UU; then
21187 : configuration may be patched via a 'config.arch' file
21188 if $test -f config.arch; then
21189 echo "I see a config.arch file, loading it."
21193 : configuration may be patched via a 'config.over' file
21194 if $test -f config.over; then
21197 rp='I see a config.over file. Do you wish to load it?'
21200 n*) echo "OK, I'll ignore it.";;
21202 echo "Configuration override changes have been loaded."
21207 : in case they want portability, strip down executable paths
21208 case "$d_portable" in
21211 echo "Stripping down executable paths..." >&4
21212 for file in $loclist $trylist; do
21214 eval $file=`basename $temp`
21219 : create config.sh file
21221 echo "Creating config.sh..." >&4
21222 $spitshell <<EOT >config.sh
21225 # This file was produced by running the Configure script. It holds all the
21226 # definitions figured out by Configure. Should you modify one of these values,
21227 # do not forget to propagate your changes by running "Configure -der". You may
21228 # instead choose to run each of the .SH files by yourself, or "Configure -S".
21231 # Package name : $package
21232 # Source directory : $src
21233 # Configuration time: $cf_time
21234 # Configured by : $cf_by
21235 # Target system : $myuname
21245 Revision='$Revision'
21253 alignbytes='$alignbytes'
21254 ansi2knr='$ansi2knr'
21255 aphostname='$aphostname'
21256 api_revision='$api_revision'
21257 api_subversion='$api_subversion'
21258 api_version='$api_version'
21259 api_versionstring='$api_versionstring'
21262 archlibexp='$archlibexp'
21263 archname64='$archname64'
21264 archname='$archname'
21265 archobjs='$archobjs'
21266 asctime_r_proto='$asctime_r_proto'
21274 byteorder='$byteorder'
21276 castflags='$castflags'
21279 cccdlflags='$cccdlflags'
21280 ccdlflags='$ccdlflags'
21282 ccflags_uselargefiles='$ccflags_uselargefiles'
21284 ccsymbols='$ccsymbols'
21285 ccversion='$ccversion'
21287 cf_email='$cf_email'
21289 charsize='$charsize'
21293 clocktype='$clocktype'
21295 compress='$compress'
21296 contains='$contains'
21300 cpp_stuff='$cpp_stuff'
21301 cppccsymbols='$cppccsymbols'
21302 cppflags='$cppflags'
21304 cppminus='$cppminus'
21306 cppstdin='$cppstdin'
21307 cppsymbols='$cppsymbols'
21308 crypt_r_proto='$crypt_r_proto'
21309 cryptlib='$cryptlib'
21311 ctermid_r_proto='$ctermid_r_proto'
21312 ctime_r_proto='$ctime_r_proto'
21313 d_Gconvert='$d_Gconvert'
21314 d_PRIEUldbl='$d_PRIEUldbl'
21315 d_PRIFUldbl='$d_PRIFUldbl'
21316 d_PRIGUldbl='$d_PRIGUldbl'
21317 d_PRIXU64='$d_PRIXU64'
21318 d_PRId64='$d_PRId64'
21319 d_PRIeldbl='$d_PRIeldbl'
21320 d_PRIfldbl='$d_PRIfldbl'
21321 d_PRIgldbl='$d_PRIgldbl'
21322 d_PRIi64='$d_PRIi64'
21323 d_PRIo64='$d_PRIo64'
21324 d_PRIu64='$d_PRIu64'
21325 d_PRIx64='$d_PRIx64'
21326 d_SCNfldbl='$d_SCNfldbl'
21327 d__fwalk='$d__fwalk'
21328 d_access='$d_access'
21329 d_accessx='$d_accessx'
21332 d_archlib='$d_archlib'
21333 d_asctime_r='$d_asctime_r'
21336 d_attribute_format='$d_attribute_format'
21337 d_attribute_malloc='$d_attribute_malloc'
21338 d_attribute_nonnull='$d_attribute_nonnull'
21339 d_attribute_noreturn='$d_attribute_noreturn'
21340 d_attribute_pure='$d_attribute_pure'
21341 d_attribute_unused='$d_attribute_unused'
21342 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
21346 d_bsdgetpgrp='$d_bsdgetpgrp'
21347 d_bsdsetpgrp='$d_bsdsetpgrp'
21348 d_builtin_choose_expr='$d_builtin_choose_expr'
21349 d_builtin_expect='$d_builtin_expect'
21351 d_c99_variadic_macros='$d_c99_variadic_macros'
21352 d_casti32='$d_casti32'
21353 d_castneg='$d_castneg'
21354 d_charvspr='$d_charvspr'
21356 d_chroot='$d_chroot'
21357 d_chsize='$d_chsize'
21359 d_clearenv='$d_clearenv'
21360 d_closedir='$d_closedir'
21361 d_cmsghdr_s='$d_cmsghdr_s'
21363 d_copysignl='$d_copysignl'
21364 d_cplusplus='$d_cplusplus'
21366 d_crypt_r='$d_crypt_r'
21368 d_ctermid='$d_ctermid'
21369 d_ctermid_r='$d_ctermid_r'
21370 d_ctime_r='$d_ctime_r'
21371 d_cuserid='$d_cuserid'
21372 d_dbl_dig='$d_dbl_dig'
21373 d_dbminitproto='$d_dbminitproto'
21374 d_difftime='$d_difftime'
21376 d_dirnamlen='$d_dirnamlen'
21377 d_dlerror='$d_dlerror'
21378 d_dlopen='$d_dlopen'
21379 d_dlsymun='$d_dlsymun'
21380 d_dosuid='$d_dosuid'
21381 d_drand48_r='$d_drand48_r'
21382 d_drand48proto='$d_drand48proto'
21384 d_eaccess='$d_eaccess'
21385 d_endgrent='$d_endgrent'
21386 d_endgrent_r='$d_endgrent_r'
21387 d_endhent='$d_endhent'
21388 d_endhostent_r='$d_endhostent_r'
21389 d_endnent='$d_endnent'
21390 d_endnetent_r='$d_endnetent_r'
21391 d_endpent='$d_endpent'
21392 d_endprotoent_r='$d_endprotoent_r'
21393 d_endpwent='$d_endpwent'
21394 d_endpwent_r='$d_endpwent_r'
21395 d_endsent='$d_endsent'
21396 d_endservent_r='$d_endservent_r'
21397 d_eofnblk='$d_eofnblk'
21398 d_eunice='$d_eunice'
21399 d_faststdio='$d_faststdio'
21400 d_fchdir='$d_fchdir'
21401 d_fchmod='$d_fchmod'
21402 d_fchown='$d_fchown'
21404 d_fcntl_can_lock='$d_fcntl_can_lock'
21405 d_fd_macros='$d_fd_macros'
21406 d_fd_set='$d_fd_set'
21407 d_fds_bits='$d_fds_bits'
21408 d_fgetpos='$d_fgetpos'
21409 d_finite='$d_finite'
21410 d_finitel='$d_finitel'
21411 d_flexfnam='$d_flexfnam'
21413 d_flockproto='$d_flockproto'
21415 d_fp_class='$d_fp_class'
21416 d_fpathconf='$d_fpathconf'
21417 d_fpclass='$d_fpclass'
21418 d_fpclassify='$d_fpclassify'
21419 d_fpclassl='$d_fpclassl'
21420 d_fpos64_t='$d_fpos64_t'
21421 d_frexpl='$d_frexpl'
21422 d_fs_data_s='$d_fs_data_s'
21423 d_fseeko='$d_fseeko'
21424 d_fsetpos='$d_fsetpos'
21425 d_fstatfs='$d_fstatfs'
21426 d_fstatvfs='$d_fstatvfs'
21428 d_ftello='$d_ftello'
21430 d_futimes='$d_futimes'
21431 d_getcwd='$d_getcwd'
21432 d_getespwnam='$d_getespwnam'
21433 d_getfsstat='$d_getfsstat'
21434 d_getgrent='$d_getgrent'
21435 d_getgrent_r='$d_getgrent_r'
21436 d_getgrgid_r='$d_getgrgid_r'
21437 d_getgrnam_r='$d_getgrnam_r'
21438 d_getgrps='$d_getgrps'
21439 d_gethbyaddr='$d_gethbyaddr'
21440 d_gethbyname='$d_gethbyname'
21441 d_gethent='$d_gethent'
21442 d_gethname='$d_gethname'
21443 d_gethostbyaddr_r='$d_gethostbyaddr_r'
21444 d_gethostbyname_r='$d_gethostbyname_r'
21445 d_gethostent_r='$d_gethostent_r'
21446 d_gethostprotos='$d_gethostprotos'
21447 d_getitimer='$d_getitimer'
21448 d_getlogin='$d_getlogin'
21449 d_getlogin_r='$d_getlogin_r'
21450 d_getmnt='$d_getmnt'
21451 d_getmntent='$d_getmntent'
21452 d_getnbyaddr='$d_getnbyaddr'
21453 d_getnbyname='$d_getnbyname'
21454 d_getnent='$d_getnent'
21455 d_getnetbyaddr_r='$d_getnetbyaddr_r'
21456 d_getnetbyname_r='$d_getnetbyname_r'
21457 d_getnetent_r='$d_getnetent_r'
21458 d_getnetprotos='$d_getnetprotos'
21459 d_getpagsz='$d_getpagsz'
21460 d_getpbyname='$d_getpbyname'
21461 d_getpbynumber='$d_getpbynumber'
21462 d_getpent='$d_getpent'
21463 d_getpgid='$d_getpgid'
21464 d_getpgrp2='$d_getpgrp2'
21465 d_getpgrp='$d_getpgrp'
21466 d_getppid='$d_getppid'
21467 d_getprior='$d_getprior'
21468 d_getprotobyname_r='$d_getprotobyname_r'
21469 d_getprotobynumber_r='$d_getprotobynumber_r'
21470 d_getprotoent_r='$d_getprotoent_r'
21471 d_getprotoprotos='$d_getprotoprotos'
21472 d_getprpwnam='$d_getprpwnam'
21473 d_getpwent='$d_getpwent'
21474 d_getpwent_r='$d_getpwent_r'
21475 d_getpwnam_r='$d_getpwnam_r'
21476 d_getpwuid_r='$d_getpwuid_r'
21477 d_getsbyname='$d_getsbyname'
21478 d_getsbyport='$d_getsbyport'
21479 d_getsent='$d_getsent'
21480 d_getservbyname_r='$d_getservbyname_r'
21481 d_getservbyport_r='$d_getservbyport_r'
21482 d_getservent_r='$d_getservent_r'
21483 d_getservprotos='$d_getservprotos'
21484 d_getspnam='$d_getspnam'
21485 d_getspnam_r='$d_getspnam_r'
21486 d_gettimeod='$d_gettimeod'
21487 d_gmtime_r='$d_gmtime_r'
21488 d_gnulibc='$d_gnulibc'
21489 d_grpasswd='$d_grpasswd'
21490 d_hasmntopt='$d_hasmntopt'
21492 d_ilogbl='$d_ilogbl'
21493 d_inc_version_list='$d_inc_version_list'
21495 d_inetaton='$d_inetaton'
21496 d_int64_t='$d_int64_t'
21497 d_isascii='$d_isascii'
21498 d_isfinite='$d_isfinite'
21501 d_isnanl='$d_isnanl'
21502 d_killpg='$d_killpg'
21503 d_lchown='$d_lchown'
21504 d_ldbl_dig='$d_ldbl_dig'
21505 d_libm_lib_version='$d_libm_lib_version'
21507 d_localtime_r='$d_localtime_r'
21508 d_locconv='$d_locconv'
21510 d_longdbl='$d_longdbl'
21511 d_longlong='$d_longlong'
21512 d_lseekproto='$d_lseekproto'
21514 d_madvise='$d_madvise'
21515 d_malloc_good_size='$d_malloc_good_size'
21516 d_malloc_size='$d_malloc_size'
21518 d_mbstowcs='$d_mbstowcs'
21519 d_mbtowc='$d_mbtowc'
21520 d_memchr='$d_memchr'
21521 d_memcmp='$d_memcmp'
21522 d_memcpy='$d_memcpy'
21523 d_memmove='$d_memmove'
21524 d_memset='$d_memset'
21526 d_mkdtemp='$d_mkdtemp'
21527 d_mkfifo='$d_mkfifo'
21528 d_mkstemp='$d_mkstemp'
21529 d_mkstemps='$d_mkstemps'
21530 d_mktime='$d_mktime'
21533 d_modfl_pow32_bug='$d_modfl_pow32_bug'
21534 d_modflproto='$d_modflproto'
21535 d_mprotect='$d_mprotect'
21537 d_msg_ctrunc='$d_msg_ctrunc'
21538 d_msg_dontroute='$d_msg_dontroute'
21539 d_msg_oob='$d_msg_oob'
21540 d_msg_peek='$d_msg_peek'
21541 d_msg_proxy='$d_msg_proxy'
21542 d_msgctl='$d_msgctl'
21543 d_msgget='$d_msgget'
21544 d_msghdr_s='$d_msghdr_s'
21545 d_msgrcv='$d_msgrcv'
21546 d_msgsnd='$d_msgsnd'
21548 d_munmap='$d_munmap'
21549 d_mymalloc='$d_mymalloc'
21551 d_nl_langinfo='$d_nl_langinfo'
21552 d_nv_preserves_uv='$d_nv_preserves_uv'
21553 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
21554 d_off64_t='$d_off64_t'
21555 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
21556 d_oldpthreads='$d_oldpthreads'
21557 d_oldsock='$d_oldsock'
21559 d_pathconf='$d_pathconf'
21561 d_perl_otherlibdirs='$d_perl_otherlibdirs'
21562 d_phostname='$d_phostname'
21565 d_portable='$d_portable'
21566 d_procselfexe='$d_procselfexe'
21567 d_pthread_atfork='$d_pthread_atfork'
21568 d_pthread_attr_setscope='$d_pthread_attr_setscope'
21569 d_pthread_yield='$d_pthread_yield'
21571 d_pwchange='$d_pwchange'
21572 d_pwclass='$d_pwclass'
21573 d_pwcomment='$d_pwcomment'
21574 d_pwexpire='$d_pwexpire'
21575 d_pwgecos='$d_pwgecos'
21576 d_pwpasswd='$d_pwpasswd'
21577 d_pwquota='$d_pwquota'
21580 d_random_r='$d_random_r'
21581 d_readdir64_r='$d_readdir64_r'
21582 d_readdir='$d_readdir'
21583 d_readdir_r='$d_readdir_r'
21584 d_readlink='$d_readlink'
21586 d_recvmsg='$d_recvmsg'
21587 d_rename='$d_rename'
21588 d_rewinddir='$d_rewinddir'
21590 d_safebcpy='$d_safebcpy'
21591 d_safemcpy='$d_safemcpy'
21592 d_sanemcmp='$d_sanemcmp'
21593 d_sbrkproto='$d_sbrkproto'
21594 d_scalbnl='$d_scalbnl'
21595 d_sched_yield='$d_sched_yield'
21596 d_scm_rights='$d_scm_rights'
21597 d_seekdir='$d_seekdir'
21598 d_select='$d_select'
21600 d_semctl='$d_semctl'
21601 d_semctl_semid_ds='$d_semctl_semid_ds'
21602 d_semctl_semun='$d_semctl_semun'
21603 d_semget='$d_semget'
21605 d_sendmsg='$d_sendmsg'
21606 d_setegid='$d_setegid'
21607 d_seteuid='$d_seteuid'
21608 d_setgrent='$d_setgrent'
21609 d_setgrent_r='$d_setgrent_r'
21610 d_setgrps='$d_setgrps'
21611 d_sethent='$d_sethent'
21612 d_sethostent_r='$d_sethostent_r'
21613 d_setitimer='$d_setitimer'
21614 d_setlinebuf='$d_setlinebuf'
21615 d_setlocale='$d_setlocale'
21616 d_setlocale_r='$d_setlocale_r'
21617 d_setnent='$d_setnent'
21618 d_setnetent_r='$d_setnetent_r'
21619 d_setpent='$d_setpent'
21620 d_setpgid='$d_setpgid'
21621 d_setpgrp2='$d_setpgrp2'
21622 d_setpgrp='$d_setpgrp'
21623 d_setprior='$d_setprior'
21624 d_setproctitle='$d_setproctitle'
21625 d_setprotoent_r='$d_setprotoent_r'
21626 d_setpwent='$d_setpwent'
21627 d_setpwent_r='$d_setpwent_r'
21628 d_setregid='$d_setregid'
21629 d_setresgid='$d_setresgid'
21630 d_setresuid='$d_setresuid'
21631 d_setreuid='$d_setreuid'
21632 d_setrgid='$d_setrgid'
21633 d_setruid='$d_setruid'
21634 d_setsent='$d_setsent'
21635 d_setservent_r='$d_setservent_r'
21636 d_setsid='$d_setsid'
21637 d_setvbuf='$d_setvbuf'
21641 d_shmatprototype='$d_shmatprototype'
21642 d_shmctl='$d_shmctl'
21644 d_shmget='$d_shmget'
21645 d_sigaction='$d_sigaction'
21646 d_sigprocmask='$d_sigprocmask'
21647 d_sigsetjmp='$d_sigsetjmp'
21648 d_sitearch='$d_sitearch'
21649 d_snprintf='$d_snprintf'
21650 d_sockatmark='$d_sockatmark'
21651 d_sockatmarkproto='$d_sockatmarkproto'
21652 d_socket='$d_socket'
21653 d_socklen_t='$d_socklen_t'
21654 d_sockpair='$d_sockpair'
21655 d_socks5_init='$d_socks5_init'
21656 d_sprintf_returns_strlen='$d_sprintf_returns_strlen'
21658 d_srand48_r='$d_srand48_r'
21659 d_srandom_r='$d_srandom_r'
21660 d_sresgproto='$d_sresgproto'
21661 d_sresuproto='$d_sresuproto'
21662 d_statblks='$d_statblks'
21663 d_statfs_f_flags='$d_statfs_f_flags'
21664 d_statfs_s='$d_statfs_s'
21665 d_statvfs='$d_statvfs'
21666 d_stdio_cnt_lval='$d_stdio_cnt_lval'
21667 d_stdio_ptr_lval='$d_stdio_ptr_lval'
21668 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
21669 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
21670 d_stdio_stream_array='$d_stdio_stream_array'
21671 d_stdiobase='$d_stdiobase'
21672 d_stdstdio='$d_stdstdio'
21673 d_strchr='$d_strchr'
21674 d_strcoll='$d_strcoll'
21675 d_strctcpy='$d_strctcpy'
21676 d_strerrm='$d_strerrm'
21677 d_strerror='$d_strerror'
21678 d_strerror_r='$d_strerror_r'
21679 d_strftime='$d_strftime'
21680 d_strlcat='$d_strlcat'
21681 d_strlcpy='$d_strlcpy'
21682 d_strtod='$d_strtod'
21683 d_strtol='$d_strtol'
21684 d_strtold='$d_strtold'
21685 d_strtoll='$d_strtoll'
21686 d_strtoq='$d_strtoq'
21687 d_strtoul='$d_strtoul'
21688 d_strtoull='$d_strtoull'
21689 d_strtouq='$d_strtouq'
21690 d_strxfrm='$d_strxfrm'
21691 d_suidsafe='$d_suidsafe'
21692 d_symlink='$d_symlink'
21693 d_syscall='$d_syscall'
21694 d_syscallproto='$d_syscallproto'
21695 d_sysconf='$d_sysconf'
21696 d_sysernlst='$d_sysernlst'
21697 d_syserrlst='$d_syserrlst'
21698 d_system='$d_system'
21699 d_tcgetpgrp='$d_tcgetpgrp'
21700 d_tcsetpgrp='$d_tcsetpgrp'
21701 d_telldir='$d_telldir'
21702 d_telldirproto='$d_telldirproto'
21705 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
21706 d_tm_tm_zone='$d_tm_tm_zone'
21707 d_tmpnam_r='$d_tmpnam_r'
21708 d_truncate='$d_truncate'
21709 d_ttyname_r='$d_ttyname_r'
21710 d_tzname='$d_tzname'
21711 d_u32align='$d_u32align'
21712 d_ualarm='$d_ualarm'
21715 d_union_semun='$d_union_semun'
21716 d_unordered='$d_unordered'
21717 d_unsetenv='$d_unsetenv'
21718 d_usleep='$d_usleep'
21719 d_usleepproto='$d_usleepproto'
21721 d_vendorarch='$d_vendorarch'
21722 d_vendorbin='$d_vendorbin'
21723 d_vendorlib='$d_vendorlib'
21724 d_vendorscript='$d_vendorscript'
21726 d_void_closedir='$d_void_closedir'
21727 d_voidsig='$d_voidsig'
21728 d_voidtty='$d_voidtty'
21729 d_volatile='$d_volatile'
21730 d_vprintf='$d_vprintf'
21731 d_vsnprintf='$d_vsnprintf'
21733 d_waitpid='$d_waitpid'
21734 d_wcstombs='$d_wcstombs'
21735 d_wctomb='$d_wctomb'
21736 d_writev='$d_writev'
21739 db_hashtype='$db_hashtype'
21740 db_prefixtype='$db_prefixtype'
21741 db_version_major='$db_version_major'
21742 db_version_minor='$db_version_minor'
21743 db_version_patch='$db_version_patch'
21744 defvoidused='$defvoidused'
21745 direntrytype='$direntrytype'
21748 doublesize='$doublesize'
21750 drand48_r_proto='$drand48_r_proto'
21751 dynamic_ext='$dynamic_ext'
21757 endgrent_r_proto='$endgrent_r_proto'
21758 endhostent_r_proto='$endhostent_r_proto'
21759 endnetent_r_proto='$endnetent_r_proto'
21760 endprotoent_r_proto='$endprotoent_r_proto'
21761 endpwent_r_proto='$endpwent_r_proto'
21762 endservent_r_proto='$endservent_r_proto'
21763 eunicefix='$eunicefix'
21766 extensions='$extensions'
21768 fflushNULL='$fflushNULL'
21769 fflushall='$fflushall'
21771 firstmakefile='$firstmakefile'
21773 fpossize='$fpossize'
21774 fpostype='$fpostype'
21775 freetype='$freetype'
21778 full_csh='$full_csh'
21779 full_sed='$full_sed'
21780 gccansipedantic='$gccansipedantic'
21781 gccosandvers='$gccosandvers'
21782 gccversion='$gccversion'
21783 getgrent_r_proto='$getgrent_r_proto'
21784 getgrgid_r_proto='$getgrgid_r_proto'
21785 getgrnam_r_proto='$getgrnam_r_proto'
21786 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
21787 gethostbyname_r_proto='$gethostbyname_r_proto'
21788 gethostent_r_proto='$gethostent_r_proto'
21789 getlogin_r_proto='$getlogin_r_proto'
21790 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
21791 getnetbyname_r_proto='$getnetbyname_r_proto'
21792 getnetent_r_proto='$getnetent_r_proto'
21793 getprotobyname_r_proto='$getprotobyname_r_proto'
21794 getprotobynumber_r_proto='$getprotobynumber_r_proto'
21795 getprotoent_r_proto='$getprotoent_r_proto'
21796 getpwent_r_proto='$getpwent_r_proto'
21797 getpwnam_r_proto='$getpwnam_r_proto'
21798 getpwuid_r_proto='$getpwuid_r_proto'
21799 getservbyname_r_proto='$getservbyname_r_proto'
21800 getservbyport_r_proto='$getservbyport_r_proto'
21801 getservent_r_proto='$getservent_r_proto'
21802 getspnam_r_proto='$getspnam_r_proto'
21803 gidformat='$gidformat'
21809 gmtime_r_proto='$gmtime_r_proto'
21810 gnulibc_version='$gnulibc_version'
21812 groupcat='$groupcat'
21813 groupstype='$groupstype'
21816 h_sysfile='$h_sysfile'
21819 html1dir='$html1dir'
21820 html1direxp='$html1direxp'
21821 html3dir='$html3dir'
21822 html3direxp='$html3direxp'
21831 i_arpainet='$i_arpainet'
21832 i_bsdioctl='$i_bsdioctl'
21836 i_dirent='$i_dirent'
21842 i_fp_class='$i_fp_class'
21845 i_ieeefp='$i_ieeefp'
21846 i_inttypes='$i_inttypes'
21847 i_langinfo='$i_langinfo'
21848 i_libutil='$i_libutil'
21849 i_limits='$i_limits'
21850 i_locale='$i_locale'
21851 i_machcthr='$i_machcthr'
21852 i_malloc='$i_malloc'
21854 i_memory='$i_memory'
21855 i_mntent='$i_mntent'
21858 i_neterrno='$i_neterrno'
21859 i_netinettcp='$i_netinettcp'
21863 i_pthread='$i_pthread'
21865 i_rpcsvcdbm='$i_rpcsvcdbm'
21868 i_shadow='$i_shadow'
21870 i_stdarg='$i_stdarg'
21871 i_stddef='$i_stddef'
21872 i_stdlib='$i_stdlib'
21873 i_string='$i_string'
21874 i_sunmath='$i_sunmath'
21875 i_sysaccess='$i_sysaccess'
21876 i_sysdir='$i_sysdir'
21877 i_sysfile='$i_sysfile'
21878 i_sysfilio='$i_sysfilio'
21880 i_sysioctl='$i_sysioctl'
21881 i_syslog='$i_syslog'
21882 i_sysmman='$i_sysmman'
21883 i_sysmode='$i_sysmode'
21884 i_sysmount='$i_sysmount'
21885 i_sysndir='$i_sysndir'
21886 i_sysparam='$i_sysparam'
21887 i_sysresrc='$i_sysresrc'
21888 i_syssecrt='$i_syssecrt'
21889 i_sysselct='$i_sysselct'
21890 i_syssockio='$i_syssockio'
21891 i_sysstat='$i_sysstat'
21892 i_sysstatfs='$i_sysstatfs'
21893 i_sysstatvfs='$i_sysstatvfs'
21894 i_systime='$i_systime'
21895 i_systimek='$i_systimek'
21896 i_systimes='$i_systimes'
21897 i_systypes='$i_systypes'
21898 i_sysuio='$i_sysuio'
21900 i_sysutsname='$i_sysutsname'
21901 i_sysvfs='$i_sysvfs'
21902 i_syswait='$i_syswait'
21903 i_termio='$i_termio'
21904 i_termios='$i_termios'
21906 i_unistd='$i_unistd'
21909 i_values='$i_values'
21910 i_varargs='$i_varargs'
21911 i_varhdr='$i_varhdr'
21913 ignore_versioned_solibs='$ignore_versioned_solibs'
21914 inc_version_list='$inc_version_list'
21915 inc_version_list_init='$inc_version_list_init'
21918 initialinstalllocation='$initialinstalllocation'
21919 installarchlib='$installarchlib'
21920 installbin='$installbin'
21921 installhtml1dir='$installhtml1dir'
21922 installhtml3dir='$installhtml3dir'
21923 installman1dir='$installman1dir'
21924 installman3dir='$installman3dir'
21925 installprefix='$installprefix'
21926 installprefixexp='$installprefixexp'
21927 installprivlib='$installprivlib'
21928 installscript='$installscript'
21929 installsitearch='$installsitearch'
21930 installsitebin='$installsitebin'
21931 installsitehtml1dir='$installsitehtml1dir'
21932 installsitehtml3dir='$installsitehtml3dir'
21933 installsitelib='$installsitelib'
21934 installsiteman1dir='$installsiteman1dir'
21935 installsiteman3dir='$installsiteman3dir'
21936 installsitescript='$installsitescript'
21937 installstyle='$installstyle'
21938 installusrbinperl='$installusrbinperl'
21939 installvendorarch='$installvendorarch'
21940 installvendorbin='$installvendorbin'
21941 installvendorhtml1dir='$installvendorhtml1dir'
21942 installvendorhtml3dir='$installvendorhtml3dir'
21943 installvendorlib='$installvendorlib'
21944 installvendorman1dir='$installvendorman1dir'
21945 installvendorman3dir='$installvendorman3dir'
21946 installvendorscript='$installvendorscript'
21948 issymlink='$issymlink'
21949 ivdformat='$ivdformat'
21952 known_extensions='$known_extensions'
21955 lddlflags='$lddlflags'
21957 ldflags_uselargefiles='$ldflags_uselargefiles'
21958 ldlibpthname='$ldlibpthname'
21965 libsdirs='$libsdirs'
21966 libsfiles='$libsfiles'
21967 libsfound='$libsfound'
21968 libspath='$libspath'
21969 libswanted='$libswanted'
21970 libswanted_uselargefiles='$libswanted_uselargefiles'
21976 localtime_r_proto='$localtime_r_proto'
21977 locincpth='$locincpth'
21978 loclibpth='$loclibpth'
21979 longdblsize='$longdblsize'
21980 longlongsize='$longlongsize'
21981 longsize='$longsize'
21985 lseeksize='$lseeksize'
21986 lseektype='$lseektype'
21989 madlyobj='$madlyobj'
21990 madlysrc='$madlysrc'
21994 make_set_make='$make_set_make'
21995 mallocobj='$mallocobj'
21996 mallocsrc='$mallocsrc'
21997 malloctype='$malloctype'
21999 man1direxp='$man1direxp'
22002 man3direxp='$man3direxp'
22004 mips_type='$mips_type'
22005 mistrustnm='$mistrustnm'
22007 mmaptype='$mmaptype'
22008 modetype='$modetype'
22010 multiarch='$multiarch'
22012 myarchname='$myarchname'
22013 mydomain='$mydomain'
22014 myhostname='$myhostname'
22017 need_va_copy='$need_va_copy'
22018 netdb_hlen_type='$netdb_hlen_type'
22019 netdb_host_type='$netdb_host_type'
22020 netdb_name_type='$netdb_name_type'
22021 netdb_net_type='$netdb_net_type'
22024 nm_so_opt='$nm_so_opt'
22025 nonxs_ext='$nonxs_ext'
22027 nvEUformat='$nvEUformat'
22028 nvFUformat='$nvFUformat'
22029 nvGUformat='$nvGUformat'
22030 nv_preserves_uv_bits='$nv_preserves_uv_bits'
22031 nveformat='$nveformat'
22032 nvfformat='$nvfformat'
22033 nvgformat='$nvgformat'
22036 o_nonblock='$o_nonblock'
22038 old_pthread_create_joinable='$old_pthread_create_joinable'
22039 optimize='$optimize'
22040 orderlib='$orderlib'
22043 otherlibdirs='$otherlibdirs'
22047 patchlevel='$patchlevel'
22048 path_sep='$path_sep'
22051 perl_patchlevel='$perl_patchlevel'
22052 perladmin='$perladmin'
22053 perllibs='$perllibs'
22054 perlpath='$perlpath'
22056 phostname='$phostname'
22062 prefixexp='$prefixexp'
22064 privlibexp='$privlibexp'
22065 procselfexe='$procselfexe'
22066 prototype='$prototype'
22068 quadkind='$quadkind'
22069 quadtype='$quadtype'
22070 randbits='$randbits'
22071 randfunc='$randfunc'
22072 random_r_proto='$random_r_proto'
22073 randseedtype='$randseedtype'
22075 rd_nodata='$rd_nodata'
22076 readdir64_r_proto='$readdir64_r_proto'
22077 readdir_r_proto='$readdir_r_proto'
22078 revision='$revision'
22083 sPRIEUldbl='$sPRIEUldbl'
22084 sPRIFUldbl='$sPRIFUldbl'
22085 sPRIGUldbl='$sPRIGUldbl'
22086 sPRIXU64='$sPRIXU64'
22088 sPRIeldbl='$sPRIeldbl'
22089 sPRIfldbl='$sPRIfldbl'
22090 sPRIgldbl='$sPRIgldbl'
22095 sSCNfldbl='$sSCNfldbl'
22096 sched_yield='$sched_yield'
22097 scriptdir='$scriptdir'
22098 scriptdirexp='$scriptdirexp'
22100 seedfunc='$seedfunc'
22101 selectminbits='$selectminbits'
22102 selecttype='$selecttype'
22103 sendmail='$sendmail'
22104 setgrent_r_proto='$setgrent_r_proto'
22105 sethostent_r_proto='$sethostent_r_proto'
22106 setlocale_r_proto='$setlocale_r_proto'
22107 setnetent_r_proto='$setnetent_r_proto'
22108 setprotoent_r_proto='$setprotoent_r_proto'
22109 setpwent_r_proto='$setpwent_r_proto'
22110 setservent_r_proto='$setservent_r_proto'
22113 sharpbang='$sharpbang'
22114 shmattype='$shmattype'
22115 shortsize='$shortsize'
22118 sig_count='$sig_count'
22119 sig_name='$sig_name'
22120 sig_name_init='$sig_name_init'
22122 sig_num_init='$sig_num_init'
22123 sig_size='$sig_size'
22124 signal_t='$signal_t'
22125 sitearch='$sitearch'
22126 sitearchexp='$sitearchexp'
22128 sitebinexp='$sitebinexp'
22129 sitehtml1dir='$sitehtml1dir'
22130 sitehtml1direxp='$sitehtml1direxp'
22131 sitehtml3dir='$sitehtml3dir'
22132 sitehtml3direxp='$sitehtml3direxp'
22134 sitelib_stem='$sitelib_stem'
22135 sitelibexp='$sitelibexp'
22136 siteman1dir='$siteman1dir'
22137 siteman1direxp='$siteman1direxp'
22138 siteman3dir='$siteman3dir'
22139 siteman3direxp='$siteman3direxp'
22140 siteprefix='$siteprefix'
22141 siteprefixexp='$siteprefixexp'
22142 sitescript='$sitescript'
22143 sitescriptexp='$sitescriptexp'
22144 sizesize='$sizesize'
22145 sizetype='$sizetype'
22149 sockethdr='$sockethdr'
22150 socketlib='$socketlib'
22151 socksizetype='$socksizetype'
22153 spackage='$spackage'
22154 spitshell='$spitshell'
22155 srand48_r_proto='$srand48_r_proto'
22156 srandom_r_proto='$srandom_r_proto'
22158 ssizetype='$ssizetype'
22159 startperl='$startperl'
22161 static_ext='$static_ext'
22163 stdio_base='$stdio_base'
22164 stdio_bufsiz='$stdio_bufsiz'
22165 stdio_cnt='$stdio_cnt'
22166 stdio_filbuf='$stdio_filbuf'
22167 stdio_ptr='$stdio_ptr'
22168 stdio_stream_array='$stdio_stream_array'
22169 strerror_r_proto='$strerror_r_proto'
22172 subversion='$subversion'
22176 targetarch='$targetarch'
22180 timeincl='$timeincl'
22181 timetype='$timetype'
22182 tmpnam_r_proto='$tmpnam_r_proto'
22188 ttyname_r_proto='$ttyname_r_proto'
22197 uidformat='$uidformat'
22203 uquadtype='$uquadtype'
22204 use5005threads='$use5005threads'
22205 use64bitall='$use64bitall'
22206 use64bitint='$use64bitint'
22207 usecrosscompile='$usecrosscompile'
22209 usefaststdio='$usefaststdio'
22210 useithreads='$useithreads'
22211 uselargefiles='$uselargefiles'
22212 uselongdouble='$uselongdouble'
22213 usemallocwrap='$usemallocwrap'
22214 usemorebits='$usemorebits'
22215 usemultiplicity='$usemultiplicity'
22216 usemymalloc='$usemymalloc'
22218 useopcode='$useopcode'
22219 useperlio='$useperlio'
22220 useposix='$useposix'
22221 usereentrant='$usereentrant'
22222 userelocatableinc='$userelocatableinc'
22224 useshrplib='$useshrplib'
22225 usesitecustomize='$usesitecustomize'
22226 usesocks='$usesocks'
22227 usethreads='$usethreads'
22228 usevendorprefix='$usevendorprefix'
22229 usevfork='$usevfork'
22232 uvXUformat='$uvXUformat'
22233 uvoformat='$uvoformat'
22236 uvuformat='$uvuformat'
22237 uvxformat='$uvxformat'
22238 vendorarch='$vendorarch'
22239 vendorarchexp='$vendorarchexp'
22240 vendorbin='$vendorbin'
22241 vendorbinexp='$vendorbinexp'
22242 vendorhtml1dir='$vendorhtml1dir'
22243 vendorhtml1direxp='$vendorhtml1direxp'
22244 vendorhtml3dir='$vendorhtml3dir'
22245 vendorhtml3direxp='$vendorhtml3direxp'
22246 vendorlib='$vendorlib'
22247 vendorlib_stem='$vendorlib_stem'
22248 vendorlibexp='$vendorlibexp'
22249 vendorman1dir='$vendorman1dir'
22250 vendorman1direxp='$vendorman1direxp'
22251 vendorman3dir='$vendorman3dir'
22252 vendorman3direxp='$vendorman3direxp'
22253 vendorprefix='$vendorprefix'
22254 vendorprefixexp='$vendorprefixexp'
22255 vendorscript='$vendorscript'
22256 vendorscriptexp='$vendorscriptexp'
22258 version_patchlevel_string='$version_patchlevel_string'
22259 versiononly='$versiononly'
22261 voidflags='$voidflags'
22264 yaccflags='$yaccflags'
22269 : Add in command line options if available
22270 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
22272 : add special variables
22273 $test -f $src/patchlevel.h && \
22274 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
22275 echo "PERL_PATCHLEVEL=$perl_patchlevel" >>config.sh
22276 echo "PERL_CONFIG_SH=true" >>config.sh
22278 : propagate old symbols
22279 if $test -f UU/config.sh; then
22280 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
22281 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
22282 $sort | $uniq -u >UU/oldsyms
22283 set X `cat UU/oldsyms`
22289 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
22291 echo "# Variables propagated from previous config.sh file." >>config.sh
22292 for sym in `cat UU/oldsyms`; do
22293 echo " Propagating $hint variable "'$'"$sym..."
22294 eval 'tmp="$'"${sym}"'"'
22296 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
22302 : Finish up by extracting the .SH files
22306 echo "Extraction done."
22316 If you'd like to make any changes to the config.sh file before I begin
22317 to configure things, do it as a shell escape now (e.g. !vi config.sh).
22320 rp="Press return or use a shell escape to edit config.sh:"
22325 *) : in case they cannot read
22326 sh 1>&4 -c "$ans";;
22331 : if this fails, just run all the .SH files by hand
22340 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
22347 Now you need to generate make dependencies by running "$make depend".
22348 You might prefer to run it in background: "$make depend > makedepend.out &"
22349 It can take a while, so you might not want to run it right now.
22354 rp="Run $make depend now?"
22358 $make depend && echo "Now you must run '$make'."
22361 echo "You must run '$make depend' then '$make'."
22364 elif test -f [Mm]akefile; then
22366 echo "Now you must run a $make."
22368 echo "Configure done."
22371 if $test -f Policy.sh; then
22374 If you compile $package on a different machine or from a different object
22375 directory, copy the Policy.sh file from this object directory to the
22376 new one before you run Configure -- this will help you with most of
22377 the policy defaults.
22381 if $test -f config.msg; then
22382 echo "Hmm. I also noted the following information while running:"
22384 $cat config.msg >&4
22387 $rm -f kit*isdone ark*isdone