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 Sat Feb 10 17:48:04 CET 2007 [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 if test ! -c /dev/null ; then
71 *** I'm sorry, but /dev/null appears to be a file rather than a device.
72 *** Please consult your operating sytem's notes for making a device
74 *** Cannot continue, aborting.
80 : compute my invocation name
84 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
89 : Proper separator for the PATH environment variable
91 : On OS/2 this directory should exist if this is not floppy only system :-]
92 if test -d c:/. || ( uname -a | grep -i 'os\(/\|\)2' ) 2>&1 >/dev/null ; then
93 if test -n "$OS2_SHELL"; then
95 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
96 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
98 elif test -n "$DJGPP"; then
99 case "X${MACHTYPE:-nonesuchmach}" in
106 : Proper PATH setting
107 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
108 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
109 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
110 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
111 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
112 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /opt/ansic/bin /usr/ccs/bin"
113 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
114 paths="$paths /sbin /usr/sbin /usr/libexec"
115 paths="$paths /system/gnu_library/bin"
119 case "$p_$PATH$p_" in
121 *) test -d $p && PATH=$PATH$p_$p ;;
128 : shall we be using ksh?
134 if (PATH=.; alias -x) >/dev/null 2>&1; then
137 if test -f /hp-ux -a -f /bin/ksh; then
138 needksh='to avoid sh bug in "here document" expansion'
140 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
141 if test X`/usr/bin/uname -v` = X4; then
142 avoidksh="to avoid AIX 4's /bin/sh"
146 if test -f /osf_boot -a -f /usr/sbin/setld; then
147 if test X`/usr/bin/uname -s` = XOSF1; then
148 avoidksh="to avoid Digital UNIX' ksh"
150 unset BIN_SH # if this is 'xpg4' sh will start up ksh
153 case "$inksh/$needksh" in
160 case "$inksh/$avoidksh" in
166 case "$inksh/$needksh-$avoidksh-" in
169 (I see you are using the Korn shell. Some ksh's blow up on $me,
170 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
177 echo "(Feeding myself to $newsh $reason.)"
179 Configure|*/Configure) exec $newsh $0 "$@";;
180 *) exec $newsh Configure "$@";;
185 : if needed set CDPATH to a harmless value that is not chatty
186 : avoid bash 2.02 problems with empty CDPATH.
190 *bash*) CDPATH='.' ;;
195 : Configure runs within the UU subdirectory
196 test -d UU || mkdir UU
334 initialinstalllocation=''
362 d_attribute_format=''
363 d_attribute_malloc=''
364 d_attribute_nonnull=''
365 d_attribute_noreturn=''
367 d_attribute_unused=''
368 d_attribute_warn_unused_result=''
369 d_printf_format_null=''
372 d_builtin_choose_expr=''
375 d_c99_variadic_macros=''
422 endhostent_r_proto=''
428 endprotoent_r_proto=''
434 endservent_r_proto=''
486 gethostbyaddr_r_proto=''
488 gethostbyname_r_proto=''
490 gethostent_r_proto=''
502 getnetbyaddr_r_proto=''
504 getnetbyname_r_proto=''
518 d_getprotobyname_r=''
519 getprotobyname_r_proto=''
520 d_getprotobynumber_r=''
521 getprotobynumber_r_proto=''
523 getprotoent_r_proto=''
535 getservbyname_r_proto=''
537 getservbyport_r_proto=''
539 getservent_r_proto=''
563 d_libm_lib_version=''
566 d_localtime_r_needs_tzset=''
577 d_malloc_good_size=''
619 d_old_pthread_create_joinable=''
620 old_pthread_create_joinable=''
622 d_pthread_attr_setscope=''
661 sethostent_r_proto=''
678 setprotoent_r_proto=''
690 setservent_r_proto=''
724 d_sprintf_returns_strlen=''
739 d_stdio_ptr_lval_nochange_cnt=''
740 d_stdio_ptr_lval_sets_cnt=''
944 d_inc_version_list=''
946 inc_version_list_init=''
965 ignore_versioned_solibs=''
1029 d_perl_otherlibdirs=''
1037 api_versionstring=''
1043 version_patchlevel_string=''
1047 d_nv_preserves_uv=''
1048 d_nv_zero_is_allbits_zero=''
1059 nv_preserves_uv_bits=''
1131 installsitehtml1dir=''
1134 installsitehtml3dir=''
1141 installsiteman1dir=''
1144 installsiteman3dir=''
1149 installsitescript=''
1164 d_stdio_stream_array=''
1165 stdio_stream_array=''
1176 ccflags_uselargefiles=''
1177 ldflags_uselargefiles=''
1178 libswanted_uselargefiles=''
1198 installvendorarch=''
1205 installvendorhtml1dir=''
1207 vendorhtml1direxp=''
1208 installvendorhtml3dir=''
1210 vendorhtml3direxp=''
1216 installvendorman1dir=''
1219 installvendorman3dir=''
1226 installvendorscript=''
1238 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1241 : We must find out about Eunice early
1243 if test -f /etc/unixtovms; then
1244 eunicefix=/etc/unixtovms
1246 if test -f /etc/unixtovms.exe; then
1247 eunicefix=/etc/unixtovms.exe
1250 : Set executable suffix now -- needed before hints available
1251 if test -f "/libs/version.library"; then
1254 elif test -f "/system/gnu_library/bin/ar.pm"; then
1257 elif test -n "$DJGPP"; then
1260 elif test -d c:/. -o -n "$is_os2" ; then
1266 : Trailing extension. Override this in a hint file, if needed.
1267 : Extra object files, if any, needed on this platform.
1272 : change the next line if compiling for Xenix/286 on Xenix/386
1273 xlibpth='/usr/lib/386 /lib/386'
1274 : Possible local library directories to search.
1275 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1276 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1278 : general looking path for locating libraries
1279 glibpth="/lib /usr/lib $xlibpth"
1280 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1281 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1282 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1283 test -d /usr/lib64 && glibpth="$glibpth /lib64 /usr/lib64 /usr/local/lib64"
1285 : Private path used by Configure to find libraries. Its value
1286 : is prepended to libpth. This variable takes care of special
1287 : machines, like the mips. Usually, it should be empty.
1290 : default library list
1292 : some systems want to use only the non-versioned libso:s
1293 ignore_versioned_solibs=''
1297 : set usethreads on the Configure command line to enable threads.
1298 usereentrant='undef'
1299 : full support for void wanted by default
1302 : Possible local include directories to search.
1303 : Set locincpth to "" in a hint file to defeat local include searches.
1304 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1305 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1307 : no include file wanted by default
1310 : Enable -DEBUGGING and -DDEBUGGING from the command line
1317 : set useposix=false in your hint file to disable the POSIX extension.
1319 : set useopcode=false in your hint file to disable the Opcode extension.
1322 ccflags_uselargefiles=''
1323 ldflags_uselargefiles=''
1324 libswanted_uselargefiles=''
1325 : set usemultiplicity on the Configure command line to enable multiplicity.
1326 : set usesocks on the Configure command line to enable socks.
1327 : List of libraries we want.
1328 : If anyone needs extra -lxxx, put those in a hint file.
1329 libswanted="sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun"
1330 libswanted="$libswanted m crypt sec util c cposix posix ucb bsd BSD"
1331 : We probably want to search /usr/shlib before most other libraries.
1332 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1333 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1334 glibpth="/usr/shlib $glibpth"
1335 : Do not use vfork unless overridden by a hint file.
1338 : Find the basic shell for Bourne shell scripts
1342 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1345 if test -f "$xxx"; then
1348 : Build up a list and do a single loop so we can 'break' out.
1349 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1350 for xxx in sh bash ksh pdksh ash; do
1352 try="$try ${p}/${xxx}"
1356 if test -f "$xxx"; then
1359 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1362 elif test -f "$xxx.exe"; then
1373 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1375 Usually it's in /bin/sh. How did you even get this far?
1376 Please contact me (Perl Maintainers) at perlbug@perl.org and
1377 we'll try to straighten this all out.
1383 : see if sh knows # comments
1384 if `$sh -c '#' >/dev/null 2>&1`; then
1388 test -f $xcat$_exe || xcat=/usr/bin/cat
1389 if test ! -f $xcat$_exe; then
1390 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1391 if test -f $p/cat$_exe; then
1396 if test ! -f $xcat$_exe; then
1397 echo "Can't find cat anywhere!"
1401 echo "#!$xcat" >sharp
1405 if test -s today; then
1408 echo "#! $xcat" > sharp
1412 if test -s today; then
1420 echo "Your $sh doesn't grok # comments--I will strip them later on."
1423 echo "exec grep -v '^[ ]*#'" >spitshell
1425 $eunicefix spitshell
1426 spitshell=`pwd`/spitshell
1428 echo "I presume that if # doesn't work, #! won't work either!"
1433 : figure out how to guarantee sh startup
1435 '') startsh=${sharpbang}${sh} ;;
1447 : echo "Yup, it does."
1449 echo "Hmm... '$startsh' does not guarantee sh startup..."
1450 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1455 : Save command line options in file UU/cmdline.opt for later use in
1456 : generating config.sh.
1457 cat > cmdline.opt <<EOSH
1458 # Configure command line arguments.
1467 cat >>cmdline.opt <<EOSH
1468 config_arg$argn='$arg'
1470 # Extreme backslashitis: replace each ' by '"'"'
1471 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1474 arg_exp=`cat cmdl.opt`
1475 args_exp="$args_exp$args_sep'$arg_exp'"
1476 argn=`expr $argn + 1`
1479 # args_exp is good for restarting self: eval "set X $args_exp"; shift; $0 "$@"
1480 # used by ./hints/os2.sh
1483 : produce awk script to parse command line options
1484 cat >options.awk <<'EOF'
1486 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1488 len = length(optstr);
1489 for (i = 1; i <= len; i++) {
1490 c = substr(optstr, i, 1);
1491 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1502 if (substr(str, 1, 1) != "-") {
1503 printf("'%s'\n", str);
1507 for (i = 2; i <= len; i++) {
1508 c = substr(str, i, 1);
1510 printf("-%s\n", substr(str, i));
1516 printf("'%s'\n", substr(str, i + 1));
1529 : process the command line options
1530 set X `for arg in "$@"; do echo "X$arg"; done |
1531 sed -e s/X// | awk -f options.awk`
1536 : set up default values
1546 rm -f optdef.sh posthint.sh
1547 cat >optdef.sh <<EOS
1553 while test $# -gt 0; do
1555 -d) shift; fastread=yes;;
1556 -e) shift; alldone=cont;;
1560 if test -r "$1"; then
1563 echo "$me: cannot read config file $1." >&2
1568 -h) shift; error=true;;
1569 -r) shift; reuseval=true;;
1570 -s) shift; silent=true; realsilent=true;;
1571 -E) shift; alldone=exit;;
1572 -K) shift; knowitall=true;;
1573 -O) shift; override=true;;
1574 -S) shift; silent=true; extractsh=true;;
1579 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1580 echo "$me: ignoring -D $1" >&2
1583 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1584 *) echo "$1='define'" >> optdef.sh;;
1591 *=) echo "$1" >> optdef.sh;;
1593 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1594 echo "$me: ignoring -U $1" >&2
1596 *) echo "$1='undef'" >> optdef.sh;;
1607 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1611 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1612 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1618 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1619 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1620 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1621 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1622 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1623 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1629 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1631 echo "$yyy=''" >> posthint.sh ;;
1636 echo "$yyy='$zzz'" >> posthint.sh ;;
1638 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1640 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1645 echo "$yyy=$zzz" >> posthint.sh ;;
1646 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1650 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1653 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1661 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1662 [-U symbol] [-U symbol=] [-A command:symbol...]
1663 -d : use defaults for all answers.
1664 -e : go on without questioning past the production of config.sh.
1665 -f : specify an alternate default configuration file.
1666 -h : print this help message and exit (with an error status).
1667 -r : reuse C symbols value if possible (skips costly nm extraction).
1668 -s : silent mode, only echoes questions and essential information.
1669 -D : define symbol to have some value:
1670 -D symbol symbol gets the value 'define'
1671 -D symbol=value symbol gets the value 'value'
1672 -E : stop at the end of questions, after having produced config.sh.
1673 -K : do not use unless you know what you are doing.
1674 -O : let -D and -U override definitions from loaded configuration file.
1675 -S : perform variable substitutions on all .SH files (can mix with -f)
1676 -U : undefine symbol:
1677 -U symbol symbol gets the value 'undef'
1678 -U symbol= symbol gets completely empty
1679 -A : manipulate symbol after the platform specific hints have been applied:
1680 -A symbol=value append " "value to symbol
1681 -A append:symbol=value append value to symbol
1682 -A define:symbol=value define symbol to have value
1683 -A clear:symbol define symbol to be ''
1684 -A define:symbol define symbol to be 'define'
1685 -A eval:symbol=value define symbol to be eval of value
1686 -A prepend:symbol=value prepend value to symbol
1687 -A undef:symbol define symbol to be 'undef'
1688 -A undef:symbol= define symbol to be ''
1689 -V : print version number and exit (with a zero status).
1696 case "$fastread$alldone" in
1699 case "$extractsh" in
1702 if test ! -t 0; then
1703 echo "Say 'sh Configure', not 'sh <Configure'"
1713 true) exec 1>/dev/null;;
1716 : run the defines and the undefines, if any, but leave the file out there...
1719 : create the posthint manipulation script and leave the file out there...
1724 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1725 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1726 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1727 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1728 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1731 : Some greps do not return status, grrr.
1732 echo "grimblepritz" >grimble
1733 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1735 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1741 : the following should work in any shell
1745 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1746 cat >contains <<'EOSS'
1747 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1752 : Find the path to the source tree
1755 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1759 *) src=`cd ../$src && pwd` ;;
1772 if test -f $rsrc/Configure && \
1773 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1775 : found it, so we are ok.
1778 for src in . .. ../.. ../../.. ../../../..; do
1779 if test -f ../$src/Configure && \
1780 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1791 Sorry, I can't seem to locate the source dir for $package. Please start
1792 Configure with an explicit path -- i.e. /some/path/Configure.
1800 echo "Sources for $package found in \"$src\"." >&4
1804 : script used to extract .SH files with variable substitutions
1805 cat >extract <<'EOS'
1807 echo "Doing variable substitutions on .SH files..."
1808 if test -f MANIFEST; then
1809 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1811 echo "(Looking for .SH files under the source directory.)"
1812 set x `(cd "$src"; find . -name "*.SH" -print)`
1816 0) set x `(cd "$src"; echo *.SH)`; shift;;
1818 if test ! -f "$src/$1"; then
1824 while test $name; do
1825 if test ! -d "$name"; then
1826 create="$name $create";
1827 name=`echo $name | sed -e "s|^[^/]*$||"`;
1828 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1833 for file in $create; do
1842 dir=`expr X$file : 'X\(.*\)/'`
1843 file=`expr X$file : 'X.*/\(.*\)'`
1844 (cd "$dir" && . ./$file)
1854 dir=`expr X$file : 'X\(.*\)/'`
1855 file=`expr X$file : 'X.*/\(.*\)'`
1856 (set x $dir; shift; eval $mkdir_p)
1857 sh <"$src/$dir/$file"
1866 if test -f "$src/config_h.SH"; then
1867 if test ! -f config.h; then
1868 : oops, they left it out of MANIFEST, probably, so do it anyway.
1869 . "$src/config_h.SH"
1874 : extract files and exit if asked to do so
1875 case "$extractsh" in
1877 case "$realsilent" in
1881 case "$config_sh" in
1882 '') config_sh='config.sh';;
1885 echo "Fetching answers from $config_sh..."
1888 test "$override" && . ./optdef.sh
1892 echo "Extraction done."
1897 : Eunice requires " " instead of "", can you believe it
1900 echo "Beginning of configuration questions for $package."
1902 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1904 : first determine how to suppress newline on echo command
1906 echo "Checking echo to see how to suppress newlines..."
1907 (echo "hi there\c" ; echo " ") >.echotmp
1908 if $contains c .echotmp >/dev/null 2>&1 ; then
1919 echo $n "The star should be here-->$c"
1923 : Now test for existence of everything in MANIFEST
1925 if test -f "$rsrc/MANIFEST"; then
1926 echo "First let's make sure your kit is complete. Checking..." >&4
1927 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | (split -l 50 2>/dev/null || split -50)
1930 for filelist in x??; do
1931 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` >/dev/null 2>>"$tmppwd/missing")
1933 if test -s missing; then
1937 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1939 You have the option of continuing the configuration process, despite the
1940 distinct possibility that your kit is damaged, by typing 'y'es. If you
1941 do, don't blame me if something goes wrong. I advise you to type 'n'o
1942 and contact the author (perlbug@perl.org).
1945 echo $n "Continue? [n] $c" >&4
1949 echo "Continuing..." >&4
1953 echo "ABORTING..." >&4
1958 echo "Looks good..."
1961 echo "There is no MANIFEST file. I hope your kit is complete !"
1966 : Find the appropriate value for a newline for tr
1967 if test -n "$DJGPP"; then
1970 if test X"$trnl" = X; then
1971 case "`echo foo|tr '\n' x 2>/dev/null`" in
1975 if test X"$trnl" = X; then
1976 case "`echo foo|tr '\012' x 2>/dev/null`" in
1977 foox) trnl='\012' ;;
1980 if test X"$trnl" = X; then
1981 case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
1982 fooxy) trnl='\n\r' ;;
1985 if test X"$trnl" = X; then
1988 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1994 : compute the number of columns on the terminal for proper question formatting
1999 : set up the echo used in my read
2000 myecho="case \"\$xxxm\" in
2001 '') echo $n \"\$rp $c\" >&4;;
2003 '') echo $n \"[\$xxxm] $c\";;
2005 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
2007 echo $n \"[\$xxxm] $c\" >&4
2009 echo $n \"\$rp [\$xxxm] $c\" >&4
2015 : now set up to do reads with possible shell escape and default assignment
2021 case "\$fastread" in
2022 yes) case "\$dflt" in
2025 case "\$silent-\$rp" in
2030 *) case "\$silent" in
2031 true) case "\$rp" in
2036 while expr "X\$ans" : "X!" >/dev/null; do
2040 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2048 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2057 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2062 echo "(OK, I'll run with -d after this question.)" >&4
2065 echo "*** Sorry, \$1 not supported yet." >&4
2075 echo "*** Substitution done -- please confirm."
2077 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2082 echo "*** Error -- try again."
2089 case "\$ans\$xxxm\$nostick" in
2101 : create .config dir to save info across Configure sessions
2102 test -d ../.config || mkdir ../.config
2103 cat >../.config/README <<EOF
2104 This directory created by Configure to save information that should
2105 persist across sessions for $package.
2107 You may safely delete it if you wish.
2110 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2112 $define|true|[yY]*) ;;
2113 *) case "$xversion" in
2116 *** WHOA THERE!!! ***
2118 This is an UNSTABLE DEVELOPMENT release.
2119 The version of this $package distribution is $xversion, that is, odd,
2120 (as opposed to even) and that signifies a development release.
2121 If you want a maintenance release, you want an even-numbered version.
2123 Do ***NOT*** install this into production use.
2124 Data corruption and crashes are possible.
2126 It is most seriously suggested that you do not continue any further
2127 unless you want to help in developing and debugging Perl.
2129 If you *still* want to build perl, you can answer 'y' now,
2130 or pass -Dusedevel to Configure.
2133 rp='Do you really want to continue?'
2137 [yY]) echo >&4 "Okay, continuing."
2138 usedevel="$define" ;;
2139 *) echo >&4 "Okay, bye."
2149 case "$versiononly" in
2150 '') versiononly="$define" ;;
2152 case "$installusrbinperl" in
2153 '') installusrbinperl="$undef" ;;
2158 : general instructions
2161 user=`(logname) 2>/dev/null`
2163 '') user=`whoami 2>&1`;;
2165 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2168 rp='Would you like to see the instructions?'
2179 This installation shell script will examine your system and ask you questions
2180 to determine how the perl5 package should be installed. If you get
2181 stuck on a question, you may use a ! shell escape to start a subshell or
2182 execute a command. Many of the questions will have default answers in square
2183 brackets; typing carriage return will give you the default.
2185 On some of the questions which ask for file or directory names you are allowed
2186 to use the ~name construct to specify the login directory belonging to "name",
2187 even if you don't have a shell which knows about that. Questions where this is
2188 allowed will be marked "(~name ok)".
2192 dflt='Type carriage return to continue'
2196 The prompter used in this script allows you to use shell variables and
2197 backticks in your answers. You may use $1, $2, etc... to refer to the words
2198 in the default answer, as if the default line was a set of arguments given to a
2199 script shell. This means you may also use $* to repeat the whole default line,
2200 so you do not have to re-type everything to add something to the default.
2202 Everytime there is a substitution, you will have to confirm. If there is an
2203 error (e.g. an unmatched backtick), the default answer will remain unchanged
2204 and you will be prompted again.
2206 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2207 the questions and use the computed defaults (or the previous answers if there
2208 was already a config.sh file). Type 'Configure -h' for a list of options.
2209 You may also start interactively and then answer '& -d' at any prompt to turn
2210 on the non-interactive behaviour for the remainder of the execution.
2216 Much effort has been expended to ensure that this shell script will run on any
2217 Unix system. If despite that it blows up on yours, your best bet is to edit
2218 Configure and run it again. If you can't run Configure for some reason,
2219 you'll have to generate a config.sh file by hand. Whatever problems you
2220 have, let me (perlbug@perl.org) know how I blew it.
2222 This installation script affects things in two ways:
2224 1) it may do direct variable substitutions on some of the files included
2226 2) it builds a config.h file for inclusion in C programs. You may edit
2227 any of these files as the need arises after running this script.
2229 If you make a mistake on a question, there is no easy way to back up to it
2230 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2231 files. Configure will offer to let you do this before it runs the SH files.
2234 dflt='Type carriage return to continue'
2236 case "$firsttime" in
2237 true) echo $user >>../.config/instruct;;
2241 : find out where common programs are
2243 echo "Locating common programs..." >&4
2256 if test -d \$dir/\$thing; then
2262 for thisthing in \$dir/\$thing; do
2263 : just loop through to pick last item
2265 if test -f \$thisthing; then
2268 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2271 elif test -f \$dir/\$thing.exe; then
2272 if test -n "$DJGPP"; then
2273 echo \$dir/\$thing.exe
2274 elif test "$eunicefix" != ":"; then
2275 : on Eunice apparently
2329 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2330 pth="$pth /lib /usr/lib"
2331 for file in $loclist; do
2335 if test -f "$xxx"; then
2338 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2339 xxx=`./loc $file $file $pth`
2342 '') xxx=`./loc $file $file $pth`;;
2343 *) xxx=`./loc $xxx $xxx $pth`;;
2345 eval $file=$xxx$_exe
2349 echo $file is in $xxx.
2352 echo $file is in $xxx.
2355 echo "I don't know where '$file' is, and my life depends on it." >&4
2356 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2362 echo "Don't worry if any of the following aren't found..."
2364 for file in $trylist; do
2368 if test -f "$xxx"; then
2371 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2372 xxx=`./loc $file $file $pth`
2375 '') xxx=`./loc $file $file $pth`;;
2376 *) xxx=`./loc $xxx $xxx $pth`;;
2378 eval $file=$xxx$_exe
2382 echo $file is in $xxx.
2385 echo $file is in $xxx.
2388 echo "I don't see $file out there, $say."
2395 echo "Substituting grep for egrep."
2402 echo "Substituting cp for ln."
2411 echo "I can't find make or gmake, and my life depends on it." >&4
2412 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2420 *) # We can't have osname yet.
2421 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2422 # Assume that gmake, if found, is definitely GNU make
2423 # and prefer it over the system make.
2424 echo "Substituting gmake for make."
2432 echo "Hopefully test is built into your sh."
2435 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2436 echo "Using the test built into your sh."
2444 echo "Hopefully echo is built into your sh."
2449 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2450 $echo $n "hi there$c" >foo1
2451 echo $n "hi there$c" >foo2
2452 if cmp foo1 foo2 >/dev/null 2>&1; then
2453 echo "They are compatible. In fact, they may be identical."
2460 They are not compatible! You are probably running ksh on a non-USG system.
2461 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2462 have echo built in and we may have to run some Bourne shell scripts. That
2463 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2466 $echo $n "The star should be here-->$c"
2476 cat <<'EOSC' >>trygcc
2481 int main(int argc, char *argv[]) {
2485 if $cc -o try $ccflags $ldflags try.c; then
2488 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2494 case "`$cc -v -c try.c 2>&1`" in
2497 if $test X"$trygcc" = Xyes; then
2498 if gcc -o try -c try.c; then
2500 echo "You seem to have a working gcc, though." >&4
2501 rp="Would you like to use it?"
2503 if $test -f myread; then
2506 if $test -f UU/myread; then
2509 echo "Cannot find myread, sorry. Aborting." >&2
2514 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2515 if $test -f usethreads.cbu; then
2518 *** However, any setting of the C compiler flags (e.g. for thread support)
2519 *** has been lost. It may be necessary to pass -Dcc=gcc to Configure
2520 *** (together with e.g. -Dusethreads).
2536 cat <<'EOSC' >>checkcc
2541 int main(int argc, char *argv[]) {
2545 if $cc -o try $ccflags $ldflags try.c; then
2548 if $test X"$despair" = Xyes; then
2549 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2552 You need to find a working C compiler.
2553 Either (purchase and) install the C compiler supplied by your OS vendor,
2554 or for a free C compiler try http://gcc.gnu.org/
2555 I cannot continue any further, aborting.
2564 : determine whether symbolic links are supported
2567 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2568 echo "Symbolic links are supported." >&4
2571 echo "Symbolic links are NOT supported." >&4
2576 : determine whether symbolic links are supported
2580 echo "Checking how to test for symbolic links..." >&4
2582 if $test "X$issymlink" = X; then
2584 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2585 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2587 if test $? = 0; then
2590 echo "Your builtin 'test -h' may be broken." >&4
2593 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2596 if test -f "$p/$test"; then
2605 echo "Trying external '$test -h'." >&4
2606 issymlink="$test -h"
2607 if $test ! -h sym >/dev/null 2>&1; then
2608 echo "External '$test -h' is broken, too." >&4
2616 if $test "X$issymlink" = X; then
2617 if $test -L sym 2>/dev/null; then
2618 issymlink="$test -L"
2619 echo "The builtin '$test -L' worked." >&4
2622 if $test "X$issymlink" != X; then
2623 echo "You can test for symbolic links with '$issymlink'." >&4
2625 echo "I do not know how you can test for symbolic links." >&4
2629 *) echo "No symbolic links, so not testing for their testing..." >&4
2635 case "$mksymlinks" in
2638 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2641 *) case "$lns:$issymlink" in
2642 *"ln"*" -s:"*"test -"?)
2643 echo "Creating the symbolic links..." >&4
2644 echo "(First creating the subdirectories...)" >&4
2646 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2648 test -z "$directory" && break
2652 if test ! -d t/base; then
2653 echo "Failed to create the subdirectories. Aborting." >&4
2656 echo "(Then creating the symlinks...)" >&4
2657 awk '{print $1}' $src/MANIFEST | while true; do
2659 test -z "$filename" && break
2660 if test -f $filename; then
2661 if $issymlink $filename; then
2665 if test -f $filename; then
2666 echo "$filename already exists, not symlinking."
2668 ln -s $src/$filename $filename
2672 if test ! -f t/base/lex.t; then
2673 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2678 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2687 case "$usecrosscompile" in
2689 $echo "Cross-compiling..."
2692 *-*-gcc) # A cross-compiling gcc, probably.
2693 targetarch=`$echo $cc|$sed 's/-gcc$//'`
2695 # leave out ld, choosing it is more complex
2697 ranlib=$targetarch-ranlib
2698 $echo 'extern int foo;' > try.c
2699 set X `$cc -v -E try.c 2>&1 | $awk '/^#include </,/^End of search /'|$grep '/include'`
2701 if $test $# -gt 0; then
2703 incpth="`$echo $incpth|$sed 's/^ //'`"
2704 echo "Guessing incpth '$incpth'." >&4
2706 j="`$echo $i|$sed 's,/include$,/lib,'`"
2707 if $test -d $j; then
2711 libpth="`$echo $libpth|$sed 's/^ //'`"
2712 echo "Guessing libpth '$libpth'." >&4
2717 case "$targetarch" in
2718 '') echo "Targetarch not defined." >&4; croak=y ;;
2719 *) echo "Using targetarch $targetarch." >&4 ;;
2722 '') echo "Incpth not defined." >&4; croak=y ;;
2723 *) echo "Using incpth '$incpth'." >&4 ;;
2726 '') echo "Libpth not defined." >&4; croak=y ;;
2727 *) echo "Using libpth '$libpth'." >&4 ;;
2730 '') for i in $incpth; do
2731 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
2733 echo "Guessing usrinc $usrinc." >&4
2738 '') echo "Usrinc not defined." >&4; croak=y ;;
2741 *) echo "Using usrinc $usrinc." >&4 ;;
2743 case "$targethost" in
2744 '') echo "Targethost not defined." >&4; croak=y ;;
2745 *) echo "Using targethost $targethost." >&4
2750 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2753 /*) run=$src/Cross/run
2754 targetmkdir=$src/Cross/mkdir
2756 from=$src/Cross/from
2758 *) pwd=`$test -f ../Configure & cd ..; pwd`
2760 targetmkdir=$pwd/Cross/mkdir
2762 from=$pwd/Cross/from
2765 case "$targetrun" in
2766 '') targetrun=ssh ;;
2771 case "$targetfrom" in
2772 '') targetfrom=scp ;;
2776 from=$from-$targetfrom
2777 case "$targetdir" in
2779 echo "Guessing targetdir $targetdir." >&4
2782 case "$targetuser" in
2784 echo "Guessing targetuser $targetuser." >&4
2787 case "$targetfrom" in
2791 case "$targetrun" in
2803 '') cwd=$targetdir ;;
2807 if $test ! -f \$exe.xok; then
2811 $targetrun -l $targetuser $targethost "cd \$cwd && ./\$exe \$@"
2814 *) echo "Unknown targetrun '$targetrun'" >&4
2818 case "$targetmkdir" in
2820 cat >$targetmkdir <<EOF
2822 $targetrun -l $targetuser $targethost "mkdir -p \$@"
2824 $chmod a+rx $targetmkdir
2826 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
2838 $targetmkdir \`dirname \$f\`
2839 $targetto $q \$f $targetuser@$targethost:\$f || exit 1
2842 $targetmkdir $targetdir/\`dirname \$f\`
2843 $targetto $q \$f $targetuser@$targethost:$targetdir/\$f || exit 1
2856 $mkdir -p $targetdir/\`dirname \$f\`
2857 $cp \$f $targetdir/\$f || exit 1
2860 $targetmkdir $targetdir/\`dirname \$f\`
2861 $cp \$f $targetdir/\$f || exit 1
2868 *) echo "Unknown targetto '$targetto'" >&4
2872 case "$targetfrom" in
2879 $targetfrom $q $targetuser@$targethost:$targetdir/\$f . || exit 1
2884 cp) cat >$from <<EOF
2889 cp $targetdir/\$f . || exit 1
2894 *) echo "Unknown targetfrom '$targetfrom'" >&4
2898 if $test ! -f $run; then
2899 echo "Target 'run' script '$run' not found." >&4
2903 if $test ! -f $to; then
2904 echo "Target 'to' script '$to' not found." >&4
2908 if $test ! -f $from; then
2909 echo "Target 'from' script '$from' not found." >&4
2913 if $test ! -f $run -o ! -f $to -o ! -f $from; then
2917 Using '$run' for remote execution,
2918 and '$from' and '$to'
2919 for remote file transfer.
2925 usecrosscompile='undef'
2930 : see whether [:lower:] and [:upper:] are supported character classes
2932 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2934 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2938 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
2939 # (0xd9 and 0xe2), therefore that is a nice testing point.
2940 if test "X$up" = X -o "X$low" = X; then
2941 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
2947 if test "X$up" = X -o "X$low" = X; then
2948 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
2954 if test "X$up" = X -o "X$low" = X; then
2955 case "`echo RS | od -x 2>/dev/null`" in
2957 echo "Hey, this might be EBCDIC." >&4
2958 if test "X$up" = X -o "X$low" = X; then
2959 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2960 rs) up='[A-IJ-RS-Z]'
2965 if test "X$up" = X -o "X$low" = X; then
2966 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
2976 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
2978 echo "Using $up and $low to convert case." >&4
2981 echo "I don't know how to translate letters from upper to lower case." >&4
2982 echo "Your tr is not acting any way I know of." >&4
2986 : set up the translation script tr, must be called with ./tr of course
2990 '[A-Z][a-z]') exec $tr '$up' '$low';;
2991 '[a-z][A-Z]') exec $tr '$low' '$up';;
2998 : Try to determine whether config.sh was made on this system
2999 case "$config_sh" in
3001 myuname=`$uname -a 2>/dev/null`
3002 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
3003 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
3004 # because the A-Z/a-z are not consecutive.
3005 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
3006 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
3007 newmyuname="$myuname"
3009 case "$knowitall" in
3011 if test -f ../config.sh; then
3012 if $contains myuname= ../config.sh >/dev/null 2>&1; then
3013 eval "`grep myuname= ../config.sh`"
3015 if test "X$myuname" = "X$newmyuname"; then
3023 : Get old answers from old config file if Configure was run on the
3024 : same system, otherwise use the hints.
3027 if test -f config.sh; then
3029 rp="I see a config.sh file. Shall I use it to set the defaults?"
3032 n*|N*) echo "OK, I'll ignore it."
3033 mv config.sh config.sh.old
3034 myuname="$newmyuname"
3036 *) echo "Fetching default answers from your old config.sh file..." >&4
3044 : Older versions did not always set $sh. Catch re-use of such
3054 if test ! -f config.sh; then
3057 First time through, eh? I have some defaults handy for some systems
3058 that need some extra help getting the Configure answers right:
3061 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3063 : Half the following guesses are probably wrong... If you have better
3064 : tests or hints, please send them to perlbug@perl.org
3065 : The metaconfig authors would also appreciate a copy...
3066 $test -f /irix && osname=irix
3067 $test -f /xenix && osname=sco_xenix
3068 $test -f /dynix && osname=dynix
3069 $test -f /dnix && osname=dnix
3070 $test -f /lynx.os && osname=lynxos
3071 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3072 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3073 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3074 $test -f /bin/mips && /bin/mips && osname=mips
3075 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
3076 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
3077 $test -d /usr/apollo/bin && osname=apollo
3078 $test -f /etc/saf/_sactab && osname=svr4
3079 $test -d /usr/include/minix && osname=minix
3080 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3081 if $test -d /MachTen -o -d /MachTen_Folder; then
3083 if $test -x /sbin/version; then
3084 osvers=`/sbin/version | $awk '{print $2}' |
3085 $sed -e 's/[A-Za-z]$//'`
3086 elif $test -x /usr/etc/version; then
3087 osvers=`/usr/etc/version | $awk '{print $2}' |
3088 $sed -e 's/[A-Za-z]$//'`
3094 $test -f /sys/posix.dll &&
3095 $test -f /usr/bin/what &&
3096 set X `/usr/bin/what /sys/posix.dll` &&
3097 $test "$3" = UWIN &&
3101 if $test -f $uname; then
3109 umips) osname=umips ;;
3112 [23]100) osname=mips ;;
3113 next*) osname=next ;;
3115 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3116 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3119 elif $test -f /etc/kconfig; then
3121 if test "$lns" = "$ln -s"; then
3123 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3125 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3132 if test -n "$DJGPP"; then
3141 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3143 # oslevel can fail with:
3144 # oslevel: Unable to acquire lock.
3145 *not\ found) osvers="$4"."$3" ;;
3146 '<3240'|'<>3240') osvers=3.2.0 ;;
3147 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3148 '=3250'|'>3250') osvers=3.2.5 ;;
3152 bsd386) osname=bsd386
3155 cygwin*) osname=cygwin
3158 *dc.osx) osname=dcosx
3164 domainos) osname=apollo
3170 dragonfly) osname=dragonfly
3173 dynixptx*) osname=dynixptx
3174 osvers=`echo "$4"|sed 's/^v//'`
3176 freebsd) osname=freebsd
3178 genix) osname=genix ;;
3182 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3198 netbsd*) osname=netbsd
3201 news-os) osvers="$3"
3203 4*) osname=newsos4 ;;
3207 next*) osname=next ;;
3208 nonstop-ux) osname=nonstopux ;;
3209 openbsd) osname=openbsd
3215 POSIX-BC | posix-bc ) osname=posix-bc
3218 powerux | power_ux | powermax_os | powermaxos | \
3219 powerunix | power_unix) osname=powerux
3225 solaris) osname=solaris
3227 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3234 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3238 titanos) osname=titanos
3247 ultrix) osname=ultrix
3250 osf1|mls+) case "$5" in
3253 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3256 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3259 hp*) osname=hp_osf1 ;;
3260 mips) osname=mips_osf1 ;;
3263 # UnixWare 7.1.2 is known as Open UNIX 8
3264 openunix|unixware) osname=svr5
3272 $2) case "$osname" in
3276 : svr4.x or possibly later
3286 if test -f /stand/boot ; then
3287 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3288 if test -n "$INITPROG" -a -f "$INITPROG"; then
3289 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3290 if test -n "$isesix"; then
3298 *) if test -f /etc/systemid; then
3300 set `echo $3 | $sed 's/\./ /g'` $4
3301 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3303 elif $test -f $src/hints/sco_$1_$2.sh; then
3305 elif $test -f $src/hints/sco_$1.sh; then
3310 '') : Still unknown. Probably a generic Sys V.
3319 *) case "$osname" in
3320 '') : Still unknown. Probably a generic BSD.
3328 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3329 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3330 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3333 $rm -f UU/kernel.what
3334 elif test -d c:/. -o -n "$is_os2" ; then
3341 case "$targetarch" in
3344 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3349 : Now look for a hint file osname_osvers, unless one has been
3350 : specified already.
3353 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3354 : Also try without trailing minor version numbers.
3355 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3356 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3357 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3358 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3361 *) case "$osvers" in
3364 *) if $test -f $src/hints/$file.sh ; then
3366 elif $test -f $src/hints/$xfile.sh ; then
3368 elif $test -f $src/hints/$xxfile.sh ; then
3370 elif $test -f $src/hints/$xxxfile.sh ; then
3372 elif $test -f $src/hints/$xxxxfile.sh ; then
3374 elif $test -f "$src/hints/${osname}.sh" ; then
3383 if $test -f Policy.sh ; then
3386 none) dflt="Policy" ;;
3387 *) dflt="Policy $dflt" ;;
3392 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3396 if $test -f Policy.sh ; then
3399 There's also a Policy hint file available, which should make the
3400 site-specific (policy) questions easier to answer.
3407 You may give one or more space-separated answers, or "none" if appropriate.
3408 If you have a handcrafted Policy.sh file or a Policy.sh file generated by a
3409 previous run of Configure, you may specify it as well as or instead of
3410 OS-specific hints. If hints are provided for your OS, you should use them:
3411 although Perl can probably be built without hints on many platforms, using
3412 hints often improve performance and may enable features that Configure can't
3413 set up on its own. If there are no hints that match your OS, specify "none";
3414 DO NOT give a wrong version or a wrong OS.
3418 rp="Which of these apply, if any?"
3421 for file in $tans; do
3422 if $test X$file = XPolicy -a -f Policy.sh; then
3424 $cat Policy.sh >> UU/config.sh
3425 elif $test -f $src/hints/$file.sh; then
3426 . $src/hints/$file.sh
3427 $cat $src/hints/$file.sh >> UU/config.sh
3428 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3431 : Give one chance to correct a possible typo.
3432 echo "$file.sh does not exist"
3434 rp="hint to use instead?"
3436 for file in $ans; do
3437 if $test -f "$src/hints/$file.sh"; then
3438 . $src/hints/$file.sh
3439 $cat $src/hints/$file.sh >> UU/config.sh
3440 elif $test X$ans = X -o X$ans = Xnone ; then
3443 echo "$file.sh does not exist -- ignored."
3450 : Remember our hint file for later.
3451 if $test -f "$src/hints/$file.sh" ; then
3461 echo "Fetching default answers from $config_sh..." >&4
3465 cp $config_sh config.sh 2>/dev/null
3475 test "$override" && . ./optdef.sh
3477 : Restore computed paths
3478 for file in $loclist $trylist; do
3479 eval $file="\$_$file"
3484 Configure uses the operating system name and version to set some defaults.
3485 The default value is probably right if the name rings a bell. Otherwise,
3486 since spelling matters for me, either accept the default or answer "none"
3493 ''|' '|none) dflt=none ;;
3494 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3497 *) dflt="$osname" ;;
3499 rp="Operating system name?"
3503 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3509 ''|' '|none) dflt=none ;;
3510 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3511 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3513 ''|' ') dflt=none ;;
3518 *) dflt="$osvers" ;;
3520 rp="Operating system version?"
3530 : who configured the system
3531 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3534 cf_by=`(logname) 2>/dev/null`
3537 cf_by=`(whoami) 2>/dev/null`
3539 "") cf_by=unknown ;;
3544 : decide how portable to be. Allow command line overrides.
3545 case "$d_portable" in
3547 *) d_portable="$define" ;;
3550 : set up shell script to do ~ expansion
3556 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3559 if $test -f /bin/csh; then
3560 /bin/csh -f -c "glob \$1"
3565 name=\`$expr x\$1 : '..\([^/]*\)'\`
3566 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3567 if $test ! -d "\$dir"; then
3569 echo "\$me: can't locate home directory for: \$name" >&2
3574 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3590 : now set up to get a file name
3594 cat <<'EOSC' >>getfile
3610 : getfile will accept an answer from the comma-separated list
3611 : enclosed in parentheses even if it does not meet other criteria.
3612 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3613 fn=`echo $fn | sed 's/(.*)//'`
3619 loc_file=`expr $fn : '.*:\(.*\)'`
3620 fn=`expr $fn : '\(.*\):.*'`
3628 */*) fullpath=true;;
3637 *e*) exp_file=true;;
3640 *p*) nopath_ok=true;;
3645 *d*) type='Directory';;
3646 *l*) type='Locate';;
3651 Locate) what='File';;
3656 case "$d_portable" in
3664 while test "$type"; do
3669 true) rp="$rp (~name ok)";;
3672 if test -f UU/getfile.ok && \
3673 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3692 value=`UU/filexp $ans`
3695 if test "$ans" != "$value"; then
3696 echo "(That expands to $value on this system.)"
3710 /*) value="$ansexp" ;;
3711 [a-zA-Z]:/*) value="$ansexp" ;;
3716 echo "I shall only accept a full path name, as in /bin/ls." >&4
3717 echo "Use a ! shell escape if you wish to check pathnames." >&4
3720 echo "Please give a full path name, starting with slash." >&4
3723 echo "Note that using ~name is ok provided it expands well." >&4
3736 for fp in $gfpth; do
3737 if test "X$fp" = X.; then
3742 if test -f "$pf"; then
3744 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3746 echo "($value is not a plain file, but that's ok.)"
3749 if test X"$type" = X; then
3756 for fp in $gfpth; do
3757 if test "X$fp" = X.; then
3762 direxp="$fp/$ansexp"
3764 if test -d "$direxp"; then
3772 if test -d "$ansexp"; then
3773 echo "(Looking for $loc_file in directory $value.)"
3774 value="$value/$loc_file"
3775 ansexp="$ansexp/$loc_file"
3777 if test -f "$ansexp"; then
3780 case "$nopath_ok" in
3781 true) case "$value" in
3783 *) echo "Assuming $value will be in people's path."
3799 if test "$fastread" = yes; then
3804 rp="$what $value doesn't exist. Use that name anyway?"
3823 test "X$gfpthkeep" != Xy && gfpth=""
3826 : determine root of directory hierarchy where package will be installed.
3829 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
3832 dflt=`echo "$prefix" | sed 's/.$//'`
3840 By default, $package will be installed in $dflt/bin, manual pages
3841 under $dflt/man, etc..., i.e. with $dflt as prefix for all
3842 installation directories. Typically this is something like /usr/local.
3843 If you wish to have binaries under /usr/bin but other parts of the
3844 installation under /usr/local, that's ok: you will be prompted
3845 separately for each of the installation directories, the prefix being
3846 only used to set the defaults.
3850 rp='Installation prefix to use?'
3858 *) oldprefix="$prefix";;
3867 *) afsroot=$afsroot ;;
3873 $define|true) afs=true ;;
3874 $undef|false) afs=false ;;
3875 *) if test -d $afsroot; then
3883 echo "AFS may be running... I'll be extra cautious then..." >&4
3885 echo "AFS does not seem to be running..." >&4
3888 : determine installation prefix for where package is to be installed.
3892 Since you are running AFS, I need to distinguish the directory in which
3893 files will reside from the directory in which they are installed (and from
3894 which they are presumably copied to the former directory by occult means).
3897 case "$installprefix" in
3898 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
3899 *) dflt="$installprefix";;
3904 In some special cases, particularly when building $package for distribution,
3905 it is convenient to distinguish the directory in which files should be
3906 installed from the directory ($prefix) in which they will
3907 eventually reside. For most users, these two directories are the same.
3910 case "$installprefix" in
3912 *) dflt=$installprefix;;
3916 rp='What installation prefix should I use for installing files?'
3918 installprefix="$ans"
3919 installprefixexp="$ansexp"
3921 : Perform the prefixexp/installprefixexp correction if necessary
3922 cat <<EOS >installprefix
3925 cat <<'EOSC' >>installprefix
3926 : Change installation prefix, if necessary.
3927 if $test X"$prefix" != X"$installprefix"; then
3928 eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`"
3930 eval "install${prefixvar}=\"\$${prefixvar}exp\""
3933 chmod +x installprefix
3934 $eunicefix installprefix
3936 : Set variables such as privlib and privlibexp from the output of ./getfile
3937 : performing the prefixexp/installprefixexp correction if necessary.
3938 cat <<EOS >setprefixvar
3941 cat <<'EOSC' >>setprefixvar
3942 eval "${prefixvar}=\"\$ans\""
3943 eval "${prefixvar}exp=\"\$ansexp\""
3946 chmod +x setprefixvar
3947 $eunicefix setprefixvar
3949 : set up the script used to warn in case of inconsistency
3958 '') echo "The $hint value for \$$var on this machine was \"$was\"!" >&4
3960 *) echo "Hmm. Based on the hints in hints/$hintfile.sh, " >&4
3961 echo "the $hint value for \$$var on this machine was \"$was\"!" >&4
3966 echo "*** WHOA THERE!!! ***" >&4
3967 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
3970 rp=" Keep the $hint value?"
3973 y) td=$was; tu=$was;;
3977 : function used to set $1 to $val
3978 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
3980 $define$undef) . ./whoa; eval "$var=\$td";;
3981 $undef$define) . ./whoa; eval "$var=\$tu";;
3982 *) eval "$var=$val";;
3986 $define|true|[yY]*) dflt='y';;
3991 Perl can be built to use the SOCKS proxy protocol library. To do so,
3992 Configure must be run with -Dusesocks. If you use SOCKS you also need
3993 to use the PerlIO abstraction layer, this will be implicitly selected.
3995 If this doesn't make any sense to you, just accept the default '$dflt'.
3997 rp='Build Perl for SOCKS?'
4000 y|Y) val="$define" ;;
4007 $define|true|[yY]*) useperlio="$define";;
4010 case "$useperlio" in
4011 $define|true|[yY]*|'') dflt='y';;
4016 Previous version of $package used the standard IO mechanisms as
4017 defined in <stdio.h>. Versions 5.003_02 and later of $package allow
4018 alternate IO mechanisms via the PerlIO abstraction layer, but the
4019 stdio mechanism is still available if needed. The abstraction layer
4020 can use AT&T's sfio (if you already have sfio installed) or regular stdio.
4021 Using PerlIO with sfio may cause problems with some extension modules.
4023 If this doesn't make any sense to you, just accept the default '$dflt'.
4025 rp='Use the PerlIO abstraction layer?'
4032 echo "Ok, doing things the stdio way."
4041 case "$useperlio" in
4042 $define|true|[yY]*) ;;
4045 You are using the SOCKS proxy protocol library which means that you
4046 should also use the PerlIO layer. You may be headed for trouble.
4055 : get the patchlevel
4057 echo "Getting the current patchlevel..." >&4
4058 if $test -r $rsrc/patchlevel.h;then
4059 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
4060 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
4061 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4062 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
4063 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
4064 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4065 perl_patchlevel=`egrep 'define PERL_PATCHNUM [0-9][0-9]|,"MAINT[0-9][0-9]*"' $rsrc/patchlevel.h|sed 's/[^0-9]//g'`
4074 $echo "(You do not have patchlevel.h. Eek.)"
4076 if $test -r $rsrc/.patch ; then
4077 if $test "X$perl_patchlevel" = "X" || $test "`cat $rsrc/.patch`" -gt "$perl_patchlevel" ; then
4078 perl_patchlevel=`cat $rsrc/.patch`
4081 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
4082 version_patchlevel_string="version $patchlevel subversion $subversion"
4083 case "$perl_patchlevel" in
4085 *) version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel" ;;
4088 $echo "(You have $package $version_patchlevel_string.)"
4092 : XXX Should be a Configure test for double-dots in filenames.
4093 version=`echo $revision $patchlevel $subversion | \
4094 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4095 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4096 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4099 version=`echo $revision $patchlevel $subversion | \
4100 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4101 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4102 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4105 : Special case the 5.005_xx maintenance series, which used 5.005
4106 : without any subversion label as a subdirectory in $sitelib
4107 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
4108 api_versionstring='5.005'
4111 case "$usethreads" in
4112 $define|true|[yY]*) dflt='y';;
4113 *) # Catch case where user specified ithreads or 5005threads but
4114 # forgot -Dusethreads (A.D. 4/2002)
4115 case "$useithreads$use5005threads" in
4117 case "$useperlio" in
4118 "$define") dflt='y' ;;
4128 Perl can be built to take advantage of threads on some systems.
4129 To do so, Configure can be run with -Dusethreads.
4131 Note that Perl built with threading support runs slightly slower
4132 and uses more memory than plain Perl. The current implementation
4133 is believed to be stable, but it is fairly new, and so should be
4134 treated with caution.
4136 If this doesn't make any sense to you, just accept the default '$dflt'.
4138 rp='Build a threading Perl?'
4141 y|Y) val="$define" ;;
4147 if $test $patchlevel -lt 9; then
4148 case "$usethreads" in
4152 Since release 5.6, Perl has had two different threading implementations,
4153 the newer interpreter-based version (ithreads) with one interpreter per
4154 thread, and the older 5.005 version (5005threads).
4155 The 5005threads version is effectively unmaintained and will probably be
4156 removed in Perl 5.10, so there should be no need to build a Perl using it
4157 unless needed for backwards compatibility with some existing 5.005threads
4161 : Default to ithreads unless overridden on command line or with
4164 case "$use5005threads" in
4165 $define|true|[yY]*) dflt='n';;
4167 case "$useithreads" in
4168 $undef|false|[nN]*) dflt='n';;
4170 rp='Use the newer interpreter-based ithreads?'
4173 y|Y) val="$define" ;;
4178 : Now set use5005threads to the opposite value.
4179 case "$useithreads" in
4180 $define) val="$undef" ;;
4187 useithreads="$undef"
4188 use5005threads="$undef"
4192 case "$useithreads$use5005threads" in
4196 You cannot have both the ithreads and the 5.005 threads enabled
4197 at the same time. Disabling the 5.005 threads since they are
4198 much less stable than the ithreads.
4201 use5005threads="$undef"
4206 : perl-5.9.x and later
4208 use5005threads="$undef"
4209 case "$usethreads" in
4211 : Default to ithreads unless overridden on command line or with
4214 case "$useithreads" in
4215 $undef|false|[nN]*) dflt='n';;
4217 rp='Use the newer interpreter-based ithreads?'
4220 y|Y) val="$define" ;;
4227 useithreads="$undef"
4233 if test X"$usethreads" = "X$define" -a "X$useperlio" = "Xundef"; then
4236 *** To build with ithreads you must also use the PerlIO layer.
4237 *** Cannot continue, aborting.
4243 case "$d_oldpthreads" in
4244 '') : Configure tests would be welcome here. For now, assume undef.
4246 *) val="$d_oldpthreads" ;;
4252 : Look for a hint-file generated 'call-back-unit'. If the
4253 : user has specified that a threading perl is to be built,
4254 : we may need to set or change some other defaults.
4255 if $test -f usethreads.cbu; then
4256 echo "Your platform has some specific hints regarding threaded builds, using them..."
4259 case "$usethreads" in
4260 "$define"|true|[yY]*)
4262 (Your platform does not have any specific hints for threaded builds.
4263 Assuming POSIX threads, then.)
4271 Perl can be built so that multiple Perl interpreters can coexist
4272 within the same Perl executable.
4275 case "$useithreads" in
4278 This multiple interpreter support is required for interpreter-based threads.
4282 *) case "$usemultiplicity" in
4283 $define|true|[yY]*) dflt='y';;
4287 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
4288 rp='Build Perl for multiplicity?'
4291 y|Y) val="$define" ;;
4300 case "$usemorebits" in
4301 "$define"|true|[yY]*)
4302 use64bitint="$define"
4303 uselongdouble="$define"
4304 usemorebits="$define"
4306 *) usemorebits="$undef"
4310 : make some quick guesses about what we are up against
4312 $echo $n "Hmm... $c"
4322 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
4323 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
4325 echo "Looks kind of like an OSF/1 system, but we'll see..."
4327 elif test `echo abc | $tr a-z A-Z` = Abc ; then
4328 xxx=`./loc addbib blurfl $pth`
4329 if $test -f $xxx; then
4330 echo "Looks kind of like a USG system with BSD features, but we'll see..."
4334 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
4335 echo "Looks kind of like an extended USG system, but we'll see..."
4337 echo "Looks kind of like a USG system, but we'll see..."
4341 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
4342 echo "Looks kind of like a BSD system, but we'll see..."
4346 echo "Looks kind of like a Version 7 system, but we'll see..."
4349 case "$eunicefix" in
4352 There is, however, a strange, musty smell in the air that reminds me of
4353 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
4357 : it so happens the Eunice I know will not run shell scripts in Unix format
4361 echo "Congratulations. You aren't running Eunice."
4365 : Detect OS2. The p_ variable is set above in the Head.U unit.
4366 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
4367 : semicolon as a patch separator
4372 I have the feeling something is not exactly right, however...don't tell me...
4373 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
4374 (Or you may be running DOS with DJGPP.)
4379 if test -f /xenix; then
4380 echo "Actually, this looks more like a XENIX system..."
4385 echo "It's not Xenix..."
4390 if test -f /venix; then
4391 echo "Actually, this looks more like a VENIX system..."
4398 echo "Nor is it Venix..."
4401 chmod +x bsd usg v7 osf1 eunice xenix venix os2
4402 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
4409 rp="Use which C compiler?"
4413 : See if they have not cc but they do have gcc
4415 : Look for a hint-file generated 'call-back-unit'. Now that the
4416 : user has specified the compiler, we may need to set or change some
4418 if $test -f cc.cbu; then
4424 echo "Checking for GNU cc in disguise and/or its version number..." >&4
4428 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
4430 printf("%s\n", __VERSION__);
4432 printf("%s\n", "1");
4438 if $cc -o try $ccflags $ldflags try.c; then
4439 gccversion=`$run ./try`
4440 case "$gccversion" in
4441 '') echo "You are not using GNU cc." ;;
4442 *) echo "You are using GNU cc $gccversion."
4448 echo "*** WHOA THERE!!! ***" >&4
4449 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
4450 case "$knowitall" in
4452 echo " You'd better start hunting for one and let me know about it." >&4
4458 case "$gccversion" in
4459 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
4461 case "$gccversion" in
4462 '') gccosandvers='' ;;
4463 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
4464 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
4466 case "$gccosandvers" in
4467 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
4468 $osname$osvers) ;; # looking good
4469 $osname*) cat <<EOM >&4
4471 *** WHOA THERE!!! ***
4473 Your gcc has not been compiled for the exact release of
4474 your operating system ($gccosandvers versus $osname$osvers).
4476 In general it is a good idea to keep gcc synchronized with
4477 the operating system because otherwise serious problems
4478 may ensue when trying to compile software, like Perl.
4480 I'm trying to be optimistic here, though, and will continue.
4481 If later during the configuration and build icky compilation
4482 problems appear (headerfile conflicts being the most common
4483 manifestation), I suggest reinstalling the gcc to match
4484 your operating system release.
4488 *) gccosandvers='' ;; # failed to parse, better be silent
4496 # gcc 3.* complain about adding -Idirectories that they already know about,
4497 # so we will take those off from locincpth.
4498 case "$gccversion" in
4500 echo "main(){}">try.c
4501 for incdir in $locincpth; do
4502 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
4503 grep '^c[cp]p*[01]: warning: changing search order '`
4504 if test "X$warn" != X; then
4505 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
4511 : What should the include directory be ?
4513 $echo $n "Hmm... $c"
4517 if $test -f /bin/mips && /bin/mips; then
4518 echo "Looks like a MIPS system..."
4519 $cat >usr.c <<'EOCP'
4520 #ifdef SYSTYPE_BSD43
4524 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4525 dflt='/bsd43/usr/include'
4529 mips_type='System V'
4531 $rm -f usr.c usr.out
4532 echo "and you're compiling with the $mips_type compiler and libraries."
4536 echo "Doesn't look like a MIPS system."
4546 case "$xxx_prompt" in
4549 rp='Where are the include files you want to use?'
4557 : see how we invoke the C preprocessor
4559 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4560 cat <<'EOT' >testcpp.c
4566 if test ! -f cppstdin; then
4567 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4568 # AIX cc -E doesn't show the absolute headerfile
4569 # locations but we'll cheat by using the -M flag.
4570 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
4572 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4575 echo "Keeping your $hint cppstdin wrapper."
4578 wrapper=`pwd`/cppstdin
4582 if $test "X$cppstdin" != "X" && \
4583 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4584 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4586 echo "You used to use $cppstdin $cppminus so we'll use that again."
4588 '') echo "But let's see if we can live without a wrapper..." ;;
4590 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4591 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4593 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4596 echo "(However, $cpprun $cpplast does not work, let's see...)"
4604 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4611 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4612 $cc -E <testcpp.c >testcpp.out 2>&1; \
4613 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4614 echo "Yup, it does."
4617 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4618 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4619 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4620 echo "Yup, it does."
4623 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4624 $cc -P <testcpp.c >testcpp.out 2>&1; \
4625 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4626 echo "Yipee, that works!"
4629 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4630 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4631 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4632 echo "At long last!"
4635 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4636 $cpp <testcpp.c >testcpp.out 2>&1; \
4637 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4641 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4642 $cpp - <testcpp.c >testcpp.out 2>&1; \
4643 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4644 echo "Hooray, it works! I was beginning to wonder."
4647 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4648 $wrapper <testcpp.c >testcpp.out 2>&1; \
4649 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4655 rp="No dice. I can't find a C preprocessor. Name one:"
4659 $x_cpp <testcpp.c >testcpp.out 2>&1
4660 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4661 echo "OK, that will do." >&4
4663 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4678 echo "Perhaps can we force $cc -E using a wrapper..."
4679 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4680 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4686 echo "Nope, we'll have to live without it..."
4700 "$wrapper"|'cppstdin') ;;
4701 *) $rm -f $wrapper;;
4703 $rm -f testcpp.c testcpp.out
4705 : Set private lib path
4708 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4713 '') dlist="$loclibpth $plibpth $glibpth";;
4714 *) dlist="$libpth";;
4717 : Now check and see which directories actually exist, avoiding duplicates
4721 if $test -d $xxx; then
4724 *) libpth="$libpth $xxx";;
4730 Some systems have incompatible or broken versions of libraries. Among
4731 the directories listed in the question below, please remove any you
4732 know not to be holding relevant libraries, and add any that are needed.
4733 Say "none" for none.
4744 rp="Directories to use for library searches?"
4751 : compute shared library extension
4754 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4764 On some systems, shared libraries may be available. Answer 'none' if
4765 you want to suppress searching of shared libraries for the remainder
4766 of this configuration.
4769 rp='What is the file extension used for shared libraries?'
4773 : Define several unixisms.
4774 : Hints files or command line option can be used to override them.
4775 : The convoluted testing is in case hints files set either the old
4778 '') case "$exe_ext" in
4780 *) _exe="$exe_ext" ;;
4785 '') case "$lib_ext" in
4792 '') case "$obj_ext" in
4799 '') case "$path_sep" in
4810 : Which makefile gets called first. This is used by make depend.
4811 case "$firstmakefile" in
4812 '') firstmakefile='makefile';;
4816 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
4819 case "$uselongdouble" in
4820 $define|true|[yY]*) dflt='y';;
4825 Perl can be built to take advantage of long doubles which
4826 (if available) may give more accuracy and range for floating point numbers.
4828 If this doesn't make any sense to you, just accept the default '$dflt'.
4830 rp='Try to use long doubles if available?'
4833 y|Y) val="$define" ;;
4839 case "$uselongdouble" in
4840 true|[yY]*) uselongdouble="$define" ;;
4843 : Look for a hint-file generated 'call-back-unit'. If the
4844 : user has specified that long doubles should be used,
4845 : we may need to set or change some other defaults.
4846 if $test -f uselongdouble.cbu; then
4847 echo "Your platform has some specific hints regarding long doubles, using them..."
4848 . ./uselongdouble.cbu
4850 case "$uselongdouble" in
4853 (Your platform does not have any specific hints for long doubles.)
4859 : Looking for optional libraries
4861 echo "Checking for optional libraries..." >&4
4866 case "$libswanted" in
4867 '') libswanted='c_s';;
4870 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
4876 for thisdir in $libpth $xlibpth; do
4877 test -d $thisdir && libspath="$libspath $thisdir"
4879 for thislib in $libswanted; do
4880 for thisdir in $libspath; do
4882 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4883 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
4884 $test -f "$xxx" && eval $libscheck
4885 $test -f "$xxx" && libstyle=shared
4887 if test ! -f "$xxx"; then
4888 xxx=$thisdir/lib$thislib.$so
4889 $test -f "$xxx" && eval $libscheck
4890 $test -f "$xxx" && libstyle=shared
4892 if test ! -f "$xxx"; then
4893 xxx=$thisdir/lib$thislib$_a
4894 $test -f "$xxx" && eval $libscheck
4895 $test -f "$xxx" && libstyle=static
4897 if test ! -f "$xxx"; then
4898 xxx=$thisdir/$thislib$_a
4899 $test -f "$xxx" && eval $libscheck
4900 $test -f "$xxx" && libstyle=static
4902 if test ! -f "$xxx"; then
4903 xxx=$thisdir/lib${thislib}_s$_a
4904 $test -f "$xxx" && eval $libscheck
4905 $test -f "$xxx" && libstyle=static
4906 $test -f "$xxx" && thislib=${thislib}_s
4908 if test ! -f "$xxx"; then
4909 xxx=$thisdir/Slib$thislib$_a
4910 $test -f "$xxx" && eval $libscheck
4911 $test -f "$xxx" && libstyle=static
4913 if $test -f "$xxx"; then
4915 shared) echo "Found -l$thislib (shared)." ;;
4916 static) echo "Found -l$thislib." ;;
4917 *) echo "Found -l$thislib ($libstyle)." ;;
4921 *) dflt="$dflt -l$thislib"
4922 libsfound="$libsfound $xxx"
4924 libsfiles="$libsfiles $yyy"
4925 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
4926 case " $libsdirs " in
4928 *) libsdirs="$libsdirs $yyy" ;;
4935 if $test ! -f "$xxx"; then
4936 echo "No -l$thislib."
4947 ' '|'') dflt='none';;
4952 In order to compile $package on your machine, a number of libraries
4953 are usually needed. Include any other special libraries here as well.
4954 Say "none" for none. The default list is almost always right.
4958 rp="What libraries to use?"
4965 : determine optimization, if desired, or use for debug flag also
4967 ' '|$undef) dflt='none';;
4969 *) dflt="$optimize";;
4973 By default, $package compiles with the -O flag to use the optimizer.
4974 Alternately, you might want to use the symbolic debugger, which uses
4975 the -g flag (on traditional Unix systems). Either flag can be
4976 specified here. To use neither flag, specify the word "none".
4979 rp="What optimizer/debugger flag should be used?"
4983 'none') optimize=" ";;
4986 : Check what DEBUGGING is required from the command line
4987 : -DEBUGGING or -DDEBUGGING or
4988 : -DEBUGGING=both = -g + -DDEBUGGING
4989 : -DEBUGGING=-g or -Doptimize=-g = -g
4990 : -DEBUGGING=none or -UDEBUGGING =
4991 : -DEBUGGING=old or -DEBUGGING=default = ? $optimize
4994 *) DEBUGGING=$EBUGGING ;;
4997 case "$DEBUGGING" in
5001 *) optimize="$optimize -g" ;;
5005 *-g*) set `echo "X $optimize " | sed 's/ -g / /'`
5013 case "$DEBUGGING" in
5014 both|$define) dflt='-DDEBUGGING'
5017 : We will not override a previous value, but we might want to
5018 : augment a hint file
5020 default|recommended)
5021 case "$gccversion" in
5022 1*) dflt="$dflt -fpcc-struct-return" ;;
5024 case "$optimize:$DEBUGGING" in
5025 *-g*:old) dflt="$dflt -DDEBUGGING";;
5027 case "$gccversion" in
5028 2*) if test -d /etc/conf/kconfig.d &&
5029 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
5031 # Interactive Systems (ISC) POSIX mode.
5036 case "$gccversion" in
5040 echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
5041 echo 'int main(void) { return 0; }' > gcctest.c
5042 if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
5043 echo "Yes, it does." 2>&1
5046 echo "Leaving current flags $ccflags alone." 2>&1
5048 *) dflt="$dflt -fno-strict-aliasing" ;;
5051 echo "Nope, it doesn't, but that's ok." 2>&1
5055 # For gcc, adding -pipe speeds up compilations for some, but apparently
5056 # some assemblers can't read from stdin. (It also slows down compilations
5057 # in other cases, but those are apparently rarer these days.) AD 5/2004.
5058 case "$gccversion" in
5060 echo "Checking if your compiler accepts -pipe" 2>&1
5061 echo 'int main(void) { return 0; }' > gcctest.c
5062 if $cc -pipe -o gcctest gcctest.c; then
5063 echo "Yes, it does." 2>&1
5066 echo "Leaving current flags $ccflags alone." 2>&1
5068 *) dflt="$dflt -pipe" ;;
5071 echo "Nope, it doesn't, but that's ok." 2>&1
5078 case "$mips_type" in
5079 *BSD*|'') inclwanted="$locincpth $usrinc";;
5080 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
5082 for thisincl in $inclwanted; do
5083 if $test -d $thisincl; then
5084 if $test x$thisincl != x$usrinc; then
5086 *" -I$thisincl "*);;
5087 *) dflt="$dflt -I$thisincl ";;
5093 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
5095 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
5103 *) dflt="$dflt -D$2";;
5107 set signal.h LANGUAGE_C; eval $inctest
5111 ccflags="$ccflags -DSOCKS"
5116 default|recommended) dflt="$ccflags $dflt" ;;
5117 *) dflt="$ccflags";;
5126 Your C compiler may want other flags. For this question you should include
5127 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
5128 but you should NOT include libraries or ld flags like -lwhatever. If you
5129 want $package to honor its debug switch, you should include -DDEBUGGING here.
5130 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
5132 To use no flags, specify the word "none".
5138 rp="Any additional cc flags?"
5145 : the following weeds options from ccflags that are of no interest to cpp
5147 '') cppflags="$ccflags" ;;
5148 *) cppflags="$cppflags $ccflags" ;;
5150 case "$gccversion" in
5151 1*) cppflags="$cppflags -D__GNUC__"
5153 case "$mips_type" in
5155 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
5161 echo "Let me guess what the preprocessor flags are..." >&4
5175 *) ftry="$previous $flag";;
5177 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
5178 >cpp1.out 2>/dev/null && \
5179 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
5180 >cpp2.out 2>/dev/null && \
5181 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
5182 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
5184 cppflags="$cppflags $ftry"
5194 *-*) echo "They appear to be: $cppflags";;
5196 $rm -f cpp.c cpp?.out
5200 : flags used in final linking phase
5202 '') if ./venix; then
5208 *-posix*) dflt="$dflt -posix" ;;
5211 *) dflt="$ldflags";;
5214 : Try to guess additional flags to pick up local libraries.
5215 for thislibdir in $libpth; do
5216 case " $loclibpth " in
5219 *"-L$thislibdir "*) ;;
5220 *) dflt="$dflt -L$thislibdir" ;;
5232 Your C linker may need flags. For this question you should
5233 include -L/whatever and any other flags used by the C linker, but you
5234 should NOT include libraries like -lwhatever.
5236 Make sure you include the appropriate -L/path flags if your C linker
5237 does not normally search all of the directories you specified above,
5240 To use no flags, specify the word "none".
5244 rp="Any additional ld flags (NOT including libraries)?"
5250 rmlist="$rmlist pdp11"
5254 echo "Checking your choice of C compiler and flags for coherency..." >&4
5255 $cat > try.c <<'EOF'
5257 int main() { printf("Ok\n"); return(0); }
5259 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
5261 $cat >try.msg <<'EOM'
5262 I've tried to compile and run the following simple program:
5265 $cat try.c >> try.msg
5267 $cat >> try.msg <<EOM
5274 and I got the following output:
5278 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5279 if $sh -c "$run ./try" >>try.msg 2>&1; then
5283 *) echo 'The program compiled OK, but produced no output.' >> try.msg
5286 cat >> try.msg <<'EOQS'
5287 If $libs contains -lsfio, and sfio is mis-configured, then it
5288 sometimes (apparently) runs and exits with a 0 status, but with no
5289 output! It may have to do with sfio's use of _exit vs. exit.
5292 rp="You have a big problem. Shall I abort Configure"
5299 echo "The program compiled OK, but exited with status $?." >>try.msg
5300 rp="You have a problem. Shall I abort Configure"
5304 echo "I can't compile the test program." >>try.msg
5305 rp="You have a BIG problem. Shall I abort Configure"
5311 case "$knowitall" in
5313 echo "(The supplied flags or libraries might be incorrect.)"
5321 *) echo "Ok. Stopping Configure." >&4
5326 n) echo "OK, that should do.";;
5328 $rm -f try try.* core
5330 : define a shorthand compile call
5334 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5335 : define a shorthand compile call for compilations that should be ok.
5339 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5341 : determine filename position in cpp output
5343 echo "Computing filename position in cpp output for #include directives..." >&4
5345 vos) testaccess=-e ;;
5348 echo '#include <stdio.h>' > foo.c
5351 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5352 $grep '^[ ]*#.*stdio\.h' | \
5353 while read cline; do
5356 while $test \$# -gt 0; do
5357 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5362 pos=\`expr \$pos + 1\`
5374 *) pos="${fieldn}th";;
5376 echo "Your cpp writes the filename in the $pos field of the line."
5379 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
5380 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
5383 : locate header file
5388 for usrincdir in $usrinc
5390 if test -f \$usrincdir/\$wanted; then
5391 echo "\$usrincdir/\$wanted"
5395 awkprg='{ print \$$fieldn }'
5396 echo "#include <\$wanted>" > foo\$\$.c
5397 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5398 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5399 while read cline; do
5400 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5402 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5403 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5408 # status = 0: grep returned 0 lines, case statement not executed
5409 # status = 1: headerfile found
5410 # status = 2: while loop executed, no headerfile found
5414 if test \$status -eq 1; then
5421 : define an alternate in-header-list? function
5422 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5423 cont=true; xxf="echo \"<\$1> found.\" >&4";
5424 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5425 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5427 case $# in 4) instead=instead;; *) instead="at last";; esac;
5428 while $test "$cont"; do
5430 var=$2; eval "was=\$$2";
5431 if $test "$xxx" && $test -r "$xxx";
5433 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5436 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5437 set $yyy; shift; shift; yyy=$@;
5438 case $# in 0) cont="";;
5439 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5440 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5441 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5442 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5446 do set $yyy; var=$2; eval "was=\$$2";
5447 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5448 set $yyy; shift; shift; yyy=$@;
5451 : see if stdlib is available
5452 set stdlib.h i_stdlib
5455 : check for lengths of integral types
5459 echo "Checking to see how big your integers are..." >&4
5468 printf("intsize=%d;\n", (int)sizeof(int));
5469 printf("longsize=%d;\n", (int)sizeof(long));
5470 printf("shortsize=%d;\n", (int)sizeof(short));
5475 if eval $compile_ok && $run ./try > /dev/null; then
5477 echo "Your integers are $intsize bytes long."
5478 echo "Your long integers are $longsize bytes long."
5479 echo "Your short integers are $shortsize bytes long."
5483 Help! I can't compile and run the intsize test program: please enlighten me!
5484 (This is probably a misconfiguration in your system or libraries, and
5485 you really ought to fix it. Still, I'll try anyway.)
5489 rp="What is the size of an integer (in bytes)?"
5493 rp="What is the size of a long integer (in bytes)?"
5497 rp="What is the size of a short integer (in bytes)?"
5505 : check for long long
5507 echo "Checking to see if you have long long..." >&4
5508 echo 'int main() { long long x = 7; return 0; }' > try.c
5510 if eval $compile; then
5512 echo "You have long long."
5515 echo "You do not have long long."
5521 : check for length of long long
5522 case "${d_longlong}${longlongsize}" in
5525 echo "Checking to see how big your long longs are..." >&4
5526 $cat >try.c <<'EOCP'
5530 printf("%d\n", (int)sizeof(long long));
5535 if eval $compile_ok; then
5536 longlongsize=`$run ./try`
5537 echo "Your long longs are $longlongsize bytes long."
5541 echo "(I can't seem to compile the test program. Guessing...)"
5542 rp="What is the size of a long long (in bytes)?"
5546 if $test "X$longsize" = "X$longlongsize"; then
5547 echo "(That isn't any different from an ordinary long.)"
5553 : see if inttypes.h is available
5554 : we want a real compile instead of Inhdr because some systems
5555 : have an inttypes.h which includes non-existent headers
5558 #include <inttypes.h>
5560 static int32_t foo32 = 0x12345678;
5564 if eval $compile; then
5565 echo "<inttypes.h> found." >&4
5568 echo "<inttypes.h> NOT found." >&4
5577 echo "Checking to see if you have int64_t..." >&4
5579 #include <sys/types.h>
5580 #$i_inttypes I_INTTYPES
5582 #include <inttypes.h>
5584 int main() { int64_t x = 7; }
5587 if eval $compile; then
5589 echo "You have int64_t."
5592 echo "You do not have int64_t."
5600 echo "Checking which 64-bit integer type we could use..." >&4
5606 val='"unsigned int"'
5611 *) case "$longsize" in
5615 val='"unsigned long"'
5620 *) case "$d_longlong:$longlongsize" in
5625 val='"unsigned long long"'
5630 *) case "$d_int64_t" in
5649 '') echo "Alas, no 64-bit integer types in sight." >&4
5652 *) echo "We could use '$quadtype' for 64-bit integers." >&4
5658 case "$uselonglong" in
5659 "$define"|true|[yY]*)
5662 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
5664 use64bitint="$define"
5667 case "$use64bits" in
5668 "$define"|true|[yY]*)
5671 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
5673 use64bitint="$define"
5676 case "$use64bitints" in
5677 "$define"|true|[yY]*)
5680 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
5682 use64bitint="$define"
5685 case "$use64bitsint" in
5686 "$define"|true|[yY]*)
5689 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
5691 use64bitint="$define"
5694 case "$uselonglongs" in
5695 "$define"|true|[yY]*)
5698 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
5700 use64bitint="$define"
5703 case "$use64bitsall" in
5704 "$define"|true|[yY]*)
5707 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
5709 use64bitall="$define"
5714 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
5716 case "$use64bitall" in
5717 "$define"|true|[yY]*) use64bitint="$define" ;;
5723 You have natively 64-bit long integers.
5727 *) case "$use64bitint" in
5728 "$define"|true|[yY]*) dflt='y';;
5737 Perl can be built to take advantage of 64-bit integer types
5738 on some systems. To do so, Configure can be run with -Duse64bitint.
5739 Choosing this option will most probably introduce binary incompatibilities.
5741 If this doesn't make any sense to you, just accept the default '$dflt'.
5742 (The default has been chosen based on your configuration.)
5744 rp='Try to use 64-bit integers, if available?'
5747 [yY]*) val="$define" ;;
5755 case "$use64bitall" in
5756 "$define"|true|[yY]*) dflt='y' ;;
5757 *) case "$longsize" in
5765 You may also choose to try maximal 64-bitness. It means using as much
5766 64-bitness as possible on the platform. This in turn means even more
5767 binary incompatibilities. On the other hand, your platform may not
5768 have any more 64-bitness available than what you already have chosen.
5770 If this doesn't make any sense to you, just accept the default '$dflt'.
5771 (The default has been chosen based on your configuration.)
5773 rp='Try to use maximal 64-bit support, if available?'
5776 [yY]*) val="$define" ;;
5781 case "$use64bitall" in
5783 case "$use64bitint" in
5787 Since you have chosen a maximally 64-bit build, I'm also turning on
5788 the use of 64-bit integers.
5790 use64bitint="$define" ;;
5795 : Look for a hint-file generated 'call-back-unit'. If the
5796 : user has specified that a 64-bit perl is to be built,
5797 : we may need to set or change some other defaults.
5798 if $test -f use64bitint.cbu; then
5799 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
5802 case "$use64bitint" in
5803 "$define"|true|[yY]*)
5805 4) case "$archname64" in
5806 '') archname64=64int ;;
5813 : Look for a hint-file generated 'call-back-unit'. If the
5814 : user has specified that a maximally 64-bit perl is to be built,
5815 : we may need to set or change some other defaults.
5816 if $test -f use64bitall.cbu; then
5817 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
5820 case "$use64bitall" in
5821 "$define"|true|[yY]*)
5823 4) case "$archname64" in
5824 ''|64int) archname64=64all ;;
5831 case "$d_quad:$use64bitint" in
5835 *** You have chosen to use 64-bit integers,
5836 *** but none can be found.
5837 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
5838 *** Cannot continue, aborting.
5845 : check for length of double
5847 case "$doublesize" in
5849 echo "Checking to see how big your double precision numbers are..." >&4
5858 printf("%d\n", (int)sizeof(double));
5863 if eval $compile_ok; then
5864 doublesize=`$run ./try`
5865 echo "Your double is $doublesize bytes long."
5868 echo "(I can't seem to compile the test program. Guessing...)"
5869 rp="What is the size of a double precision number (in bytes)?"
5877 : check for long doubles
5879 echo "Checking to see if you have long double..." >&4
5880 echo 'int main() { long double x = 7.0; }' > try.c
5882 if eval $compile; then
5884 echo "You have long double."
5887 echo "You do not have long double."
5893 : check for length of long double
5894 case "${d_longdbl}${longdblsize}" in
5897 echo "Checking to see how big your long doubles are..." >&4
5898 $cat >try.c <<'EOCP'
5902 printf("%d\n", sizeof(long double));
5907 if eval $compile; then
5908 longdblsize=`$run ./try`
5909 echo "Your long doubles are $longdblsize bytes long."
5913 echo "(I can't seem to compile the test program. Guessing...)" >&4
5914 rp="What is the size of a long double (in bytes)?"
5918 if $test "X$doublesize" = "X$longdblsize"; then
5919 echo "That isn't any different from an ordinary double."
5920 echo "I'll keep your setting anyway, but you may see some"
5921 echo "harmless compilation warnings."
5927 : determine the architecture name
5929 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
5930 tarch=`arch`"-$osname"
5931 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
5932 if uname -m > tmparch 2>&1 ; then
5933 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
5934 -e 's/$/'"-$osname/" tmparch`
5942 case "$myarchname" in
5945 echo "(Your architecture name used to be $myarchname.)"
5949 case "$targetarch" in
5951 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
5956 *) dflt="$archname";;
5958 rp='What is your architecture name'
5961 case "$usethreads" in
5963 echo "Threads selected." >&4
5965 *-thread*) echo "...and architecture name already has -thread." >&4
5967 *) archname="$archname-thread"
5968 echo "...setting architecture name to $archname." >&4
5973 case "$usemultiplicity" in
5975 echo "Multiplicity selected." >&4
5977 *-multi*) echo "...and architecture name already has -multi." >&4
5979 *) archname="$archname-multi"
5980 echo "...setting architecture name to $archname." >&4
5985 case "$use64bitint$use64bitall" in
5987 case "$archname64" in
5989 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
5992 case "$use64bitint" in
5993 "$define") echo "64 bit integers selected." >&4 ;;
5995 case "$use64bitall" in
5996 "$define") echo "Maximal 64 bitness selected." >&4 ;;
5999 *-$archname64*) echo "...and architecture name already has $archname64." >&4
6001 *) archname="$archname-$archname64"
6002 echo "...setting architecture name to $archname." >&4
6008 case "$uselongdouble" in
6010 echo "Long doubles selected." >&4
6011 case "$longdblsize" in
6013 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
6017 *-ld*) echo "...and architecture name already has -ld." >&4
6019 *) archname="$archname-ld"
6020 echo "...setting architecture name to $archname." >&4
6027 case "$useperlio" in
6029 echo "Perlio selected." >&4
6032 echo "Perlio not selected, using stdio." >&4
6034 *-stdio*) echo "...and architecture name already has -stdio." >&4
6036 *) archname="$archname-stdio"
6037 echo "...setting architecture name to $archname." >&4
6042 if $test -f archname.cbu; then
6043 echo "Your platform has some specific hints for architecture name, using them..."
6047 : set the prefixit variable, to compute a suitable default value
6048 prefixit='case "$3" in
6050 case "$oldprefix" in
6051 "") eval "$1=\"\$$2\"";;
6058 ""|" ") eval "$1=\"\$$2\"";;
6064 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
6066 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
6067 /*-$oldprefix/*|\~*-$oldprefix/*)
6068 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
6069 *) eval "$1=\"\$$2\"";;
6073 : determine installation style
6074 : For now, try to deduce it from prefix unless it is already set.
6075 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
6076 case "$installstyle" in
6077 '') case "$prefix" in
6078 *perl*) dflt='lib';;
6079 *) dflt='lib/perl5' ;;
6082 *) dflt="$installstyle" ;;
6084 : Probably not worth prompting for this since we prompt for all
6085 : the directories individually, and the prompt would be too long and
6089 : determine where public executables go
6094 rp='Pathname where the public executables will reside?'
6096 if $test "X$ansexp" != "X$binexp"; then
6100 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
6101 : XXX If this is fixed, also fix the "start perl" hunk below, which relies on
6102 : this via initialinstalllocation
6105 case "$userelocatableinc" in
6106 $define|true|[yY]*) dflt='y' ;;
6111 Would you like to build Perl so that the installation is relocatable, so that
6112 library paths in @INC are determined relative to the path of the perl binary?
6113 This is not advised for system Perl installs, or if you need to run setid
6114 scripts or scripts under taint mode.
6116 If this doesn't make any sense to you, just accept the default '$dflt'.
6118 rp='Use relocatable @INC?'
6121 y|Y) val="$define" ;;
6124 set userelocatableinc
6127 initialinstalllocation="$binexp"
6128 : Default prefix is now "up one level from where the binaries are"
6129 case "$userelocatableinc" in
6135 installprefixexp=".../.."
6139 : determine where private library files go
6140 : Usual default is /usr/local/lib/perl5/$version.
6141 : Also allow things like /opt/perl/lib/$version, since
6142 : /opt/perl/lib/perl5... would be redundant.
6143 : The default "style" setting is made in installstyle.U
6144 case "$installstyle" in
6145 *lib/perl5*) set dflt privlib lib/$package/$version ;;
6146 *) set dflt privlib lib/$version ;;
6151 There are some auxiliary files for $package that need to be put into a
6152 private library directory that is accessible by everyone.
6157 rp='Pathname where the private library files will reside?'
6162 : set the prefixup variable, to restore leading tilda escape
6163 prefixup='case "$prefixexp" in
6165 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
6168 : determine where public architecture dependent libraries go
6171 : privlib default is /usr/local/lib/$package/$version
6172 : archlib default is /usr/local/lib/$package/$version/$archname
6173 : privlib may have an optional trailing /share.
6174 tdflt=`echo $privlib | $sed 's,/share$,,'`
6175 tdflt=$tdflt/$archname
6184 $spackage contains architecture-dependent library files. If you are
6185 sharing libraries in a heterogeneous environment, you might store
6186 these files in a separate location. Otherwise, you can just include
6187 them with the rest of the public library files.
6192 rp='Where do you want to put the public architecture-dependent libraries?'
6196 if $test X"$archlib" = X"$privlib"; then
6202 : see if setuid scripts can be secure
6205 Some kernels have a bug that prevents setuid #! scripts from being
6206 secure. Some sites have disabled setuid #! scripts because of this.
6208 First let's decide if your kernel supports secure setuid #! scripts.
6209 (If setuid #! scripts would be secure but have been disabled anyway,
6210 don't say that they are secure if asked.)
6215 if $test -d /dev/fd; then
6216 echo "#!$ls" >reflect
6217 chmod +x,u+s reflect
6218 ./reflect >flect 2>&1
6219 if $contains "/dev/fd" flect >/dev/null; then
6220 echo "Congratulations, your kernel has secure setuid scripts!" >&4
6224 If you are not sure if they are secure, I can check but I'll need a
6225 username and password different from the one you are using right now.
6226 If you don't have such a username or don't want me to test, simply
6230 rp='Other username to test security of setuid scripts with?'
6235 case "$d_suidsafe" in
6236 '') echo "I'll assume setuid scripts are *not* secure." >&4
6239 echo "Well, the $hint value is *not* secure." >&4
6241 *) echo "Well, the $hint value *is* secure." >&4
6246 $rm -f reflect flect
6247 echo "#!$ls" >reflect
6248 chmod +x,u+s reflect
6251 echo '"su" will (probably) prompt you for '"$ans's password."
6252 su $ans -c './reflect >flect'
6253 if $contains "/dev/fd" flect >/dev/null; then
6254 echo "Okay, it looks like setuid scripts are secure." >&4
6257 echo "I don't think setuid scripts are secure." >&4
6262 rp='Does your kernel have *secure* setuid scripts?'
6265 [yY]*) val="$define";;
6270 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
6271 echo "(That's for file descriptors, not floppy disks.)"
6277 $rm -f reflect flect
6279 : now see if they want to do setuid emulation
6282 case "$d_suidsafe" in
6285 echo "No need to emulate SUID scripts since they are secure here." >&4
6289 Some systems have disabled setuid scripts, especially systems where
6290 setuid scripts cannot be secure. On systems where setuid scripts have
6291 been disabled, the setuid/setgid bits on scripts are currently
6292 useless. It is possible for $package to detect those bits and emulate
6293 setuid/setgid in a secure fashion. This emulation will only work if
6294 setuid scripts have been disabled in your kernel.
6298 "$define") dflt=y ;;
6301 rp="Do you want to do setuid/setgid emulation?"
6304 [yY]*) val="$define";;
6312 : Find perl5.005 or later.
6313 echo "Looking for a previously installed perl5.005 or later... "
6315 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
6316 : Check if this perl is recent and can load a simple module
6317 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6320 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6330 '') echo "None found. That's ok.";;
6331 *) echo "Using $perl5." ;;
6336 After $package is installed, you may wish to install various
6337 add-on modules and utilities. Typically, these add-ons will
6338 be installed under $prefix with the rest
6339 of this package. However, you may wish to install such add-ons
6340 elsewhere under a different prefix.
6342 If you do not wish to put everything under a single prefix, that's
6343 ok. You will be prompted for the individual locations; this siteprefix
6344 is only used to suggest the defaults.
6346 The default should be fine for most people.
6350 rp='Installation prefix to use for add-on modules and utilities?'
6351 : XXX Here might be another good place for an installstyle setting.
6352 case "$siteprefix" in
6354 *) dflt=$siteprefix ;;
6357 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6359 case "$siteprefix" in
6363 *) oldsiteprefix="$prefix";;
6368 siteprefixexp="$ansexp"
6370 : determine where site specific libraries go.
6371 : Usual default is /usr/local/lib/perl5/site_perl/$version
6372 : The default "style" setting is made in installstyle.U
6373 : XXX No longer works with Prefixit stuff.
6374 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6376 '') case "$installstyle" in
6377 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
6378 *) dflt=$siteprefix/lib/site_$prog/$version ;;
6386 The installation process will create a directory for
6387 site-specific extensions and modules. Most users find it convenient
6388 to place all site-specific files in this directory rather than in the
6389 main distribution directory.
6393 rp='Pathname for the site-specific library files?'
6397 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6399 : Determine list of previous versions to include in @INC
6400 $cat > getverlist <<EOPL
6403 \$api_versionstring = "$api_versionstring";
6404 \$version = "$version";
6405 \$stem = "$sitelib_stem";
6406 \$archname = "$archname";
6408 $cat >> getverlist <<'EOPL'
6409 # The list found is store twice for each entry: the original name, and
6410 # the binary broken down version as pack "sss", so sorting is easy and
6411 # unambiguous. This will work for all versions that have a maximum of
6412 # three digit groups, separate by '.'s or '_'s. Names are extended with
6413 # ".0.0" to ensure at least three elements for the pack.
6414 # -- H.Merijn Brand (m)'06 23-10-2006
6416 # Can't have leading @ because metaconfig interprets it as a command!
6417 ;@inc_version_list=();
6418 # XXX Redo to do opendir/readdir?
6421 ;@candidates = map {
6422 [ $_, pack "sss", split m/[._]/, "$_.0.0" ] } glob("5.*");
6428 ($pversion, $aversion, $vsn5005) = map {
6429 pack "sss", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005";
6430 foreach $d (@candidates) {
6431 if ($d->[1] lt $pversion) {
6432 if ($d->[1] ge $aversion) {
6433 unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]);
6435 elsif ($d->[1] ge $vsn5005) {
6436 unshift(@inc_version_list, grep { -d } $d->[0]);
6440 # Skip newer version. I.e. don't look in
6441 # 5.7.0 if we're installing 5.6.1.
6445 if (@inc_version_list) {
6446 print join(' ', @inc_version_list);
6449 # Blank space to preserve value for next Configure run.
6454 case "$inc_version_list" in
6455 '') if test -x "$perl5$exe_ext"; then
6456 dflt=`$perl5 getverlist`
6461 $undef) dflt='none' ;;
6462 *) eval dflt=\"$inc_version_list\" ;;
6465 ''|' ') dflt=none ;;
6472 In order to ease the process of upgrading, this version of perl
6473 can be configured to use modules built and installed with earlier
6474 versions of perl that were installed under $prefix. Specify here
6475 the list of earlier versions that this version of perl should check.
6476 If Configure detected no earlier versions of perl installed under
6477 $prefix, then the list will be empty. Answer 'none' to tell perl
6478 to not search earlier versions.
6480 The default should almost always be sensible, so if you're not sure,
6481 just accept the default.
6484 rp='List of earlier versions to include in @INC?'
6487 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
6488 *) inc_version_list="$ans" ;;
6490 case "$inc_version_list" in
6492 inc_version_list_init='0'
6493 d_inc_version_list="$undef"
6495 *) inc_version_list_init=`echo $inc_version_list |
6496 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
6497 d_inc_version_list="$define"
6502 : see if this is a malloc.h system
6503 : we want a real compile instead of Inhdr because some systems have a
6504 : malloc.h that just gives a compile error saying to use stdlib.h instead
6509 int main () { return 0; }
6512 if eval $compile; then
6513 echo "<malloc.h> found." >&4
6516 echo "<malloc.h> NOT found." >&4
6523 : check for void type
6525 echo "Checking to see how well your C compiler groks the void type..." >&4
6526 case "$voidflags" in
6538 extern void moo(); /* function returning void */
6539 void (*goo)(); /* ptr to func returning void */
6541 void *hue; /* generic ptr */
6554 int main() { sub(); }
6556 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
6557 voidflags=$defvoidused
6558 echo "Good. It appears to support void to the level $package wants.">&4
6559 if $contains warning .out >/dev/null 2>&1; then
6560 echo "However, you might get some warnings that look like this:"
6564 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
6565 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
6566 echo "It supports 1..."
6567 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
6568 echo "It also supports 2..."
6569 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
6571 echo "And it supports 4 but not 8 definitely."
6573 echo "It doesn't support 4..."
6574 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
6576 echo "But it supports 8."
6579 echo "Neither does it support 8."
6583 echo "It does not support 2..."
6584 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
6586 echo "But it supports 4 and 8."
6588 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
6590 echo "And it supports 4 but has not heard about 8."
6592 echo "However it supports 8 but not 4."
6597 echo "There is no support at all for void."
6602 case "$voidflags" in
6605 Support flag bits are:
6606 1: basic void declarations.
6607 2: arrays of pointers to functions returning void.
6608 4: operations between pointers to and addresses of void functions.
6609 8: generic void pointers.
6612 rp="Your void support flags add up to what?"
6619 : check for length of pointer
6623 echo "Checking to see how big your pointers are..." >&4
6624 if test "$voidflags" -gt 7; then
6625 echo '#define VOID_PTR char *' > try.c
6627 echo '#define VOID_PTR void *' > try.c
6637 printf("%d\n", (int)sizeof(VOID_PTR));
6642 if eval $compile_ok; then
6643 ptrsize=`$run ./try`
6644 echo "Your pointers are $ptrsize bytes long."
6647 echo "(I can't seem to compile the test program. Guessing...)" >&4
6648 rp="What is the size of a pointer (in bytes)?"
6655 case "$use64bitall" in
6656 "$define"|true|[yY]*)
6660 *** You have chosen a maximally 64-bit build,
6661 *** but your pointers are only 4 bytes wide.
6662 *** Please rerun Configure without -Duse64bitall.
6667 *** Since you have quads, you could possibly try with -Duse64bitint.
6672 *** Cannot continue, aborting.
6683 : determine whether to use malloc wrapping
6685 case "$usemallocwrap" in
6686 [yY]*|true|$define) dflt='y' ;;
6687 [nN]*|false|$undef) dflt='n' ;;
6688 *) case "$usedevel" in
6689 [yY]*|true|$define) dflt='y' ;;
6694 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
6696 usemallocwrap="$ans"
6699 usemallocwrap="$define" ;;
6701 usemallocwrap="$undef" ;;
6704 : determine which malloc to compile in
6706 case "$usemymalloc" in
6707 [yY]*|true|$define) dflt='y' ;;
6708 [nN]*|false|$undef) dflt='n' ;;
6709 *) case "$ptrsize" in
6715 rp="Do you wish to attempt to use the malloc that comes with $package?"
6721 mallocsrc='malloc.c'
6722 mallocobj="malloc$_o"
6723 d_mymalloc="$define"
6726 : Remove malloc from list of libraries to use
6727 echo "Removing unneeded -lmalloc from library list" >&4
6728 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
6731 echo "libs = $libs" >&4
6743 : compute the return types of malloc and free
6745 $cat >malloc.c <<END
6749 #include <sys/types.h>
6763 case "$malloctype" in
6765 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
6772 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
6776 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
6783 echo "Your system uses $freetype free(), it would seem." >&4
6785 : determine where site specific architecture-dependent libraries go.
6786 : sitelib default is /usr/local/lib/perl5/site_perl/$version
6787 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6788 : sitelib may have an optional trailing /share.
6790 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
6791 dflt="$dflt/$archname"
6796 set sitearch sitearch none
6800 The installation process will also create a directory for
6801 architecture-dependent site-specific extensions and modules.
6805 rp='Pathname for the site-specific architecture-dependent library files?'
6809 if $test X"$sitearch" = X"$sitelib"; then
6812 d_sitearch="$define"
6817 The installation process will also create a directory for
6818 vendor-supplied add-ons. Vendors who supply perl with their system
6819 may find it convenient to place all vendor-supplied files in this
6820 directory rather than in the main distribution directory. This will
6821 ease upgrades between binary-compatible maintenance versions of perl.
6823 Of course you may also use these directories in whatever way you see
6824 fit. For example, you might use them to access modules shared over a
6825 company-wide network.
6827 The default answer should be fine for most people.
6828 This causes further questions about vendor add-ons to be skipped
6829 and no vendor-specific directories will be configured for perl.
6832 rp='Do you want to configure vendor-specific add-on directories?'
6833 case "$usevendorprefix" in
6834 define|true|[yY]*) dflt=y ;;
6835 *) : User may have set vendorprefix directly on Configure command line.
6836 case "$vendorprefix" in
6845 rp='Installation prefix to use for vendor-supplied add-ons?'
6846 case "$vendorprefix" in
6848 *) dflt=$vendorprefix ;;
6851 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6853 case "$vendorprefix" in
6857 *) oldvendorprefix="$prefix";;
6861 usevendorprefix="$define"
6863 vendorprefixexp="$ansexp"
6865 *) usevendorprefix="$undef"
6871 case "$vendorprefix" in
6872 '') d_vendorlib="$undef"
6876 *) d_vendorlib="$define"
6877 : determine where vendor-supplied modules go.
6878 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
6879 case "$vendorlib" in
6881 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6882 case "$installstyle" in
6883 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
6884 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
6887 *) dflt="$vendorlib"
6891 rp='Pathname for the vendor-supplied library files?'
6894 vendorlibexp="$ansexp"
6897 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
6901 case "$vendorprefix" in
6902 '') d_vendorarch="$undef"
6906 *) d_vendorarch="$define"
6907 : determine where vendor-supplied architecture-dependent libraries go.
6908 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
6909 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
6910 : vendorlib may have an optional trailing /share.
6911 case "$vendorarch" in
6912 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
6913 dflt="$dflt/$archname"
6915 *) dflt="$vendorarch" ;;
6918 rp='Pathname for vendor-supplied architecture-dependent files?'
6921 vendorarchexp="$ansexp"
6924 prefixvar=vendorarch
6927 : Final catch-all directories to search
6930 Lastly, you can have perl look in other directories for extensions and
6931 modules in addition to those already specified.
6932 These directories will be searched after
6936 test X"$vendorlib" != "X" && echo ' ' $vendorlib
6937 test X"$vendorarch" != "X" && echo ' ' $vendorarch
6939 case "$otherlibdirs" in
6940 ''|' ') dflt='none' ;;
6941 *) dflt="$otherlibdirs" ;;
6944 Enter a colon-separated set of extra paths to include in perl's @INC
6945 search path, or enter 'none' for no extra paths.
6949 rp='Colon-separated list of additional directories for perl to search?'
6952 ' '|''|none) otherlibdirs=' ' ;;
6953 *) otherlibdirs="$ans" ;;
6955 case "$otherlibdirs" in
6959 set d_perl_otherlibdirs
6962 : Cruising for prototypes
6964 echo "Checking out function prototypes..." >&4
6965 $cat >prototype.c <<EOCP
6970 int main(int argc, char *argv[]) {
6973 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
6974 echo "Your C compiler appears to support function prototypes."
6977 echo "Your C compiler doesn't seem to understand function prototypes."
6984 case "$prototype" in
6986 *) ansi2knr='ansi2knr'
6991 This version of $package can only be compiled by a compiler that
6992 understands function prototypes. Unfortunately, your C compiler
6994 doesn't seem to understand them. Sorry about that.
6996 If GNU cc is available for your system, perhaps you could try that instead.
6998 Eventually, we hope to support building Perl with pre-ANSI compilers.
6999 If you would like to help in that effort, please contact <perlbug@perl.org>.
7001 Aborting Configure now.
7013 Perl can be built with extra modules or bundles of modules which
7014 will be fetched from the CPAN and installed alongside Perl.
7016 Notice that you will need access to the CPAN; either via the Internet,
7017 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
7018 be asked later to configure the CPAN.pm module which will in turn do
7019 the installation of the rest of the extra modules or bundles.)
7021 Notice also that if the modules require any external software such as
7022 libraries and headers (the libz library and the zlib.h header for the
7023 Compress::Zlib module, for example) you MUST have any such software
7024 already installed, this configuration process will NOT install such
7027 If this doesn't make any sense to you, just accept the default '$dflt'.
7029 rp='Install any extra modules (y or n)?'
7035 Please list any extra modules or bundles to be installed from CPAN,
7036 with spaces between the names. The names can be in any format the
7037 'install' command of CPAN.pm will understand. (Answer 'none',
7038 without the quotes, to install no extra modules or bundles.)
7048 $rm -f ../extras.lst
7050 *) echo "(Saving the list of extras for later...)"
7051 echo "$extras" > ../extras.lst
7059 : determine where html pages for programs go
7060 set html1dir html1dir none
7064 If you wish to install html files for programs in $spackage, indicate
7065 the appropriate directory here. To skip installing html files,
7069 ''|none|$undef|' ') dflt=none ;;
7070 *) dflt=$html1dir ;;
7073 rp="Directory for the main $spackage html pages?"
7077 : Use ' ' for none so value is preserved next time through Configure
7078 $test X"$html1dir" = "X" && html1dir=' '
7080 : determine where html pages for libraries and modules go
7081 set html3dir html3dir none
7085 If you wish to install html files for modules associated with $spackage,
7086 indicate the appropriate directory here. To skip installing html files,
7089 : There is no obvious default. If they have specified html1dir, then
7090 : try to key off that, possibly changing .../html1 into .../html3.
7092 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
7093 *) dflt=$html3dir ;;
7096 rp="Directory for the $spackage module html pages?"
7100 : Use ' ' for none so value is preserved next time through Configure
7101 $test X"$html3dir" = "X" && html3dir=' '
7103 : determine whether to install perl also as /usr/bin/perl
7106 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
7108 Many scripts expect perl to be installed as /usr/bin/perl.
7110 If you want to, I can install the perl you are about to compile
7111 as /usr/bin/perl (in addition to $bin/perl).
7113 if test -f /usr/bin/perl; then
7116 However, please note that because you already have a /usr/bin/perl,
7117 overwriting that with a new Perl would very probably cause problems.
7118 Therefore I'm assuming you don't want to do that (unless you insist).
7121 case "$installusrbinperl" in
7122 "$define"|[yY]*) dflt='y';;
7128 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
7131 case "$installusrbinperl" in
7132 "$undef"|[nN]*) dflt='n';;
7136 rp="Do you want to install perl as /usr/bin/perl?"
7139 [yY]*) val="$define";;
7145 set installusrbinperl
7149 echo "Checking for GNU C Library..." >&4
7151 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
7152 alone are insufficient to distinguish different versions, such as
7153 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
7154 libc version 2.1.0. A. Dougherty, June 3, 2002.
7160 # ifdef __GLIBC_MINOR__
7161 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus)
7162 # include <gnu/libc-version.h>
7163 printf("%s\n", gnu_get_libc_version());
7165 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
7168 printf("%d\n", __GLIBC__);
7177 if eval $compile_ok && $run ./try > glibc.ver; then
7179 gnulibc_version=`$cat glibc.ver`
7180 echo "You are using the GNU C Library version $gnulibc_version"
7184 echo "You are not using the GNU C Library"
7186 $rm -f try try.* glibc.ver
7190 : see if nm is to be used to determine whether a symbol is defined or not
7194 case "$d_gnulibc" in
7197 echo "nm probably won't work on the GNU C Library." >&4
7203 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
7205 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
7206 echo "'nm' won't be sufficient on this sytem." >&4
7212 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
7213 if $test $dflt -gt 20; then
7223 true|$define) dflt=y;;
7230 I can use $nm to extract the symbols from your C libraries. This
7231 is a time consuming task which may generate huge output on the disk (up
7232 to 3 megabytes) but that should make the symbols extraction faster. The
7233 alternative is to skip the 'nm' extraction part and to compile a small
7234 test program instead to determine whether each symbol is present. If
7235 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
7236 this may be the best solution.
7238 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
7241 rp="Shall I use $nm to extract C symbols from the libraries?"
7244 [Nn]*) usenm=false;;
7253 : nm options which may be necessary
7255 '') if $test -f /mach_boot; then
7257 elif $test -d /usr/ccs/lib; then
7258 nm_opt='-p' # Solaris (and SunOS?)
7259 elif $test -f /dgux; then
7261 elif $test -f /lib64/rld; then
7262 nm_opt='-p' # 64-bit Irix
7268 : nm options which may be necessary for shared libraries but illegal
7269 : for archive libraries. Thank you, Linux.
7270 case "$nm_so_opt" in
7271 '') case "$myuname" in
7273 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
7274 nm_so_opt='--dynamic'
7283 : get list of predefined functions in a handy place
7288 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
7294 *) for thislib in $libs; do
7297 : Handle C library specially below.
7300 thislib=`echo $thislib | $sed -e 's/^-l//'`
7301 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
7303 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
7305 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
7307 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
7309 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
7311 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
7313 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
7318 libnames="$libnames $try"
7320 *) libnames="$libnames $thislib" ;;
7329 for xxx in $libpth; do
7330 $test -r $1 || set $xxx/libc.$so
7331 : The messy sed command sorts on library version numbers.
7333 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
7334 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
7336 s/[0-9][0-9]*/0000&/g
7337 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
7340 $sort | $sed -e 's/^.* //'`
7343 $test -r $1 || set /usr/ccs/lib/libc.$so
7344 $test -r $1 || set /lib/libsys_s$_a
7350 if $test -r "$1"; then
7351 echo "Your (shared) C library seems to be in $1."
7353 elif $test -r /lib/libc && $test -r /lib/clib; then
7354 echo "Your C library seems to be in both /lib/clib and /lib/libc."
7356 libc='/lib/clib /lib/libc'
7357 if $test -r /lib/syslib; then
7358 echo "(Your math library is in /lib/syslib.)"
7359 libc="$libc /lib/syslib"
7361 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7362 echo "Your C library seems to be in $libc, as you said before."
7363 elif $test -r $incpath/usr/lib/libc$_a; then
7364 libc=$incpath/usr/lib/libc$_a;
7365 echo "Your C library seems to be in $libc. That's fine."
7366 elif $test -r /lib/libc$_a; then
7368 echo "Your C library seems to be in $libc. You're normal."
7370 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
7372 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
7373 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
7374 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
7376 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7378 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7381 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
7383 if $test -r "$tans"; then
7384 echo "Your C library seems to be in $tans, of all places."
7390 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7394 If the guess above is wrong (which it might be if you're using a strange
7395 compiler, or your machine supports multiple models), you can override it here.
7400 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
7402 I can't seem to find your C library. I've looked in the following places:
7405 $sed 's/^/ /' libpath
7408 None of these seems to contain your C library. I need to get its name...
7413 rp='Where is your C library?'
7418 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
7419 set X `cat libnames`
7422 case $# in 1) xxx=file; esac
7423 echo "Extracting names from the following $xxx for later perusal:" >&4
7425 $sed 's/^/ /' libnames >&4
7427 $echo $n "This may take a while...$c" >&4
7431 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
7432 *) $nm $nm_opt $file 2>/dev/null;;
7437 $grep fprintf libc.tmp > libc.ptf
7438 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
7439 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
7441 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
7443 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7445 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
7447 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7449 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
7451 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7453 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
7455 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7457 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
7459 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7461 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
7463 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7465 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
7466 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
7468 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7470 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
7472 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7474 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
7476 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7478 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
7480 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7482 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
7484 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7486 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
7488 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7490 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
7492 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7494 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
7496 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7499 $nm -p $* 2>/dev/null >libc.tmp
7500 $grep fprintf libc.tmp > libc.ptf
7501 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
7502 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
7508 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
7510 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
7511 for thisname in $libnames $libc; do
7512 $ar t $thisname >>libc.tmp
7514 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
7516 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
7517 # Repeat libc to extract forwarders to DLL entries too
7518 for thisname in $libnames $libc; do
7519 $ar tv $thisname >>libc.tmp
7520 # Revision 50 of EMX has bug in $ar.
7521 # it will not extract forwarders to DLL entries
7522 # Use emximp which will extract exactly them.
7523 emximp -o tmp.imp $thisname \
7525 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
7526 < tmp.imp >>libc.tmp
7529 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
7532 echo "$ar didn't seem to work right." >&4
7533 echo "Maybe this is a Cray...trying bld instead..." >&4
7534 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
7536 for thisname in $libnames; do
7538 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
7539 $ar t $thisname >>libc.tmp
7543 echo "That didn't work either. Giving up." >&4
7553 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
7554 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
7556 *) if $test -f /lib/syscalls.exp; then
7558 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
7559 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' /lib/syscalls.exp >>libc.list
7565 $rm -f libnames libpath
7567 : see if dld is available
7571 : is a C symbol defined?
7574 -v) tf=libc.tmp; tdc="";;
7575 -a) tf=libc.tmp; tdc="[]";;
7576 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
7579 case "$reuseval-$4" in
7581 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
7586 if $test "$runnm" = true; then
7587 if $contains $tlook $tf >/dev/null 2>&1; then
7589 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
7590 echo "void *(*(p()))$tdc { extern void *$1$tdc; return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7591 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
7592 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
7593 $rm -f try$_exe try.c core core.* try.core;
7596 echo "void *(*(p()))$tdc { extern void *$1$tdc; return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7597 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
7598 $rm -f try$_exe try.c;
7603 $define) tval=true;;
7610 : define an is-in-libc? function
7611 inlibc='echo " "; td=$define; tu=$undef;
7612 sym=$1; var=$2; eval "was=\$$2";
7614 case "$reuseval$was" in
7624 echo "$sym() found." >&4;
7625 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
7627 echo "$sym() NOT found." >&4;
7628 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
7632 $define) echo "$sym() found." >&4;;
7633 *) echo "$sym() NOT found." >&4;;
7639 echo "Checking for C++..." >&4
7653 if eval $compile_ok && $run ./try >cplusplus$$; then
7654 val=`$cat cplusplus$$`
7655 echo "You are using a C++ compiler."
7658 echo "You are not using a C++ compiler."
7660 $rm -f try try.* cplusplus$$
7664 : see if dlopen exists
7666 xxx_ccflags="$ccflags"
7668 : with g++ one needs -shared to get is-in-libc to work for dlopen
7669 case "$gccversion" in
7671 *) case "$d_cplusplus" in
7672 "$define") ccflags="$ccflags -shared" ;;
7679 ccflags="$xxx_ccflags"
7681 : see if this is a unistd.h system
7682 set unistd.h i_unistd
7685 : determine which dynamic loading, if any, to compile in
7687 dldir="ext/DynaLoader"
7700 $define) dflt='y' ;;
7703 $define) dflt='y' ;;
7705 : Does a dl_xxx.xs file exist for this operating system
7706 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
7709 rp="Do you wish to use dynamic loading?"
7716 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
7717 dflt="$dldir/dl_${osname}.xs"
7718 elif $test "$d_dlopen" = "$define" ; then
7719 dflt="$dldir/dl_dlopen.xs"
7720 elif $test "$i_dld" = "$define" ; then
7721 dflt="$dldir/dl_dld.xs"
7726 *) dflt="$dldir/$dlsrc"
7729 echo "The following dynamic loading files are available:"
7730 : Can not go over to $dldir because getfile has path hard-coded in.
7731 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
7732 rp="Source file to use for dynamic loading"
7738 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
7742 Some systems may require passing special flags to $cc -c to
7743 compile modules that will be used to create a shared library.
7744 To use no flags, say "none".
7747 case "$cccdlflags" in
7748 '') case "$gccversion" in
7749 '') case "$osname" in
7751 next) dflt='none' ;;
7752 irix*) dflt='-KPIC' ;;
7753 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
7754 sunos) dflt='-pic' ;;
7758 *) case "$osname" in
7759 darwin) dflt='none' ;;
7760 svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
7765 *) dflt="$cccdlflags" ;;
7767 rp="Any special flags to pass to $cc -c to compile shared library modules?"
7770 none) cccdlflags=' ' ;;
7771 *) cccdlflags="$ans" ;;
7776 Some systems use ld to create libraries that can be dynamically loaded,
7777 while other systems (such as those using ELF) use $cc.
7781 '') $cat >try.c <<EOM
7782 /* Test for whether ELF binaries are produced */
7794 int i = open("a.out",O_RDONLY);
7797 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
7798 exit(0); /* succeed (yes, it's ELF) */
7803 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
7805 You appear to have ELF support. I'll use $cc to build dynamic libraries.
7809 echo "I'll use ld to build dynamic libraries."
7818 rp="What command should be used to create dynamic libraries?"
7824 Some systems may require passing special flags to $ld to create a
7825 library that can be dynamically loaded. If your ld flags include
7826 -L/other/path options to locate libraries outside your loader's normal
7827 search path, you may need to specify those -L options here as well. To
7828 use no flags, say "none".
7831 case "$lddlflags" in
7832 '') case "$osname" in
7833 beos) dflt='-nostart' ;;
7835 case "$gccversion" in
7836 '') dflt="$dflt +vnocompatwarnings" ;;
7839 linux|irix*|gnu*) dflt='-shared' ;;
7840 next) dflt='none' ;;
7841 solaris) dflt='-G' ;;
7842 sunos) dflt='-assert nodefinitions' ;;
7843 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
7847 *) dflt="$lddlflags" ;;
7850 : Try to guess additional flags to pick up local libraries.
7851 : Be careful not to append to a plain 'none'
7855 for thisflag in $ldflags; do
7860 *) dflt="$dflt $thisflag" ;;
7867 ''|' ') dflt='none' ;;
7870 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
7873 none) lddlflags=' ' ;;
7874 *) lddlflags="$ans" ;;
7879 Some systems may require passing special flags to $cc to indicate that
7880 the resulting executable will use dynamic linking. To use no flags,
7884 case "$ccdlflags" in
7885 '') case "$osname" in
7886 linux|hpux|gnu*) dflt='-Wl,-E' ;;
7887 next|sunos) dflt='none' ;;
7891 *) dflt="$ccdlflags" ;;
7893 rp="Any special flags to pass to $cc to use dynamic linking?"
7896 none) ccdlflags=' ' ;;
7897 *) ccdlflags="$ans" ;;
7911 # No dynamic loading being used, so don't bother even to prompt.
7914 *) case "$useshrplib" in
7915 '') case "$osname" in
7916 svr4*|nonstopux|dgux|dynixptx|esix|powerux|beos|cygwin*)
7918 also='Building a shared libperl is required for dynamic loading to work on your system.'
7923 also='Building a shared libperl is needed for MAB support.'
7941 The perl executable is normally obtained by linking perlmain.c with
7942 libperl${_a}, any static extensions (usually just DynaLoader), and
7943 any other libraries needed on this system (such as -lm, etc.). Since
7944 your system supports dynamic loading, it is probably possible to build
7945 a shared libperl.$so. If you will have more than one executable linked
7946 to libperl.$so, this will significantly reduce the size of each
7947 executable, but it may have a noticeable effect on performance. The
7948 default is probably sensible for your system.
7952 rp="Build a shared libperl.$so (y/n)"
7956 useshrplib='true' ;;
7957 *) useshrplib='false' ;;
7962 case "$useshrplib" in
7966 # Figure out a good name for libperl.so. Since it gets stored in
7967 # a version-specific architecture-dependent library, the version
7968 # number isn't really that important, except for making cc/ld happy.
7970 # A name such as libperl.so.3.1
7971 majmin="libperl.$so.$patchlevel.$subversion"
7972 # A name such as libperl.so.301
7973 majonly=`echo $patchlevel $subversion |
7974 $awk '{printf "%d%02d", $1, $2}'`
7975 majonly=libperl.$so.$majonly
7976 # I'd prefer to keep the os-specific stuff here to a minimum, and
7977 # rely on figuring it out from the naming of libc.
7978 case "${osname}${osvers}" in
7981 # XXX How handle the --version stuff for MAB?
7983 linux*|gnu*) # ld won't link with a bare -lperl otherwise.
7986 cygwin*) # ld links against an importlib
7987 dflt=libperl$lib_ext
7989 *) # Try to guess based on whether libc has major.minor.
7991 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
7992 *libc.$so.[0-9]*) dflt=$majonly ;;
7993 *) dflt=libperl.$so ;;
8003 I need to select a good name for the shared libperl. If your system uses
8004 library names with major and minor numbers, then you might want something
8005 like $majmin. Alternatively, if your system uses a single version
8006 number for shared libraries, then you might want to use $majonly.
8007 Or, your system might be quite happy with a simple libperl.$so.
8009 Since the shared libperl will get installed into a version-specific
8010 architecture-dependent directory, the version number of the shared perl
8011 library probably isn't important, so the default should be o.k.
8014 rp='What name do you want to give to the shared libperl?'
8017 echo "Ok, I'll use $libperl"
8020 libperl="libperl${_a}"
8024 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
8028 WARNING: Use of the shrpdir variable for the installation location of
8029 the shared $libperl is not supported. It was never documented and
8030 will not work in this version. Let me (perlbug@perl.org)
8031 know of any problems this may cause.
8037 But your current setting of $shrpdir is
8038 the default anyway, so it's harmless.
8043 Further, your current attempted setting of $shrpdir
8044 conflicts with the value of $archlibexp/CORE
8045 that installperl will use.
8052 # How will the perl executable find the installed shared $libperl?
8053 # Add $xxx to ccdlflags.
8054 # If we can't figure out a command-line option, use $shrpenv to
8055 # set env LD_RUN_PATH. The main perl makefile uses this.
8056 shrpdir=$archlibexp/CORE
8059 if "$useshrplib"; then
8062 # We'll set it in Makefile.SH...
8067 freebsd|netbsd|openbsd|interix|dragonfly)
8068 xxx="-Wl,-R$shrpdir"
8070 bsdos|linux|irix*|dec_osf|gnu*)
8071 xxx="-Wl,-rpath,$shrpdir"
8074 # next doesn't like the default...
8077 # beos doesn't like the default, either.
8080 # hpux doesn't like the default, either.
8081 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
8084 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
8090 # Only add $xxx if it isn't already in ccdlflags.
8091 case " $ccdlflags " in
8093 *) ccdlflags="$ccdlflags $xxx"
8096 Adding $xxx to the flags
8097 passed to $ld so that the perl executable will find the
8098 installed shared $libperl.
8106 # Fix ccdlflags in AIX for building external extensions.
8107 # (For building Perl itself bare -bE:perl.exp is needed,
8108 # Makefile.SH takes care of this.)
8110 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8112 # Respect a hint or command-line value.
8114 '') shrpenv="$tmp_shrpenv" ;;
8116 case "$ldlibpthname" in
8117 '') ldlibpthname=LD_LIBRARY_PATH ;;
8118 none) ldlibpthname='' ;;
8121 : determine where manual pages are on this system
8125 syspath='/usr/share/man/man1 /usr/man/man1'
8126 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8127 syspath="$syspath /usr/man/u_man/man1"
8128 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8129 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8130 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8131 sysman=`./loc . /usr/man/man1 $syspath`
8134 if $test -d "$sysman"; then
8135 echo "System manual is in $sysman." >&4
8137 echo "Could not find manual pages in source form." >&4
8140 : determine where manual pages go
8141 set man1dir man1dir none
8145 $spackage has manual pages available in source form.
8149 echo "However, you don't have nroff, so they're probably useless to you."
8151 '') man1dir="none";;
8154 echo "If you don't want the manual sources installed, answer 'none'."
8159 lookpath="$prefixexp/share/man/man1"
8160 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8161 lookpath="$lookpath $prefixexp/man/p_man/man1"
8162 lookpath="$lookpath $prefixexp/man/u_man/man1"
8163 lookpath="$lookpath $prefixexp/man/man.1"
8165 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8166 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8176 rp="Where do the main $spackage manual pages (source) go?"
8178 if $test "X$man1direxp" != "X$ansexp"; then
8189 : What suffix to use on installed man pages
8196 rp="What suffix should be used for the main $spackage man pages?"
8198 '') case "$man1dir" in
8212 *) dflt="$man1ext";;
8219 : see if we can have long filenames
8221 first=123456789abcdef
8223 if (echo hi >$first) 2>/dev/null; then
8224 if $test -f 123456789abcde; then
8225 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8228 echo 'You can have filenames longer than 14 characters.'>&4
8233 You can't have filenames longer than 14 chars.
8234 You can't even think about them!
8240 $rm -rf 123456789abcde*
8242 : determine where library module manual pages go
8243 set man3dir man3dir none
8247 $spackage has manual pages for many of the library modules.
8253 However, you don't have nroff, so they're probably useless to you.
8256 '') man3dir="none";;
8260 case "$d_flexfnam" in
8263 However, your system can't handle the long file names like File::Basename.3.
8266 '') man3dir="none";;
8270 echo "If you don't want the manual sources installed, answer 'none'."
8271 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8273 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
8274 if $test -d "$privlib/man/man3"; then
8277 WARNING: Previous versions of perl installed man3 pages into
8278 $privlib/man/man3. This version will suggest a
8279 new default of $dflt.
8283 rp='Do you wish to preserve the old behavior?(y/n)'
8286 y*) dflt="$privlib/man/man3" ;;
8291 *) dflt="$man3dir" ;;
8298 rp="Where do the $package library man pages (source) go?"
8308 : What suffix to use on installed man pages
8314 rp="What suffix should be used for the $package library man pages?"
8316 '') case "$man3dir" in
8330 *) dflt="$man3ext";;
8337 : see if we have to deal with yellow pages, now NIS.
8338 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
8339 if $test -f /usr/etc/nibindd; then
8341 echo "I'm fairly confident you're on a NeXT."
8343 rp='Do you get the hosts file via NetInfo?'
8352 y*) hostcat='nidump hosts .';;
8353 *) case "$hostcat" in
8354 nidump*) hostcat='';;
8364 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
8372 rp='Are you getting the hosts file via yellow pages?'
8375 y*) hostcat='ypcat hosts';;
8376 *) hostcat='cat /etc/hosts';;
8382 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
8385 '') test -f /etc/group && groupcat='cat /etc/group';;
8388 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
8391 : now get the host name
8393 echo "Figuring out host name..." >&4
8394 case "$myhostname" in
8396 echo 'Maybe "hostname" will work...'
8397 if tans=`sh -c hostname 2>&1` ; then
8405 if $test "$cont"; then
8407 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
8408 if tans=`cat /etc/systemid 2>&1` ; then
8410 phostname='cat /etc/systemid'
8411 echo "Whadyaknow. Xenix always was a bit strange..."
8414 elif $test -r /etc/systemid; then
8415 echo "(What is a non-Xenix system doing with /etc/systemid?)"
8418 if $test "$cont"; then
8419 echo 'No, maybe "uuname -l" will work...'
8420 if tans=`sh -c 'uuname -l' 2>&1` ; then
8422 phostname='uuname -l'
8424 echo 'Strange. Maybe "uname -n" will work...'
8425 if tans=`sh -c 'uname -n' 2>&1` ; then
8427 phostname='uname -n'
8429 echo 'Oh well, maybe I can mine it out of whoami.h...'
8430 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
8431 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
8432 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
8434 case "$myhostname" in
8435 '') echo "Does this machine have an identity crisis or something?"
8438 echo "Well, you said $myhostname before..."
8439 phostname='echo $myhostname';;
8445 case "$myhostname" in
8446 '') myhostname=noname ;;
8448 : you do not want to know about this
8453 if $test "$myhostname" ; then
8455 rp='Your host name appears to be "'$myhostname'".'" Right?"
8463 : bad guess or no guess
8464 while $test "X$myhostname" = X ; do
8466 rp="Please type the (one word) name of your host:"
8471 : translate upper to lower if necessary
8472 case "$myhostname" in
8474 echo "(Normalizing case in your host name)"
8475 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
8479 case "$myhostname" in
8481 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
8482 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
8483 echo "(Trimming domain name from host name--host name is now $myhostname)"
8485 *) case "$mydomain" in
8488 test "X$hostcat" = "Xypcat hosts" &&
8489 ypmatch "$myhostname" hosts 2>/dev/null |\
8490 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
8493 test "X$hostcat" != "X" &&
8494 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
8495 /[ ]$myhostname[ . ]/p" > hosts
8498 if $test -f hosts; then
8499 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
8500 END { print sum }" hosts` = x1 || tmp_re="[ ]"
8501 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
8502 hosts | $sort | $uniq | \
8503 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
8504 case `$echo X$dflt` in
8505 X*\ *) echo "(Several hosts in the database matched hostname)"
8508 X.) echo "(You do not have fully-qualified names in the hosts database)"
8512 echo "(I cannot locate a hosts database anywhere)"
8517 tans=`./loc resolv.conf X /etc /usr/etc`
8518 if $test -f "$tans"; then
8519 echo "(Attempting domain name extraction from $tans)"
8520 dflt=.`$sed -n -e 's/ / /g' \
8521 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
8522 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8524 .) dflt=.`$sed -n -e 's/ / /g' \
8525 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
8526 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8533 .) echo "(No help from resolv.conf either -- attempting clever guess)"
8534 dflt=.`sh -c domainname 2>/dev/null`
8537 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
8541 case "$dflt$osname" in
8542 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
8543 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
8547 .) echo "(Lost all hope -- silly guess then)"
8553 *) dflt="$mydomain";;
8557 rp="What is your domain name?"
8567 : translate upper to lower if necessary
8570 echo "(Normalizing case in your domain name)"
8571 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
8575 : a little sanity check here
8576 case "$phostname" in
8579 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
8580 $myhostname$mydomain|$myhostname) ;;
8582 case "$phostname" in
8584 echo "(That doesn't agree with your whoami.h file, by the way.)"
8587 echo "(That doesn't agree with your $phostname command, by the way.)"
8597 I need to get your e-mail address in Internet format if possible, i.e.
8598 something like user@host.domain. Please answer accurately since I have
8599 no easy means to double check it. The default value provided below
8600 is most probably close to reality but may not be valid from outside
8601 your organization...
8605 while test "$cont"; do
8607 '') dflt="$cf_by@$myhostname$mydomain";;
8608 *) dflt="$cf_email";;
8610 rp='What is your e-mail address?'
8616 rp='Address does not look like an Internet one. Use it anyway?'
8632 If you or somebody else will be maintaining perl at your site, please
8633 fill in the correct e-mail address here so that they may be contacted
8634 if necessary. Currently, the "perlbug" program included with perl
8635 will send mail to this address in addition to perlbug@perl.org. You may
8636 enter "none" for no administrator.
8639 case "$perladmin" in
8640 '') dflt="$cf_email";;
8641 *) dflt="$perladmin";;
8643 rp='Perl administrator e-mail address'
8647 : determine whether to only install version-specific parts.
8650 Do you want to install only the version-specific parts of the perl
8651 distribution? Usually you do *not* want to do this.
8653 case "$versiononly" in
8654 "$define"|[Yy]*|true) dflt='y' ;;
8657 rp="Do you want to install only the version-specific parts of perl?"
8660 [yY]*) val="$define";;
8666 case "$versiononly" in
8667 "$define") inc_version_list=''
8668 inc_version_list_init=0
8672 : figure out how to guarantee perl startup
8673 : XXX Note that this currently takes advantage of the bug that binexp ignores
8674 : the Configure -Dinstallprefix setting, which in turn means that under
8675 : relocatable @INC, initialinstalllocation is what binexp started as.
8676 case "$startperl" in
8678 case "$sharpbang" in
8682 I can use the #! construct to start perl on your system. This will
8683 make startup of perl scripts faster, but may cause problems if you
8684 want to share those scripts and perl is not in a standard place
8685 ($initialinstalllocation/perl) on all your platforms. The alternative
8686 is to force a shell by starting the script with a single ':' character.
8689 case "$versiononly" in
8690 "$define") dflt="$initialinstalllocation/perl$version";;
8691 *) dflt="$initialinstalllocation/perl";;
8693 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
8696 none) startperl=": # use perl";;
8697 *) startperl="#!$ans"
8698 if $test 30 -lt `echo "$ans" | wc -c`; then
8701 WARNING: Some systems limit the #! command to 32 characters.
8702 If you experience difficulty running Perl scripts with #!, try
8703 installing Perl in a directory with a shorter pathname.
8709 *) startperl=": # use perl"
8714 echo "I'll use $startperl to start perl scripts."
8716 : figure best path for perl in scripts
8719 case "$versiononly" in
8720 "$define") perlpath="$initialinstalllocation/perl$version";;
8721 *) perlpath="$initialinstalllocation/perl";;
8723 case "$startperl" in
8728 I will use the "eval 'exec'" idiom to start Perl on your system.
8729 I can use the full path of your Perl binary for this purpose, but
8730 doing so may cause problems if you want to share those scripts and
8731 Perl is not always in a standard place ($initialinstalllocation/perl).
8734 dflt="$initialinstalllocation/perl"
8735 rp="What path shall I use in \"eval 'exec'\"?"
8742 case "$startperl" in
8744 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
8747 : determine where public executable scripts go
8748 set scriptdir scriptdir
8750 case "$scriptdir" in
8753 : guess some guesses
8754 $test -d /usr/share/scripts && dflt=/usr/share/scripts
8755 $test -d /usr/share/bin && dflt=/usr/share/bin
8756 $test -d /usr/local/script && dflt=/usr/local/script
8757 $test -d /usr/local/scripts && dflt=/usr/local/scripts
8758 $test -d $prefixexp/script && dflt=$prefixexp/script
8762 *) dflt="$scriptdir"
8767 Some installations have a separate directory just for executable scripts so
8768 that they can mount it across multiple architectures but keep the scripts in
8769 one spot. You might, for example, have a subdirectory of /usr/share for this.
8770 Or you might just lump your scripts in with all your other executables.
8774 rp='Where do you keep publicly executable scripts?'
8776 if $test "X$ansexp" != "X$scriptdirexp"; then
8782 : A little fix up for an irregularly named variable.
8783 installscript="$installscriptdir"
8785 : determine where add-on public executables go
8787 '') dflt=$siteprefix/bin ;;
8791 rp='Pathname where the add-on public executables should be installed?'
8796 : determine where add-on html pages go
8797 : There is no standard location, so try to copy the previously-selected
8798 : directory structure for the core html pages.
8799 case "$sitehtml1dir" in
8800 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
8801 *) dflt=$sitehtml1dir ;;
8804 ''|' ') dflt=none ;;
8807 rp='Pathname where the site-specific html pages should be installed?'
8809 prefixvar=sitehtml1dir
8812 : determine where add-on library html pages go
8813 : There is no standard location, so try to copy the previously-selected
8814 : directory structure for the core html pages.
8815 case "$sitehtml3dir" in
8816 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
8817 *) dflt=$sitehtml3dir ;;
8820 ''|' ') dflt=none ;;
8823 rp='Pathname where the site-specific library html pages should be installed?'
8825 prefixvar=sitehtml3dir
8828 : determine where add-on manual pages go
8829 case "$siteman1dir" in
8830 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
8831 *) dflt=$siteman1dir ;;
8834 ''|' ') dflt=none ;;
8837 rp='Pathname where the site-specific manual pages should be installed?'
8839 prefixvar=siteman1dir
8842 : determine where add-on library man pages go
8843 case "$siteman3dir" in
8844 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
8845 *) dflt=$siteman3dir ;;
8848 ''|' ') dflt=none ;;
8851 rp='Pathname where the site-specific library manual pages should be installed?'
8853 prefixvar=siteman3dir
8856 : determine where add-on public executable scripts go
8857 case "$sitescript" in
8858 '') dflt=$siteprefix/script
8859 $test -d $dflt || dflt=$sitebin ;;
8860 *) dflt="$sitescript" ;;
8863 rp='Pathname where add-on public executable scripts should be installed?'
8865 prefixvar=sitescript
8868 case "$usefaststdio" in
8869 $define|true|[yY]*|'')
8870 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
8880 Perl can be built to use 'fast stdio', which means using the stdio
8881 library but also directly manipulating the stdio buffers to enable
8882 faster I/O. Using stdio is better for backward compatibility (especially
8883 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
8884 interface has been preferred instead of stdio.
8886 If this doesn't make any sense to you, just accept the default '$dflt'.
8888 rp='Use the "fast stdio" if available?'
8891 y|Y) val="$define" ;;
8898 : define an is-a-typedef? function
8899 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8901 "") inclist="sys/types.h";;
8903 eval "varval=\$$var";
8907 for inc in $inclist; do
8908 echo "#include <$inc>" >>temp.c;
8910 echo "#ifdef $type" >> temp.c;
8911 echo "printf(\"We have $type\");" >> temp.c;
8912 echo "#endif" >> temp.c;
8913 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8914 if $contains $type temp.E >/dev/null 2>&1; then
8920 *) eval "$var=\$varval";;
8923 : define an is-a-typedef? function that prompts if the type is not available.
8924 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8926 "") inclist="sys/types.h";;
8928 eval "varval=\$$var";
8932 for inc in $inclist; do
8933 echo "#include <$inc>" >>temp.c;
8935 echo "#ifdef $type" >> temp.c;
8936 echo "printf(\"We have $type\");" >> temp.c;
8937 echo "#endif" >> temp.c;
8938 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8940 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
8941 if $contains $type temp.E >/dev/null 2>&1; then
8942 echo "$type found." >&4;
8945 echo "$type NOT found." >&4;
8951 *) eval "$var=\$varval";;
8954 : see what type lseek is declared as in the kernel
8955 rp="What is the type used for lseek's offset on this system?"
8956 set off_t lseektype long stdio.h sys/types.h
8960 echo "Checking to see how big your file offsets are..." >&4
8962 #include <sys/types.h>
8966 printf("%d\n", (int)sizeof($lseektype));
8971 if eval $compile_ok; then
8972 lseeksize=`$run ./try`
8973 echo "Your file offsets are $lseeksize bytes long."
8977 echo "(I can't seem to compile the test program. Guessing...)"
8978 rp="What is the size of your file offsets (in bytes)?"
8984 : see what type file positions are declared as in the library
8985 rp="What is the type for file position used by fsetpos()?"
8986 set fpos_t fpostype long stdio.h sys/types.h
8991 *_t) zzz="$fpostype" ;;
8994 echo "Checking the size of $zzz..." >&4
8996 #include <sys/types.h>
9003 printf("%d\n", (int)sizeof($fpostype));
9008 if eval $compile_ok; then
9012 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9015 echo "Your $zzz is $fpossize bytes long."
9021 echo "(I can't compile the test program. Guessing...)" >&4
9022 rp="What is the size of your file positions (in bytes)?"
9027 # Backward compatibility (uselfs is deprecated).
9029 "$define"|true|[yY]*)
9032 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
9034 uselargefiles="$define"
9038 case "$lseeksize:$fpossize" in
9041 You can have files larger than 2 gigabytes.
9044 *) case "$uselargefiles" in
9045 "$undef"|false|[nN]*) dflt='n' ;;
9050 Perl can be built to understand large files (files larger than 2 gigabytes)
9051 on some systems. To do so, Configure can be run with -Duselargefiles.
9053 If this doesn't make any sense to you, just accept the default '$dflt'.
9055 rp='Try to understand large files, if available?'
9058 y|Y) val="$define" ;;
9065 : Look for a hint-file generated 'call-back-unit'. If the
9066 : user has specified that a large files perl is to be built,
9067 : we may need to set or change some other defaults.
9068 if $test -f uselargefiles.cbu; then
9069 echo "Your platform has some specific hints regarding large file builds, using them..."
9070 . ./uselargefiles.cbu
9072 case "$uselargefiles" in
9074 if $test -f uselargefiles.cbu; then
9076 echo "Rechecking to see how big your file offsets are..." >&4
9078 #include <sys/types.h>
9082 printf("%d\n", (int)sizeof($lseektype));
9087 if eval $compile_ok; then
9088 lseeksize=`$run ./try`
9089 $echo "Your file offsets are now $lseeksize bytes long."
9093 echo "(I can't seem to compile the test program. Guessing...)"
9094 rp="What is the size of your file offsets (in bytes)?"
9099 *_t) zzz="$fpostype" ;;
9102 $echo $n "Rechecking the size of $zzz...$c" >&4
9104 #include <sys/types.h>
9111 printf("%d\n", (int)sizeof($fpostype));
9116 if eval $compile_ok; then
9121 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9124 echo " $fpossize bytes." >&4
9130 echo "(I can't compile the test program. Guessing...)" >&4
9131 rp="What is the size of your file positions (in bytes)?"
9140 case "$vendorprefix" in
9141 '') d_vendorbin="$undef"
9145 *) d_vendorbin="$define"
9146 : determine where vendor-supplied executables go.
9147 case "$vendorbin" in
9148 '') dflt=$vendorprefix/bin ;;
9149 *) dflt="$vendorbin" ;;
9152 rp='Pathname for the vendor-supplied executables directory?'
9155 vendorbinexp="$ansexp"
9161 case "$vendorprefix" in
9162 '') vendorhtml1dir=''
9163 vendorhtml1direxp=''
9165 *) : determine where vendor-supplied html pages go.
9166 : There is no standard location, so try to copy the previously-selected
9167 : directory structure for the core html pages.
9168 : XXX Better default suggestions would be welcome.
9169 case "$vendorhtml1dir" in
9170 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9171 *) dflt=$vendorhtml1dir ;;
9174 ''|' ') dflt=none ;;
9177 rp='Pathname for the vendor-supplied html pages?'
9179 vendorhtml1dir="$ans"
9180 vendorhtml1direxp="$ansexp"
9183 : Use ' ' for none so value is preserved next time through Configure
9184 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9185 prefixvar=vendorhtml1dir
9188 case "$vendorprefix" in
9189 '') vendorhtml3dir=''
9190 vendorhtml3direxp=''
9192 *) : determine where vendor-supplied module html pages go.
9193 : There is no standard location, so try to copy the previously-selected
9194 : directory structure for the core html pages.
9195 : XXX Better default suggestions would be welcome.
9196 case "$vendorhtml3dir" in
9197 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9198 *) dflt=$vendorhtml3dir ;;
9201 ''|' ') dflt=none ;;
9204 rp='Pathname for the vendor-supplied html pages?'
9206 vendorhtml3dir="$ans"
9207 vendorhtml3direxp="$ansexp"
9210 : Use ' ' for none so value is preserved next time through Configure
9211 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9212 prefixvar=vendorhtml3dir
9215 case "$vendorprefix" in
9216 '') vendorman1dir=''
9219 *) : determine where vendor-supplied manual pages go.
9220 case "$vendorman1dir" in
9221 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9222 *) dflt=$vendorman1dir ;;
9225 ''|' ') dflt=none ;;
9228 rp='Pathname for the vendor-supplied manual section 1 pages?'
9230 vendorman1dir="$ans"
9231 vendorman1direxp="$ansexp"
9234 : Use ' ' for none so value is preserved next time through Configure
9235 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
9236 prefixvar=vendorman1dir
9239 case "$vendorprefix" in
9240 '') vendorman3dir=''
9243 *) : determine where vendor-supplied module manual pages go.
9244 case "$vendorman3dir" in
9245 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9246 *) dflt=$vendorman3dir ;;
9249 ''|' ') dflt=none ;;
9252 rp='Pathname for the vendor-supplied manual section 3 pages?'
9254 vendorman3dir="$ans"
9255 vendorman3direxp="$ansexp"
9258 : Use ' ' for none so value is preserved next time through Configure
9259 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
9260 prefixvar=vendorman3dir
9263 case "$vendorprefix" in
9264 '') d_vendorscript="$undef"
9268 *) d_vendorscript="$define"
9269 : determine where vendor-supplied scripts go.
9270 case "$vendorscript" in
9271 '') dflt=$vendorprefix/script
9272 $test -d $dflt || dflt=$vendorbin ;;
9273 *) dflt="$vendorscript" ;;
9277 The installation process will create a directory for
9278 vendor-supplied scripts.
9282 rp='Pathname for the vendor-supplied scripts directory?'
9285 vendorscriptexp="$ansexp"
9288 prefixvar=vendorscript
9291 : see if qgcvt exists
9297 if $test X"$d_longdbl" = X"$define"; then
9299 echo "Checking how to print long doubles..." >&4
9301 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
9302 $cat >try.c <<'EOCP'
9303 #include <sys/types.h>
9307 printf("%.3f\n", d);
9311 if eval $compile; then
9315 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
9316 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
9317 echo "We will use %f."
9323 if $test X"$sPRIfldbl" = X; then
9324 $cat >try.c <<'EOCP'
9325 #include <sys/types.h>
9328 long double d = 123.456;
9329 printf("%.3Lf\n", d);
9333 if eval $compile; then
9337 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
9338 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
9339 echo "We will use %Lf."
9345 if $test X"$sPRIfldbl" = X; then
9346 $cat >try.c <<'EOCP'
9347 #include <sys/types.h>
9350 long double d = 123.456;
9351 printf("%.3llf\n", d);
9355 if eval $compile; then
9359 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
9360 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
9361 echo "We will use %llf."
9367 if $test X"$sPRIfldbl" = X; then
9368 $cat >try.c <<'EOCP'
9369 #include <sys/types.h>
9372 long double d = 123.456;
9373 printf("%.3lf\n", d);
9377 if eval $compile; then
9381 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
9382 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
9383 echo "We will use %lf."
9389 if $test X"$sPRIfldbl" = X; then
9390 echo "Cannot figure out how to print long doubles." >&4
9392 sSCNfldbl=$sPRIfldbl # expect consistency
9399 case "$sPRIfldbl" in
9400 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
9401 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
9402 d_SCNfldbl="$undef";
9404 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
9405 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
9406 d_SCNfldbl="$define";
9410 : Check how to convert floats to strings.
9412 if test "X$d_Gconvert" = X; then
9415 echo "Checking for an efficient way to convert floats to strings."
9417 case "$uselongdouble" in
9418 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
9420 case "$d_longdbl" in
9421 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
9423 case "$d_PRIgldbl" in
9424 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
9428 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
9429 char *myname = "gconvert";
9432 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
9433 char *myname = "gcvt";
9436 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
9437 char *myname = "qgcvt";
9438 #define DOUBLETYPE long double
9441 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9443 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
9445 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
9448 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
9450 char *myname = "sprintf";
9454 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9455 #define DOUBLETYPE long double
9457 #define DOUBLETYPE double
9463 #define I_STDLIB $i_stdlib
9469 checkit(expect, got)
9473 if (strcmp(expect, got)) {
9474 printf("%s oddity: Expected %s, got %s\n",
9475 myname, expect, got);
9485 /* This must be 1st test on (which?) platform */
9486 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
9487 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
9488 checkit("0.1", buf);
9490 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
9491 checkit("0.01", buf);
9493 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
9494 checkit("0.001", buf);
9496 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
9497 checkit("0.0001", buf);
9499 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
9500 if (strlen(buf) > 5)
9501 checkit("9e-005", buf); /* for Microsoft ?? */
9503 checkit("9e-05", buf);
9505 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
9508 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
9509 checkit("1.1", buf);
9511 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
9512 checkit("1.01", buf);
9514 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
9515 checkit("1.001", buf);
9517 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
9518 checkit("1.0001", buf);
9520 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
9521 checkit("1.00001", buf);
9523 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
9524 checkit("1.000001", buf);
9526 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
9529 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
9532 /* Some Linux gcvt's give 1.e+5 here. */
9533 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
9534 checkit("100000", buf);
9536 /* Some Linux gcvt's give -1.e+5 here. */
9537 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
9538 checkit("-100000", buf);
9540 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
9541 checkit("123.456", buf);
9543 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
9544 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
9545 /* 34 should be enough to scare even long double
9546 * places into using the e notation. */
9547 if (strlen(buf) > 5)
9548 checkit("1e+034", buf); /* for Microsoft */
9550 checkit("1e+34", buf);
9552 /* For Perl, if you add additional tests here, also add them to
9553 * t/base/num.t for benefit of platforms not using Configure or
9554 * overriding d_Gconvert */
9559 : first add preferred functions to our list
9561 for xxx_convert in $gconvert_preference; do
9562 case $xxx_convert in
9563 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
9564 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
9567 : then add any others
9568 for xxx_convert in gconvert gcvt sprintf; do
9571 *) xxx_list="$xxx_list $xxx_convert" ;;
9575 case "$d_longdbl$uselongdouble" in
9577 : again, add prefered functions to our list first
9579 for xxx_convert in $gconvert_ld_preference; do
9580 case $xxx_convert in
9581 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9582 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
9585 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
9586 for xxx_convert in qgcvt sprintf $xxx_list; do
9587 case "$xxx_ld_list" in
9588 $xxx_convert*|*" $xxx_convert"*) ;;
9589 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9592 : if sprintf cannot do long doubles, move it to the end
9593 if test "$d_PRIgldbl" != "$define"; then
9594 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
9596 : if no qgcvt, remove it
9597 if test "$d_qgcvt" != "$define"; then
9598 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
9601 xxx_list="$xxx_ld_list"
9605 for xxx_convert in $xxx_list; do
9606 echo "Trying $xxx_convert..."
9608 set try -DTRY_$xxx_convert
9609 if eval $compile; then
9610 echo "$xxx_convert() found." >&4
9612 echo "I'll use $xxx_convert to convert floats into a string." >&4
9615 echo "...But $xxx_convert didn't work as I expected."
9619 echo "$xxx_convert NOT found." >&4
9623 if test X$xxx_convert = X; then
9624 echo "*** WHOA THERE!!! ***" >&4
9625 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
9629 case "$xxx_convert" in
9630 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
9631 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
9632 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
9633 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
9634 "$define$define$define")
9635 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
9636 "$define$define$undef")
9637 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
9638 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
9645 : see if _fwalk exists
9649 : Initialize h_fcntl
9652 : Initialize h_sysfile
9655 : access call always available on UNIX
9659 : locate the flags for 'access()'
9663 $cat >access.c <<EOCP
9664 #include <sys/types.h>
9669 #include <sys/file.h>
9682 : check sys/file.h first, no particular reason here
9683 if $test `./findhdr sys/file.h` && \
9684 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
9686 echo "<sys/file.h> defines the *_OK access constants." >&4
9687 elif $test `./findhdr fcntl.h` && \
9688 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
9690 echo "<fcntl.h> defines the *_OK access constants." >&4
9691 elif $test `./findhdr unistd.h` && \
9692 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
9693 echo "<unistd.h> defines the *_OK access constants." >&4
9695 echo "I can't find the four *_OK access constants--I'll use mine." >&4
9701 : see if accessx exists
9702 set accessx d_accessx
9705 : see if aintl exists
9709 : see if alarm exists
9713 : see if POSIX threads are available
9714 set pthread.h i_pthread
9717 : define a fucntion to check prototypes
9718 $cat > protochk <<EOSH
9721 optimize="$optimize"
9723 prototype="$prototype"
9726 usethreads=$usethreads
9727 i_pthread=$i_pthread
9728 pthread_h_first=$pthread_h_first
9731 $cat >> protochk <<'EOSH'
9736 while test $# -ge 2; do
9738 $define) echo "#include <$2>" >> try.c ;;
9739 literal) echo "$2" >> try.c ;;
9741 # Extra magic for the benefit of systems that need pthread.h
9742 # to be included early to correctly detect threadsafe functions.
9743 # Such functions must guarantee themselves, though, that the usethreads
9744 # and i_pthread have been defined, before calling protochk.
9745 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
9746 echo "#include <pthread.h>" >> try.c
9751 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
9752 cat >> try.c <<'EOCP'
9753 #ifdef CAN_PROTOTYPE
9754 #define _(args) args
9759 echo "$foo" >> try.c
9760 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
9761 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
9769 hasproto='varname=$1; func=$2; shift; shift;
9770 while $test $# -ge 2; do
9772 $define) echo "#include <$2>";;
9776 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
9777 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
9778 echo "$func() prototype found.";
9781 echo "$func() prototype NOT found.";
9786 $rm -f try.c tryout.c'
9788 : see if sys/types.h has to be included
9789 set sys/types.h i_systypes
9792 : see if sys/select.h has to be included
9793 set sys/select.h i_sysselct
9796 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
9797 while $test $# -ge 2; do
9799 $define) echo "#include <$2>";;
9803 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
9805 if eval $compile; then
9814 : see if we should include time.h, sys/time.h, or both
9816 if test "X$timeincl" = X; then
9817 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
9818 $echo $n "I'm now running the test program...$c"
9820 #include <sys/types.h>
9825 #ifdef SYSTIMEKERNEL
9828 #include <sys/time.h>
9831 #include <sys/select.h>
9844 struct timezone tzp;
9846 if (foo.tm_sec == foo.tm_sec)
9849 if (bar.tv_sec == bar.tv_sec)
9856 for s_timezone in '-DS_TIMEZONE' ''; do
9858 for s_timeval in '-DS_TIMEVAL' ''; do
9859 for i_systimek in '' '-DSYSTIMEKERNEL'; do
9860 for i_time in '' '-DI_TIME'; do
9861 for i_systime in '-DI_SYSTIME' ''; do
9864 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
9865 if eval $compile; then
9866 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
9870 $echo $n "Succeeded with $flags$c"
9882 *SYSTIMEKERNEL*) i_systimek="$define"
9883 timeincl=`./findhdr sys/time.h`
9884 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
9885 *) i_systimek="$undef";;
9888 *I_TIME*) i_time="$define"
9889 timeincl=`./findhdr time.h`" $timeincl"
9890 echo "We'll include <time.h>." >&4;;
9891 *) i_time="$undef";;
9894 *I_SYSTIME*) i_systime="$define"
9895 timeincl=`./findhdr sys/time.h`" $timeincl"
9896 echo "We'll include <sys/time.h>." >&4;;
9897 *) i_systime="$undef";;
9901 : see if struct tm knows about tm_zone
9902 case "$i_systime$i_time" in
9905 echo "Checking to see if your struct tm has tm_zone field..." >&4
9906 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
9914 case "$d_tm_tm_zone" in
9915 "$define") echo "Yes, it does." ;;
9916 *) echo "No, it doesn't." ;;
9918 : see if struct tm knows about tm_gmtoff
9919 case "$i_systime$i_time" in
9922 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
9923 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
9931 case "$d_tm_tm_gmtoff" in
9932 "$define") echo "Yes, it does." ;;
9933 *) echo "No, it doesn't." ;;
9936 : see if asctime_r exists
9937 set asctime_r d_asctime_r
9939 case "$d_asctime_r" in
9941 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
9942 case "$d_asctime_r_proto:$usethreads" in
9943 ":define") d_asctime_r_proto=define
9944 set d_asctime_r_proto asctime_r $hdrs
9948 case "$d_asctime_r_proto" in
9950 case "$asctime_r_proto" in
9951 ''|0) try='char* asctime_r(const struct tm*, char*);'
9952 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SB ;;
9954 case "$asctime_r_proto" in
9955 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
9956 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SBI ;;
9958 case "$asctime_r_proto" in
9959 ''|0) try='int asctime_r(const struct tm*, char*);'
9960 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SB ;;
9962 case "$asctime_r_proto" in
9963 ''|0) try='int asctime_r(const struct tm*, char*, int);'
9964 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SBI ;;
9966 case "$asctime_r_proto" in
9967 ''|0) d_asctime_r=undef
9969 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
9970 * ) case "$asctime_r_proto" in
9971 REENTRANT_PROTO*) ;;
9972 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
9974 echo "Prototype: $try" ;;
9977 *) case "$usethreads" in
9978 define) echo "asctime_r has no prototype, not using it." >&4 ;;
9985 *) asctime_r_proto=0
9989 : see if atolf exists
9993 : see if atoll exists
9997 : Look for GCC-style attribute format
9998 case "$d_attribute_format" in
10001 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
10002 $cat >attrib.c <<'EOCP'
10004 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
10006 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10007 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10008 echo "Your C compiler doesn't support __attribute__((format))."
10011 echo "Your C compiler supports __attribute__((format))."
10015 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10019 *) val="$d_attribute_format" ;;
10021 set d_attribute_format
10025 : Look for GCC-style attribute format with null format allowed
10026 case "$d_printf_format_null" in
10027 '') case "$d_attribute_format" in
10030 echo "Checking whether your compiler allows __printf__ format to be null ..." >&4
10031 $cat >attrib.c <<EOCP
10033 #$i_stdlib I_STDLIB
10035 #include <stdlib.h>
10037 int null_printf (char* pat,...) __attribute__((__format__(__printf__,1,2)));
10038 int null_printf (char* pat,...) { return (int)pat; }
10039 int main () { exit(null_printf(NULL)); }
10041 if $cc $ccflags -o attrib attrib.c >attrib.out 2>&1 ; then
10042 : run the executable in case it produces a run-time warning
10043 if $run ./attrib >>attrib.out 2>&1; then
10044 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10045 echo "Your C compiler doesn't allow __printf__ format to be null."
10048 echo "Your C compiler allows __printf__ format to be null."
10052 echo "Your C compiler executable failed with __printf__ format null."
10056 echo "Your C compiler fails with __printf__ format null."
10063 *) val="$d_printf_format_null" ;;
10065 set d_printf_format_null
10069 : Look for GCC-style attribute malloc
10070 case "$d_attribute_malloc" in
10073 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
10074 $cat >attrib.c <<'EOCP'
10076 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
10078 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10079 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10080 echo "Your C compiler doesn't support __attribute__((malloc))."
10083 echo "Your C compiler supports __attribute__((malloc))."
10087 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10091 *) val="$d_attribute_malloc" ;;
10093 set d_attribute_malloc
10097 : Look for GCC-style attribute nonnull
10098 case "$d_attribute_nonnull" in
10101 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
10102 $cat >attrib.c <<'EOCP'
10104 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
10106 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10107 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10108 echo "Your C compiler doesn't support __attribute__((nonnull))."
10111 echo "Your C compiler supports __attribute__((nonnull))."
10115 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10119 *) val="$d_attribute_nonnull" ;;
10121 set d_attribute_nonnull
10125 : Look for GCC-style attribute noreturn
10126 case "$d_attribute_noreturn" in
10129 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
10130 $cat >attrib.c <<'EOCP'
10132 void fall_over_dead( void ) __attribute__((noreturn));
10134 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10135 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10136 echo "Your C compiler doesn't support __attribute__((noreturn))."
10139 echo "Your C compiler supports __attribute__((noreturn))."
10143 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10147 *) val="$d_attribute_noreturn" ;;
10149 set d_attribute_noreturn
10153 : Look for GCC-style attribute pure
10154 case "$d_attribute_pure" in
10157 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
10158 $cat >attrib.c <<'EOCP'
10160 int square( int n ) __attribute__((pure));
10162 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10163 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10164 echo "Your C compiler doesn't support __attribute__((pure))."
10167 echo "Your C compiler supports __attribute__((pure))."
10171 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10175 *) val="$d_attribute_pure" ;;
10177 set d_attribute_pure
10181 : Look for GCC-style attribute unused
10182 case "$d_attribute_unused" in
10185 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
10186 $cat >attrib.c <<'EOCP'
10188 int do_something( int dummy __attribute__((unused)), int n );
10190 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10191 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10192 echo "Your C compiler doesn't support __attribute__((unused))."
10195 echo "Your C compiler supports __attribute__((unused))."
10199 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10203 *) val="$d_attribute_unused" ;;
10205 set d_attribute_unused
10209 : Look for GCC-style attribute warn_unused_result
10210 case "$d_attribute_warn_unused_result" in
10213 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
10214 $cat >attrib.c <<'EOCP'
10216 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
10218 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10219 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10220 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
10223 echo "Your C compiler supports __attribute__((warn_unused_result))."
10227 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10231 *) val="$d_attribute_warn_unused_result" ;;
10233 set d_attribute_warn_unused_result
10237 : see if bcmp exists
10241 : see if bcopy exists
10245 : see if getpgrp exists
10246 set getpgrp d_getpgrp
10249 case "$d_getpgrp" in
10252 echo "Checking to see which flavor of getpgrp is in use..."
10254 #$i_unistd I_UNISTD
10255 #include <sys/types.h>
10257 # include <unistd.h>
10259 #$i_stdlib I_STDLIB
10261 #include <stdlib.h>
10265 if (getuid() == 0) {
10266 printf("(I see you are running Configure as super-user...)\n");
10269 #ifdef TRY_BSD_PGRP
10270 if (getpgrp(1) == 0)
10279 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10280 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
10282 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10283 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
10286 echo "I can't seem to compile and run the test program."
10288 xxx="a USG one, i.e. you use getpgrp()."
10290 # SVR4 systems can appear rather BSD-ish.
10291 case "$i_unistd" in
10293 xxx="a BSD one, i.e. you use getpgrp(pid)."
10297 xxx="probably a USG one, i.e. you use getpgrp()."
10302 echo "Assuming your getpgrp is $xxx" >&4
10311 : see if setpgrp exists
10312 set setpgrp d_setpgrp
10315 case "$d_setpgrp" in
10318 echo "Checking to see which flavor of setpgrp is in use..."
10320 #$i_unistd I_UNISTD
10321 #include <sys/types.h>
10323 # include <unistd.h>
10325 #$i_stdlib I_STDLIB
10327 #include <stdlib.h>
10331 if (getuid() == 0) {
10332 printf("(I see you are running Configure as super-user...)\n");
10335 #ifdef TRY_BSD_PGRP
10336 if (-1 == setpgrp(1, 1))
10339 if (setpgrp() != -1)
10345 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10346 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
10348 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10349 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
10352 echo "(I can't seem to compile and run the test program.)"
10354 xxx="a USG one, i.e. you use setpgrp()."
10356 # SVR4 systems can appear rather BSD-ish.
10357 case "$i_unistd" in
10359 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
10363 xxx="probably a USG one, i.e. you use setpgrp()."
10368 echo "Assuming your setpgrp is $xxx" >&4
10376 : Look for GCC-style __builtin_choose_expr
10377 case "$d_builtin_choose_expr" in
10380 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
10381 $cat >try.c <<'EOCP'
10382 #include <assert.h>
10383 #include <stdlib.h>
10386 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
10389 assert( SYRINX(1) == 2112 );
10390 assert( SYRINX(1) != 5150 );
10391 assert( SYRINX(0) == 5150 );
10392 assert( SYRINX(0) != 2112 );
10393 puts( "All good!" );
10399 if eval $compile; then
10400 echo "Your C compiler supports __builtin_choose_expr."
10403 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
10407 *) val="$d_builtin_choose_expr" ;;
10410 set d_builtin_choose_expr
10412 $rm -f try.* try core core.try.*
10414 : Look for GCC-style __builtin_expect
10415 case "$d_builtin_expect" in
10418 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
10419 $cat >builtin.c <<'EOCP'
10422 if ( __builtin_expect(n, 0) ) n = 1;
10426 if eval $compile; then
10427 echo "Your C compiler supports __builtin_choose_expr."
10430 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
10434 *) val="$d_builtin_expect" ;;
10437 set d_builtin_expect
10439 $rm -f try.* try core core.try.*
10441 : see if bzero exists
10445 : see if stdarg is available
10447 if $test `./findhdr stdarg.h`; then
10448 echo "<stdarg.h> found." >&4
10451 echo "<stdarg.h> NOT found." >&4
10455 : see if varags is available
10457 if $test `./findhdr varargs.h`; then
10458 echo "<varargs.h> found." >&4
10460 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
10463 : set up the varargs testing programs
10464 $cat > varargs.c <<EOP
10466 #include <stdarg.h>
10469 #include <varargs.h>
10473 int f(char *p, ...)
10487 p = va_arg(ap, char *);
10493 $cat > varargs <<EOP
10495 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
10504 : now check which varargs header should be included
10509 if `./varargs I_STDARG`; then
10511 elif `./varargs I_VARARGS`; then
10516 if `./varargs I_VARARGS`; then
10523 echo "I could not find the definition for va_dcl... You have problems..." >&4
10524 val="$undef"; set i_stdarg; eval $setvar
10525 val="$undef"; set i_varargs; eval $setvar
10530 case "$i_varhdr" in
10532 val="$define"; set i_stdarg; eval $setvar
10533 val="$undef"; set i_varargs; eval $setvar
10536 val="$undef"; set i_stdarg; eval $setvar
10537 val="$define"; set i_varargs; eval $setvar
10540 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
10544 : see if the Compiler supports C99 variadic macros
10545 case "$i_stdarg$i_stdlib" in
10547 echo "You have <stdarg.h> and <stdlib.h>, so checking for C99 variadic macros." >&4
10550 #include <stdarg.h>
10552 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
10556 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
10562 if eval $compile && $run ./try 2>&1 >/dev/null; then
10563 case "`$run ./try`" in
10565 echo "You have C99 variadic macros." >&4
10566 d_c99_variadic_macros="$define"
10569 echo "You don't have functional C99 variadic macros." >&4
10570 d_c99_variadic_macros="$undef"
10574 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
10575 d_c99_variadic_macros="$undef"
10577 $rm -f try.* try core core.try.*
10580 echo "You don't have <stdarg.h> and <stdlib.h>, so not checking for C99 variadic macros." >&4
10581 d_c99_variadic_macros="$undef"
10585 : see if signal is declared as pointer to function returning int or void
10587 xxx=`./findhdr signal.h`
10588 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
10589 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10590 echo "You have int (*signal())() instead of void." >&4
10592 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10593 echo "You have void (*signal())()." >&4
10595 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
10596 echo "You have int (*signal())() instead of void." >&4
10598 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
10599 echo "You have void (*signal())()." >&4
10602 case "$d_voidsig" in
10604 echo "I can't determine whether signal handler returns void or int..." >&4
10606 rp="What type does your signal handler return?"
10609 v*) val="$define";;
10613 echo "As you already told me, signal handler returns void." >&4
10616 *) echo "As you already told me, signal handler returns int." >&4
10623 case "$d_voidsig" in
10624 "$define") signal_t="void";;
10625 *) signal_t="int";;
10629 : check for ability to cast large floats to 32-bit ints.
10631 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
10632 if $test "$intsize" -ge 4; then
10639 #$i_stdlib I_STDLIB
10641 #include <stdlib.h>
10643 #include <sys/types.h>
10644 #include <signal.h>
10645 $signal_t blech(int s) { exit(3); }
10652 signal(SIGFPE, blech);
10654 /* Don't let compiler optimize the test away. Store the number
10655 in a writable string for gcc to pass to sscanf under HP/UX.
10657 sprintf(str, "2147483647");
10658 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
10662 /* x86 processors will probably give 0x8000 0000, which is a
10663 sign change. We don't want that. We want to mimic SPARC
10664 behavior here, which is to preserve the sign and give
10667 if (i32 != ($xxx) f)
10673 if eval $compile_ok; then
10677 echo "(I can't seem to compile the test program--assuming it can't)"
10682 echo "Yup, it can."
10685 echo "Nope, it can't."
10692 : check for ability to cast negative floats to unsigned
10694 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
10697 #$i_stdlib I_STDLIB
10699 #include <stdlib.h>
10701 #include <sys/types.h>
10702 #include <signal.h>
10703 $signal_t blech(int s) { exit(7); }
10704 $signal_t blech_in_list(int s) { exit(4); }
10705 unsigned long dummy_long(unsigned long p) { return p; }
10706 unsigned int dummy_int(unsigned int p) { return p; }
10707 unsigned short dummy_short(unsigned short p) { return p; }
10711 unsigned long along;
10713 unsigned short ashort;
10717 /* Frustrate gcc-2.7.2's optimizer which failed this test with
10718 a direct f = -123. assignment. gcc-2.8.0 reportedly
10719 optimized the whole file away
10721 /* Store the number in a writable string for gcc to pass to
10722 sscanf under HP/UX.
10724 sprintf(str, "-123");
10725 sscanf(str, "%lf", &f); /* f = -123.; */
10727 signal(SIGFPE, blech);
10728 along = (unsigned long)f;
10729 aint = (unsigned int)f;
10730 ashort = (unsigned short)f;
10731 if (along != (unsigned long)-123)
10733 if (aint != (unsigned int)-123)
10735 if (ashort != (unsigned short)-123)
10737 sprintf(str, "1073741824.");
10738 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
10741 along = (unsigned long)f;
10742 if (along != 0x80000000)
10746 along = (unsigned long)f;
10747 if (along != 0x7fffffff)
10751 along = (unsigned long)f;
10752 if (along != 0x80000001)
10756 signal(SIGFPE, blech_in_list);
10757 sprintf(str, "123.");
10758 sscanf(str, "%lf", &f); /* f = 123.; */
10759 along = dummy_long((unsigned long)f);
10760 aint = dummy_int((unsigned int)f);
10761 ashort = dummy_short((unsigned short)f);
10762 if (along != (unsigned long)123)
10764 if (aint != (unsigned int)123)
10766 if (ashort != (unsigned short)123)
10773 if eval $compile_ok; then
10777 echo "(I can't seem to compile the test program--assuming it can't)"
10780 case "$castflags" in
10782 echo "Yup, it can."
10785 echo "Nope, it can't."
10792 : see if vprintf exists
10794 if set vprintf val -f d_vprintf; eval $csym; $val; then
10795 echo 'vprintf() found.' >&4
10798 #include <varargs.h>
10799 #$i_stdlib I_STDLIB
10801 #include <stdlib.h>
10804 int main() { xxx("foo"); }
10813 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
10817 if eval $compile && $run ./try; then
10818 echo "Your vsprintf() returns (int)." >&4
10821 echo "Your vsprintf() returns (char*)." >&4
10825 echo 'vprintf() NOT found.' >&4
10836 : see if chown exists
10840 : see if chroot exists
10841 set chroot d_chroot
10844 : see if chsize exists
10845 set chsize d_chsize
10848 : see if class exists
10852 : see if clearenv exists
10853 set clearenv d_clearenv
10856 hasstruct='varname=$1; struct=$2; shift; shift;
10857 while $test $# -ge 2; do
10859 $define) echo "#include <$2>";;
10863 echo "int main () { struct $struct foo; }" >> try.c;
10865 if eval $compile; then
10872 $rm -f try.c try.o'
10876 : see whether socket exists
10878 $echo $n "Hmm... $c" >&4
10879 if set socket val -f d_socket; eval $csym; $val; then
10880 echo "Looks like you have Berkeley networking support." >&4
10882 if set setsockopt val -f; eval $csym; $val; then
10885 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
10886 d_oldsock="$define"
10889 if $contains socklib libc.list >/dev/null 2>&1; then
10890 echo "Looks like you have Berkeley networking support." >&4
10892 : we will have to assume that it supports the 4.2 BSD interface
10895 echo "You don't have Berkeley networking in libc$_a..." >&4
10896 if test "X$d_socket" = "X$define"; then
10897 echo "...but you seem to believe that you have sockets." >&4
10899 for net in net socket
10901 if test -f /usr/lib/lib$net$_a; then
10902 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
10903 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
10904 if $contains socket libc.list >/dev/null 2>&1; then
10909 echo "...but the Wollongong group seems to have hacked it in." >&4
10910 sockethdr="-I/usr/netinclude"
10913 echo "Found Berkeley sockets interface in lib$net." >&4
10914 if $contains setsockopt libc.list >/dev/null 2>&1; then
10917 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
10918 d_oldsock="$define"
10924 if test "X$d_socket" != "X$define"; then
10925 echo "or anywhere else I see." >&4
10933 : see if socketpair exists
10934 set socketpair d_sockpair
10939 echo "Checking the availability of certain socket constants..." >&4
10940 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
10941 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
10943 #include <sys/types.h>
10944 #include <sys/socket.h>
10950 set try; if eval $compile; then
10953 set d_${enum}; eval $setvar
10957 : see if this is a sys/uio.h system
10958 set sys/uio.h i_sysuio
10963 echo "Checking to see if your system supports struct cmsghdr..." >&4
10964 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
10966 case "$d_cmsghdr_s" in
10967 "$define") echo "Yes, it does." ;;
10968 *) echo "No, it doesn't." ;;
10972 : check for const keyword
10974 echo 'Checking to see if your C compiler knows about "const"...' >&4
10975 $cat >const.c <<'EOCP'
10976 typedef struct spug { int drokk; } spug;
10980 const spug y = { 0 };
10983 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
10985 echo "Yup, it does."
10988 echo "Nope, it doesn't."
10993 : see if copysignl exists
10994 set copysignl d_copysignl
10997 : see if crypt exists
11002 $define) cryptlib='' ;;
11003 *) if set crypt val -f d_crypt; eval $csym; $val; then
11004 echo 'crypt() found.' >&4
11008 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
11009 if $test -z "$cryptlib"; then
11010 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
11014 if $test -z "$cryptlib"; then
11015 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
11019 if $test -z "$cryptlib"; then
11020 cryptlib=`./loc libcrypt$_a "" $libpth`
11024 if $test -z "$cryptlib"; then
11025 echo 'crypt() NOT found.' >&4
11036 : see if this is a crypt.h system
11037 set crypt.h i_crypt
11040 : see if crypt_r exists
11041 set crypt_r d_crypt_r
11043 case "$d_crypt_r" in
11045 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
11046 case "$d_crypt_r_proto:$usethreads" in
11047 ":define") d_crypt_r_proto=define
11048 set d_crypt_r_proto crypt_r $hdrs
11052 case "$d_crypt_r_proto" in
11054 case "$crypt_r_proto" in
11055 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
11056 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCS ;;
11058 case "$crypt_r_proto" in
11059 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
11060 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCD ;;
11062 case "$crypt_r_proto" in
11063 ''|0) d_crypt_r=undef
11065 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
11066 * ) case "$crypt_r_proto" in
11067 REENTRANT_PROTO*) ;;
11068 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
11070 echo "Prototype: $try" ;;
11073 *) case "$usethreads" in
11074 define) echo "crypt_r has no prototype, not using it." >&4 ;;
11085 : get csh whereabouts
11087 'csh') val="$undef" ;;
11088 *) val="$define" ;;
11092 : Respect a hint or command line value for full_csh.
11093 case "$full_csh" in
11094 '') full_csh=$csh ;;
11097 : see if ctermid exists
11098 set ctermid d_ctermid
11101 : see if ctermid_r exists
11102 set ctermid_r d_ctermid_r
11104 case "$d_ctermid_r" in
11106 hdrs="$i_systypes sys/types.h define stdio.h "
11107 case "$d_ctermid_r_proto:$usethreads" in
11108 ":define") d_ctermid_r_proto=define
11109 set d_ctermid_r_proto ctermid_r $hdrs
11113 case "$d_ctermid_r_proto" in
11115 case "$ctermid_r_proto" in
11116 ''|0) try='char* ctermid_r(char*);'
11117 ./protochk "extern $try" $hdrs && ctermid_r_proto=B_B ;;
11119 case "$ctermid_r_proto" in
11120 ''|0) d_ctermid_r=undef
11122 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
11123 * ) case "$ctermid_r_proto" in
11124 REENTRANT_PROTO*) ;;
11125 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
11127 echo "Prototype: $try" ;;
11130 *) case "$usethreads" in
11131 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
11138 *) ctermid_r_proto=0
11142 : see if ctime_r exists
11143 set ctime_r d_ctime_r
11145 case "$d_ctime_r" in
11147 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
11148 case "$d_ctime_r_proto:$usethreads" in
11149 ":define") d_ctime_r_proto=define
11150 set d_ctime_r_proto ctime_r $hdrs
11154 case "$d_ctime_r_proto" in
11156 case "$ctime_r_proto" in
11157 ''|0) try='char* ctime_r(const time_t*, char*);'
11158 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SB ;;
11160 case "$ctime_r_proto" in
11161 ''|0) try='char* ctime_r(const time_t*, char*, int);'
11162 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SBI ;;
11164 case "$ctime_r_proto" in
11165 ''|0) try='int ctime_r(const time_t*, char*);'
11166 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SB ;;
11168 case "$ctime_r_proto" in
11169 ''|0) try='int ctime_r(const time_t*, char*, int);'
11170 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SBI ;;
11172 case "$ctime_r_proto" in
11173 ''|0) d_ctime_r=undef
11175 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
11176 * ) case "$ctime_r_proto" in
11177 REENTRANT_PROTO*) ;;
11178 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
11180 echo "Prototype: $try" ;;
11183 *) case "$usethreads" in
11184 define) echo "ctime_r has no prototype, not using it." >&4 ;;
11195 : see if cuserid exists
11196 set cuserid d_cuserid
11199 : see if this is a limits.h system
11200 set limits.h i_limits
11203 : see if this is a float.h system
11204 set float.h i_float
11207 : See if number of significant digits in a double precision number is known
11209 $cat >dbl_dig.c <<EOM
11210 #$i_limits I_LIMITS
11213 #include <limits.h>
11219 printf("Contains DBL_DIG");
11222 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
11223 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
11224 echo "DBL_DIG found." >&4
11227 echo "DBL_DIG NOT found." >&4
11234 : see if dbm.h is available
11235 : see if dbmclose exists
11236 set dbmclose d_dbmclose
11239 case "$d_dbmclose" in
11249 *) set rpcsvc/dbm.h i_rpcsvcdbm
11254 *) echo "We won't be including <dbm.h>"
11264 : see if prototype for dbminit is available
11266 set d_dbminitproto dbminit $i_dbm dbm.h
11269 : see if difftime exists
11270 set difftime d_difftime
11273 : see if this is a dirent system
11275 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
11277 echo "<dirent.h> found." >&4
11280 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
11281 echo "<sys/dir.h> found." >&4
11284 xinc=`./findhdr sys/ndir.h`
11286 echo "<dirent.h> NOT found." >&4
11291 : Look for type of directory structure.
11293 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11295 case "$direntrytype" in
11297 case "$i_dirent" in
11298 $define) guess1='struct dirent' ;;
11299 *) guess1='struct direct' ;;
11302 *) guess1="$direntrytype"
11307 'struct dirent') guess2='struct direct' ;;
11308 *) guess2='struct dirent' ;;
11311 if $contains "$guess1" try.c >/dev/null 2>&1; then
11312 direntrytype="$guess1"
11313 echo "Your directory entries are $direntrytype." >&4
11314 elif $contains "$guess2" try.c >/dev/null 2>&1; then
11315 direntrytype="$guess2"
11316 echo "Your directory entries seem to be $direntrytype." >&4
11318 echo "I don't recognize your system's directory entries." >&4
11319 rp="What type is used for directory entries on this system?"
11322 direntrytype="$ans"
11327 : see if the directory entry stores field length
11329 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11330 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
11331 echo "Good, your directory entry keeps length information in d_namlen." >&4
11334 echo "Your directory entry does not know about the d_namlen field." >&4
11341 : Look for DIR.dd_fd
11342 case "$i_dirent" in
11344 echo "Checking to see if DIR has a dd_fd member variable" >&4
11346 #$i_stdlib I_STDLIB
11348 #include <stdlib.h>
11350 #include <dirent.h>
11360 if eval $compile; then
11361 echo "Yes, it does."
11364 echo "No, it does not."
11369 echo "You don't have a <dirent.h>, so not checking for dd_fd." >&4
11377 : see if this is an sysdir system
11378 set sys/dir.h i_sysdir
11381 : see if this is an sysndir system
11382 set sys/ndir.h i_sysndir
11387 $cat >dirfd.c <<EOM
11389 #$i_stdlib I_STDLIB
11391 #include <stdlib.h>
11393 #$i_dirent I_DIRENT /**/
11394 #$i_sysdir I_SYS_DIR /**/
11395 #$i_sysndir I_SYS_NDIR /**/
11396 #$i_systypes I_SYS_TYPES /**/
11397 #if defined(I_SYS_TYPES)
11398 #include <sys/types.h>
11400 #if defined(I_DIRENT)
11401 #include <dirent.h>
11402 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
11403 #include <sys/dir.h>
11407 #include <sys/ndir.h>
11411 #include <ndir.h> /* may be wrong in the future */
11413 #include <sys/dir.h>
11419 DIR *dirp = opendir(".");
11420 if (dirfd(dirp) >= 0)
11428 if eval $compile; then
11432 $define) echo "dirfd() found." >&4 ;;
11433 *) echo "dirfd() NOT found." >&4 ;;
11439 : see if dlerror exists
11442 set dlerror d_dlerror
11446 : see if dlfcn is available
11447 set dlfcn.h i_dlfcn
11454 On a few systems, the dynamically loaded modules that perl generates and uses
11455 will need a different extension than shared libs. The default will probably
11461 *) dflt="$dlext" ;;
11463 rp='What is the extension of dynamically loaded modules'
11472 : Check if dlsym need a leading underscore
11478 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
11479 $cat >dyna.c <<'EOM'
11486 #$i_stdlib I_STDLIB
11488 #include <stdlib.h>
11492 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
11494 #include <sys/types.h>
11499 extern int fred() ;
11508 int mode = RTLD_LAZY ;
11510 handle = dlopen("./dyna.$dlext", mode) ;
11511 if (handle == NULL) {
11516 symbol = dlsym(handle, "fred") ;
11517 if (symbol == NULL) {
11518 /* try putting a leading underscore */
11519 symbol = dlsym(handle, "_fred") ;
11520 if (symbol == NULL) {
11533 : Call the object file tmp-dyna.o in case dlext=o.
11534 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
11535 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
11536 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
11537 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
11540 1) echo "Test program failed using dlopen." >&4
11541 echo "Perhaps you should not use dynamic loading." >&4;;
11542 2) echo "Test program failed using dlsym." >&4
11543 echo "Perhaps you should not use dynamic loading." >&4;;
11544 3) echo "dlsym needs a leading underscore" >&4
11546 4) echo "dlsym doesn't need a leading underscore." >&4;;
11549 echo "I can't compile and run the test program." >&4
11550 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
11555 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
11560 : see if drand48_r exists
11561 set drand48_r d_drand48_r
11563 case "$d_drand48_r" in
11565 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
11566 case "$d_drand48_r_proto:$usethreads" in
11567 ":define") d_drand48_r_proto=define
11568 set d_drand48_r_proto drand48_r $hdrs
11572 case "$d_drand48_r_proto" in
11574 case "$drand48_r_proto" in
11575 ''|0) try='int drand48_r(struct drand48_data*, double*);'
11576 ./protochk "extern $try" $hdrs && drand48_r_proto=I_ST ;;
11578 case "$drand48_r_proto" in
11579 ''|0) d_drand48_r=undef
11581 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
11582 * ) case "$drand48_r_proto" in
11583 REENTRANT_PROTO*) ;;
11584 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
11586 echo "Prototype: $try" ;;
11589 *) case "$usethreads" in
11590 define) echo "drand48_r has no prototype, not using it." >&4 ;;
11597 *) drand48_r_proto=0
11601 : see if prototype for drand48 is available
11603 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
11606 : see if dup2 exists
11610 : see if eaccess exists
11611 set eaccess d_eaccess
11614 : see if endgrent exists
11615 set endgrent d_endgrent
11618 : see if this is an grp system
11624 xxx=`./findhdr grp.h`
11625 $cppstdin $cppflags $cppminus < $xxx >$$.h
11627 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
11639 set d_grpasswd; eval $setvar
11643 : see if endgrent_r exists
11644 set endgrent_r d_endgrent_r
11646 case "$d_endgrent_r" in
11648 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
11649 case "$d_endgrent_r_proto:$usethreads" in
11650 ":define") d_endgrent_r_proto=define
11651 set d_endgrent_r_proto endgrent_r $hdrs
11655 case "$d_endgrent_r_proto" in
11657 case "$endgrent_r_proto" in
11658 ''|0) try='int endgrent_r(FILE**);'
11659 ./protochk "extern $try" $hdrs && endgrent_r_proto=I_H ;;
11661 case "$endgrent_r_proto" in
11662 ''|0) try='void endgrent_r(FILE**);'
11663 ./protochk "extern $try" $hdrs && endgrent_r_proto=V_H ;;
11665 case "$endgrent_r_proto" in
11666 ''|0) d_endgrent_r=undef
11668 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
11669 * ) case "$endgrent_r_proto" in
11670 REENTRANT_PROTO*) ;;
11671 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
11673 echo "Prototype: $try" ;;
11676 *) case "$usethreads" in
11677 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
11684 *) endgrent_r_proto=0
11688 : see if endhostent exists
11689 set endhostent d_endhent
11692 : see if this is a netdb.h system
11693 set netdb.h i_netdb
11696 : see if endhostent_r exists
11697 set endhostent_r d_endhostent_r
11699 case "$d_endhostent_r" in
11701 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11702 case "$d_endhostent_r_proto:$usethreads" in
11703 ":define") d_endhostent_r_proto=define
11704 set d_endhostent_r_proto endhostent_r $hdrs
11708 case "$d_endhostent_r_proto" in
11710 case "$endhostent_r_proto" in
11711 ''|0) try='int endhostent_r(struct hostent_data*);'
11712 ./protochk "extern $try" $hdrs && endhostent_r_proto=I_D ;;
11714 case "$endhostent_r_proto" in
11715 ''|0) try='void endhostent_r(struct hostent_data*);'
11716 ./protochk "extern $try" $hdrs && endhostent_r_proto=V_D ;;
11718 case "$endhostent_r_proto" in
11719 ''|0) d_endhostent_r=undef
11720 endhostent_r_proto=0
11721 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
11722 * ) case "$endhostent_r_proto" in
11723 REENTRANT_PROTO*) ;;
11724 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
11726 echo "Prototype: $try" ;;
11729 *) case "$usethreads" in
11730 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
11732 d_endhostent_r=undef
11733 endhostent_r_proto=0
11737 *) endhostent_r_proto=0
11741 : see if endnetent exists
11742 set endnetent d_endnent
11745 : see if endnetent_r exists
11746 set endnetent_r d_endnetent_r
11748 case "$d_endnetent_r" in
11750 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11751 case "$d_endnetent_r_proto:$usethreads" in
11752 ":define") d_endnetent_r_proto=define
11753 set d_endnetent_r_proto endnetent_r $hdrs
11757 case "$d_endnetent_r_proto" in
11759 case "$endnetent_r_proto" in
11760 ''|0) try='int endnetent_r(struct netent_data*);'
11761 ./protochk "extern $try" $hdrs && endnetent_r_proto=I_D ;;
11763 case "$endnetent_r_proto" in
11764 ''|0) try='void endnetent_r(struct netent_data*);'
11765 ./protochk "extern $try" $hdrs && endnetent_r_proto=V_D ;;
11767 case "$endnetent_r_proto" in
11768 ''|0) d_endnetent_r=undef
11769 endnetent_r_proto=0
11770 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
11771 * ) case "$endnetent_r_proto" in
11772 REENTRANT_PROTO*) ;;
11773 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
11775 echo "Prototype: $try" ;;
11778 *) case "$usethreads" in
11779 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
11781 d_endnetent_r=undef
11782 endnetent_r_proto=0
11786 *) endnetent_r_proto=0
11790 : see if endprotoent exists
11791 set endprotoent d_endpent
11794 : see if endprotoent_r exists
11795 set endprotoent_r d_endprotoent_r
11797 case "$d_endprotoent_r" in
11799 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11800 case "$d_endprotoent_r_proto:$usethreads" in
11801 ":define") d_endprotoent_r_proto=define
11802 set d_endprotoent_r_proto endprotoent_r $hdrs
11806 case "$d_endprotoent_r_proto" in
11808 case "$endprotoent_r_proto" in
11809 ''|0) try='int endprotoent_r(struct protoent_data*);'
11810 ./protochk "extern $try" $hdrs && endprotoent_r_proto=I_D ;;
11812 case "$endprotoent_r_proto" in
11813 ''|0) try='void endprotoent_r(struct protoent_data*);'
11814 ./protochk "extern $try" $hdrs && endprotoent_r_proto=V_D ;;
11816 case "$endprotoent_r_proto" in
11817 ''|0) d_endprotoent_r=undef
11818 endprotoent_r_proto=0
11819 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
11820 * ) case "$endprotoent_r_proto" in
11821 REENTRANT_PROTO*) ;;
11822 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
11824 echo "Prototype: $try" ;;
11827 *) case "$usethreads" in
11828 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
11830 d_endprotoent_r=undef
11831 endprotoent_r_proto=0
11835 *) endprotoent_r_proto=0
11839 : see if endpwent exists
11840 set endpwent d_endpwent
11843 : see if this is a pwd.h system
11849 xxx=`./findhdr pwd.h`
11850 $cppstdin $cppflags $cppminus < $xxx >$$.h
11852 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
11860 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
11868 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
11876 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
11884 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
11892 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
11900 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
11908 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
11920 set d_pwquota; eval $setvar
11921 set d_pwage; eval $setvar
11922 set d_pwchange; eval $setvar
11923 set d_pwclass; eval $setvar
11924 set d_pwexpire; eval $setvar
11925 set d_pwcomment; eval $setvar
11926 set d_pwgecos; eval $setvar
11927 set d_pwpasswd; eval $setvar
11931 : see if endpwent_r exists
11932 set endpwent_r d_endpwent_r
11934 case "$d_endpwent_r" in
11936 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
11937 case "$d_endpwent_r_proto:$usethreads" in
11938 ":define") d_endpwent_r_proto=define
11939 set d_endpwent_r_proto endpwent_r $hdrs
11943 case "$d_endpwent_r_proto" in
11945 case "$endpwent_r_proto" in
11946 ''|0) try='int endpwent_r(FILE**);'
11947 ./protochk "extern $try" $hdrs && endpwent_r_proto=I_H ;;
11949 case "$endpwent_r_proto" in
11950 ''|0) try='void endpwent_r(FILE**);'
11951 ./protochk "extern $try" $hdrs && endpwent_r_proto=V_H ;;
11953 case "$endpwent_r_proto" in
11954 ''|0) d_endpwent_r=undef
11956 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
11957 * ) case "$endpwent_r_proto" in
11958 REENTRANT_PROTO*) ;;
11959 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
11961 echo "Prototype: $try" ;;
11964 *) case "$usethreads" in
11965 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
11972 *) endpwent_r_proto=0
11976 : see if endservent exists
11977 set endservent d_endsent
11980 : see if endservent_r exists
11981 set endservent_r d_endservent_r
11983 case "$d_endservent_r" in
11985 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11986 case "$d_endservent_r_proto:$usethreads" in
11987 ":define") d_endservent_r_proto=define
11988 set d_endservent_r_proto endservent_r $hdrs
11992 case "$d_endservent_r_proto" in
11994 case "$endservent_r_proto" in
11995 ''|0) try='int endservent_r(struct servent_data*);'
11996 ./protochk "extern $try" $hdrs && endservent_r_proto=I_D ;;
11998 case "$endservent_r_proto" in
11999 ''|0) try='void endservent_r(struct servent_data*);'
12000 ./protochk "extern $try" $hdrs && endservent_r_proto=V_D ;;
12002 case "$endservent_r_proto" in
12003 ''|0) d_endservent_r=undef
12004 endservent_r_proto=0
12005 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
12006 * ) case "$endservent_r_proto" in
12007 REENTRANT_PROTO*) ;;
12008 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
12010 echo "Prototype: $try" ;;
12013 *) case "$usethreads" in
12014 define) echo "endservent_r has no prototype, not using it." >&4 ;;
12016 d_endservent_r=undef
12017 endservent_r_proto=0
12021 *) endservent_r_proto=0
12025 : Locate the flags for 'open()'
12028 #include <sys/types.h>
12033 #include <sys/file.h>
12035 #$i_stdlib I_STDLIB
12037 #include <stdlib.h>
12048 : check sys/file.h first to get FREAD on Sun
12049 if $test `./findhdr sys/file.h` && \
12050 set try -DI_SYS_FILE && eval $compile; then
12052 echo "<sys/file.h> defines the O_* constants..." >&4
12053 if $run ./try; then
12054 echo "and you have the 3 argument form of open()." >&4
12057 echo "but not the 3 argument form of open(). Oh, well." >&4
12060 elif $test `./findhdr fcntl.h` && \
12061 set try -DI_FCNTL && eval $compile; then
12063 echo "<fcntl.h> defines the O_* constants..." >&4
12064 if $run ./try; then
12065 echo "and you have the 3 argument form of open()." >&4
12068 echo "but not the 3 argument form of open(). Oh, well." >&4
12073 echo "I can't find the O_* constant definitions! You got problems." >&4
12079 : see which of string.h or strings.h is needed
12081 strings=`./findhdr string.h`
12082 if $test "$strings" && $test -r "$strings"; then
12083 echo "Using <string.h> instead of <strings.h>." >&4
12087 strings=`./findhdr strings.h`
12088 if $test "$strings" && $test -r "$strings"; then
12089 echo "Using <strings.h> instead of <string.h>." >&4
12091 echo "No string header found -- You'll surely have problems." >&4
12096 case "$i_string" in
12097 "$undef") strings=`./findhdr strings.h`;;
12098 *) strings=`./findhdr string.h`;;
12101 : see if this is a sys/file.h system
12106 : do we need to include sys/file.h ?
12110 if $h_sysfile; then
12112 echo "We'll be including <sys/file.h>." >&4
12115 echo "We won't be including <sys/file.h>." >&4
12125 : see if fcntl.h is there
12130 : see if we can include fcntl.h
12136 echo "We'll be including <fcntl.h>." >&4
12139 if $h_sysfile; then
12140 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
12142 echo "We won't be including <fcntl.h>." >&4
12154 : check for non-blocking I/O stuff
12155 case "$h_sysfile" in
12156 true) echo "#include <sys/file.h>" > head.c;;
12159 true) echo "#include <fcntl.h>" > head.c;;
12160 *) echo "#include <sys/fcntl.h>" > head.c;;
12165 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
12166 case "$o_nonblock" in
12168 $cat head.c > try.c
12169 $cat >>try.c <<EOCP
12171 #$i_stdlib I_STDLIB
12173 #include <stdlib.h>
12181 printf("O_NONBLOCK\n");
12185 printf("O_NDELAY\n");
12189 printf("FNDELAY\n");
12196 if eval $compile_ok; then
12197 o_nonblock=`$run ./try`
12198 case "$o_nonblock" in
12199 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
12200 *) echo "Seems like we can use $o_nonblock.";;
12203 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
12206 *) echo "Using $hint value $o_nonblock.";;
12208 $rm -f try try.* .out core
12211 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
12214 $cat head.c > try.c
12215 $cat >>try.c <<EOCP
12217 #include <sys/types.h>
12218 #include <signal.h>
12220 #$i_stdlib I_STDLIB
12222 #include <stdlib.h>
12228 #define MY_O_NONBLOCK $o_nonblock
12229 #ifndef errno /* XXX need better Configure test */
12232 #$i_unistd I_UNISTD
12234 #include <unistd.h>
12236 #$i_string I_STRING
12238 #include <string.h>
12240 #include <strings.h>
12242 $signal_t blech(int x) { exit(3); }
12244 $cat >> try.c <<'EOCP'
12252 pipe(pd); /* Down: child -> parent */
12253 pipe(pu); /* Up: parent -> child */
12256 close(pd[1]); /* Parent reads from pd[0] */
12257 close(pu[0]); /* Parent writes (blocking) to pu[1] */
12259 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
12264 signal(SIGALRM, blech);
12266 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
12268 sprintf(string, "%d\n", ret);
12269 write(2, string, strlen(string));
12272 if (errno == EAGAIN) {
12273 printf("EAGAIN\n");
12278 if (errno == EWOULDBLOCK)
12279 printf("EWOULDBLOCK\n");
12282 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
12283 sleep(2); /* Give it time to close our pipe */
12285 ret = read(pd[0], buf, 1); /* Should read EOF */
12287 sprintf(string, "%d\n", ret);
12288 write(4, string, strlen(string));
12292 close(pd[0]); /* We write to pd[1] */
12293 close(pu[1]); /* We read from pu[0] */
12294 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
12295 close(pd[1]); /* Pipe pd is now fully closed! */
12296 exit(0); /* Bye bye, thank you for playing! */
12300 if eval $compile_ok; then
12301 echo "$startsh" >mtry
12302 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
12304 ./mtry >/dev/null 2>&1
12306 0) eagain=`$cat try.out`;;
12307 1) echo "Could not perform non-blocking setting!";;
12308 2) echo "I did a successful read() for something that was not there!";;
12309 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
12310 4) echo "Could not find F_SETFL!";;
12311 *) echo "Something terribly wrong happened during testing.";;
12313 rd_nodata=`$cat try.ret`
12314 echo "A read() system call with no data present returns $rd_nodata."
12315 case "$rd_nodata" in
12318 echo "(That's peculiar, fixing that to be -1.)"
12324 echo "Forcing errno EAGAIN on read() with no data available."
12328 echo "Your read() sets errno to $eagain when no data is available."
12331 status=`$cat try.err`
12333 0) echo "And it correctly returns 0 to signal EOF.";;
12334 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
12335 *) echo "However, your read() returns '$status' on EOF??";;
12338 if test "$status" = "$rd_nodata"; then
12339 echo "WARNING: you can't distinguish between EOF and no data!"
12343 echo "I can't compile the test program--assuming errno EAGAIN will do."
12350 echo "Using $hint value $eagain."
12351 echo "Your read() returns $rd_nodata when no data is present."
12352 case "$d_eofnblk" in
12353 "$define") echo "And you can see EOF because read() returns 0.";;
12354 "$undef") echo "But you can't see EOF status from read() returned value.";;
12356 echo "(Assuming you can't see EOF status from read anyway.)"
12362 $rm -f try try.* .out core head.c mtry
12364 : see if _ptr and _cnt from stdio act std
12367 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
12368 echo "(Looks like you have stdio.h from BSD.)"
12369 case "$stdio_ptr" in
12370 '') stdio_ptr='((fp)->_p)'
12373 *) ptr_lval=$d_stdio_ptr_lval;;
12375 case "$stdio_cnt" in
12376 '') stdio_cnt='((fp)->_r)'
12379 *) cnt_lval=$d_stdio_cnt_lval;;
12381 case "$stdio_base" in
12382 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
12384 case "$stdio_bufsiz" in
12385 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
12387 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
12388 echo "(Looks like you have stdio.h from Linux.)"
12389 case "$stdio_ptr" in
12390 '') stdio_ptr='((fp)->_IO_read_ptr)'
12393 *) ptr_lval=$d_stdio_ptr_lval;;
12395 case "$stdio_cnt" in
12396 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
12399 *) cnt_lval=$d_stdio_cnt_lval;;
12401 case "$stdio_base" in
12402 '') stdio_base='((fp)->_IO_read_base)';;
12404 case "$stdio_bufsiz" in
12405 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
12408 case "$stdio_ptr" in
12409 '') stdio_ptr='((fp)->_ptr)'
12412 *) ptr_lval=$d_stdio_ptr_lval;;
12414 case "$stdio_cnt" in
12415 '') stdio_cnt='((fp)->_cnt)'
12418 *) cnt_lval=$d_stdio_cnt_lval;;
12420 case "$stdio_base" in
12421 '') stdio_base='((fp)->_base)';;
12423 case "$stdio_bufsiz" in
12424 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
12428 : test whether _ptr and _cnt really work
12429 echo "Checking how std your stdio is..." >&4
12432 #$i_stdlib I_STDLIB
12434 #include <stdlib.h>
12436 #define FILE_ptr(fp) $stdio_ptr
12437 #define FILE_cnt(fp) $stdio_cnt
12439 FILE *fp = fopen("try.c", "r");
12442 18 <= FILE_cnt(fp) &&
12443 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12451 if eval $compile && $to try.c; then
12452 if $run ./try; then
12453 echo "Your stdio acts pretty std."
12456 echo "Your stdio isn't very std."
12459 echo "Your stdio doesn't appear very std."
12463 # glibc 2.2.90 and above apparently change stdio streams so Perl's
12464 # direct buffer manipulation no longer works. The Configure tests
12465 # should be changed to correctly detect this, but until then,
12466 # the following check should at least let perl compile and run.
12467 # (This quick fix should be updated before 5.8.1.)
12468 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
12469 # A. Dougherty, June 3, 2002.
12470 case "$d_gnulibc" in
12472 case "$gnulibc_version" in
12476 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
12485 : Can _ptr be used as an lvalue?
12486 case "$d_stdstdio$ptr_lval" in
12487 $define$define) val=$define ;;
12490 set d_stdio_ptr_lval
12493 : Can _cnt be used as an lvalue?
12494 case "$d_stdstdio$cnt_lval" in
12495 $define$define) val=$define ;;
12498 set d_stdio_cnt_lval
12502 : test whether setting _ptr sets _cnt as a side effect
12503 d_stdio_ptr_lval_sets_cnt="$undef"
12504 d_stdio_ptr_lval_nochange_cnt="$undef"
12505 case "$d_stdio_ptr_lval$d_stdstdio" in
12507 echo "Checking to see what happens if we set the stdio ptr..." >&4
12510 /* Can we scream? */
12511 /* Eat dust sed :-) */
12512 /* In the buffer space, no one can hear you scream. */
12513 #$i_stdlib I_STDLIB
12515 #include <stdlib.h>
12517 #define FILE_ptr(fp) $stdio_ptr
12518 #define FILE_cnt(fp) $stdio_cnt
12519 #include <sys/types.h>
12521 FILE *fp = fopen("try.c", "r");
12526 puts("Fail even to read");
12529 c = getc(fp); /* Read away the first # */
12531 puts("Fail even to read");
12535 18 <= FILE_cnt(fp) &&
12536 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12538 puts("Fail even to read");
12541 ptr = (char*) FILE_ptr(fp);
12542 cnt = (size_t)FILE_cnt(fp);
12544 FILE_ptr(fp) += 42;
12546 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
12547 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
12550 if (FILE_cnt(fp) <= 20) {
12551 printf ("Fail (<20 chars to test)");
12554 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
12555 puts("Fail compare");
12558 if (cnt == FILE_cnt(fp)) {
12559 puts("Pass_unchanged");
12562 if (FILE_cnt(fp) == (cnt - 42)) {
12563 puts("Pass_changed");
12566 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
12572 if eval $compile && $to try.c; then
12573 case `$run ./try` in
12575 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
12576 d_stdio_ptr_lval_sets_cnt="$define" ;;
12578 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
12579 d_stdio_ptr_lval_nochange_cnt="$define" ;;
12581 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
12583 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
12586 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
12592 : see if _base is also standard
12594 case "$d_stdstdio" in
12598 #$i_stdlib I_STDLIB
12600 #include <stdlib.h>
12602 #define FILE_base(fp) $stdio_base
12603 #define FILE_bufsiz(fp) $stdio_bufsiz
12605 FILE *fp = fopen("try.c", "r");
12608 19 <= FILE_bufsiz(fp) &&
12609 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
12616 if eval $compile && $to try.c; then
12617 if $run ./try; then
12618 echo "And its _base field acts std."
12621 echo "But its _base field isn't std."
12624 echo "However, it seems to be lacking the _base field."
12632 : see if fast_stdio exists
12634 case "$d_stdstdio:$d_stdio_ptr_lval" in
12636 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
12638 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
12649 : see if fchdir exists
12650 set fchdir d_fchdir
12653 : see if fchmod exists
12654 set fchmod d_fchmod
12657 : see if fchown exists
12658 set fchown d_fchown
12661 : see if this is an fcntl system
12666 : See if fcntl-based locking works.
12668 #$i_stdlib I_STDLIB
12670 #include <stdlib.h>
12672 #include <unistd.h>
12674 #include <signal.h>
12675 $signal_t blech(int x) { exit(3); }
12677 #if defined(F_SETLK) && defined(F_SETLKW)
12678 struct flock flock;
12680 fd = open("try.c", O_RDONLY);
12681 flock.l_type = F_RDLCK;
12682 flock.l_whence = SEEK_SET;
12683 flock.l_start = flock.l_len = 0;
12684 signal(SIGALRM, blech);
12686 retval = fcntl(fd, F_SETLK, &flock);
12688 (retval < 0 ? exit(2) : exit(0));
12694 echo "Checking if fcntl-based file locking works... "
12698 if eval $compile_ok; then
12699 if $run ./try; then
12700 echo "Yes, it seems to work."
12703 echo "Nope, it didn't work."
12708 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
12709 *** This is (almost) impossible.
12710 *** If your NFS lock daemons are not feeling well, something like
12711 *** this may happen, please investigate. Cannot continue, aborting.
12719 echo "I'm unable to compile the test program, so I'll assume not."
12724 echo "Nope, since you don't even have fcntl()."
12727 set d_fcntl_can_lock
12732 : check for fd_set items
12735 Checking to see how well your C compiler handles fd_set and friends ...
12738 #$i_stdlib I_STDLIB
12740 #include <stdlib.h>
12742 #$i_systime I_SYS_TIME
12743 #$i_sysselct I_SYS_SELECT
12744 #$d_socket HAS_SOCKET
12745 #include <sys/types.h>
12747 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
12750 #include <sys/time.h>
12752 #ifdef I_SYS_SELECT
12753 #include <sys/select.h>
12762 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
12770 if eval $compile; then
12771 d_fds_bits="$define"
12773 echo "Well, your system knows about the normal fd_set typedef..." >&4
12774 if $run ./try; then
12775 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
12776 d_fd_macros="$define"
12779 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
12781 d_fd_macros="$undef"
12785 Hmm, your compiler has some difficulty with fd_set. Checking further...
12788 if eval $compile; then
12789 d_fds_bits="$undef"
12791 echo "Well, your system has some sort of fd_set available..." >&4
12792 if $run ./try; then
12793 echo "and you have the normal fd_set macros." >&4
12794 d_fd_macros="$define"
12797 but not the normal fd_set macros! Gross! More work for me...
12799 d_fd_macros="$undef"
12802 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
12804 d_fds_bits="$undef"
12805 d_fd_macros="$undef"
12810 : see if fgetpos exists
12811 set fgetpos d_fgetpos
12814 : see if finite exists
12815 set finite d_finite
12818 : see if finitel exists
12819 set finitel d_finitel
12822 : see if flock exists
12826 : see if prototype for flock is available
12828 set d_flockproto flock $i_sysfile sys/file.h
12831 : see if fork exists
12835 : see if fp_class exists
12836 set fp_class d_fp_class
12839 : see if pathconf exists
12840 set pathconf d_pathconf
12843 : see if fpathconf exists
12844 set fpathconf d_fpathconf
12847 : see if fpclass exists
12848 set fpclass d_fpclass
12851 : see if fpclassify exists
12852 set fpclassify d_fpclassify
12855 : see if fpclassl exists
12856 set fpclassl d_fpclassl
12860 : check for fpos64_t
12862 echo "Checking to see if you have fpos64_t..." >&4
12865 int main() { fpos64_t x = 7; }
12868 if eval $compile; then
12870 echo "You have fpos64_t."
12873 echo "You do not have fpos64_t."
12874 case "$fpossize" in
12875 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
12882 : see if frexpl exists
12883 set frexpl d_frexpl
12886 : see if this is a sys/param system
12887 set sys/param.h i_sysparam
12890 : see if this is a sys/mount.h system
12891 set sys/mount.h i_sysmount
12896 echo "Checking to see if your system supports struct fs_data..." >&4
12897 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
12899 case "$d_fs_data_s" in
12900 "$define") echo "Yes, it does." ;;
12901 *) echo "No, it doesn't." ;;
12904 : see if fseeko exists
12905 set fseeko d_fseeko
12907 case "$longsize" in
12908 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
12911 : see if fsetpos exists
12912 set fsetpos d_fsetpos
12916 : see if fstatfs exists
12917 set fstatfs d_fstatfs
12921 : see if statvfs exists
12922 set statvfs d_statvfs
12925 : see if fstatvfs exists
12926 set fstatvfs d_fstatvfs
12930 : see if fsync exists
12934 : see if ftello exists
12935 set ftello d_ftello
12937 case "$longsize" in
12938 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
12942 : check for a working futimes
12944 echo "Checking for a working futimes()" >&4
12947 #include <sys/time.h>
12954 fd = open ("try.c", O_RDWR);
12955 if (-1 == fd) exit (1);
12956 rv = futimes (fd, NULL);
12957 exit (rv == -1 ? errno : 0);
12961 if eval $compile; then
12965 0) echo "Yes, it does" >&4
12966 d_futimes="$define"
12968 *) echo "No, it has futimes, but it isn't working ($rc) (probably harmless)\n" >&4
12972 echo "No, it does not (probably harmless)\n" >&4
12974 $rm -f try.* try core core.try.*
12976 : see if getcwd exists
12977 set getcwd d_getcwd
12980 : see if getespwnam exists
12981 set getespwnam d_getespwnam
12985 : see if getfsstat exists
12986 set getfsstat d_getfsstat
12989 : see if getgrent exists
12990 set getgrent d_getgrent
12993 : see if getgrent_r exists
12994 set getgrent_r d_getgrent_r
12996 case "$d_getgrent_r" in
12998 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12999 case "$d_getgrent_r_proto:$usethreads" in
13000 ":define") d_getgrent_r_proto=define
13001 set d_getgrent_r_proto getgrent_r $hdrs
13005 case "$d_getgrent_r_proto" in
13007 case "$getgrent_r_proto" in
13008 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
13009 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBWR ;;
13011 case "$getgrent_r_proto" in
13012 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
13013 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIR ;;
13015 case "$getgrent_r_proto" in
13016 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
13017 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBW ;;
13019 case "$getgrent_r_proto" in
13020 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
13021 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBI ;;
13023 case "$getgrent_r_proto" in
13024 ''|0) try='int getgrent_r(struct group*, char*, int);'
13025 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBI ;;
13027 case "$getgrent_r_proto" in
13028 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
13029 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIH ;;
13031 case "$getgrent_r_proto" in
13032 ''|0) d_getgrent_r=undef
13034 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
13035 * ) case "$getgrent_r_proto" in
13036 REENTRANT_PROTO*) ;;
13037 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
13039 echo "Prototype: $try" ;;
13042 *) case "$usethreads" in
13043 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
13050 *) getgrent_r_proto=0
13054 : see if getgrgid_r exists
13055 set getgrgid_r d_getgrgid_r
13057 case "$d_getgrgid_r" in
13059 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13060 case "$d_getgrgid_r_proto:$usethreads" in
13061 ":define") d_getgrgid_r_proto=define
13062 set d_getgrgid_r_proto getgrgid_r $hdrs
13066 case "$d_getgrgid_r_proto" in
13068 case "$getgrgid_r_proto" in
13069 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
13070 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
13072 case "$getgrgid_r_proto" in
13073 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
13074 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
13076 case "$getgrgid_r_proto" in
13077 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
13078 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
13080 case "$getgrgid_r_proto" in
13081 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
13082 ./protochk "extern $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
13084 case "$getgrgid_r_proto" in
13085 ''|0) d_getgrgid_r=undef
13087 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
13088 * ) case "$getgrgid_r_proto" in
13089 REENTRANT_PROTO*) ;;
13090 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
13092 echo "Prototype: $try" ;;
13095 *) case "$usethreads" in
13096 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
13103 *) getgrgid_r_proto=0
13107 : see if getgrnam_r exists
13108 set getgrnam_r d_getgrnam_r
13110 case "$d_getgrnam_r" in
13112 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13113 case "$d_getgrnam_r_proto:$usethreads" in
13114 ":define") d_getgrnam_r_proto=define
13115 set d_getgrnam_r_proto getgrnam_r $hdrs
13119 case "$d_getgrnam_r_proto" in
13121 case "$getgrnam_r_proto" in
13122 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
13123 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
13125 case "$getgrnam_r_proto" in
13126 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
13127 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
13129 case "$getgrnam_r_proto" in
13130 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
13131 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CBI ;;
13133 case "$getgrnam_r_proto" in
13134 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
13135 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
13137 case "$getgrnam_r_proto" in
13138 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
13139 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
13141 case "$getgrnam_r_proto" in
13142 ''|0) d_getgrnam_r=undef
13144 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
13145 * ) case "$getgrnam_r_proto" in
13146 REENTRANT_PROTO*) ;;
13147 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
13149 echo "Prototype: $try" ;;
13152 *) case "$usethreads" in
13153 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
13160 *) getgrnam_r_proto=0
13164 : see if gethostbyaddr exists
13165 set gethostbyaddr d_gethbyaddr
13168 : see if gethostbyname exists
13169 set gethostbyname d_gethbyname
13172 : see if gethostent exists
13173 set gethostent d_gethent
13176 : see how we will look up host name
13179 if set gethostname val -f d_gethname; eval $csym; $val; then
13180 echo 'gethostname() found.' >&4
13181 d_gethname="$define"
13184 if set uname val -f d_uname; eval $csym; $val; then
13187 uname() was found, but you're running xenix, and older versions of xenix
13188 have a broken uname(). If you don't really know whether your xenix is old
13189 enough to have a broken system call, use the default answer.
13194 "$define") dflt=n;;
13196 rp='Is your uname() broken?'
13199 n*) d_uname="$define"; call=uname;;
13202 echo 'uname() found.' >&4
13209 case "$d_gethname" in
13210 '') d_gethname="$undef";;
13213 '') d_uname="$undef";;
13215 case "$d_uname$d_gethname" in
13220 Every now and then someone has a $call() that lies about the hostname
13221 but can't be fixed for political or economic reasons. If you wish, I can
13222 pretend $call() isn't there and maybe compute hostname at run-time
13223 thanks to the '$phostname' command.
13226 rp="Shall I ignore $call() from now on?"
13229 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
13232 case "$phostname" in
13233 '') aphostname='';;
13234 *) case "$aphostname" in
13236 *) set X $phostname
13240 file=`./loc $file $file $pth`
13241 aphostname=`echo $file $*`
13246 case "$d_uname$d_gethname" in
13249 case "$phostname" in
13251 echo "There will be no way for $package to get your hostname." >&4;;
13253 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
13257 case "$d_phostname" in
13258 '') d_phostname="$undef";;
13261 : see if gethostbyaddr_r exists
13262 set gethostbyaddr_r d_gethostbyaddr_r
13264 case "$d_gethostbyaddr_r" in
13266 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13267 case "$d_gethostbyaddr_r_proto:$usethreads" in
13268 ":define") d_gethostbyaddr_r_proto=define
13269 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
13273 case "$d_gethostbyaddr_r_proto" in
13275 case "$gethostbyaddr_r_proto" in
13276 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13277 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
13279 case "$gethostbyaddr_r_proto" in
13280 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
13281 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
13283 case "$gethostbyaddr_r_proto" in
13284 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
13285 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
13287 case "$gethostbyaddr_r_proto" in
13288 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
13289 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
13291 case "$gethostbyaddr_r_proto" in
13292 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
13293 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
13295 case "$gethostbyaddr_r_proto" in
13296 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
13297 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
13299 case "$gethostbyaddr_r_proto" in
13300 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
13301 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
13303 case "$gethostbyaddr_r_proto" in
13304 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
13305 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
13307 case "$gethostbyaddr_r_proto" in
13308 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
13309 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
13311 case "$gethostbyaddr_r_proto" in
13312 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
13313 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
13315 case "$gethostbyaddr_r_proto" in
13316 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13317 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
13319 case "$gethostbyaddr_r_proto" in
13320 ''|0) d_gethostbyaddr_r=undef
13321 gethostbyaddr_r_proto=0
13322 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
13323 * ) case "$gethostbyaddr_r_proto" in
13324 REENTRANT_PROTO*) ;;
13325 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
13327 echo "Prototype: $try" ;;
13330 *) case "$usethreads" in
13331 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
13333 d_gethostbyaddr_r=undef
13334 gethostbyaddr_r_proto=0
13338 *) gethostbyaddr_r_proto=0
13342 : see if gethostbyname_r exists
13343 set gethostbyname_r d_gethostbyname_r
13345 case "$d_gethostbyname_r" in
13347 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13348 case "$d_gethostbyname_r_proto:$usethreads" in
13349 ":define") d_gethostbyname_r_proto=define
13350 set d_gethostbyname_r_proto gethostbyname_r $hdrs
13354 case "$d_gethostbyname_r_proto" in
13356 case "$gethostbyname_r_proto" in
13357 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
13358 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
13360 case "$gethostbyname_r_proto" in
13361 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
13362 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
13364 case "$gethostbyname_r_proto" in
13365 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
13366 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
13368 case "$gethostbyname_r_proto" in
13369 ''|0) d_gethostbyname_r=undef
13370 gethostbyname_r_proto=0
13371 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
13372 * ) case "$gethostbyname_r_proto" in
13373 REENTRANT_PROTO*) ;;
13374 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
13376 echo "Prototype: $try" ;;
13379 *) case "$usethreads" in
13380 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
13382 d_gethostbyname_r=undef
13383 gethostbyname_r_proto=0
13387 *) gethostbyname_r_proto=0
13391 : see if gethostent_r exists
13392 set gethostent_r d_gethostent_r
13394 case "$d_gethostent_r" in
13396 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13397 case "$d_gethostent_r_proto:$usethreads" in
13398 ":define") d_gethostent_r_proto=define
13399 set d_gethostent_r_proto gethostent_r $hdrs
13403 case "$d_gethostent_r_proto" in
13405 case "$gethostent_r_proto" in
13406 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
13407 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
13409 case "$gethostent_r_proto" in
13410 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
13411 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBIE ;;
13413 case "$gethostent_r_proto" in
13414 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
13415 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBIE ;;
13417 case "$gethostent_r_proto" in
13418 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
13419 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBI ;;
13421 case "$gethostent_r_proto" in
13422 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
13423 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBI ;;
13425 case "$gethostent_r_proto" in
13426 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
13427 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SD ;;
13429 case "$gethostent_r_proto" in
13430 ''|0) d_gethostent_r=undef
13431 gethostent_r_proto=0
13432 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
13433 * ) case "$gethostent_r_proto" in
13434 REENTRANT_PROTO*) ;;
13435 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
13437 echo "Prototype: $try" ;;
13440 *) case "$usethreads" in
13441 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
13443 d_gethostent_r=undef
13444 gethostent_r_proto=0
13448 *) gethostent_r_proto=0
13452 : see if prototypes for various gethostxxx netdb.h functions are available
13454 set d_gethostprotos gethostent $i_netdb netdb.h
13457 : see if getitimer exists
13458 set getitimer d_getitimer
13461 : see if getlogin exists
13462 set getlogin d_getlogin
13465 : see if getlogin_r exists
13466 set getlogin_r d_getlogin_r
13468 case "$d_getlogin_r" in
13470 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
13471 case "$d_getlogin_r_proto:$usethreads" in
13472 ":define") d_getlogin_r_proto=define
13473 set d_getlogin_r_proto getlogin_r $hdrs
13477 case "$d_getlogin_r_proto" in
13479 case "$getlogin_r_proto" in
13480 ''|0) try='int getlogin_r(char*, size_t);'
13481 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BW ;;
13483 case "$getlogin_r_proto" in
13484 ''|0) try='int getlogin_r(char*, int);'
13485 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BI ;;
13487 case "$getlogin_r_proto" in
13488 ''|0) try='char* getlogin_r(char*, size_t);'
13489 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BW ;;
13491 case "$getlogin_r_proto" in
13492 ''|0) try='char* getlogin_r(char*, int);'
13493 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BI ;;
13495 case "$getlogin_r_proto" in
13496 ''|0) d_getlogin_r=undef
13498 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
13499 * ) case "$getlogin_r_proto" in
13500 REENTRANT_PROTO*) ;;
13501 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
13503 echo "Prototype: $try" ;;
13506 *) case "$usethreads" in
13507 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
13514 *) getlogin_r_proto=0
13518 : see if getmnt exists
13519 set getmnt d_getmnt
13522 : see if getmntent exists
13523 set getmntent d_getmntent
13526 : see if getnetbyaddr exists
13527 set getnetbyaddr d_getnbyaddr
13530 : see if getnetbyname exists
13531 set getnetbyname d_getnbyname
13534 : see if getnetent exists
13535 set getnetent d_getnent
13538 : see if getnetbyaddr_r exists
13539 set getnetbyaddr_r d_getnetbyaddr_r
13541 case "$d_getnetbyaddr_r" in
13543 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13544 case "$d_getnetbyaddr_r_proto:$usethreads" in
13545 ":define") d_getnetbyaddr_r_proto=define
13546 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
13550 case "$d_getnetbyaddr_r_proto" in
13552 case "$getnetbyaddr_r_proto" in
13553 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
13554 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
13556 case "$getnetbyaddr_r_proto" in
13557 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
13558 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
13560 case "$getnetbyaddr_r_proto" in
13561 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
13562 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
13564 case "$getnetbyaddr_r_proto" in
13565 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
13566 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
13568 case "$getnetbyaddr_r_proto" in
13569 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
13570 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
13572 case "$getnetbyaddr_r_proto" in
13573 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
13574 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
13576 case "$getnetbyaddr_r_proto" in
13577 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
13578 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
13580 case "$getnetbyaddr_r_proto" in
13581 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
13582 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
13584 case "$getnetbyaddr_r_proto" in
13585 ''|0) d_getnetbyaddr_r=undef
13586 getnetbyaddr_r_proto=0
13587 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
13588 * ) case "$getnetbyaddr_r_proto" in
13589 REENTRANT_PROTO*) ;;
13590 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
13592 echo "Prototype: $try" ;;
13595 *) case "$usethreads" in
13596 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
13598 d_getnetbyaddr_r=undef
13599 getnetbyaddr_r_proto=0
13603 *) getnetbyaddr_r_proto=0
13607 : see if getnetbyname_r exists
13608 set getnetbyname_r d_getnetbyname_r
13610 case "$d_getnetbyname_r" in
13612 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13613 case "$d_getnetbyname_r_proto:$usethreads" in
13614 ":define") d_getnetbyname_r_proto=define
13615 set d_getnetbyname_r_proto getnetbyname_r $hdrs
13619 case "$d_getnetbyname_r_proto" in
13621 case "$getnetbyname_r_proto" in
13622 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
13623 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
13625 case "$getnetbyname_r_proto" in
13626 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
13627 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
13629 case "$getnetbyname_r_proto" in
13630 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
13631 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
13633 case "$getnetbyname_r_proto" in
13634 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
13635 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
13637 case "$getnetbyname_r_proto" in
13638 ''|0) d_getnetbyname_r=undef
13639 getnetbyname_r_proto=0
13640 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
13641 * ) case "$getnetbyname_r_proto" in
13642 REENTRANT_PROTO*) ;;
13643 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
13645 echo "Prototype: $try" ;;
13648 *) case "$usethreads" in
13649 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
13651 d_getnetbyname_r=undef
13652 getnetbyname_r_proto=0
13656 *) getnetbyname_r_proto=0
13660 : see if getnetent_r exists
13661 set getnetent_r d_getnetent_r
13663 case "$d_getnetent_r" in
13665 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13666 case "$d_getnetent_r_proto:$usethreads" in
13667 ":define") d_getnetent_r_proto=define
13668 set d_getnetent_r_proto getnetent_r $hdrs
13672 case "$d_getnetent_r_proto" in
13674 case "$getnetent_r_proto" in
13675 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
13676 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
13678 case "$getnetent_r_proto" in
13679 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
13680 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBIE ;;
13682 case "$getnetent_r_proto" in
13683 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
13684 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBIE ;;
13686 case "$getnetent_r_proto" in
13687 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
13688 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBI ;;
13690 case "$getnetent_r_proto" in
13691 ''|0) try='int getnetent_r(struct netent*, char*, int);'
13692 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBI ;;
13694 case "$getnetent_r_proto" in
13695 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
13696 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SD ;;
13698 case "$getnetent_r_proto" in
13699 ''|0) d_getnetent_r=undef
13700 getnetent_r_proto=0
13701 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
13702 * ) case "$getnetent_r_proto" in
13703 REENTRANT_PROTO*) ;;
13704 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
13706 echo "Prototype: $try" ;;
13709 *) case "$usethreads" in
13710 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
13712 d_getnetent_r=undef
13713 getnetent_r_proto=0
13717 *) getnetent_r_proto=0
13721 : see if prototypes for various getnetxxx netdb.h functions are available
13723 set d_getnetprotos getnetent $i_netdb netdb.h
13726 : see if getpagesize exists
13727 set getpagesize d_getpagsz
13731 : see if getprotobyname exists
13732 set getprotobyname d_getpbyname
13735 : see if getprotobynumber exists
13736 set getprotobynumber d_getpbynumber
13739 : see if getprotoent exists
13740 set getprotoent d_getpent
13743 : see if getpgid exists
13744 set getpgid d_getpgid
13747 : see if getpgrp2 exists
13748 set getpgrp2 d_getpgrp2
13751 : see if getppid exists
13752 set getppid d_getppid
13755 : see if getpriority exists
13756 set getpriority d_getprior
13759 : see if getprotobyname_r exists
13760 set getprotobyname_r d_getprotobyname_r
13762 case "$d_getprotobyname_r" in
13764 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13765 case "$d_getprotobyname_r_proto:$usethreads" in
13766 ":define") d_getprotobyname_r_proto=define
13767 set d_getprotobyname_r_proto getprotobyname_r $hdrs
13771 case "$d_getprotobyname_r_proto" in
13773 case "$getprotobyname_r_proto" in
13774 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
13775 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
13777 case "$getprotobyname_r_proto" in
13778 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
13779 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
13781 case "$getprotobyname_r_proto" in
13782 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
13783 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
13785 case "$getprotobyname_r_proto" in
13786 ''|0) d_getprotobyname_r=undef
13787 getprotobyname_r_proto=0
13788 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
13789 * ) case "$getprotobyname_r_proto" in
13790 REENTRANT_PROTO*) ;;
13791 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
13793 echo "Prototype: $try" ;;
13796 *) case "$usethreads" in
13797 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
13799 d_getprotobyname_r=undef
13800 getprotobyname_r_proto=0
13804 *) getprotobyname_r_proto=0
13808 : see if getprotobynumber_r exists
13809 set getprotobynumber_r d_getprotobynumber_r
13811 case "$d_getprotobynumber_r" in
13813 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13814 case "$d_getprotobynumber_r_proto:$usethreads" in
13815 ":define") d_getprotobynumber_r_proto=define
13816 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
13820 case "$d_getprotobynumber_r_proto" in
13822 case "$getprotobynumber_r_proto" in
13823 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
13824 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
13826 case "$getprotobynumber_r_proto" in
13827 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
13828 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
13830 case "$getprotobynumber_r_proto" in
13831 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
13832 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
13834 case "$getprotobynumber_r_proto" in
13835 ''|0) d_getprotobynumber_r=undef
13836 getprotobynumber_r_proto=0
13837 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
13838 * ) case "$getprotobynumber_r_proto" in
13839 REENTRANT_PROTO*) ;;
13840 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
13842 echo "Prototype: $try" ;;
13845 *) case "$usethreads" in
13846 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
13848 d_getprotobynumber_r=undef
13849 getprotobynumber_r_proto=0
13853 *) getprotobynumber_r_proto=0
13857 : see if getprotoent_r exists
13858 set getprotoent_r d_getprotoent_r
13860 case "$d_getprotoent_r" in
13862 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13863 case "$d_getprotoent_r_proto:$usethreads" in
13864 ":define") d_getprotoent_r_proto=define
13865 set d_getprotoent_r_proto getprotoent_r $hdrs
13869 case "$d_getprotoent_r_proto" in
13871 case "$getprotoent_r_proto" in
13872 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
13873 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
13875 case "$getprotoent_r_proto" in
13876 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
13877 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBI ;;
13879 case "$getprotoent_r_proto" in
13880 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
13881 ./protochk "extern $try" $hdrs && getprotoent_r_proto=S_SBI ;;
13883 case "$getprotoent_r_proto" in
13884 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
13885 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SD ;;
13887 case "$getprotoent_r_proto" in
13888 ''|0) d_getprotoent_r=undef
13889 getprotoent_r_proto=0
13890 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
13891 * ) case "$getprotoent_r_proto" in
13892 REENTRANT_PROTO*) ;;
13893 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
13895 echo "Prototype: $try" ;;
13898 *) case "$usethreads" in
13899 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
13901 d_getprotoent_r=undef
13902 getprotoent_r_proto=0
13906 *) getprotoent_r_proto=0
13910 : see if prototypes for various getprotoxxx netdb.h functions are available
13912 set d_getprotoprotos getprotoent $i_netdb netdb.h
13915 : see if getprpwnam exists
13916 set getprpwnam d_getprpwnam
13919 : see if getpwent exists
13920 set getpwent d_getpwent
13923 : see if getpwent_r exists
13924 set getpwent_r d_getpwent_r
13926 case "$d_getpwent_r" in
13928 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13929 case "$d_getpwent_r_proto:$usethreads" in
13930 ":define") d_getpwent_r_proto=define
13931 set d_getpwent_r_proto getpwent_r $hdrs
13935 case "$d_getpwent_r_proto" in
13937 case "$getpwent_r_proto" in
13938 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
13939 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBWR ;;
13941 case "$getpwent_r_proto" in
13942 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
13943 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIR ;;
13945 case "$getpwent_r_proto" in
13946 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
13947 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBW ;;
13949 case "$getpwent_r_proto" in
13950 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
13951 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBI ;;
13953 case "$getpwent_r_proto" in
13954 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
13955 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBI ;;
13957 case "$getpwent_r_proto" in
13958 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
13959 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIH ;;
13961 case "$getpwent_r_proto" in
13962 ''|0) d_getpwent_r=undef
13964 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
13965 * ) case "$getpwent_r_proto" in
13966 REENTRANT_PROTO*) ;;
13967 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
13969 echo "Prototype: $try" ;;
13972 *) case "$usethreads" in
13973 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
13980 *) getpwent_r_proto=0
13984 : see if getpwnam_r exists
13985 set getpwnam_r d_getpwnam_r
13987 case "$d_getpwnam_r" in
13989 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13990 case "$d_getpwnam_r_proto:$usethreads" in
13991 ":define") d_getpwnam_r_proto=define
13992 set d_getpwnam_r_proto getpwnam_r $hdrs
13996 case "$d_getpwnam_r_proto" in
13998 case "$getpwnam_r_proto" in
13999 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
14000 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
14002 case "$getpwnam_r_proto" in
14003 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
14004 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
14006 case "$getpwnam_r_proto" in
14007 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
14008 ./protochk "extern $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
14010 case "$getpwnam_r_proto" in
14011 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
14012 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
14014 case "$getpwnam_r_proto" in
14015 ''|0) d_getpwnam_r=undef
14017 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
14018 * ) case "$getpwnam_r_proto" in
14019 REENTRANT_PROTO*) ;;
14020 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
14022 echo "Prototype: $try" ;;
14025 *) case "$usethreads" in
14026 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
14033 *) getpwnam_r_proto=0
14037 : see if getpwuid_r exists
14038 set getpwuid_r d_getpwuid_r
14040 case "$d_getpwuid_r" in
14042 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14043 case "$d_getpwuid_r_proto:$usethreads" in
14044 ":define") d_getpwuid_r_proto=define
14045 set d_getpwuid_r_proto getpwuid_r $hdrs
14049 case "$d_getpwuid_r_proto" in
14051 case "$getpwuid_r_proto" in
14052 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
14053 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
14055 case "$getpwuid_r_proto" in
14056 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
14057 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
14059 case "$getpwuid_r_proto" in
14060 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
14061 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
14063 case "$getpwuid_r_proto" in
14064 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
14065 ./protochk "extern $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
14067 case "$getpwuid_r_proto" in
14068 ''|0) d_getpwuid_r=undef
14070 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
14071 * ) case "$getpwuid_r_proto" in
14072 REENTRANT_PROTO*) ;;
14073 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
14075 echo "Prototype: $try" ;;
14078 *) case "$usethreads" in
14079 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
14086 *) getpwuid_r_proto=0
14091 : see if getservbyname exists
14092 set getservbyname d_getsbyname
14095 : see if getservbyport exists
14096 set getservbyport d_getsbyport
14099 : see if getservent exists
14100 set getservent d_getsent
14103 : see if getservbyname_r exists
14104 set getservbyname_r d_getservbyname_r
14106 case "$d_getservbyname_r" in
14108 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14109 case "$d_getservbyname_r_proto:$usethreads" in
14110 ":define") d_getservbyname_r_proto=define
14111 set d_getservbyname_r_proto getservbyname_r $hdrs
14115 case "$d_getservbyname_r_proto" in
14117 case "$getservbyname_r_proto" in
14118 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
14119 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
14121 case "$getservbyname_r_proto" in
14122 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
14123 ./protochk "extern $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
14125 case "$getservbyname_r_proto" in
14126 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
14127 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
14129 case "$getservbyname_r_proto" in
14130 ''|0) d_getservbyname_r=undef
14131 getservbyname_r_proto=0
14132 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
14133 * ) case "$getservbyname_r_proto" in
14134 REENTRANT_PROTO*) ;;
14135 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
14137 echo "Prototype: $try" ;;
14140 *) case "$usethreads" in
14141 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
14143 d_getservbyname_r=undef
14144 getservbyname_r_proto=0
14148 *) getservbyname_r_proto=0
14152 : see if getservbyport_r exists
14153 set getservbyport_r d_getservbyport_r
14155 case "$d_getservbyport_r" in
14157 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14158 case "$d_getservbyport_r_proto:$usethreads" in
14159 ":define") d_getservbyport_r_proto=define
14160 set d_getservbyport_r_proto getservbyport_r $hdrs
14164 case "$d_getservbyport_r_proto" in
14166 case "$getservbyport_r_proto" in
14167 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
14168 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
14170 case "$getservbyport_r_proto" in
14171 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
14172 ./protochk "extern $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
14174 case "$getservbyport_r_proto" in
14175 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
14176 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
14178 case "$getservbyport_r_proto" in
14179 ''|0) d_getservbyport_r=undef
14180 getservbyport_r_proto=0
14181 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
14182 * ) case "$getservbyport_r_proto" in
14183 REENTRANT_PROTO*) ;;
14184 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
14186 echo "Prototype: $try" ;;
14189 *) case "$usethreads" in
14190 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
14192 d_getservbyport_r=undef
14193 getservbyport_r_proto=0
14197 *) getservbyport_r_proto=0
14201 : see if getservent_r exists
14202 set getservent_r d_getservent_r
14204 case "$d_getservent_r" in
14206 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14207 case "$d_getservent_r_proto:$usethreads" in
14208 ":define") d_getservent_r_proto=define
14209 set d_getservent_r_proto getservent_r $hdrs
14213 case "$d_getservent_r_proto" in
14215 case "$getservent_r_proto" in
14216 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
14217 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBWR ;;
14219 case "$getservent_r_proto" in
14220 ''|0) try='int getservent_r(struct servent*, char*, int);'
14221 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBI ;;
14223 case "$getservent_r_proto" in
14224 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
14225 ./protochk "extern $try" $hdrs && getservent_r_proto=S_SBI ;;
14227 case "$getservent_r_proto" in
14228 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
14229 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SD ;;
14231 case "$getservent_r_proto" in
14232 ''|0) d_getservent_r=undef
14233 getservent_r_proto=0
14234 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
14235 * ) case "$getservent_r_proto" in
14236 REENTRANT_PROTO*) ;;
14237 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
14239 echo "Prototype: $try" ;;
14242 *) case "$usethreads" in
14243 define) echo "getservent_r has no prototype, not using it." >&4 ;;
14245 d_getservent_r=undef
14246 getservent_r_proto=0
14250 *) getservent_r_proto=0
14254 : see if prototypes for various getservxxx netdb.h functions are available
14256 set d_getservprotos getservent $i_netdb netdb.h
14259 : see if getspnam exists
14260 set getspnam d_getspnam
14263 : see if this is a shadow.h system
14264 set shadow.h i_shadow
14267 : see if getspnam_r exists
14268 set getspnam_r d_getspnam_r
14270 case "$d_getspnam_r" in
14272 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
14273 case "$d_getspnam_r_proto:$usethreads" in
14274 ":define") d_getspnam_r_proto=define
14275 set d_getspnam_r_proto getspnam_r $hdrs
14279 case "$d_getspnam_r_proto" in
14281 case "$getspnam_r_proto" in
14282 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
14283 ./protochk "extern $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
14285 case "$getspnam_r_proto" in
14286 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
14287 ./protochk "extern $try" $hdrs && getspnam_r_proto=S_CSBI ;;
14289 case "$getspnam_r_proto" in
14290 ''|0) d_getspnam_r=undef
14292 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
14293 * ) case "$getspnam_r_proto" in
14294 REENTRANT_PROTO*) ;;
14295 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
14297 echo "Prototype: $try" ;;
14300 *) case "$usethreads" in
14301 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
14308 *) getspnam_r_proto=0
14312 : see if gettimeofday or ftime exists
14313 set gettimeofday d_gettimeod
14315 case "$d_gettimeod" in
14321 val="$undef"; set d_ftime; eval $setvar
14324 case "$d_gettimeod$d_ftime" in
14327 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
14331 : see if gmtime_r exists
14332 set gmtime_r d_gmtime_r
14334 case "$d_gmtime_r" in
14336 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14337 case "$d_gmtime_r_proto:$usethreads" in
14338 ":define") d_gmtime_r_proto=define
14339 set d_gmtime_r_proto gmtime_r $hdrs
14343 case "$d_gmtime_r_proto" in
14345 case "$gmtime_r_proto" in
14346 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
14347 ./protochk "extern $try" $hdrs && gmtime_r_proto=S_TS ;;
14349 case "$gmtime_r_proto" in
14350 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
14351 ./protochk "extern $try" $hdrs && gmtime_r_proto=I_TS ;;
14353 case "$gmtime_r_proto" in
14354 ''|0) d_gmtime_r=undef
14356 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
14357 * ) case "$gmtime_r_proto" in
14358 REENTRANT_PROTO*) ;;
14359 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
14361 echo "Prototype: $try" ;;
14364 *) case "$usethreads" in
14365 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
14372 *) gmtime_r_proto=0
14376 : see if hasmntopt exists
14377 set hasmntopt d_hasmntopt
14380 : see if this is a netinet/in.h or sys/in.h system
14381 set netinet/in.h i_niin sys/in.h i_sysin
14384 : see if arpa/inet.h has to be included
14385 set arpa/inet.h i_arpainet
14388 : see if htonl --and friends-- exists
14393 : Maybe they are macros.
14396 $cat >htonl.c <<EOM
14398 #include <sys/types.h>
14399 #$i_niin I_NETINET_IN
14401 #$i_arpainet I_ARPA_INET
14402 #ifdef I_NETINET_IN
14403 #include <netinet/in.h>
14406 #include <sys/in.h>
14409 #include <arpa/inet.h>
14412 printf("Defined as a macro.");
14415 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
14416 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
14418 echo "But it seems to be defined as a macro." >&4
14426 : see if ilogbl exists
14427 set ilogbl d_ilogbl
14432 if set index val -f; eval $csym; $val; then
14433 if set strchr val -f d_strchr; eval $csym; $val; then
14434 if $contains strchr "$strings" >/dev/null 2>&1 ; then
14437 echo "strchr() found." >&4
14441 echo "index() found." >&4
14446 echo "index() found." >&4
14449 if set strchr val -f d_strchr; eval $csym; $val; then
14452 echo "strchr() found." >&4
14454 echo "No index() or strchr() found!" >&4
14459 set d_strchr; eval $setvar
14461 set d_index; eval $setvar
14463 : check whether inet_aton exists
14464 set inet_aton d_inetaton
14469 $cat >isascii.c <<EOCP
14472 #$i_stdlib I_STDLIB
14474 #include <stdlib.h>
14485 if eval $compile; then
14486 echo "isascii() found." >&4
14489 echo "isascii() NOT found." >&4
14496 : see if isfinite exists
14497 set isfinite d_isfinite
14500 : see if isinf exists
14504 : see if isnan exists
14508 : see if isnanl exists
14509 set isnanl d_isnanl
14512 : see if killpg exists
14513 set killpg d_killpg
14516 : see if lchown exists
14518 $cat > try.c <<'EOCP'
14519 /* System header to define __stub macros and hopefully few prototypes,
14520 which can conflict with char lchown(); below. */
14521 #include <assert.h>
14522 /* Override any gcc2 internal prototype to avoid an error. */
14523 /* We use char because int might match the return type of a gcc2
14524 builtin and then its argument prototype would still apply. */
14527 /* The GNU C library defines this for functions which it implements
14528 to always fail with ENOSYS. Some functions are actually named
14529 something starting with __ and the normal name is an alias. */
14530 #if defined (__stub_lchown) || defined (__stub___lchown)
14538 if eval $compile; then
14539 $echo "lchown() found." >&4
14542 $echo "lchown() NOT found." >&4
14548 : See if number of significant digits in a double precision number is known
14550 $cat >ldbl_dig.c <<EOM
14551 #$i_limits I_LIMITS
14554 #include <limits.h>
14560 printf("Contains LDBL_DIG");
14563 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
14564 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
14565 echo "LDBL_DIG found." >&4
14568 echo "LDBL_DIG NOT found." >&4
14575 : see if this is a math.h system
14579 d_libm_lib_version="$undef"
14582 : check to see if math.h defines _LIB_VERSION
14584 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
14586 #include <unistd.h>
14588 int main (int argc, char *argv[])
14590 printf ("%d\n", _LIB_VERSION);
14595 if eval $compile; then
14597 echo "Yes, it does ($foo)" >&4
14598 d_libm_lib_version="$define"
14600 echo "No, it does not (probably harmless)\n" >&4
14602 $rm -f try.* try core core.try.*
14607 : see if link exists
14611 : see if localtime_r exists
14612 set localtime_r d_localtime_r
14614 case "$d_localtime_r" in
14616 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14617 case "$d_localtime_r_proto:$usethreads" in
14618 ":define") d_localtime_r_proto=define
14619 set d_localtime_r_proto localtime_r $hdrs
14623 case "$d_localtime_r_proto" in
14625 case "$localtime_r_proto" in
14626 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
14627 ./protochk "extern $try" $hdrs && localtime_r_proto=S_TS ;;
14629 case "$localtime_r_proto" in
14630 ''|0) try='int localtime_r(const time_t*, struct tm*);'
14631 ./protochk "extern $try" $hdrs && localtime_r_proto=I_TS ;;
14633 case "$localtime_r_proto" in
14634 ''|0) d_localtime_r=undef
14635 localtime_r_proto=0
14636 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
14637 * ) case "$localtime_r_proto" in
14638 REENTRANT_PROTO*) ;;
14639 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
14641 echo "Prototype: $try" ;;
14644 *) case "$usethreads" in
14645 define) echo "localtime_r has no prototype, not using it." >&4 ;;
14647 d_localtime_r=undef
14648 localtime_r_proto=0
14652 *) localtime_r_proto=0
14656 : see if localtime_r calls tzset
14657 case "$localtime_r_proto" in
14660 /* Does our libc's localtime_r call tzset ?
14661 * return 0 if so, 1 otherwise.
14663 #include <sys/types.h>
14664 #include <unistd.h>
14666 #include <string.h>
14667 #include <malloc.h>
14670 time_t t = time(0L);
14671 char w_tz[]="TZ" "=GMT+5",
14672 e_tz[]="TZ" "=GMT-5",
14673 *tz_e = (char*)malloc(16),
14674 *tz_w = (char*)malloc(16);
14675 struct tm tm_e, tm_w;
14676 memset(&tm_e,'\0',sizeof(struct tm));
14677 memset(&tm_w,'\0',sizeof(struct tm));
14682 localtime_r(&t, &tm_e);
14685 localtime_r(&t, &tm_w);
14687 if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 )
14693 if eval $compile; then
14695 d_localtime_r_needs_tzset=undef;
14697 d_localtime_r_needs_tzset=define;
14700 d_localtime_r_needs_tzset=undef;
14704 d_localtime_r_needs_tzset=undef;
14707 $rm -f try try.* core
14709 : see if localeconv exists
14710 set localeconv d_locconv
14713 : see if lockf exists
14717 : see if prototype for lseek is available
14719 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
14722 : see if lstat exists
14726 : see if madvise exists
14727 set madvise d_madvise
14730 : see if malloc_size exists
14731 set malloc_size d_malloc_size
14734 : see if malloc_size_good exists
14735 set malloc_good_size d_malloc_good_size
14738 : see if mblen exists
14742 : see if mbstowcs exists
14743 set mbstowcs d_mbstowcs
14746 : see if mbtowc exists
14747 set mbtowc d_mbtowc
14750 : see if memchr exists
14751 set memchr d_memchr
14754 : see if memcmp exists
14755 set memcmp d_memcmp
14758 : see if memcpy exists
14759 set memcpy d_memcpy
14762 : see if memmove exists
14763 set memmove d_memmove
14766 : see if memset exists
14767 set memset d_memset
14770 : see if mkdir exists
14774 : see if mkdtemp exists
14775 set mkdtemp d_mkdtemp
14778 : see if mkfifo exists
14779 set mkfifo d_mkfifo
14782 : see if mkstemp exists
14783 set mkstemp d_mkstemp
14786 : see if mkstemps exists
14787 set mkstemps d_mkstemps
14790 : see if mktime exists
14791 set mktime d_mktime
14794 : see if this is a sys/mman.h system
14795 set sys/mman.h i_sysmman
14798 : see if mmap exists
14801 : see what shmat returns
14802 : default to something harmless
14804 case "$i_sysmman$d_mmap" in
14806 $cat >mmap.c <<'END'
14807 #include <sys/mman.h>
14810 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
14815 echo "and it returns ($mmaptype)." >&4
14821 : see if sqrtl exists
14825 : see if scalbnl exists
14826 set scalbnl d_scalbnl
14829 : see if modfl exists
14833 : see if prototype for modfl is available
14835 set d_modflproto modfl $i_math math.h
14838 d_modfl_pow32_bug="$undef"
14840 case "$d_longdbl$d_modfl" in
14843 Checking to see whether your modfl() is okay for large values...
14849 if $test "X$d_modflproto" != "X$define"; then
14850 $cat >>try.c <<EOCP
14851 /* Sigh. many current glibcs provide the function, but do not prototype it. */
14852 long double modfl (long double, long double *);
14855 $cat >>try.c <<EOCP
14857 long double nv = 4294967303.15;
14863 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
14867 case "$osname:$gccversion" in
14868 aix:) saveccflags="$ccflags"
14869 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
14872 if eval $compile; then
14875 *" 4294967303.150000 1.150000 4294967302.000000")
14876 echo >&4 "Your modfl() is broken for large values."
14877 d_modfl_pow32_bug="$define"
14879 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
14883 *" 4294967303.150000 0.150000 4294967303.000000")
14884 echo >&4 "Your modfl() seems okay for large values."
14886 *) echo >&4 "I don't understand your modfl() at all."
14890 $rm -f try.* try core core.try.*
14892 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
14895 case "$osname:$gccversion" in
14896 aix:) ccflags="$saveccflags" ;; # restore
14901 if $test "$uselongdouble" = "$define"; then
14903 if $test "$d_sqrtl" != "$define"; then
14904 message="$message sqrtl"
14906 if $test "$d_modfl" != "$define"; then
14907 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
14908 echo "You have both aintl and copysignl, so I can emulate modfl."
14910 message="$message modfl"
14913 if $test "$d_frexpl" != "$define"; then
14914 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
14915 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
14917 message="$message frexpl"
14921 if $test "$message" != ""; then
14924 *** You requested the use of long doubles but you do not seem to have
14925 *** the following mathematical functions needed for long double support:
14927 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
14928 *** Cannot continue, aborting.
14936 : see if mprotect exists
14937 set mprotect d_mprotect
14940 : see if msgctl exists
14941 set msgctl d_msgctl
14944 : see if msgget exists
14945 set msgget d_msgget
14948 : see if msgsnd exists
14949 set msgsnd d_msgsnd
14952 : see if msgrcv exists
14953 set msgrcv d_msgrcv
14956 : see how much of the 'msg*(2)' library is present.
14959 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
14960 *"$undef"*) h_msg=false;;
14964 case "`ipcs 2>&1`" in
14965 "SVID messages"*"not configured"*)
14966 echo "Your $osname does not have the msg*(2) configured." >&4
14969 set msgctl d_msgctl
14971 set msgget d_msgget
14973 set msgsnd d_msgsnd
14975 set msgrcv d_msgrcv
14981 : we could also check for sys/ipc.h ...
14982 if $h_msg && $test `./findhdr sys/msg.h`; then
14983 echo "You have the full msg*(2) library." >&4
14986 echo "You don't have the full msg*(2) library." >&4
14994 echo "Checking to see if your system supports struct msghdr..." >&4
14995 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
14997 case "$d_msghdr_s" in
14998 "$define") echo "Yes, it does." ;;
14999 *) echo "No, it doesn't." ;;
15003 : see if msync exists
15007 : see if munmap exists
15008 set munmap d_munmap
15011 : see if nice exists
15015 : see if this is a langinfo.h system
15016 set langinfo.h i_langinfo
15019 : see if nl_langinfo exists
15020 set nl_langinfo d_nl_langinfo
15023 : check for length of character
15025 case "$charsize" in
15027 echo "Checking to see how big your characters are (hey, you never know)..." >&4
15030 #$i_stdlib I_STDLIB
15032 #include <stdlib.h>
15036 printf("%d\n", (int)sizeof(char));
15041 if eval $compile_ok; then
15045 echo "(I can't seem to compile the test program. Guessing...)"
15052 rp="What is the size of a character (in bytes)?"
15057 : check for volatile keyword
15059 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
15060 $cat >try.c <<'EOCP'
15063 typedef struct _goo_struct goo_struct;
15064 goo_struct * volatile goo = ((goo_struct *)0);
15065 struct _goo_struct {
15070 typedef unsigned short foo_t;
15071 char *volatile foo;
15073 volatile foo_t blech;
15077 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
15079 echo "Yup, it does."
15082 echo "Nope, it doesn't."
15090 $echo "Choosing the C types to be used for Perl's internal types..." >&4
15092 case "$use64bitint:$d_quad:$quadtype" in
15095 uvtype="$uquadtype"
15100 uvtype="unsigned long"
15106 case "$uselongdouble:$d_longdbl" in
15108 nvtype="long double"
15109 nvsize=$longdblsize
15116 $echo "(IV will be "$ivtype", $ivsize bytes)"
15117 $echo "(UV will be "$uvtype", $uvsize bytes)"
15118 $echo "(NV will be "$nvtype", $nvsize bytes)"
15121 #$i_inttypes I_INTTYPES
15123 #include <inttypes.h>
15128 int8_t i = INT8_MAX;
15129 uint8_t u = UINT8_MAX;
15130 printf("int8_t\n");
15133 int16_t i = INT16_MAX;
15134 uint16_t i = UINT16_MAX;
15135 printf("int16_t\n");
15138 int32_t i = INT32_MAX;
15139 uint32_t u = UINT32_MAX;
15140 printf("int32_t\n");
15146 '') case "$charsize" in
15148 u8type="unsigned char"
15157 if eval $compile; then
15158 case "`$run ./try`" in
15159 int8_t) i8type=int8_t
15169 '') if $test $charsize -ge 1; then
15171 u8type="unsigned char"
15179 '') case "$shortsize" in
15181 u16type="unsigned short"
15189 '') set try -DINT16
15190 if eval $compile; then
15191 case "`$run ./try`" in
15203 '') if $test $shortsize -ge 2; then
15205 u16type="unsigned short"
15213 '') case "$longsize" in
15215 u32type="unsigned long"
15219 *) case "$intsize" in
15221 u32type="unsigned int"
15231 '') set try -DINT32
15232 if eval $compile; then
15233 case "`$run ./try`" in
15245 '') if $test $intsize -ge 4; then
15247 u32type="unsigned int"
15255 '') case "$d_quad:$quadtype" in
15257 i64type="$quadtype"
15258 u64type="$uquadtype"
15266 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
15267 : volatile so that the compiler has to store it out to memory.
15268 if test X"$d_volatile" = X"$define"; then
15273 #$i_stdlib I_STDLIB
15275 #include <stdlib.h>
15277 #include <sys/types.h>
15278 #include <signal.h>
15280 $volatile int bletched = 0;
15281 $signal_t blech(int s) { bletched = 1; }
15286 int n = 8 * $uvsize;
15289 signal(SIGFPE, blech);
15292 for (i = 0; i < n; i++) {
15293 u = u << 1 | ($uvtype)1;
15295 if (($uvtype)d != u)
15299 d = ($nvtype)(u - 1);
15300 if (($uvtype)d != (u - 1))
15307 printf("%d\n", ((i == n) ? -n : i));
15313 d_nv_preserves_uv="$undef"
15314 if eval $compile; then
15315 nv_preserves_uv_bits="`$run ./try`"
15317 case "$nv_preserves_uv_bits" in
15319 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
15320 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
15321 d_nv_preserves_uv="$define"
15323 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
15324 d_nv_preserves_uv="$undef" ;;
15325 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
15326 nv_preserves_uv_bits="0" ;;
15331 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
15332 : volatile so that the compiler has to store it out to memory.
15333 if test X"$d_volatile" = X"$define"; then
15338 #$i_stdlib I_STDLIB
15340 #include <stdlib.h>
15342 #$i_string I_STRING
15344 # include <string.h>
15346 # include <strings.h>
15348 #include <sys/types.h>
15349 #include <signal.h>
15351 $volatile int bletched = 0;
15352 $signal_t blech(int s) { bletched = 1; }
15355 int checkit($nvtype d, char *where) {
15356 unsigned char *p = (char *)&d;
15357 unsigned char *end = p + sizeof(d);
15367 printf("No - %s: 0x", where);
15369 printf ("%02X", *p++);
15374 int main(int argc, char **argv) {
15377 fail += checkit(d, "0.0");
15379 /* The compiler shouldn't be assuming that bletched is 0 */
15382 fail += checkit(d, "bleched");
15385 signal(SIGFPE, blech);
15388 /* Paranoia - the compiler should have no way of knowing that ANSI says
15389 that argv[argc] will always be NULL. Actually, if it did assume this it
15390 would be buggy, as this is C and main() can be called from elsewhere in
15392 d = argv[argc] ? 1 : 0;
15395 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
15398 fail += checkit(d, "ternary");
15400 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
15403 printf("No - memset doesn't give 0.0\n");
15404 /* This might just blow up: */
15405 printf("(gives %g)\n", d);
15411 printf("No - something bleched\n");
15416 printf("No - %d fail(s)\n", fail);
15425 d_nv_zero_is_allbits_zero="$undef"
15426 if eval $compile; then
15432 0.0 is represented as all bits zero in memory
15434 d_nv_zero_is_allbits_zero="$define"
15437 0.0 is not represented as all bits zero in memory
15439 d_nv_zero_is_allbits_zero="$undef"
15444 0.0 is not represented as all bits zero in memory
15446 d_nv_zero_is_allbits_zero="$undef"
15454 : check for off64_t
15456 echo "Checking to see if you have off64_t..." >&4
15458 #include <sys/types.h>
15459 #include <unistd.h>
15460 int main() { off64_t x = 7; }
15463 if eval $compile; then
15465 echo "You have off64_t."
15468 echo "You do not have off64_t."
15469 case "$lseeksize" in
15470 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
15477 : how to create joinable pthreads
15478 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
15480 echo "Checking what constant to use for creating joinable pthreads..." >&4
15481 $cat >try.c <<'EOCP'
15482 #include <pthread.h>
15484 int detachstate = JOINABLE;
15487 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
15488 if eval $compile; then
15489 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
15490 val="$undef" # Yes, undef.
15491 set d_old_pthread_create_joinable
15494 set old_pthread_create_joinable
15497 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
15498 if eval $compile; then
15499 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
15501 set d_old_pthread_create_joinable
15503 val=PTHREAD_CREATE_UNDETACHED
15504 set old_pthread_create_joinable
15507 set try -DJOINABLE=__UNDETACHED
15508 if eval $compile; then
15509 echo "You seem to use __UNDETACHED." >&4
15511 set d_old_pthread_create_joinable
15514 set old_pthread_create_joinable
15517 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
15519 set d_old_pthread_create_joinable
15522 set old_pthread_create_joinable
15529 d_old_pthread_create_joinable="$undef"
15530 old_pthread_create_joinable=""
15533 : see if pause exists
15537 : see if pipe exists
15541 : see if poll exists
15545 : see if readlink exists
15546 set readlink d_readlink
15552 case "$d_readlink" in
15554 if $issymlink /proc/self/exe ; then
15555 $ls -l /proc/self/exe > reflect
15556 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
15557 echo "You have Linux-like /proc/self/exe."
15558 procselfexe='"/proc/self/exe"'
15562 if $issymlink /proc/curproc/file ; then
15563 $ls -l /proc/curproc/file > reflect
15564 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
15565 echo "You have BSD-like /proc/curproc/file."
15566 procselfexe='"/proc/curproc/file"'
15576 : backward compatibility for d_hvfork
15577 if test X$d_hvfork != X; then
15578 d_vfork="$d_hvfork"
15581 : see if there is a vfork
15586 d_pseudofork=$undef
15588 : Ok, but do we want to use it. vfork is reportedly unreliable in
15589 : perl on Solaris 2.x, and probably elsewhere.
15593 case "$usevfork" in
15599 Perl can only use a vfork() that doesn't suffer from strict
15600 restrictions on calling functions or modifying global data in
15601 the child. For example, glibc-2.1 contains such a vfork()
15602 that is unsuitable. If your system provides a proper fork()
15603 call, chances are that you do NOT want perl to use vfork().
15606 rp="Do you still want to use vfork()?"
15611 echo "Ok, we won't use vfork()."
15620 $define) usevfork='true';;
15621 *) usevfork='false';;
15624 : see whether the pthread_atfork exists
15626 #include <pthread.h>
15629 #ifdef PTHREAD_ATFORK
15630 pthread_atfork(NULL,NULL,NULL);
15635 : see if pthread_atfork exists
15636 set try -DPTHREAD_ATFORK
15637 if eval $compile; then
15642 case "$usethreads" in
15645 $define) echo 'pthread_atfork found.' >&4 ;;
15646 *) echo 'pthread_atfork NOT found.' >&4 ;;
15649 set d_pthread_atfork
15652 : see if pthread_attr_setscope exists
15653 set pthread_attr_setscope d_pthread_attr_setscope
15657 : see whether the various POSIXish _yields exist
15659 #include <pthread.h>
15665 #ifdef PTHREAD_YIELD
15668 #ifdef PTHREAD_YIELD_NULL
15669 pthread_yield(NULL);
15675 : see if sched_yield exists
15676 set try -DSCHED_YIELD
15677 if eval $compile; then
15679 sched_yield='sched_yield()'
15683 case "$usethreads" in
15686 $define) echo 'sched_yield() found.' >&4 ;;
15687 *) echo 'sched_yield() NOT found.' >&4 ;;
15693 : see if pthread_yield exists
15694 set try -DPTHREAD_YIELD
15695 if eval $compile; then
15697 case "$sched_yield" in
15698 '') sched_yield='pthread_yield()' ;;
15701 set try -DPTHREAD_YIELD_NULL
15702 if eval $compile; then
15704 case "$sched_yield" in
15705 '') sched_yield='pthread_yield(NULL)' ;;
15711 case "$usethreads" in
15714 $define) echo 'pthread_yield() found.' >&4 ;;
15715 *) echo 'pthread_yield() NOT found.' >&4 ;;
15719 set d_pthread_yield
15722 case "$sched_yield" in
15723 '') sched_yield=undef ;;
15728 : see if random_r exists
15729 set random_r d_random_r
15731 case "$d_random_r" in
15733 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
15734 case "$d_random_r_proto:$usethreads" in
15735 ":define") d_random_r_proto=define
15736 set d_random_r_proto random_r $hdrs
15740 case "$d_random_r_proto" in
15742 case "$random_r_proto" in
15743 ''|0) try='int random_r(int*, struct random_data*);'
15744 ./protochk "extern $try" $hdrs && random_r_proto=I_iS ;;
15746 case "$random_r_proto" in
15747 ''|0) try='int random_r(long*, struct random_data*);'
15748 ./protochk "extern $try" $hdrs && random_r_proto=I_lS ;;
15750 case "$random_r_proto" in
15751 ''|0) try='int random_r(struct random_data*, int32_t*);'
15752 ./protochk "extern $try" $hdrs && random_r_proto=I_St ;;
15754 case "$random_r_proto" in
15755 ''|0) d_random_r=undef
15757 echo "Disabling random_r, cannot determine prototype." >&4 ;;
15758 * ) case "$random_r_proto" in
15759 REENTRANT_PROTO*) ;;
15760 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
15762 echo "Prototype: $try" ;;
15765 *) case "$usethreads" in
15766 define) echo "random_r has no prototype, not using it." >&4 ;;
15773 *) random_r_proto=0
15777 : see if readdir and friends exist
15778 set readdir d_readdir
15780 set seekdir d_seekdir
15782 set telldir d_telldir
15784 set rewinddir d_rewinddir
15787 : see if readdir64_r exists
15788 set readdir64_r d_readdir64_r
15790 case "$d_readdir64_r" in
15792 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
15793 case "$d_readdir64_r_proto:$usethreads" in
15794 ":define") d_readdir64_r_proto=define
15795 set d_readdir64_r_proto readdir64_r $hdrs
15799 case "$d_readdir64_r_proto" in
15801 case "$readdir64_r_proto" in
15802 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
15803 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TSR ;;
15805 case "$readdir64_r_proto" in
15806 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
15807 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TS ;;
15809 case "$readdir64_r_proto" in
15810 ''|0) d_readdir64_r=undef
15811 readdir64_r_proto=0
15812 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
15813 * ) case "$readdir64_r_proto" in
15814 REENTRANT_PROTO*) ;;
15815 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
15817 echo "Prototype: $try" ;;
15820 *) case "$usethreads" in
15821 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
15823 d_readdir64_r=undef
15824 readdir64_r_proto=0
15828 *) readdir64_r_proto=0
15832 : see if readdir_r exists
15833 set readdir_r d_readdir_r
15835 case "$d_readdir_r" in
15837 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
15838 case "$d_readdir_r_proto:$usethreads" in
15839 ":define") d_readdir_r_proto=define
15840 set d_readdir_r_proto readdir_r $hdrs
15844 case "$d_readdir_r_proto" in
15846 case "$readdir_r_proto" in
15847 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
15848 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TSR ;;
15850 case "$readdir_r_proto" in
15851 ''|0) try='int readdir_r(DIR*, struct dirent*);'
15852 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TS ;;
15854 case "$readdir_r_proto" in
15855 ''|0) d_readdir_r=undef
15857 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
15858 * ) case "$readdir_r_proto" in
15859 REENTRANT_PROTO*) ;;
15860 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
15862 echo "Prototype: $try" ;;
15865 *) case "$usethreads" in
15866 define) echo "readdir_r has no prototype, not using it." >&4 ;;
15873 *) readdir_r_proto=0
15877 : see if readv exists
15881 : see if recvmsg exists
15882 set recvmsg d_recvmsg
15885 : see if rename exists
15886 set rename d_rename
15889 : see if rmdir exists
15893 : see if memory.h is available.
15898 : See if it conflicts with string.h
15904 $cppstdin $cppflags $cppminus < $strings > mem.h
15905 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
15907 echo "We won't be including <memory.h>."
15917 : can bcopy handle overlapping blocks?
15920 case "$d_memmove" in
15921 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
15922 *) case "$d_bcopy" in
15924 echo "Checking to see if bcopy() can do overlapping copies..." >&4
15926 #$i_memory I_MEMORY
15927 #$i_stdlib I_STDLIB
15928 #$i_string I_STRING
15929 #$i_unistd I_UNISTD
15931 $cat >>try.c <<'EOCP'
15934 # include <memory.h>
15937 # include <stdlib.h>
15940 # include <string.h>
15942 # include <strings.h>
15945 # include <unistd.h> /* Needed for NetBSD */
15949 char buf[128], abc[128];
15955 /* Copy "abcde..." string to char abc[] so that gcc doesn't
15956 try to store the string in read-only memory. */
15957 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
15959 for (align = 7; align >= 0; align--) {
15960 for (len = 36; len; len--) {
15962 bcopy(abc, b, len);
15963 for (off = 1; off <= len; off++) {
15964 bcopy(b, b+off, len);
15965 bcopy(b+off, b, len);
15966 if (bcmp(b, abc, len))
15975 if eval $compile_ok; then
15976 if ./try 2>/dev/null; then
15977 echo "Yes, it can."
15980 echo "It can't, sorry."
15983 echo "(I can't compile the test program, so we'll assume not...)"
15987 $rm -f try.* try core
15993 : can memcpy handle overlapping blocks?
15996 case "$d_memmove" in
15997 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
15998 *) case "$d_memcpy" in
16000 echo "Checking to see if memcpy() can do overlapping copies..." >&4
16002 #$i_memory I_MEMORY
16003 #$i_stdlib I_STDLIB
16004 #$i_string I_STRING
16005 #$i_unistd I_UNISTD
16007 $cat >>try.c <<'EOCP'
16010 # include <memory.h>
16013 # include <stdlib.h>
16016 # include <string.h>
16018 # include <strings.h>
16021 # include <unistd.h> /* Needed for NetBSD */
16025 char buf[128], abc[128];
16031 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16032 try to store the string in read-only memory. */
16033 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
16035 for (align = 7; align >= 0; align--) {
16036 for (len = 36; len; len--) {
16038 memcpy(b, abc, len);
16039 for (off = 1; off <= len; off++) {
16040 memcpy(b+off, b, len);
16041 memcpy(b, b+off, len);
16042 if (memcmp(b, abc, len))
16051 if eval $compile_ok; then
16052 if ./try 2>/dev/null; then
16053 echo "Yes, it can."
16056 echo "It can't, sorry."
16059 echo "(I can't compile the test program, so we'll assume not...)"
16063 $rm -f try.* try core
16069 : can memcmp be trusted to compare relative magnitude?
16071 case "$d_memcmp" in
16074 echo "Checking if your memcmp() can compare relative magnitude..." >&4
16076 #$i_memory I_MEMORY
16077 #$i_stdlib I_STDLIB
16078 #$i_string I_STRING
16079 #$i_unistd I_UNISTD
16081 $cat >>try.c <<'EOCP'
16084 # include <memory.h>
16087 # include <stdlib.h>
16090 # include <string.h>
16092 # include <strings.h>
16095 # include <unistd.h> /* Needed for NetBSD */
16101 if ((a < b) && memcmp(&a, &b, 1) < 0)
16107 if eval $compile_ok; then
16108 if $run ./try 2>/dev/null; then
16109 echo "Yes, it can."
16112 echo "No, it can't (it uses signed chars)."
16115 echo "(I can't compile the test program, so we'll assume not...)"
16119 $rm -f try.* try core
16123 : see if prototype for sbrk is available
16125 set d_sbrkproto sbrk $i_unistd unistd.h
16128 : see if select exists
16129 set select d_select
16132 : see if semctl exists
16133 set semctl d_semctl
16136 : see if semget exists
16137 set semget d_semget
16140 : see if semop exists
16144 : see how much of the 'sem*(2)' library is present.
16147 case "$d_semctl$d_semget$d_semop" in
16148 *"$undef"*) h_sem=false;;
16152 case "`ipcs 2>&1`" in
16153 "SVID messages"*"not configured"*)
16154 echo "Your $osname does not have the sem*(2) configured." >&4
16157 set semctl d_semctl
16159 set semget d_semget
16167 : we could also check for sys/ipc.h ...
16168 if $h_sem && $test `./findhdr sys/sem.h`; then
16169 echo "You have the full sem*(2) library." >&4
16172 echo "You don't have the full sem*(2) library." >&4
16178 : see whether sys/sem.h defines union semun
16180 $cat > try.c <<'END'
16181 #include <sys/types.h>
16182 #include <sys/ipc.h>
16183 #include <sys/sem.h>
16184 int main () { union semun semun; semun.buf = 0; }
16187 if eval $compile; then
16188 echo "You have union semun in <sys/sem.h>." >&4
16191 echo "You do not have union semun in <sys/sem.h>." >&4
16198 : see how to do semctl IPC_STAT
16205 # define S_IRUSR S_IREAD
16206 # define S_IWUSR S_IWRITE
16207 # define S_IXUSR S_IEXEC
16209 # define S_IRUSR 0400
16210 # define S_IWUSR 0200
16211 # define S_IXUSR 0100
16213 # define S_IRGRP (S_IRUSR>>3)
16214 # define S_IWGRP (S_IWUSR>>3)
16215 # define S_IXGRP (S_IXUSR>>3)
16216 # define S_IROTH (S_IRUSR>>6)
16217 # define S_IWOTH (S_IWUSR>>6)
16218 # define S_IXOTH (S_IXUSR>>6)
16221 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
16222 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
16223 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
16226 : see whether semctl IPC_STAT can use union semun
16227 case "$d_semctl_semun" in
16231 #include <sys/types.h>
16232 #include <sys/ipc.h>
16233 #include <sys/sem.h>
16234 #include <sys/stat.h>
16241 #$d_union_semun HAS_UNION_SEMUN
16244 #ifndef HAS_UNION_SEMUN
16247 struct semid_ds *buf;
16248 unsigned short *array;
16254 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16255 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16257 struct semid_ds argbuf;
16260 st = semctl(sem, 0, IPC_STAT, arg);
16264 # endif /* IPC_STAT */
16265 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16267 if (semctl(sem, 0, IPC_RMID, arg) != 0)
16268 # endif /* IPC_RMID */
16269 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16271 #endif /* IPC_PRIVATE && ... */
16272 printf("semget failed: errno = %d\n", errno);
16277 if eval $compile; then
16280 semun) val="$define" ;;
16288 case "$d_semctl_semun" in
16290 echo "You can use union semun for semctl IPC_STAT." >&4
16293 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
16298 : see whether semctl IPC_STAT can use struct semid_ds pointer
16299 case "$d_semctl_semid_ds" in
16302 $cat > try.c <<'END'
16303 #include <sys/types.h>
16304 #include <sys/ipc.h>
16305 #include <sys/sem.h>
16306 #include <sys/stat.h>
16314 struct semid_ds arg;
16317 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16318 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16321 st = semctl(sem, 0, IPC_STAT, &arg);
16323 printf("semid_ds\n");
16325 # endif /* IPC_STAT */
16326 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16328 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
16329 # endif /* IPC_RMID */
16330 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16332 #endif /* IPC_PRIVATE && ... */
16333 printf("semget failed: errno = %d\n", errno);
16339 if eval $compile; then
16342 semid_ds) val="$define" ;;
16346 set d_semctl_semid_ds
16350 case "$d_semctl_semid_ds" in
16352 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
16354 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
16361 # We do not have the full sem*(2) library, so assume we can not
16367 set d_semctl_semid_ds
16372 : see if sendmsg exists
16373 set sendmsg d_sendmsg
16376 : see if setegid exists
16377 set setegid d_setegid
16380 : see if seteuid exists
16381 set seteuid d_seteuid
16384 : see if setgrent exists
16385 set setgrent d_setgrent
16388 : see if setgrent_r exists
16389 set setgrent_r d_setgrent_r
16391 case "$d_setgrent_r" in
16393 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
16394 case "$d_setgrent_r_proto:$usethreads" in
16395 ":define") d_setgrent_r_proto=define
16396 set d_setgrent_r_proto setgrent_r $hdrs
16400 case "$d_setgrent_r_proto" in
16402 case "$setgrent_r_proto" in
16403 ''|0) try='int setgrent_r(FILE**);'
16404 ./protochk "extern $try" $hdrs && setgrent_r_proto=I_H ;;
16406 case "$setgrent_r_proto" in
16407 ''|0) try='void setgrent_r(FILE**);'
16408 ./protochk "extern $try" $hdrs && setgrent_r_proto=V_H ;;
16410 case "$setgrent_r_proto" in
16411 ''|0) d_setgrent_r=undef
16413 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
16414 * ) case "$setgrent_r_proto" in
16415 REENTRANT_PROTO*) ;;
16416 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
16418 echo "Prototype: $try" ;;
16421 *) case "$usethreads" in
16422 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
16429 *) setgrent_r_proto=0
16433 : see if sethostent exists
16434 set sethostent d_sethent
16437 : see if sethostent_r exists
16438 set sethostent_r d_sethostent_r
16440 case "$d_sethostent_r" in
16442 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16443 case "$d_sethostent_r_proto:$usethreads" in
16444 ":define") d_sethostent_r_proto=define
16445 set d_sethostent_r_proto sethostent_r $hdrs
16449 case "$d_sethostent_r_proto" in
16451 case "$sethostent_r_proto" in
16452 ''|0) try='int sethostent_r(int, struct hostent_data*);'
16453 ./protochk "extern $try" $hdrs && sethostent_r_proto=I_ID ;;
16455 case "$sethostent_r_proto" in
16456 ''|0) try='void sethostent_r(int, struct hostent_data*);'
16457 ./protochk "extern $try" $hdrs && sethostent_r_proto=V_ID ;;
16459 case "$sethostent_r_proto" in
16460 ''|0) d_sethostent_r=undef
16461 sethostent_r_proto=0
16462 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
16463 * ) case "$sethostent_r_proto" in
16464 REENTRANT_PROTO*) ;;
16465 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
16467 echo "Prototype: $try" ;;
16470 *) case "$usethreads" in
16471 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
16473 d_sethostent_r=undef
16474 sethostent_r_proto=0
16478 *) sethostent_r_proto=0
16482 : see if setitimer exists
16483 set setitimer d_setitimer
16486 : see if setlinebuf exists
16487 set setlinebuf d_setlinebuf
16490 : see if setlocale exists
16491 set setlocale d_setlocale
16494 : see if locale.h is available
16495 set locale.h i_locale
16498 : see if setlocale_r exists
16499 set setlocale_r d_setlocale_r
16501 case "$d_setlocale_r" in
16503 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
16504 case "$d_setlocale_r_proto:$usethreads" in
16505 ":define") d_setlocale_r_proto=define
16506 set d_setlocale_r_proto setlocale_r $hdrs
16510 case "$d_setlocale_r_proto" in
16512 case "$setlocale_r_proto" in
16513 ''|0) try='int setlocale_r(int, const char*, char*, int);'
16514 ./protochk "extern $try" $hdrs && setlocale_r_proto=I_ICBI ;;
16516 case "$setlocale_r_proto" in
16517 ''|0) d_setlocale_r=undef
16518 setlocale_r_proto=0
16519 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
16520 * ) case "$setlocale_r_proto" in
16521 REENTRANT_PROTO*) ;;
16522 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
16524 echo "Prototype: $try" ;;
16527 *) case "$usethreads" in
16528 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
16530 d_setlocale_r=undef
16531 setlocale_r_proto=0
16535 *) setlocale_r_proto=0
16539 : see if setnetent exists
16540 set setnetent d_setnent
16543 : see if setnetent_r exists
16544 set setnetent_r d_setnetent_r
16546 case "$d_setnetent_r" in
16548 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16549 case "$d_setnetent_r_proto:$usethreads" in
16550 ":define") d_setnetent_r_proto=define
16551 set d_setnetent_r_proto setnetent_r $hdrs
16555 case "$d_setnetent_r_proto" in
16557 case "$setnetent_r_proto" in
16558 ''|0) try='int setnetent_r(int, struct netent_data*);'
16559 ./protochk "extern $try" $hdrs && setnetent_r_proto=I_ID ;;
16561 case "$setnetent_r_proto" in
16562 ''|0) try='void setnetent_r(int, struct netent_data*);'
16563 ./protochk "extern $try" $hdrs && setnetent_r_proto=V_ID ;;
16565 case "$setnetent_r_proto" in
16566 ''|0) d_setnetent_r=undef
16567 setnetent_r_proto=0
16568 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
16569 * ) case "$setnetent_r_proto" in
16570 REENTRANT_PROTO*) ;;
16571 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
16573 echo "Prototype: $try" ;;
16576 *) case "$usethreads" in
16577 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
16579 d_setnetent_r=undef
16580 setnetent_r_proto=0
16584 *) setnetent_r_proto=0
16588 : see if setprotoent exists
16589 set setprotoent d_setpent
16592 : see if setpgid exists
16593 set setpgid d_setpgid
16596 : see if setpgrp2 exists
16597 set setpgrp2 d_setpgrp2
16600 : see if setpriority exists
16601 set setpriority d_setprior
16604 : see if setproctitle exists
16605 set setproctitle d_setproctitle
16608 : see if setprotoent_r exists
16609 set setprotoent_r d_setprotoent_r
16611 case "$d_setprotoent_r" in
16613 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16614 case "$d_setprotoent_r_proto:$usethreads" in
16615 ":define") d_setprotoent_r_proto=define
16616 set d_setprotoent_r_proto setprotoent_r $hdrs
16620 case "$d_setprotoent_r_proto" in
16622 case "$setprotoent_r_proto" in
16623 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
16624 ./protochk "extern $try" $hdrs && setprotoent_r_proto=I_ID ;;
16626 case "$setprotoent_r_proto" in
16627 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
16628 ./protochk "extern $try" $hdrs && setprotoent_r_proto=V_ID ;;
16630 case "$setprotoent_r_proto" in
16631 ''|0) d_setprotoent_r=undef
16632 setprotoent_r_proto=0
16633 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
16634 * ) case "$setprotoent_r_proto" in
16635 REENTRANT_PROTO*) ;;
16636 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
16638 echo "Prototype: $try" ;;
16641 *) case "$usethreads" in
16642 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
16644 d_setprotoent_r=undef
16645 setprotoent_r_proto=0
16649 *) setprotoent_r_proto=0
16653 : see if setpwent exists
16654 set setpwent d_setpwent
16657 : see if setpwent_r exists
16658 set setpwent_r d_setpwent_r
16660 case "$d_setpwent_r" in
16662 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
16663 case "$d_setpwent_r_proto:$usethreads" in
16664 ":define") d_setpwent_r_proto=define
16665 set d_setpwent_r_proto setpwent_r $hdrs
16669 case "$d_setpwent_r_proto" in
16671 case "$setpwent_r_proto" in
16672 ''|0) try='int setpwent_r(FILE**);'
16673 ./protochk "extern $try" $hdrs && setpwent_r_proto=I_H ;;
16675 case "$setpwent_r_proto" in
16676 ''|0) try='void setpwent_r(FILE**);'
16677 ./protochk "extern $try" $hdrs && setpwent_r_proto=V_H ;;
16679 case "$setpwent_r_proto" in
16680 ''|0) d_setpwent_r=undef
16682 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
16683 * ) case "$setpwent_r_proto" in
16684 REENTRANT_PROTO*) ;;
16685 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
16687 echo "Prototype: $try" ;;
16690 *) case "$usethreads" in
16691 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
16698 *) setpwent_r_proto=0
16702 : see if setregid exists
16703 set setregid d_setregid
16705 set setresgid d_setresgid
16708 : see if setreuid exists
16709 set setreuid d_setreuid
16711 set setresuid d_setresuid
16714 : see if setrgid exists
16715 set setrgid d_setrgid
16718 : see if setruid exists
16719 set setruid d_setruid
16722 : see if setservent exists
16723 set setservent d_setsent
16726 : see if setservent_r exists
16727 set setservent_r d_setservent_r
16729 case "$d_setservent_r" in
16731 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16732 case "$d_setservent_r_proto:$usethreads" in
16733 ":define") d_setservent_r_proto=define
16734 set d_setservent_r_proto setservent_r $hdrs
16738 case "$d_setservent_r_proto" in
16740 case "$setservent_r_proto" in
16741 ''|0) try='int setservent_r(int, struct servent_data*);'
16742 ./protochk "extern $try" $hdrs && setservent_r_proto=I_ID ;;
16744 case "$setservent_r_proto" in
16745 ''|0) try='void setservent_r(int, struct servent_data*);'
16746 ./protochk "extern $try" $hdrs && setservent_r_proto=V_ID ;;
16748 case "$setservent_r_proto" in
16749 ''|0) d_setservent_r=undef
16750 setservent_r_proto=0
16751 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
16752 * ) case "$setservent_r_proto" in
16753 REENTRANT_PROTO*) ;;
16754 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
16756 echo "Prototype: $try" ;;
16759 *) case "$usethreads" in
16760 define) echo "setservent_r has no prototype, not using it." >&4 ;;
16762 d_setservent_r=undef
16763 setservent_r_proto=0
16767 *) setservent_r_proto=0
16771 : see if setsid exists
16772 set setsid d_setsid
16775 : see if setvbuf exists
16776 set setvbuf d_setvbuf
16779 : see if sfio.h is available
16784 : see if sfio library is available
16795 : Ok, but do we want to use it.
16799 true|$define|[yY]*) dflt='y';;
16802 echo "$package can use the sfio library, but it is experimental."
16803 case "$useperlio" in
16805 echo "For sfio also the PerlIO abstraction layer is needed."
16806 echo "Earlier you said you wouldn't want that."
16809 rp="You seem to have sfio available, do you want to try using it?"
16812 y|Y) echo "Ok, turning on both sfio and PerlIO, then."
16813 useperlio="$define"
16816 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
16821 *) case "$usesfio" in
16822 true|$define|[yY]*)
16823 echo "Sorry, cannot find sfio on this machine." >&4
16824 echo "Ignoring your setting of usesfio=$usesfio." >&4
16833 $define) usesfio='true';;
16834 *) usesfio='false';;
16838 *) : Remove sfio from list of libraries to use
16841 echo "Removing unneeded -lsfio from library list" >&4
16842 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
16845 echo "libs = $libs" >&4
16852 : see if shmctl exists
16853 set shmctl d_shmctl
16856 : see if shmget exists
16857 set shmget d_shmget
16860 : see if shmat exists
16863 : see what shmat returns
16866 $cat >shmat.c <<'END'
16867 #include <sys/shm.h>
16870 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
16875 echo "and it returns ($shmattype)." >&4
16876 : see if a prototype for shmat is available
16877 xxx=`./findhdr sys/shm.h`
16878 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
16879 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
16890 set d_shmatprototype
16893 : see if shmdt exists
16897 : see how much of the 'shm*(2)' library is present.
16900 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
16901 *"$undef"*) h_shm=false;;
16905 case "`ipcs 2>&1`" in
16906 "SVID shared memory"*"not configured"*)
16907 echo "Your $osname does not have the shm*(2) configured." >&4
16910 set shmctl d_shmctl
16912 set shmget d_shmget
16922 : we could also check for sys/ipc.h ...
16923 if $h_shm && $test `./findhdr sys/shm.h`; then
16924 echo "You have the full shm*(2) library." >&4
16927 echo "You don't have the full shm*(2) library." >&4
16934 : see if we have sigaction
16935 if set sigaction val -f d_sigaction; eval $csym; $val; then
16936 echo 'sigaction() found.' >&4
16939 #include <sys/types.h>
16940 #include <signal.h>
16941 #$i_stdlib I_STDLIB
16943 #include <stdlib.h>
16947 struct sigaction act, oact;
16949 oact.sa_handler = 0;
16950 /* so that act and oact are used */
16951 exit(act.sa_flags == 0 && oact.sa_handler == 0);
16955 if eval $compile_ok; then
16958 echo "But you don't seem to have a useable struct sigaction." >&4
16962 echo 'sigaction NOT found.' >&4
16965 set d_sigaction; eval $setvar
16966 $rm -f try try$_o try.c
16968 : see if this is a sunmath.h system
16969 set sunmath.h i_sunmath
16972 : see if signbit exists
16973 $echo $n "Checking to see if you have signbit() available to work on $nvtype... $c" >&4
16976 #$i_sunmath I_SUNMATH
16980 #ifdef I_SUNMATH /* Solaris special math library */
16981 # include <sunmath.h>
16984 int main(int argc, char **argv)
16988 if ((signbit(x) == 0) && (signbit(y) != 0))
16996 if eval $compile; then
16997 if $run ./try; then
17001 $echo "Signbit seems to be available, but doesn't work as I expected."
17002 $echo "I won't use it." >&4
17013 : see if sigprocmask exists
17014 set sigprocmask d_sigprocmask
17017 : see if sigsetjmp exists
17019 case "$d_sigsetjmp" in
17022 #include <setjmp.h>
17023 #$i_stdlib I_STDLIB
17025 #include <stdlib.h>
17031 if (sigsetjmp(env,1))
17034 siglongjmp(env, 1);
17039 if eval $compile; then
17040 if $run ./try >/dev/null 2>&1; then
17041 echo "POSIX sigsetjmp found." >&4
17045 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
17051 echo "sigsetjmp not found." >&4
17055 *) val="$d_sigsetjmp"
17056 case "$d_sigsetjmp" in
17057 $define) echo "POSIX sigsetjmp found." >&4;;
17058 $undef) echo "sigsetjmp not found." >&4;;
17066 : see if snprintf exists
17067 set snprintf d_snprintf
17070 : see if vsnprintf exists
17071 set vsnprintf d_vsnprintf
17074 case "$d_snprintf-$d_vsnprintf" in
17077 Checking whether your snprintf() and vsnprintf() work okay...
17079 $cat >try.c <<'EOCP'
17080 /* v?snprintf testing logic courtesy of Russ Allbery.
17081 * According to C99:
17082 * - if the buffer is too short it still must be \0-terminated
17083 * - if the buffer is too short the potentially required length
17084 * must be returned and not -1
17085 * - if the buffer is NULL the potentially required length
17086 * must be returned and not -1 or core dump
17089 #include <stdarg.h>
17093 int test (char *format, ...)
17098 va_start (args, format);
17099 count = vsnprintf (buf, sizeof buf, format, args);
17106 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
17107 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
17111 if eval $compile; then
17114 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
17116 Your snprintf() and snprintf() don't seem to be working okay.
17118 d_snprintf="$undef"
17119 d_vsnprintf="$undef"
17123 echo "(I can't seem to compile the test program--assuming they don't)"
17124 d_snprintf="$undef"
17125 d_vsnprintf="$undef"
17127 $rm -f try.* try core core.try.*
17131 : see if sockatmark exists
17132 set sockatmark d_sockatmark
17135 : see if prototype for sockatmark is available
17137 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
17140 : see if socks5_init exists
17141 set socks5_init d_socks5_init
17144 : see if sprintf returns the length of the string in the buffer as per ANSI
17145 $echo "Checking whether sprintf returns the length of the string..." >&4
17148 #$i_stdlib I_STDLIB
17150 #include <stdlib.h>
17152 #$i_string I_STRING
17154 # include <string.h>
17156 # include <strings.h>
17165 int check (size_t expect, int test) {
17166 size_t got = strlen(buffer);
17170 printf("expected %ld, got %ld in test %d '%s'\n", (long) expect, (long) got,
17175 int main(int argc, char **argv) {
17178 check(sprintf(buffer, ""), ++test);
17179 check(sprintf(buffer, "%s %s", "perl", "rules"), ++test);
17180 check(sprintf(buffer, "I like %g", atan2(0,-1)), ++test);
17187 d_sprintf_returns_strlen="$undef"
17188 if eval $compile; then
17192 sprintf returns the length of the string (as ANSI says it should)
17194 d_sprintf_returns_strlen="$define"
17197 sprintf does not return the length of the string (how old is this system?)
17199 d_sprintf_returns_strlen="$undef"
17206 : see if srand48_r exists
17207 set srand48_r d_srand48_r
17209 case "$d_srand48_r" in
17211 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17212 case "$d_srand48_r_proto:$usethreads" in
17213 ":define") d_srand48_r_proto=define
17214 set d_srand48_r_proto srand48_r $hdrs
17218 case "$d_srand48_r_proto" in
17220 case "$srand48_r_proto" in
17221 ''|0) try='int srand48_r(long, struct drand48_data*);'
17222 ./protochk "extern $try" $hdrs && srand48_r_proto=I_LS ;;
17224 case "$srand48_r_proto" in
17225 ''|0) d_srand48_r=undef
17227 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
17228 * ) case "$srand48_r_proto" in
17229 REENTRANT_PROTO*) ;;
17230 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
17232 echo "Prototype: $try" ;;
17235 *) case "$usethreads" in
17236 define) echo "srand48_r has no prototype, not using it." >&4 ;;
17243 *) srand48_r_proto=0
17247 : see if srandom_r exists
17248 set srandom_r d_srandom_r
17250 case "$d_srandom_r" in
17252 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17253 case "$d_srandom_r_proto:$usethreads" in
17254 ":define") d_srandom_r_proto=define
17255 set d_srandom_r_proto srandom_r $hdrs
17259 case "$d_srandom_r_proto" in
17261 case "$srandom_r_proto" in
17262 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
17263 ./protochk "extern $try" $hdrs && srandom_r_proto=I_TS ;;
17265 case "$srandom_r_proto" in
17266 ''|0) d_srandom_r=undef
17268 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
17269 * ) case "$srandom_r_proto" in
17270 REENTRANT_PROTO*) ;;
17271 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
17273 echo "Prototype: $try" ;;
17276 *) case "$usethreads" in
17277 define) echo "srandom_r has no prototype, not using it." >&4 ;;
17284 *) srandom_r_proto=0
17288 : see if prototype for setresgid is available
17290 set d_sresgproto setresgid $i_unistd unistd.h
17293 : see if prototype for setresuid is available
17295 set d_sresuproto setresuid $i_unistd unistd.h
17298 : see if sys/stat.h is available
17299 set sys/stat.h i_sysstat
17303 : see if stat knows about block sizes
17305 echo "Checking to see if your struct stat has st_blocks field..." >&4
17306 set d_statblks stat st_blocks $i_sysstat sys/stat.h
17310 : see if this is a sys/vfs.h system
17311 set sys/vfs.h i_sysvfs
17315 : see if this is a sys/statfs.h system
17316 set sys/statfs.h i_sysstatfs
17321 echo "Checking to see if your system supports struct statfs..." >&4
17322 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
17324 case "$d_statfs_s" in
17325 "$define") echo "Yes, it does." ;;
17326 *) echo "No, it doesn't." ;;
17331 : see if struct statfs knows about f_flags
17332 case "$d_statfs_s" in
17335 echo "Checking to see if your struct statfs has f_flags field..." >&4
17336 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
17340 set d_statfs_f_flags
17344 case "$d_statfs_f_flags" in
17345 "$define") echo "Yes, it does." ;;
17346 *) echo "No, it doesn't." ;;
17350 Checking how to access stdio streams by file descriptor number...
17352 case "$stdio_stream_array" in
17353 '') $cat >try.c <<EOCP
17356 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
17360 for s in _iob __iob __sF
17362 set try -DSTDIO_STREAM_ARRAY=$s
17363 if eval $compile; then
17364 case "`$run ./try`" in
17365 yes) stdio_stream_array=$s; break ;;
17369 $rm -f try.* try$exe_ext
17371 case "$stdio_stream_array" in
17373 I can't figure out how to access stdio streams by file descriptor number.
17375 d_stdio_stream_array="$undef"
17378 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
17380 d_stdio_stream_array="$define"
17384 : see if strcoll exists
17385 set strcoll d_strcoll
17388 : check for structure copying
17390 echo "Checking to see if your C compiler can copy structs..." >&4
17391 $cat >try.c <<'EOCP'
17401 if $cc -c try.c >/dev/null 2>&1 ; then
17403 echo "Yup, it can."
17406 echo "Nope, it can't."
17412 : see if strerror and/or sys_errlist[] exist
17414 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
17415 if set strerror val -f d_strerror; eval $csym; $val; then
17416 echo 'strerror() found.' >&4
17417 d_strerror="$define"
17418 d_strerrm='strerror(e)'
17419 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17420 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
17421 d_syserrlst="$define"
17423 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
17424 d_syserrlst="$undef"
17426 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
17427 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
17428 echo 'strerror() found in string header.' >&4
17429 d_strerror="$define"
17430 d_strerrm='strerror(e)'
17431 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17432 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
17433 d_syserrlst="$define"
17435 echo "(You don't appear to have any sys_errlist[], how can this be?)"
17436 d_syserrlst="$undef"
17438 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17439 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
17440 d_strerror="$undef"
17441 d_syserrlst="$define"
17442 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
17444 echo 'strerror() and sys_errlist[] NOT found.' >&4
17445 d_strerror="$undef"
17446 d_syserrlst="$undef"
17447 d_strerrm='"unknown"'
17451 : see if strerror_r exists
17452 set strerror_r d_strerror_r
17454 case "$d_strerror_r" in
17456 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
17457 case "$d_strerror_r_proto:$usethreads" in
17458 ":define") d_strerror_r_proto=define
17459 set d_strerror_r_proto strerror_r $hdrs
17463 case "$d_strerror_r_proto" in
17465 case "$strerror_r_proto" in
17466 ''|0) try='int strerror_r(int, char*, size_t);'
17467 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBW ;;
17469 case "$strerror_r_proto" in
17470 ''|0) try='int strerror_r(int, char*, int);'
17471 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBI ;;
17473 case "$strerror_r_proto" in
17474 ''|0) try='char* strerror_r(int, char*, size_t);'
17475 ./protochk "extern $try" $hdrs && strerror_r_proto=B_IBW ;;
17477 case "$strerror_r_proto" in
17478 ''|0) d_strerror_r=undef
17480 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
17481 * ) case "$strerror_r_proto" in
17482 REENTRANT_PROTO*) ;;
17483 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
17485 echo "Prototype: $try" ;;
17488 *) case "$usethreads" in
17489 define) echo "strerror_r has no prototype, not using it." >&4 ;;
17496 *) strerror_r_proto=0
17500 : see if strftime exists
17501 set strftime d_strftime
17504 : see if strlcat exists
17505 set strlcat d_strlcat
17508 : see if strlcpy exists
17509 set strlcpy d_strlcpy
17512 : see if strtod exists
17513 set strtod d_strtod
17516 : see if strtol exists
17517 set strtol d_strtol
17520 : see if strtold exists
17521 set strtold d_strtold
17524 : see if strtoll exists
17525 set strtoll d_strtoll
17528 case "$d_longlong-$d_strtoll" in
17531 Checking whether your strtoll() works okay...
17533 $cat >try.c <<'EOCP'
17536 #define strtoll __strtoll
17539 #define strtoll _strtoll
17542 extern long long int strtoll(char *s, char **, int);
17543 static int bad = 0;
17544 int check(char *s, long long ell, int een) {
17547 gll = strtoll(s, 0, 10);
17548 if (!((gll == ell) && (errno == een)))
17552 check(" 1", 1LL, 0);
17553 check(" 0", 0LL, 0);
17554 check("-1", -1LL, 0);
17555 check("-9223372036854775808", -9223372036854775808LL, 0);
17556 check("-9223372036854775808", -9223372036854775808LL, 0);
17557 check(" 9223372036854775807", 9223372036854775807LL, 0);
17558 check("-9223372036854775808", -9223372036854775808LL, 0);
17559 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
17560 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
17566 if eval $compile; then
17569 ok) echo "Your strtoll() seems to be working okay." ;;
17571 Your strtoll() doesn't seem to be working okay.
17577 echo "(I can't seem to compile the test program--assuming it doesn't)"
17583 : see if strtoq exists
17584 set strtoq d_strtoq
17587 : see if strtoul exists
17588 set strtoul d_strtoul
17591 case "$d_strtoul" in
17594 Checking whether your strtoul() works okay...
17596 $cat >try.c <<'EOCP'
17599 extern unsigned long int strtoul(char *s, char **, int);
17600 static int bad = 0;
17601 void check(char *s, unsigned long eul, int een) {
17604 gul = strtoul(s, 0, 10);
17605 if (!((gul == eul) && (errno == een)))
17609 check(" 1", 1L, 0);
17610 check(" 0", 0L, 0);
17612 case "$longsize" in
17614 $cat >>try.c <<'EOCP'
17615 check("18446744073709551615", 18446744073709551615UL, 0);
17616 check("18446744073709551616", 18446744073709551615UL, ERANGE);
17617 #if 0 /* strtoul() for /^-/ strings is undefined. */
17618 check("-1", 18446744073709551615UL, 0);
17619 check("-18446744073709551614", 2, 0);
17620 check("-18446744073709551615", 1, 0);
17621 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
17622 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
17627 $cat >>try.c <<'EOCP'
17628 check("4294967295", 4294967295UL, 0);
17629 check("4294967296", 4294967295UL, ERANGE);
17630 #if 0 /* strtoul() for /^-/ strings is undefined. */
17631 check("-1", 4294967295UL, 0);
17632 check("-4294967294", 2, 0);
17633 check("-4294967295", 1, 0);
17634 check("-4294967296", 4294967295UL, ERANGE);
17635 check("-4294967297", 4294967295UL, ERANGE);
17640 : Should we write these tests to be more portable by sprintf-ing
17641 : ~0 and then manipulating that char string as input for strtol?
17644 $cat >>try.c <<'EOCP'
17651 if eval $compile; then
17652 case "`$run ./try`" in
17653 ok) echo "Your strtoul() seems to be working okay." ;;
17655 Your strtoul() doesn't seem to be working okay.
17664 : see if strtoull exists
17665 set strtoull d_strtoull
17668 case "$d_longlong-$d_strtoull" in
17671 Checking whether your strtoull() works okay...
17673 $cat >try.c <<'EOCP'
17676 #define strtoull __strtoull
17679 extern unsigned long long int strtoull(char *s, char **, int);
17680 static int bad = 0;
17681 int check(char *s, long long eull, int een) {
17684 gull = strtoull(s, 0, 10);
17685 if (!((gull == eull) && (errno == een)))
17689 check(" 1", 1LL, 0);
17690 check(" 0", 0LL, 0);
17691 check("18446744073709551615", 18446744073709551615ULL, 0);
17692 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
17693 #if 0 /* strtoull() for /^-/ strings is undefined. */
17694 check("-1", 18446744073709551615ULL, 0);
17695 check("-18446744073709551614", 2LL, 0);
17696 check("-18446744073709551615", 1LL, 0);
17697 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
17698 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
17705 if eval $compile; then
17706 case "`$run ./try`" in
17707 ok) echo "Your strtoull() seems to be working okay." ;;
17709 Your strtoull() doesn't seem to be working okay.
17711 d_strtoull="$undef"
17718 : see if strtouq exists
17719 set strtouq d_strtouq
17722 case "$d_strtouq" in
17725 Checking whether your strtouq() works okay...
17727 $cat >try.c <<'EOCP'
17730 extern unsigned long long int strtouq(char *s, char **, int);
17731 static int bad = 0;
17732 void check(char *s, unsigned long long eull, int een) {
17733 unsigned long long gull;
17735 gull = strtouq(s, 0, 10);
17736 if (!((gull == eull) && (errno == een)))
17740 check(" 1", 1LL, 0);
17741 check(" 0", 0LL, 0);
17742 check("18446744073709551615", 18446744073709551615ULL, 0);
17743 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
17744 #if 0 /* strtouq() for /^-/ strings is undefined. */
17745 check("-1", 18446744073709551615ULL, 0);
17746 check("-18446744073709551614", 2LL, 0);
17747 check("-18446744073709551615", 1LL, 0);
17748 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
17749 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
17757 if eval $compile; then
17758 case "`$run ./try`" in
17759 ok) echo "Your strtouq() seems to be working okay." ;;
17761 Your strtouq() doesn't seem to be working okay.
17770 : see if strxfrm exists
17771 set strxfrm d_strxfrm
17774 : see if symlink exists
17775 set symlink d_symlink
17778 : see if syscall exists
17779 set syscall d_syscall
17782 : see if prototype for syscall is available
17784 set d_syscallproto syscall $i_unistd unistd.h
17787 : see if sysconf exists
17788 set sysconf d_sysconf
17791 : see if system exists
17792 set system d_system
17795 : see if tcgetpgrp exists
17796 set tcgetpgrp d_tcgetpgrp
17799 : see if tcsetpgrp exists
17800 set tcsetpgrp d_tcsetpgrp
17803 : see if prototype for telldir is available
17805 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
17808 : see if time exists
17810 if test "X$d_time" = X -o X"$timetype" = X; then
17811 if set time val -f d_time; eval $csym; $val; then
17812 echo 'time() found.' >&4
17814 rp="What is the type returned by time() on this system?"
17815 set time_t timetype long stdio.h sys/types.h
17818 echo 'time() not found, hope that will do.' >&4
17826 : see if this is a sys/times.h system
17827 set sys/times.h i_systimes
17830 : see if times exists
17832 if set times val -f d_times; eval $csym; $val; then
17833 echo 'times() found.' >&4
17836 case "$i_systimes" in
17837 "$define") inc='sys/times.h';;
17839 rp="What is the type returned by times() on this system?"
17840 set clock_t clocktype long stdio.h sys/types.h $inc
17843 echo 'times() NOT found, hope that will do.' >&4
17848 : see if tmpnam_r exists
17849 set tmpnam_r d_tmpnam_r
17851 case "$d_tmpnam_r" in
17853 hdrs="$i_systypes sys/types.h define stdio.h "
17854 case "$d_tmpnam_r_proto:$usethreads" in
17855 ":define") d_tmpnam_r_proto=define
17856 set d_tmpnam_r_proto tmpnam_r $hdrs
17860 case "$d_tmpnam_r_proto" in
17862 case "$tmpnam_r_proto" in
17863 ''|0) try='char* tmpnam_r(char*);'
17864 ./protochk "extern $try" $hdrs && tmpnam_r_proto=B_B ;;
17866 case "$tmpnam_r_proto" in
17867 ''|0) d_tmpnam_r=undef
17869 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
17870 * ) case "$tmpnam_r_proto" in
17871 REENTRANT_PROTO*) ;;
17872 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
17874 echo "Prototype: $try" ;;
17877 *) case "$usethreads" in
17878 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
17885 *) tmpnam_r_proto=0
17889 : see if truncate exists
17890 set truncate d_truncate
17893 : see if ttyname_r exists
17894 set ttyname_r d_ttyname_r
17896 case "$d_ttyname_r" in
17898 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
17899 case "$d_ttyname_r_proto:$usethreads" in
17900 ":define") d_ttyname_r_proto=define
17901 set d_ttyname_r_proto ttyname_r $hdrs
17905 case "$d_ttyname_r_proto" in
17907 case "$ttyname_r_proto" in
17908 ''|0) try='int ttyname_r(int, char*, size_t);'
17909 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBW ;;
17911 case "$ttyname_r_proto" in
17912 ''|0) try='int ttyname_r(int, char*, int);'
17913 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBI ;;
17915 case "$ttyname_r_proto" in
17916 ''|0) try='char* ttyname_r(int, char*, int);'
17917 ./protochk "extern $try" $hdrs && ttyname_r_proto=B_IBI ;;
17919 case "$ttyname_r_proto" in
17920 ''|0) d_ttyname_r=undef
17922 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
17923 * ) case "$ttyname_r_proto" in
17924 REENTRANT_PROTO*) ;;
17925 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
17927 echo "Prototype: $try" ;;
17930 *) case "$usethreads" in
17931 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
17938 *) ttyname_r_proto=0
17942 : see if tzname[] exists
17944 if set tzname val -a d_tzname; eval $csym; $val; then
17946 echo 'tzname[] found.' >&4
17949 echo 'tzname[] NOT found.' >&4
17955 next|rhapsody|darwin) multiarch="$define" ;;
17957 case "$multiarch" in
17958 ''|[nN]*) multiarch="$undef" ;;
17961 : check for ordering of bytes in a UV
17963 case "$usecrosscompile$multiarch" in
17966 You seem to be either cross-compiling or doing a multiarchitecture build,
17967 skipping the byteorder check.
17973 case "$byteorder" in
17976 In the following, larger digits indicate more significance. A big-endian
17977 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
17978 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
17979 machines may have weird orders like 3412. A Cray will report 87654321,
17980 an Alpha will report 12345678. If the test program works the default is
17982 I'm now running the test program...
17986 #$i_stdlib I_STDLIB
17988 #include <stdlib.h>
17990 #include <sys/types.h>
17991 typedef $uvtype UV;
18001 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
18003 u.l = (UV)0x04030201;
18004 for (i = 0; i < $uvsize; i++)
18005 printf("%c", u.c[i]+'0');
18012 if eval $compile && ./try > /dev/null; then
18015 [1-4][1-4][1-4][1-4]|12345678|87654321)
18016 echo "(The test program ran ok.)"
18017 echo "byteorder=$dflt"
18020 ????|????????) echo "(The test program ran ok.)" ;;
18021 *) echo "(The test program didn't run right for some reason.)" ;;
18026 (I can't seem to compile the test program. Guessing big-endian...)
18029 case "$xxx_prompt" in
18031 rp="What is the order of bytes in $uvtype?"
18047 Checking to see whether you can access character data unalignedly...
18049 case "$d_u32align" in
18050 '') $cat >try.c <<EOCP
18052 #$i_stdlib I_STDLIB
18054 #include <stdlib.h>
18056 #define U32 $u32type
18057 #define BYTEORDER 0x$byteorder
18059 #include <signal.h>
18061 $signal_t bletch(int s) { exit(4); }
18064 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
18069 if (sizeof(U32) != 4) {
18070 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
18077 signal(SIGBUS, bletch);
18089 for (i = 0; i < 4; i++) {
18090 up = (U32*)(buf + i);
18091 if (! ((*up == 1 << (8*i)) || /* big-endian */
18092 (*up == 1 << (8*(3-i))) /* little-endian */
18096 printf("read failed (%x)\n", *up);
18102 for (i = 0; i < 4; i++) {
18103 up = (U32*)(buf + i);
18105 if (*up != 0xBeef) {
18106 printf("write failed (%x)\n", *up);
18120 if eval $compile_ok; then
18121 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
18122 $run ./try 2>&1 >/dev/null
18125 You can access character data pretty unalignedly.
18127 d_u32align="$undef"
18130 It seems that you must access character data in an aligned manner.
18132 d_u32align="$define"
18136 rp='Can you access character data at unaligned addresses?'
18140 [yY]*) d_u32align="$undef" ;;
18141 *) d_u32align="$define" ;;
18144 $rm -f core core.try.* try.core
18148 : see if ualarm exists
18149 set ualarm d_ualarm
18152 : see if umask exists
18156 : see if unordered exists
18157 set unordered d_unordered
18160 : see if unsetenv exists
18161 set unsetenv d_unsetenv
18164 : see if usleep exists
18165 set usleep d_usleep
18168 : see if prototype for usleep is available
18170 set d_usleepproto usleep $i_unistd unistd.h
18173 : see if ustat exists
18177 : see if closedir exists
18178 set closedir d_closedir
18181 case "$d_closedir" in
18184 echo "Checking whether closedir() returns a status..." >&4
18186 #$i_dirent I_DIRENT /**/
18187 #$i_sysdir I_SYS_DIR /**/
18188 #$i_sysndir I_SYS_NDIR /**/
18189 #$i_systypes I_SYS_TYPES /**/
18191 #if defined(I_SYS_TYPES)
18192 #include <sys/types.h>
18194 #if defined(I_DIRENT)
18195 #include <dirent.h>
18196 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
18197 #include <sys/dir.h>
18201 #include <sys/ndir.h>
18205 #include <ndir.h> /* may be wrong in the future */
18207 #include <sys/dir.h>
18212 int main() { return closedir(opendir(".")); }
18215 if eval $compile_ok; then
18216 if $run ./try > /dev/null 2>&1 ; then
18217 echo "Yes, it does."
18220 echo "No, it doesn't."
18224 echo "(I can't seem to compile the test program--assuming it doesn't)"
18232 set d_void_closedir
18235 : see if there is a wait4
18239 : see if waitpid exists
18240 set waitpid d_waitpid
18243 : see if wcstombs exists
18244 set wcstombs d_wcstombs
18247 : see if wctomb exists
18248 set wctomb d_wctomb
18251 : see if writev exists
18252 set writev d_writev
18255 : preserve RCS keywords in files with variable substitution, grrr
18260 Revision='$Revision'
18262 : check for alignment requirements
18264 case "$usecrosscompile$multiarch" in
18267 You seem to be either cross-compiling or doing a multiarchitecture build,
18268 skipping the memory alignment check.
18271 case "$alignbytes" in
18272 '') alignbytes=8 ;;
18276 case "$alignbytes" in
18277 '') echo "Checking alignment constraints..." >&4
18278 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
18279 $cat >try.c <<'EOCP'
18280 typedef long double NV;
18283 $cat >try.c <<'EOCP'
18287 $cat >>try.c <<'EOCP'
18295 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
18300 if eval $compile_ok; then
18304 echo "(I can't seem to compile the test program...)"
18307 *) dflt="$alignbytes"
18310 rp="Doubles must be aligned on a how-many-byte boundary?"
18318 : set the base revision
18321 : how do we concatenate cpp tokens here?
18323 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
18324 $cat >cpp_stuff.c <<'EOCP'
18325 #define RCAT(a,b)a/**/b
18326 #define ACAT(a,b)a ## b
18330 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
18331 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
18332 echo "Oh! Smells like ANSI's been here." >&4
18333 echo "We can catify or stringify, separately or together!"
18335 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
18336 echo "Ah, yes! The good old days!" >&4
18337 echo "However, in the good old days we don't know how to stringify and"
18338 echo "catify at the same time."
18342 Hmm, I don't seem to be able to concatenate tokens with your cpp.
18343 You're going to have to edit the values of CAT[2-5] in config.h...
18345 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
18349 : see if this is a db.h system
18355 : Check db version.
18357 echo "Checking Berkeley DB version ..." >&4
18363 #include <sys/types.h>
18365 #$i_stdlib I_STDLIB
18367 #include <stdlib.h>
18370 int main(int argc, char *argv[])
18372 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
18373 int Major, Minor, Patch ;
18374 unsigned long Version ;
18375 (void)db_version(&Major, &Minor, &Patch) ;
18377 printf("%d %d %d %d %d %d\n",
18378 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
18379 Major, Minor, Patch);
18382 printf("You have Berkeley DB Version 2 or greater.\n");
18384 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
18385 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
18386 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
18387 Major, Minor, Patch) ;
18389 /* check that db.h & libdb are compatible */
18390 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
18391 printf("db.h and libdb are incompatible.\n") ;
18395 printf("db.h and libdb are compatible.\n") ;
18397 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
18398 + DB_VERSION_PATCH ;
18400 /* needs to be >= 2.3.4 */
18401 if (Version < 2003004) {
18402 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
18403 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
18409 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
18414 printf("You have Berkeley DB Version 1.\n");
18415 exit(0); /* DB version < 2: the coast is clear. */
18417 exit(1); /* <db.h> not Berkeley DB? */
18423 if eval $compile_ok && $run ./try; then
18424 echo 'Looks OK.' >&4
18426 db_version_major=$1
18427 db_version_minor=$2
18428 db_version_patch=$3
18430 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
18434 : Remove db from list of libraries to use
18435 echo "Removing unusable -ldb from library list" >&4
18436 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
18439 echo "libs = $libs" >&4
18449 : Check the return type needed for hash
18451 echo "Checking return type needed for hash for Berkeley DB ..." >&4
18457 #include <sys/types.h>
18460 #ifndef DB_VERSION_MAJOR
18461 u_int32_t hash_cb (ptr, size)
18469 info.hash = hash_cb;
18473 if $cc $ccflags -c try.c >try.out 2>&1 ; then
18474 if $contains warning try.out >>/dev/null 2>&1 ; then
18477 db_hashtype='u_int32_t'
18480 : XXX Maybe we should just give up here.
18481 db_hashtype=u_int32_t
18483 echo "Help: I can't seem to compile the db test program." >&4
18484 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
18487 echo "Your version of Berkeley DB uses $db_hashtype for hash."
18489 *) db_hashtype=u_int32_t
18494 : Check the return type needed for prefix
18496 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
18502 #include <sys/types.h>
18505 #ifndef DB_VERSION_MAJOR
18506 size_t prefix_cb (key1, key2)
18514 info.prefix = prefix_cb;
18518 if $cc $ccflags -c try.c >try.out 2>&1 ; then
18519 if $contains warning try.out >>/dev/null 2>&1 ; then
18520 db_prefixtype='int'
18522 db_prefixtype='size_t'
18525 db_prefixtype='size_t'
18526 : XXX Maybe we should just give up here.
18528 echo "Help: I can't seem to compile the db test program." >&4
18529 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
18532 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
18534 *) db_prefixtype='size_t'
18539 : How can we generate normalized random numbers ?
18541 echo "Looking for a random number function..." >&4
18542 case "$randfunc" in
18544 if set drand48 val -f; eval $csym; $val; then
18546 echo "Good, found drand48()." >&4
18547 elif set random val -f; eval $csym; $val; then
18549 echo "OK, found random()." >&4
18552 echo "Yick, looks like I have to use rand()." >&4
18563 *-Dmy_rand=*|*-Dmy_srand=*)
18564 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
18565 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
18566 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
18567 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
18571 while $test "$cont"; do
18572 rp="Use which function to generate random numbers?"
18574 if $test "$ans" = "$dflt"; then
18580 if set $ans val -f; eval $csym; $val; then
18584 rp="I cannot find function $ans. Use that name anyway?"
18593 case "$randfunc" in
18595 drand01="drand48()"
18601 case "$randbits" in
18603 echo "Checking to see how many bits your $randfunc() function produces..." >&4
18605 #$i_unistd I_UNISTD
18606 #$i_stdlib I_STDLIB
18609 # include <unistd.h>
18612 # include <stdlib.h>
18617 register unsigned long tmp;
18618 register unsigned long max = 0L;
18620 for (i = 1000; i; i--) {
18621 tmp = (unsigned long) $randfunc();
18622 if (tmp > max) max = tmp;
18624 for (i = 0; max; i++)
18630 if eval $compile_ok; then
18634 echo "(I can't seem to compile the test program...)"
18641 rp="How many bits does your $randfunc() function produce?"
18645 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
18646 seedfunc="s$randfunc"
18647 randseedtype=unsigned
18651 rp="How many bits does your $randfunc() function produce?"
18654 seedfunc="s$randfunc"
18655 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
18656 if set $seedfunc val -f; eval $csym; $val; then
18657 echo "(Using $seedfunc() to seed random generator)"
18659 echo "(Warning: no $seedfunc() to seed random generator)"
18662 randseedtype=unsigned
18670 echo "Determining whether or not we are on an EBCDIC system..." >&4
18671 $cat >try.c <<'EOM'
18674 if ('M'==0xd4) return 0;
18681 if eval $compile_ok; then
18682 if $run ./try; then
18683 echo "You seem to speak EBCDIC." >&4
18686 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
18689 echo "I'm unable to compile the test program." >&4
18690 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
18698 Checking how to flush all pending stdio output...
18700 # I only know how to find the first 32 possibly open files on SunOS.
18701 # See also hints/sunos_4_1.sh and util.c --AD
18703 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
18705 $cat >>try.c <<EOCP
18707 #$i_stdlib I_STDLIB
18709 #include <stdlib.h>
18711 #$i_unistd I_UNISTD
18713 # include <unistd.h>
18715 #$d_sysconf HAS_SYSCONF
18716 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
18717 #ifdef HAS_STDIO_STREAM_ARRAY
18718 # define STDIO_STREAM_ARRAY $stdio_stream_array
18723 p = fopen("try.out", "w");
18727 # ifdef TRY_FPRINTF
18731 #ifdef TRY_FFLUSH_NULL
18734 #ifdef TRY_FFLUSH_ALL
18736 long open_max = -1;
18737 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
18738 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
18740 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
18741 open_max = sysconf(_SC_OPEN_MAX);
18744 open_max = FOPEN_MAX;
18747 open_max = OPEN_MAX;
18756 # ifdef HAS_STDIO_STREAM_ARRAY
18757 if (open_max > 0) {
18759 for (i = 0; i < open_max; i++)
18760 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
18761 STDIO_STREAM_ARRAY[i]._file < open_max &&
18762 STDIO_STREAM_ARRAY[i]._flag)
18763 fflush(&STDIO_STREAM_ARRAY[i]);
18771 : first we have to find out how _not_ to flush
18773 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
18775 set try -DTRY_FPUTC
18776 if eval $compile; then
18777 $run ./try 2>/dev/null
18780 if $test ! -s try.out -a "X$code" = X42; then
18786 set try -DTRY_FPRINTF
18787 if eval $compile; then
18788 $run ./try 2>/dev/null
18791 if $test ! -s try.out -a "X$code" = X42; then
18792 output=-DTRY_FPRINTF
18798 : check for fflush NULL behaviour
18799 case "$fflushNULL" in
18800 '') set try -DTRY_FFLUSH_NULL $output
18801 if eval $compile; then
18802 $run ./try 2>/dev/null
18805 if $test -s try.out -a "X$code" = X42; then
18806 fflushNULL="`$cat try.out`"
18808 if $test "X$code" != X42; then
18810 (If this test failed, don't worry, we'll try another method shortly.)
18815 $rm -f core try.core core.try.*
18816 case "$fflushNULL" in
18818 Your fflush(NULL) works okay for output streams.
18819 Let's see if it clobbers input pipes...
18821 # As of mid-March 2000 all versions of Solaris appear to have a stdio
18822 # bug that improperly flushes the input end of pipes. So we avoid the
18823 # autoflush on fork/system/exec support for now. :-(
18824 $cat >tryp.c <<EOCP
18827 main(int argc, char **argv)
18833 while ((i = getc(stdin)) != -1
18834 && (*bp++ = i) != '\n'
18835 && bp < &buf[1024])
18838 fprintf(stdout, "%s", buf);
18846 fflushNULL="$define"
18848 if eval $compile; then
18850 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
18851 if cmp tryp.c tryp.out >/dev/null 2>&1; then
18853 fflush(NULL) seems to behave okay with input streams.
18855 fflushNULL="$define"
18858 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
18860 fflushNULL="$undef"
18863 $rm -f core tryp.c tryp.core core.tryp.*
18866 Your fflush(NULL) isn't working (contrary to ANSI C).
18868 fflushNULL="$undef"
18871 Cannot figure out whether your fflush(NULL) works or not.
18872 I'm assuming it doesn't (contrary to ANSI C).
18874 fflushNULL="$undef"
18878 $define|true|[yY]*)
18879 fflushNULL="$define"
18882 fflushNULL="$undef"
18885 : check explicit looping only if NULL did not work, and if the pipe
18886 : bug does not show up on an explicit flush too
18887 case "$fflushNULL" in
18889 $cat >tryp.c <<EOCP
18892 main(int argc, char **argv)
18898 while ((i = getc(stdin)) != -1
18899 && (*bp++ = i) != '\n'
18900 && bp < &buf[1024])
18903 fprintf(stdout, "%s", buf);
18912 if eval $compile; then
18914 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
18915 if cmp tryp.c tryp.out >/dev/null 2>&1; then
18917 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
18919 : now check for fflushall behaviour
18920 case "$fflushall" in
18921 '') set try -DTRY_FFLUSH_ALL $output
18922 if eval $compile; then
18924 (Now testing the other method--but note that this also may fail.)
18926 $run ./try 2>/dev/null
18929 if $test -s try.out -a "X$code" = X42; then
18930 fflushall="`$cat try.out`"
18933 $rm -f core try.core core.try.*
18934 case "$fflushall" in
18936 Whew. Flushing explicitly all the stdio streams works.
18938 fflushall="$define"
18941 Sigh. Flushing explicitly all the stdio streams doesn't work.
18946 Cannot figure out whether flushing stdio streams explicitly works or not.
18947 I'm assuming it doesn't.
18953 "$define"|true|[yY]*)
18954 fflushall="$define"
18962 All is futile. Even fflush(stdin) clobbers input pipes!
18969 $rm -f core tryp.c tryp.core core.tryp.*
18971 *) fflushall="$undef"
18975 case "$fflushNULL$fflushall" in
18978 OK, I give up. I cannot figure out how to flush pending stdio output.
18979 We won't be flushing handles at all before fork/exec/popen.
18983 $rm -f try.* try$exe_ext
18985 : Store the full pathname to the ar program for use in the C program
18986 : Respect a hint or command line value for full_ar.
18991 : Store the full pathname to the sed program for use in the C program
18994 : see what type gids are declared as in the kernel
18996 echo "Looking for the type for group ids returned by getgid()."
18997 set gid_t gidtype xxx stdio.h sys/types.h
19001 xxx=`./findhdr sys/user.h`
19002 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
19004 unsigned) dflt="$1 $2" ;;
19008 *) dflt="$gidtype";;
19011 gid_t) echo "gid_t found." ;;
19012 *) rp="What is the type for group ids returned by getgid()?"
19020 *_t) zzz="$gidtype" ;;
19023 echo "Checking the size of $zzz..." >&4
19025 #include <sys/types.h>
19027 #$i_stdlib I_STDLIB
19029 #include <stdlib.h>
19032 printf("%d\n", (int)sizeof($gidtype));
19037 if eval $compile_ok; then
19041 echo "(I can't execute the test program--guessing $gidsize.)" >&4
19044 echo "Your $zzz is $gidsize bytes long."
19049 echo "(I can't compile the test program--guessing $gidsize.)" >&4
19055 *_t) zzz="$gidtype" ;;
19058 echo "Checking the sign of $zzz..." >&4
19060 #include <sys/types.h>
19071 if eval $compile; then
19075 echo "(I can't execute the test program--guessing unsigned.)" >&4
19079 1) echo "Your $zzz is unsigned." ;;
19080 -1) echo "Your $zzz is signed." ;;
19086 echo "(I can't compile the test program--guessing unsigned.)" >&4
19092 if $test X"$quadtype" != X; then
19094 echo "Checking how to print 64-bit integers..." >&4
19096 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
19097 $cat >try.c <<'EOCP'
19098 #include <sys/types.h>
19101 int q = 12345678901;
19102 printf("%ld\n", q);
19106 if eval $compile; then
19110 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
19111 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
19112 echo "We will use %d."
19118 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
19119 $cat >try.c <<'EOCP'
19120 #include <sys/types.h>
19123 long q = 12345678901;
19124 printf("%ld\n", q);
19128 if eval $compile; then
19132 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
19133 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
19134 echo "We will use %ld."
19140 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
19141 $cat >try.c <<'EOCP'
19142 #include <sys/types.h>
19143 #include <inttypes.h>
19146 int64_t q = 12345678901;
19147 printf("%" PRId64 "\n", q);
19151 if eval $compile; then
19155 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
19156 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
19157 echo "We will use the C9X style."
19163 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
19165 #include <sys/types.h>
19168 $quadtype q = 12345678901;
19169 printf("%Ld\n", q);
19173 if eval $compile; then
19177 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
19178 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
19179 echo "We will use %Ld."
19185 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
19186 $cat >try.c <<'EOCP'
19187 #include <sys/types.h>
19190 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
19191 printf("%lld\n", q);
19195 if eval $compile; then
19199 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
19200 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
19201 echo "We will use the %lld style."
19207 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
19209 #include <sys/types.h>
19212 $quadtype q = 12345678901;
19213 printf("%qd\n", q);
19217 if eval $compile; then
19221 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
19222 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
19223 echo "We will use %qd."
19229 if $test X"$sPRId64" = X; then
19230 echo "Cannot figure out how to print 64-bit integers." >&4
19238 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
19239 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
19241 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
19242 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
19248 $echo "Checking the format strings to be used for Perl's internal types..." >&4
19250 if $test X"$ivsize" = X8; then
19251 ivdformat="$sPRId64"
19252 uvuformat="$sPRIu64"
19253 uvoformat="$sPRIo64"
19254 uvxformat="$sPRIx64"
19255 uvXUformat="$sPRIXU64"
19257 if $test X"$ivsize" = X"$longsize"; then
19264 if $test X"$ivsize" = X"$intsize"; then
19272 if $test X"$ivsize" = X"$shortsize"; then
19283 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
19284 nveformat="$sPRIeldbl"
19285 nvfformat="$sPRIfldbl"
19286 nvgformat="$sPRIgldbl"
19287 nvEUformat="$sPRIEUldbl"
19288 nvFUformat="$sPRIFUldbl"
19289 nvGUformat="$sPRIGUldbl"
19299 case "$ivdformat" in
19300 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
19307 $echo "Checking the format string to be used for gids..." >&4
19310 -1) if $test X"$gidsize" = X"$ivsize"; then
19311 gidformat="$ivdformat"
19313 if $test X"$gidsize" = X"$longsize"; then
19316 if $test X"$gidsize" = X"$intsize"; then
19319 if $test X"$gidsize" = X"$shortsize"; then
19326 *) if $test X"$gidsize" = X"$uvsize"; then
19327 gidformat="$uvuformat"
19329 if $test X"$gidsize" = X"$longsize"; then
19332 if $test X"$gidsize" = X"$intsize"; then
19335 if $test X"$gidsize" = X"$shortsize"; then
19344 : see if getgroups exists
19345 set getgroups d_getgrps
19348 : see if setgroups exists
19349 set setgroups d_setgrps
19353 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
19355 case "$d_getgrps$d_setgrps" in
19357 case "$groupstype" in
19358 '') dflt="$gidtype" ;;
19359 *) dflt="$groupstype" ;;
19362 What type of pointer is the second argument to getgroups() and setgroups()?
19363 Usually this is the same as group ids, $gidtype, but not always.
19366 rp='What type pointer is the second argument to getgroups() and setgroups()?'
19370 *) groupstype="$gidtype";;
19374 if $test $patchlevel -lt 9; then
19375 : MAD is not available in 5.8.x or earlier.
19379 $define|true|[yY]*) dflt='y' ;;
19384 Would you like to build with Misc Attribute Decoration? This is development
19385 work leading to a Perl 5 to Perl 6 convertor, which imposes a space and speed
19386 overhead on the interpreter.
19388 If this doesn't make any sense to you, just accept the default '$dflt'.
19390 rp='Build Perl with MAD?'
19395 madlyh='madly.h madly.act madly.tab'
19397 madlyobj="madly$_o" ;;
19407 echo "Checking if your $make program sets \$(MAKE)..." >&4
19408 case "$make_set_make" in
19410 $sed 's/^X //' > testmake.mak << 'EOF'
19412 X @echo 'maketemp="$(MAKE)"'
19414 case "`$make -f testmake.mak 2>/dev/null`" in
19415 *maketemp=*) make_set_make='#' ;;
19416 *) make_set_make="MAKE=$make" ;;
19418 $rm -f testmake.mak
19421 case "$make_set_make" in
19422 '#') echo "Yup, it does.";;
19423 *) echo "Nope, it doesn't.";;
19426 : see what type is used for mode_t
19427 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
19428 set mode_t modetype int stdio.h sys/types.h
19431 : see if we need va_copy
19433 case "$i_stdarg" in
19436 #include <stdarg.h>
19438 #$i_stdlib I_STDLIB
19440 #include <stdlib.h>
19442 #include <signal.h>
19445 ivfprintf(FILE *f, const char *fmt, va_list *valp)
19447 return vfprintf(f, fmt, *valp);
19451 myvfprintf(FILE *f, const char *fmt, va_list val)
19453 return ivfprintf(f, fmt, &val);
19457 myprintf(char *fmt, ...)
19460 va_start(val, fmt);
19461 return myvfprintf(stdout, fmt, val);
19465 main(int ac, char **av)
19467 signal(SIGSEGV, exit);
19469 myprintf("%s%cs all right, then\n", "that", '\'');
19474 if eval $compile && $run ./try 2>&1 >/dev/null; then
19475 case "`$run ./try`" in
19476 "that's all right, then")
19482 yes) echo "It seems that you don't need va_copy()." >&4
19483 need_va_copy="$undef"
19485 *) echo "It seems that va_copy() or similar will be needed." >&4
19486 need_va_copy="$define"
19489 $rm -f try.* core core.* *.core *.core.*
19491 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
19495 : see what type is used for size_t
19496 rp="What is the type used for the length parameter for string functions?"
19497 set size_t sizetype 'unsigned int' stdio.h sys/types.h
19500 : check for type of arguments to gethostbyaddr.
19501 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
19502 case "$d_gethbyaddr" in
19506 Checking to see what type of arguments are accepted by gethostbyaddr().
19508 hdrs="$define sys/types.h
19509 $d_socket sys/socket.h
19510 $i_niin netinet/in.h
19512 $i_unistd unistd.h"
19513 : The first arg can 'char *' or 'void *'
19514 : The second arg is some of integral type
19515 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
19516 for yyy in size_t long int; do
19517 case "$netdb_host_type" in
19518 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
19519 if ./protochk "$try" $hdrs; then
19520 echo "Your system accepts $xxx for the first arg."
19521 echo "...and $yyy for the second arg."
19522 netdb_host_type="$xxx"
19523 netdb_hlen_type="$yyy"
19529 : In case none of those worked, prompt the user.
19530 case "$netdb_host_type" in
19531 '') rp='What is the type for the 1st argument to gethostbyaddr?'
19534 netdb_host_type=$ans
19535 rp='What is the type for the 2nd argument to gethostbyaddr?'
19538 netdb_hlen_type=$ans
19542 *) : no gethostbyaddr, so pick harmless defaults
19543 netdb_host_type='char *'
19544 netdb_hlen_type="$sizetype"
19547 # Remove the "const" if needed. -- but then we'll have a
19549 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
19552 : check for type of argument to gethostbyname.
19553 if test "X$netdb_name_type" = X ; then
19554 case "$d_gethbyname" in
19558 Checking to see what type of argument is accepted by gethostbyname().
19560 hdrs="$define sys/types.h
19561 $d_socket sys/socket.h
19562 $i_niin netinet/in.h
19564 $i_unistd unistd.h"
19565 for xxx in "const char *" "char *"; do
19566 case "$netdb_name_type" in
19567 '') try="extern struct hostent *gethostbyname($xxx);"
19568 if ./protochk "$try" $hdrs; then
19569 echo "Your system accepts $xxx."
19570 netdb_name_type="$xxx"
19575 : In case none of those worked, prompt the user.
19576 case "$netdb_name_type" in
19577 '') rp='What is the type for the 1st argument to gethostbyname?'
19580 netdb_name_type=$ans
19584 *) : no gethostbyname, so pick harmless default
19585 netdb_name_type='char *'
19590 : check for type of 1st argument to getnetbyaddr.
19591 if test "X$netdb_net_type" = X ; then
19592 case "$d_getnbyaddr" in
19596 Checking to see what type of 1st argument is accepted by getnetbyaddr().
19598 hdrs="$define sys/types.h
19599 $d_socket sys/socket.h
19600 $i_niin netinet/in.h
19602 $i_unistd unistd.h"
19603 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
19604 case "$netdb_net_type" in
19605 '') try="extern struct netent *getnetbyaddr($xxx, int);"
19606 if ./protochk "$try" $hdrs; then
19607 echo "Your system accepts $xxx."
19608 netdb_net_type="$xxx"
19613 : In case none of those worked, prompt the user.
19614 case "$netdb_net_type" in
19615 '') rp='What is the type for the 1st argument to getnetbyaddr?'
19618 netdb_net_type=$ans
19622 *) : no getnetbyaddr, so pick harmless default
19623 netdb_net_type='long'
19627 : locate the preferred pager for this system
19634 [a-zA-Z]:/*) dflt=$pg;;
19638 [a-zA-Z]:/*) dflt=$more;;
19642 [a-zA-Z]:/*) dflt=$less;;
19645 '') dflt=/usr/ucb/more;;
19649 : Instruct ./getfile to trust the hinted or previous pager value,
19650 : even if it does not begin with a slash. For example, on os2,
19651 : pager might be cmd /c more. See comments in UU/getfile.
19656 rp='What pager is used on your system?'
19660 : see what type pids are declared as in the kernel
19661 rp="What is the type of process ids on this system?"
19662 set pid_t pidtype int stdio.h sys/types.h
19665 : see if ar generates random libraries by itself
19667 echo "Checking how to generate random libraries on your machine..." >&4
19668 echo 'int bar1() { return bar2(); }' > bar1.c
19669 echo 'int bar2() { return 2; }' > bar2.c
19671 #$i_stdlib I_STDLIB
19673 #include <stdlib.h>
19675 int main() { printf("%d\n", bar1()); exit(0); }
19677 $cc $ccflags -c bar1.c >/dev/null 2>&1
19678 $cc $ccflags -c bar2.c >/dev/null 2>&1
19679 $cc $ccflags -c foo.c >/dev/null 2>&1
19680 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
19681 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19682 $run ./foobar >/dev/null 2>&1; then
19683 echo "$ar appears to generate random libraries itself."
19685 if [ "X$ranlib" = "X" ]; then
19688 elif $ar s bar$_a >/dev/null 2>&1 &&
19689 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19690 $run ./foobar >/dev/null 2>&1; then
19691 echo "a table of contents needs to be added with '$ar s'."
19694 elif $ar ts bar$_a >/dev/null 2>&1 &&
19695 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19696 $run ./foobar >/dev/null 2>&1; then
19697 echo "a table of contents needs to be added with '$ar ts'."
19704 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
19705 $test -f $ranlib || ranlib=''
19708 if $test -n "$ranlib"; then
19709 echo "your system has '$ranlib'; we'll use that."
19712 echo "your system doesn't seem to support random libraries"
19713 echo "so we'll use lorder and tsort to order the libraries."
19720 : check for type of arguments to select.
19721 case "$selecttype" in
19722 '') case "$d_select" in
19726 Checking to see what type of arguments are accepted by select().
19728 hdrs="$define sys/types.h
19729 $i_systime sys/time.h
19730 $i_sysselct sys/select.h
19731 $d_socket sys/socket.h"
19732 : The first arg can be int, unsigned, or size_t
19733 : The last arg may or may not be 'const'
19735 : void pointer has been seen but using that
19736 : breaks the selectminbits test
19737 for xxx in 'fd_set *' 'int *'; do
19738 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
19739 for tmo in 'struct timeval *' 'const struct timeval *'; do
19741 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
19742 if ./protochk "$try" $hdrs; then
19743 echo "Your system accepts $xxx."
19752 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
19753 case "$d_fd_set" in
19754 $define) dflt="fd_set *" ;;
19763 *) : no select, so pick a harmless default
19770 : check for the select 'width'
19771 case "$selectminbits" in
19772 '') safebits=`expr $ptrsize \* 8`
19773 case "$d_select" in
19777 Checking to see on how many bits at a time your select() operates...
19780 #include <sys/types.h>
19782 #$i_systime I_SYS_TIME
19783 #$i_systimek I_SYS_TIME_KERNEL
19788 # ifdef I_SYS_TIME_KERNEL
19791 # include <sys/time.h>
19792 # ifdef I_SYS_TIME_KERNEL
19796 #$i_sysselct I_SYS_SELECT
19797 #ifdef I_SYS_SELECT
19798 #include <sys/select.h>
19800 #$d_socket HAS_SOCKET
19802 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
19805 #$i_stdlib I_STDLIB
19807 #include <stdlib.h>
19810 #define S sizeof(*(b))
19812 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
19813 #define NBITS (NBYTES * 8)
19815 char *s = (char *)malloc(NBYTES);
19824 fp = fopen("try.c", "r");
19830 b = ($selecttype)s;
19831 for (i = 0; i < NBITS; i++)
19835 select(fd + 1, b, 0, 0, &t);
19836 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
19838 printf("%d\n", i + 1);
19843 if eval $compile_ok; then
19844 selectminbits=`$run ./try`
19845 case "$selectminbits" in
19847 Cannot figure out on how many bits at a time your select() operates.
19848 I'll play safe and guess it is $safebits bits.
19850 selectminbits=$safebits
19851 bits="$safebits bits"
19854 *) bits="$selectminbits bits" ;;
19856 echo "Your select() operates on $bits at a time." >&4
19858 rp='What is the minimum number of bits your select() operates on?'
19859 case "$byteorder" in
19860 12345678) dflt=64 ;;
19866 selectminbits="$val"
19870 *) : no select, so pick a harmless default
19871 selectminbits=$safebits
19877 : Trace out the files included by signal.h, then look for SIGxxx names.
19878 : Remove SIGARRAYSIZE used by HPUX.
19879 : Remove SIGSTKSIZE used by Linux.
19880 : Remove SIGSTKSZ used by Posix.
19881 : Remove SIGTYP void lines used by OS2.
19882 : Some cpps, like os390, dont give the file name anywhere
19883 if [ "X$fieldn" = X ]; then
19884 : Just make some guesses. We check them later.
19885 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
19887 xxx=`echo '#include <signal.h>' |
19888 $cppstdin $cppminus $cppflags 2>/dev/null |
19889 $grep '^[ ]*#.*include' |
19890 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
19892 : Check this list of files to be sure we have parsed the cpp output ok.
19893 : This will also avoid potentially non-existent files, such
19896 for xx in $xxx /dev/null ; do
19897 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
19899 : If we have found no files, at least try signal.h
19900 case "$xxxfiles" in
19901 '') xxxfiles=`./findhdr signal.h` ;;
19904 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
19905 print substr($2, 4, 20)
19907 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
19908 print substr($3, 4, 20)
19910 : Append some common names just in case the awk scan failed.
19911 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
19912 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
19913 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
19914 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
19915 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
19917 : generate a few handy files for later
19918 $cat > signal.c <<EOCP
19919 #include <sys/types.h>
19920 #include <signal.h>
19921 #$i_stdlib I_STDLIB
19923 #include <stdlib.h>
19928 /* Strange style to avoid deeply-nested #if/#else/#endif */
19931 # define NSIG (_NSIG)
19937 # define NSIG (SIGMAX+1)
19943 # define NSIG (SIG_MAX+1)
19949 # define NSIG (_SIG_MAX+1)
19955 # define NSIG (MAXSIG+1)
19961 # define NSIG (MAX_SIG+1)
19966 # ifdef SIGARRAYSIZE
19967 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
19973 # define NSIG (_sys_nsig) /* Solaris 2.5 */
19977 /* Default to some arbitrary number that's big enough to get most
19978 of the common signals.
19984 printf("NSIG %d\n", NSIG);
19990 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
19992 printf "#ifdef SIG"; printf $1; printf "\n"
19993 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
19994 printf $1; printf ");\n"
19998 printf "#endif /* JUST_NSIG */\n";
19999 printf "exit(0);\n}\n";
20002 $cat >signal.awk <<'EOP'
20003 BEGIN { ndups = 0 }
20004 $1 ~ /^NSIG$/ { nsig = $2 }
20005 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
20006 if ($2 > maxsig) { maxsig = $2 }
20007 if (sig_name[$2]) {
20008 dup_name[ndups] = $1
20009 dup_num[ndups] = $2
20021 printf("NSIG %d\n", nsig);
20022 for (n = 1; n < nsig; n++) {
20024 printf("%s %d\n", sig_name[n], sig_num[n])
20027 printf("NUM%d %d\n", n, n)
20030 for (n = 0; n < ndups; n++) {
20031 printf("%s %d\n", dup_name[n], dup_num[n])
20035 $cat >signal_cmd <<EOS
20037 if $test -s signal.lst; then
20038 echo "Using your existing signal.lst file"
20043 $cat >>signal_cmd <<'EOS'
20046 if eval $compile_ok; then
20047 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) | $uniq | $awk -f signal.awk >signal.lst
20049 echo "(I can't seem be able to compile the whole test program)" >&4
20050 echo "(I'll try it in little pieces.)" >&4
20051 set signal -DJUST_NSIG
20052 if eval $compile_ok; then
20053 $run ./signal$_exe > signal.nsg
20056 echo "I can't seem to figure out how many signals you have." >&4
20057 echo "Guessing 50." >&4
20058 echo 'NSIG 50' > signal.nsg
20060 : Now look at all the signal names, one at a time.
20061 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
20062 $cat > signal.c <<EOCP
20063 #include <sys/types.h>
20064 #include <signal.h>
20067 printf("$xx %d\n", SIG${xx});
20072 if eval $compile; then
20073 echo "SIG${xx} found."
20074 $run ./signal$_exe >> signal.ls1
20076 echo "SIG${xx} NOT found."
20079 if $test -s signal.ls1; then
20080 $cat signal.nsg signal.ls1 |
20081 $sort -n | $uniq | $awk -f signal.awk >signal.lst
20085 if $test -s signal.lst; then
20088 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
20089 echo 'kill -l' >signal
20090 set X `csh -f <signal`
20094 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
20096 echo $@ | $tr ' ' $trnl | \
20097 $awk '{ printf "%s %d\n", $1, ++s; }
20098 END { printf "NSIG %d\n", ++s }' >signal.lst
20100 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
20102 chmod a+x signal_cmd
20103 $eunicefix signal_cmd
20105 : generate list of signal names
20107 case "$sig_name_init" in
20109 *) case "$sig_num_init" in
20110 ''|*,*) doinit=yes ;;
20115 echo "Generating a list of signal names and numbers..." >&4
20117 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
20118 sig_name=`$awk 'BEGIN { printf "ZERO " }
20119 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
20120 sig_num=`$awk 'BEGIN { printf "0 " }
20121 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
20122 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
20123 !/^NSIG/ { printf "\"%s\", ", $1 }
20124 END { printf "0\n" }' signal.lst`
20125 sig_num_init=`$awk 'BEGIN { printf "0, " }
20126 !/^NSIG/ { printf "%d, ", $2}
20127 END { printf "0\n"}' signal.lst`
20130 echo "The following $sig_count signals are available:"
20132 echo $sig_name | $awk \
20133 'BEGIN { linelen = 0 }
20135 for (i = 1; i <= NF; i++) {
20136 name = "SIG" $i " "
20137 linelen = linelen + length(name)
20138 if (linelen > 70) {
20140 linelen = length(name)
20146 sig_size=`echo $sig_name | awk '{print NF}'`
20147 $rm -f signal signal.c signal.awk signal.lst signal_cmd
20150 case "$sizetype" in
20151 *_t) zzz="$sizetype" ;;
20152 *) zzz="filesize" ;;
20154 echo "Checking the size of $zzz..." >&4
20156 #include <sys/types.h>
20158 #$i_stdlib I_STDLIB
20160 #include <stdlib.h>
20163 printf("%d\n", (int)sizeof($sizetype));
20168 if eval $compile_ok; then
20172 echo "(I can't execute the test program--guessing $sizesize.)" >&4
20175 echo "Your $zzz size is $sizesize bytes."
20180 echo "(I can't compile the test program--guessing $sizesize.)" >&4
20184 : check for socklen_t
20186 echo "Checking to see if you have socklen_t..." >&4
20188 #include <sys/types.h>
20189 #$d_socket HAS_SOCKET
20191 #include <sys/socket.h>
20193 int main() { socklen_t x = 16; }
20196 if eval $compile; then
20198 echo "You have socklen_t."
20201 echo "You do not have socklen_t."
20202 case "$sizetype" in
20203 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
20210 : see if this is a socks.h system
20211 set socks.h i_socks
20214 : check for type of the size argument to socket calls
20215 case "$d_socket" in
20219 Checking to see what type is the last argument of accept().
20222 case "$d_socklen_t" in
20223 "$define") yyy="$yyy socklen_t"
20225 yyy="$yyy $sizetype int long unsigned"
20226 for xxx in $yyy; do
20227 case "$socksizetype" in
20228 '') try="extern int accept(int, struct sockaddr *, $xxx *);"
20229 case "$usesocks" in
20231 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
20232 echo "Your system accepts '$xxx *' for the last argument of accept()."
20233 socksizetype="$xxx"
20236 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
20237 echo "Your system accepts '$xxx *' for the last argument of accept()."
20238 socksizetype="$xxx"
20245 : In case none of those worked, prompt the user.
20246 case "$socksizetype" in
20247 '') rp='What is the type for socket address structure sizes?'
20254 *) : no sockets, so pick relatively harmless default
20259 : see what type is used for signed size_t
20260 set ssize_t ssizetype int stdio.h sys/types.h
20265 #$i_stdlib I_STDLIB
20267 #include <stdlib.h>
20269 #include <sys/types.h>
20270 #define Size_t $sizetype
20271 #define SSize_t $dflt
20274 if (sizeof(Size_t) == sizeof(SSize_t))
20276 else if (sizeof(Size_t) == sizeof(int))
20285 if eval $compile_ok && $run ./try > /dev/null; then
20286 ssizetype=`$run ./try`
20287 echo "I'll be using $ssizetype for functions returning a byte count." >&4
20290 Help! I can't compile and run the ssize_t test program: please enlighten me!
20291 (This is probably a misconfiguration in your system or libraries, and
20292 you really ought to fix it. Still, I'll try anyway.)
20294 I need a type that is the same size as $sizetype, but is guaranteed to
20295 be signed. Common values are ssize_t, int and long.
20298 rp="What signed type is the same size as $sizetype?"
20304 : see what type of char stdio uses.
20306 echo '#include <stdio.h>' > stdio.c
20307 $cppstdin $cppminus < stdio.c > stdioh
20308 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
20309 echo "Your stdio uses unsigned chars." >&4
20310 stdchar="unsigned char"
20312 echo "Your stdio uses signed chars." >&4
20315 $rm -f stdio.* stdioh
20317 : see what type uids are declared as in the kernel
20319 echo "Looking for the type for user ids returned by getuid()."
20320 set uid_t uidtype xxx stdio.h sys/types.h
20324 xxx=`./findhdr sys/user.h`
20325 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
20327 unsigned) dflt="$1 $2" ;;
20331 *) dflt="$uidtype";;
20334 uid_t) echo "uid_t found." ;;
20335 *) rp="What is the type for user ids returned by getuid()?"
20343 *_t) zzz="$uidtype" ;;
20346 echo "Checking the size of $zzz..." >&4
20348 #include <sys/types.h>
20350 #$i_stdlib I_STDLIB
20352 #include <stdlib.h>
20355 printf("%d\n", (int)sizeof($uidtype));
20360 if eval $compile_ok; then
20364 echo "(I can't execute the test program--guessing $uidsize.)" >&4
20367 echo "Your $zzz is $uidsize bytes long."
20372 echo "(I can't compile the test program--guessing $uidsize.)" >&4
20377 *_t) zzz="$uidtype" ;;
20380 echo "Checking the sign of $zzz..." >&4
20382 #include <sys/types.h>
20393 if eval $compile; then
20397 echo "(I can't execute the test program--guessing unsigned.)" >&4
20401 1) echo "Your $zzz is unsigned." ;;
20402 -1) echo "Your $zzz is signed." ;;
20408 echo "(I can't compile the test program--guessing unsigned.)" >&4
20414 $echo "Checking the format string to be used for uids..." >&4
20417 -1) if $test X"$uidsize" = X"$ivsize"; then
20418 uidformat="$ivdformat"
20420 if $test X"$uidsize" = X"$longsize"; then
20423 if $test X"$uidsize" = X"$intsize"; then
20426 if $test X"$uidsize" = X"$shortsize"; then
20433 *) if $test X"$uidsize" = X"$uvsize"; then
20434 uidformat="$uvuformat"
20436 if $test X"$uidsize" = X"$longsize"; then
20439 if $test X"$uidsize" = X"$intsize"; then
20442 if $test X"$uidsize" = X"$shortsize"; then
20452 case "$usesitecustomize" in
20453 $define|true|[Yy]*)
20454 usesitecustomize="$define"
20457 usesitecustomize="$undef"
20461 : determine compiler compiler
20470 if $test -f "$byacc$_exe"; then
20472 comp="byacc or $comp"
20474 if $test -f "$bison$_exe"; then
20475 comp="$comp or bison -y"
20477 rp="Which compiler compiler ($comp) shall I use?"
20486 echo "(Adding -y option to bison to get yacc-compatible behaviour.)"
20492 : see if this is a fp.h system
20496 : see if this is a fp_class.h system
20497 set fp_class.h i_fp_class
20500 : see if gdbm.h is available
20505 : see if gdbm_open exists
20506 set gdbm_open d_gdbm_open
20508 case "$d_gdbm_open" in
20511 echo "We won't be including <gdbm.h>"
20520 : see if this is a ieeefp.h system
20521 case "$i_ieeefp" in
20522 '' ) set ieeefp.h i_ieeefp
20527 : see if this is a libutil.h system
20528 set libutil.h i_libutil
20531 : see if mach cthreads are available
20532 if test "X$usethreads" = "X$define"; then
20533 set mach/cthreads.h i_machcthr
20536 i_machcthr="$undef"
20541 : see if this is a mntent.h system
20542 set mntent.h i_mntent
20545 : see if ndbm.h is available
20551 # Some Linux distributions such as RedHat 7.1 put the
20552 # ndbm.h header in /usr/include/gdbm/ndbm.h.
20553 if $test -f /usr/include/gdbm/ndbm.h; then
20554 echo '<gdbm/ndbm.h> found.'
20555 ccflags="$ccflags -I/usr/include/gdbm"
20556 cppflags="$cppflags -I/usr/include/gdbm"
20564 : see if dbm_open exists
20565 set dbm_open d_dbm_open
20567 case "$d_dbm_open" in
20570 echo "We won't be including <ndbm.h>"
20579 : see if net/errno.h is available
20581 set net/errno.h val
20584 : Unfortunately, it causes problems on some systems. Arrgh.
20587 cat > try.c <<'EOM'
20590 #include <net/errno.h>
20596 if $cc $ccflags -c try.c >/dev/null 2>&1; then
20597 echo "We'll be including <net/errno.h>." >&4
20599 echo "We won't be including <net/errno.h>." >&4
20608 : see if netinet/tcp.h is available
20609 set netinet/tcp.h i_netinettcp
20612 : see if this is a poll.h system
20616 : see if this is a prot.h system
20621 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
20622 $cat <<'EOSH' > Cppsym.know
20623 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
20624 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
20625 alliant alpha am29000 AM29000 AMD64 amd64 amiga AMIGAOS AMIX
20626 ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
20627 BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
20628 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
20629 bull c cadmus clipper CMU COFF COMPILER_VERSION
20630 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
20631 CYGWIN DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
20632 Dynix DynixPTX ELF encore EPI EXTENSIONS FAVOR_BSD
20633 FILE_OFFSET_BITS FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
20635 GNU_SOURCE GNUC GNUC_MINOR GNU_LIBRARY GO32 gould GOULD_PN
20636 H3050R H3050RX hbullx20 hcx host_mips
20637 hp200 hp300 hp700 HP700 hp800 hp9000
20638 hp9000s200 hp9000s300 hp9000s400 hp9000s500
20639 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
20640 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
20641 IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
20642 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
20643 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
20644 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
20645 Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
20646 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
20647 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
20648 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
20649 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
20650 MATH_HAS_NO_SIDE_EFFECTS
20651 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
20652 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
20653 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
20654 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
20655 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
20656 NetBSD news1500 news1700 news1800 news1900 news3700
20657 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
20658 ns32016 ns32332 ns32k nsc32000
20659 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
20660 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
20661 pc532 pdp11 PGC PIC plexus PORTAR posix
20662 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
20663 POSIX_C_SOURCE POSIX_SOURCE POWER
20664 PROTOTYPES PWB pyr QNX R3000 REENTRANT RES Rhapsody RISC6000
20665 riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
20666 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
20667 sony sony_news sonyrisc sparc sparclite spectrum
20668 stardent stdc STDC_EXT stratos sun sun3 sun386
20669 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
20670 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
20671 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
20672 sysV68 sysV88 Tek4132 Tek4300 titan
20673 TM3200 TM5400 TM5600
20674 tower tower32 tower32_200 tower32_600 tower32_700
20675 tower32_800 tower32_850 tss
20676 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
20677 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
20678 unix UNIX95 UNIX99 unixpc unos
20679 USE_BSD USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE USE_LARGEFILE64
20680 USE_MISC USE_POSIX USE_POSIX199309 USE_POSIX199506 USE_POSIX2
20681 USE_REENTRANT USE_SVID USE_UNIX98 USE_XOPEN USE_XOPEN_EXTENDED
20683 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms x86_64 xenix Xenix286
20684 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
20685 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
20688 # Maybe put other stuff here too.
20689 cat <<EOSH >>Cppsym.know
20692 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
20693 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
20694 $cat Cppsym.know > Cppsym.c
20695 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
20696 $rm -f Cppsym.a Cppsym.b Cppsym.c
20697 cat <<EOSH > Cppsym
20699 if $test \$# -gt 0; then
20700 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
20701 if $test -s Cppsym.got; then
20708 $tr " " "$trnl" | ./Cppsym.try
20714 cat <<EOSH > Cppsym.try
20716 cat <<'EOCP' > try.c
20719 #define STRINGIFY(a) "a"
20721 #if cpp_stuff == 42
20722 #define StGiFy(a) #a
20723 #define STRINGIFY(a) StGiFy(a)
20725 #if $cpp_stuff != 1 && $cpp_stuff != 42
20726 # include "Bletch: How does this C preprocessor stringify macros?"
20732 cat <<'EOSH' >> Cppsym.try
20734 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
20735 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
20736 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
20737 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
20739 echo 'return 0;}' >> try.c
20741 cat <<EOSH >> Cppsym.try
20743 case "$osname-$gccversion" in
20744 irix-) ccflags="\$ccflags -woff 1178" ;;
20745 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
20747 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs && $run ./try | $sed 's/ /\\\\ /g'
20749 chmod +x Cppsym.try
20750 $eunicefix Cppsym.try
20751 ./Cppsym < Cppsym.know > Cppsym.true
20752 : Add in any linux cpp "predefined macros":
20753 case "$osname::$gccversion" in
20756 rm -f $tHdrH'.h' $tHdrH
20758 if cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
20759 sed 's/#define[\ \ ]*//;s/[\ \ ].*$//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
20760 if [ -s $tHdrH'_cppsym.real' ]; then
20761 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
20764 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
20767 : now check the C compiler for additional symbols
20768 postprocess_cc_v=''
20770 aix) postprocess_cc_v="|$tr , ' '" ;;
20777 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
20780 -D*) echo "\$i" | $sed 's/^-D//';;
20781 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
20786 postprocess_cc_v=''
20789 ./ccsym > ccsym1.raw
20790 if $test -s ccsym1.raw; then
20791 $sort ccsym1.raw | $uniq >ccsym.raw
20793 mv ccsym1.raw ccsym.raw
20796 $awk '/\=/ { print $0; next }
20797 { print $0"=1" }' ccsym.raw >ccsym.list
20798 $comm -13 Cppsym.true ccsym.list >ccsym.own
20799 $comm -12 Cppsym.true ccsym.list >ccsym.com
20800 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
20802 if $test -z ccsym.raw; then
20803 echo "Your C compiler doesn't seem to define any symbols!" >&4
20805 echo "However, your C preprocessor defines the following symbols:"
20808 cppsymbols=`$cat Cppsym.true`
20809 cppsymbols=`echo $cppsymbols`
20810 cppccsymbols="$cppsymbols"
20812 if $test -s ccsym.com; then
20813 echo "Your C compiler and pre-processor define these symbols:"
20814 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
20817 cppccsymbols=`$cat ccsym.com`
20818 cppccsymbols=`echo $cppccsymbols`
20819 $test "$silent" || sleep 1
20821 if $test -s ccsym.cpp; then
20822 $test "$also" && echo " "
20823 echo "Your C pre-processor ${also}defines the following symbols:"
20824 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
20826 cppsymbols=`$cat ccsym.cpp`
20827 cppsymbols=`echo $cppsymbols`
20828 $test "$silent" || sleep 1
20830 if $test -s ccsym.own; then
20831 $test "$also" && echo " "
20832 echo "Your C compiler ${also}defines the following cpp symbols:"
20833 $sed -e 's/\(..*\)=1/\1/' ccsym.own
20834 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
20835 ccsymbols=`$cat ccsym.own`
20836 ccsymbols=`echo $ccsymbols`
20837 $test "$silent" || sleep 1
20841 : see if this is a termio system
20845 if $test `./findhdr termios.h`; then
20846 set tcsetattr i_termios
20852 "$define") echo "You have POSIX termios.h... good!" >&4;;
20853 *) if ./Cppsym pyr; then
20854 case "`/bin/universe`" in
20855 ucb) if $test `./findhdr sgtty.h`; then
20857 echo "<sgtty.h> found." >&4
20859 echo "System is pyramid with BSD universe."
20860 echo "<sgtty.h> not found--you could have problems." >&4
20862 *) if $test `./findhdr termio.h`; then
20864 echo "<termio.h> found." >&4
20866 echo "System is pyramid with USG universe."
20867 echo "<termio.h> not found--you could have problems." >&4
20871 if $test `./findhdr termio.h`; then
20872 echo "<termio.h> found." >&4
20874 elif $test `./findhdr sgtty.h`; then
20875 echo "<sgtty.h> found." >&4
20878 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
20881 if $test `./findhdr sgtty.h`; then
20882 echo "<sgtty.h> found." >&4
20884 elif $test `./findhdr termio.h`; then
20885 echo "<termio.h> found." >&4
20888 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
20892 set i_termio; eval $setvar
20893 val=$val2; set i_sgtty; eval $setvar
20894 val=$val3; set i_termios; eval $setvar
20896 : see if stddef is available
20897 set stddef.h i_stddef
20900 : see if sys/access.h is available
20901 set sys/access.h i_sysaccess
20904 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
20905 set sys/filio.h i_sysfilio
20908 if $test `./findhdr sys/ioctl.h`; then
20910 echo '<sys/ioctl.h> found.' >&4
20913 if $test $i_sysfilio = "$define"; then
20914 echo '<sys/ioctl.h> NOT found.' >&4
20916 $test $i_sgtty = "$define" && xxx="sgtty.h"
20917 $test $i_termio = "$define" && xxx="termio.h"
20918 $test $i_termios = "$define" && xxx="termios.h"
20919 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
20925 : see if socket ioctl defs are in sys/sockio.h
20927 xxx=`./findhdr sys/sockio.h`
20928 if $test "$xxx"; then
20929 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
20931 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
20934 echo "No socket ioctls found in <sys/sockio.h>." >&4
20939 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
20946 : see if this is a syslog.h system
20947 set syslog.h i_syslog
20951 : see if this is a sys/mode.h system
20952 set sys/mode.h i_sysmode
20955 : see if sys/resource.h has to be included
20956 set sys/resource.h i_sysresrc
20959 : see if sys/security.h is available
20960 set sys/security.h i_syssecrt
20963 : see if this is a sys/statvfs.h system
20964 set sys/statvfs.h i_sysstatvfs
20967 : see if this is a sys/un.h system
20968 set sys/un.h i_sysun
20972 : see if this is a sys/utsname.h system
20973 set sys/utsname.h i_sysutsname
20976 : see if this is a syswait system
20977 set sys/wait.h i_syswait
20980 : see if this is a ustat.h system
20981 set ustat.h i_ustat
20984 : see if this is an utime system
20985 set utime.h i_utime
20988 : see if this is a values.h system
20989 set values.h i_values
20992 : see if this is a vfork system
20995 set vfork.h i_vfork
21004 echo "Looking for extensions..." >&4
21005 : If we are using the old config.sh, known_extensions may contain
21006 : old or inaccurate or duplicate values.
21007 known_extensions=''
21008 nonxs_extensions=''
21009 : We do not use find because it might not be available.
21010 : We do not just use MANIFEST because the user may have dropped
21011 : some additional extensions into the source tree and expect them
21014 : Function to recursively find available extensions, ignoring DynaLoader
21015 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
21019 DynaLoader|dynaload) ;;
21021 if $test -f $xxx/$xxx.xs -o -f $xxx/$xxx.c; then
21022 known_extensions="$known_extensions $1$xxx";
21023 elif $test -f $xxx/Makefile.PL; then
21024 nonxs_extensions="$nonxs_extensions $1$xxx";
21026 if $test -d $xxx -a $# -lt 10; then
21029 eval $find_extensions;
21041 eval $find_extensions
21042 # Special case: Add in threads/shared since it is not picked up by the
21043 # recursive find above (and adding in general recursive finding breaks
21044 # SDBM_File/sdbm). A.D. 10/25/2001.
21045 known_extensions="$known_extensions threads/shared"
21046 set X $known_extensions
21048 known_extensions="$*"
21049 # Ditto for IO/Compress/Base and IO/Compress/Zlib
21050 nonxs_extensions="$nonxs_extensions IO/Compress/Base IO/Compress/Zlib"
21051 set X $nonxs_extensions
21053 nonxs_extensions="$*"
21056 : Now see which are supported on this system.
21058 for xxx in $known_extensions ; do
21062 $define) avail_ext="$avail_ext $xxx" ;;
21065 GDBM_File|gdbm_fil)
21067 $define) avail_ext="$avail_ext $xxx" ;;
21070 I18N/Langinfo|i18n_lan)
21071 case "$i_langinfo$d_nl_langinfo" in
21072 $define$define) avail_ext="$avail_ext $xxx" ;;
21075 NDBM_File|ndbm_fil)
21078 case "$osname-$use64bitint" in
21081 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
21084 *) avail_ext="$avail_ext $xxx" ;;
21089 ODBM_File|odbm_fil)
21090 case "${i_dbm}${i_rpcsvcdbm}" in
21092 case "$osname-$use64bitint" in
21095 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
21098 *) avail_ext="$avail_ext $xxx" ;;
21104 case "$useposix" in
21105 true|define|y) avail_ext="$avail_ext $xxx" ;;
21109 case "$useopcode" in
21110 true|define|y) avail_ext="$avail_ext $xxx" ;;
21114 case "$d_socket" in
21117 beos) ;; # not unless BONE
21118 *) avail_ext="$avail_ext $xxx" ;;
21123 Sys/Syslog|sys/syslog)
21124 : XXX syslog requires socket
21125 case "$d_socket" in
21126 true|$define|y) avail_ext="$avail_ext $xxx" ;;
21130 case "$usethreads" in
21132 case "$useithreads" in
21133 $undef|false|[nN]*) avail_ext="$avail_ext $xxx" ;;
21139 cygwin) avail_ext="$avail_ext $xxx" ;;
21142 XS/APItest|xs/apitest)
21143 # This is just for testing. Skip it unless we have dynamic loading.
21146 $define) avail_ext="$avail_ext $xxx" ;;
21149 XS/Typemap|xs/typemap)
21150 # This is just for testing. Skip it unless we have dynamic loading.
21152 $define) avail_ext="$avail_ext $xxx" ;;
21155 threads|threads/shared)
21156 # threads and threads::shared are special cases.
21157 # To stop people from asking "Perl 5.8.0 was supposed
21158 # to have this new fancy threads implementation but my
21159 # perl doesn't have it" and from people trying to
21160 # (re)install the threads module using CPAN.pm and
21161 # CPAN.pm then offering to reinstall Perl 5.8.0,
21162 # the threads.pm and threads/shared.pm will always be
21163 # there, croaking informatively ("you need to rebuild
21164 # all of Perl with threads, sorry") when threads haven't
21165 # been compiled in.
21167 avail_ext="$avail_ext $xxx"
21170 : XXX Do we need a useipcsysv variable here
21171 case "${d_msg}${d_sem}${d_shm}" in
21172 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
21175 *) avail_ext="$avail_ext $xxx"
21184 case "$onlyextensions" in
21186 *) keepextensions=''
21187 echo "You have requested that only certains extensions be included..." >&4
21188 for i in $onlyextensions; do
21189 case " $avail_ext " in
21191 echo "Keeping extension $i."
21192 keepextensions="$keepextensions $i"
21194 *) echo "Ignoring extension $i." ;;
21197 avail_ext="$keepextensions"
21201 case "$noextensions" in
21203 *) keepextensions=''
21204 echo "You have requested that certain extensions be ignored..." >&4
21205 for i in $avail_ext; do
21206 case " $noextensions " in
21207 *" $i "*) echo "Ignoring extension $i." ;;
21208 *) echo "Keeping extension $i.";
21209 keepextensions="$keepextensions $i"
21213 avail_ext="$keepextensions"
21217 : Now see which nonxs extensions are supported on this system.
21218 : For now assume all are.
21220 for xxx in $nonxs_extensions ; do
21222 *) nonxs_ext="$nonxs_ext $xxx"
21234 A number of extensions are supplied with $package. You may choose to
21235 compile these extensions for dynamic loading (the default), compile
21236 them into the $package executable (static loading), or not include
21237 them at all. Answer "none" to include no extensions.
21238 Note that DynaLoader is always built and need not be mentioned here.
21241 case "$dynamic_ext" in
21243 : Exclude those listed in static_ext
21245 for xxx in $avail_ext; do
21246 case " $static_ext " in
21248 *) dflt="$dflt $xxx" ;;
21255 *) dflt="$dynamic_ext"
21256 # Perhaps we are reusing an old out-of-date config.sh.
21259 if test X"$dynamic_ext" != X"$avail_ext"; then
21261 NOTICE: Your previous config.sh list may be incorrect.
21262 The extensions now available to you are
21264 but the default list from your previous config.sh is
21276 rp="What extensions do you wish to load dynamically?"
21279 none) dynamic_ext=' ' ;;
21280 *) dynamic_ext="$ans" ;;
21283 case "$static_ext" in
21285 : Exclude those already listed in dynamic linking
21287 for xxx in $avail_ext; do
21288 case " $dynamic_ext " in
21290 *) dflt="$dflt $xxx" ;;
21297 *) dflt="$static_ext"
21304 rp="What extensions do you wish to load statically?"
21307 none) static_ext=' ' ;;
21308 *) static_ext="$ans" ;;
21313 A number of extensions are supplied with $package. Answer "none"
21314 to include no extensions.
21315 Note that DynaLoader is always built and need not be mentioned here.
21318 case "$static_ext" in
21319 '') dflt="$avail_ext" ;;
21320 *) dflt="$static_ext"
21321 # Perhaps we are reusing an old out-of-date config.sh.
21324 if test X"$static_ext" != X"$avail_ext"; then
21326 NOTICE: Your previous config.sh list may be incorrect.
21327 The extensions now available to you are
21329 but the default list from your previous config.sh is
21338 : Exclude those that are not xs extensions
21342 rp="What extensions do you wish to include?"
21345 none) static_ext=' ' ;;
21346 *) static_ext="$ans" ;;
21351 # Encode is a special case. If we are building Encode as a static
21352 # extension, we need to explicitly list its subextensions as well.
21353 # For other nested extensions, this is handled automatically by
21354 # the appropriate Makefile.PL.
21355 case " $static_ext " in
21356 *" Encode "*) # Add the subextensions of Encode
21358 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
21359 static_ext="$static_ext Encode/$xxx"
21365 set X $dynamic_ext $static_ext $nonxs_ext
21369 # Sanity check: We require an extension suitable for use with
21370 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
21371 # should show up as failures in the test suite, but it's helpful to
21372 # catch them now.) The 'extensions' list is normally sorted
21373 # alphabetically, so we need to accept either
21374 # DB_File ... Fcntl ... IO ....
21375 # or something like
21376 # Fcntl ... NDBM_File ... IO ....
21377 case " $extensions" in
21378 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
21379 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
21380 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
21381 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
21382 echo "WARNING: The Perl you are building will be quite crippled." >& 4
21386 : Remove libraries needed only for extensions
21387 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
21388 : The exception is SunOS 4.x, which needs them.
21389 case "${osname}X${osvers}" in
21393 *) case "$usedl" in
21394 $define|true|[yY]*)
21395 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
21399 *) perllibs="$libs"
21405 : Remove build directory name from cppstdin so it can be used from
21406 : either the present location or the final installed location.
21408 : Get out of the UU directory to get correct path name.
21410 case "$cppstdin" in
21412 echo "Stripping down cppstdin path name"
21418 : end of configuration questions
21420 echo "End of configuration questions."
21423 : back to where it started
21424 if test -d ../UU; then
21428 : configuration may be patched via a 'config.arch' file
21429 if $test -f config.arch; then
21430 echo "I see a config.arch file, loading it."
21434 : configuration may be patched via a 'config.over' file
21435 if $test -f config.over; then
21438 rp='I see a config.over file. Do you wish to load it?'
21441 n*) echo "OK, I'll ignore it.";;
21443 echo "Configuration override changes have been loaded."
21448 : in case they want portability, strip down executable paths
21449 case "$d_portable" in
21452 echo "Stripping down executable paths..." >&4
21453 for file in $loclist $trylist; do
21455 eval $file=`basename $temp`
21460 : create config.sh file
21462 echo "Creating config.sh..." >&4
21463 $spitshell <<EOT >config.sh
21466 # This file was produced by running the Configure script. It holds all the
21467 # definitions figured out by Configure. Should you modify one of these values,
21468 # do not forget to propagate your changes by running "Configure -der". You may
21469 # instead choose to run each of the .SH files by yourself, or "Configure -S".
21472 # Package name : $package
21473 # Source directory : $src
21474 # Configuration time: $cf_time
21475 # Configured by : $cf_by
21476 # Target system : $myuname
21486 Revision='$Revision'
21494 alignbytes='$alignbytes'
21495 ansi2knr='$ansi2knr'
21496 aphostname='$aphostname'
21497 api_revision='$api_revision'
21498 api_subversion='$api_subversion'
21499 api_version='$api_version'
21500 api_versionstring='$api_versionstring'
21503 archlibexp='$archlibexp'
21504 archname64='$archname64'
21505 archname='$archname'
21506 archobjs='$archobjs'
21507 asctime_r_proto='$asctime_r_proto'
21515 byteorder='$byteorder'
21517 castflags='$castflags'
21520 cccdlflags='$cccdlflags'
21521 ccdlflags='$ccdlflags'
21523 ccflags_uselargefiles='$ccflags_uselargefiles'
21525 ccsymbols='$ccsymbols'
21526 ccversion='$ccversion'
21528 cf_email='$cf_email'
21530 charsize='$charsize'
21534 clocktype='$clocktype'
21536 compress='$compress'
21537 contains='$contains'
21541 cpp_stuff='$cpp_stuff'
21542 cppccsymbols='$cppccsymbols'
21543 cppflags='$cppflags'
21545 cppminus='$cppminus'
21547 cppstdin='$cppstdin'
21548 cppsymbols='$cppsymbols'
21549 crypt_r_proto='$crypt_r_proto'
21550 cryptlib='$cryptlib'
21552 ctermid_r_proto='$ctermid_r_proto'
21553 ctime_r_proto='$ctime_r_proto'
21554 d_Gconvert='$d_Gconvert'
21555 d_PRIEUldbl='$d_PRIEUldbl'
21556 d_PRIFUldbl='$d_PRIFUldbl'
21557 d_PRIGUldbl='$d_PRIGUldbl'
21558 d_PRIXU64='$d_PRIXU64'
21559 d_PRId64='$d_PRId64'
21560 d_PRIeldbl='$d_PRIeldbl'
21561 d_PRIfldbl='$d_PRIfldbl'
21562 d_PRIgldbl='$d_PRIgldbl'
21563 d_PRIi64='$d_PRIi64'
21564 d_PRIo64='$d_PRIo64'
21565 d_PRIu64='$d_PRIu64'
21566 d_PRIx64='$d_PRIx64'
21567 d_SCNfldbl='$d_SCNfldbl'
21568 d__fwalk='$d__fwalk'
21569 d_access='$d_access'
21570 d_accessx='$d_accessx'
21573 d_archlib='$d_archlib'
21574 d_asctime_r='$d_asctime_r'
21577 d_attribute_format='$d_attribute_format'
21578 d_attribute_malloc='$d_attribute_malloc'
21579 d_attribute_nonnull='$d_attribute_nonnull'
21580 d_attribute_noreturn='$d_attribute_noreturn'
21581 d_attribute_pure='$d_attribute_pure'
21582 d_attribute_unused='$d_attribute_unused'
21583 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
21587 d_bsdgetpgrp='$d_bsdgetpgrp'
21588 d_bsdsetpgrp='$d_bsdsetpgrp'
21589 d_builtin_choose_expr='$d_builtin_choose_expr'
21590 d_builtin_expect='$d_builtin_expect'
21592 d_c99_variadic_macros='$d_c99_variadic_macros'
21593 d_casti32='$d_casti32'
21594 d_castneg='$d_castneg'
21595 d_charvspr='$d_charvspr'
21597 d_chroot='$d_chroot'
21598 d_chsize='$d_chsize'
21600 d_clearenv='$d_clearenv'
21601 d_closedir='$d_closedir'
21602 d_cmsghdr_s='$d_cmsghdr_s'
21604 d_copysignl='$d_copysignl'
21605 d_cplusplus='$d_cplusplus'
21607 d_crypt_r='$d_crypt_r'
21609 d_ctermid='$d_ctermid'
21610 d_ctermid_r='$d_ctermid_r'
21611 d_ctime_r='$d_ctime_r'
21612 d_cuserid='$d_cuserid'
21613 d_dbl_dig='$d_dbl_dig'
21614 d_dbminitproto='$d_dbminitproto'
21615 d_difftime='$d_difftime'
21616 d_dir_dd_fd='$d_dir_dd_fd'
21618 d_dirnamlen='$d_dirnamlen'
21619 d_dlerror='$d_dlerror'
21620 d_dlopen='$d_dlopen'
21621 d_dlsymun='$d_dlsymun'
21622 d_dosuid='$d_dosuid'
21623 d_drand48_r='$d_drand48_r'
21624 d_drand48proto='$d_drand48proto'
21626 d_eaccess='$d_eaccess'
21627 d_endgrent='$d_endgrent'
21628 d_endgrent_r='$d_endgrent_r'
21629 d_endhent='$d_endhent'
21630 d_endhostent_r='$d_endhostent_r'
21631 d_endnent='$d_endnent'
21632 d_endnetent_r='$d_endnetent_r'
21633 d_endpent='$d_endpent'
21634 d_endprotoent_r='$d_endprotoent_r'
21635 d_endpwent='$d_endpwent'
21636 d_endpwent_r='$d_endpwent_r'
21637 d_endsent='$d_endsent'
21638 d_endservent_r='$d_endservent_r'
21639 d_eofnblk='$d_eofnblk'
21640 d_eunice='$d_eunice'
21641 d_faststdio='$d_faststdio'
21642 d_fchdir='$d_fchdir'
21643 d_fchmod='$d_fchmod'
21644 d_fchown='$d_fchown'
21646 d_fcntl_can_lock='$d_fcntl_can_lock'
21647 d_fd_macros='$d_fd_macros'
21648 d_fd_set='$d_fd_set'
21649 d_fds_bits='$d_fds_bits'
21650 d_fgetpos='$d_fgetpos'
21651 d_finite='$d_finite'
21652 d_finitel='$d_finitel'
21653 d_flexfnam='$d_flexfnam'
21655 d_flockproto='$d_flockproto'
21657 d_fp_class='$d_fp_class'
21658 d_fpathconf='$d_fpathconf'
21659 d_fpclass='$d_fpclass'
21660 d_fpclassify='$d_fpclassify'
21661 d_fpclassl='$d_fpclassl'
21662 d_fpos64_t='$d_fpos64_t'
21663 d_frexpl='$d_frexpl'
21664 d_fs_data_s='$d_fs_data_s'
21665 d_fseeko='$d_fseeko'
21666 d_fsetpos='$d_fsetpos'
21667 d_fstatfs='$d_fstatfs'
21668 d_fstatvfs='$d_fstatvfs'
21670 d_ftello='$d_ftello'
21672 d_futimes='$d_futimes'
21673 d_getcwd='$d_getcwd'
21674 d_getespwnam='$d_getespwnam'
21675 d_getfsstat='$d_getfsstat'
21676 d_getgrent='$d_getgrent'
21677 d_getgrent_r='$d_getgrent_r'
21678 d_getgrgid_r='$d_getgrgid_r'
21679 d_getgrnam_r='$d_getgrnam_r'
21680 d_getgrps='$d_getgrps'
21681 d_gethbyaddr='$d_gethbyaddr'
21682 d_gethbyname='$d_gethbyname'
21683 d_gethent='$d_gethent'
21684 d_gethname='$d_gethname'
21685 d_gethostbyaddr_r='$d_gethostbyaddr_r'
21686 d_gethostbyname_r='$d_gethostbyname_r'
21687 d_gethostent_r='$d_gethostent_r'
21688 d_gethostprotos='$d_gethostprotos'
21689 d_getitimer='$d_getitimer'
21690 d_getlogin='$d_getlogin'
21691 d_getlogin_r='$d_getlogin_r'
21692 d_getmnt='$d_getmnt'
21693 d_getmntent='$d_getmntent'
21694 d_getnbyaddr='$d_getnbyaddr'
21695 d_getnbyname='$d_getnbyname'
21696 d_getnent='$d_getnent'
21697 d_getnetbyaddr_r='$d_getnetbyaddr_r'
21698 d_getnetbyname_r='$d_getnetbyname_r'
21699 d_getnetent_r='$d_getnetent_r'
21700 d_getnetprotos='$d_getnetprotos'
21701 d_getpagsz='$d_getpagsz'
21702 d_getpbyname='$d_getpbyname'
21703 d_getpbynumber='$d_getpbynumber'
21704 d_getpent='$d_getpent'
21705 d_getpgid='$d_getpgid'
21706 d_getpgrp2='$d_getpgrp2'
21707 d_getpgrp='$d_getpgrp'
21708 d_getppid='$d_getppid'
21709 d_getprior='$d_getprior'
21710 d_getprotobyname_r='$d_getprotobyname_r'
21711 d_getprotobynumber_r='$d_getprotobynumber_r'
21712 d_getprotoent_r='$d_getprotoent_r'
21713 d_getprotoprotos='$d_getprotoprotos'
21714 d_getprpwnam='$d_getprpwnam'
21715 d_getpwent='$d_getpwent'
21716 d_getpwent_r='$d_getpwent_r'
21717 d_getpwnam_r='$d_getpwnam_r'
21718 d_getpwuid_r='$d_getpwuid_r'
21719 d_getsbyname='$d_getsbyname'
21720 d_getsbyport='$d_getsbyport'
21721 d_getsent='$d_getsent'
21722 d_getservbyname_r='$d_getservbyname_r'
21723 d_getservbyport_r='$d_getservbyport_r'
21724 d_getservent_r='$d_getservent_r'
21725 d_getservprotos='$d_getservprotos'
21726 d_getspnam='$d_getspnam'
21727 d_getspnam_r='$d_getspnam_r'
21728 d_gettimeod='$d_gettimeod'
21729 d_gmtime_r='$d_gmtime_r'
21730 d_gnulibc='$d_gnulibc'
21731 d_grpasswd='$d_grpasswd'
21732 d_hasmntopt='$d_hasmntopt'
21734 d_ilogbl='$d_ilogbl'
21735 d_inc_version_list='$d_inc_version_list'
21737 d_inetaton='$d_inetaton'
21738 d_int64_t='$d_int64_t'
21739 d_isascii='$d_isascii'
21740 d_isfinite='$d_isfinite'
21743 d_isnanl='$d_isnanl'
21744 d_killpg='$d_killpg'
21745 d_lchown='$d_lchown'
21746 d_ldbl_dig='$d_ldbl_dig'
21747 d_libm_lib_version='$d_libm_lib_version'
21749 d_localtime_r='$d_localtime_r'
21750 d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset'
21751 d_locconv='$d_locconv'
21753 d_longdbl='$d_longdbl'
21754 d_longlong='$d_longlong'
21755 d_lseekproto='$d_lseekproto'
21757 d_madvise='$d_madvise'
21758 d_malloc_good_size='$d_malloc_good_size'
21759 d_malloc_size='$d_malloc_size'
21761 d_mbstowcs='$d_mbstowcs'
21762 d_mbtowc='$d_mbtowc'
21763 d_memchr='$d_memchr'
21764 d_memcmp='$d_memcmp'
21765 d_memcpy='$d_memcpy'
21766 d_memmove='$d_memmove'
21767 d_memset='$d_memset'
21769 d_mkdtemp='$d_mkdtemp'
21770 d_mkfifo='$d_mkfifo'
21771 d_mkstemp='$d_mkstemp'
21772 d_mkstemps='$d_mkstemps'
21773 d_mktime='$d_mktime'
21776 d_modfl_pow32_bug='$d_modfl_pow32_bug'
21777 d_modflproto='$d_modflproto'
21778 d_mprotect='$d_mprotect'
21780 d_msg_ctrunc='$d_msg_ctrunc'
21781 d_msg_dontroute='$d_msg_dontroute'
21782 d_msg_oob='$d_msg_oob'
21783 d_msg_peek='$d_msg_peek'
21784 d_msg_proxy='$d_msg_proxy'
21785 d_msgctl='$d_msgctl'
21786 d_msgget='$d_msgget'
21787 d_msghdr_s='$d_msghdr_s'
21788 d_msgrcv='$d_msgrcv'
21789 d_msgsnd='$d_msgsnd'
21791 d_munmap='$d_munmap'
21792 d_mymalloc='$d_mymalloc'
21794 d_nl_langinfo='$d_nl_langinfo'
21795 d_nv_preserves_uv='$d_nv_preserves_uv'
21796 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
21797 d_off64_t='$d_off64_t'
21798 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
21799 d_oldpthreads='$d_oldpthreads'
21800 d_oldsock='$d_oldsock'
21802 d_pathconf='$d_pathconf'
21804 d_perl_otherlibdirs='$d_perl_otherlibdirs'
21805 d_phostname='$d_phostname'
21808 d_portable='$d_portable'
21809 d_printf_format_null='$d_printf_format_null'
21810 d_procselfexe='$d_procselfexe'
21811 d_pseudofork='$d_pseudofork'
21812 d_pthread_atfork='$d_pthread_atfork'
21813 d_pthread_attr_setscope='$d_pthread_attr_setscope'
21814 d_pthread_yield='$d_pthread_yield'
21816 d_pwchange='$d_pwchange'
21817 d_pwclass='$d_pwclass'
21818 d_pwcomment='$d_pwcomment'
21819 d_pwexpire='$d_pwexpire'
21820 d_pwgecos='$d_pwgecos'
21821 d_pwpasswd='$d_pwpasswd'
21822 d_pwquota='$d_pwquota'
21825 d_random_r='$d_random_r'
21826 d_readdir64_r='$d_readdir64_r'
21827 d_readdir='$d_readdir'
21828 d_readdir_r='$d_readdir_r'
21829 d_readlink='$d_readlink'
21831 d_recvmsg='$d_recvmsg'
21832 d_rename='$d_rename'
21833 d_rewinddir='$d_rewinddir'
21835 d_safebcpy='$d_safebcpy'
21836 d_safemcpy='$d_safemcpy'
21837 d_sanemcmp='$d_sanemcmp'
21838 d_sbrkproto='$d_sbrkproto'
21839 d_scalbnl='$d_scalbnl'
21840 d_sched_yield='$d_sched_yield'
21841 d_scm_rights='$d_scm_rights'
21842 d_seekdir='$d_seekdir'
21843 d_select='$d_select'
21845 d_semctl='$d_semctl'
21846 d_semctl_semid_ds='$d_semctl_semid_ds'
21847 d_semctl_semun='$d_semctl_semun'
21848 d_semget='$d_semget'
21850 d_sendmsg='$d_sendmsg'
21851 d_setegid='$d_setegid'
21852 d_seteuid='$d_seteuid'
21853 d_setgrent='$d_setgrent'
21854 d_setgrent_r='$d_setgrent_r'
21855 d_setgrps='$d_setgrps'
21856 d_sethent='$d_sethent'
21857 d_sethostent_r='$d_sethostent_r'
21858 d_setitimer='$d_setitimer'
21859 d_setlinebuf='$d_setlinebuf'
21860 d_setlocale='$d_setlocale'
21861 d_setlocale_r='$d_setlocale_r'
21862 d_setnent='$d_setnent'
21863 d_setnetent_r='$d_setnetent_r'
21864 d_setpent='$d_setpent'
21865 d_setpgid='$d_setpgid'
21866 d_setpgrp2='$d_setpgrp2'
21867 d_setpgrp='$d_setpgrp'
21868 d_setprior='$d_setprior'
21869 d_setproctitle='$d_setproctitle'
21870 d_setprotoent_r='$d_setprotoent_r'
21871 d_setpwent='$d_setpwent'
21872 d_setpwent_r='$d_setpwent_r'
21873 d_setregid='$d_setregid'
21874 d_setresgid='$d_setresgid'
21875 d_setresuid='$d_setresuid'
21876 d_setreuid='$d_setreuid'
21877 d_setrgid='$d_setrgid'
21878 d_setruid='$d_setruid'
21879 d_setsent='$d_setsent'
21880 d_setservent_r='$d_setservent_r'
21881 d_setsid='$d_setsid'
21882 d_setvbuf='$d_setvbuf'
21886 d_shmatprototype='$d_shmatprototype'
21887 d_shmctl='$d_shmctl'
21889 d_shmget='$d_shmget'
21890 d_sigaction='$d_sigaction'
21891 d_signbit='$d_signbit'
21892 d_sigprocmask='$d_sigprocmask'
21893 d_sigsetjmp='$d_sigsetjmp'
21894 d_sitearch='$d_sitearch'
21895 d_snprintf='$d_snprintf'
21896 d_sockatmark='$d_sockatmark'
21897 d_sockatmarkproto='$d_sockatmarkproto'
21898 d_socket='$d_socket'
21899 d_socklen_t='$d_socklen_t'
21900 d_sockpair='$d_sockpair'
21901 d_socks5_init='$d_socks5_init'
21902 d_sprintf_returns_strlen='$d_sprintf_returns_strlen'
21904 d_srand48_r='$d_srand48_r'
21905 d_srandom_r='$d_srandom_r'
21906 d_sresgproto='$d_sresgproto'
21907 d_sresuproto='$d_sresuproto'
21908 d_statblks='$d_statblks'
21909 d_statfs_f_flags='$d_statfs_f_flags'
21910 d_statfs_s='$d_statfs_s'
21911 d_statvfs='$d_statvfs'
21912 d_stdio_cnt_lval='$d_stdio_cnt_lval'
21913 d_stdio_ptr_lval='$d_stdio_ptr_lval'
21914 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
21915 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
21916 d_stdio_stream_array='$d_stdio_stream_array'
21917 d_stdiobase='$d_stdiobase'
21918 d_stdstdio='$d_stdstdio'
21919 d_strchr='$d_strchr'
21920 d_strcoll='$d_strcoll'
21921 d_strctcpy='$d_strctcpy'
21922 d_strerrm='$d_strerrm'
21923 d_strerror='$d_strerror'
21924 d_strerror_r='$d_strerror_r'
21925 d_strftime='$d_strftime'
21926 d_strlcat='$d_strlcat'
21927 d_strlcpy='$d_strlcpy'
21928 d_strtod='$d_strtod'
21929 d_strtol='$d_strtol'
21930 d_strtold='$d_strtold'
21931 d_strtoll='$d_strtoll'
21932 d_strtoq='$d_strtoq'
21933 d_strtoul='$d_strtoul'
21934 d_strtoull='$d_strtoull'
21935 d_strtouq='$d_strtouq'
21936 d_strxfrm='$d_strxfrm'
21937 d_suidsafe='$d_suidsafe'
21938 d_symlink='$d_symlink'
21939 d_syscall='$d_syscall'
21940 d_syscallproto='$d_syscallproto'
21941 d_sysconf='$d_sysconf'
21942 d_sysernlst='$d_sysernlst'
21943 d_syserrlst='$d_syserrlst'
21944 d_system='$d_system'
21945 d_tcgetpgrp='$d_tcgetpgrp'
21946 d_tcsetpgrp='$d_tcsetpgrp'
21947 d_telldir='$d_telldir'
21948 d_telldirproto='$d_telldirproto'
21951 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
21952 d_tm_tm_zone='$d_tm_tm_zone'
21953 d_tmpnam_r='$d_tmpnam_r'
21954 d_truncate='$d_truncate'
21955 d_ttyname_r='$d_ttyname_r'
21956 d_tzname='$d_tzname'
21957 d_u32align='$d_u32align'
21958 d_ualarm='$d_ualarm'
21961 d_union_semun='$d_union_semun'
21962 d_unordered='$d_unordered'
21963 d_unsetenv='$d_unsetenv'
21964 d_usleep='$d_usleep'
21965 d_usleepproto='$d_usleepproto'
21967 d_vendorarch='$d_vendorarch'
21968 d_vendorbin='$d_vendorbin'
21969 d_vendorlib='$d_vendorlib'
21970 d_vendorscript='$d_vendorscript'
21972 d_void_closedir='$d_void_closedir'
21973 d_voidsig='$d_voidsig'
21974 d_voidtty='$d_voidtty'
21975 d_volatile='$d_volatile'
21976 d_vprintf='$d_vprintf'
21977 d_vsnprintf='$d_vsnprintf'
21979 d_waitpid='$d_waitpid'
21980 d_wcstombs='$d_wcstombs'
21981 d_wctomb='$d_wctomb'
21982 d_writev='$d_writev'
21985 db_hashtype='$db_hashtype'
21986 db_prefixtype='$db_prefixtype'
21987 db_version_major='$db_version_major'
21988 db_version_minor='$db_version_minor'
21989 db_version_patch='$db_version_patch'
21990 defvoidused='$defvoidused'
21991 direntrytype='$direntrytype'
21994 doublesize='$doublesize'
21996 drand48_r_proto='$drand48_r_proto'
21997 dynamic_ext='$dynamic_ext'
22003 endgrent_r_proto='$endgrent_r_proto'
22004 endhostent_r_proto='$endhostent_r_proto'
22005 endnetent_r_proto='$endnetent_r_proto'
22006 endprotoent_r_proto='$endprotoent_r_proto'
22007 endpwent_r_proto='$endpwent_r_proto'
22008 endservent_r_proto='$endservent_r_proto'
22009 eunicefix='$eunicefix'
22012 extensions='$extensions'
22014 fflushNULL='$fflushNULL'
22015 fflushall='$fflushall'
22017 firstmakefile='$firstmakefile'
22019 fpossize='$fpossize'
22020 fpostype='$fpostype'
22021 freetype='$freetype'
22024 full_csh='$full_csh'
22025 full_sed='$full_sed'
22026 gccansipedantic='$gccansipedantic'
22027 gccosandvers='$gccosandvers'
22028 gccversion='$gccversion'
22029 getgrent_r_proto='$getgrent_r_proto'
22030 getgrgid_r_proto='$getgrgid_r_proto'
22031 getgrnam_r_proto='$getgrnam_r_proto'
22032 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
22033 gethostbyname_r_proto='$gethostbyname_r_proto'
22034 gethostent_r_proto='$gethostent_r_proto'
22035 getlogin_r_proto='$getlogin_r_proto'
22036 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
22037 getnetbyname_r_proto='$getnetbyname_r_proto'
22038 getnetent_r_proto='$getnetent_r_proto'
22039 getprotobyname_r_proto='$getprotobyname_r_proto'
22040 getprotobynumber_r_proto='$getprotobynumber_r_proto'
22041 getprotoent_r_proto='$getprotoent_r_proto'
22042 getpwent_r_proto='$getpwent_r_proto'
22043 getpwnam_r_proto='$getpwnam_r_proto'
22044 getpwuid_r_proto='$getpwuid_r_proto'
22045 getservbyname_r_proto='$getservbyname_r_proto'
22046 getservbyport_r_proto='$getservbyport_r_proto'
22047 getservent_r_proto='$getservent_r_proto'
22048 getspnam_r_proto='$getspnam_r_proto'
22049 gidformat='$gidformat'
22055 gmtime_r_proto='$gmtime_r_proto'
22056 gnulibc_version='$gnulibc_version'
22058 groupcat='$groupcat'
22059 groupstype='$groupstype'
22062 h_sysfile='$h_sysfile'
22065 html1dir='$html1dir'
22066 html1direxp='$html1direxp'
22067 html3dir='$html3dir'
22068 html3direxp='$html3direxp'
22077 i_arpainet='$i_arpainet'
22078 i_bsdioctl='$i_bsdioctl'
22082 i_dirent='$i_dirent'
22088 i_fp_class='$i_fp_class'
22091 i_ieeefp='$i_ieeefp'
22092 i_inttypes='$i_inttypes'
22093 i_langinfo='$i_langinfo'
22094 i_libutil='$i_libutil'
22095 i_limits='$i_limits'
22096 i_locale='$i_locale'
22097 i_machcthr='$i_machcthr'
22098 i_malloc='$i_malloc'
22100 i_memory='$i_memory'
22101 i_mntent='$i_mntent'
22104 i_neterrno='$i_neterrno'
22105 i_netinettcp='$i_netinettcp'
22109 i_pthread='$i_pthread'
22111 i_rpcsvcdbm='$i_rpcsvcdbm'
22114 i_shadow='$i_shadow'
22116 i_stdarg='$i_stdarg'
22117 i_stddef='$i_stddef'
22118 i_stdlib='$i_stdlib'
22119 i_string='$i_string'
22120 i_sunmath='$i_sunmath'
22121 i_sysaccess='$i_sysaccess'
22122 i_sysdir='$i_sysdir'
22123 i_sysfile='$i_sysfile'
22124 i_sysfilio='$i_sysfilio'
22126 i_sysioctl='$i_sysioctl'
22127 i_syslog='$i_syslog'
22128 i_sysmman='$i_sysmman'
22129 i_sysmode='$i_sysmode'
22130 i_sysmount='$i_sysmount'
22131 i_sysndir='$i_sysndir'
22132 i_sysparam='$i_sysparam'
22133 i_sysresrc='$i_sysresrc'
22134 i_syssecrt='$i_syssecrt'
22135 i_sysselct='$i_sysselct'
22136 i_syssockio='$i_syssockio'
22137 i_sysstat='$i_sysstat'
22138 i_sysstatfs='$i_sysstatfs'
22139 i_sysstatvfs='$i_sysstatvfs'
22140 i_systime='$i_systime'
22141 i_systimek='$i_systimek'
22142 i_systimes='$i_systimes'
22143 i_systypes='$i_systypes'
22144 i_sysuio='$i_sysuio'
22146 i_sysutsname='$i_sysutsname'
22147 i_sysvfs='$i_sysvfs'
22148 i_syswait='$i_syswait'
22149 i_termio='$i_termio'
22150 i_termios='$i_termios'
22152 i_unistd='$i_unistd'
22155 i_values='$i_values'
22156 i_varargs='$i_varargs'
22157 i_varhdr='$i_varhdr'
22159 ignore_versioned_solibs='$ignore_versioned_solibs'
22160 inc_version_list='$inc_version_list'
22161 inc_version_list_init='$inc_version_list_init'
22164 initialinstalllocation='$initialinstalllocation'
22165 installarchlib='$installarchlib'
22166 installbin='$installbin'
22167 installhtml1dir='$installhtml1dir'
22168 installhtml3dir='$installhtml3dir'
22169 installman1dir='$installman1dir'
22170 installman3dir='$installman3dir'
22171 installprefix='$installprefix'
22172 installprefixexp='$installprefixexp'
22173 installprivlib='$installprivlib'
22174 installscript='$installscript'
22175 installsitearch='$installsitearch'
22176 installsitebin='$installsitebin'
22177 installsitehtml1dir='$installsitehtml1dir'
22178 installsitehtml3dir='$installsitehtml3dir'
22179 installsitelib='$installsitelib'
22180 installsiteman1dir='$installsiteman1dir'
22181 installsiteman3dir='$installsiteman3dir'
22182 installsitescript='$installsitescript'
22183 installstyle='$installstyle'
22184 installusrbinperl='$installusrbinperl'
22185 installvendorarch='$installvendorarch'
22186 installvendorbin='$installvendorbin'
22187 installvendorhtml1dir='$installvendorhtml1dir'
22188 installvendorhtml3dir='$installvendorhtml3dir'
22189 installvendorlib='$installvendorlib'
22190 installvendorman1dir='$installvendorman1dir'
22191 installvendorman3dir='$installvendorman3dir'
22192 installvendorscript='$installvendorscript'
22194 issymlink='$issymlink'
22195 ivdformat='$ivdformat'
22198 known_extensions='$known_extensions'
22201 lddlflags='$lddlflags'
22203 ldflags_uselargefiles='$ldflags_uselargefiles'
22204 ldlibpthname='$ldlibpthname'
22211 libsdirs='$libsdirs'
22212 libsfiles='$libsfiles'
22213 libsfound='$libsfound'
22214 libspath='$libspath'
22215 libswanted='$libswanted'
22216 libswanted_uselargefiles='$libswanted_uselargefiles'
22222 localtime_r_proto='$localtime_r_proto'
22223 locincpth='$locincpth'
22224 loclibpth='$loclibpth'
22225 longdblsize='$longdblsize'
22226 longlongsize='$longlongsize'
22227 longsize='$longsize'
22231 lseeksize='$lseeksize'
22232 lseektype='$lseektype'
22235 madlyobj='$madlyobj'
22236 madlysrc='$madlysrc'
22240 make_set_make='$make_set_make'
22241 mallocobj='$mallocobj'
22242 mallocsrc='$mallocsrc'
22243 malloctype='$malloctype'
22245 man1direxp='$man1direxp'
22248 man3direxp='$man3direxp'
22250 mips_type='$mips_type'
22251 mistrustnm='$mistrustnm'
22253 mmaptype='$mmaptype'
22254 modetype='$modetype'
22256 multiarch='$multiarch'
22258 myarchname='$myarchname'
22259 mydomain='$mydomain'
22260 myhostname='$myhostname'
22263 need_va_copy='$need_va_copy'
22264 netdb_hlen_type='$netdb_hlen_type'
22265 netdb_host_type='$netdb_host_type'
22266 netdb_name_type='$netdb_name_type'
22267 netdb_net_type='$netdb_net_type'
22270 nm_so_opt='$nm_so_opt'
22271 nonxs_ext='$nonxs_ext'
22273 nvEUformat='$nvEUformat'
22274 nvFUformat='$nvFUformat'
22275 nvGUformat='$nvGUformat'
22276 nv_preserves_uv_bits='$nv_preserves_uv_bits'
22277 nveformat='$nveformat'
22278 nvfformat='$nvfformat'
22279 nvgformat='$nvgformat'
22282 o_nonblock='$o_nonblock'
22284 old_pthread_create_joinable='$old_pthread_create_joinable'
22285 optimize='$optimize'
22286 orderlib='$orderlib'
22289 otherlibdirs='$otherlibdirs'
22293 patchlevel='$patchlevel'
22294 path_sep='$path_sep'
22297 perl_patchlevel='$perl_patchlevel'
22298 perladmin='$perladmin'
22299 perllibs='$perllibs'
22300 perlpath='$perlpath'
22302 phostname='$phostname'
22308 prefixexp='$prefixexp'
22310 privlibexp='$privlibexp'
22311 procselfexe='$procselfexe'
22312 prototype='$prototype'
22314 quadkind='$quadkind'
22315 quadtype='$quadtype'
22316 randbits='$randbits'
22317 randfunc='$randfunc'
22318 random_r_proto='$random_r_proto'
22319 randseedtype='$randseedtype'
22321 rd_nodata='$rd_nodata'
22322 readdir64_r_proto='$readdir64_r_proto'
22323 readdir_r_proto='$readdir_r_proto'
22324 revision='$revision'
22329 sPRIEUldbl='$sPRIEUldbl'
22330 sPRIFUldbl='$sPRIFUldbl'
22331 sPRIGUldbl='$sPRIGUldbl'
22332 sPRIXU64='$sPRIXU64'
22334 sPRIeldbl='$sPRIeldbl'
22335 sPRIfldbl='$sPRIfldbl'
22336 sPRIgldbl='$sPRIgldbl'
22341 sSCNfldbl='$sSCNfldbl'
22342 sched_yield='$sched_yield'
22343 scriptdir='$scriptdir'
22344 scriptdirexp='$scriptdirexp'
22346 seedfunc='$seedfunc'
22347 selectminbits='$selectminbits'
22348 selecttype='$selecttype'
22349 sendmail='$sendmail'
22350 setgrent_r_proto='$setgrent_r_proto'
22351 sethostent_r_proto='$sethostent_r_proto'
22352 setlocale_r_proto='$setlocale_r_proto'
22353 setnetent_r_proto='$setnetent_r_proto'
22354 setprotoent_r_proto='$setprotoent_r_proto'
22355 setpwent_r_proto='$setpwent_r_proto'
22356 setservent_r_proto='$setservent_r_proto'
22359 sharpbang='$sharpbang'
22360 shmattype='$shmattype'
22361 shortsize='$shortsize'
22364 sig_count='$sig_count'
22365 sig_name='$sig_name'
22366 sig_name_init='$sig_name_init'
22368 sig_num_init='$sig_num_init'
22369 sig_size='$sig_size'
22370 signal_t='$signal_t'
22371 sitearch='$sitearch'
22372 sitearchexp='$sitearchexp'
22374 sitebinexp='$sitebinexp'
22375 sitehtml1dir='$sitehtml1dir'
22376 sitehtml1direxp='$sitehtml1direxp'
22377 sitehtml3dir='$sitehtml3dir'
22378 sitehtml3direxp='$sitehtml3direxp'
22380 sitelib_stem='$sitelib_stem'
22381 sitelibexp='$sitelibexp'
22382 siteman1dir='$siteman1dir'
22383 siteman1direxp='$siteman1direxp'
22384 siteman3dir='$siteman3dir'
22385 siteman3direxp='$siteman3direxp'
22386 siteprefix='$siteprefix'
22387 siteprefixexp='$siteprefixexp'
22388 sitescript='$sitescript'
22389 sitescriptexp='$sitescriptexp'
22390 sizesize='$sizesize'
22391 sizetype='$sizetype'
22395 sockethdr='$sockethdr'
22396 socketlib='$socketlib'
22397 socksizetype='$socksizetype'
22399 spackage='$spackage'
22400 spitshell='$spitshell'
22401 srand48_r_proto='$srand48_r_proto'
22402 srandom_r_proto='$srandom_r_proto'
22404 ssizetype='$ssizetype'
22405 startperl='$startperl'
22407 static_ext='$static_ext'
22409 stdio_base='$stdio_base'
22410 stdio_bufsiz='$stdio_bufsiz'
22411 stdio_cnt='$stdio_cnt'
22412 stdio_filbuf='$stdio_filbuf'
22413 stdio_ptr='$stdio_ptr'
22414 stdio_stream_array='$stdio_stream_array'
22415 strerror_r_proto='$strerror_r_proto'
22418 subversion='$subversion'
22422 targetarch='$targetarch'
22426 timeincl='$timeincl'
22427 timetype='$timetype'
22428 tmpnam_r_proto='$tmpnam_r_proto'
22434 ttyname_r_proto='$ttyname_r_proto'
22443 uidformat='$uidformat'
22449 uquadtype='$uquadtype'
22450 use5005threads='$use5005threads'
22451 use64bitall='$use64bitall'
22452 use64bitint='$use64bitint'
22453 usecrosscompile='$usecrosscompile'
22455 usefaststdio='$usefaststdio'
22456 useithreads='$useithreads'
22457 uselargefiles='$uselargefiles'
22458 uselongdouble='$uselongdouble'
22459 usemallocwrap='$usemallocwrap'
22460 usemorebits='$usemorebits'
22461 usemultiplicity='$usemultiplicity'
22462 usemymalloc='$usemymalloc'
22464 useopcode='$useopcode'
22465 useperlio='$useperlio'
22466 useposix='$useposix'
22467 usereentrant='$usereentrant'
22468 userelocatableinc='$userelocatableinc'
22470 useshrplib='$useshrplib'
22471 usesitecustomize='$usesitecustomize'
22472 usesocks='$usesocks'
22473 usethreads='$usethreads'
22474 usevendorprefix='$usevendorprefix'
22475 usevfork='$usevfork'
22478 uvXUformat='$uvXUformat'
22479 uvoformat='$uvoformat'
22482 uvuformat='$uvuformat'
22483 uvxformat='$uvxformat'
22484 vendorarch='$vendorarch'
22485 vendorarchexp='$vendorarchexp'
22486 vendorbin='$vendorbin'
22487 vendorbinexp='$vendorbinexp'
22488 vendorhtml1dir='$vendorhtml1dir'
22489 vendorhtml1direxp='$vendorhtml1direxp'
22490 vendorhtml3dir='$vendorhtml3dir'
22491 vendorhtml3direxp='$vendorhtml3direxp'
22492 vendorlib='$vendorlib'
22493 vendorlib_stem='$vendorlib_stem'
22494 vendorlibexp='$vendorlibexp'
22495 vendorman1dir='$vendorman1dir'
22496 vendorman1direxp='$vendorman1direxp'
22497 vendorman3dir='$vendorman3dir'
22498 vendorman3direxp='$vendorman3direxp'
22499 vendorprefix='$vendorprefix'
22500 vendorprefixexp='$vendorprefixexp'
22501 vendorscript='$vendorscript'
22502 vendorscriptexp='$vendorscriptexp'
22504 version_patchlevel_string='$version_patchlevel_string'
22505 versiononly='$versiononly'
22507 voidflags='$voidflags'
22510 yaccflags='$yaccflags'
22515 : Add in command line options if available
22516 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
22518 : add special variables
22519 $test -f $src/patchlevel.h && \
22520 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
22521 echo "PERL_PATCHLEVEL=$perl_patchlevel" >>config.sh
22522 echo "PERL_CONFIG_SH=true" >>config.sh
22524 : propagate old symbols
22525 if $test -f UU/config.sh; then
22526 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
22527 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
22528 $sort | $uniq -u >UU/oldsyms
22529 set X `cat UU/oldsyms`
22535 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
22537 echo "# Variables propagated from previous config.sh file." >>config.sh
22538 for sym in `cat UU/oldsyms`; do
22539 echo " Propagating $hint variable "'$'"$sym..."
22540 eval 'tmp="$'"${sym}"'"'
22542 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
22548 : Finish up by extracting the .SH files
22552 echo "Extraction done."
22562 If you'd like to make any changes to the config.sh file before I begin
22563 to configure things, do it as a shell escape now (e.g. !vi config.sh).
22566 rp="Press return or use a shell escape to edit config.sh:"
22571 *) : in case they cannot read
22572 sh 1>&4 -c "$ans";;
22577 : if this fails, just run all the .SH files by hand
22586 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
22593 Now you need to generate make dependencies by running "$make depend".
22594 You might prefer to run it in background: "$make depend > makedepend.out &"
22595 It can take a while, so you might not want to run it right now.
22600 rp="Run $make depend now?"
22604 $make depend && echo "Now you must run '$make'."
22607 echo "You must run '$make depend' then '$make'."
22610 elif test -f [Mm]akefile; then
22612 echo "Now you must run a $make."
22614 echo "Configure done."
22617 if $test -f Policy.sh; then
22620 If you compile $package on a different machine or from a different object
22621 directory, copy the Policy.sh file from this object directory to the
22622 new one before you run Configure -- this will help you with most of
22623 the policy defaults.
22627 if $test -f config.msg; then
22628 echo "Hmm. I also noted the following information while running:"
22630 $cat config.msg >&4
22633 $rm -f kit*isdone ark*isdone