3 # If these # comments don't work, trim them. Don't worry about any other
4 # shell scripts, Configure will trim # comments from them for you.
6 # (If you are trying to port this package to a machine without sh,
7 # I would suggest you have a look at the prototypical config_h.SH file
8 # and edit it to reflect your system. Some packages may include samples
9 # of config.h for certain machines, so you might look for one of those.)
11 # Yes, you may rip this off to use in other distribution packages. This
12 # script belongs to the public domain and cannot be copyrighted.
14 # (Note: this Configure script was generated automatically. Rather than
15 # working with this copy of Configure, you may wish to get metaconfig.
16 # The dist-3.0 package (which contains metaconfig) was posted in
17 # comp.sources.misc and is available on CPAN under authors/id/RAM so
18 # you may fetch it yourself from your nearest archive site.)
21 # Though this script was generated by metaconfig, it is OK to send
22 # patches against it. It's up to the Configure pumpkin to backport
23 # the patch to the metaunits if it is accepted.
24 # See Porting/pumpkin.pod for more information on metaconfig.
27 # $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $
29 # Generated on Mon Oct 8 10:22:27 CEST 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 "$@";;
184 test -x "${newsh}" || unset newsh
186 : if needed set CDPATH to a harmless value that is not chatty
187 : avoid bash 2.02 problems with empty CDPATH.
191 *bash*) CDPATH='.' ;;
196 : Configure runs within the UU subdirectory
197 test -d UU || mkdir UU
336 initialinstalllocation=''
363 d_attribute_format=''
364 d_attribute_malloc=''
365 d_attribute_nonnull=''
366 d_attribute_noreturn=''
368 d_attribute_unused=''
369 d_attribute_warn_unused_result=''
370 d_printf_format_null=''
373 d_builtin_choose_expr=''
376 d_c99_variadic_macros=''
423 endhostent_r_proto=''
429 endprotoent_r_proto=''
435 endservent_r_proto=''
487 gethostbyaddr_r_proto=''
489 gethostbyname_r_proto=''
491 gethostent_r_proto=''
503 getnetbyaddr_r_proto=''
505 getnetbyname_r_proto=''
519 d_getprotobyname_r=''
520 getprotobyname_r_proto=''
521 d_getprotobynumber_r=''
522 getprotobynumber_r_proto=''
524 getprotoent_r_proto=''
536 getservbyname_r_proto=''
538 getservbyport_r_proto=''
540 getservent_r_proto=''
564 d_libm_lib_version=''
567 d_localtime_r_needs_tzset=''
578 d_malloc_good_size=''
620 d_old_pthread_create_joinable=''
621 old_pthread_create_joinable=''
623 d_pthread_attr_setscope=''
662 sethostent_r_proto=''
679 setprotoent_r_proto=''
691 setservent_r_proto=''
725 d_sprintf_returns_strlen=''
740 d_stdio_ptr_lval_nochange_cnt=''
741 d_stdio_ptr_lval_sets_cnt=''
945 d_inc_version_list=''
947 inc_version_list_init=''
966 ignore_versioned_solibs=''
1030 d_perl_otherlibdirs=''
1038 api_versionstring=''
1044 version_patchlevel_string=''
1048 d_nv_preserves_uv=''
1049 d_nv_zero_is_allbits_zero=''
1060 nv_preserves_uv_bits=''
1132 installsitehtml1dir=''
1135 installsitehtml3dir=''
1142 installsiteman1dir=''
1145 installsiteman3dir=''
1150 installsitescript=''
1165 d_stdio_stream_array=''
1166 stdio_stream_array=''
1177 ccflags_uselargefiles=''
1178 ldflags_uselargefiles=''
1179 libswanted_uselargefiles=''
1199 installvendorarch=''
1206 installvendorhtml1dir=''
1208 vendorhtml1direxp=''
1209 installvendorhtml3dir=''
1211 vendorhtml3direxp=''
1217 installvendorman1dir=''
1220 installvendorman3dir=''
1227 installvendorscript=''
1239 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1242 : We must find out about Eunice early
1244 if test -f /etc/unixtovms; then
1245 eunicefix=/etc/unixtovms
1247 if test -f /etc/unixtovms.exe; then
1248 eunicefix=/etc/unixtovms.exe
1251 : Set executable suffix now -- needed before hints available
1252 if test -f "/libs/version.library"; then
1255 elif test -f "/system/gnu_library/bin/ar.pm"; then
1258 elif test -n "$DJGPP"; then
1261 elif test -d c:/. -o -n "$is_os2" ; then
1267 : Trailing extension. Override this in a hint file, if needed.
1268 : Extra object files, if any, needed on this platform.
1273 : change the next line if compiling for Xenix/286 on Xenix/386
1274 xlibpth='/usr/lib/386 /lib/386'
1275 : Possible local library directories to search.
1276 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1277 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1279 : general looking path for locating libraries
1280 glibpth="/lib /usr/lib $xlibpth"
1281 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1282 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1283 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1284 test -d /usr/lib64 && glibpth="$glibpth /lib64 /usr/lib64 /usr/local/lib64"
1286 : Private path used by Configure to find libraries. Its value
1287 : is prepended to libpth. This variable takes care of special
1288 : machines, like the mips. Usually, it should be empty.
1291 : default library list
1293 : some systems want to use only the non-versioned libso:s
1294 ignore_versioned_solibs=''
1298 : set usethreads on the Configure command line to enable threads.
1299 usereentrant='undef'
1300 : full support for void wanted by default
1303 : Possible local include directories to search.
1304 : Set locincpth to "" in a hint file to defeat local include searches.
1305 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1306 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1308 : no include file wanted by default
1311 : Enable -DEBUGGING and -DDEBUGGING from the command line
1318 : set useposix=false in your hint file to disable the POSIX extension.
1320 : set useopcode=false in your hint file to disable the Opcode extension.
1323 ccflags_uselargefiles=''
1324 ldflags_uselargefiles=''
1325 libswanted_uselargefiles=''
1326 : set usemultiplicity on the Configure command line to enable multiplicity.
1327 : set usesocks on the Configure command line to enable socks.
1328 : List of libraries we want.
1329 : If anyone needs extra -lxxx, put those in a hint file.
1330 libswanted="sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun"
1331 libswanted="$libswanted m crypt sec util c cposix posix ucb bsd BSD"
1332 : We probably want to search /usr/shlib before most other libraries.
1333 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1334 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1335 glibpth="/usr/shlib $glibpth"
1336 : Do not use vfork unless overridden by a hint file.
1339 : Find the basic shell for Bourne shell scripts
1343 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1346 if test -f "$xxx"; then
1349 : Build up a list and do a single loop so we can 'break' out.
1350 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1351 for xxx in sh bash ksh pdksh ash; do
1353 try="$try ${p}/${xxx}"
1357 if test -f "$xxx"; then
1360 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1363 elif test -f "$xxx.exe"; then
1374 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1376 Usually it's in /bin/sh. How did you even get this far?
1377 Please contact me (Perl Maintainers) at perlbug@perl.org and
1378 we'll try to straighten this all out.
1384 : see if sh knows # comments
1385 if `$sh -c '#' >/dev/null 2>&1`; then
1389 test -f $xcat$_exe || xcat=/usr/bin/cat
1390 if test ! -f $xcat$_exe; then
1391 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1392 if test -f $p/cat$_exe; then
1397 if test ! -f $xcat$_exe; then
1398 echo "Can't find cat anywhere!"
1402 echo "#!$xcat" >sharp
1406 if test -s today; then
1409 echo "#! $xcat" > sharp
1413 if test -s today; then
1421 echo "Your $sh doesn't grok # comments--I will strip them later on."
1424 echo "exec grep -v '^[ ]*#'" >spitshell
1426 $eunicefix spitshell
1427 spitshell=`pwd`/spitshell
1429 echo "I presume that if # doesn't work, #! won't work either!"
1434 : figure out how to guarantee sh startup
1436 '') startsh=${sharpbang}${sh} ;;
1448 : echo "Yup, it does."
1450 echo "Hmm... '$startsh' does not guarantee sh startup..."
1451 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1456 : Save command line options in file UU/cmdline.opt for later use in
1457 : generating config.sh.
1458 cat > cmdline.opt <<EOSH
1459 # Configure command line arguments.
1468 cat >>cmdline.opt <<EOSH
1469 config_arg$argn='$arg'
1471 # Extreme backslashitis: replace each ' by '"'"'
1472 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1475 arg_exp=`cat cmdl.opt`
1476 args_exp="$args_exp$args_sep'$arg_exp'"
1477 argn=`expr $argn + 1`
1480 # args_exp is good for restarting self: eval "set X $args_exp"; shift; $0 "$@"
1481 # used by ./hints/os2.sh
1484 : produce awk script to parse command line options
1485 cat >options.awk <<'EOF'
1487 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1489 len = length(optstr);
1490 for (i = 1; i <= len; i++) {
1491 c = substr(optstr, i, 1);
1492 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1503 if (substr(str, 1, 1) != "-") {
1504 printf("'%s'\n", str);
1508 for (i = 2; i <= len; i++) {
1509 c = substr(str, i, 1);
1511 printf("-%s\n", substr(str, i));
1517 printf("'%s'\n", substr(str, i + 1));
1530 : process the command line options
1531 set X `for arg in "$@"; do echo "X$arg"; done |
1532 sed -e s/X// | awk -f options.awk`
1537 : set up default values
1547 rm -f optdef.sh posthint.sh
1548 cat >optdef.sh <<EOS
1554 while test $# -gt 0; do
1556 -d) shift; fastread=yes;;
1557 -e) shift; alldone=cont;;
1561 if test -r "$1"; then
1564 echo "$me: cannot read config file $1." >&2
1570 -h) shift; error=true;;
1571 -r) shift; reuseval=true;;
1572 -s) shift; silent=true; realsilent=true;;
1573 -E) shift; alldone=exit;;
1574 -K) shift; knowitall=true;;
1575 -O) shift; override=true;;
1576 -S) shift; silent=true; extractsh=true;;
1581 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1582 echo "$me: ignoring -D $1" >&2
1585 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1586 *) echo "$1='define'" >> optdef.sh;;
1593 *=) echo "$1" >> optdef.sh;;
1595 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1596 echo "$me: ignoring -U $1" >&2
1598 *) echo "$1='undef'" >> optdef.sh;;
1609 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1613 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1614 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1620 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1621 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1622 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1623 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1624 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1625 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1631 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1633 echo "$yyy=''" >> posthint.sh ;;
1638 echo "$yyy='$zzz'" >> posthint.sh ;;
1640 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1642 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1647 echo "$yyy=$zzz" >> posthint.sh ;;
1648 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1652 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1655 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1663 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1664 [-U symbol] [-U symbol=] [-A command:symbol...]
1665 -d : use defaults for all answers.
1666 -e : go on without questioning past the production of config.sh.
1667 -f : specify an alternate default configuration file.
1668 -h : print this help message and exit (with an error status).
1669 -r : reuse C symbols value if possible (skips costly nm extraction).
1670 -s : silent mode, only echoes questions and essential information.
1671 -D : define symbol to have some value:
1672 -D symbol symbol gets the value 'define'
1673 -D symbol=value symbol gets the value 'value'
1674 common used examples (see INSTALL for more info):
1675 -Duse64bitint use 64bit integers
1676 -Duse64bitall use 64bit integers and pointers
1677 -Dusethreads use thread support
1678 -Dinc_version_list=none do not include older perl trees in @INC
1679 -DEBUGGING=none DEBUGGING options
1680 -Dcc=gcc choose your compiler
1681 -Dprefix=/opt/perl5 choose your destination
1682 -E : stop at the end of questions, after having produced config.sh.
1683 -K : do not use unless you know what you are doing.
1684 -O : let -D and -U override definitions from loaded configuration file.
1685 -S : perform variable substitutions on all .SH files (can mix with -f)
1686 -U : undefine symbol:
1687 -U symbol symbol gets the value 'undef'
1688 -U symbol= symbol gets completely empty
1690 -A : manipulate symbol after the platform specific hints have been applied:
1691 -A append:symbol=value append value to symbol
1692 -A symbol=value like append:, but with a separating space
1693 -A define:symbol=value define symbol to have value
1694 -A clear:symbol define symbol to be ''
1695 -A define:symbol define symbol to be 'define'
1696 -A eval:symbol=value define symbol to be eval of value
1697 -A prepend:symbol=value prepend value to symbol
1698 -A undef:symbol define symbol to be 'undef'
1699 -A undef:symbol= define symbol to be ''
1700 e.g.: -A prepend:libswanted='cl pthread '
1701 -A ccflags=-DSOME_MACRO
1702 -V : print version number and exit (with a zero status).
1709 case "$fastread$alldone" in
1712 case "$extractsh" in
1715 if test ! -t 0; then
1716 echo "Say 'sh Configure', not 'sh <Configure'"
1726 true) exec 1>/dev/null;;
1729 : run the defines and the undefines, if any, but leave the file out there...
1732 : create the posthint manipulation script and leave the file out there...
1737 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1738 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1739 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1740 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1741 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1744 : Some greps do not return status, grrr.
1745 echo "grimblepritz" >grimble
1746 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1748 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1754 : the following should work in any shell
1758 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1759 cat >contains <<'EOSS'
1760 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1765 : Find the path to the source tree
1768 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1772 *) src=`cd ../$src && pwd` ;;
1785 if test -f $rsrc/Configure && \
1786 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1788 : found it, so we are ok.
1791 for src in . .. ../.. ../../.. ../../../..; do
1792 if test -f ../$src/Configure && \
1793 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1804 Sorry, I can't seem to locate the source dir for $package. Please start
1805 Configure with an explicit path -- i.e. /some/path/Configure.
1813 echo "Sources for $package found in \"$src\"." >&4
1817 : script used to extract .SH files with variable substitutions
1818 cat >extract <<'EOS'
1820 echo "Doing variable substitutions on .SH files..."
1821 if test -f MANIFEST; then
1822 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1824 echo "(Looking for .SH files under the source directory.)"
1825 set x `(cd "$src"; find . -name "*.SH" -print)`
1829 0) set x `(cd "$src"; echo *.SH)`; shift;;
1831 if test ! -f "$src/$1"; then
1837 while test $name; do
1838 if test ! -d "$name"; then
1839 create="$name $create";
1840 name=`echo $name | sed -e "s|^[^/]*$||"`;
1841 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1846 for file in $create; do
1855 dir=`expr X$file : 'X\(.*\)/'`
1856 file=`expr X$file : 'X.*/\(.*\)'`
1857 (cd "$dir" && . ./$file)
1867 dir=`expr X$file : 'X\(.*\)/'`
1868 file=`expr X$file : 'X.*/\(.*\)'`
1869 (set x $dir; shift; eval $mkdir_p)
1870 sh <"$src/$dir/$file"
1879 if test -f "$src/config_h.SH"; then
1880 if test ! -f config.h; then
1881 : oops, they left it out of MANIFEST, probably, so do it anyway.
1882 . "$src/config_h.SH"
1887 : extract files and exit if asked to do so
1888 case "$extractsh" in
1890 case "$realsilent" in
1894 case "$config_sh" in
1895 '') config_sh='config.sh';;
1898 echo "Fetching answers from $config_sh..."
1901 test "$override" && . ./optdef.sh
1905 echo "Extraction done."
1910 : Eunice requires " " instead of "", can you believe it
1913 echo "Beginning of configuration questions for $package."
1915 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1917 : first determine how to suppress newline on echo command
1919 echo "Checking echo to see how to suppress newlines..."
1920 (echo "hi there\c" ; echo " ") >.echotmp
1921 if $contains c .echotmp >/dev/null 2>&1 ; then
1932 echo $n "The star should be here-->$c"
1936 : Now test for existence of everything in MANIFEST
1938 if test -f "$rsrc/MANIFEST"; then
1939 echo "First let's make sure your kit is complete. Checking..." >&4
1940 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | (split -l 50 2>/dev/null || split -50)
1943 for filelist in x??; do
1944 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` >/dev/null 2>>"$tmppwd/missing")
1946 if test -s missing; then
1950 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1952 You have the option of continuing the configuration process, despite the
1953 distinct possibility that your kit is damaged, by typing 'y'es. If you
1954 do, don't blame me if something goes wrong. I advise you to type 'n'o
1955 and contact the author (perlbug@perl.org).
1958 echo $n "Continue? [n] $c" >&4
1962 echo "Continuing..." >&4
1966 echo "ABORTING..." >&4
1971 echo "Looks good..."
1974 echo "There is no MANIFEST file. I hope your kit is complete !"
1979 : Find the appropriate value for a newline for tr
1980 if test -n "$DJGPP"; then
1983 if test X"$trnl" = X; then
1984 case "`echo foo|tr '\n' x 2>/dev/null`" in
1988 if test X"$trnl" = X; then
1989 case "`echo foo|tr '\012' x 2>/dev/null`" in
1990 foox) trnl='\012' ;;
1993 if test X"$trnl" = X; then
1994 case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
1995 fooxy) trnl='\n\r' ;;
1998 if test X"$trnl" = X; then
2001 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
2007 : compute the number of columns on the terminal for proper question formatting
2012 : set up the echo used in my read
2013 myecho="case \"\$xxxm\" in
2014 '') echo $n \"\$rp $c\" >&4;;
2016 '') echo $n \"[\$xxxm] $c\";;
2018 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
2020 echo $n \"[\$xxxm] $c\" >&4
2022 echo $n \"\$rp [\$xxxm] $c\" >&4
2028 : now set up to do reads with possible shell escape and default assignment
2034 case "\$fastread" in
2035 yes) case "\$dflt" in
2038 case "\$silent-\$rp" in
2043 *) case "\$silent" in
2044 true) case "\$rp" in
2049 while expr "X\$ans" : "X!" >/dev/null; do
2053 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2061 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2070 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2075 echo "(OK, I'll run with -d after this question.)" >&4
2078 echo "*** Sorry, \$1 not supported yet." >&4
2088 echo "*** Substitution done -- please confirm."
2090 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2095 echo "*** Error -- try again."
2102 case "\$ans\$xxxm\$nostick" in
2114 : create .config dir to save info across Configure sessions
2115 test -d ../.config || mkdir ../.config
2116 cat >../.config/README <<EOF
2117 This directory created by Configure to save information that should
2118 persist across sessions for $package.
2120 You may safely delete it if you wish.
2123 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2125 $define|true|[yY]*) ;;
2126 *) case "$xversion" in
2129 *** WHOA THERE!!! ***
2131 This is an UNSTABLE DEVELOPMENT release.
2132 The version of this $package distribution is $xversion, that is, odd,
2133 (as opposed to even) and that signifies a development release.
2134 If you want a maintenance release, you want an even-numbered version.
2136 Do ***NOT*** install this into production use.
2137 Data corruption and crashes are possible.
2139 It is most seriously suggested that you do not continue any further
2140 unless you want to help in developing and debugging Perl.
2142 If you *still* want to build perl, you can answer 'y' now,
2143 or pass -Dusedevel to Configure.
2146 rp='Do you really want to continue?'
2150 [yY]) echo >&4 "Okay, continuing."
2151 usedevel="$define" ;;
2152 *) echo >&4 "Okay, bye."
2162 case "$versiononly" in
2163 '') versiononly="$define" ;;
2165 case "$installusrbinperl" in
2166 '') installusrbinperl="$undef" ;;
2171 : general instructions
2174 user=`(logname) 2>/dev/null`
2176 '') user=`whoami 2>&1`;;
2178 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2181 rp='Would you like to see the instructions?'
2192 This installation shell script will examine your system and ask you questions
2193 to determine how the perl5 package should be installed. If you get
2194 stuck on a question, you may use a ! shell escape to start a subshell or
2195 execute a command. Many of the questions will have default answers in square
2196 brackets; typing carriage return will give you the default.
2198 On some of the questions which ask for file or directory names you are allowed
2199 to use the ~name construct to specify the login directory belonging to "name",
2200 even if you don't have a shell which knows about that. Questions where this is
2201 allowed will be marked "(~name ok)".
2205 dflt='Type carriage return to continue'
2209 The prompter used in this script allows you to use shell variables and
2210 backticks in your answers. You may use $1, $2, etc... to refer to the words
2211 in the default answer, as if the default line was a set of arguments given to a
2212 script shell. This means you may also use $* to repeat the whole default line,
2213 so you do not have to re-type everything to add something to the default.
2215 Everytime there is a substitution, you will have to confirm. If there is an
2216 error (e.g. an unmatched backtick), the default answer will remain unchanged
2217 and you will be prompted again.
2219 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2220 the questions and use the computed defaults (or the previous answers if there
2221 was already a config.sh file). Type 'Configure -h' for a list of options.
2222 You may also start interactively and then answer '& -d' at any prompt to turn
2223 on the non-interactive behaviour for the remainder of the execution.
2229 Much effort has been expended to ensure that this shell script will run on any
2230 Unix system. If despite that it blows up on yours, your best bet is to edit
2231 Configure and run it again. If you can't run Configure for some reason,
2232 you'll have to generate a config.sh file by hand. Whatever problems you
2233 have, let me (perlbug@perl.org) know how I blew it.
2235 This installation script affects things in two ways:
2237 1) it may do direct variable substitutions on some of the files included
2239 2) it builds a config.h file for inclusion in C programs. You may edit
2240 any of these files as the need arises after running this script.
2242 If you make a mistake on a question, there is no easy way to back up to it
2243 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2244 files. Configure will offer to let you do this before it runs the SH files.
2247 dflt='Type carriage return to continue'
2249 case "$firsttime" in
2250 true) echo $user >>../.config/instruct;;
2254 : find out where common programs are
2256 echo "Locating common programs..." >&4
2269 if test -d \$dir/\$thing; then
2275 for thisthing in \$dir/\$thing; do
2276 : just loop through to pick last item
2278 if test -f \$thisthing; then
2281 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2284 elif test -f \$dir/\$thing.exe; then
2285 if test -n "$DJGPP"; then
2286 echo \$dir/\$thing.exe
2287 elif test "$eunicefix" != ":"; then
2288 : on Eunice apparently
2342 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2343 pth="$pth /lib /usr/lib"
2344 for file in $loclist; do
2348 if test -f "$xxx"; then
2351 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2352 xxx=`./loc $file $file $pth`
2355 '') xxx=`./loc $file $file $pth`;;
2356 *) xxx=`./loc $xxx $xxx $pth`;;
2358 eval $file=$xxx$_exe
2362 echo $file is in $xxx.
2365 echo $file is in $xxx.
2368 echo "I don't know where '$file' is, and my life depends on it." >&4
2369 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2375 echo "Don't worry if any of the following aren't found..."
2377 for file in $trylist; do
2381 if test -f "$xxx"; then
2384 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2385 xxx=`./loc $file $file $pth`
2388 '') xxx=`./loc $file $file $pth`;;
2389 *) xxx=`./loc $xxx $xxx $pth`;;
2391 eval $file=$xxx$_exe
2395 echo $file is in $xxx.
2398 echo $file is in $xxx.
2401 echo "I don't see $file out there, $say."
2408 echo "Substituting grep for egrep."
2415 echo "Substituting cp for ln."
2424 echo "I can't find make or gmake, and my life depends on it." >&4
2425 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2433 *) # We can't have osname yet.
2434 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2435 # Assume that gmake, if found, is definitely GNU make
2436 # and prefer it over the system make.
2437 echo "Substituting gmake for make."
2445 echo "Hopefully test is built into your sh."
2448 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2449 echo "Using the test built into your sh."
2457 echo "Hopefully echo is built into your sh."
2462 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2463 $echo $n "hi there$c" >foo1
2464 echo $n "hi there$c" >foo2
2465 if cmp foo1 foo2 >/dev/null 2>&1; then
2466 echo "They are compatible. In fact, they may be identical."
2473 They are not compatible! You are probably running ksh on a non-USG system.
2474 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2475 have echo built in and we may have to run some Bourne shell scripts. That
2476 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2479 $echo $n "The star should be here-->$c"
2486 # This question was auctioned at YAPC::Europe-2007 in Vienna
2487 # I never promised you could answer it. I only auctioned the question.
2489 The following message is sponsored by
2491 Dresden.pm<--The stars should be here.
2493 Dear Perl user, system administrator or package
2494 maintainer, the Perl community sends greetings to
2495 you. Do you (emblematical) greet back [Y/n]? n
2502 cat <<'EOSC' >>trygcc
2507 int main(int argc, char *argv[]) {
2511 if $cc -o try $ccflags $ldflags try.c; then
2514 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2520 # Skip this test because it gives a false match on output like:
2521 # ./trygcc: line 23: cc: command not found
2522 # case "`$cc -v -c try.c 2>&1`" in
2523 # *gcc*) trygcc=no ;;
2525 if $test X"$trygcc" = Xyes; then
2526 if gcc -o try -c try.c; then
2528 echo "You seem to have a working gcc, though." >&4
2529 # Switching compilers may undo the work of hints files.
2530 # The most common problem is -D_REENTRANT for threads.
2531 # This heuristic catches that case, but gets false positives
2532 # if -Dusethreads was not actually specified. Better to
2533 # bail out here with a useful message than fail
2534 # mysteriously later. Should we perhaps just try to
2535 # re-invoke Configure -Dcc=gcc config_args ?
2536 if $test -f usethreads.cbu; then
2539 *** However, any setting of the C compiler flags (e.g. for thread support)
2540 *** will be lost. It may be necessary for you to restart Configure and
2541 *** add -Dcc=gcc to your Configure command line.
2544 rp="Would you like to go ahead and try gcc anyway?"
2547 rp="Would you like to use it?"
2550 if $test -f myread; then
2553 if $test -f UU/myread; then
2556 echo "Cannot find myread, sorry. Aborting." >&2
2561 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2574 cat <<'EOSC' >>checkcc
2579 int main(int argc, char *argv[]) {
2583 if $cc -o try $ccflags $ldflags try.c; then
2586 if $test X"$despair" = Xyes; then
2587 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2590 You need to find a working C compiler.
2591 Either (purchase and) install the C compiler supplied by your OS vendor,
2592 or for a free C compiler try http://gcc.gnu.org/
2593 I cannot continue any further, aborting.
2602 : determine whether symbolic links are supported
2605 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2606 echo "Symbolic links are supported." >&4
2609 echo "Symbolic links are NOT supported." >&4
2614 : determine whether symbolic links are supported
2618 echo "Checking how to test for symbolic links..." >&4
2620 if $test "X$issymlink" = X; then
2622 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2623 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2625 if test $? = 0; then
2628 echo "Your builtin 'test -h' may be broken." >&4
2631 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2634 if test -f "$p/$test"; then
2643 echo "Trying external '$test -h'." >&4
2644 issymlink="$test -h"
2645 if $test ! -h sym >/dev/null 2>&1; then
2646 echo "External '$test -h' is broken, too." >&4
2654 if $test "X$issymlink" = X; then
2655 if $test -L sym 2>/dev/null; then
2656 issymlink="$test -L"
2657 echo "The builtin '$test -L' worked." >&4
2660 if $test "X$issymlink" != X; then
2661 echo "You can test for symbolic links with '$issymlink'." >&4
2663 echo "I do not know how you can test for symbolic links." >&4
2667 *) echo "No symbolic links, so not testing for their testing..." >&4
2673 case "$mksymlinks" in
2676 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2679 *) case "$lns:$issymlink" in
2680 *"ln"*" -s:"*"test -"?)
2681 echo "Creating the symbolic links..." >&4
2682 echo "(First creating the subdirectories...)" >&4
2684 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2686 test -z "$directory" && break
2690 if test ! -d t/base; then
2691 echo "Failed to create the subdirectories. Aborting." >&4
2694 echo "(Then creating the symlinks...)" >&4
2695 awk '{print $1}' $src/MANIFEST | while true; do
2697 test -z "$filename" && break
2698 if test -f $filename; then
2699 if $issymlink $filename; then
2703 if test -f $filename; then
2704 echo "$filename already exists, not symlinking."
2706 ln -s $src/$filename $filename
2710 if test ! -f t/base/lex.t; then
2711 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2716 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2725 case "$usecrosscompile" in
2727 $echo "Cross-compiling..."
2730 *-*-gcc) # A cross-compiling gcc, probably.
2731 targetarch=`$echo $cc|$sed 's/-gcc$//'`
2733 # leave out ld, choosing it is more complex
2735 ranlib=$targetarch-ranlib
2736 $echo 'extern int foo;' > try.c
2737 set X `$cc -v -E try.c 2>&1 | $awk '/^#include </,/^End of search /'|$grep '/include'`
2739 if $test $# -gt 0; then
2741 incpth="`$echo $incpth|$sed 's/^ //'`"
2742 echo "Guessing incpth '$incpth'." >&4
2744 j="`$echo $i|$sed 's,/include$,/lib,'`"
2745 if $test -d $j; then
2749 libpth="`$echo $libpth|$sed 's/^ //'`"
2750 echo "Guessing libpth '$libpth'." >&4
2755 case "$targetarch" in
2756 '') echo "Targetarch not defined." >&4; croak=y ;;
2757 *) echo "Using targetarch $targetarch." >&4 ;;
2760 '') echo "Incpth not defined." >&4; croak=y ;;
2761 *) echo "Using incpth '$incpth'." >&4 ;;
2764 '') echo "Libpth not defined." >&4; croak=y ;;
2765 *) echo "Using libpth '$libpth'." >&4 ;;
2768 '') for i in $incpth; do
2769 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
2771 echo "Guessing usrinc $usrinc." >&4
2776 '') echo "Usrinc not defined." >&4; croak=y ;;
2779 *) echo "Using usrinc $usrinc." >&4 ;;
2781 case "$targethost" in
2782 '') echo "Targethost not defined." >&4; croak=y ;;
2783 *) echo "Using targethost $targethost." >&4
2788 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2791 /*) run=$src/Cross/run
2792 targetmkdir=$src/Cross/mkdir
2794 from=$src/Cross/from
2796 *) pwd=`$test -f ../Configure & cd ..; pwd`
2798 targetmkdir=$pwd/Cross/mkdir
2800 from=$pwd/Cross/from
2803 case "$targetrun" in
2804 '') targetrun=ssh ;;
2809 case "$targetfrom" in
2810 '') targetfrom=scp ;;
2814 from=$from-$targetfrom
2815 case "$targetdir" in
2817 echo "Guessing targetdir $targetdir." >&4
2820 case "$targetuser" in
2822 echo "Guessing targetuser $targetuser." >&4
2825 case "$targetfrom" in
2829 case "$targetrun" in
2841 '') cwd=$targetdir ;;
2845 if $test ! -f \$exe.xok; then
2849 $targetrun -l $targetuser $targethost "cd \$cwd && ./\$exe \$@"
2852 *) echo "Unknown targetrun '$targetrun'" >&4
2856 case "$targetmkdir" in
2858 cat >$targetmkdir <<EOF
2860 $targetrun -l $targetuser $targethost "mkdir -p \$@"
2862 $chmod a+rx $targetmkdir
2864 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
2876 $targetmkdir \`dirname \$f\`
2877 $targetto $q \$f $targetuser@$targethost:\$f || exit 1
2880 $targetmkdir $targetdir/\`dirname \$f\`
2881 $targetto $q \$f $targetuser@$targethost:$targetdir/\$f || exit 1
2894 $mkdir -p $targetdir/\`dirname \$f\`
2895 $cp \$f $targetdir/\$f || exit 1
2898 $targetmkdir $targetdir/\`dirname \$f\`
2899 $cp \$f $targetdir/\$f || exit 1
2906 *) echo "Unknown targetto '$targetto'" >&4
2910 case "$targetfrom" in
2917 $targetfrom $q $targetuser@$targethost:$targetdir/\$f . || exit 1
2922 cp) cat >$from <<EOF
2927 cp $targetdir/\$f . || exit 1
2932 *) echo "Unknown targetfrom '$targetfrom'" >&4
2936 if $test ! -f $run; then
2937 echo "Target 'run' script '$run' not found." >&4
2941 if $test ! -f $to; then
2942 echo "Target 'to' script '$to' not found." >&4
2946 if $test ! -f $from; then
2947 echo "Target 'from' script '$from' not found." >&4
2951 if $test ! -f $run -o ! -f $to -o ! -f $from; then
2955 Using '$run' for remote execution,
2956 and '$from' and '$to'
2957 for remote file transfer.
2963 usecrosscompile='undef'
2968 : see whether [:lower:] and [:upper:] are supported character classes
2970 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2972 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2976 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
2977 # (0xd9 and 0xe2), therefore that is a nice testing point.
2978 if test "X$up" = X -o "X$low" = X; then
2979 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
2985 if test "X$up" = X -o "X$low" = X; then
2986 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
2992 if test "X$up" = X -o "X$low" = X; then
2993 case "`echo RS | od -x 2>/dev/null`" in
2995 echo "Hey, this might be EBCDIC." >&4
2996 if test "X$up" = X -o "X$low" = X; then
2997 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2998 rs) up='[A-IJ-RS-Z]'
3003 if test "X$up" = X -o "X$low" = X; then
3004 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
3014 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
3016 echo "Using $up and $low to convert case." >&4
3019 echo "I don't know how to translate letters from upper to lower case." >&4
3020 echo "Your tr is not acting any way I know of." >&4
3024 : set up the translation script tr, must be called with ./tr of course
3028 '[A-Z][a-z]') exec $tr '$up' '$low';;
3029 '[a-z][A-Z]') exec $tr '$low' '$up';;
3036 : Try to determine whether config.sh was made on this system
3037 case "$config_sh" in
3039 myuname=`$uname -a 2>/dev/null`
3040 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
3041 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
3042 # because the A-Z/a-z are not consecutive.
3043 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e "s,['/],,g" | \
3044 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
3045 newmyuname="$myuname"
3047 case "$knowitall" in
3049 if test -f ../config.sh; then
3050 if $contains myuname= ../config.sh >/dev/null 2>&1; then
3051 eval "`grep myuname= ../config.sh`"
3053 if test "X$myuname" = "X$newmyuname"; then
3061 : Get old answers from old config file if Configure was run on the
3062 : same system, otherwise use the hints.
3065 if test -f config.sh; then
3067 rp="I see a config.sh file. Shall I use it to set the defaults?"
3070 n*|N*) echo "OK, I'll ignore it."
3071 mv config.sh config.sh.old
3072 myuname="$newmyuname"
3074 *) echo "Fetching default answers from your old config.sh file..." >&4
3082 : Older versions did not always set $sh. Catch re-use of such
3092 if test ! -f config.sh; then
3095 First time through, eh? I have some defaults handy for some systems
3096 that need some extra help getting the Configure answers right:
3099 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3101 : Half the following guesses are probably wrong... If you have better
3102 : tests or hints, please send them to perlbug@perl.org
3103 : The metaconfig authors would also appreciate a copy...
3104 $test -f /irix && osname=irix
3105 $test -f /xenix && osname=sco_xenix
3106 $test -f /dynix && osname=dynix
3107 $test -f /dnix && osname=dnix
3108 $test -f /lynx.os && osname=lynxos
3109 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3110 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3111 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3112 $test -f /bin/mips && /bin/mips && osname=mips
3113 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
3114 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
3115 $test -d /usr/apollo/bin && osname=apollo
3116 $test -f /etc/saf/_sactab && osname=svr4
3117 $test -d /usr/include/minix && osname=minix
3118 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3119 if $test -d /MachTen -o -d /MachTen_Folder; then
3121 if $test -x /sbin/version; then
3122 osvers=`/sbin/version | $awk '{print $2}' |
3123 $sed -e 's/[A-Za-z]$//'`
3124 elif $test -x /usr/etc/version; then
3125 osvers=`/usr/etc/version | $awk '{print $2}' |
3126 $sed -e 's/[A-Za-z]$//'`
3132 $test -f /sys/posix.dll &&
3133 $test -f /usr/bin/what &&
3134 set X `/usr/bin/what /sys/posix.dll` &&
3135 $test "$3" = UWIN &&
3139 if $test -f $uname; then
3147 umips) osname=umips ;;
3150 [23]100) osname=mips ;;
3151 next*) osname=next ;;
3153 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3154 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3157 elif $test -f /etc/kconfig; then
3159 if test "$lns" = "$ln -s"; then
3161 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3163 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3170 if test -n "$DJGPP"; then
3179 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3181 # oslevel can fail with:
3182 # oslevel: Unable to acquire lock.
3183 *not\ found) osvers="$4"."$3" ;;
3184 '<3240'|'<>3240') osvers=3.2.0 ;;
3185 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3186 '=3250'|'>3250') osvers=3.2.5 ;;
3190 bsd386) osname=bsd386
3193 cygwin*) osname=cygwin
3196 *dc.osx) osname=dcosx
3202 domainos) osname=apollo
3208 dragonfly) osname=dragonfly
3211 dynixptx*) osname=dynixptx
3212 osvers=`echo "$4"|sed 's/^v//'`
3214 freebsd) osname=freebsd
3216 genix) osname=genix ;;
3220 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3236 netbsd*) osname=netbsd
3239 news-os) osvers="$3"
3241 4*) osname=newsos4 ;;
3245 next*) osname=next ;;
3246 nonstop-ux) osname=nonstopux ;;
3247 openbsd) osname=openbsd
3253 POSIX-BC | posix-bc ) osname=posix-bc
3256 powerux | power_ux | powermax_os | powermaxos | \
3257 powerunix | power_unix) osname=powerux
3263 solaris) osname=solaris
3265 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3272 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3276 titanos) osname=titanos
3285 ultrix) osname=ultrix
3288 osf1|mls+) case "$5" in
3291 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3294 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3297 hp*) osname=hp_osf1 ;;
3298 mips) osname=mips_osf1 ;;
3301 # UnixWare 7.1.2 is known as Open UNIX 8
3302 openunix|unixware) osname=svr5
3310 $2) case "$osname" in
3314 : svr4.x or possibly later
3324 if test -f /stand/boot ; then
3325 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3326 if test -n "$INITPROG" -a -f "$INITPROG"; then
3327 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3328 if test -n "$isesix"; then
3336 *) if test -f /etc/systemid; then
3338 set `echo $3 | $sed 's/\./ /g'` $4
3339 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3341 elif $test -f $src/hints/sco_$1_$2.sh; then
3343 elif $test -f $src/hints/sco_$1.sh; then
3348 '') : Still unknown. Probably a generic Sys V.
3357 *) case "$osname" in
3358 '') : Still unknown. Probably a generic BSD.
3366 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3367 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3368 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3371 $rm -f UU/kernel.what
3372 elif test -d c:/. -o -n "$is_os2" ; then
3379 case "$targetarch" in
3382 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3387 : Now look for a hint file osname_osvers, unless one has been
3388 : specified already.
3391 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3392 : Also try without trailing minor version numbers.
3393 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3394 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3395 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3396 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3399 *) case "$osvers" in
3402 *) if $test -f $src/hints/$file.sh ; then
3404 elif $test -f $src/hints/$xfile.sh ; then
3406 elif $test -f $src/hints/$xxfile.sh ; then
3408 elif $test -f $src/hints/$xxxfile.sh ; then
3410 elif $test -f $src/hints/$xxxxfile.sh ; then
3412 elif $test -f "$src/hints/${osname}.sh" ; then
3421 if $test -f Policy.sh ; then
3424 none) dflt="Policy" ;;
3425 *) dflt="Policy $dflt" ;;
3430 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3434 if $test -f Policy.sh ; then
3437 There's also a Policy hint file available, which should make the
3438 site-specific (policy) questions easier to answer.
3445 You may give one or more space-separated answers, or "none" if appropriate.
3446 If you have a handcrafted Policy.sh file or a Policy.sh file generated by a
3447 previous run of Configure, you may specify it as well as or instead of
3448 OS-specific hints. If hints are provided for your OS, you should use them:
3449 although Perl can probably be built without hints on many platforms, using
3450 hints often improve performance and may enable features that Configure can't
3451 set up on its own. If there are no hints that match your OS, specify "none";
3452 DO NOT give a wrong version or a wrong OS.
3456 rp="Which of these apply, if any?"
3459 for file in $tans; do
3460 if $test X$file = XPolicy -a -f Policy.sh; then
3462 $cat Policy.sh >> UU/config.sh
3463 elif $test -f $src/hints/$file.sh; then
3464 . $src/hints/$file.sh
3465 $cat $src/hints/$file.sh >> UU/config.sh
3466 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3469 : Give one chance to correct a possible typo.
3470 echo "$file.sh does not exist"
3472 rp="hint to use instead?"
3474 for file in $ans; do
3475 if $test -f "$src/hints/$file.sh"; then
3476 . $src/hints/$file.sh
3477 $cat $src/hints/$file.sh >> UU/config.sh
3478 elif $test X$ans = X -o X$ans = Xnone ; then
3481 echo "$file.sh does not exist -- ignored."
3488 : Remember our hint file for later.
3489 if $test -f "$src/hints/$file.sh" ; then
3499 echo "Fetching default answers from $config_sh..." >&4
3503 cp $config_sh config.sh 2>/dev/null
3513 test "$override" && . ./optdef.sh
3515 : Restore computed paths
3516 for file in $loclist $trylist; do
3517 eval $file="\$_$file"
3522 Configure uses the operating system name and version to set some defaults.
3523 The default value is probably right if the name rings a bell. Otherwise,
3524 since spelling matters for me, either accept the default or answer "none"
3531 ''|' '|none) dflt=none ;;
3532 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3535 *) dflt="$osname" ;;
3537 rp="Operating system name?"
3541 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3547 ''|' '|none) dflt=none ;;
3548 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3549 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3551 ''|' ') dflt=none ;;
3556 *) dflt="$osvers" ;;
3558 rp="Operating system version?"
3568 : who configured the system
3569 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3572 cf_by=`(logname) 2>/dev/null`
3575 cf_by=`(whoami) 2>/dev/null`
3577 "") cf_by=unknown ;;
3582 : decide how portable to be. Allow command line overrides.
3583 case "$d_portable" in
3585 *) d_portable="$define" ;;
3588 : set up shell script to do ~ expansion
3594 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3597 if $test -f /bin/csh; then
3598 /bin/csh -f -c "glob \$1"
3603 name=\`$expr x\$1 : '..\([^/]*\)'\`
3604 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3605 if $test ! -d "\$dir"; then
3607 echo "\$me: can't locate home directory for: \$name" >&2
3612 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3628 : now set up to get a file name
3632 cat <<'EOSC' >>getfile
3648 : getfile will accept an answer from the comma-separated list
3649 : enclosed in parentheses even if it does not meet other criteria.
3650 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3651 fn=`echo $fn | sed 's/(.*)//'`
3657 loc_file=`expr $fn : '.*:\(.*\)'`
3658 fn=`expr $fn : '\(.*\):.*'`
3666 */*) fullpath=true;;
3675 *e*) exp_file=true;;
3678 *p*) nopath_ok=true;;
3683 *d*) type='Directory';;
3684 *l*) type='Locate';;
3689 Locate) what='File';;
3694 case "$d_portable" in
3702 while test "$type"; do
3707 true) rp="$rp (~name ok)";;
3710 if test -f UU/getfile.ok && \
3711 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3730 value=`UU/filexp $ans`
3733 if test "$ans" != "$value"; then
3734 echo "(That expands to $value on this system.)"
3748 /*) value="$ansexp" ;;
3749 [a-zA-Z]:/*) value="$ansexp" ;;
3754 echo "I shall only accept a full path name, as in /bin/ls." >&4
3755 echo "Use a ! shell escape if you wish to check pathnames." >&4
3758 echo "Please give a full path name, starting with slash." >&4
3761 echo "Note that using ~name is ok provided it expands well." >&4
3774 for fp in $gfpth; do
3775 if test "X$fp" = X.; then
3780 if test -f "$pf"; then
3782 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3784 echo "($value is not a plain file, but that's ok.)"
3787 if test X"$type" = X; then
3794 for fp in $gfpth; do
3795 if test "X$fp" = X.; then
3800 direxp="$fp/$ansexp"
3802 if test -d "$direxp"; then
3810 if test -d "$ansexp"; then
3811 echo "(Looking for $loc_file in directory $value.)"
3812 value="$value/$loc_file"
3813 ansexp="$ansexp/$loc_file"
3815 if test -f "$ansexp"; then
3818 case "$nopath_ok" in
3819 true) case "$value" in
3821 *) echo "Assuming $value will be in people's path."
3837 if test "$fastread" = yes; then
3842 rp="$what $value doesn't exist. Use that name anyway?"
3861 test "X$gfpthkeep" != Xy && gfpth=""
3864 : determine root of directory hierarchy where package will be installed.
3867 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
3870 dflt=`echo "$prefix" | sed 's/.$//'`
3878 By default, $package will be installed in $dflt/bin, manual pages
3879 under $dflt/man, etc..., i.e. with $dflt as prefix for all
3880 installation directories. Typically this is something like /usr/local.
3881 If you wish to have binaries under /usr/bin but other parts of the
3882 installation under /usr/local, that's ok: you will be prompted
3883 separately for each of the installation directories, the prefix being
3884 only used to set the defaults.
3888 rp='Installation prefix to use?'
3896 *) oldprefix="$prefix";;
3905 *) afsroot=$afsroot ;;
3911 $define|true) afs=true ;;
3912 $undef|false) afs=false ;;
3913 *) if test -d $afsroot; then
3921 echo "AFS may be running... I'll be extra cautious then..." >&4
3923 echo "AFS does not seem to be running..." >&4
3926 : determine installation prefix for where package is to be installed.
3930 Since you are running AFS, I need to distinguish the directory in which
3931 files will reside from the directory in which they are installed (and from
3932 which they are presumably copied to the former directory by occult means).
3935 case "$installprefix" in
3936 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
3937 *) dflt="$installprefix";;
3942 In some special cases, particularly when building $package for distribution,
3943 it is convenient to distinguish the directory in which files should be
3944 installed from the directory ($prefix) in which they will
3945 eventually reside. For most users, these two directories are the same.
3948 case "$installprefix" in
3950 *) dflt=$installprefix;;
3954 rp='What installation prefix should I use for installing files?'
3956 installprefix="$ans"
3957 installprefixexp="$ansexp"
3959 : Perform the prefixexp/installprefixexp correction if necessary
3960 cat <<EOS >installprefix
3963 cat <<'EOSC' >>installprefix
3964 : Change installation prefix, if necessary.
3965 if $test X"$prefix" != X"$installprefix"; then
3966 eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`"
3968 eval "install${prefixvar}=\"\$${prefixvar}exp\""
3971 chmod +x installprefix
3972 $eunicefix installprefix
3974 : Set variables such as privlib and privlibexp from the output of ./getfile
3975 : performing the prefixexp/installprefixexp correction if necessary.
3976 cat <<EOS >setprefixvar
3979 cat <<'EOSC' >>setprefixvar
3980 eval "${prefixvar}=\"\$ans\""
3981 eval "${prefixvar}exp=\"\$ansexp\""
3984 chmod +x setprefixvar
3985 $eunicefix setprefixvar
3987 : set up the script used to warn in case of inconsistency
3996 '') echo "The $hint value for \$$var on this machine was \"$was\"!" >&4
3998 *) echo "Hmm. Based on the hints in hints/$hintfile.sh, " >&4
3999 echo "the $hint value for \$$var on this machine was \"$was\"!" >&4
4004 echo "*** WHOA THERE!!! ***" >&4
4005 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
4008 rp=" Keep the $hint value?"
4011 y) td=$was; tu=$was;;
4015 : function used to set $1 to $val
4016 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
4018 $define$undef) . ./whoa; eval "$var=\$td";;
4019 $undef$define) . ./whoa; eval "$var=\$tu";;
4020 *) eval "$var=$val";;
4024 $define|true|[yY]*) dflt='y';;
4029 Perl can be built to use the SOCKS proxy protocol library. To do so,
4030 Configure must be run with -Dusesocks. If you use SOCKS you also need
4031 to use the PerlIO abstraction layer, this will be implicitly selected.
4033 If this doesn't make any sense to you, just accept the default '$dflt'.
4035 rp='Build Perl for SOCKS?'
4038 y|Y) val="$define" ;;
4045 $define|true|[yY]*) useperlio="$define";;
4048 case "$useperlio" in
4049 $define|true|[yY]*|'') dflt='y';;
4054 Previous version of $package used the standard IO mechanisms as
4055 defined in <stdio.h>. Versions 5.003_02 and later of $package allow
4056 alternate IO mechanisms via the PerlIO abstraction layer, but the
4057 stdio mechanism is still available if needed. The abstraction layer
4058 can use AT&T's sfio (if you already have sfio installed) or regular stdio.
4059 Using PerlIO with sfio may cause problems with some extension modules.
4061 If this doesn't make any sense to you, just accept the default '$dflt'.
4063 rp='Use the PerlIO abstraction layer?'
4070 echo "Ok, doing things the stdio way."
4079 case "$useperlio" in
4080 $define|true|[yY]*) ;;
4083 You are using the SOCKS proxy protocol library which means that you
4084 should also use the PerlIO layer. You may be headed for trouble.
4093 : get the patchlevel
4095 echo "Getting the current patchlevel..." >&4
4096 if $test -r $rsrc/patchlevel.h;then
4097 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
4098 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
4099 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4100 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
4101 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
4102 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4103 perl_patchlevel=`egrep ',"(MAINT|SMOKE)[0-9][0-9]*"' $rsrc/patchlevel.h|tail -1|sed 's/[^0-9]//g'`
4112 $echo "(You do not have patchlevel.h. Eek.)"
4114 if $test -r $rsrc/.patch ; then
4115 if $test "X$perl_patchlevel" = "X" || $test "`cat $rsrc/.patch`" -gt "$perl_patchlevel" ; then
4116 perl_patchlevel=`cat $rsrc/.patch`
4119 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
4120 version_patchlevel_string="version $patchlevel subversion $subversion"
4121 case "$perl_patchlevel" in
4123 *) version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel" ;;
4126 $echo "(You have $package $version_patchlevel_string.)"
4130 : XXX Should be a Configure test for double-dots in filenames.
4131 version=`echo $revision $patchlevel $subversion | \
4132 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4133 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4134 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4137 version=`echo $revision $patchlevel $subversion | \
4138 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4139 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4140 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4143 : Special case the 5.005_xx maintenance series, which used 5.005
4144 : without any subversion label as a subdirectory in $sitelib
4145 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
4146 api_versionstring='5.005'
4149 case "$usethreads" in
4150 $define|true|[yY]*) dflt='y';;
4151 *) # Catch case where user specified ithreads or 5005threads but
4152 # forgot -Dusethreads (A.D. 4/2002)
4153 case "$useithreads$use5005threads" in
4155 case "$useperlio" in
4156 "$define") dflt='y' ;;
4166 Perl can be built to take advantage of threads on some systems.
4167 To do so, Configure can be run with -Dusethreads.
4169 Note that Perl built with threading support runs slightly slower
4170 and uses more memory than plain Perl. The current implementation
4171 is believed to be stable, but it is fairly new, and so should be
4172 treated with caution.
4174 If this doesn't make any sense to you, just accept the default '$dflt'.
4176 rp='Build a threading Perl?'
4179 y|Y) val="$define" ;;
4185 if $test $patchlevel -lt 9; then
4186 case "$usethreads" in
4190 Since release 5.6, Perl has had two different threading implementations,
4191 the newer interpreter-based version (ithreads) with one interpreter per
4192 thread, and the older 5.005 version (5005threads).
4193 The 5005threads version is effectively unmaintained and will probably be
4194 removed in Perl 5.10, so there should be no need to build a Perl using it
4195 unless needed for backwards compatibility with some existing 5.005threads
4199 : Default to ithreads unless overridden on command line or with
4202 case "$use5005threads" in
4203 $define|true|[yY]*) dflt='n';;
4205 case "$useithreads" in
4206 $undef|false|[nN]*) dflt='n';;
4208 rp='Use the newer interpreter-based ithreads?'
4211 y|Y) val="$define" ;;
4216 : Now set use5005threads to the opposite value.
4217 case "$useithreads" in
4218 $define) val="$undef" ;;
4225 useithreads="$undef"
4226 use5005threads="$undef"
4230 case "$useithreads$use5005threads" in
4234 You cannot have both the ithreads and the 5.005 threads enabled
4235 at the same time. Disabling the 5.005 threads since they are
4236 much less stable than the ithreads.
4239 use5005threads="$undef"
4244 : perl-5.9.x and later
4246 if test X"$usethreads" = "X$define"; then
4247 case "$use5005threads" in
4251 5.005 threads has been removed for 5.10. Perl will be built using ithreads.
4258 use5005threads="$undef"
4259 useithreads="$usethreads"
4262 if test X"$usethreads" = "X$define" -a "X$useperlio" = "Xundef"; then
4265 *** To build with ithreads you must also use the PerlIO layer.
4266 *** Cannot continue, aborting.
4272 case "$d_oldpthreads" in
4273 '') : Configure tests would be welcome here. For now, assume undef.
4275 *) val="$d_oldpthreads" ;;
4281 : Look for a hint-file generated 'call-back-unit'. If the
4282 : user has specified that a threading perl is to be built,
4283 : we may need to set or change some other defaults.
4284 if $test -f usethreads.cbu; then
4285 echo "Your platform has some specific hints regarding threaded builds, using them..."
4288 case "$usethreads" in
4289 "$define"|true|[yY]*)
4291 (Your platform does not have any specific hints for threaded builds.
4292 Assuming POSIX threads, then.)
4300 Perl can be built so that multiple Perl interpreters can coexist
4301 within the same Perl executable.
4304 case "$useithreads" in
4307 This multiple interpreter support is required for interpreter-based threads.
4311 *) case "$usemultiplicity" in
4312 $define|true|[yY]*) dflt='y';;
4316 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
4317 rp='Build Perl for multiplicity?'
4320 y|Y) val="$define" ;;
4329 case "$usemorebits" in
4330 "$define"|true|[yY]*)
4331 use64bitint="$define"
4332 uselongdouble="$define"
4333 usemorebits="$define"
4335 *) usemorebits="$undef"
4339 : make some quick guesses about what we are up against
4341 $echo $n "Hmm... $c"
4351 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
4352 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
4354 echo "Looks kind of like an OSF/1 system, but we'll see..."
4356 elif test `echo abc | $tr a-z A-Z` = Abc ; then
4357 xxx=`./loc addbib blurfl $pth`
4358 if $test -f $xxx; then
4359 echo "Looks kind of like a USG system with BSD features, but we'll see..."
4363 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
4364 echo "Looks kind of like an extended USG system, but we'll see..."
4366 echo "Looks kind of like a USG system, but we'll see..."
4370 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
4371 echo "Looks kind of like a BSD system, but we'll see..."
4375 echo "Looks kind of like a Version 7 system, but we'll see..."
4378 case "$eunicefix" in
4381 There is, however, a strange, musty smell in the air that reminds me of
4382 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
4386 : it so happens the Eunice I know will not run shell scripts in Unix format
4390 echo "Congratulations. You aren't running Eunice."
4394 : Detect OS2. The p_ variable is set above in the Head.U unit.
4395 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
4396 : semicolon as a patch separator
4401 I have the feeling something is not exactly right, however...don't tell me...
4402 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
4403 (Or you may be running DOS with DJGPP.)
4408 if test -f /xenix; then
4409 echo "Actually, this looks more like a XENIX system..."
4414 echo "It's not Xenix..."
4419 if test -f /venix; then
4420 echo "Actually, this looks more like a VENIX system..."
4427 echo "Nor is it Venix..."
4430 chmod +x bsd usg v7 osf1 eunice xenix venix os2
4431 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
4438 rp="Use which C compiler?"
4442 : See if they have not cc but they do have gcc
4444 : Look for a hint-file generated 'call-back-unit'. Now that the
4445 : user has specified the compiler, we may need to set or change some
4447 if $test -f cc.cbu; then
4453 echo "Checking for GNU cc in disguise and/or its version number..." >&4
4457 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
4459 printf("%s\n", __VERSION__);
4461 printf("%s\n", "1");
4467 if $cc -o try $ccflags $ldflags try.c; then
4468 gccversion=`$run ./try`
4469 case "$gccversion" in
4470 '') echo "You are not using GNU cc." ;;
4471 *) echo "You are using GNU cc $gccversion."
4477 echo "*** WHOA THERE!!! ***" >&4
4478 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
4479 case "$knowitall" in
4481 echo " You'd better start hunting for one and let me know about it." >&4
4487 case "$gccversion" in
4488 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
4490 case "$gccversion" in
4491 '') gccosandvers='' ;;
4492 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
4493 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
4495 case "$gccosandvers" in
4496 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
4497 $osname$osvers) ;; # looking good
4498 $osname*) cat <<EOM >&4
4500 *** WHOA THERE!!! ***
4502 Your gcc has not been compiled for the exact release of
4503 your operating system ($gccosandvers versus $osname$osvers).
4505 In general it is a good idea to keep gcc synchronized with
4506 the operating system because otherwise serious problems
4507 may ensue when trying to compile software, like Perl.
4509 I'm trying to be optimistic here, though, and will continue.
4510 If later during the configuration and build icky compilation
4511 problems appear (headerfile conflicts being the most common
4512 manifestation), I suggest reinstalling the gcc to match
4513 your operating system release.
4517 *) gccosandvers='' ;; # failed to parse, better be silent
4525 # gcc 3.* complain about adding -Idirectories that they already know about,
4526 # so we will take those off from locincpth.
4527 case "$gccversion" in
4529 echo "main(){}">try.c
4530 for incdir in $locincpth; do
4531 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
4532 grep '^c[cp]p*[01]: warning: changing search order '`
4533 if test "X$warn" != X; then
4534 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
4540 : What should the include directory be ?
4542 $echo $n "Hmm... $c"
4546 if $test -f /bin/mips && /bin/mips; then
4547 echo "Looks like a MIPS system..."
4548 $cat >usr.c <<'EOCP'
4549 #ifdef SYSTYPE_BSD43
4553 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4554 dflt='/bsd43/usr/include'
4558 mips_type='System V'
4560 $rm -f usr.c usr.out
4561 echo "and you're compiling with the $mips_type compiler and libraries."
4565 echo "Doesn't look like a MIPS system."
4575 case "$xxx_prompt" in
4578 rp='Where are the include files you want to use?'
4586 : see how we invoke the C preprocessor
4588 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4589 cat <<'EOT' >testcpp.c
4595 if test ! -f cppstdin; then
4596 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4597 # AIX cc -E doesn't show the absolute headerfile
4598 # locations but we'll cheat by using the -M flag.
4599 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
4601 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4604 echo "Keeping your $hint cppstdin wrapper."
4607 wrapper=`pwd`/cppstdin
4611 if $test "X$cppstdin" != "X" && \
4612 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4613 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4615 echo "You used to use $cppstdin $cppminus so we'll use that again."
4617 '') echo "But let's see if we can live without a wrapper..." ;;
4619 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4620 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4622 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4625 echo "(However, $cpprun $cpplast does not work, let's see...)"
4633 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4640 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4641 $cc -E <testcpp.c >testcpp.out 2>&1; \
4642 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4643 echo "Yup, it does."
4646 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4647 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4648 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4649 echo "Yup, it does."
4652 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4653 $cc -P <testcpp.c >testcpp.out 2>&1; \
4654 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4655 echo "Yipee, that works!"
4658 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4659 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4660 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4661 echo "At long last!"
4664 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4665 $cpp <testcpp.c >testcpp.out 2>&1; \
4666 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4670 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4671 $cpp - <testcpp.c >testcpp.out 2>&1; \
4672 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4673 echo "Hooray, it works! I was beginning to wonder."
4676 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4677 $wrapper <testcpp.c >testcpp.out 2>&1; \
4678 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4684 rp="No dice. I can't find a C preprocessor. Name one:"
4688 $x_cpp <testcpp.c >testcpp.out 2>&1
4689 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4690 echo "OK, that will do." >&4
4692 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4707 echo "Perhaps can we force $cc -E using a wrapper..."
4708 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4709 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4715 echo "Nope, we'll have to live without it..."
4729 "$wrapper"|'cppstdin') ;;
4730 *) $rm -f $wrapper;;
4732 $rm -f testcpp.c testcpp.out
4734 : Set private lib path
4737 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4742 '') dlist="$loclibpth $plibpth $glibpth";;
4743 *) dlist="$libpth";;
4746 : Now check and see which directories actually exist, avoiding duplicates
4750 if $test -d $xxx; then
4753 *) libpth="$libpth $xxx";;
4759 Some systems have incompatible or broken versions of libraries. Among
4760 the directories listed in the question below, please remove any you
4761 know not to be holding relevant libraries, and add any that are needed.
4762 Say "none" for none.
4773 rp="Directories to use for library searches?"
4780 : compute shared library extension
4783 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4793 On some systems, shared libraries may be available. Answer 'none' if
4794 you want to suppress searching of shared libraries for the remainder
4795 of this configuration.
4798 rp='What is the file extension used for shared libraries?'
4802 : Define several unixisms.
4803 : Hints files or command line option can be used to override them.
4804 : The convoluted testing is in case hints files set either the old
4807 '') case "$exe_ext" in
4809 *) _exe="$exe_ext" ;;
4814 '') case "$lib_ext" in
4821 '') case "$obj_ext" in
4828 '') case "$path_sep" in
4839 rm_try="$rm -f try try$_exe a.out .out try.[cho] try.$_o core core.try* try.core*"
4841 : Which makefile gets called first. This is used by make depend.
4842 case "$firstmakefile" in
4843 '') firstmakefile='makefile';;
4847 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
4850 case "$uselongdouble" in
4851 $define|true|[yY]*) dflt='y';;
4856 Perl can be built to take advantage of long doubles which
4857 (if available) may give more accuracy and range for floating point numbers.
4859 If this doesn't make any sense to you, just accept the default '$dflt'.
4861 rp='Try to use long doubles if available?'
4864 y|Y) val="$define" ;;
4870 case "$uselongdouble" in
4871 true|[yY]*) uselongdouble="$define" ;;
4874 : Look for a hint-file generated 'call-back-unit'. If the
4875 : user has specified that long doubles should be used,
4876 : we may need to set or change some other defaults.
4877 if $test -f uselongdouble.cbu; then
4878 echo "Your platform has some specific hints regarding long doubles, using them..."
4879 . ./uselongdouble.cbu
4881 case "$uselongdouble" in
4884 (Your platform does not have any specific hints for long doubles.)
4890 : Looking for optional libraries
4892 echo "Checking for optional libraries..." >&4
4897 case "$libswanted" in
4898 '') libswanted='c_s';;
4901 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
4907 for thisdir in $libpth $xlibpth; do
4908 test -d $thisdir && libspath="$libspath $thisdir"
4910 for thislib in $libswanted; do
4911 for thisdir in $libspath; do
4913 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4914 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
4915 $test -f "$xxx" && eval $libscheck
4916 $test -f "$xxx" && libstyle=shared
4918 if test ! -f "$xxx"; then
4919 xxx=$thisdir/lib$thislib.$so
4920 $test -f "$xxx" && eval $libscheck
4921 $test -f "$xxx" && libstyle=shared
4923 if test ! -f "$xxx"; then
4924 xxx=$thisdir/lib$thislib$_a
4925 $test -f "$xxx" && eval $libscheck
4926 $test -f "$xxx" && libstyle=static
4928 if test ! -f "$xxx"; then
4929 xxx=$thisdir/$thislib$_a
4930 $test -f "$xxx" && eval $libscheck
4931 $test -f "$xxx" && libstyle=static
4933 if test ! -f "$xxx"; then
4934 xxx=$thisdir/lib${thislib}_s$_a
4935 $test -f "$xxx" && eval $libscheck
4936 $test -f "$xxx" && libstyle=static
4937 $test -f "$xxx" && thislib=${thislib}_s
4939 if test ! -f "$xxx"; then
4940 xxx=$thisdir/Slib$thislib$_a
4941 $test -f "$xxx" && eval $libscheck
4942 $test -f "$xxx" && libstyle=static
4944 if $test -f "$xxx"; then
4946 shared) echo "Found -l$thislib (shared)." ;;
4947 static) echo "Found -l$thislib." ;;
4948 *) echo "Found -l$thislib ($libstyle)." ;;
4952 *) dflt="$dflt -l$thislib"
4953 libsfound="$libsfound $xxx"
4955 libsfiles="$libsfiles $yyy"
4956 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
4957 case " $libsdirs " in
4959 *) libsdirs="$libsdirs $yyy" ;;
4966 if $test ! -f "$xxx"; then
4967 echo "No -l$thislib."
4978 ' '|'') dflt='none';;
4983 In order to compile $package on your machine, a number of libraries
4984 are usually needed. Include any other special libraries here as well.
4985 Say "none" for none. The default list is almost always right.
4989 rp="What libraries to use?"
4996 : determine optimization, if desired, or use for debug flag also
4998 ' '|$undef) dflt='none';;
5000 *) dflt="$optimize";;
5004 By default, $package compiles with the -O flag to use the optimizer.
5005 Alternately, you might want to use the symbolic debugger, which uses
5006 the -g flag (on traditional Unix systems). Either flag can be
5007 specified here. To use neither flag, specify the word "none".
5010 rp="What optimizer/debugger flag should be used?"
5014 'none') optimize=" ";;
5017 : Check what DEBUGGING is required from the command line
5018 : -DEBUGGING or -DDEBUGGING or
5019 : -DEBUGGING=both = -g + -DDEBUGGING
5020 : -DEBUGGING=-g or -Doptimize=-g = -g
5021 : -DEBUGGING=none or -UDEBUGGING =
5022 : -DEBUGGING=old or -DEBUGGING=default = ? $optimize
5025 *) DEBUGGING=$EBUGGING ;;
5028 case "$DEBUGGING" in
5032 *) optimize="$optimize -g" ;;
5036 *-g*) set `echo "X $optimize " | sed 's/ -g / /'`
5044 case "$DEBUGGING" in
5045 both|$define) dflt='-DDEBUGGING'
5048 : argument order is deliberate, as the flag will start with - which set could
5049 : think is an option
5050 checkccflag='check=$1; flag=$2;
5052 echo "Checking if your compiler accepts $flag" 2>&1;
5053 echo "int main(void) { return 0; }" > gcctest.c;
5054 if $cc -O2 $flag -o gcctest gcctest.c; then
5055 echo "Yes, it does." 2>&1;
5058 echo "Leaving current flags $ccflags alone." 2>&1
5060 *) dflt="$dflt $flag" ;;
5063 echo "Nope, it does not, but that is ok." 2>&1;
5067 : We will not override a previous value, but we might want to
5068 : augment a hint file
5070 default|recommended)
5071 case "$gccversion" in
5072 1*) dflt="$dflt -fpcc-struct-return" ;;
5074 case "$optimize:$DEBUGGING" in
5075 *-g*:old) dflt="$dflt -DDEBUGGING";;
5077 case "$gccversion" in
5078 2*) if test -d /etc/conf/kconfig.d &&
5079 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
5081 # Interactive Systems (ISC) POSIX mode.
5086 case "$gccversion" in
5089 ?*) set strict-aliasing -fno-strict-aliasing
5093 # For gcc, adding -pipe speeds up compilations for some, but apparently
5094 # some assemblers can't read from stdin. (It also slows down compilations
5095 # in other cases, but those are apparently rarer these days.) AD 5/2004.
5096 case "$gccversion" in
5104 case "$mips_type" in
5105 *BSD*|'') inclwanted="$locincpth $usrinc";;
5106 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
5108 for thisincl in $inclwanted; do
5109 if $test -d $thisincl; then
5110 if $test x$thisincl != x$usrinc; then
5112 *" -I$thisincl "*);;
5113 *) dflt="$dflt -I$thisincl ";;
5119 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
5121 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
5129 *) dflt="$dflt -D$2";;
5133 set signal.h LANGUAGE_C; eval $inctest
5137 ccflags="$ccflags -DSOCKS"
5142 default|recommended) dflt="$ccflags $dflt" ;;
5143 *) dflt="$ccflags";;
5152 Your C compiler may want other flags. For this question you should include
5153 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
5154 but you should NOT include libraries or ld flags like -lwhatever. If you
5155 want $package to honor its debug switch, you should include -DDEBUGGING here.
5156 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
5158 To use no flags, specify the word "none".
5164 rp="Any additional cc flags?"
5171 : the following weeds options from ccflags that are of no interest to cpp
5173 '') cppflags="$ccflags" ;;
5174 *) cppflags="$cppflags $ccflags" ;;
5176 case "$gccversion" in
5177 1*) cppflags="$cppflags -D__GNUC__"
5179 case "$mips_type" in
5181 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
5187 echo "Let me guess what the preprocessor flags are..." >&4
5201 *) ftry="$previous $flag";;
5203 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
5204 >cpp1.out 2>/dev/null && \
5205 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
5206 >cpp2.out 2>/dev/null && \
5207 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
5208 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
5210 cppflags="$cppflags $ftry"
5220 *-*) echo "They appear to be: $cppflags";;
5222 $rm -f cpp.c cpp?.out
5226 : flags used in final linking phase
5228 '') if ./venix; then
5234 *-posix*) dflt="$dflt -posix" ;;
5237 *) dflt="$ldflags";;
5240 : Try to guess additional flags to pick up local libraries.
5241 for thislibdir in $libpth; do
5242 case " $loclibpth " in
5245 *"-L$thislibdir "*) ;;
5246 *) dflt="$dflt -L$thislibdir" ;;
5258 Your C linker may need flags. For this question you should
5259 include -L/whatever and any other flags used by the C linker, but you
5260 should NOT include libraries like -lwhatever.
5262 Make sure you include the appropriate -L/path flags if your C linker
5263 does not normally search all of the directories you specified above,
5266 To use no flags, specify the word "none".
5270 rp="Any additional ld flags (NOT including libraries)?"
5276 rmlist="$rmlist pdp11"
5280 echo "Checking your choice of C compiler and flags for coherency..." >&4
5281 $cat > try.c <<'EOF'
5283 int main() { printf("Ok\n"); return(0); }
5285 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
5287 $cat >try.msg <<'EOM'
5288 I've tried to compile and run the following simple program:
5291 $cat try.c >> try.msg
5293 $cat >> try.msg <<EOM
5300 and I got the following output:
5304 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5305 if $sh -c "$run ./try" >>try.msg 2>&1; then
5309 *) echo 'The program compiled OK, but produced no output.' >> try.msg
5312 cat >> try.msg <<'EOQS'
5313 If $libs contains -lsfio, and sfio is mis-configured, then it
5314 sometimes (apparently) runs and exits with a 0 status, but with no
5315 output! It may have to do with sfio's use of _exit vs. exit.
5318 rp="You have a big problem. Shall I abort Configure"
5325 echo "The program compiled OK, but exited with status $?." >>try.msg
5326 rp="You have a problem. Shall I abort Configure"
5330 echo "I can't compile the test program." >>try.msg
5331 rp="You have a BIG problem. Shall I abort Configure"
5337 case "$knowitall" in
5339 echo "(The supplied flags or libraries might be incorrect.)"
5347 *) echo "Ok. Stopping Configure." >&4
5352 n) echo "OK, that should do.";;
5356 : define a shorthand compile call
5360 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5361 : define a shorthand compile call for compilations that should be ok.
5365 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5367 : determine filename position in cpp output
5369 echo "Computing filename position in cpp output for #include directives..." >&4
5371 vos) testaccess=-e ;;
5374 echo '#include <stdio.h>' > foo.c
5377 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5378 $grep '^[ ]*#.*stdio\.h' | \
5379 while read cline; do
5382 while $test \$# -gt 0; do
5383 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5388 pos=\`expr \$pos + 1\`
5400 *) pos="${fieldn}th";;
5402 echo "Your cpp writes the filename in the $pos field of the line."
5405 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
5406 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
5409 : locate header file
5414 for usrincdir in $usrinc
5416 if test -f \$usrincdir/\$wanted; then
5417 echo "\$usrincdir/\$wanted"
5421 awkprg='{ print \$$fieldn }'
5422 echo "#include <\$wanted>" > foo\$\$.c
5423 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5424 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5425 while read cline; do
5426 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5428 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5429 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5434 # status = 0: grep returned 0 lines, case statement not executed
5435 # status = 1: headerfile found
5436 # status = 2: while loop executed, no headerfile found
5440 if test \$status -eq 1; then
5447 : define an alternate in-header-list? function
5448 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5449 cont=true; xxf="echo \"<\$1> found.\" >&4";
5450 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5451 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5453 case $# in 4) instead=instead;; *) instead="at last";; esac;
5454 while $test "$cont"; do
5456 var=$2; eval "was=\$$2";
5457 if $test "$xxx" && $test -r "$xxx";
5459 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5462 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5463 set $yyy; shift; shift; yyy=$@;
5464 case $# in 0) cont="";;
5465 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5466 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5467 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5468 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5472 do set $yyy; var=$2; eval "was=\$$2";
5473 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5474 set $yyy; shift; shift; yyy=$@;
5477 : see if stdlib is available
5478 set stdlib.h i_stdlib
5481 : check for lengths of integral types
5485 echo "Checking to see how big your integers are..." >&4
5494 printf("intsize=%d;\n", (int)sizeof(int));
5495 printf("longsize=%d;\n", (int)sizeof(long));
5496 printf("shortsize=%d;\n", (int)sizeof(short));
5501 if eval $compile_ok && $run ./try > /dev/null; then
5503 echo "Your integers are $intsize bytes long."
5504 echo "Your long integers are $longsize bytes long."
5505 echo "Your short integers are $shortsize bytes long."
5509 Help! I can't compile and run the intsize test program: please enlighten me!
5510 (This is probably a misconfiguration in your system or libraries, and
5511 you really ought to fix it. Still, I'll try anyway.)
5515 rp="What is the size of an integer (in bytes)?"
5519 rp="What is the size of a long integer (in bytes)?"
5523 rp="What is the size of a short integer (in bytes)?"
5531 : check for long long
5533 echo "Checking to see if you have long long..." >&4
5534 echo 'int main() { long long x = 7; return 0; }' > try.c
5536 if eval $compile; then
5538 echo "You have long long."
5541 echo "You do not have long long."
5547 : check for length of long long
5548 case "${d_longlong}${longlongsize}" in
5551 echo "Checking to see how big your long longs are..." >&4
5552 $cat >try.c <<'EOCP'
5556 printf("%d\n", (int)sizeof(long long));
5561 if eval $compile_ok; then
5562 longlongsize=`$run ./try`
5563 echo "Your long longs are $longlongsize bytes long."
5567 echo "(I can't seem to compile the test program. Guessing...)"
5568 rp="What is the size of a long long (in bytes)?"
5572 if $test "X$longsize" = "X$longlongsize"; then
5573 echo "(That isn't any different from an ordinary long.)"
5579 : see if inttypes.h is available
5580 : we want a real compile instead of Inhdr because some systems
5581 : have an inttypes.h which includes non-existent headers
5584 #include <inttypes.h>
5586 static int32_t foo32 = 0x12345678;
5590 if eval $compile; then
5591 echo "<inttypes.h> found." >&4
5594 echo "<inttypes.h> NOT found." >&4
5603 echo "Checking to see if you have int64_t..." >&4
5605 #include <sys/types.h>
5606 #$i_inttypes I_INTTYPES
5608 #include <inttypes.h>
5610 int main() { int64_t x = 7; }
5613 if eval $compile; then
5615 echo "You have int64_t."
5618 echo "You do not have int64_t."
5626 echo "Checking which 64-bit integer type we could use..." >&4
5632 val='"unsigned int"'
5637 *) case "$longsize" in
5641 val='"unsigned long"'
5646 *) case "$d_longlong:$longlongsize" in
5651 val='"unsigned long long"'
5656 *) case "$d_int64_t" in
5675 '') echo "Alas, no 64-bit integer types in sight." >&4
5678 *) echo "We could use '$quadtype' for 64-bit integers." >&4
5684 case "$uselonglong" in
5685 "$define"|true|[yY]*)
5688 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
5690 use64bitint="$define"
5693 case "$use64bits" in
5694 "$define"|true|[yY]*)
5697 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
5699 use64bitint="$define"
5702 case "$use64bitints" in
5703 "$define"|true|[yY]*)
5706 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
5708 use64bitint="$define"
5711 case "$use64bitsint" in
5712 "$define"|true|[yY]*)
5715 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
5717 use64bitint="$define"
5720 case "$uselonglongs" in
5721 "$define"|true|[yY]*)
5724 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
5726 use64bitint="$define"
5729 case "$use64bitsall" in
5730 "$define"|true|[yY]*)
5733 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
5735 use64bitall="$define"
5740 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
5742 case "$use64bitall" in
5743 "$define"|true|[yY]*) use64bitint="$define" ;;
5749 You have natively 64-bit long integers.
5753 *) case "$use64bitint" in
5754 "$define"|true|[yY]*) dflt='y';;
5763 Perl can be built to take advantage of 64-bit integer types
5764 on some systems. To do so, Configure can be run with -Duse64bitint.
5765 Choosing this option will most probably introduce binary incompatibilities.
5767 If this doesn't make any sense to you, just accept the default '$dflt'.
5768 (The default has been chosen based on your configuration.)
5770 rp='Try to use 64-bit integers, if available?'
5773 [yY]*) val="$define" ;;
5781 case "$use64bitall" in
5782 "$define"|true|[yY]*) dflt='y' ;;
5783 *) case "$longsize" in
5791 You may also choose to try maximal 64-bitness. It means using as much
5792 64-bitness as possible on the platform. This in turn means even more
5793 binary incompatibilities. On the other hand, your platform may not
5794 have any more 64-bitness available than what you already have chosen.
5796 If this doesn't make any sense to you, just accept the default '$dflt'.
5797 (The default has been chosen based on your configuration.)
5799 rp='Try to use maximal 64-bit support, if available?'
5802 [yY]*) val="$define" ;;
5807 case "$use64bitall" in
5809 case "$use64bitint" in
5813 Since you have chosen a maximally 64-bit build, I'm also turning on
5814 the use of 64-bit integers.
5816 use64bitint="$define" ;;
5821 : Look for a hint-file generated 'call-back-unit'. If the
5822 : user has specified that a 64-bit perl is to be built,
5823 : we may need to set or change some other defaults.
5824 if $test -f use64bitint.cbu; then
5825 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
5828 case "$use64bitint" in
5829 "$define"|true|[yY]*)
5831 4) case "$archname64" in
5832 '') archname64=64int ;;
5839 : Look for a hint-file generated 'call-back-unit'. If the
5840 : user has specified that a maximally 64-bit perl is to be built,
5841 : we may need to set or change some other defaults.
5842 if $test -f use64bitall.cbu; then
5843 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
5846 case "$use64bitall" in
5847 "$define"|true|[yY]*)
5849 4) case "$archname64" in
5850 ''|64int) archname64=64all ;;
5857 case "$d_quad:$use64bitint" in
5861 *** You have chosen to use 64-bit integers,
5862 *** but none can be found.
5863 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
5864 *** Cannot continue, aborting.
5871 : check for length of double
5873 case "$doublesize" in
5875 echo "Checking to see how big your double precision numbers are..." >&4
5884 printf("%d\n", (int)sizeof(double));
5889 if eval $compile_ok; then
5890 doublesize=`$run ./try`
5891 echo "Your double is $doublesize bytes long."
5894 echo "(I can't seem to compile the test program. Guessing...)"
5895 rp="What is the size of a double precision number (in bytes)?"
5903 : check for long doubles
5905 echo "Checking to see if you have long double..." >&4
5906 echo 'int main() { long double x = 7.0; }' > try.c
5908 if eval $compile; then
5910 echo "You have long double."
5913 echo "You do not have long double."
5919 : check for length of long double
5920 case "${d_longdbl}${longdblsize}" in
5923 echo "Checking to see how big your long doubles are..." >&4
5924 $cat >try.c <<'EOCP'
5928 printf("%d\n", sizeof(long double));
5933 if eval $compile; then
5934 longdblsize=`$run ./try`
5935 echo "Your long doubles are $longdblsize bytes long."
5939 echo "(I can't seem to compile the test program. Guessing...)" >&4
5940 rp="What is the size of a long double (in bytes)?"
5944 if $test "X$doublesize" = "X$longdblsize"; then
5945 echo "That isn't any different from an ordinary double."
5946 echo "I'll keep your setting anyway, but you may see some"
5947 echo "harmless compilation warnings."
5953 : determine the architecture name
5955 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
5956 tarch=`arch`"-$osname"
5957 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
5958 if uname -m > tmparch 2>&1 ; then
5959 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
5960 -e 's/$/'"-$osname/" tmparch`
5968 case "$myarchname" in
5971 echo "(Your architecture name used to be $myarchname.)"
5975 case "$targetarch" in
5977 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
5982 *) dflt="$archname";;
5984 rp='What is your architecture name'
5987 case "$usethreads" in
5989 echo "Threads selected." >&4
5991 *-thread*) echo "...and architecture name already has -thread." >&4
5993 *) archname="$archname-thread"
5994 echo "...setting architecture name to $archname." >&4
5999 case "$usemultiplicity" in
6001 echo "Multiplicity selected." >&4
6003 *-multi*) echo "...and architecture name already has -multi." >&4
6005 *) archname="$archname-multi"
6006 echo "...setting architecture name to $archname." >&4
6011 case "$use64bitint$use64bitall" in
6013 case "$archname64" in
6015 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
6018 case "$use64bitint" in
6019 "$define") echo "64 bit integers selected." >&4 ;;
6021 case "$use64bitall" in
6022 "$define") echo "Maximal 64 bitness selected." >&4 ;;
6025 *-$archname64*) echo "...and architecture name already has $archname64." >&4
6027 *) archname="$archname-$archname64"
6028 echo "...setting architecture name to $archname." >&4
6034 case "$uselongdouble" in
6036 echo "Long doubles selected." >&4
6037 case "$longdblsize" in
6039 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
6043 *-ld*) echo "...and architecture name already has -ld." >&4
6045 *) archname="$archname-ld"
6046 echo "...setting architecture name to $archname." >&4
6053 case "$useperlio" in
6055 echo "Perlio selected." >&4
6058 echo "Perlio not selected, using stdio." >&4
6060 *-stdio*) echo "...and architecture name already has -stdio." >&4
6062 *) archname="$archname-stdio"
6063 echo "...setting architecture name to $archname." >&4
6068 if $test -f archname.cbu; then
6069 echo "Your platform has some specific hints for architecture name, using them..."
6073 : set the prefixit variable, to compute a suitable default value
6074 prefixit='case "$3" in
6076 case "$oldprefix" in
6077 "") eval "$1=\"\$$2\"";;
6084 ""|" ") eval "$1=\"\$$2\"";;
6090 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
6092 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
6093 /*-$oldprefix/*|\~*-$oldprefix/*)
6094 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
6095 *) eval "$1=\"\$$2\"";;
6099 : determine installation style
6100 : For now, try to deduce it from prefix unless it is already set.
6101 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
6102 case "$installstyle" in
6103 '') case "$prefix" in
6104 *perl*) dflt='lib';;
6105 *) dflt='lib/perl5' ;;
6108 *) dflt="$installstyle" ;;
6110 : Probably not worth prompting for this since we prompt for all
6111 : the directories individually, and the prompt would be too long and
6115 : determine where public executables go
6120 rp='Pathname where the public executables will reside?'
6122 if $test "X$ansexp" != "X$binexp"; then
6126 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
6127 : XXX If this is fixed, also fix the "start perl" hunk below, which relies on
6128 : this via initialinstalllocation
6131 case "$userelocatableinc" in
6132 $define|true|[yY]*) dflt='y' ;;
6137 Would you like to build Perl so that the installation is relocatable, so that
6138 library paths in @INC are determined relative to the path of the perl binary?
6139 This is not advised for system Perl installs, or if you need to run setid
6140 scripts or scripts under taint mode.
6142 If this doesn't make any sense to you, just accept the default '$dflt'.
6144 rp='Use relocatable @INC?'
6147 y|Y) val="$define" ;;
6150 set userelocatableinc
6153 initialinstalllocation="$binexp"
6154 : Default prefix is now "up one level from where the binaries are"
6155 case "$userelocatableinc" in
6161 installprefixexp=".../.."
6165 : determine where private library files go
6166 : Usual default is /usr/local/lib/perl5/$version.
6167 : Also allow things like /opt/perl/lib/$version, since
6168 : /opt/perl/lib/perl5... would be redundant.
6169 : The default "style" setting is made in installstyle.U
6170 case "$installstyle" in
6171 *lib/perl5*) set dflt privlib lib/$package/$version ;;
6172 *) set dflt privlib lib/$version ;;
6177 There are some auxiliary files for $package that need to be put into a
6178 private library directory that is accessible by everyone.
6183 rp='Pathname where the private library files will reside?'
6188 : set the prefixup variable, to restore leading tilda escape
6189 prefixup='case "$prefixexp" in
6191 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
6194 : determine where public architecture dependent libraries go
6197 : privlib default is /usr/local/lib/$package/$version
6198 : archlib default is /usr/local/lib/$package/$version/$archname
6199 : privlib may have an optional trailing /share.
6200 tdflt=`echo $privlib | $sed 's,/share$,,'`
6201 tdflt=$tdflt/$archname
6210 $spackage contains architecture-dependent library files. If you are
6211 sharing libraries in a heterogeneous environment, you might store
6212 these files in a separate location. Otherwise, you can just include
6213 them with the rest of the public library files.
6218 rp='Where do you want to put the public architecture-dependent libraries?'
6222 if $test X"$archlib" = X"$privlib"; then
6228 : see if setuid scripts can be secure
6231 Some kernels have a bug that prevents setuid #! scripts from being
6232 secure. Some sites have disabled setuid #! scripts because of this.
6234 First let's decide if your kernel supports secure setuid #! scripts.
6235 (If setuid #! scripts would be secure but have been disabled anyway,
6236 don't say that they are secure if asked.)
6241 if $test -d /dev/fd; then
6242 echo "#!$ls" >reflect
6243 chmod +x,u+s reflect
6244 ./reflect >flect 2>&1
6245 if $contains "/dev/fd" flect >/dev/null; then
6246 echo "Congratulations, your kernel has secure setuid scripts!" >&4
6250 If you are not sure if they are secure, I can check but I'll need a
6251 username and password different from the one you are using right now.
6252 If you don't have such a username or don't want me to test, simply
6256 rp='Other username to test security of setuid scripts with?'
6261 case "$d_suidsafe" in
6262 '') echo "I'll assume setuid scripts are *not* secure." >&4
6265 echo "Well, the $hint value is *not* secure." >&4
6267 *) echo "Well, the $hint value *is* secure." >&4
6272 $rm -f reflect flect
6273 echo "#!$ls" >reflect
6274 chmod +x,u+s reflect
6277 echo '"su" will (probably) prompt you for '"$ans's password."
6278 su $ans -c './reflect >flect'
6279 if $contains "/dev/fd" flect >/dev/null; then
6280 echo "Okay, it looks like setuid scripts are secure." >&4
6283 echo "I don't think setuid scripts are secure." >&4
6288 rp='Does your kernel have *secure* setuid scripts?'
6291 [yY]*) val="$define";;
6296 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
6297 echo "(That's for file descriptors, not floppy disks.)"
6303 $rm -f reflect flect
6305 : now see if they want to do setuid emulation
6308 case "$d_suidsafe" in
6311 echo "No need to emulate SUID scripts since they are secure here." >&4
6315 Some systems have disabled setuid scripts, especially systems where
6316 setuid scripts cannot be secure. On systems where setuid scripts have
6317 been disabled, the setuid/setgid bits on scripts are currently
6318 useless. It is possible for $package to detect those bits and emulate
6319 setuid/setgid in a secure fashion. This emulation will only work if
6320 setuid scripts have been disabled in your kernel.
6324 "$define") dflt=y ;;
6327 rp="Do you want to do setuid/setgid emulation?"
6330 [yY]*) val="$define";;
6338 : Find perl5.005 or later.
6339 echo "Looking for a previously installed perl5.005 or later... "
6341 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
6342 : Check if this perl is recent and can load a simple module
6343 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6346 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6356 '') echo "None found. That's ok.";;
6357 *) echo "Using $perl5." ;;
6362 After $package is installed, you may wish to install various
6363 add-on modules and utilities. Typically, these add-ons will
6364 be installed under $prefix with the rest
6365 of this package. However, you may wish to install such add-ons
6366 elsewhere under a different prefix.
6368 If you do not wish to put everything under a single prefix, that's
6369 ok. You will be prompted for the individual locations; this siteprefix
6370 is only used to suggest the defaults.
6372 The default should be fine for most people.
6376 rp='Installation prefix to use for add-on modules and utilities?'
6377 : XXX Here might be another good place for an installstyle setting.
6378 case "$siteprefix" in
6380 *) dflt=$siteprefix ;;
6383 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6385 case "$siteprefix" in
6389 *) oldsiteprefix="$prefix";;
6394 siteprefixexp="$ansexp"
6396 : determine where site specific libraries go.
6397 : Usual default is /usr/local/lib/perl5/site_perl/$version
6398 : The default "style" setting is made in installstyle.U
6399 : XXX No longer works with Prefixit stuff.
6400 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6402 '') case "$installstyle" in
6403 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
6404 *) dflt=$siteprefix/lib/site_$prog/$version ;;
6412 The installation process will create a directory for
6413 site-specific extensions and modules. Most users find it convenient
6414 to place all site-specific files in this directory rather than in the
6415 main distribution directory.
6419 rp='Pathname for the site-specific library files?'
6423 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6425 : Determine list of previous versions to include in @INC
6426 $cat > getverlist <<EOPL
6429 \$api_versionstring = "$api_versionstring";
6430 \$version = "$version";
6431 \$stem = "$sitelib_stem";
6432 \$archname = "$archname";
6434 $cat >> getverlist <<'EOPL'
6435 # The list found is store twice for each entry: the original name, and
6436 # the binary broken down version as pack "sss", so sorting is easy and
6437 # unambiguous. This will work for all versions that have a maximum of
6438 # three digit groups, separate by '.'s or '_'s. Names are extended with
6439 # ".0.0" to ensure at least three elements for the pack.
6440 # -- H.Merijn Brand (m)'06 23-10-2006
6442 # Can't have leading @ because metaconfig interprets it as a command!
6443 ;@inc_version_list=();
6444 # XXX Redo to do opendir/readdir?
6447 ;@candidates = map {
6448 [ $_, pack "sss", split m/[._]/, "$_.0.0" ] } glob("5.*");
6454 ($pversion, $aversion, $vsn5005) = map {
6455 pack "sss", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005";
6456 foreach $d (@candidates) {
6457 if ($d->[1] lt $pversion) {
6458 if ($d->[1] ge $aversion) {
6459 unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]);
6461 elsif ($d->[1] ge $vsn5005) {
6462 unshift(@inc_version_list, grep { -d } $d->[0]);
6466 # Skip newer version. I.e. don't look in
6467 # 5.7.0 if we're installing 5.6.1.
6471 if (@inc_version_list) {
6472 print join(' ', @inc_version_list);
6475 # Blank space to preserve value for next Configure run.
6480 case "$inc_version_list" in
6481 '') if test -x "$perl5$exe_ext"; then
6482 dflt=`$perl5 getverlist`
6487 $undef) dflt='none' ;;
6488 *) eval dflt=\"$inc_version_list\" ;;
6491 ''|' ') dflt=none ;;
6498 In order to ease the process of upgrading, this version of perl
6499 can be configured to use modules built and installed with earlier
6500 versions of perl that were installed under $prefix. Specify here
6501 the list of earlier versions that this version of perl should check.
6502 If Configure detected no earlier versions of perl installed under
6503 $prefix, then the list will be empty. Answer 'none' to tell perl
6504 to not search earlier versions.
6506 The default should almost always be sensible, so if you're not sure,
6507 just accept the default.
6510 rp='List of earlier versions to include in @INC?'
6513 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
6514 *) inc_version_list="$ans" ;;
6516 case "$inc_version_list" in
6518 inc_version_list_init='0'
6519 d_inc_version_list="$undef"
6521 *) inc_version_list_init=`echo $inc_version_list |
6522 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
6523 d_inc_version_list="$define"
6528 : see if this is a malloc.h system
6529 : we want a real compile instead of Inhdr because some systems have a
6530 : malloc.h that just gives a compile error saying to use stdlib.h instead
6535 int main () { return 0; }
6538 if eval $compile; then
6539 echo "<malloc.h> found." >&4
6542 echo "<malloc.h> NOT found." >&4
6549 : check for void type
6551 echo "Checking to see how well your C compiler groks the void type..." >&4
6552 case "$voidflags" in
6564 extern void moo(); /* function returning void */
6565 void (*goo)(); /* ptr to func returning void */
6567 void *hue; /* generic ptr */
6580 int main() { sub(); }
6582 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
6583 voidflags=$defvoidused
6584 echo "Good. It appears to support void to the level $package wants.">&4
6585 if $contains warning .out >/dev/null 2>&1; then
6586 echo "However, you might get some warnings that look like this:"
6590 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
6591 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
6592 echo "It supports 1..."
6593 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
6594 echo "It also supports 2..."
6595 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
6597 echo "And it supports 4 but not 8 definitely."
6599 echo "It doesn't support 4..."
6600 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
6602 echo "But it supports 8."
6605 echo "Neither does it support 8."
6609 echo "It does not support 2..."
6610 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
6612 echo "But it supports 4 and 8."
6614 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
6616 echo "And it supports 4 but has not heard about 8."
6618 echo "However it supports 8 but not 4."
6623 echo "There is no support at all for void."
6628 case "$voidflags" in
6631 Support flag bits are:
6632 1: basic void declarations.
6633 2: arrays of pointers to functions returning void.
6634 4: operations between pointers to and addresses of void functions.
6635 8: generic void pointers.
6638 rp="Your void support flags add up to what?"
6645 : check for length of pointer
6649 echo "Checking to see how big your pointers are..." >&4
6650 if test "$voidflags" -gt 7; then
6651 echo '#define VOID_PTR char *' > try.c
6653 echo '#define VOID_PTR void *' > try.c
6663 printf("%d\n", (int)sizeof(VOID_PTR));
6668 if eval $compile_ok; then
6669 ptrsize=`$run ./try`
6670 echo "Your pointers are $ptrsize bytes long."
6673 echo "(I can't seem to compile the test program. Guessing...)" >&4
6674 rp="What is the size of a pointer (in bytes)?"
6681 case "$use64bitall" in
6682 "$define"|true|[yY]*)
6686 *** You have chosen a maximally 64-bit build,
6687 *** but your pointers are only 4 bytes wide.
6688 *** Please rerun Configure without -Duse64bitall.
6693 *** Since you have quads, you could possibly try with -Duse64bitint.
6698 *** Cannot continue, aborting.
6709 : determine whether to use malloc wrapping
6711 case "$usemallocwrap" in
6712 [yY]*|true|$define) dflt='y' ;;
6713 [nN]*|false|$undef) dflt='n' ;;
6714 *) case "$usedevel" in
6715 [yY]*|true|$define) dflt='y' ;;
6720 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
6722 usemallocwrap="$ans"
6725 usemallocwrap="$define" ;;
6727 usemallocwrap="$undef" ;;
6730 : determine which malloc to compile in
6732 case "$usemymalloc" in
6733 [yY]*|true|$define) dflt='y' ;;
6734 [nN]*|false|$undef) dflt='n' ;;
6735 *) case "$ptrsize" in
6741 rp="Do you wish to attempt to use the malloc that comes with $package?"
6747 mallocsrc='malloc.c'
6748 mallocobj="malloc$_o"
6749 d_mymalloc="$define"
6752 : Remove malloc from list of libraries to use
6753 echo "Removing unneeded -lmalloc from library list" >&4
6754 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
6757 echo "libs = $libs" >&4
6769 : compute the return types of malloc and free
6771 $cat >malloc.c <<END
6775 #include <sys/types.h>
6789 case "$malloctype" in
6791 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
6798 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
6802 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
6809 echo "Your system uses $freetype free(), it would seem." >&4
6811 : determine where site specific architecture-dependent libraries go.
6812 : sitelib default is /usr/local/lib/perl5/site_perl/$version
6813 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6814 : sitelib may have an optional trailing /share.
6816 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
6817 dflt="$dflt/$archname"
6822 set sitearch sitearch none
6826 The installation process will also create a directory for
6827 architecture-dependent site-specific extensions and modules.
6831 rp='Pathname for the site-specific architecture-dependent library files?'
6835 if $test X"$sitearch" = X"$sitelib"; then
6838 d_sitearch="$define"
6843 The installation process will also create a directory for
6844 vendor-supplied add-ons. Vendors who supply perl with their system
6845 may find it convenient to place all vendor-supplied files in this
6846 directory rather than in the main distribution directory. This will
6847 ease upgrades between binary-compatible maintenance versions of perl.
6849 Of course you may also use these directories in whatever way you see
6850 fit. For example, you might use them to access modules shared over a
6851 company-wide network.
6853 The default answer should be fine for most people.
6854 This causes further questions about vendor add-ons to be skipped
6855 and no vendor-specific directories will be configured for perl.
6858 rp='Do you want to configure vendor-specific add-on directories?'
6859 case "$usevendorprefix" in
6860 define|true|[yY]*) dflt=y ;;
6861 *) : User may have set vendorprefix directly on Configure command line.
6862 case "$vendorprefix" in
6871 rp='Installation prefix to use for vendor-supplied add-ons?'
6872 case "$vendorprefix" in
6874 *) dflt=$vendorprefix ;;
6877 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6879 case "$vendorprefix" in
6883 *) oldvendorprefix="$prefix";;
6887 usevendorprefix="$define"
6889 vendorprefixexp="$ansexp"
6891 *) usevendorprefix="$undef"
6897 case "$vendorprefix" in
6898 '') d_vendorlib="$undef"
6902 *) d_vendorlib="$define"
6903 : determine where vendor-supplied modules go.
6904 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
6905 case "$vendorlib" in
6907 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6908 case "$installstyle" in
6909 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
6910 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
6913 *) dflt="$vendorlib"
6917 rp='Pathname for the vendor-supplied library files?'
6920 vendorlibexp="$ansexp"
6923 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
6927 case "$vendorprefix" in
6928 '') d_vendorarch="$undef"
6932 *) d_vendorarch="$define"
6933 : determine where vendor-supplied architecture-dependent libraries go.
6934 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
6935 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
6936 : vendorlib may have an optional trailing /share.
6937 case "$vendorarch" in
6938 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
6939 dflt="$dflt/$archname"
6941 *) dflt="$vendorarch" ;;
6944 rp='Pathname for vendor-supplied architecture-dependent files?'
6947 vendorarchexp="$ansexp"
6950 prefixvar=vendorarch
6953 : Final catch-all directories to search
6956 Lastly, you can have perl look in other directories for extensions and
6957 modules in addition to those already specified.
6958 These directories will be searched after
6962 test X"$vendorlib" != "X" && echo ' ' $vendorlib
6963 test X"$vendorarch" != "X" && echo ' ' $vendorarch
6965 case "$otherlibdirs" in
6966 ''|' ') dflt='none' ;;
6967 *) dflt="$otherlibdirs" ;;
6970 Enter a colon-separated set of extra paths to include in perl's @INC
6971 search path, or enter 'none' for no extra paths.
6975 rp='Colon-separated list of additional directories for perl to search?'
6978 ' '|''|none) otherlibdirs=' ' ;;
6979 *) otherlibdirs="$ans" ;;
6981 case "$otherlibdirs" in
6985 set d_perl_otherlibdirs
6988 : Cruising for prototypes
6990 echo "Checking out function prototypes..." >&4
6991 $cat >prototype.c <<EOCP
6996 int main(int argc, char *argv[]) {
6999 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
7000 echo "Your C compiler appears to support function prototypes."
7003 echo "Your C compiler doesn't seem to understand function prototypes."
7010 case "$prototype" in
7012 *) ansi2knr='ansi2knr'
7017 This version of $package can only be compiled by a compiler that
7018 understands function prototypes. Unfortunately, your C compiler
7020 doesn't seem to understand them. Sorry about that.
7022 If GNU cc is available for your system, perhaps you could try that instead.
7024 Eventually, we hope to support building Perl with pre-ANSI compilers.
7025 If you would like to help in that effort, please contact <perlbug@perl.org>.
7027 Aborting Configure now.
7039 Perl can be built with extra modules or bundles of modules which
7040 will be fetched from the CPAN and installed alongside Perl.
7042 Notice that you will need access to the CPAN; either via the Internet,
7043 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
7044 be asked later to configure the CPAN.pm module which will in turn do
7045 the installation of the rest of the extra modules or bundles.)
7047 Notice also that if the modules require any external software such as
7048 libraries and headers (the libz library and the zlib.h header for the
7049 Compress::Zlib module, for example) you MUST have any such software
7050 already installed, this configuration process will NOT install such
7053 If this doesn't make any sense to you, just accept the default '$dflt'.
7055 rp='Install any extra modules (y or n)?'
7061 Please list any extra modules or bundles to be installed from CPAN,
7062 with spaces between the names. The names can be in any format the
7063 'install' command of CPAN.pm will understand. (Answer 'none',
7064 without the quotes, to install no extra modules or bundles.)
7074 $rm -f ../extras.lst
7076 *) echo "(Saving the list of extras for later...)"
7077 echo "$extras" > ../extras.lst
7085 : determine where html pages for programs go
7086 set html1dir html1dir none
7090 If you wish to install html files for programs in $spackage, indicate
7091 the appropriate directory here. To skip installing html files,
7095 ''|none|$undef|' ') dflt=none ;;
7096 *) dflt=$html1dir ;;
7099 rp="Directory for the main $spackage html pages?"
7103 : Use ' ' for none so value is preserved next time through Configure
7104 $test X"$html1dir" = "X" && html1dir=' '
7106 : determine where html pages for libraries and modules go
7107 set html3dir html3dir none
7111 If you wish to install html files for modules associated with $spackage,
7112 indicate the appropriate directory here. To skip installing html files,
7115 : There is no obvious default. If they have specified html1dir, then
7116 : try to key off that, possibly changing .../html1 into .../html3.
7118 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
7119 *) dflt=$html3dir ;;
7122 rp="Directory for the $spackage module html pages?"
7126 : Use ' ' for none so value is preserved next time through Configure
7127 $test X"$html3dir" = "X" && html3dir=' '
7129 : determine whether to install perl also as /usr/bin/perl
7132 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
7134 Many scripts expect perl to be installed as /usr/bin/perl.
7136 If you want to, I can install the perl you are about to compile
7137 as /usr/bin/perl (in addition to $bin/perl).
7139 if test -f /usr/bin/perl; then
7142 However, please note that because you already have a /usr/bin/perl,
7143 overwriting that with a new Perl would very probably cause problems.
7144 Therefore I'm assuming you don't want to do that (unless you insist).
7147 case "$installusrbinperl" in
7148 "$define"|[yY]*) dflt='y';;
7154 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
7157 case "$installusrbinperl" in
7158 "$undef"|[nN]*) dflt='n';;
7162 rp="Do you want to install perl as /usr/bin/perl?"
7165 [yY]*) val="$define";;
7171 set installusrbinperl
7175 echo "Checking for GNU C Library..." >&4
7177 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
7178 alone are insufficient to distinguish different versions, such as
7179 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
7180 libc version 2.1.0. A. Dougherty, June 3, 2002.
7186 # ifdef __GLIBC_MINOR__
7187 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus)
7188 # include <gnu/libc-version.h>
7189 printf("%s\n", gnu_get_libc_version());
7191 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
7194 printf("%d\n", __GLIBC__);
7203 if eval $compile_ok && $run ./try > glibc.ver; then
7205 gnulibc_version=`$cat glibc.ver`
7206 echo "You are using the GNU C Library version $gnulibc_version"
7210 echo "You are not using the GNU C Library"
7216 : see if nm is to be used to determine whether a symbol is defined or not
7220 case "$d_gnulibc" in
7223 echo "nm probably won't work on the GNU C Library." >&4
7229 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
7231 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
7232 echo "'nm' won't be sufficient on this sytem." >&4
7238 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
7239 if $test $dflt -gt 20; then
7249 true|$define) dflt=y;;
7256 I can use $nm to extract the symbols from your C libraries. This
7257 is a time consuming task which may generate huge output on the disk (up
7258 to 3 megabytes) but that should make the symbols extraction faster. The
7259 alternative is to skip the 'nm' extraction part and to compile a small
7260 test program instead to determine whether each symbol is present. If
7261 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
7262 this may be the best solution.
7264 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
7267 rp="Shall I use $nm to extract C symbols from the libraries?"
7270 [Nn]*) usenm=false;;
7279 : nm options which may be necessary
7281 '') if $test -f /mach_boot; then
7283 elif $test -d /usr/ccs/lib; then
7284 nm_opt='-p' # Solaris (and SunOS?)
7285 elif $test -f /dgux; then
7287 elif $test -f /lib64/rld; then
7288 nm_opt='-p' # 64-bit Irix
7294 : nm options which may be necessary for shared libraries but illegal
7295 : for archive libraries. Thank you, Linux.
7296 case "$nm_so_opt" in
7297 '') case "$myuname" in
7299 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
7300 nm_so_opt='--dynamic'
7309 : get list of predefined functions in a handy place
7314 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
7320 *) for thislib in $libs; do
7323 : Handle C library specially below.
7326 thislib=`echo $thislib | $sed -e 's/^-l//'`
7327 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
7329 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
7331 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
7333 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
7335 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
7337 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
7339 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
7344 libnames="$libnames $try"
7346 *) libnames="$libnames $thislib" ;;
7355 for xxx in $libpth; do
7356 $test -r $1 || set $xxx/libc.$so
7357 : The messy sed command sorts on library version numbers.
7359 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
7360 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
7362 s/[0-9][0-9]*/0000&/g
7363 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
7366 $sort | $sed -e 's/^.* //'`
7369 $test -r $1 || set /usr/ccs/lib/libc.$so
7370 $test -r $1 || set /lib/libsys_s$_a
7376 if $test -r "$1"; then
7377 echo "Your (shared) C library seems to be in $1."
7379 elif $test -r /lib/libc && $test -r /lib/clib; then
7380 echo "Your C library seems to be in both /lib/clib and /lib/libc."
7382 libc='/lib/clib /lib/libc'
7383 if $test -r /lib/syslib; then
7384 echo "(Your math library is in /lib/syslib.)"
7385 libc="$libc /lib/syslib"
7387 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7388 echo "Your C library seems to be in $libc, as you said before."
7389 elif $test -r $incpath/usr/lib/libc$_a; then
7390 libc=$incpath/usr/lib/libc$_a;
7391 echo "Your C library seems to be in $libc. That's fine."
7392 elif $test -r /lib/libc$_a; then
7394 echo "Your C library seems to be in $libc. You're normal."
7396 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
7398 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
7399 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
7400 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
7402 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7404 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7407 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
7409 if $test -r "$tans"; then
7410 echo "Your C library seems to be in $tans, of all places."
7416 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7420 If the guess above is wrong (which it might be if you're using a strange
7421 compiler, or your machine supports multiple models), you can override it here.
7426 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
7428 I can't seem to find your C library. I've looked in the following places:
7431 $sed 's/^/ /' libpath
7434 None of these seems to contain your C library. I need to get its name...
7439 rp='Where is your C library?'
7444 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
7445 set X `cat libnames`
7448 case $# in 1) xxx=file; esac
7449 echo "Extracting names from the following $xxx for later perusal:" >&4
7451 $sed 's/^/ /' libnames >&4
7453 $echo $n "This may take a while...$c" >&4
7457 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
7458 *) $nm $nm_opt $file 2>/dev/null;;
7463 $grep fprintf libc.tmp > libc.ptf
7464 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
7465 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
7467 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
7469 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7471 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
7473 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7475 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
7477 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7479 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
7481 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7483 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
7485 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7487 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
7489 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7491 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
7492 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
7494 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7496 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
7498 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7500 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
7502 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7504 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
7506 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7508 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
7510 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7512 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
7514 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7516 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
7518 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7520 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
7522 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7525 $nm -p $* 2>/dev/null >libc.tmp
7526 $grep fprintf libc.tmp > libc.ptf
7527 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
7528 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
7534 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
7536 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
7537 for thisname in $libnames $libc; do
7538 $ar t $thisname >>libc.tmp
7540 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
7542 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
7543 # Repeat libc to extract forwarders to DLL entries too
7544 for thisname in $libnames $libc; do
7545 $ar tv $thisname >>libc.tmp
7546 # Revision 50 of EMX has bug in $ar.
7547 # it will not extract forwarders to DLL entries
7548 # Use emximp which will extract exactly them.
7549 emximp -o tmp.imp $thisname \
7551 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
7552 < tmp.imp >>libc.tmp
7555 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
7558 echo "$ar didn't seem to work right." >&4
7559 echo "Maybe this is a Cray...trying bld instead..." >&4
7560 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
7562 for thisname in $libnames; do
7564 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
7565 $ar t $thisname >>libc.tmp
7569 echo "That didn't work either. Giving up." >&4
7579 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
7580 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
7582 *) if $test -f /lib/syscalls.exp; then
7584 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
7585 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' /lib/syscalls.exp >>libc.list
7591 $rm -f libnames libpath
7593 : see if dld is available
7599 echo "Checking for C++..." >&4
7600 $cat >try.c <<'EOCP'
7612 if eval $compile_ok && $run ./try; then
7614 echo "You are using a C++ compiler."
7617 echo "You are not using a C++ compiler."
7623 : is a C symbol defined?
7626 -v) tf=libc.tmp; tdc="";;
7627 -a) tf=libc.tmp; tdc="[]";;
7628 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
7631 case "$reuseval-$4" in
7633 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
7638 case "$d_cplusplus" in
7639 $define) extern_C=\"C\";;
7641 if $test "$runnm" = true; then
7642 if $contains $tlook $tf >/dev/null 2>&1; then
7644 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
7645 echo "extern $extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7646 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
7647 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
7651 echo "extern $extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7652 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
7658 $define) tval=true;;
7665 : define an is-in-libc? function
7666 inlibc='echo " "; td=$define; tu=$undef;
7667 sym=$1; var=$2; eval "was=\$$2";
7669 case "$reuseval$was" in
7679 echo "$sym() found." >&4;
7680 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
7682 echo "$sym() NOT found." >&4;
7683 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
7687 $define) echo "$sym() found." >&4;;
7688 *) echo "$sym() NOT found." >&4;;
7692 : see if dlopen exists
7694 xxx_ccflags="$ccflags"
7696 : with g++ one needs -shared to get is-in-libc to work for dlopen
7697 case "$gccversion" in
7699 *) case "$d_cplusplus" in
7700 "$define") ccflags="$ccflags -shared" ;;
7707 ccflags="$xxx_ccflags"
7709 : see if this is a unistd.h system
7710 set unistd.h i_unistd
7713 : determine which dynamic loading, if any, to compile in
7715 dldir="ext/DynaLoader"
7728 $define) dflt='y' ;;
7731 $define) dflt='y' ;;
7733 : Does a dl_xxx.xs file exist for this operating system
7734 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
7737 rp="Do you wish to use dynamic loading?"
7744 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
7745 dflt="$dldir/dl_${osname}.xs"
7746 elif $test "$d_dlopen" = "$define" ; then
7747 dflt="$dldir/dl_dlopen.xs"
7748 elif $test "$i_dld" = "$define" ; then
7749 dflt="$dldir/dl_dld.xs"
7754 *) dflt="$dldir/$dlsrc"
7757 echo "The following dynamic loading files are available:"
7758 : Can not go over to $dldir because getfile has path hard-coded in.
7759 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
7760 rp="Source file to use for dynamic loading"
7766 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
7770 Some systems may require passing special flags to $cc -c to
7771 compile modules that will be used to create a shared library.
7772 To use no flags, say "none".
7775 case "$cccdlflags" in
7776 '') case "$gccversion" in
7777 '') case "$osname" in
7779 next) dflt='none' ;;
7780 irix*) dflt='-KPIC' ;;
7781 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
7782 sunos) dflt='-pic' ;;
7786 *) case "$osname" in
7787 darwin) dflt='none' ;;
7788 linux*|svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
7793 *) dflt="$cccdlflags" ;;
7795 rp="Any special flags to pass to $cc -c to compile shared library modules?"
7798 none) cccdlflags=' ' ;;
7799 *) cccdlflags="$ans" ;;
7804 Some systems use ld to create libraries that can be dynamically loaded,
7805 while other systems (such as those using ELF) use $cc.
7809 '') $cat >try.c <<EOM
7810 /* Test for whether ELF binaries are produced */
7822 int i = open("a.out",O_RDONLY);
7825 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
7826 exit(0); /* succeed (yes, it's ELF) */
7831 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
7833 You appear to have ELF support. I'll use $cc to build dynamic libraries.
7837 echo "I'll use ld to build dynamic libraries."
7846 rp="What command should be used to create dynamic libraries?"
7852 Some systems may require passing special flags to $ld to create a
7853 library that can be dynamically loaded. If your ld flags include
7854 -L/other/path options to locate libraries outside your loader's normal
7855 search path, you may need to specify those -L options here as well. To
7856 use no flags, say "none".
7859 case "$lddlflags" in
7860 '') case "$osname" in
7861 beos) dflt='-nostart' ;;
7863 case "$gccversion" in
7864 '') dflt="$dflt +vnocompatwarnings" ;;
7867 linux|irix*|gnu*) dflt="-shared $optimize" ;;
7868 next) dflt='none' ;;
7869 solaris) dflt='-G' ;;
7870 sunos) dflt='-assert nodefinitions' ;;
7871 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
7875 *) dflt="$lddlflags" ;;
7878 : Try to guess additional flags to pick up local libraries.
7879 : Be careful not to append to a plain 'none'
7883 for thisflag in $ldflags; do
7888 *) dflt="$dflt $thisflag" ;;
7895 ''|' ') dflt='none' ;;
7898 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
7901 none) lddlflags=' ' ;;
7902 *) lddlflags="$ans" ;;
7907 Some systems may require passing special flags to $cc to indicate that
7908 the resulting executable will use dynamic linking. To use no flags,
7912 case "$ccdlflags" in
7913 '') case "$osname" in
7914 linux|hpux|gnu*) dflt='-Wl,-E' ;;
7915 next|sunos) dflt='none' ;;
7919 *) dflt="$ccdlflags" ;;
7921 rp="Any special flags to pass to $cc to use dynamic linking?"
7924 none) ccdlflags=' ' ;;
7925 *) ccdlflags="$ans" ;;
7939 # No dynamic loading being used, so don't bother even to prompt.
7942 *) case "$useshrplib" in
7943 '') case "$osname" in
7944 svr4*|nonstopux|dgux|dynixptx|esix|powerux|beos|cygwin*)
7946 also='Building a shared libperl is required for dynamic loading to work on your system.'
7951 also='Building a shared libperl is needed for MAB support.'
7969 The perl executable is normally obtained by linking perlmain.c with
7970 libperl${_a}, any static extensions (usually just DynaLoader), and
7971 any other libraries needed on this system (such as -lm, etc.). Since
7972 your system supports dynamic loading, it is probably possible to build
7973 a shared libperl.$so. If you will have more than one executable linked
7974 to libperl.$so, this will significantly reduce the size of each
7975 executable, but it may have a noticeable effect on performance. The
7976 default is probably sensible for your system.
7980 rp="Build a shared libperl.$so (y/n)"
7984 useshrplib='true' ;;
7985 *) useshrplib='false' ;;
7990 case "$useshrplib" in
7994 # Figure out a good name for libperl.so. Since it gets stored in
7995 # a version-specific architecture-dependent library, the version
7996 # number isn't really that important, except for making cc/ld happy.
7998 # A name such as libperl.so.3.1
7999 majmin="libperl.$so.$patchlevel.$subversion"
8000 # A name such as libperl.so.301
8001 majonly=`echo $patchlevel $subversion |
8002 $awk '{printf "%d%02d", $1, $2}'`
8003 majonly=libperl.$so.$majonly
8004 # I'd prefer to keep the os-specific stuff here to a minimum, and
8005 # rely on figuring it out from the naming of libc.
8006 case "${osname}${osvers}" in
8009 # XXX How handle the --version stuff for MAB?
8011 linux*|gnu*) # ld won't link with a bare -lperl otherwise.
8014 cygwin*) # ld links against an importlib
8015 dflt=libperl$lib_ext
8017 *) # Try to guess based on whether libc has major.minor.
8019 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
8020 *libc.$so.[0-9]*) dflt=$majonly ;;
8021 *) dflt=libperl.$so ;;
8031 I need to select a good name for the shared libperl. If your system uses
8032 library names with major and minor numbers, then you might want something
8033 like $majmin. Alternatively, if your system uses a single version
8034 number for shared libraries, then you might want to use $majonly.
8035 Or, your system might be quite happy with a simple libperl.$so.
8037 Since the shared libperl will get installed into a version-specific
8038 architecture-dependent directory, the version number of the shared perl
8039 library probably isn't important, so the default should be o.k.
8042 rp='What name do you want to give to the shared libperl?'
8045 echo "Ok, I'll use $libperl"
8048 libperl="libperl${_a}"
8052 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
8056 WARNING: Use of the shrpdir variable for the installation location of
8057 the shared $libperl is not supported. It was never documented and
8058 will not work in this version. Let me (perlbug@perl.org)
8059 know of any problems this may cause.
8065 But your current setting of $shrpdir is
8066 the default anyway, so it's harmless.
8071 Further, your current attempted setting of $shrpdir
8072 conflicts with the value of $archlibexp/CORE
8073 that installperl will use.
8080 # How will the perl executable find the installed shared $libperl?
8081 # Add $xxx to ccdlflags.
8082 # If we can't figure out a command-line option, use $shrpenv to
8083 # set env LD_RUN_PATH. The main perl makefile uses this.
8084 shrpdir=$archlibexp/CORE
8087 if "$useshrplib"; then
8090 # We'll set it in Makefile.SH...
8095 freebsd|netbsd|openbsd|interix|dragonfly)
8096 xxx="-Wl,-R$shrpdir"
8098 bsdos|linux|irix*|dec_osf|gnu*)
8099 xxx="-Wl,-rpath,$shrpdir"
8102 # next doesn't like the default...
8105 # beos doesn't like the default, either.
8108 # hpux doesn't like the default, either.
8109 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
8112 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
8118 # Only add $xxx if it isn't already in ccdlflags.
8119 case " $ccdlflags " in
8121 *) ccdlflags="$ccdlflags $xxx"
8124 Adding $xxx to the flags
8125 passed to $ld so that the perl executable will find the
8126 installed shared $libperl.
8134 # Fix ccdlflags in AIX for building external extensions.
8135 # (For building Perl itself bare -bE:perl.exp is needed,
8136 # Makefile.SH takes care of this.)
8138 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8140 # Respect a hint or command-line value.
8142 '') shrpenv="$tmp_shrpenv" ;;
8144 case "$ldlibpthname" in
8145 '') ldlibpthname=LD_LIBRARY_PATH ;;
8146 none) ldlibpthname='' ;;
8149 : determine where manual pages are on this system
8153 syspath='/usr/share/man/man1 /usr/man/man1'
8154 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8155 syspath="$syspath /usr/man/u_man/man1"
8156 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8157 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8158 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8159 sysman=`./loc . /usr/man/man1 $syspath`
8162 if $test -d "$sysman"; then
8163 echo "System manual is in $sysman." >&4
8165 echo "Could not find manual pages in source form." >&4
8168 : determine where manual pages go
8169 set man1dir man1dir none
8173 $spackage has manual pages available in source form.
8177 echo "However, you don't have nroff, so they're probably useless to you."
8179 '') man1dir="none";;
8182 echo "If you don't want the manual sources installed, answer 'none'."
8187 lookpath="$prefixexp/share/man/man1"
8188 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8189 lookpath="$lookpath $prefixexp/man/p_man/man1"
8190 lookpath="$lookpath $prefixexp/man/u_man/man1"
8191 lookpath="$lookpath $prefixexp/man/man.1"
8193 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8194 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8204 rp="Where do the main $spackage manual pages (source) go?"
8206 if $test "X$man1direxp" != "X$ansexp"; then
8217 : What suffix to use on installed man pages
8224 rp="What suffix should be used for the main $spackage man pages?"
8226 '') case "$man1dir" in
8240 *) dflt="$man1ext";;
8247 : see if we can have long filenames
8249 first=123456789abcdef
8251 if (echo hi >$first) 2>/dev/null; then
8252 if $test -f 123456789abcde; then
8253 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8256 echo 'You can have filenames longer than 14 characters.'>&4
8261 You can't have filenames longer than 14 chars.
8262 You can't even think about them!
8268 $rm -rf 123456789abcde*
8270 : determine where library module manual pages go
8271 set man3dir man3dir none
8275 $spackage has manual pages for many of the library modules.
8281 However, you don't have nroff, so they're probably useless to you.
8284 '') man3dir="none";;
8288 case "$d_flexfnam" in
8291 However, your system can't handle the long file names like File::Basename.3.
8294 '') man3dir="none";;
8298 echo "If you don't want the manual sources installed, answer 'none'."
8299 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8301 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
8302 if $test -d "$privlib/man/man3"; then
8305 WARNING: Previous versions of perl installed man3 pages into
8306 $privlib/man/man3. This version will suggest a
8307 new default of $dflt.
8311 rp='Do you wish to preserve the old behavior?(y/n)'
8314 y*) dflt="$privlib/man/man3" ;;
8319 *) dflt="$man3dir" ;;
8326 rp="Where do the $package library man pages (source) go?"
8336 : What suffix to use on installed man pages
8342 rp="What suffix should be used for the $package library man pages?"
8344 '') case "$man3dir" in
8358 *) dflt="$man3ext";;
8365 : see if we have to deal with yellow pages, now NIS.
8366 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
8367 if $test -f /usr/etc/nibindd; then
8369 echo "I'm fairly confident you're on a NeXT."
8371 rp='Do you get the hosts file via NetInfo?'
8380 y*) hostcat='nidump hosts .';;
8381 *) case "$hostcat" in
8382 nidump*) hostcat='';;
8392 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
8400 rp='Are you getting the hosts file via yellow pages?'
8403 y*) hostcat='ypcat hosts';;
8404 *) hostcat='cat /etc/hosts';;
8410 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
8413 '') test -f /etc/group && groupcat='cat /etc/group';;
8416 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
8419 : now get the host name
8421 echo "Figuring out host name..." >&4
8422 case "$myhostname" in
8424 echo 'Maybe "hostname" will work...'
8425 if tans=`sh -c hostname 2>&1` ; then
8433 if $test "$cont"; then
8435 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
8436 if tans=`cat /etc/systemid 2>&1` ; then
8438 phostname='cat /etc/systemid'
8439 echo "Whadyaknow. Xenix always was a bit strange..."
8442 elif $test -r /etc/systemid; then
8443 echo "(What is a non-Xenix system doing with /etc/systemid?)"
8446 if $test "$cont"; then
8447 echo 'No, maybe "uuname -l" will work...'
8448 if tans=`sh -c 'uuname -l' 2>&1` ; then
8450 phostname='uuname -l'
8452 echo 'Strange. Maybe "uname -n" will work...'
8453 if tans=`sh -c 'uname -n' 2>&1` ; then
8455 phostname='uname -n'
8457 echo 'Oh well, maybe I can mine it out of whoami.h...'
8458 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
8459 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
8460 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
8462 case "$myhostname" in
8463 '') echo "Does this machine have an identity crisis or something?"
8466 echo "Well, you said $myhostname before..."
8467 phostname='echo $myhostname';;
8473 case "$myhostname" in
8474 '') myhostname=noname ;;
8476 : you do not want to know about this
8481 if $test "$myhostname" ; then
8483 rp='Your host name appears to be "'$myhostname'".'" Right?"
8491 : bad guess or no guess
8492 while $test "X$myhostname" = X ; do
8494 rp="Please type the (one word) name of your host:"
8499 : translate upper to lower if necessary
8500 case "$myhostname" in
8502 echo "(Normalizing case in your host name)"
8503 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
8507 case "$myhostname" in
8509 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
8510 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
8511 echo "(Trimming domain name from host name--host name is now $myhostname)"
8513 *) case "$mydomain" in
8516 test "X$hostcat" = "Xypcat hosts" &&
8517 ypmatch "$myhostname" hosts 2>/dev/null |\
8518 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
8521 test "X$hostcat" != "X" &&
8522 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
8523 /[ ]$myhostname[ . ]/p" > hosts
8526 if $test -f hosts; then
8527 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
8528 END { print sum }" hosts` = x1 || tmp_re="[ ]"
8529 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
8530 hosts | $sort | $uniq | \
8531 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
8532 case `$echo X$dflt` in
8533 X*\ *) echo "(Several hosts in the database matched hostname)"
8536 X.) echo "(You do not have fully-qualified names in the hosts database)"
8540 echo "(I cannot locate a hosts database anywhere)"
8545 tans=`./loc resolv.conf X /etc /usr/etc`
8546 if $test -f "$tans"; then
8547 echo "(Attempting domain name extraction from $tans)"
8548 dflt=.`$sed -n -e 's/ / /g' \
8549 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
8550 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8552 .) dflt=.`$sed -n -e 's/ / /g' \
8553 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
8554 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8561 .) echo "(No help from resolv.conf either -- attempting clever guess)"
8562 dflt=.`sh -c domainname 2>/dev/null`
8565 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
8569 case "$dflt$osname" in
8570 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
8571 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
8575 .) echo "(Lost all hope -- silly guess then)"
8581 *) dflt="$mydomain";;
8585 rp="What is your domain name?"
8595 : translate upper to lower if necessary
8598 echo "(Normalizing case in your domain name)"
8599 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
8603 : a little sanity check here
8604 case "$phostname" in
8607 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
8608 $myhostname$mydomain|$myhostname) ;;
8610 case "$phostname" in
8612 echo "(That doesn't agree with your whoami.h file, by the way.)"
8615 echo "(That doesn't agree with your $phostname command, by the way.)"
8625 I need to get your e-mail address in Internet format if possible, i.e.
8626 something like user@host.domain. Please answer accurately since I have
8627 no easy means to double check it. The default value provided below
8628 is most probably close to reality but may not be valid from outside
8629 your organization...
8633 while test "$cont"; do
8635 '') dflt="$cf_by@$myhostname$mydomain";;
8636 *) dflt="$cf_email";;
8638 rp='What is your e-mail address?'
8644 rp='Address does not look like an Internet one. Use it anyway?'
8660 If you or somebody else will be maintaining perl at your site, please
8661 fill in the correct e-mail address here so that they may be contacted
8662 if necessary. Currently, the "perlbug" program included with perl
8663 will send mail to this address in addition to perlbug@perl.org. You may
8664 enter "none" for no administrator.
8667 case "$perladmin" in
8668 '') dflt="$cf_email";;
8669 *) dflt="$perladmin";;
8671 rp='Perl administrator e-mail address'
8675 : determine whether to only install version-specific parts.
8678 Do you want to install only the version-specific parts of the perl
8679 distribution? Usually you do *not* want to do this.
8681 case "$versiononly" in
8682 "$define"|[Yy]*|true) dflt='y' ;;
8685 rp="Do you want to install only the version-specific parts of perl?"
8688 [yY]*) val="$define";;
8694 case "$versiononly" in
8695 "$define") inc_version_list=''
8696 inc_version_list_init=0
8700 : figure out how to guarantee perl startup
8701 : XXX Note that this currently takes advantage of the bug that binexp ignores
8702 : the Configure -Dinstallprefix setting, which in turn means that under
8703 : relocatable @INC, initialinstalllocation is what binexp started as.
8704 case "$startperl" in
8706 case "$sharpbang" in
8710 I can use the #! construct to start perl on your system. This will
8711 make startup of perl scripts faster, but may cause problems if you
8712 want to share those scripts and perl is not in a standard place
8713 ($initialinstalllocation/perl) on all your platforms. The alternative
8714 is to force a shell by starting the script with a single ':' character.
8717 case "$versiononly" in
8718 "$define") dflt="$initialinstalllocation/perl$version";;
8719 *) dflt="$initialinstalllocation/perl";;
8721 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
8724 none) startperl=": # use perl";;
8725 *) startperl="#!$ans"
8726 if $test 30 -lt `echo "$ans" | wc -c`; then
8729 WARNING: Some systems limit the #! command to 32 characters.
8730 If you experience difficulty running Perl scripts with #!, try
8731 installing Perl in a directory with a shorter pathname.
8737 *) startperl=": # use perl"
8742 echo "I'll use $startperl to start perl scripts."
8744 : figure best path for perl in scripts
8747 case "$versiononly" in
8748 "$define") perlpath="$initialinstalllocation/perl$version";;
8749 *) perlpath="$initialinstalllocation/perl";;
8751 case "$startperl" in
8756 I will use the "eval 'exec'" idiom to start Perl on your system.
8757 I can use the full path of your Perl binary for this purpose, but
8758 doing so may cause problems if you want to share those scripts and
8759 Perl is not always in a standard place ($initialinstalllocation/perl).
8762 dflt="$initialinstalllocation/perl"
8763 rp="What path shall I use in \"eval 'exec'\"?"
8770 case "$startperl" in
8772 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
8775 : determine where public executable scripts go
8776 set scriptdir scriptdir
8778 case "$scriptdir" in
8781 : guess some guesses
8782 $test -d /usr/share/scripts && dflt=/usr/share/scripts
8783 $test -d /usr/share/bin && dflt=/usr/share/bin
8784 $test -d /usr/local/script && dflt=/usr/local/script
8785 $test -d /usr/local/scripts && dflt=/usr/local/scripts
8786 $test -d $prefixexp/script && dflt=$prefixexp/script
8790 *) dflt="$scriptdir"
8795 Some installations have a separate directory just for executable scripts so
8796 that they can mount it across multiple architectures but keep the scripts in
8797 one spot. You might, for example, have a subdirectory of /usr/share for this.
8798 Or you might just lump your scripts in with all your other executables.
8802 rp='Where do you keep publicly executable scripts?'
8804 if $test "X$ansexp" != "X$scriptdirexp"; then
8810 : A little fix up for an irregularly named variable.
8811 installscript="$installscriptdir"
8813 : determine where add-on public executables go
8815 '') dflt=$siteprefix/bin ;;
8819 rp='Pathname where the add-on public executables should be installed?'
8824 : determine where add-on html pages go
8825 : There is no standard location, so try to copy the previously-selected
8826 : directory structure for the core html pages.
8827 case "$sitehtml1dir" in
8828 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
8829 *) dflt=$sitehtml1dir ;;
8832 ''|' ') dflt=none ;;
8835 rp='Pathname where the site-specific html pages should be installed?'
8837 prefixvar=sitehtml1dir
8840 : determine where add-on library html pages go
8841 : There is no standard location, so try to copy the previously-selected
8842 : directory structure for the core html pages.
8843 case "$sitehtml3dir" in
8844 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
8845 *) dflt=$sitehtml3dir ;;
8848 ''|' ') dflt=none ;;
8851 rp='Pathname where the site-specific library html pages should be installed?'
8853 prefixvar=sitehtml3dir
8856 : determine where add-on manual pages go
8857 case "$siteman1dir" in
8858 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
8859 *) dflt=$siteman1dir ;;
8862 ''|' ') dflt=none ;;
8865 rp='Pathname where the site-specific manual pages should be installed?'
8867 prefixvar=siteman1dir
8870 : determine where add-on library man pages go
8871 case "$siteman3dir" in
8872 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
8873 *) dflt=$siteman3dir ;;
8876 ''|' ') dflt=none ;;
8879 rp='Pathname where the site-specific library manual pages should be installed?'
8881 prefixvar=siteman3dir
8884 : determine where add-on public executable scripts go
8885 case "$sitescript" in
8886 '') dflt=$siteprefix/script
8887 $test -d $dflt || dflt=$sitebin ;;
8888 *) dflt="$sitescript" ;;
8891 rp='Pathname where add-on public executable scripts should be installed?'
8893 prefixvar=sitescript
8896 case "$usefaststdio" in
8897 $define|true|[yY]*|'')
8898 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
8908 Perl can be built to use 'fast stdio', which means using the stdio
8909 library but also directly manipulating the stdio buffers to enable
8910 faster I/O. Using stdio is better for backward compatibility (especially
8911 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
8912 interface has been preferred instead of stdio.
8914 If this doesn't make any sense to you, just accept the default '$dflt'.
8916 rp='Use the "fast stdio" if available?'
8919 y|Y) val="$define" ;;
8926 : define an is-a-typedef? function
8927 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8929 "") inclist="sys/types.h";;
8931 eval "varval=\$$var";
8935 for inc in $inclist; do
8936 echo "#include <$inc>" >>temp.c;
8938 echo "#ifdef $type" >> temp.c;
8939 echo "printf(\"We have $type\");" >> temp.c;
8940 echo "#endif" >> temp.c;
8941 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8942 if $contains $type temp.E >/dev/null 2>&1; then
8948 *) eval "$var=\$varval";;
8951 : define an is-a-typedef? function that prompts if the type is not available.
8952 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8954 "") inclist="sys/types.h";;
8956 eval "varval=\$$var";
8960 for inc in $inclist; do
8961 echo "#include <$inc>" >>temp.c;
8963 echo "#ifdef $type" >> temp.c;
8964 echo "printf(\"We have $type\");" >> temp.c;
8965 echo "#endif" >> temp.c;
8966 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8968 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
8969 if $contains $type temp.E >/dev/null 2>&1; then
8970 echo "$type found." >&4;
8973 echo "$type NOT found." >&4;
8979 *) eval "$var=\$varval";;
8982 : see what type lseek is declared as in the kernel
8983 rp="What is the type used for lseek's offset on this system?"
8984 set off_t lseektype long stdio.h sys/types.h
8988 echo "Checking to see how big your file offsets are..." >&4
8990 #include <sys/types.h>
8994 printf("%d\n", (int)sizeof($lseektype));
8999 if eval $compile_ok; then
9000 lseeksize=`$run ./try`
9001 echo "Your file offsets are $lseeksize bytes long."
9005 echo "(I can't seem to compile the test program. Guessing...)"
9006 rp="What is the size of your file offsets (in bytes)?"
9012 : see what type file positions are declared as in the library
9013 rp="What is the type for file position used by fsetpos()?"
9014 set fpos_t fpostype long stdio.h sys/types.h
9019 *_t) zzz="$fpostype" ;;
9022 echo "Checking the size of $zzz..." >&4
9024 #include <sys/types.h>
9031 printf("%d\n", (int)sizeof($fpostype));
9036 if eval $compile_ok; then
9040 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9043 echo "Your $zzz is $fpossize bytes long."
9049 echo "(I can't compile the test program. Guessing...)" >&4
9050 rp="What is the size of your file positions (in bytes)?"
9055 # Backward compatibility (uselfs is deprecated).
9057 "$define"|true|[yY]*)
9060 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
9062 uselargefiles="$define"
9066 case "$lseeksize:$fpossize" in
9069 You can have files larger than 2 gigabytes.
9072 *) case "$uselargefiles" in
9073 "$undef"|false|[nN]*) dflt='n' ;;
9078 Perl can be built to understand large files (files larger than 2 gigabytes)
9079 on some systems. To do so, Configure can be run with -Duselargefiles.
9081 If this doesn't make any sense to you, just accept the default '$dflt'.
9083 rp='Try to understand large files, if available?'
9086 y|Y) val="$define" ;;
9093 : Look for a hint-file generated 'call-back-unit'. If the
9094 : user has specified that a large files perl is to be built,
9095 : we may need to set or change some other defaults.
9096 if $test -f uselargefiles.cbu; then
9097 echo "Your platform has some specific hints regarding large file builds, using them..."
9098 . ./uselargefiles.cbu
9100 case "$uselargefiles" in
9102 if $test -f uselargefiles.cbu; then
9104 echo "Rechecking to see how big your file offsets are..." >&4
9106 #include <sys/types.h>
9110 printf("%d\n", (int)sizeof($lseektype));
9115 if eval $compile_ok; then
9116 lseeksize=`$run ./try`
9117 $echo "Your file offsets are now $lseeksize bytes long."
9121 echo "(I can't seem to compile the test program. Guessing...)"
9122 rp="What is the size of your file offsets (in bytes)?"
9127 *_t) zzz="$fpostype" ;;
9130 $echo $n "Rechecking the size of $zzz...$c" >&4
9132 #include <sys/types.h>
9139 printf("%d\n", (int)sizeof($fpostype));
9144 if eval $compile_ok; then
9149 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9152 echo " $fpossize bytes." >&4
9158 echo "(I can't compile the test program. Guessing...)" >&4
9159 rp="What is the size of your file positions (in bytes)?"
9168 case "$vendorprefix" in
9169 '') d_vendorbin="$undef"
9173 *) d_vendorbin="$define"
9174 : determine where vendor-supplied executables go.
9175 case "$vendorbin" in
9176 '') dflt=$vendorprefix/bin ;;
9177 *) dflt="$vendorbin" ;;
9180 rp='Pathname for the vendor-supplied executables directory?'
9183 vendorbinexp="$ansexp"
9189 case "$vendorprefix" in
9190 '') vendorhtml1dir=''
9191 vendorhtml1direxp=''
9193 *) : determine where vendor-supplied html pages go.
9194 : There is no standard location, so try to copy the previously-selected
9195 : directory structure for the core html pages.
9196 : XXX Better default suggestions would be welcome.
9197 case "$vendorhtml1dir" in
9198 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9199 *) dflt=$vendorhtml1dir ;;
9202 ''|' ') dflt=none ;;
9205 rp='Pathname for the vendor-supplied html pages?'
9207 vendorhtml1dir="$ans"
9208 vendorhtml1direxp="$ansexp"
9211 : Use ' ' for none so value is preserved next time through Configure
9212 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9213 prefixvar=vendorhtml1dir
9216 case "$vendorprefix" in
9217 '') vendorhtml3dir=''
9218 vendorhtml3direxp=''
9220 *) : determine where vendor-supplied module html pages go.
9221 : There is no standard location, so try to copy the previously-selected
9222 : directory structure for the core html pages.
9223 : XXX Better default suggestions would be welcome.
9224 case "$vendorhtml3dir" in
9225 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9226 *) dflt=$vendorhtml3dir ;;
9229 ''|' ') dflt=none ;;
9232 rp='Pathname for the vendor-supplied html pages?'
9234 vendorhtml3dir="$ans"
9235 vendorhtml3direxp="$ansexp"
9238 : Use ' ' for none so value is preserved next time through Configure
9239 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9240 prefixvar=vendorhtml3dir
9243 case "$vendorprefix" in
9244 '') vendorman1dir=''
9247 *) : determine where vendor-supplied manual pages go.
9248 case "$vendorman1dir" in
9249 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9250 *) dflt=$vendorman1dir ;;
9253 ''|' ') dflt=none ;;
9256 rp='Pathname for the vendor-supplied manual section 1 pages?'
9258 vendorman1dir="$ans"
9259 vendorman1direxp="$ansexp"
9262 : Use ' ' for none so value is preserved next time through Configure
9263 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
9264 prefixvar=vendorman1dir
9267 case "$vendorprefix" in
9268 '') vendorman3dir=''
9271 *) : determine where vendor-supplied module manual pages go.
9272 case "$vendorman3dir" in
9273 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9274 *) dflt=$vendorman3dir ;;
9277 ''|' ') dflt=none ;;
9280 rp='Pathname for the vendor-supplied manual section 3 pages?'
9282 vendorman3dir="$ans"
9283 vendorman3direxp="$ansexp"
9286 : Use ' ' for none so value is preserved next time through Configure
9287 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
9288 prefixvar=vendorman3dir
9291 case "$vendorprefix" in
9292 '') d_vendorscript="$undef"
9296 *) d_vendorscript="$define"
9297 : determine where vendor-supplied scripts go.
9298 case "$vendorscript" in
9299 '') dflt=$vendorprefix/script
9300 $test -d $dflt || dflt=$vendorbin ;;
9301 *) dflt="$vendorscript" ;;
9305 The installation process will create a directory for
9306 vendor-supplied scripts.
9310 rp='Pathname for the vendor-supplied scripts directory?'
9313 vendorscriptexp="$ansexp"
9316 prefixvar=vendorscript
9319 : see if qgcvt exists
9325 if $test X"$d_longdbl" = X"$define"; then
9327 echo "Checking how to print long doubles..." >&4
9329 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
9330 $cat >try.c <<'EOCP'
9331 #include <sys/types.h>
9335 printf("%.3f\n", d);
9339 if eval $compile; then
9343 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
9344 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
9345 echo "We will use %f."
9351 if $test X"$sPRIfldbl" = X; then
9352 $cat >try.c <<'EOCP'
9353 #include <sys/types.h>
9356 long double d = 123.456;
9357 printf("%.3Lf\n", d);
9361 if eval $compile; then
9365 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
9366 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
9367 echo "We will use %Lf."
9373 if $test X"$sPRIfldbl" = X; then
9374 $cat >try.c <<'EOCP'
9375 #include <sys/types.h>
9378 long double d = 123.456;
9379 printf("%.3llf\n", d);
9383 if eval $compile; then
9387 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
9388 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
9389 echo "We will use %llf."
9395 if $test X"$sPRIfldbl" = X; then
9396 $cat >try.c <<'EOCP'
9397 #include <sys/types.h>
9400 long double d = 123.456;
9401 printf("%.3lf\n", d);
9405 if eval $compile; then
9409 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
9410 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
9411 echo "We will use %lf."
9417 if $test X"$sPRIfldbl" = X; then
9418 echo "Cannot figure out how to print long doubles." >&4
9420 sSCNfldbl=$sPRIfldbl # expect consistency
9427 case "$sPRIfldbl" in
9428 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
9429 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
9430 d_SCNfldbl="$undef";
9432 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
9433 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
9434 d_SCNfldbl="$define";
9438 : Check how to convert floats to strings.
9440 if test "X$d_Gconvert" = X; then
9443 echo "Checking for an efficient way to convert floats to strings."
9445 case "$uselongdouble" in
9446 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
9448 case "$d_longdbl" in
9449 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
9451 case "$d_PRIgldbl" in
9452 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
9456 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
9457 char *myname = "gconvert";
9460 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
9461 char *myname = "gcvt";
9464 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
9465 char *myname = "qgcvt";
9466 #define DOUBLETYPE long double
9469 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9471 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
9473 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
9476 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
9478 char *myname = "sprintf";
9482 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9483 #define DOUBLETYPE long double
9485 #define DOUBLETYPE double
9491 #define I_STDLIB $i_stdlib
9497 checkit(expect, got)
9501 if (strcmp(expect, got)) {
9502 printf("%s oddity: Expected %s, got %s\n",
9503 myname, expect, got);
9513 /* This must be 1st test on (which?) platform */
9514 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
9515 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
9516 checkit("0.1", buf);
9518 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
9519 checkit("0.01", buf);
9521 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
9522 checkit("0.001", buf);
9524 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
9525 checkit("0.0001", buf);
9527 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
9528 if (strlen(buf) > 5)
9529 checkit("9e-005", buf); /* for Microsoft ?? */
9531 checkit("9e-05", buf);
9533 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
9536 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
9537 checkit("1.1", buf);
9539 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
9540 checkit("1.01", buf);
9542 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
9543 checkit("1.001", buf);
9545 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
9546 checkit("1.0001", buf);
9548 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
9549 checkit("1.00001", buf);
9551 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
9552 checkit("1.000001", buf);
9554 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
9557 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
9560 /* Some Linux gcvt's give 1.e+5 here. */
9561 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
9562 checkit("100000", buf);
9564 /* Some Linux gcvt's give -1.e+5 here. */
9565 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
9566 checkit("-100000", buf);
9568 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
9569 checkit("123.456", buf);
9571 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
9572 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
9573 /* 34 should be enough to scare even long double
9574 * places into using the e notation. */
9575 if (strlen(buf) > 5)
9576 checkit("1e+034", buf); /* for Microsoft */
9578 checkit("1e+34", buf);
9580 /* For Perl, if you add additional tests here, also add them to
9581 * t/base/num.t for benefit of platforms not using Configure or
9582 * overriding d_Gconvert */
9587 : first add preferred functions to our list
9589 for xxx_convert in $gconvert_preference; do
9590 case $xxx_convert in
9591 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
9592 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
9595 : then add any others
9596 for xxx_convert in gconvert gcvt sprintf; do
9599 *) xxx_list="$xxx_list $xxx_convert" ;;
9603 case "$d_longdbl$uselongdouble" in
9605 : again, add prefered functions to our list first
9607 for xxx_convert in $gconvert_ld_preference; do
9608 case $xxx_convert in
9609 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9610 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
9613 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
9614 for xxx_convert in qgcvt sprintf $xxx_list; do
9615 case "$xxx_ld_list" in
9616 $xxx_convert*|*" $xxx_convert"*) ;;
9617 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9620 : if sprintf cannot do long doubles, move it to the end
9621 if test "$d_PRIgldbl" != "$define"; then
9622 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
9624 : if no qgcvt, remove it
9625 if test "$d_qgcvt" != "$define"; then
9626 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
9629 xxx_list="$xxx_ld_list"
9633 for xxx_convert in $xxx_list; do
9634 echo "Trying $xxx_convert..."
9635 $rm -f try try$_o core
9636 set try -DTRY_$xxx_convert
9637 if eval $compile; then
9638 echo "$xxx_convert() found." >&4
9640 echo "I'll use $xxx_convert to convert floats into a string." >&4
9643 echo "...But $xxx_convert didn't work as I expected."
9647 echo "$xxx_convert NOT found." >&4
9651 if test X$xxx_convert = X; then
9652 echo "*** WHOA THERE!!! ***" >&4
9653 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
9657 case "$xxx_convert" in
9658 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
9659 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
9660 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
9661 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
9662 "$define$define$define")
9663 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
9664 "$define$define$undef")
9665 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
9666 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
9674 : see if _fwalk exists
9678 : Initialize h_fcntl
9681 : Initialize h_sysfile
9684 : access call always available on UNIX
9688 : locate the flags for 'access()'
9692 $cat >access.c <<EOCP
9693 #include <sys/types.h>
9698 #include <sys/file.h>
9711 : check sys/file.h first, no particular reason here
9712 if $test `./findhdr sys/file.h` && \
9713 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
9715 echo "<sys/file.h> defines the *_OK access constants." >&4
9716 elif $test `./findhdr fcntl.h` && \
9717 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
9719 echo "<fcntl.h> defines the *_OK access constants." >&4
9720 elif $test `./findhdr unistd.h` && \
9721 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
9722 echo "<unistd.h> defines the *_OK access constants." >&4
9724 echo "I can't find the four *_OK access constants--I'll use mine." >&4
9730 : see if accessx exists
9731 set accessx d_accessx
9734 : see if aintl exists
9738 : see if alarm exists
9742 : see if POSIX threads are available
9743 set pthread.h i_pthread
9746 : define a fucntion to check prototypes
9747 $cat > protochk <<EOSH
9750 optimize="$optimize"
9752 prototype="$prototype"
9755 usethreads=$usethreads
9756 i_pthread=$i_pthread
9757 pthread_h_first=$pthread_h_first
9760 $cat >> protochk <<'EOSH'
9765 while test $# -ge 2; do
9767 $define) echo "#include <$2>" >> try.c ;;
9768 literal) echo "$2" >> try.c ;;
9770 # Extra magic for the benefit of systems that need pthread.h
9771 # to be included early to correctly detect threadsafe functions.
9772 # Such functions must guarantee themselves, though, that the usethreads
9773 # and i_pthread have been defined, before calling protochk.
9774 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
9775 echo "#include <pthread.h>" >> try.c
9780 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
9781 cat >> try.c <<'EOCP'
9782 #ifdef CAN_PROTOTYPE
9783 #define _(args) args
9788 echo "$foo" >> try.c
9789 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
9790 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
9798 hasproto='varname=$1; func=$2; shift; shift;
9799 while $test $# -ge 2; do
9801 $define) echo "#include <$2>";;
9805 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
9806 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
9807 echo "$func() prototype found.";
9810 echo "$func() prototype NOT found.";
9817 : see if sys/types.h has to be included
9818 set sys/types.h i_systypes
9821 : see if sys/select.h has to be included
9822 set sys/select.h i_sysselct
9825 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
9826 while $test $# -ge 2; do
9828 $define) echo "#include <$2>";;
9832 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
9834 if eval $compile; then
9843 : see if we should include time.h, sys/time.h, or both
9845 if test "X$timeincl" = X; then
9846 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
9847 $echo $n "I'm now running the test program...$c"
9849 #include <sys/types.h>
9854 #ifdef SYSTIMEKERNEL
9857 #include <sys/time.h>
9860 #include <sys/select.h>
9873 struct timezone tzp;
9875 if (foo.tm_sec == foo.tm_sec)
9878 if (bar.tv_sec == bar.tv_sec)
9885 for s_timezone in '-DS_TIMEZONE' ''; do
9887 for s_timeval in '-DS_TIMEVAL' ''; do
9888 for i_systimek in '' '-DSYSTIMEKERNEL'; do
9889 for i_time in '' '-DI_TIME'; do
9890 for i_systime in '-DI_SYSTIME' ''; do
9893 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
9894 if eval $compile; then
9895 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
9899 $echo $n "Succeeded with $flags$c"
9911 *SYSTIMEKERNEL*) i_systimek="$define"
9912 timeincl=`./findhdr sys/time.h`
9913 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
9914 *) i_systimek="$undef";;
9917 *I_TIME*) i_time="$define"
9918 timeincl=`./findhdr time.h`" $timeincl"
9919 echo "We'll include <time.h>." >&4;;
9920 *) i_time="$undef";;
9923 *I_SYSTIME*) i_systime="$define"
9924 timeincl=`./findhdr sys/time.h`" $timeincl"
9925 echo "We'll include <sys/time.h>." >&4;;
9926 *) i_systime="$undef";;
9930 : see if struct tm knows about tm_zone
9931 case "$i_systime$i_time" in
9934 echo "Checking to see if your struct tm has tm_zone field..." >&4
9935 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
9943 case "$d_tm_tm_zone" in
9944 "$define") echo "Yes, it does." ;;
9945 *) echo "No, it doesn't." ;;
9947 : see if struct tm knows about tm_gmtoff
9948 case "$i_systime$i_time" in
9951 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
9952 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
9960 case "$d_tm_tm_gmtoff" in
9961 "$define") echo "Yes, it does." ;;
9962 *) echo "No, it doesn't." ;;
9965 : see if asctime_r exists
9966 set asctime_r d_asctime_r
9968 case "$d_asctime_r" in
9970 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
9971 case "$d_asctime_r_proto:$usethreads" in
9972 ":define") d_asctime_r_proto=define
9973 set d_asctime_r_proto asctime_r $hdrs
9977 case "$d_asctime_r_proto" in
9979 case "$asctime_r_proto" in
9980 ''|0) try='char* asctime_r(const struct tm*, char*);'
9981 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SB ;;
9983 case "$asctime_r_proto" in
9984 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
9985 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SBI ;;
9987 case "$asctime_r_proto" in
9988 ''|0) try='int asctime_r(const struct tm*, char*);'
9989 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SB ;;
9991 case "$asctime_r_proto" in
9992 ''|0) try='int asctime_r(const struct tm*, char*, int);'
9993 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SBI ;;
9995 case "$asctime_r_proto" in
9996 ''|0) d_asctime_r=undef
9998 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
9999 * ) case "$asctime_r_proto" in
10000 REENTRANT_PROTO*) ;;
10001 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
10003 echo "Prototype: $try" ;;
10006 *) case "$usethreads" in
10007 define) echo "asctime_r has no prototype, not using it." >&4 ;;
10014 *) asctime_r_proto=0
10018 : see if atolf exists
10022 : see if atoll exists
10026 : Look for GCC-style attribute format
10027 case "$d_attribute_format" in
10030 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
10031 $cat >attrib.c <<'EOCP'
10033 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
10035 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10036 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10037 echo "Your C compiler doesn't support __attribute__((format))."
10040 echo "Your C compiler supports __attribute__((format))."
10044 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10048 *) val="$d_attribute_format" ;;
10050 set d_attribute_format
10054 : Look for GCC-style attribute format with null format allowed
10055 case "$d_printf_format_null" in
10056 '') case "$d_attribute_format" in
10059 echo "Checking whether your compiler allows __printf__ format to be null ..." >&4
10060 $cat >attrib.c <<EOCP
10062 #$i_stdlib I_STDLIB
10064 #include <stdlib.h>
10066 int null_printf (char* pat,...) __attribute__((__format__(__printf__,1,2)));
10067 int null_printf (char* pat,...) { return (int)pat; }
10068 int main () { exit(null_printf(NULL)); }
10070 if $cc $ccflags -o attrib attrib.c >attrib.out 2>&1 ; then
10071 : run the executable in case it produces a run-time warning
10072 if $run ./attrib >>attrib.out 2>&1; then
10073 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10074 echo "Your C compiler doesn't allow __printf__ format to be null."
10077 echo "Your C compiler allows __printf__ format to be null."
10081 echo "Your C compiler executable failed with __printf__ format null."
10085 echo "Your C compiler fails with __printf__ format null."
10092 *) val="$d_printf_format_null" ;;
10094 set d_printf_format_null
10098 : Look for GCC-style attribute malloc
10099 case "$d_attribute_malloc" in
10102 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
10103 $cat >attrib.c <<'EOCP'
10105 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
10107 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10108 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10109 echo "Your C compiler doesn't support __attribute__((malloc))."
10112 echo "Your C compiler supports __attribute__((malloc))."
10116 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10120 *) val="$d_attribute_malloc" ;;
10122 set d_attribute_malloc
10126 : Look for GCC-style attribute nonnull
10127 case "$d_attribute_nonnull" in
10130 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
10131 $cat >attrib.c <<'EOCP'
10133 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
10135 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10136 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10137 echo "Your C compiler doesn't support __attribute__((nonnull))."
10140 echo "Your C compiler supports __attribute__((nonnull))."
10144 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10148 *) val="$d_attribute_nonnull" ;;
10150 set d_attribute_nonnull
10154 : Look for GCC-style attribute noreturn
10155 case "$d_attribute_noreturn" in
10158 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
10159 $cat >attrib.c <<'EOCP'
10161 void fall_over_dead( void ) __attribute__((noreturn));
10163 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10164 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10165 echo "Your C compiler doesn't support __attribute__((noreturn))."
10168 echo "Your C compiler supports __attribute__((noreturn))."
10172 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10176 *) val="$d_attribute_noreturn" ;;
10178 set d_attribute_noreturn
10182 : Look for GCC-style attribute pure
10183 case "$d_attribute_pure" in
10186 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
10187 $cat >attrib.c <<'EOCP'
10189 int square( int n ) __attribute__((pure));
10191 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10192 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10193 echo "Your C compiler doesn't support __attribute__((pure))."
10196 echo "Your C compiler supports __attribute__((pure))."
10200 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10204 *) val="$d_attribute_pure" ;;
10206 set d_attribute_pure
10210 : Look for GCC-style attribute unused
10211 case "$d_attribute_unused" in
10214 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
10215 $cat >attrib.c <<'EOCP'
10217 int do_something( int dummy __attribute__((unused)), int n );
10219 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10220 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10221 echo "Your C compiler doesn't support __attribute__((unused))."
10224 echo "Your C compiler supports __attribute__((unused))."
10228 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10232 *) val="$d_attribute_unused" ;;
10234 set d_attribute_unused
10238 : Look for GCC-style attribute warn_unused_result
10239 case "$d_attribute_warn_unused_result" in
10242 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
10243 $cat >attrib.c <<'EOCP'
10245 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
10247 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10248 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10249 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
10252 echo "Your C compiler supports __attribute__((warn_unused_result))."
10256 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10260 *) val="$d_attribute_warn_unused_result" ;;
10262 set d_attribute_warn_unused_result
10266 : see if bcmp exists
10270 : see if bcopy exists
10274 : see if getpgrp exists
10275 set getpgrp d_getpgrp
10278 case "$d_getpgrp" in
10281 echo "Checking to see which flavor of getpgrp is in use..."
10283 #$i_unistd I_UNISTD
10284 #include <sys/types.h>
10286 # include <unistd.h>
10288 #$i_stdlib I_STDLIB
10290 #include <stdlib.h>
10294 if (getuid() == 0) {
10295 printf("(I see you are running Configure as super-user...)\n");
10298 #ifdef TRY_BSD_PGRP
10299 if (getpgrp(1) == 0)
10308 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10309 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
10311 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10312 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
10315 echo "I can't seem to compile and run the test program."
10317 xxx="a USG one, i.e. you use getpgrp()."
10319 # SVR4 systems can appear rather BSD-ish.
10320 case "$i_unistd" in
10322 xxx="a BSD one, i.e. you use getpgrp(pid)."
10326 xxx="probably a USG one, i.e. you use getpgrp()."
10331 echo "Assuming your getpgrp is $xxx" >&4
10340 : see if setpgrp exists
10341 set setpgrp d_setpgrp
10344 case "$d_setpgrp" in
10347 echo "Checking to see which flavor of setpgrp is in use..."
10349 #$i_unistd I_UNISTD
10350 #include <sys/types.h>
10352 # include <unistd.h>
10354 #$i_stdlib I_STDLIB
10356 #include <stdlib.h>
10360 if (getuid() == 0) {
10361 printf("(I see you are running Configure as super-user...)\n");
10364 #ifdef TRY_BSD_PGRP
10365 if (-1 == setpgrp(1, 1))
10368 if (setpgrp() != -1)
10374 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10375 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
10377 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10378 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
10381 echo "(I can't seem to compile and run the test program.)"
10383 xxx="a USG one, i.e. you use setpgrp()."
10385 # SVR4 systems can appear rather BSD-ish.
10386 case "$i_unistd" in
10388 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
10392 xxx="probably a USG one, i.e. you use setpgrp()."
10397 echo "Assuming your setpgrp is $xxx" >&4
10406 : Look for GCC-style __builtin_choose_expr
10407 case "$d_builtin_choose_expr" in
10410 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
10411 $cat >try.c <<'EOCP'
10412 #include <assert.h>
10413 #include <stdlib.h>
10416 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
10419 assert( SYRINX(1) == 2112 );
10420 assert( SYRINX(1) != 5150 );
10421 assert( SYRINX(0) == 5150 );
10422 assert( SYRINX(0) != 2112 );
10423 puts( "All good!" );
10429 if eval $compile; then
10430 echo "Your C compiler supports __builtin_choose_expr."
10433 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
10437 *) val="$d_builtin_choose_expr" ;;
10440 set d_builtin_choose_expr
10444 : Look for GCC-style __builtin_expect
10445 case "$d_builtin_expect" in
10448 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
10449 $cat >builtin.c <<'EOCP'
10452 if ( __builtin_expect(n, 0) ) n = 1;
10456 if eval $compile; then
10457 echo "Your C compiler supports __builtin_choose_expr."
10460 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
10464 *) val="$d_builtin_expect" ;;
10467 set d_builtin_expect
10471 : see if bzero exists
10475 : see if stdarg is available
10477 if $test `./findhdr stdarg.h`; then
10478 echo "<stdarg.h> found." >&4
10481 echo "<stdarg.h> NOT found." >&4
10485 : see if varags is available
10487 if $test `./findhdr varargs.h`; then
10488 echo "<varargs.h> found." >&4
10490 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
10493 : set up the varargs testing programs
10494 $cat > varargs.c <<EOP
10496 #include <stdarg.h>
10499 #include <varargs.h>
10503 int f(char *p, ...)
10517 p = va_arg(ap, char *);
10523 $cat > varargs <<EOP
10525 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
10534 : now check which varargs header should be included
10539 if `./varargs I_STDARG`; then
10541 elif `./varargs I_VARARGS`; then
10546 if `./varargs I_VARARGS`; then
10553 echo "I could not find the definition for va_dcl... You have problems..." >&4
10554 val="$undef"; set i_stdarg; eval $setvar
10555 val="$undef"; set i_varargs; eval $setvar
10560 case "$i_varhdr" in
10562 val="$define"; set i_stdarg; eval $setvar
10563 val="$undef"; set i_varargs; eval $setvar
10566 val="$undef"; set i_stdarg; eval $setvar
10567 val="$define"; set i_varargs; eval $setvar
10570 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
10574 : see if the Compiler supports C99 variadic macros
10575 case "$i_stdarg$i_stdlib" in
10577 echo "You have <stdarg.h> and <stdlib.h>, so checking for C99 variadic macros." >&4
10580 #include <stdarg.h>
10582 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
10586 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
10592 if eval $compile && $run ./try 2>&1 >/dev/null; then
10593 case "`$run ./try`" in
10595 echo "You have C99 variadic macros." >&4
10596 d_c99_variadic_macros="$define"
10599 echo "You don't have functional C99 variadic macros." >&4
10600 d_c99_variadic_macros="$undef"
10604 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
10605 d_c99_variadic_macros="$undef"
10610 echo "You don't have <stdarg.h> and <stdlib.h>, so not checking for C99 variadic macros." >&4
10611 d_c99_variadic_macros="$undef"
10615 : see if signal is declared as pointer to function returning int or void
10617 xxx=`./findhdr signal.h`
10618 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
10619 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10620 echo "You have int (*signal())() instead of void." >&4
10622 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10623 echo "You have void (*signal())()." >&4
10625 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
10626 echo "You have int (*signal())() instead of void." >&4
10628 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
10629 echo "You have void (*signal())()." >&4
10632 case "$d_voidsig" in
10634 echo "I can't determine whether signal handler returns void or int..." >&4
10636 rp="What type does your signal handler return?"
10639 v*) val="$define";;
10643 echo "As you already told me, signal handler returns void." >&4
10646 *) echo "As you already told me, signal handler returns int." >&4
10653 case "$d_voidsig" in
10654 "$define") signal_t="void";;
10655 *) signal_t="int";;
10659 : check for ability to cast large floats to 32-bit ints.
10661 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
10662 if $test "$intsize" -ge 4; then
10669 #$i_stdlib I_STDLIB
10671 #include <stdlib.h>
10673 #include <sys/types.h>
10674 #include <signal.h>
10675 $signal_t blech(int s) { exit(3); }
10682 signal(SIGFPE, blech);
10684 /* Don't let compiler optimize the test away. Store the number
10685 in a writable string for gcc to pass to sscanf under HP/UX.
10687 sprintf(str, "2147483647");
10688 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
10692 /* x86 processors will probably give 0x8000 0000, which is a
10693 sign change. We don't want that. We want to mimic SPARC
10694 behavior here, which is to preserve the sign and give
10697 if (i32 != ($xxx) f)
10703 if eval $compile_ok; then
10707 echo "(I can't seem to compile the test program--assuming it can't)"
10712 echo "Yup, it can."
10715 echo "Nope, it can't."
10722 : check for ability to cast negative floats to unsigned
10724 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
10727 #$i_stdlib I_STDLIB
10729 #include <stdlib.h>
10731 #include <sys/types.h>
10732 #include <signal.h>
10733 $signal_t blech(int s) { exit(7); }
10734 $signal_t blech_in_list(int s) { exit(4); }
10735 unsigned long dummy_long(unsigned long p) { return p; }
10736 unsigned int dummy_int(unsigned int p) { return p; }
10737 unsigned short dummy_short(unsigned short p) { return p; }
10741 unsigned long along;
10743 unsigned short ashort;
10747 /* Frustrate gcc-2.7.2's optimizer which failed this test with
10748 a direct f = -123. assignment. gcc-2.8.0 reportedly
10749 optimized the whole file away
10751 /* Store the number in a writable string for gcc to pass to
10752 sscanf under HP/UX.
10754 sprintf(str, "-123");
10755 sscanf(str, "%lf", &f); /* f = -123.; */
10757 signal(SIGFPE, blech);
10758 along = (unsigned long)f;
10759 aint = (unsigned int)f;
10760 ashort = (unsigned short)f;
10761 if (along != (unsigned long)-123)
10763 if (aint != (unsigned int)-123)
10765 if (ashort != (unsigned short)-123)
10767 sprintf(str, "1073741824.");
10768 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
10771 along = (unsigned long)f;
10772 if (along != 0x80000000)
10776 along = (unsigned long)f;
10777 if (along != 0x7fffffff)
10781 along = (unsigned long)f;
10782 if (along != 0x80000001)
10786 signal(SIGFPE, blech_in_list);
10787 sprintf(str, "123.");
10788 sscanf(str, "%lf", &f); /* f = 123.; */
10789 along = dummy_long((unsigned long)f);
10790 aint = dummy_int((unsigned int)f);
10791 ashort = dummy_short((unsigned short)f);
10792 if (along != (unsigned long)123)
10794 if (aint != (unsigned int)123)
10796 if (ashort != (unsigned short)123)
10803 if eval $compile_ok; then
10807 echo "(I can't seem to compile the test program--assuming it can't)"
10810 case "$castflags" in
10812 echo "Yup, it can."
10815 echo "Nope, it can't."
10822 : see if vprintf exists
10824 if set vprintf val -f d_vprintf; eval $csym; $val; then
10825 echo 'vprintf() found.' >&4
10828 #$i_stdarg I_STDARG /* Only one of these can be defined by i_varhrd */
10829 #$i_varargs I_VARARGS
10831 #$i_stdlib I_STDLIB
10832 #$i_unistd I_UNISTD
10835 # include <stdarg.h>
10836 #else /* I_VARARGS */
10837 # include <varargs.h>
10841 # include <unistd.h>
10845 # include <stdlib.h>
10848 #include <stdio.h> /* vsprintf prototype */
10851 void xxx(int n, ...)
10856 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
10858 int main() { xxx(1, "foo"); }
10860 #else /* I_VARARGS */
10868 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
10870 int main() { xxx("foo"); }
10876 if eval $compile_ok; then
10877 if $run ./try; then
10878 echo "Your vsprintf() returns (int)." >&4
10881 echo "Your vsprintf() returns (char*)." >&4
10885 echo 'I am unable to compile the vsprintf() test program.' >&4
10886 # We shouldn't get here. If we do, assume the standard signature,
10887 # not the old BSD one.
10888 echo 'Guessing that vsprintf() returns (int).' >&4
10892 echo 'vprintf() NOT found.' >&4
10903 : see if chown exists
10907 : see if chroot exists
10908 set chroot d_chroot
10911 : see if chsize exists
10912 set chsize d_chsize
10915 : see if class exists
10919 : see if clearenv exists
10920 set clearenv d_clearenv
10923 hasstruct='varname=$1; struct=$2; shift; shift;
10924 while $test $# -ge 2; do
10926 $define) echo "#include <$2>";;
10930 echo "int main () { struct $struct foo; }" >> try.c;
10932 if eval $compile; then
10943 : see whether socket exists
10945 $echo $n "Hmm... $c" >&4
10946 if set socket val -f d_socket; eval $csym; $val; then
10947 echo "Looks like you have Berkeley networking support." >&4
10949 if set setsockopt val -f; eval $csym; $val; then
10952 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
10953 d_oldsock="$define"
10956 if $contains socklib libc.list >/dev/null 2>&1; then
10957 echo "Looks like you have Berkeley networking support." >&4
10959 : we will have to assume that it supports the 4.2 BSD interface
10962 echo "You don't have Berkeley networking in libc$_a..." >&4
10963 if test "X$d_socket" = "X$define"; then
10964 echo "...but you seem to believe that you have sockets." >&4
10966 for net in net socket
10968 if test -f /usr/lib/lib$net$_a; then
10969 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
10970 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
10971 if $contains socket libc.list >/dev/null 2>&1; then
10976 echo "...but the Wollongong group seems to have hacked it in." >&4
10977 sockethdr="-I/usr/netinclude"
10980 echo "Found Berkeley sockets interface in lib$net." >&4
10981 if $contains setsockopt libc.list >/dev/null 2>&1; then
10984 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
10985 d_oldsock="$define"
10991 if test "X$d_socket" != "X$define"; then
10992 echo "or anywhere else I see." >&4
11000 : see if socketpair exists
11001 set socketpair d_sockpair
11006 echo "Checking the availability of certain socket constants..." >&4
11007 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
11008 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
11010 #include <sys/types.h>
11011 #include <sys/socket.h>
11017 set try; if eval $compile; then
11020 set d_${enum}; eval $setvar
11024 : see if this is a sys/uio.h system
11025 set sys/uio.h i_sysuio
11030 echo "Checking to see if your system supports struct cmsghdr..." >&4
11031 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
11033 case "$d_cmsghdr_s" in
11034 "$define") echo "Yes, it does." ;;
11035 *) echo "No, it doesn't." ;;
11039 : check for const keyword
11041 echo 'Checking to see if your C compiler knows about "const"...' >&4
11042 $cat >const.c <<'EOCP'
11043 typedef struct spug { int drokk; } spug;
11047 const spug y = { 0 };
11050 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
11052 echo "Yup, it does."
11055 echo "Nope, it doesn't."
11060 : see if copysignl exists
11061 set copysignl d_copysignl
11064 : see if crypt exists
11069 $define) cryptlib='' ;;
11070 *) if set crypt val -f d_crypt; eval $csym; $val; then
11071 echo 'crypt() found.' >&4
11075 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
11076 if $test -z "$cryptlib"; then
11077 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
11081 if $test -z "$cryptlib"; then
11082 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
11086 if $test -z "$cryptlib"; then
11087 cryptlib=`./loc libcrypt$_a "" $libpth`
11091 if $test -z "$cryptlib"; then
11092 echo 'crypt() NOT found.' >&4
11103 : see if this is a crypt.h system
11104 set crypt.h i_crypt
11107 : see if crypt_r exists
11108 set crypt_r d_crypt_r
11110 case "$d_crypt_r" in
11112 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
11113 case "$d_crypt_r_proto:$usethreads" in
11114 ":define") d_crypt_r_proto=define
11115 set d_crypt_r_proto crypt_r $hdrs
11119 case "$d_crypt_r_proto" in
11121 case "$crypt_r_proto" in
11122 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
11123 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCS ;;
11125 case "$crypt_r_proto" in
11126 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
11127 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCD ;;
11129 case "$crypt_r_proto" in
11130 ''|0) d_crypt_r=undef
11132 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
11133 * ) case "$crypt_r_proto" in
11134 REENTRANT_PROTO*) ;;
11135 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
11137 echo "Prototype: $try" ;;
11140 *) case "$usethreads" in
11141 define) echo "crypt_r has no prototype, not using it." >&4 ;;
11152 : get csh whereabouts
11154 'csh') val="$undef" ;;
11155 *) val="$define" ;;
11159 : Respect a hint or command line value for full_csh.
11160 case "$full_csh" in
11161 '') full_csh=$csh ;;
11164 : see if ctermid exists
11165 set ctermid d_ctermid
11168 : see if ctermid_r exists
11169 set ctermid_r d_ctermid_r
11171 case "$d_ctermid_r" in
11173 hdrs="$i_systypes sys/types.h define stdio.h "
11174 case "$d_ctermid_r_proto:$usethreads" in
11175 ":define") d_ctermid_r_proto=define
11176 set d_ctermid_r_proto ctermid_r $hdrs
11180 case "$d_ctermid_r_proto" in
11182 case "$ctermid_r_proto" in
11183 ''|0) try='char* ctermid_r(char*);'
11184 ./protochk "extern $try" $hdrs && ctermid_r_proto=B_B ;;
11186 case "$ctermid_r_proto" in
11187 ''|0) d_ctermid_r=undef
11189 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
11190 * ) case "$ctermid_r_proto" in
11191 REENTRANT_PROTO*) ;;
11192 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
11194 echo "Prototype: $try" ;;
11197 *) case "$usethreads" in
11198 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
11205 *) ctermid_r_proto=0
11209 : see if ctime_r exists
11210 set ctime_r d_ctime_r
11212 case "$d_ctime_r" in
11214 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
11215 case "$d_ctime_r_proto:$usethreads" in
11216 ":define") d_ctime_r_proto=define
11217 set d_ctime_r_proto ctime_r $hdrs
11221 case "$d_ctime_r_proto" in
11223 case "$ctime_r_proto" in
11224 ''|0) try='char* ctime_r(const time_t*, char*);'
11225 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SB ;;
11227 case "$ctime_r_proto" in
11228 ''|0) try='char* ctime_r(const time_t*, char*, int);'
11229 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SBI ;;
11231 case "$ctime_r_proto" in
11232 ''|0) try='int ctime_r(const time_t*, char*);'
11233 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SB ;;
11235 case "$ctime_r_proto" in
11236 ''|0) try='int ctime_r(const time_t*, char*, int);'
11237 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SBI ;;
11239 case "$ctime_r_proto" in
11240 ''|0) d_ctime_r=undef
11242 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
11243 * ) case "$ctime_r_proto" in
11244 REENTRANT_PROTO*) ;;
11245 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
11247 echo "Prototype: $try" ;;
11250 *) case "$usethreads" in
11251 define) echo "ctime_r has no prototype, not using it." >&4 ;;
11262 : see if cuserid exists
11263 set cuserid d_cuserid
11266 : see if this is a limits.h system
11267 set limits.h i_limits
11270 : see if this is a float.h system
11271 set float.h i_float
11274 : See if number of significant digits in a double precision number is known
11276 $cat >dbl_dig.c <<EOM
11277 #$i_limits I_LIMITS
11280 #include <limits.h>
11286 printf("Contains DBL_DIG");
11289 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
11290 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
11291 echo "DBL_DIG found." >&4
11294 echo "DBL_DIG NOT found." >&4
11301 : see if dbm.h is available
11302 : see if dbmclose exists
11303 set dbmclose d_dbmclose
11306 case "$d_dbmclose" in
11316 *) set rpcsvc/dbm.h i_rpcsvcdbm
11321 *) echo "We won't be including <dbm.h>"
11331 : see if prototype for dbminit is available
11333 set d_dbminitproto dbminit $i_dbm dbm.h
11336 : see if difftime exists
11337 set difftime d_difftime
11340 : see if this is a dirent system
11342 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
11344 echo "<dirent.h> found." >&4
11347 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
11348 echo "<sys/dir.h> found." >&4
11351 xinc=`./findhdr sys/ndir.h`
11353 echo "<dirent.h> NOT found." >&4
11358 : Look for type of directory structure.
11360 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11362 case "$direntrytype" in
11364 case "$i_dirent" in
11365 $define) guess1='struct dirent' ;;
11366 *) guess1='struct direct' ;;
11369 *) guess1="$direntrytype"
11374 'struct dirent') guess2='struct direct' ;;
11375 *) guess2='struct dirent' ;;
11378 if $contains "$guess1" try.c >/dev/null 2>&1; then
11379 direntrytype="$guess1"
11380 echo "Your directory entries are $direntrytype." >&4
11381 elif $contains "$guess2" try.c >/dev/null 2>&1; then
11382 direntrytype="$guess2"
11383 echo "Your directory entries seem to be $direntrytype." >&4
11385 echo "I don't recognize your system's directory entries." >&4
11386 rp="What type is used for directory entries on this system?"
11389 direntrytype="$ans"
11393 : see if the directory entry stores field length
11395 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11396 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
11397 echo "Good, your directory entry keeps length information in d_namlen." >&4
11400 echo "Your directory entry does not know about the d_namlen field." >&4
11407 : Look for DIR.dd_fd
11408 case "$i_dirent" in
11410 echo "Checking to see if DIR has a dd_fd member variable" >&4
11412 #$i_stdlib I_STDLIB
11414 #include <stdlib.h>
11416 #include <dirent.h>
11426 if eval $compile; then
11427 echo "Yes, it does."
11430 echo "No, it does not."
11435 echo "You don't have a <dirent.h>, so not checking for dd_fd." >&4
11443 : see if this is an sysdir system
11444 set sys/dir.h i_sysdir
11447 : see if this is an sysndir system
11448 set sys/ndir.h i_sysndir
11453 $cat >dirfd.c <<EOM
11455 #$i_stdlib I_STDLIB
11457 #include <stdlib.h>
11459 #$i_dirent I_DIRENT /**/
11460 #$i_sysdir I_SYS_DIR /**/
11461 #$i_sysndir I_SYS_NDIR /**/
11462 #$i_systypes I_SYS_TYPES /**/
11463 #if defined(I_SYS_TYPES)
11464 #include <sys/types.h>
11466 #if defined(I_DIRENT)
11467 #include <dirent.h>
11468 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
11469 #include <sys/dir.h>
11473 #include <sys/ndir.h>
11477 #include <ndir.h> /* may be wrong in the future */
11479 #include <sys/dir.h>
11485 DIR *dirp = opendir(".");
11486 if (dirfd(dirp) >= 0)
11494 if eval $compile; then
11498 $define) echo "dirfd() found." >&4 ;;
11499 *) echo "dirfd() NOT found." >&4 ;;
11505 : see if dlerror exists
11508 set dlerror d_dlerror
11512 : see if dlfcn is available
11513 set dlfcn.h i_dlfcn
11520 On a few systems, the dynamically loaded modules that perl generates and uses
11521 will need a different extension than shared libs. The default will probably
11527 *) dflt="$dlext" ;;
11529 rp='What is the extension of dynamically loaded modules'
11538 : Check if dlsym need a leading underscore
11544 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
11545 $cat >dyna.c <<'EOM'
11552 #$i_stdlib I_STDLIB
11554 #include <stdlib.h>
11558 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
11560 #include <sys/types.h>
11565 extern int fred() ;
11574 int mode = RTLD_LAZY ;
11576 handle = dlopen("./dyna.$dlext", mode) ;
11577 if (handle == NULL) {
11582 symbol = dlsym(handle, "fred") ;
11583 if (symbol == NULL) {
11584 /* try putting a leading underscore */
11585 symbol = dlsym(handle, "_fred") ;
11586 if (symbol == NULL) {
11599 : Call the object file tmp-dyna.o in case dlext=o.
11600 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
11601 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
11602 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
11603 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
11606 1) echo "Test program failed using dlopen." >&4
11607 echo "Perhaps you should not use dynamic loading." >&4;;
11608 2) echo "Test program failed using dlsym." >&4
11609 echo "Perhaps you should not use dynamic loading." >&4;;
11610 3) echo "dlsym needs a leading underscore" >&4
11612 4) echo "dlsym doesn't need a leading underscore." >&4;;
11615 echo "I can't compile and run the test program." >&4
11616 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
11621 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
11626 : see if drand48_r exists
11627 set drand48_r d_drand48_r
11629 case "$d_drand48_r" in
11631 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
11632 case "$d_drand48_r_proto:$usethreads" in
11633 ":define") d_drand48_r_proto=define
11634 set d_drand48_r_proto drand48_r $hdrs
11638 case "$d_drand48_r_proto" in
11640 case "$drand48_r_proto" in
11641 ''|0) try='int drand48_r(struct drand48_data*, double*);'
11642 ./protochk "extern $try" $hdrs && drand48_r_proto=I_ST ;;
11644 case "$drand48_r_proto" in
11645 ''|0) d_drand48_r=undef
11647 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
11648 * ) case "$drand48_r_proto" in
11649 REENTRANT_PROTO*) ;;
11650 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
11652 echo "Prototype: $try" ;;
11655 *) case "$usethreads" in
11656 define) echo "drand48_r has no prototype, not using it." >&4 ;;
11663 *) drand48_r_proto=0
11667 : see if prototype for drand48 is available
11669 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
11672 : see if dup2 exists
11676 : see if eaccess exists
11677 set eaccess d_eaccess
11680 : see if endgrent exists
11681 set endgrent d_endgrent
11684 : see if this is an grp system
11690 xxx=`./findhdr grp.h`
11691 $cppstdin $cppflags $cppminus < $xxx >$$.h
11693 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
11705 set d_grpasswd; eval $setvar
11709 : see if endgrent_r exists
11710 set endgrent_r d_endgrent_r
11712 case "$d_endgrent_r" in
11714 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
11715 case "$d_endgrent_r_proto:$usethreads" in
11716 ":define") d_endgrent_r_proto=define
11717 set d_endgrent_r_proto endgrent_r $hdrs
11721 case "$d_endgrent_r_proto" in
11723 case "$endgrent_r_proto" in
11724 ''|0) try='int endgrent_r(FILE**);'
11725 ./protochk "extern $try" $hdrs && endgrent_r_proto=I_H ;;
11727 case "$endgrent_r_proto" in
11728 ''|0) try='void endgrent_r(FILE**);'
11729 ./protochk "extern $try" $hdrs && endgrent_r_proto=V_H ;;
11731 case "$endgrent_r_proto" in
11732 ''|0) d_endgrent_r=undef
11734 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
11735 * ) case "$endgrent_r_proto" in
11736 REENTRANT_PROTO*) ;;
11737 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
11739 echo "Prototype: $try" ;;
11742 *) case "$usethreads" in
11743 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
11750 *) endgrent_r_proto=0
11754 : see if endhostent exists
11755 set endhostent d_endhent
11758 : see if this is a netdb.h system
11759 set netdb.h i_netdb
11762 : see if endhostent_r exists
11763 set endhostent_r d_endhostent_r
11765 case "$d_endhostent_r" in
11767 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11768 case "$d_endhostent_r_proto:$usethreads" in
11769 ":define") d_endhostent_r_proto=define
11770 set d_endhostent_r_proto endhostent_r $hdrs
11774 case "$d_endhostent_r_proto" in
11776 case "$endhostent_r_proto" in
11777 ''|0) try='int endhostent_r(struct hostent_data*);'
11778 ./protochk "extern $try" $hdrs && endhostent_r_proto=I_D ;;
11780 case "$endhostent_r_proto" in
11781 ''|0) try='void endhostent_r(struct hostent_data*);'
11782 ./protochk "extern $try" $hdrs && endhostent_r_proto=V_D ;;
11784 case "$endhostent_r_proto" in
11785 ''|0) d_endhostent_r=undef
11786 endhostent_r_proto=0
11787 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
11788 * ) case "$endhostent_r_proto" in
11789 REENTRANT_PROTO*) ;;
11790 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
11792 echo "Prototype: $try" ;;
11795 *) case "$usethreads" in
11796 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
11798 d_endhostent_r=undef
11799 endhostent_r_proto=0
11803 *) endhostent_r_proto=0
11807 : see if endnetent exists
11808 set endnetent d_endnent
11811 : see if endnetent_r exists
11812 set endnetent_r d_endnetent_r
11814 case "$d_endnetent_r" in
11816 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11817 case "$d_endnetent_r_proto:$usethreads" in
11818 ":define") d_endnetent_r_proto=define
11819 set d_endnetent_r_proto endnetent_r $hdrs
11823 case "$d_endnetent_r_proto" in
11825 case "$endnetent_r_proto" in
11826 ''|0) try='int endnetent_r(struct netent_data*);'
11827 ./protochk "extern $try" $hdrs && endnetent_r_proto=I_D ;;
11829 case "$endnetent_r_proto" in
11830 ''|0) try='void endnetent_r(struct netent_data*);'
11831 ./protochk "extern $try" $hdrs && endnetent_r_proto=V_D ;;
11833 case "$endnetent_r_proto" in
11834 ''|0) d_endnetent_r=undef
11835 endnetent_r_proto=0
11836 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
11837 * ) case "$endnetent_r_proto" in
11838 REENTRANT_PROTO*) ;;
11839 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
11841 echo "Prototype: $try" ;;
11844 *) case "$usethreads" in
11845 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
11847 d_endnetent_r=undef
11848 endnetent_r_proto=0
11852 *) endnetent_r_proto=0
11856 : see if endprotoent exists
11857 set endprotoent d_endpent
11860 : see if endprotoent_r exists
11861 set endprotoent_r d_endprotoent_r
11863 case "$d_endprotoent_r" in
11865 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11866 case "$d_endprotoent_r_proto:$usethreads" in
11867 ":define") d_endprotoent_r_proto=define
11868 set d_endprotoent_r_proto endprotoent_r $hdrs
11872 case "$d_endprotoent_r_proto" in
11874 case "$endprotoent_r_proto" in
11875 ''|0) try='int endprotoent_r(struct protoent_data*);'
11876 ./protochk "extern $try" $hdrs && endprotoent_r_proto=I_D ;;
11878 case "$endprotoent_r_proto" in
11879 ''|0) try='void endprotoent_r(struct protoent_data*);'
11880 ./protochk "extern $try" $hdrs && endprotoent_r_proto=V_D ;;
11882 case "$endprotoent_r_proto" in
11883 ''|0) d_endprotoent_r=undef
11884 endprotoent_r_proto=0
11885 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
11886 * ) case "$endprotoent_r_proto" in
11887 REENTRANT_PROTO*) ;;
11888 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
11890 echo "Prototype: $try" ;;
11893 *) case "$usethreads" in
11894 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
11896 d_endprotoent_r=undef
11897 endprotoent_r_proto=0
11901 *) endprotoent_r_proto=0
11905 : see if endpwent exists
11906 set endpwent d_endpwent
11909 : see if this is a pwd.h system
11915 xxx=`./findhdr pwd.h`
11916 $cppstdin $cppflags $cppminus < $xxx >$$.h
11918 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
11926 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
11934 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
11942 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
11950 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
11958 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
11966 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
11974 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
11986 set d_pwquota; eval $setvar
11987 set d_pwage; eval $setvar
11988 set d_pwchange; eval $setvar
11989 set d_pwclass; eval $setvar
11990 set d_pwexpire; eval $setvar
11991 set d_pwcomment; eval $setvar
11992 set d_pwgecos; eval $setvar
11993 set d_pwpasswd; eval $setvar
11997 : see if endpwent_r exists
11998 set endpwent_r d_endpwent_r
12000 case "$d_endpwent_r" in
12002 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
12003 case "$d_endpwent_r_proto:$usethreads" in
12004 ":define") d_endpwent_r_proto=define
12005 set d_endpwent_r_proto endpwent_r $hdrs
12009 case "$d_endpwent_r_proto" in
12011 case "$endpwent_r_proto" in
12012 ''|0) try='int endpwent_r(FILE**);'
12013 ./protochk "extern $try" $hdrs && endpwent_r_proto=I_H ;;
12015 case "$endpwent_r_proto" in
12016 ''|0) try='void endpwent_r(FILE**);'
12017 ./protochk "extern $try" $hdrs && endpwent_r_proto=V_H ;;
12019 case "$endpwent_r_proto" in
12020 ''|0) d_endpwent_r=undef
12022 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
12023 * ) case "$endpwent_r_proto" in
12024 REENTRANT_PROTO*) ;;
12025 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
12027 echo "Prototype: $try" ;;
12030 *) case "$usethreads" in
12031 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
12038 *) endpwent_r_proto=0
12042 : see if endservent exists
12043 set endservent d_endsent
12046 : see if endservent_r exists
12047 set endservent_r d_endservent_r
12049 case "$d_endservent_r" in
12051 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12052 case "$d_endservent_r_proto:$usethreads" in
12053 ":define") d_endservent_r_proto=define
12054 set d_endservent_r_proto endservent_r $hdrs
12058 case "$d_endservent_r_proto" in
12060 case "$endservent_r_proto" in
12061 ''|0) try='int endservent_r(struct servent_data*);'
12062 ./protochk "extern $try" $hdrs && endservent_r_proto=I_D ;;
12064 case "$endservent_r_proto" in
12065 ''|0) try='void endservent_r(struct servent_data*);'
12066 ./protochk "extern $try" $hdrs && endservent_r_proto=V_D ;;
12068 case "$endservent_r_proto" in
12069 ''|0) d_endservent_r=undef
12070 endservent_r_proto=0
12071 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
12072 * ) case "$endservent_r_proto" in
12073 REENTRANT_PROTO*) ;;
12074 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
12076 echo "Prototype: $try" ;;
12079 *) case "$usethreads" in
12080 define) echo "endservent_r has no prototype, not using it." >&4 ;;
12082 d_endservent_r=undef
12083 endservent_r_proto=0
12087 *) endservent_r_proto=0
12091 : Locate the flags for 'open()'
12094 #include <sys/types.h>
12099 #include <sys/file.h>
12101 #$i_stdlib I_STDLIB
12103 #include <stdlib.h>
12114 : check sys/file.h first to get FREAD on Sun
12115 if $test `./findhdr sys/file.h` && \
12116 set try -DI_SYS_FILE && eval $compile; then
12118 echo "<sys/file.h> defines the O_* constants..." >&4
12119 if $run ./try; then
12120 echo "and you have the 3 argument form of open()." >&4
12123 echo "but not the 3 argument form of open(). Oh, well." >&4
12126 elif $test `./findhdr fcntl.h` && \
12127 set try -DI_FCNTL && eval $compile; then
12129 echo "<fcntl.h> defines the O_* constants..." >&4
12130 if $run ./try; then
12131 echo "and you have the 3 argument form of open()." >&4
12134 echo "but not the 3 argument form of open(). Oh, well." >&4
12139 echo "I can't find the O_* constant definitions! You got problems." >&4
12145 : see which of string.h or strings.h is needed
12147 strings=`./findhdr string.h`
12148 if $test "$strings" && $test -r "$strings"; then
12149 echo "Using <string.h> instead of <strings.h>." >&4
12153 strings=`./findhdr strings.h`
12154 if $test "$strings" && $test -r "$strings"; then
12155 echo "Using <strings.h> instead of <string.h>." >&4
12157 echo "No string header found -- You'll surely have problems." >&4
12162 case "$i_string" in
12163 "$undef") strings=`./findhdr strings.h`;;
12164 *) strings=`./findhdr string.h`;;
12167 : see if this is a sys/file.h system
12172 : do we need to include sys/file.h ?
12176 if $h_sysfile; then
12178 echo "We'll be including <sys/file.h>." >&4
12181 echo "We won't be including <sys/file.h>." >&4
12191 : see if fcntl.h is there
12196 : see if we can include fcntl.h
12202 echo "We'll be including <fcntl.h>." >&4
12205 if $h_sysfile; then
12206 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
12208 echo "We won't be including <fcntl.h>." >&4
12220 : see if fork exists
12224 : see if pipe exists
12228 : check for non-blocking I/O stuff
12229 case "$h_sysfile" in
12230 true) echo "#include <sys/file.h>" > head.c;;
12233 true) echo "#include <fcntl.h>" > head.c;;
12234 *) echo "#include <sys/fcntl.h>" > head.c;;
12239 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
12240 case "$o_nonblock" in
12242 $cat head.c > try.c
12243 $cat >>try.c <<EOCP
12245 #$i_stdlib I_STDLIB
12247 #include <stdlib.h>
12255 printf("O_NONBLOCK\n");
12259 printf("O_NDELAY\n");
12263 printf("FNDELAY\n");
12270 if eval $compile_ok; then
12271 o_nonblock=`$run ./try`
12272 case "$o_nonblock" in
12273 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
12274 *) echo "Seems like we can use $o_nonblock.";;
12277 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
12280 *) echo "Using $hint value $o_nonblock.";;
12285 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
12288 case "$d_fork:$d_pipe" in
12290 $cat head.c > try.c
12291 $cat >>try.c <<EOCP
12293 #include <sys/types.h>
12294 #include <signal.h>
12296 #$i_stdlib I_STDLIB
12298 #include <stdlib.h>
12304 #define MY_O_NONBLOCK $o_nonblock
12305 #ifndef errno /* XXX need better Configure test */
12308 #$i_unistd I_UNISTD
12310 #include <unistd.h>
12312 #$i_string I_STRING
12314 #include <string.h>
12316 #include <strings.h>
12318 $signal_t blech(int x) { exit(3); }
12320 $cat >> try.c <<'EOCP'
12328 pipe(pd); /* Down: child -> parent */
12329 pipe(pu); /* Up: parent -> child */
12332 close(pd[1]); /* Parent reads from pd[0] */
12333 close(pu[0]); /* Parent writes (blocking) to pu[1] */
12335 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
12340 signal(SIGALRM, blech);
12342 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
12344 sprintf(string, "%d\n", ret);
12345 write(2, string, strlen(string));
12348 if (errno == EAGAIN) {
12349 printf("EAGAIN\n");
12354 if (errno == EWOULDBLOCK)
12355 printf("EWOULDBLOCK\n");
12358 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
12359 sleep(2); /* Give it time to close our pipe */
12361 ret = read(pd[0], buf, 1); /* Should read EOF */
12363 sprintf(string, "%d\n", ret);
12364 write(4, string, strlen(string));
12368 close(pd[0]); /* We write to pd[1] */
12369 close(pu[1]); /* We read from pu[0] */
12370 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
12371 close(pd[1]); /* Pipe pd is now fully closed! */
12372 exit(0); /* Bye bye, thank you for playing! */
12376 if eval $compile_ok; then
12377 echo "$startsh" >mtry
12378 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
12380 ./mtry >/dev/null 2>&1
12382 0) eagain=`$cat try.out`;;
12383 1) echo "Could not perform non-blocking setting!";;
12384 2) echo "I did a successful read() for something that was not there!";;
12385 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
12386 4) echo "Could not find F_SETFL!";;
12387 *) echo "Something terribly wrong happened during testing.";;
12389 rd_nodata=`$cat try.ret`
12390 echo "A read() system call with no data present returns $rd_nodata."
12391 case "$rd_nodata" in
12394 echo "(That's peculiar, fixing that to be -1.)"
12400 echo "Forcing errno EAGAIN on read() with no data available."
12404 echo "Your read() sets errno to $eagain when no data is available."
12407 status=`$cat try.err`
12409 0) echo "And it correctly returns 0 to signal EOF.";;
12410 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
12411 *) echo "However, your read() returns '$status' on EOF??";;
12414 if test "$status" = "$rd_nodata"; then
12415 echo "WARNING: you can't distinguish between EOF and no data!"
12419 echo "I can't compile the test program--assuming errno EAGAIN will do."
12423 *) echo "Can't figure out how to test this--assuming errno EAGAIN will do."
12432 echo "Using $hint value $eagain."
12433 echo "Your read() returns $rd_nodata when no data is present."
12434 case "$d_eofnblk" in
12435 "$define") echo "And you can see EOF because read() returns 0.";;
12436 "$undef") echo "But you can't see EOF status from read() returned value.";;
12438 echo "(Assuming you can't see EOF status from read anyway.)"
12444 $rm_try head.c mtry
12446 : see if _ptr and _cnt from stdio act std
12449 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
12450 echo "(Looks like you have stdio.h from BSD.)"
12451 case "$stdio_ptr" in
12452 '') stdio_ptr='((fp)->_p)'
12455 *) ptr_lval=$d_stdio_ptr_lval;;
12457 case "$stdio_cnt" in
12458 '') stdio_cnt='((fp)->_r)'
12461 *) cnt_lval=$d_stdio_cnt_lval;;
12463 case "$stdio_base" in
12464 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
12466 case "$stdio_bufsiz" in
12467 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
12469 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
12470 echo "(Looks like you have stdio.h from Linux.)"
12471 case "$stdio_ptr" in
12472 '') stdio_ptr='((fp)->_IO_read_ptr)'
12475 *) ptr_lval=$d_stdio_ptr_lval;;
12477 case "$stdio_cnt" in
12478 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
12481 *) cnt_lval=$d_stdio_cnt_lval;;
12483 case "$stdio_base" in
12484 '') stdio_base='((fp)->_IO_read_base)';;
12486 case "$stdio_bufsiz" in
12487 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
12490 case "$stdio_ptr" in
12491 '') stdio_ptr='((fp)->_ptr)'
12494 *) ptr_lval=$d_stdio_ptr_lval;;
12496 case "$stdio_cnt" in
12497 '') stdio_cnt='((fp)->_cnt)'
12500 *) cnt_lval=$d_stdio_cnt_lval;;
12502 case "$stdio_base" in
12503 '') stdio_base='((fp)->_base)';;
12505 case "$stdio_bufsiz" in
12506 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
12510 : test whether _ptr and _cnt really work
12511 echo "Checking how std your stdio is..." >&4
12514 #$i_stdlib I_STDLIB
12516 #include <stdlib.h>
12518 #define FILE_ptr(fp) $stdio_ptr
12519 #define FILE_cnt(fp) $stdio_cnt
12521 FILE *fp = fopen("try.c", "r");
12524 18 <= FILE_cnt(fp) &&
12525 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12533 if eval $compile && $to try.c; then
12534 if $run ./try; then
12535 echo "Your stdio acts pretty std."
12538 echo "Your stdio isn't very std."
12541 echo "Your stdio doesn't appear very std."
12545 # glibc 2.2.90 and above apparently change stdio streams so Perl's
12546 # direct buffer manipulation no longer works. The Configure tests
12547 # should be changed to correctly detect this, but until then,
12548 # the following check should at least let perl compile and run.
12549 # (This quick fix should be updated before 5.8.1.)
12550 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
12551 # A. Dougherty, June 3, 2002.
12552 case "$d_gnulibc" in
12554 case "$gnulibc_version" in
12558 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
12567 : Can _ptr be used as an lvalue?
12568 case "$d_stdstdio$ptr_lval" in
12569 $define$define) val=$define ;;
12572 set d_stdio_ptr_lval
12575 : Can _cnt be used as an lvalue?
12576 case "$d_stdstdio$cnt_lval" in
12577 $define$define) val=$define ;;
12580 set d_stdio_cnt_lval
12584 : test whether setting _ptr sets _cnt as a side effect
12585 d_stdio_ptr_lval_sets_cnt="$undef"
12586 d_stdio_ptr_lval_nochange_cnt="$undef"
12587 case "$d_stdio_ptr_lval$d_stdstdio" in
12589 echo "Checking to see what happens if we set the stdio ptr..." >&4
12592 /* Can we scream? */
12593 /* Eat dust sed :-) */
12594 /* In the buffer space, no one can hear you scream. */
12595 #$i_stdlib I_STDLIB
12597 #include <stdlib.h>
12599 #define FILE_ptr(fp) $stdio_ptr
12600 #define FILE_cnt(fp) $stdio_cnt
12601 #include <sys/types.h>
12603 FILE *fp = fopen("try.c", "r");
12608 puts("Fail even to read");
12611 c = getc(fp); /* Read away the first # */
12613 puts("Fail even to read");
12617 18 <= FILE_cnt(fp) &&
12618 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12620 puts("Fail even to read");
12623 ptr = (char*) FILE_ptr(fp);
12624 cnt = (size_t)FILE_cnt(fp);
12626 FILE_ptr(fp) += 42;
12628 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
12629 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
12632 if (FILE_cnt(fp) <= 20) {
12633 printf ("Fail (<20 chars to test)");
12636 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
12637 puts("Fail compare");
12640 if (cnt == FILE_cnt(fp)) {
12641 puts("Pass_unchanged");
12644 if (FILE_cnt(fp) == (cnt - 42)) {
12645 puts("Pass_changed");
12648 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
12654 if eval $compile && $to try.c; then
12655 case `$run ./try` in
12657 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
12658 d_stdio_ptr_lval_sets_cnt="$define" ;;
12660 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
12661 d_stdio_ptr_lval_nochange_cnt="$define" ;;
12663 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
12665 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
12668 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
12674 : see if _base is also standard
12676 case "$d_stdstdio" in
12680 #$i_stdlib I_STDLIB
12682 #include <stdlib.h>
12684 #define FILE_base(fp) $stdio_base
12685 #define FILE_bufsiz(fp) $stdio_bufsiz
12687 FILE *fp = fopen("try.c", "r");
12690 19 <= FILE_bufsiz(fp) &&
12691 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
12698 if eval $compile && $to try.c; then
12699 if $run ./try; then
12700 echo "And its _base field acts std."
12703 echo "But its _base field isn't std."
12706 echo "However, it seems to be lacking the _base field."
12714 : see if fast_stdio exists
12716 case "$d_stdstdio:$d_stdio_ptr_lval" in
12718 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
12720 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
12731 : see if fchdir exists
12732 set fchdir d_fchdir
12735 : see if fchmod exists
12736 set fchmod d_fchmod
12739 : see if fchown exists
12740 set fchown d_fchown
12743 : see if this is an fcntl system
12748 : See if fcntl-based locking works.
12750 #$i_stdlib I_STDLIB
12752 #include <stdlib.h>
12754 #include <unistd.h>
12756 #include <signal.h>
12757 $signal_t blech(int x) { exit(3); }
12759 #if defined(F_SETLK) && defined(F_SETLKW)
12760 struct flock flock;
12762 fd = open("try.c", O_RDONLY);
12763 flock.l_type = F_RDLCK;
12764 flock.l_whence = SEEK_SET;
12765 flock.l_start = flock.l_len = 0;
12766 signal(SIGALRM, blech);
12768 retval = fcntl(fd, F_SETLK, &flock);
12770 (retval < 0 ? exit(2) : exit(0));
12776 echo "Checking if fcntl-based file locking works... "
12780 if eval $compile_ok; then
12781 if $run ./try; then
12782 echo "Yes, it seems to work."
12785 echo "Nope, it didn't work."
12790 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
12791 *** This is (almost) impossible.
12792 *** If your NFS lock daemons are not feeling well, something like
12793 *** this may happen, please investigate. Cannot continue, aborting.
12801 echo "I'm unable to compile the test program, so I'll assume not."
12806 echo "Nope, since you don't even have fcntl()."
12809 set d_fcntl_can_lock
12813 : check for fd_set items
12816 Checking to see how well your C compiler handles fd_set and friends ...
12819 #$i_stdlib I_STDLIB
12821 #include <stdlib.h>
12823 #$i_systime I_SYS_TIME
12824 #$i_sysselct I_SYS_SELECT
12825 #$d_socket HAS_SOCKET
12826 #include <sys/types.h>
12828 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
12831 #include <sys/time.h>
12833 #ifdef I_SYS_SELECT
12834 #include <sys/select.h>
12843 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
12851 if eval $compile; then
12852 d_fds_bits="$define"
12854 echo "Well, your system knows about the normal fd_set typedef..." >&4
12855 if $run ./try; then
12856 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
12857 d_fd_macros="$define"
12860 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
12862 d_fd_macros="$undef"
12866 Hmm, your compiler has some difficulty with fd_set. Checking further...
12869 if eval $compile; then
12870 d_fds_bits="$undef"
12872 echo "Well, your system has some sort of fd_set available..." >&4
12873 if $run ./try; then
12874 echo "and you have the normal fd_set macros." >&4
12875 d_fd_macros="$define"
12878 but not the normal fd_set macros! Gross! More work for me...
12880 d_fd_macros="$undef"
12883 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
12885 d_fds_bits="$undef"
12886 d_fd_macros="$undef"
12891 : see if fgetpos exists
12892 set fgetpos d_fgetpos
12895 : see if finite exists
12896 set finite d_finite
12899 : see if finitel exists
12900 set finitel d_finitel
12903 : see if flock exists
12907 : see if prototype for flock is available
12909 set d_flockproto flock $i_sysfile sys/file.h
12912 : see if fp_class exists
12913 set fp_class d_fp_class
12916 : see if pathconf exists
12917 set pathconf d_pathconf
12920 : see if fpathconf exists
12921 set fpathconf d_fpathconf
12924 : see if fpclass exists
12925 set fpclass d_fpclass
12928 : see if fpclassify exists
12929 set fpclassify d_fpclassify
12932 : see if fpclassl exists
12933 set fpclassl d_fpclassl
12937 : check for fpos64_t
12939 echo "Checking to see if you have fpos64_t..." >&4
12942 int main() { fpos64_t x = 7; }
12945 if eval $compile; then
12947 echo "You have fpos64_t."
12950 echo "You do not have fpos64_t."
12951 case "$fpossize" in
12952 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
12959 : see if frexpl exists
12960 set frexpl d_frexpl
12963 : see if this is a sys/param system
12964 set sys/param.h i_sysparam
12967 : see if this is a sys/mount.h system
12968 set sys/mount.h i_sysmount
12973 echo "Checking to see if your system supports struct fs_data..." >&4
12974 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
12976 case "$d_fs_data_s" in
12977 "$define") echo "Yes, it does." ;;
12978 *) echo "No, it doesn't." ;;
12981 : see if fseeko exists
12982 set fseeko d_fseeko
12984 case "$longsize" in
12985 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
12988 : see if fsetpos exists
12989 set fsetpos d_fsetpos
12993 : see if fstatfs exists
12994 set fstatfs d_fstatfs
12998 : see if statvfs exists
12999 set statvfs d_statvfs
13002 : see if fstatvfs exists
13003 set fstatvfs d_fstatvfs
13007 : see if fsync exists
13011 : see if ftello exists
13012 set ftello d_ftello
13014 case "$longsize" in
13015 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
13019 : check for a working futimes
13021 echo "Checking if you have a working futimes()" >&4
13024 #include <sys/time.h>
13031 fd = open ("try.c", O_RDWR);
13032 if (-1 == fd) exit (1);
13033 rv = futimes (fd, NULL);
13034 exit (rv == -1 ? errno : 0);
13038 if eval $compile; then
13042 0) echo "Yes, you have" >&4
13043 d_futimes="$define"
13045 *) echo "No, you have futimes, but it isn't working ($rc) (probably harmless)" >&4
13049 echo "No, it does not (probably harmless)" >&4
13053 : see if getcwd exists
13054 set getcwd d_getcwd
13057 : see if getespwnam exists
13058 set getespwnam d_getespwnam
13062 : see if getfsstat exists
13063 set getfsstat d_getfsstat
13066 : see if getgrent exists
13067 set getgrent d_getgrent
13070 : see if getgrent_r exists
13071 set getgrent_r d_getgrent_r
13073 case "$d_getgrent_r" in
13075 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13076 case "$d_getgrent_r_proto:$usethreads" in
13077 ":define") d_getgrent_r_proto=define
13078 set d_getgrent_r_proto getgrent_r $hdrs
13082 case "$d_getgrent_r_proto" in
13084 case "$getgrent_r_proto" in
13085 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
13086 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBWR ;;
13088 case "$getgrent_r_proto" in
13089 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
13090 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIR ;;
13092 case "$getgrent_r_proto" in
13093 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
13094 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBW ;;
13096 case "$getgrent_r_proto" in
13097 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
13098 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBI ;;
13100 case "$getgrent_r_proto" in
13101 ''|0) try='int getgrent_r(struct group*, char*, int);'
13102 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBI ;;
13104 case "$getgrent_r_proto" in
13105 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
13106 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIH ;;
13108 case "$getgrent_r_proto" in
13109 ''|0) d_getgrent_r=undef
13111 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
13112 * ) case "$getgrent_r_proto" in
13113 REENTRANT_PROTO*) ;;
13114 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
13116 echo "Prototype: $try" ;;
13119 *) case "$usethreads" in
13120 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
13127 *) getgrent_r_proto=0
13131 : see if getgrgid_r exists
13132 set getgrgid_r d_getgrgid_r
13134 case "$d_getgrgid_r" in
13136 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13137 case "$d_getgrgid_r_proto:$usethreads" in
13138 ":define") d_getgrgid_r_proto=define
13139 set d_getgrgid_r_proto getgrgid_r $hdrs
13143 case "$d_getgrgid_r_proto" in
13145 case "$getgrgid_r_proto" in
13146 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
13147 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
13149 case "$getgrgid_r_proto" in
13150 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
13151 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
13153 case "$getgrgid_r_proto" in
13154 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
13155 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
13157 case "$getgrgid_r_proto" in
13158 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
13159 ./protochk "extern $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
13161 case "$getgrgid_r_proto" in
13162 ''|0) d_getgrgid_r=undef
13164 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
13165 * ) case "$getgrgid_r_proto" in
13166 REENTRANT_PROTO*) ;;
13167 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
13169 echo "Prototype: $try" ;;
13172 *) case "$usethreads" in
13173 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
13180 *) getgrgid_r_proto=0
13184 : see if getgrnam_r exists
13185 set getgrnam_r d_getgrnam_r
13187 case "$d_getgrnam_r" in
13189 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13190 case "$d_getgrnam_r_proto:$usethreads" in
13191 ":define") d_getgrnam_r_proto=define
13192 set d_getgrnam_r_proto getgrnam_r $hdrs
13196 case "$d_getgrnam_r_proto" in
13198 case "$getgrnam_r_proto" in
13199 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
13200 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
13202 case "$getgrnam_r_proto" in
13203 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
13204 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
13206 case "$getgrnam_r_proto" in
13207 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
13208 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CBI ;;
13210 case "$getgrnam_r_proto" in
13211 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
13212 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
13214 case "$getgrnam_r_proto" in
13215 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
13216 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
13218 case "$getgrnam_r_proto" in
13219 ''|0) d_getgrnam_r=undef
13221 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
13222 * ) case "$getgrnam_r_proto" in
13223 REENTRANT_PROTO*) ;;
13224 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
13226 echo "Prototype: $try" ;;
13229 *) case "$usethreads" in
13230 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
13237 *) getgrnam_r_proto=0
13241 : see if gethostbyaddr exists
13242 set gethostbyaddr d_gethbyaddr
13245 : see if gethostbyname exists
13246 set gethostbyname d_gethbyname
13249 : see if gethostent exists
13250 set gethostent d_gethent
13253 : see how we will look up host name
13256 if set gethostname val -f d_gethname; eval $csym; $val; then
13257 echo 'gethostname() found.' >&4
13258 d_gethname="$define"
13261 if set uname val -f d_uname; eval $csym; $val; then
13264 uname() was found, but you're running xenix, and older versions of xenix
13265 have a broken uname(). If you don't really know whether your xenix is old
13266 enough to have a broken system call, use the default answer.
13271 "$define") dflt=n;;
13273 rp='Is your uname() broken?'
13276 n*) d_uname="$define"; call=uname;;
13279 echo 'uname() found.' >&4
13286 case "$d_gethname" in
13287 '') d_gethname="$undef";;
13290 '') d_uname="$undef";;
13292 case "$d_uname$d_gethname" in
13297 Every now and then someone has a $call() that lies about the hostname
13298 but can't be fixed for political or economic reasons. If you wish, I can
13299 pretend $call() isn't there and maybe compute hostname at run-time
13300 thanks to the '$phostname' command.
13303 rp="Shall I ignore $call() from now on?"
13306 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
13309 case "$phostname" in
13310 '') aphostname='';;
13311 *) case "$aphostname" in
13313 *) set X $phostname
13317 file=`./loc $file $file $pth`
13318 aphostname=`echo $file $*`
13323 case "$d_uname$d_gethname" in
13326 case "$phostname" in
13328 echo "There will be no way for $package to get your hostname." >&4;;
13330 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
13334 case "$d_phostname" in
13335 '') d_phostname="$undef";;
13338 : see if gethostbyaddr_r exists
13339 set gethostbyaddr_r d_gethostbyaddr_r
13341 case "$d_gethostbyaddr_r" in
13343 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13344 case "$d_gethostbyaddr_r_proto:$usethreads" in
13345 ":define") d_gethostbyaddr_r_proto=define
13346 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
13350 case "$d_gethostbyaddr_r_proto" in
13352 case "$gethostbyaddr_r_proto" in
13353 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13354 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
13356 case "$gethostbyaddr_r_proto" in
13357 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
13358 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
13360 case "$gethostbyaddr_r_proto" in
13361 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
13362 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
13364 case "$gethostbyaddr_r_proto" in
13365 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
13366 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
13368 case "$gethostbyaddr_r_proto" in
13369 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
13370 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
13372 case "$gethostbyaddr_r_proto" in
13373 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
13374 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
13376 case "$gethostbyaddr_r_proto" in
13377 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
13378 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
13380 case "$gethostbyaddr_r_proto" in
13381 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
13382 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
13384 case "$gethostbyaddr_r_proto" in
13385 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
13386 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
13388 case "$gethostbyaddr_r_proto" in
13389 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
13390 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
13392 case "$gethostbyaddr_r_proto" in
13393 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13394 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
13396 case "$gethostbyaddr_r_proto" in
13397 ''|0) d_gethostbyaddr_r=undef
13398 gethostbyaddr_r_proto=0
13399 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
13400 * ) case "$gethostbyaddr_r_proto" in
13401 REENTRANT_PROTO*) ;;
13402 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
13404 echo "Prototype: $try" ;;
13407 *) case "$usethreads" in
13408 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
13410 d_gethostbyaddr_r=undef
13411 gethostbyaddr_r_proto=0
13415 *) gethostbyaddr_r_proto=0
13419 : see if gethostbyname_r exists
13420 set gethostbyname_r d_gethostbyname_r
13422 case "$d_gethostbyname_r" in
13424 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13425 case "$d_gethostbyname_r_proto:$usethreads" in
13426 ":define") d_gethostbyname_r_proto=define
13427 set d_gethostbyname_r_proto gethostbyname_r $hdrs
13431 case "$d_gethostbyname_r_proto" in
13433 case "$gethostbyname_r_proto" in
13434 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
13435 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
13437 case "$gethostbyname_r_proto" in
13438 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
13439 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
13441 case "$gethostbyname_r_proto" in
13442 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
13443 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
13445 case "$gethostbyname_r_proto" in
13446 ''|0) d_gethostbyname_r=undef
13447 gethostbyname_r_proto=0
13448 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
13449 * ) case "$gethostbyname_r_proto" in
13450 REENTRANT_PROTO*) ;;
13451 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
13453 echo "Prototype: $try" ;;
13456 *) case "$usethreads" in
13457 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
13459 d_gethostbyname_r=undef
13460 gethostbyname_r_proto=0
13464 *) gethostbyname_r_proto=0
13468 : see if gethostent_r exists
13469 set gethostent_r d_gethostent_r
13471 case "$d_gethostent_r" in
13473 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13474 case "$d_gethostent_r_proto:$usethreads" in
13475 ":define") d_gethostent_r_proto=define
13476 set d_gethostent_r_proto gethostent_r $hdrs
13480 case "$d_gethostent_r_proto" in
13482 case "$gethostent_r_proto" in
13483 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
13484 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
13486 case "$gethostent_r_proto" in
13487 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
13488 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBIE ;;
13490 case "$gethostent_r_proto" in
13491 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
13492 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBIE ;;
13494 case "$gethostent_r_proto" in
13495 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
13496 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBI ;;
13498 case "$gethostent_r_proto" in
13499 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
13500 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBI ;;
13502 case "$gethostent_r_proto" in
13503 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
13504 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SD ;;
13506 case "$gethostent_r_proto" in
13507 ''|0) d_gethostent_r=undef
13508 gethostent_r_proto=0
13509 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
13510 * ) case "$gethostent_r_proto" in
13511 REENTRANT_PROTO*) ;;
13512 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
13514 echo "Prototype: $try" ;;
13517 *) case "$usethreads" in
13518 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
13520 d_gethostent_r=undef
13521 gethostent_r_proto=0
13525 *) gethostent_r_proto=0
13529 : see if prototypes for various gethostxxx netdb.h functions are available
13531 set d_gethostprotos gethostent $i_netdb netdb.h
13534 : see if getitimer exists
13535 set getitimer d_getitimer
13538 : see if getlogin exists
13539 set getlogin d_getlogin
13542 : see if getlogin_r exists
13543 set getlogin_r d_getlogin_r
13545 case "$d_getlogin_r" in
13547 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
13548 case "$d_getlogin_r_proto:$usethreads" in
13549 ":define") d_getlogin_r_proto=define
13550 set d_getlogin_r_proto getlogin_r $hdrs
13554 case "$d_getlogin_r_proto" in
13556 case "$getlogin_r_proto" in
13557 ''|0) try='int getlogin_r(char*, size_t);'
13558 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BW ;;
13560 case "$getlogin_r_proto" in
13561 ''|0) try='int getlogin_r(char*, int);'
13562 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BI ;;
13564 case "$getlogin_r_proto" in
13565 ''|0) try='char* getlogin_r(char*, size_t);'
13566 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BW ;;
13568 case "$getlogin_r_proto" in
13569 ''|0) try='char* getlogin_r(char*, int);'
13570 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BI ;;
13572 case "$getlogin_r_proto" in
13573 ''|0) d_getlogin_r=undef
13575 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
13576 * ) case "$getlogin_r_proto" in
13577 REENTRANT_PROTO*) ;;
13578 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
13580 echo "Prototype: $try" ;;
13583 *) case "$usethreads" in
13584 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
13591 *) getlogin_r_proto=0
13595 : see if getmnt exists
13596 set getmnt d_getmnt
13599 : see if getmntent exists
13600 set getmntent d_getmntent
13603 : see if getnetbyaddr exists
13604 set getnetbyaddr d_getnbyaddr
13607 : see if getnetbyname exists
13608 set getnetbyname d_getnbyname
13611 : see if getnetent exists
13612 set getnetent d_getnent
13615 : see if getnetbyaddr_r exists
13616 set getnetbyaddr_r d_getnetbyaddr_r
13618 case "$d_getnetbyaddr_r" in
13620 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13621 case "$d_getnetbyaddr_r_proto:$usethreads" in
13622 ":define") d_getnetbyaddr_r_proto=define
13623 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
13627 case "$d_getnetbyaddr_r_proto" in
13629 case "$getnetbyaddr_r_proto" in
13630 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
13631 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
13633 case "$getnetbyaddr_r_proto" in
13634 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
13635 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
13637 case "$getnetbyaddr_r_proto" in
13638 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
13639 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
13641 case "$getnetbyaddr_r_proto" in
13642 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
13643 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
13645 case "$getnetbyaddr_r_proto" in
13646 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
13647 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
13649 case "$getnetbyaddr_r_proto" in
13650 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
13651 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
13653 case "$getnetbyaddr_r_proto" in
13654 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
13655 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
13657 case "$getnetbyaddr_r_proto" in
13658 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
13659 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
13661 case "$getnetbyaddr_r_proto" in
13662 ''|0) d_getnetbyaddr_r=undef
13663 getnetbyaddr_r_proto=0
13664 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
13665 * ) case "$getnetbyaddr_r_proto" in
13666 REENTRANT_PROTO*) ;;
13667 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
13669 echo "Prototype: $try" ;;
13672 *) case "$usethreads" in
13673 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
13675 d_getnetbyaddr_r=undef
13676 getnetbyaddr_r_proto=0
13680 *) getnetbyaddr_r_proto=0
13684 : see if getnetbyname_r exists
13685 set getnetbyname_r d_getnetbyname_r
13687 case "$d_getnetbyname_r" in
13689 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13690 case "$d_getnetbyname_r_proto:$usethreads" in
13691 ":define") d_getnetbyname_r_proto=define
13692 set d_getnetbyname_r_proto getnetbyname_r $hdrs
13696 case "$d_getnetbyname_r_proto" in
13698 case "$getnetbyname_r_proto" in
13699 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
13700 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
13702 case "$getnetbyname_r_proto" in
13703 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
13704 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
13706 case "$getnetbyname_r_proto" in
13707 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
13708 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
13710 case "$getnetbyname_r_proto" in
13711 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
13712 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
13714 case "$getnetbyname_r_proto" in
13715 ''|0) d_getnetbyname_r=undef
13716 getnetbyname_r_proto=0
13717 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
13718 * ) case "$getnetbyname_r_proto" in
13719 REENTRANT_PROTO*) ;;
13720 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
13722 echo "Prototype: $try" ;;
13725 *) case "$usethreads" in
13726 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
13728 d_getnetbyname_r=undef
13729 getnetbyname_r_proto=0
13733 *) getnetbyname_r_proto=0
13737 : see if getnetent_r exists
13738 set getnetent_r d_getnetent_r
13740 case "$d_getnetent_r" in
13742 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13743 case "$d_getnetent_r_proto:$usethreads" in
13744 ":define") d_getnetent_r_proto=define
13745 set d_getnetent_r_proto getnetent_r $hdrs
13749 case "$d_getnetent_r_proto" in
13751 case "$getnetent_r_proto" in
13752 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
13753 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
13755 case "$getnetent_r_proto" in
13756 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
13757 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBIE ;;
13759 case "$getnetent_r_proto" in
13760 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
13761 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBIE ;;
13763 case "$getnetent_r_proto" in
13764 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
13765 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBI ;;
13767 case "$getnetent_r_proto" in
13768 ''|0) try='int getnetent_r(struct netent*, char*, int);'
13769 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBI ;;
13771 case "$getnetent_r_proto" in
13772 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
13773 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SD ;;
13775 case "$getnetent_r_proto" in
13776 ''|0) d_getnetent_r=undef
13777 getnetent_r_proto=0
13778 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
13779 * ) case "$getnetent_r_proto" in
13780 REENTRANT_PROTO*) ;;
13781 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
13783 echo "Prototype: $try" ;;
13786 *) case "$usethreads" in
13787 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
13789 d_getnetent_r=undef
13790 getnetent_r_proto=0
13794 *) getnetent_r_proto=0
13798 : see if prototypes for various getnetxxx netdb.h functions are available
13800 set d_getnetprotos getnetent $i_netdb netdb.h
13803 : see if getpagesize exists
13804 set getpagesize d_getpagsz
13808 : see if getprotobyname exists
13809 set getprotobyname d_getpbyname
13812 : see if getprotobynumber exists
13813 set getprotobynumber d_getpbynumber
13816 : see if getprotoent exists
13817 set getprotoent d_getpent
13820 : see if getpgid exists
13821 set getpgid d_getpgid
13824 : see if getpgrp2 exists
13825 set getpgrp2 d_getpgrp2
13828 : see if getppid exists
13829 set getppid d_getppid
13832 : see if getpriority exists
13833 set getpriority d_getprior
13836 : see if getprotobyname_r exists
13837 set getprotobyname_r d_getprotobyname_r
13839 case "$d_getprotobyname_r" in
13841 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13842 case "$d_getprotobyname_r_proto:$usethreads" in
13843 ":define") d_getprotobyname_r_proto=define
13844 set d_getprotobyname_r_proto getprotobyname_r $hdrs
13848 case "$d_getprotobyname_r_proto" in
13850 case "$getprotobyname_r_proto" in
13851 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
13852 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
13854 case "$getprotobyname_r_proto" in
13855 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
13856 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
13858 case "$getprotobyname_r_proto" in
13859 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
13860 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
13862 case "$getprotobyname_r_proto" in
13863 ''|0) d_getprotobyname_r=undef
13864 getprotobyname_r_proto=0
13865 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
13866 * ) case "$getprotobyname_r_proto" in
13867 REENTRANT_PROTO*) ;;
13868 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
13870 echo "Prototype: $try" ;;
13873 *) case "$usethreads" in
13874 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
13876 d_getprotobyname_r=undef
13877 getprotobyname_r_proto=0
13881 *) getprotobyname_r_proto=0
13885 : see if getprotobynumber_r exists
13886 set getprotobynumber_r d_getprotobynumber_r
13888 case "$d_getprotobynumber_r" in
13890 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13891 case "$d_getprotobynumber_r_proto:$usethreads" in
13892 ":define") d_getprotobynumber_r_proto=define
13893 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
13897 case "$d_getprotobynumber_r_proto" in
13899 case "$getprotobynumber_r_proto" in
13900 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
13901 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
13903 case "$getprotobynumber_r_proto" in
13904 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
13905 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
13907 case "$getprotobynumber_r_proto" in
13908 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
13909 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
13911 case "$getprotobynumber_r_proto" in
13912 ''|0) d_getprotobynumber_r=undef
13913 getprotobynumber_r_proto=0
13914 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
13915 * ) case "$getprotobynumber_r_proto" in
13916 REENTRANT_PROTO*) ;;
13917 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
13919 echo "Prototype: $try" ;;
13922 *) case "$usethreads" in
13923 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
13925 d_getprotobynumber_r=undef
13926 getprotobynumber_r_proto=0
13930 *) getprotobynumber_r_proto=0
13934 : see if getprotoent_r exists
13935 set getprotoent_r d_getprotoent_r
13937 case "$d_getprotoent_r" in
13939 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13940 case "$d_getprotoent_r_proto:$usethreads" in
13941 ":define") d_getprotoent_r_proto=define
13942 set d_getprotoent_r_proto getprotoent_r $hdrs
13946 case "$d_getprotoent_r_proto" in
13948 case "$getprotoent_r_proto" in
13949 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
13950 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
13952 case "$getprotoent_r_proto" in
13953 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
13954 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBI ;;
13956 case "$getprotoent_r_proto" in
13957 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
13958 ./protochk "extern $try" $hdrs && getprotoent_r_proto=S_SBI ;;
13960 case "$getprotoent_r_proto" in
13961 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
13962 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SD ;;
13964 case "$getprotoent_r_proto" in
13965 ''|0) d_getprotoent_r=undef
13966 getprotoent_r_proto=0
13967 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
13968 * ) case "$getprotoent_r_proto" in
13969 REENTRANT_PROTO*) ;;
13970 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
13972 echo "Prototype: $try" ;;
13975 *) case "$usethreads" in
13976 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
13978 d_getprotoent_r=undef
13979 getprotoent_r_proto=0
13983 *) getprotoent_r_proto=0
13987 : see if prototypes for various getprotoxxx netdb.h functions are available
13989 set d_getprotoprotos getprotoent $i_netdb netdb.h
13992 : see if getprpwnam exists
13993 set getprpwnam d_getprpwnam
13996 : see if getpwent exists
13997 set getpwent d_getpwent
14000 : see if getpwent_r exists
14001 set getpwent_r d_getpwent_r
14003 case "$d_getpwent_r" in
14005 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14006 case "$d_getpwent_r_proto:$usethreads" in
14007 ":define") d_getpwent_r_proto=define
14008 set d_getpwent_r_proto getpwent_r $hdrs
14012 case "$d_getpwent_r_proto" in
14014 case "$getpwent_r_proto" in
14015 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
14016 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBWR ;;
14018 case "$getpwent_r_proto" in
14019 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
14020 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIR ;;
14022 case "$getpwent_r_proto" in
14023 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
14024 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBW ;;
14026 case "$getpwent_r_proto" in
14027 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
14028 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBI ;;
14030 case "$getpwent_r_proto" in
14031 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
14032 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBI ;;
14034 case "$getpwent_r_proto" in
14035 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
14036 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIH ;;
14038 case "$getpwent_r_proto" in
14039 ''|0) d_getpwent_r=undef
14041 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
14042 * ) case "$getpwent_r_proto" in
14043 REENTRANT_PROTO*) ;;
14044 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
14046 echo "Prototype: $try" ;;
14049 *) case "$usethreads" in
14050 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
14057 *) getpwent_r_proto=0
14061 : see if getpwnam_r exists
14062 set getpwnam_r d_getpwnam_r
14064 case "$d_getpwnam_r" in
14066 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14067 case "$d_getpwnam_r_proto:$usethreads" in
14068 ":define") d_getpwnam_r_proto=define
14069 set d_getpwnam_r_proto getpwnam_r $hdrs
14073 case "$d_getpwnam_r_proto" in
14075 case "$getpwnam_r_proto" in
14076 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
14077 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
14079 case "$getpwnam_r_proto" in
14080 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
14081 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
14083 case "$getpwnam_r_proto" in
14084 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
14085 ./protochk "extern $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
14087 case "$getpwnam_r_proto" in
14088 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
14089 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
14091 case "$getpwnam_r_proto" in
14092 ''|0) d_getpwnam_r=undef
14094 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
14095 * ) case "$getpwnam_r_proto" in
14096 REENTRANT_PROTO*) ;;
14097 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
14099 echo "Prototype: $try" ;;
14102 *) case "$usethreads" in
14103 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
14110 *) getpwnam_r_proto=0
14114 : see if getpwuid_r exists
14115 set getpwuid_r d_getpwuid_r
14117 case "$d_getpwuid_r" in
14119 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14120 case "$d_getpwuid_r_proto:$usethreads" in
14121 ":define") d_getpwuid_r_proto=define
14122 set d_getpwuid_r_proto getpwuid_r $hdrs
14126 case "$d_getpwuid_r_proto" in
14128 case "$getpwuid_r_proto" in
14129 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
14130 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
14132 case "$getpwuid_r_proto" in
14133 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
14134 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
14136 case "$getpwuid_r_proto" in
14137 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
14138 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
14140 case "$getpwuid_r_proto" in
14141 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
14142 ./protochk "extern $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
14144 case "$getpwuid_r_proto" in
14145 ''|0) d_getpwuid_r=undef
14147 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
14148 * ) case "$getpwuid_r_proto" in
14149 REENTRANT_PROTO*) ;;
14150 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
14152 echo "Prototype: $try" ;;
14155 *) case "$usethreads" in
14156 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
14163 *) getpwuid_r_proto=0
14168 : see if getservbyname exists
14169 set getservbyname d_getsbyname
14172 : see if getservbyport exists
14173 set getservbyport d_getsbyport
14176 : see if getservent exists
14177 set getservent d_getsent
14180 : see if getservbyname_r exists
14181 set getservbyname_r d_getservbyname_r
14183 case "$d_getservbyname_r" in
14185 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14186 case "$d_getservbyname_r_proto:$usethreads" in
14187 ":define") d_getservbyname_r_proto=define
14188 set d_getservbyname_r_proto getservbyname_r $hdrs
14192 case "$d_getservbyname_r_proto" in
14194 case "$getservbyname_r_proto" in
14195 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
14196 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
14198 case "$getservbyname_r_proto" in
14199 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
14200 ./protochk "extern $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
14202 case "$getservbyname_r_proto" in
14203 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
14204 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
14206 case "$getservbyname_r_proto" in
14207 ''|0) d_getservbyname_r=undef
14208 getservbyname_r_proto=0
14209 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
14210 * ) case "$getservbyname_r_proto" in
14211 REENTRANT_PROTO*) ;;
14212 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
14214 echo "Prototype: $try" ;;
14217 *) case "$usethreads" in
14218 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
14220 d_getservbyname_r=undef
14221 getservbyname_r_proto=0
14225 *) getservbyname_r_proto=0
14229 : see if getservbyport_r exists
14230 set getservbyport_r d_getservbyport_r
14232 case "$d_getservbyport_r" in
14234 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14235 case "$d_getservbyport_r_proto:$usethreads" in
14236 ":define") d_getservbyport_r_proto=define
14237 set d_getservbyport_r_proto getservbyport_r $hdrs
14241 case "$d_getservbyport_r_proto" in
14243 case "$getservbyport_r_proto" in
14244 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
14245 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
14247 case "$getservbyport_r_proto" in
14248 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
14249 ./protochk "extern $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
14251 case "$getservbyport_r_proto" in
14252 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
14253 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
14255 case "$getservbyport_r_proto" in
14256 ''|0) d_getservbyport_r=undef
14257 getservbyport_r_proto=0
14258 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
14259 * ) case "$getservbyport_r_proto" in
14260 REENTRANT_PROTO*) ;;
14261 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
14263 echo "Prototype: $try" ;;
14266 *) case "$usethreads" in
14267 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
14269 d_getservbyport_r=undef
14270 getservbyport_r_proto=0
14274 *) getservbyport_r_proto=0
14278 : see if getservent_r exists
14279 set getservent_r d_getservent_r
14281 case "$d_getservent_r" in
14283 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14284 case "$d_getservent_r_proto:$usethreads" in
14285 ":define") d_getservent_r_proto=define
14286 set d_getservent_r_proto getservent_r $hdrs
14290 case "$d_getservent_r_proto" in
14292 case "$getservent_r_proto" in
14293 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
14294 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBWR ;;
14296 case "$getservent_r_proto" in
14297 ''|0) try='int getservent_r(struct servent*, char*, int);'
14298 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBI ;;
14300 case "$getservent_r_proto" in
14301 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
14302 ./protochk "extern $try" $hdrs && getservent_r_proto=S_SBI ;;
14304 case "$getservent_r_proto" in
14305 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
14306 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SD ;;
14308 case "$getservent_r_proto" in
14309 ''|0) d_getservent_r=undef
14310 getservent_r_proto=0
14311 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
14312 * ) case "$getservent_r_proto" in
14313 REENTRANT_PROTO*) ;;
14314 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
14316 echo "Prototype: $try" ;;
14319 *) case "$usethreads" in
14320 define) echo "getservent_r has no prototype, not using it." >&4 ;;
14322 d_getservent_r=undef
14323 getservent_r_proto=0
14327 *) getservent_r_proto=0
14331 : see if prototypes for various getservxxx netdb.h functions are available
14333 set d_getservprotos getservent $i_netdb netdb.h
14336 : see if getspnam exists
14337 set getspnam d_getspnam
14340 : see if this is a shadow.h system
14341 set shadow.h i_shadow
14344 : see if getspnam_r exists
14345 set getspnam_r d_getspnam_r
14347 case "$d_getspnam_r" in
14349 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
14350 case "$d_getspnam_r_proto:$usethreads" in
14351 ":define") d_getspnam_r_proto=define
14352 set d_getspnam_r_proto getspnam_r $hdrs
14356 case "$d_getspnam_r_proto" in
14358 case "$getspnam_r_proto" in
14359 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
14360 ./protochk "extern $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
14362 case "$getspnam_r_proto" in
14363 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
14364 ./protochk "extern $try" $hdrs && getspnam_r_proto=S_CSBI ;;
14366 case "$getspnam_r_proto" in
14367 ''|0) d_getspnam_r=undef
14369 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
14370 * ) case "$getspnam_r_proto" in
14371 REENTRANT_PROTO*) ;;
14372 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
14374 echo "Prototype: $try" ;;
14377 *) case "$usethreads" in
14378 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
14385 *) getspnam_r_proto=0
14389 : see if gettimeofday or ftime exists
14390 set gettimeofday d_gettimeod
14392 case "$d_gettimeod" in
14398 val="$undef"; set d_ftime; eval $setvar
14401 case "$d_gettimeod$d_ftime" in
14404 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
14408 : see if gmtime_r exists
14409 set gmtime_r d_gmtime_r
14411 case "$d_gmtime_r" in
14413 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14414 case "$d_gmtime_r_proto:$usethreads" in
14415 ":define") d_gmtime_r_proto=define
14416 set d_gmtime_r_proto gmtime_r $hdrs
14420 case "$d_gmtime_r_proto" in
14422 case "$gmtime_r_proto" in
14423 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
14424 ./protochk "extern $try" $hdrs && gmtime_r_proto=S_TS ;;
14426 case "$gmtime_r_proto" in
14427 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
14428 ./protochk "extern $try" $hdrs && gmtime_r_proto=I_TS ;;
14430 case "$gmtime_r_proto" in
14431 ''|0) d_gmtime_r=undef
14433 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
14434 * ) case "$gmtime_r_proto" in
14435 REENTRANT_PROTO*) ;;
14436 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
14438 echo "Prototype: $try" ;;
14441 *) case "$usethreads" in
14442 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
14449 *) gmtime_r_proto=0
14453 : see if hasmntopt exists
14454 set hasmntopt d_hasmntopt
14457 : see if this is a netinet/in.h or sys/in.h system
14458 set netinet/in.h i_niin sys/in.h i_sysin
14461 : see if arpa/inet.h has to be included
14462 set arpa/inet.h i_arpainet
14465 : see if htonl --and friends-- exists
14470 : Maybe they are macros.
14473 $cat >htonl.c <<EOM
14475 #include <sys/types.h>
14476 #$i_niin I_NETINET_IN
14478 #$i_arpainet I_ARPA_INET
14479 #ifdef I_NETINET_IN
14480 #include <netinet/in.h>
14483 #include <sys/in.h>
14486 #include <arpa/inet.h>
14489 printf("Defined as a macro.");
14492 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
14493 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
14495 echo "But it seems to be defined as a macro." >&4
14503 : see if ilogbl exists
14504 set ilogbl d_ilogbl
14509 if set index val -f; eval $csym; $val; then
14510 if set strchr val -f d_strchr; eval $csym; $val; then
14511 if $contains strchr "$strings" >/dev/null 2>&1 ; then
14514 echo "strchr() found." >&4
14518 echo "index() found." >&4
14523 echo "index() found." >&4
14526 if set strchr val -f d_strchr; eval $csym; $val; then
14529 echo "strchr() found." >&4
14531 echo "No index() or strchr() found!" >&4
14536 set d_strchr; eval $setvar
14538 set d_index; eval $setvar
14540 : check whether inet_aton exists
14541 set inet_aton d_inetaton
14546 $cat >isascii.c <<EOCP
14549 #$i_stdlib I_STDLIB
14551 #include <stdlib.h>
14562 if eval $compile; then
14563 echo "isascii() found." >&4
14566 echo "isascii() NOT found." >&4
14573 : see if isfinite exists
14574 set isfinite d_isfinite
14577 : see if isinf exists
14581 : see if isnan exists
14585 : see if isnanl exists
14586 set isnanl d_isnanl
14589 : see if killpg exists
14590 set killpg d_killpg
14593 : see if lchown exists
14595 $cat > try.c <<'EOCP'
14596 /* System header to define __stub macros and hopefully few prototypes,
14597 which can conflict with char lchown(); below. */
14598 #include <assert.h>
14599 /* Override any gcc2 internal prototype to avoid an error. */
14600 /* We use char because int might match the return type of a gcc2
14601 builtin and then its argument prototype would still apply. */
14604 /* The GNU C library defines this for functions which it implements
14605 to always fail with ENOSYS. Some functions are actually named
14606 something starting with __ and the normal name is an alias. */
14607 #if defined (__stub_lchown) || defined (__stub___lchown)
14615 if eval $compile; then
14616 $echo "lchown() found." >&4
14619 $echo "lchown() NOT found." >&4
14625 : See if number of significant digits in a double precision number is known
14627 $cat >ldbl_dig.c <<EOM
14628 #$i_limits I_LIMITS
14631 #include <limits.h>
14637 printf("Contains LDBL_DIG");
14640 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
14641 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
14642 echo "LDBL_DIG found." >&4
14645 echo "LDBL_DIG NOT found." >&4
14652 : see if this is a math.h system
14656 d_libm_lib_version="$undef"
14659 : check to see if math.h defines _LIB_VERSION
14661 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
14663 #include <unistd.h>
14665 int main (int argc, char *argv[])
14667 printf ("%d\n", _LIB_VERSION);
14672 if eval $compile; then
14674 echo "Yes, it does ($foo)" >&4
14675 d_libm_lib_version="$define"
14677 echo "No, it does not (probably harmless)" >&4
14684 : see if link exists
14688 : see if localtime_r exists
14689 set localtime_r d_localtime_r
14691 case "$d_localtime_r" in
14693 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14694 case "$d_localtime_r_proto:$usethreads" in
14695 ":define") d_localtime_r_proto=define
14696 set d_localtime_r_proto localtime_r $hdrs
14700 case "$d_localtime_r_proto" in
14702 case "$localtime_r_proto" in
14703 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
14704 ./protochk "extern $try" $hdrs && localtime_r_proto=S_TS ;;
14706 case "$localtime_r_proto" in
14707 ''|0) try='int localtime_r(const time_t*, struct tm*);'
14708 ./protochk "extern $try" $hdrs && localtime_r_proto=I_TS ;;
14710 case "$localtime_r_proto" in
14711 ''|0) d_localtime_r=undef
14712 localtime_r_proto=0
14713 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
14714 * ) case "$localtime_r_proto" in
14715 REENTRANT_PROTO*) ;;
14716 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
14718 echo "Prototype: $try" ;;
14721 *) case "$usethreads" in
14722 define) echo "localtime_r has no prototype, not using it." >&4 ;;
14724 d_localtime_r=undef
14725 localtime_r_proto=0
14729 *) localtime_r_proto=0
14733 : see if localtime_r calls tzset
14734 case "$localtime_r_proto" in
14737 /* Does our libc's localtime_r call tzset ?
14738 * return 0 if so, 1 otherwise.
14740 #include <sys/types.h>
14741 #include <unistd.h>
14743 #include <string.h>
14744 #include <malloc.h>
14747 time_t t = time(0L);
14748 char w_tz[]="TZ" "=GMT+5",
14749 e_tz[]="TZ" "=GMT-5",
14750 *tz_e = (char*)malloc(16),
14751 *tz_w = (char*)malloc(16);
14752 struct tm tm_e, tm_w;
14753 memset(&tm_e,'\0',sizeof(struct tm));
14754 memset(&tm_w,'\0',sizeof(struct tm));
14759 localtime_r(&t, &tm_e);
14762 localtime_r(&t, &tm_w);
14764 if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 )
14770 if eval $compile; then
14771 if $run ./try; then
14772 d_localtime_r_needs_tzset=undef;
14774 d_localtime_r_needs_tzset=define;
14777 d_localtime_r_needs_tzset=undef;
14781 d_localtime_r_needs_tzset=undef;
14786 : see if localeconv exists
14787 set localeconv d_locconv
14790 : see if lockf exists
14794 : see if prototype for lseek is available
14796 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
14799 : see if lstat exists
14803 : see if madvise exists
14804 set madvise d_madvise
14807 : see if malloc_size exists
14808 set malloc_size d_malloc_size
14811 : see if malloc_size_good exists
14812 set malloc_good_size d_malloc_good_size
14815 : see if mblen exists
14819 : see if mbstowcs exists
14820 set mbstowcs d_mbstowcs
14823 : see if mbtowc exists
14824 set mbtowc d_mbtowc
14827 : see if memchr exists
14828 set memchr d_memchr
14831 : see if memcmp exists
14832 set memcmp d_memcmp
14835 : see if memcpy exists
14836 set memcpy d_memcpy
14839 : see if memmove exists
14840 set memmove d_memmove
14843 : see if memset exists
14844 set memset d_memset
14847 : see if mkdir exists
14851 : see if mkdtemp exists
14852 set mkdtemp d_mkdtemp
14855 : see if mkfifo exists
14856 set mkfifo d_mkfifo
14859 : see if mkstemp exists
14860 set mkstemp d_mkstemp
14863 : see if mkstemps exists
14864 set mkstemps d_mkstemps
14867 : see if mktime exists
14868 set mktime d_mktime
14871 : see if this is a sys/mman.h system
14872 set sys/mman.h i_sysmman
14875 : see if mmap exists
14878 : see what shmat returns
14879 : default to something harmless
14881 case "$i_sysmman$d_mmap" in
14883 $cat >mmap.c <<'END'
14884 #include <sys/mman.h>
14887 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
14892 echo "and it returns ($mmaptype)." >&4
14898 : see if sqrtl exists
14902 : see if scalbnl exists
14903 set scalbnl d_scalbnl
14906 : see if modfl exists
14910 : see if prototype for modfl is available
14912 set d_modflproto modfl $i_math math.h
14915 d_modfl_pow32_bug="$undef"
14917 case "$d_longdbl$d_modfl" in
14920 Checking to see whether your modfl() is okay for large values...
14926 if $test "X$d_modflproto" != "X$define"; then
14927 $cat >>try.c <<EOCP
14928 /* Sigh. many current glibcs provide the function, but do not prototype it. */
14929 long double modfl (long double, long double *);
14932 $cat >>try.c <<EOCP
14934 long double nv = 4294967303.15;
14940 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
14944 case "$osname:$gccversion" in
14945 aix:) saveccflags="$ccflags"
14946 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
14949 if eval $compile; then
14952 *" 4294967303.150000 1.150000 4294967302.000000")
14953 echo >&4 "Your modfl() is broken for large values."
14954 d_modfl_pow32_bug="$define"
14956 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
14960 *" 4294967303.150000 0.150000 4294967303.000000")
14961 echo >&4 "Your modfl() seems okay for large values."
14963 *) echo >&4 "I don't understand your modfl() at all."
14969 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
14972 case "$osname:$gccversion" in
14973 aix:) ccflags="$saveccflags" ;; # restore
14978 if $test "$uselongdouble" = "$define"; then
14980 if $test "$d_sqrtl" != "$define"; then
14981 message="$message sqrtl"
14983 if $test "$d_modfl" != "$define"; then
14984 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
14985 echo "You have both aintl and copysignl, so I can emulate modfl."
14987 message="$message modfl"
14990 if $test "$d_frexpl" != "$define"; then
14991 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
14992 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
14994 message="$message frexpl"
14998 if $test "$message" != ""; then
15001 *** You requested the use of long doubles but you do not seem to have
15002 *** the following mathematical functions needed for long double support:
15004 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
15005 *** Cannot continue, aborting.
15013 : see if mprotect exists
15014 set mprotect d_mprotect
15017 : see if msgctl exists
15018 set msgctl d_msgctl
15021 : see if msgget exists
15022 set msgget d_msgget
15025 : see if msgsnd exists
15026 set msgsnd d_msgsnd
15029 : see if msgrcv exists
15030 set msgrcv d_msgrcv
15033 : see how much of the 'msg*(2)' library is present.
15036 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
15037 *"$undef"*) h_msg=false;;
15041 case "`ipcs 2>&1`" in
15042 "SVID messages"*"not configured"*)
15043 echo "Your $osname does not have the msg*(2) configured." >&4
15046 set msgctl d_msgctl
15048 set msgget d_msgget
15050 set msgsnd d_msgsnd
15052 set msgrcv d_msgrcv
15058 : we could also check for sys/ipc.h ...
15059 if $h_msg && $test `./findhdr sys/msg.h`; then
15060 echo "You have the full msg*(2) library." >&4
15063 echo "You don't have the full msg*(2) library." >&4
15071 echo "Checking to see if your system supports struct msghdr..." >&4
15072 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
15074 case "$d_msghdr_s" in
15075 "$define") echo "Yes, it does." ;;
15076 *) echo "No, it doesn't." ;;
15080 : see if msync exists
15084 : see if munmap exists
15085 set munmap d_munmap
15088 : see if nice exists
15092 : see if this is a langinfo.h system
15093 set langinfo.h i_langinfo
15096 : see if nl_langinfo exists
15097 set nl_langinfo d_nl_langinfo
15100 : check for volatile keyword
15102 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
15103 $cat >try.c <<'EOCP'
15106 typedef struct _goo_struct goo_struct;
15107 goo_struct * volatile goo = ((goo_struct *)0);
15108 struct _goo_struct {
15113 typedef unsigned short foo_t;
15114 char *volatile foo;
15116 volatile foo_t blech;
15120 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
15122 echo "Yup, it does."
15125 echo "Nope, it doesn't."
15133 $echo "Choosing the C types to be used for Perl's internal types..." >&4
15135 case "$use64bitint:$d_quad:$quadtype" in
15138 uvtype="$uquadtype"
15143 uvtype="unsigned long"
15149 case "$uselongdouble:$d_longdbl" in
15151 nvtype="long double"
15152 nvsize=$longdblsize
15159 $echo "(IV will be "$ivtype", $ivsize bytes)"
15160 $echo "(UV will be "$uvtype", $uvsize bytes)"
15161 $echo "(NV will be "$nvtype", $nvsize bytes)"
15164 #$i_inttypes I_INTTYPES
15166 #include <inttypes.h>
15171 int8_t i = INT8_MAX;
15172 uint8_t u = UINT8_MAX;
15173 printf("int8_t\n");
15176 int16_t i = INT16_MAX;
15177 uint16_t i = UINT16_MAX;
15178 printf("int16_t\n");
15181 int32_t i = INT32_MAX;
15182 uint32_t u = UINT32_MAX;
15183 printf("int32_t\n");
15189 u8type="unsigned char"
15194 '') case "$shortsize" in
15196 u16type="unsigned short"
15204 '') set try -DINT16
15205 if eval $compile; then
15206 case "`$run ./try`" in
15218 '') if $test $shortsize -ge 2; then
15220 u16type="unsigned short"
15228 '') case "$longsize" in
15230 u32type="unsigned long"
15234 *) case "$intsize" in
15236 u32type="unsigned int"
15246 '') set try -DINT32
15247 if eval $compile; then
15248 case "`$run ./try`" in
15260 '') if $test $intsize -ge 4; then
15262 u32type="unsigned int"
15270 '') case "$d_quad:$quadtype" in
15272 i64type="$quadtype"
15273 u64type="$uquadtype"
15281 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
15282 : volatile so that the compiler has to store it out to memory.
15283 if test X"$d_volatile" = X"$define"; then
15288 #$i_stdlib I_STDLIB
15290 #include <stdlib.h>
15292 #include <sys/types.h>
15293 #include <signal.h>
15295 $volatile int bletched = 0;
15296 $signal_t blech(int s) { bletched = 1; }
15301 int n = 8 * $uvsize;
15304 signal(SIGFPE, blech);
15307 for (i = 0; i < n; i++) {
15308 u = u << 1 | ($uvtype)1;
15310 if (($uvtype)d != u)
15314 d = ($nvtype)(u - 1);
15315 if (($uvtype)d != (u - 1))
15322 printf("%d\n", ((i == n) ? -n : i));
15328 d_nv_preserves_uv="$undef"
15329 if eval $compile; then
15330 nv_preserves_uv_bits="`$run ./try`"
15332 case "$nv_preserves_uv_bits" in
15334 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
15335 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
15336 d_nv_preserves_uv="$define"
15338 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
15339 d_nv_preserves_uv="$undef" ;;
15340 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
15341 nv_preserves_uv_bits="0" ;;
15345 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
15346 : volatile so that the compiler has to store it out to memory.
15347 if test X"$d_volatile" = X"$define"; then
15352 #$i_stdlib I_STDLIB
15354 #include <stdlib.h>
15356 #$i_string I_STRING
15358 # include <string.h>
15360 # include <strings.h>
15362 #include <sys/types.h>
15363 #include <signal.h>
15365 $volatile int bletched = 0;
15366 $signal_t blech(int s) { bletched = 1; }
15369 int checkit($nvtype d, char *where) {
15370 unsigned char *p = (char *)&d;
15371 unsigned char *end = p + sizeof(d);
15381 printf("No - %s: 0x", where);
15383 printf ("%02X", *p++);
15388 int main(int argc, char **argv) {
15391 fail += checkit(d, "0.0");
15393 /* The compiler shouldn't be assuming that bletched is 0 */
15396 fail += checkit(d, "bleched");
15399 signal(SIGFPE, blech);
15402 /* Paranoia - the compiler should have no way of knowing that ANSI says
15403 that argv[argc] will always be NULL. Actually, if it did assume this it
15404 would be buggy, as this is C and main() can be called from elsewhere in
15406 d = argv[argc] ? 1 : 0;
15409 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
15412 fail += checkit(d, "ternary");
15414 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
15417 printf("No - memset doesn't give 0.0\n");
15418 /* This might just blow up: */
15419 printf("(gives %g)\n", d);
15425 printf("No - something bleched\n");
15430 printf("No - %d fail(s)\n", fail);
15439 d_nv_zero_is_allbits_zero="$undef"
15440 if eval $compile; then
15446 0.0 is represented as all bits zero in memory
15448 d_nv_zero_is_allbits_zero="$define"
15451 0.0 is not represented as all bits zero in memory
15453 d_nv_zero_is_allbits_zero="$undef"
15458 0.0 is not represented as all bits zero in memory
15460 d_nv_zero_is_allbits_zero="$undef"
15466 : check for off64_t
15468 echo "Checking to see if you have off64_t..." >&4
15470 #include <sys/types.h>
15471 #include <unistd.h>
15472 int main() { off64_t x = 7; }
15475 if eval $compile; then
15477 echo "You have off64_t."
15480 echo "You do not have off64_t."
15481 case "$lseeksize" in
15482 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
15489 : how to create joinable pthreads
15490 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
15492 echo "Checking what constant to use for creating joinable pthreads..." >&4
15493 $cat >try.c <<'EOCP'
15494 #include <pthread.h>
15496 int detachstate = JOINABLE;
15499 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
15500 if eval $compile; then
15501 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
15502 val="$undef" # Yes, undef.
15503 set d_old_pthread_create_joinable
15506 set old_pthread_create_joinable
15509 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
15510 if eval $compile; then
15511 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
15513 set d_old_pthread_create_joinable
15515 val=PTHREAD_CREATE_UNDETACHED
15516 set old_pthread_create_joinable
15519 set try -DJOINABLE=__UNDETACHED
15520 if eval $compile; then
15521 echo "You seem to use __UNDETACHED." >&4
15523 set d_old_pthread_create_joinable
15526 set old_pthread_create_joinable
15529 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
15531 set d_old_pthread_create_joinable
15534 set old_pthread_create_joinable
15541 d_old_pthread_create_joinable="$undef"
15542 old_pthread_create_joinable=""
15545 : see if pause exists
15549 : see if poll exists
15553 : see if readlink exists
15554 set readlink d_readlink
15560 case "$d_readlink" in
15562 if $issymlink /proc/self/exe ; then
15563 $ls -l /proc/self/exe > reflect
15564 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
15565 echo "You have Linux-like /proc/self/exe."
15566 procselfexe='"/proc/self/exe"'
15570 if $issymlink /proc/curproc/file ; then
15571 $ls -l /proc/curproc/file > reflect
15572 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
15573 echo "You have BSD-like /proc/curproc/file."
15574 procselfexe='"/proc/curproc/file"'
15584 : backward compatibility for d_hvfork
15585 if test X$d_hvfork != X; then
15586 d_vfork="$d_hvfork"
15589 : see if there is a vfork
15594 d_pseudofork=$undef
15596 : Ok, but do we want to use it. vfork is reportedly unreliable in
15597 : perl on Solaris 2.x, and probably elsewhere.
15601 case "$usevfork" in
15607 Perl can only use a vfork() that doesn't suffer from strict
15608 restrictions on calling functions or modifying global data in
15609 the child. For example, glibc-2.1 contains such a vfork()
15610 that is unsuitable. If your system provides a proper fork()
15611 call, chances are that you do NOT want perl to use vfork().
15614 rp="Do you still want to use vfork()?"
15619 echo "Ok, we won't use vfork()."
15628 $define) usevfork='true';;
15629 *) usevfork='false';;
15632 : see whether the pthread_atfork exists
15634 #include <pthread.h>
15637 #ifdef PTHREAD_ATFORK
15638 pthread_atfork(NULL,NULL,NULL);
15643 : see if pthread_atfork exists
15644 set try -DPTHREAD_ATFORK
15645 if eval $compile; then
15650 case "$usethreads" in
15653 $define) echo 'pthread_atfork found.' >&4 ;;
15654 *) echo 'pthread_atfork NOT found.' >&4 ;;
15657 set d_pthread_atfork
15660 : see if pthread_attr_setscope exists
15661 set pthread_attr_setscope d_pthread_attr_setscope
15665 : see whether the various POSIXish _yields exist
15667 #include <pthread.h>
15673 #ifdef PTHREAD_YIELD
15676 #ifdef PTHREAD_YIELD_NULL
15677 pthread_yield(NULL);
15683 : see if sched_yield exists
15684 set try -DSCHED_YIELD
15685 if eval $compile; then
15687 sched_yield='sched_yield()'
15691 case "$usethreads" in
15694 $define) echo 'sched_yield() found.' >&4 ;;
15695 *) echo 'sched_yield() NOT found.' >&4 ;;
15701 : see if pthread_yield exists
15702 set try -DPTHREAD_YIELD
15703 if eval $compile; then
15705 case "$sched_yield" in
15706 '') sched_yield='pthread_yield()' ;;
15709 set try -DPTHREAD_YIELD_NULL
15710 if eval $compile; then
15712 case "$sched_yield" in
15713 '') sched_yield='pthread_yield(NULL)' ;;
15719 case "$usethreads" in
15722 $define) echo 'pthread_yield() found.' >&4 ;;
15723 *) echo 'pthread_yield() NOT found.' >&4 ;;
15727 set d_pthread_yield
15729 case "$sched_yield" in
15730 '') sched_yield=undef ;;
15734 : see if random_r exists
15735 set random_r d_random_r
15737 case "$d_random_r" in
15739 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
15740 case "$d_random_r_proto:$usethreads" in
15741 ":define") d_random_r_proto=define
15742 set d_random_r_proto random_r $hdrs
15746 case "$d_random_r_proto" in
15748 case "$random_r_proto" in
15749 ''|0) try='int random_r(int*, struct random_data*);'
15750 ./protochk "extern $try" $hdrs && random_r_proto=I_iS ;;
15752 case "$random_r_proto" in
15753 ''|0) try='int random_r(long*, struct random_data*);'
15754 ./protochk "extern $try" $hdrs && random_r_proto=I_lS ;;
15756 case "$random_r_proto" in
15757 ''|0) try='int random_r(struct random_data*, int32_t*);'
15758 ./protochk "extern $try" $hdrs && random_r_proto=I_St ;;
15760 case "$random_r_proto" in
15761 ''|0) d_random_r=undef
15763 echo "Disabling random_r, cannot determine prototype." >&4 ;;
15764 * ) case "$random_r_proto" in
15765 REENTRANT_PROTO*) ;;
15766 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
15768 echo "Prototype: $try" ;;
15771 *) case "$usethreads" in
15772 define) echo "random_r has no prototype, not using it." >&4 ;;
15779 *) random_r_proto=0
15783 : see if readdir and friends exist
15784 set readdir d_readdir
15786 set seekdir d_seekdir
15788 set telldir d_telldir
15790 set rewinddir d_rewinddir
15793 : see if readdir64_r exists
15794 set readdir64_r d_readdir64_r
15796 case "$d_readdir64_r" in
15798 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
15799 case "$d_readdir64_r_proto:$usethreads" in
15800 ":define") d_readdir64_r_proto=define
15801 set d_readdir64_r_proto readdir64_r $hdrs
15805 case "$d_readdir64_r_proto" in
15807 case "$readdir64_r_proto" in
15808 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
15809 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TSR ;;
15811 case "$readdir64_r_proto" in
15812 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
15813 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TS ;;
15815 case "$readdir64_r_proto" in
15816 ''|0) d_readdir64_r=undef
15817 readdir64_r_proto=0
15818 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
15819 * ) case "$readdir64_r_proto" in
15820 REENTRANT_PROTO*) ;;
15821 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
15823 echo "Prototype: $try" ;;
15826 *) case "$usethreads" in
15827 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
15829 d_readdir64_r=undef
15830 readdir64_r_proto=0
15834 *) readdir64_r_proto=0
15838 : see if readdir_r exists
15839 set readdir_r d_readdir_r
15841 case "$d_readdir_r" in
15843 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
15844 case "$d_readdir_r_proto:$usethreads" in
15845 ":define") d_readdir_r_proto=define
15846 set d_readdir_r_proto readdir_r $hdrs
15850 case "$d_readdir_r_proto" in
15852 case "$readdir_r_proto" in
15853 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
15854 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TSR ;;
15856 case "$readdir_r_proto" in
15857 ''|0) try='int readdir_r(DIR*, struct dirent*);'
15858 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TS ;;
15860 case "$readdir_r_proto" in
15861 ''|0) d_readdir_r=undef
15863 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
15864 * ) case "$readdir_r_proto" in
15865 REENTRANT_PROTO*) ;;
15866 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
15868 echo "Prototype: $try" ;;
15871 *) case "$usethreads" in
15872 define) echo "readdir_r has no prototype, not using it." >&4 ;;
15879 *) readdir_r_proto=0
15883 : see if readv exists
15887 : see if recvmsg exists
15888 set recvmsg d_recvmsg
15891 : see if rename exists
15892 set rename d_rename
15895 : see if rmdir exists
15899 : see if memory.h is available.
15904 : See if it conflicts with string.h
15910 $cppstdin $cppflags $cppminus < $strings > mem.h
15911 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
15913 echo "We won't be including <memory.h>."
15923 : can bcopy handle overlapping blocks?
15926 case "$d_memmove" in
15927 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
15928 *) case "$d_bcopy" in
15930 echo "Checking to see if bcopy() can do overlapping copies..." >&4
15932 #$i_memory I_MEMORY
15933 #$i_stdlib I_STDLIB
15934 #$i_string I_STRING
15935 #$i_unistd I_UNISTD
15937 $cat >>try.c <<'EOCP'
15940 # include <memory.h>
15943 # include <stdlib.h>
15946 # include <string.h>
15948 # include <strings.h>
15951 # include <unistd.h> /* Needed for NetBSD */
15955 char buf[128], abc[128];
15961 /* Copy "abcde..." string to char abc[] so that gcc doesn't
15962 try to store the string in read-only memory. */
15963 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
15965 for (align = 7; align >= 0; align--) {
15966 for (len = 36; len; len--) {
15968 bcopy(abc, b, len);
15969 for (off = 1; off <= len; off++) {
15970 bcopy(b, b+off, len);
15971 bcopy(b+off, b, len);
15972 if (bcmp(b, abc, len))
15981 if eval $compile_ok; then
15982 if $run ./try 2>/dev/null; then
15983 echo "Yes, it can."
15986 echo "It can't, sorry."
15989 echo "(I can't compile the test program, so we'll assume not...)"
15999 : can memcpy handle overlapping blocks?
16002 case "$d_memmove" in
16003 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
16004 *) case "$d_memcpy" in
16006 echo "Checking to see if memcpy() can do overlapping copies..." >&4
16008 #$i_memory I_MEMORY
16009 #$i_stdlib I_STDLIB
16010 #$i_string I_STRING
16011 #$i_unistd I_UNISTD
16013 $cat >>try.c <<'EOCP'
16016 # include <memory.h>
16019 # include <stdlib.h>
16022 # include <string.h>
16024 # include <strings.h>
16027 # include <unistd.h> /* Needed for NetBSD */
16031 char buf[128], abc[128];
16037 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16038 try to store the string in read-only memory. */
16039 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
16041 for (align = 7; align >= 0; align--) {
16042 for (len = 36; len; len--) {
16044 memcpy(b, abc, len);
16045 for (off = 1; off <= len; off++) {
16046 memcpy(b+off, b, len);
16047 memcpy(b, b+off, len);
16048 if (memcmp(b, abc, len))
16057 if eval $compile_ok; then
16058 if $run ./try 2>/dev/null; then
16059 echo "Yes, it can."
16062 echo "It can't, sorry."
16065 echo "(I can't compile the test program, so we'll assume not...)"
16075 : can memcmp be trusted to compare relative magnitude?
16077 case "$d_memcmp" in
16080 echo "Checking if your memcmp() can compare relative magnitude..." >&4
16082 #$i_memory I_MEMORY
16083 #$i_stdlib I_STDLIB
16084 #$i_string I_STRING
16085 #$i_unistd I_UNISTD
16087 $cat >>try.c <<'EOCP'
16090 # include <memory.h>
16093 # include <stdlib.h>
16096 # include <string.h>
16098 # include <strings.h>
16101 # include <unistd.h> /* Needed for NetBSD */
16107 if ((a < b) && memcmp(&a, &b, 1) < 0)
16113 if eval $compile_ok; then
16114 if $run ./try 2>/dev/null; then
16115 echo "Yes, it can."
16118 echo "No, it can't (it uses signed chars)."
16121 echo "(I can't compile the test program, so we'll assume not...)"
16129 : see if prototype for sbrk is available
16131 set d_sbrkproto sbrk $i_unistd unistd.h
16134 : see if select exists
16135 set select d_select
16138 : see if semctl exists
16139 set semctl d_semctl
16142 : see if semget exists
16143 set semget d_semget
16146 : see if semop exists
16150 : see how much of the 'sem*(2)' library is present.
16153 case "$d_semctl$d_semget$d_semop" in
16154 *"$undef"*) h_sem=false;;
16158 case "`ipcs 2>&1`" in
16159 "SVID messages"*"not configured"*)
16160 echo "Your $osname does not have the sem*(2) configured." >&4
16163 set semctl d_semctl
16165 set semget d_semget
16173 : we could also check for sys/ipc.h ...
16174 if $h_sem && $test `./findhdr sys/sem.h`; then
16175 echo "You have the full sem*(2) library." >&4
16178 echo "You don't have the full sem*(2) library." >&4
16184 : see whether sys/sem.h defines union semun
16186 $cat > try.c <<'END'
16187 #include <sys/types.h>
16188 #include <sys/ipc.h>
16189 #include <sys/sem.h>
16190 int main () { union semun semun; semun.buf = 0; }
16193 if eval $compile; then
16194 echo "You have union semun in <sys/sem.h>." >&4
16197 echo "You do not have union semun in <sys/sem.h>." >&4
16204 : see how to do semctl IPC_STAT
16208 $cat > tryh.h <<END
16211 # define S_IRUSR S_IREAD
16212 # define S_IWUSR S_IWRITE
16213 # define S_IXUSR S_IEXEC
16215 # define S_IRUSR 0400
16216 # define S_IWUSR 0200
16217 # define S_IXUSR 0100
16219 # define S_IRGRP (S_IRUSR>>3)
16220 # define S_IWGRP (S_IWUSR>>3)
16221 # define S_IXGRP (S_IXUSR>>3)
16222 # define S_IROTH (S_IRUSR>>6)
16223 # define S_IWOTH (S_IWUSR>>6)
16224 # define S_IXOTH (S_IXUSR>>6)
16227 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
16228 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
16229 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
16232 : see whether semctl IPC_STAT can use union semun
16233 case "$d_semctl_semun" in
16237 #include <sys/types.h>
16238 #include <sys/ipc.h>
16239 #include <sys/sem.h>
16240 #include <sys/stat.h>
16247 #$d_union_semun HAS_UNION_SEMUN
16250 #ifndef HAS_UNION_SEMUN
16253 struct semid_ds *buf;
16254 unsigned short *array;
16260 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16261 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16263 struct semid_ds argbuf;
16266 st = semctl(sem, 0, IPC_STAT, arg);
16270 # endif /* IPC_STAT */
16271 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16273 if (semctl(sem, 0, IPC_RMID, arg) != 0)
16274 # endif /* IPC_RMID */
16275 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16277 #endif /* IPC_PRIVATE && ... */
16278 printf("semget failed: errno = %d\n", errno);
16283 if eval $compile; then
16286 semun) val="$define" ;;
16294 case "$d_semctl_semun" in
16296 echo "You can use union semun for semctl IPC_STAT." >&4
16299 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
16304 : see whether semctl IPC_STAT can use struct semid_ds pointer
16305 case "$d_semctl_semid_ds" in
16308 $cat > try.c <<'END'
16309 #include <sys/types.h>
16310 #include <sys/ipc.h>
16311 #include <sys/sem.h>
16312 #include <sys/stat.h>
16320 struct semid_ds arg;
16323 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16324 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16327 st = semctl(sem, 0, IPC_STAT, &arg);
16329 printf("semid_ds\n");
16331 # endif /* IPC_STAT */
16332 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16334 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
16335 # endif /* IPC_RMID */
16336 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16338 #endif /* IPC_PRIVATE && ... */
16339 printf("semget failed: errno = %d\n", errno);
16345 if eval $compile; then
16348 semid_ds) val="$define" ;;
16352 set d_semctl_semid_ds
16356 case "$d_semctl_semid_ds" in
16358 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
16360 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
16366 # We do not have the full sem*(2) library, so assume we can not
16372 set d_semctl_semid_ds
16378 : see if sendmsg exists
16379 set sendmsg d_sendmsg
16382 : see if setegid exists
16383 set setegid d_setegid
16386 : see if seteuid exists
16387 set seteuid d_seteuid
16390 : see if setgrent exists
16391 set setgrent d_setgrent
16394 : see if setgrent_r exists
16395 set setgrent_r d_setgrent_r
16397 case "$d_setgrent_r" in
16399 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
16400 case "$d_setgrent_r_proto:$usethreads" in
16401 ":define") d_setgrent_r_proto=define
16402 set d_setgrent_r_proto setgrent_r $hdrs
16406 case "$d_setgrent_r_proto" in
16408 case "$setgrent_r_proto" in
16409 ''|0) try='int setgrent_r(FILE**);'
16410 ./protochk "extern $try" $hdrs && setgrent_r_proto=I_H ;;
16412 case "$setgrent_r_proto" in
16413 ''|0) try='void setgrent_r(FILE**);'
16414 ./protochk "extern $try" $hdrs && setgrent_r_proto=V_H ;;
16416 case "$setgrent_r_proto" in
16417 ''|0) d_setgrent_r=undef
16419 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
16420 * ) case "$setgrent_r_proto" in
16421 REENTRANT_PROTO*) ;;
16422 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
16424 echo "Prototype: $try" ;;
16427 *) case "$usethreads" in
16428 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
16435 *) setgrent_r_proto=0
16439 : see if sethostent exists
16440 set sethostent d_sethent
16443 : see if sethostent_r exists
16444 set sethostent_r d_sethostent_r
16446 case "$d_sethostent_r" in
16448 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16449 case "$d_sethostent_r_proto:$usethreads" in
16450 ":define") d_sethostent_r_proto=define
16451 set d_sethostent_r_proto sethostent_r $hdrs
16455 case "$d_sethostent_r_proto" in
16457 case "$sethostent_r_proto" in
16458 ''|0) try='int sethostent_r(int, struct hostent_data*);'
16459 ./protochk "extern $try" $hdrs && sethostent_r_proto=I_ID ;;
16461 case "$sethostent_r_proto" in
16462 ''|0) try='void sethostent_r(int, struct hostent_data*);'
16463 ./protochk "extern $try" $hdrs && sethostent_r_proto=V_ID ;;
16465 case "$sethostent_r_proto" in
16466 ''|0) d_sethostent_r=undef
16467 sethostent_r_proto=0
16468 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
16469 * ) case "$sethostent_r_proto" in
16470 REENTRANT_PROTO*) ;;
16471 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
16473 echo "Prototype: $try" ;;
16476 *) case "$usethreads" in
16477 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
16479 d_sethostent_r=undef
16480 sethostent_r_proto=0
16484 *) sethostent_r_proto=0
16488 : see if setitimer exists
16489 set setitimer d_setitimer
16492 : see if setlinebuf exists
16493 set setlinebuf d_setlinebuf
16496 : see if setlocale exists
16497 set setlocale d_setlocale
16500 : see if locale.h is available
16501 set locale.h i_locale
16504 : see if setlocale_r exists
16505 set setlocale_r d_setlocale_r
16507 case "$d_setlocale_r" in
16509 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
16510 case "$d_setlocale_r_proto:$usethreads" in
16511 ":define") d_setlocale_r_proto=define
16512 set d_setlocale_r_proto setlocale_r $hdrs
16516 case "$d_setlocale_r_proto" in
16518 case "$setlocale_r_proto" in
16519 ''|0) try='int setlocale_r(int, const char*, char*, int);'
16520 ./protochk "extern $try" $hdrs && setlocale_r_proto=I_ICBI ;;
16522 case "$setlocale_r_proto" in
16523 ''|0) d_setlocale_r=undef
16524 setlocale_r_proto=0
16525 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
16526 * ) case "$setlocale_r_proto" in
16527 REENTRANT_PROTO*) ;;
16528 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
16530 echo "Prototype: $try" ;;
16533 *) case "$usethreads" in
16534 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
16536 d_setlocale_r=undef
16537 setlocale_r_proto=0
16541 *) setlocale_r_proto=0
16545 : see if setnetent exists
16546 set setnetent d_setnent
16549 : see if setnetent_r exists
16550 set setnetent_r d_setnetent_r
16552 case "$d_setnetent_r" in
16554 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16555 case "$d_setnetent_r_proto:$usethreads" in
16556 ":define") d_setnetent_r_proto=define
16557 set d_setnetent_r_proto setnetent_r $hdrs
16561 case "$d_setnetent_r_proto" in
16563 case "$setnetent_r_proto" in
16564 ''|0) try='int setnetent_r(int, struct netent_data*);'
16565 ./protochk "extern $try" $hdrs && setnetent_r_proto=I_ID ;;
16567 case "$setnetent_r_proto" in
16568 ''|0) try='void setnetent_r(int, struct netent_data*);'
16569 ./protochk "extern $try" $hdrs && setnetent_r_proto=V_ID ;;
16571 case "$setnetent_r_proto" in
16572 ''|0) d_setnetent_r=undef
16573 setnetent_r_proto=0
16574 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
16575 * ) case "$setnetent_r_proto" in
16576 REENTRANT_PROTO*) ;;
16577 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
16579 echo "Prototype: $try" ;;
16582 *) case "$usethreads" in
16583 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
16585 d_setnetent_r=undef
16586 setnetent_r_proto=0
16590 *) setnetent_r_proto=0
16594 : see if setprotoent exists
16595 set setprotoent d_setpent
16598 : see if setpgid exists
16599 set setpgid d_setpgid
16602 : see if setpgrp2 exists
16603 set setpgrp2 d_setpgrp2
16606 : see if setpriority exists
16607 set setpriority d_setprior
16610 : see if setproctitle exists
16611 set setproctitle d_setproctitle
16614 : see if setprotoent_r exists
16615 set setprotoent_r d_setprotoent_r
16617 case "$d_setprotoent_r" in
16619 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16620 case "$d_setprotoent_r_proto:$usethreads" in
16621 ":define") d_setprotoent_r_proto=define
16622 set d_setprotoent_r_proto setprotoent_r $hdrs
16626 case "$d_setprotoent_r_proto" in
16628 case "$setprotoent_r_proto" in
16629 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
16630 ./protochk "extern $try" $hdrs && setprotoent_r_proto=I_ID ;;
16632 case "$setprotoent_r_proto" in
16633 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
16634 ./protochk "extern $try" $hdrs && setprotoent_r_proto=V_ID ;;
16636 case "$setprotoent_r_proto" in
16637 ''|0) d_setprotoent_r=undef
16638 setprotoent_r_proto=0
16639 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
16640 * ) case "$setprotoent_r_proto" in
16641 REENTRANT_PROTO*) ;;
16642 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
16644 echo "Prototype: $try" ;;
16647 *) case "$usethreads" in
16648 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
16650 d_setprotoent_r=undef
16651 setprotoent_r_proto=0
16655 *) setprotoent_r_proto=0
16659 : see if setpwent exists
16660 set setpwent d_setpwent
16663 : see if setpwent_r exists
16664 set setpwent_r d_setpwent_r
16666 case "$d_setpwent_r" in
16668 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
16669 case "$d_setpwent_r_proto:$usethreads" in
16670 ":define") d_setpwent_r_proto=define
16671 set d_setpwent_r_proto setpwent_r $hdrs
16675 case "$d_setpwent_r_proto" in
16677 case "$setpwent_r_proto" in
16678 ''|0) try='int setpwent_r(FILE**);'
16679 ./protochk "extern $try" $hdrs && setpwent_r_proto=I_H ;;
16681 case "$setpwent_r_proto" in
16682 ''|0) try='void setpwent_r(FILE**);'
16683 ./protochk "extern $try" $hdrs && setpwent_r_proto=V_H ;;
16685 case "$setpwent_r_proto" in
16686 ''|0) d_setpwent_r=undef
16688 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
16689 * ) case "$setpwent_r_proto" in
16690 REENTRANT_PROTO*) ;;
16691 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
16693 echo "Prototype: $try" ;;
16696 *) case "$usethreads" in
16697 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
16704 *) setpwent_r_proto=0
16708 : see if setregid exists
16709 set setregid d_setregid
16711 set setresgid d_setresgid
16714 : see if setreuid exists
16715 set setreuid d_setreuid
16717 set setresuid d_setresuid
16720 : see if setrgid exists
16721 set setrgid d_setrgid
16724 : see if setruid exists
16725 set setruid d_setruid
16728 : see if setservent exists
16729 set setservent d_setsent
16732 : see if setservent_r exists
16733 set setservent_r d_setservent_r
16735 case "$d_setservent_r" in
16737 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16738 case "$d_setservent_r_proto:$usethreads" in
16739 ":define") d_setservent_r_proto=define
16740 set d_setservent_r_proto setservent_r $hdrs
16744 case "$d_setservent_r_proto" in
16746 case "$setservent_r_proto" in
16747 ''|0) try='int setservent_r(int, struct servent_data*);'
16748 ./protochk "extern $try" $hdrs && setservent_r_proto=I_ID ;;
16750 case "$setservent_r_proto" in
16751 ''|0) try='void setservent_r(int, struct servent_data*);'
16752 ./protochk "extern $try" $hdrs && setservent_r_proto=V_ID ;;
16754 case "$setservent_r_proto" in
16755 ''|0) d_setservent_r=undef
16756 setservent_r_proto=0
16757 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
16758 * ) case "$setservent_r_proto" in
16759 REENTRANT_PROTO*) ;;
16760 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
16762 echo "Prototype: $try" ;;
16765 *) case "$usethreads" in
16766 define) echo "setservent_r has no prototype, not using it." >&4 ;;
16768 d_setservent_r=undef
16769 setservent_r_proto=0
16773 *) setservent_r_proto=0
16777 : see if setsid exists
16778 set setsid d_setsid
16781 : see if setvbuf exists
16782 set setvbuf d_setvbuf
16785 : see if sfio.h is available
16790 : see if sfio library is available
16801 : Ok, but do we want to use it.
16805 true|$define|[yY]*) dflt='y';;
16808 echo "$package can use the sfio library, but it is experimental."
16809 case "$useperlio" in
16811 echo "For sfio also the PerlIO abstraction layer is needed."
16812 echo "Earlier you said you wouldn't want that."
16815 rp="You seem to have sfio available, do you want to try using it?"
16818 y|Y) echo "Ok, turning on both sfio and PerlIO, then."
16819 useperlio="$define"
16822 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
16827 *) case "$usesfio" in
16828 true|$define|[yY]*)
16829 echo "Sorry, cannot find sfio on this machine." >&4
16830 echo "Ignoring your setting of usesfio=$usesfio." >&4
16839 $define) usesfio='true';;
16840 *) usesfio='false';;
16844 *) : Remove sfio from list of libraries to use
16847 echo "Removing unneeded -lsfio from library list" >&4
16848 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
16851 echo "libs = $libs" >&4
16858 : see if shmctl exists
16859 set shmctl d_shmctl
16862 : see if shmget exists
16863 set shmget d_shmget
16866 : see if shmat exists
16869 : see what shmat returns
16872 $cat >shmat.c <<'END'
16873 #include <sys/shm.h>
16876 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
16881 echo "and it returns ($shmattype)." >&4
16882 : see if a prototype for shmat is available
16883 xxx=`./findhdr sys/shm.h`
16884 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
16885 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
16896 set d_shmatprototype
16899 : see if shmdt exists
16903 : see how much of the 'shm*(2)' library is present.
16906 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
16907 *"$undef"*) h_shm=false;;
16911 case "`ipcs 2>&1`" in
16912 "SVID shared memory"*"not configured"*)
16913 echo "Your $osname does not have the shm*(2) configured." >&4
16916 set shmctl d_shmctl
16918 set shmget d_shmget
16928 : we could also check for sys/ipc.h ...
16929 if $h_shm && $test `./findhdr sys/shm.h`; then
16930 echo "You have the full shm*(2) library." >&4
16933 echo "You don't have the full shm*(2) library." >&4
16940 : see if we have sigaction
16941 if set sigaction val -f d_sigaction; eval $csym; $val; then
16942 echo 'sigaction() found.' >&4
16945 #include <sys/types.h>
16946 #include <signal.h>
16947 #$i_stdlib I_STDLIB
16949 #include <stdlib.h>
16953 struct sigaction act, oact;
16955 oact.sa_handler = 0;
16956 /* so that act and oact are used */
16957 exit(act.sa_flags == 0 && oact.sa_handler == 0);
16961 if eval $compile_ok; then
16964 echo "But you don't seem to have a useable struct sigaction." >&4
16968 echo 'sigaction NOT found.' >&4
16971 set d_sigaction; eval $setvar
16974 : see if this is a sunmath.h system
16975 set sunmath.h i_sunmath
16978 : see if signbit exists
16979 $echo $n "Checking to see if you have signbit() available to work on $nvtype... $c" >&4
16982 #$i_sunmath I_SUNMATH
16986 #ifdef I_SUNMATH /* Solaris special math library */
16987 # include <sunmath.h>
16990 int main(int argc, char **argv)
16994 if ((signbit(x) == 0) && (signbit(y) != 0))
17002 if eval $compile; then
17003 if $run ./try; then
17007 $echo "Signbit seems to be available, but doesn't work as I expected."
17008 $echo "I won't use it." >&4
17019 : see if sigprocmask exists
17020 set sigprocmask d_sigprocmask
17023 : see if sigsetjmp exists
17025 case "$d_sigsetjmp" in
17028 #include <setjmp.h>
17029 #$i_stdlib I_STDLIB
17031 #include <stdlib.h>
17037 if (sigsetjmp(env,1))
17040 siglongjmp(env, 1);
17045 if eval $compile; then
17046 if $run ./try >/dev/null 2>&1; then
17047 echo "POSIX sigsetjmp found." >&4
17051 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
17057 echo "sigsetjmp not found." >&4
17061 *) val="$d_sigsetjmp"
17062 case "$d_sigsetjmp" in
17063 $define) echo "POSIX sigsetjmp found." >&4;;
17064 $undef) echo "sigsetjmp not found." >&4;;
17072 : see if snprintf exists
17073 set snprintf d_snprintf
17076 : see if vsnprintf exists
17077 set vsnprintf d_vsnprintf
17080 case "$d_snprintf-$d_vsnprintf" in
17083 Checking whether your snprintf() and vsnprintf() work okay...
17085 $cat >try.c <<'EOCP'
17086 /* v?snprintf testing logic courtesy of Russ Allbery.
17087 * According to C99:
17088 * - if the buffer is too short it still must be \0-terminated
17089 * - if the buffer is too short the potentially required length
17090 * must be returned and not -1
17091 * - if the buffer is NULL the potentially required length
17092 * must be returned and not -1 or core dump
17095 #include <stdarg.h>
17099 int test (char *format, ...)
17104 va_start (args, format);
17105 count = vsnprintf (buf, sizeof buf, format, args);
17112 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
17113 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
17117 if eval $compile; then
17120 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
17122 Your snprintf() and snprintf() don't seem to be working okay.
17124 d_snprintf="$undef"
17125 d_vsnprintf="$undef"
17129 echo "(I can't seem to compile the test program--assuming they don't)"
17130 d_snprintf="$undef"
17131 d_vsnprintf="$undef"
17137 : see if sockatmark exists
17138 set sockatmark d_sockatmark
17141 : see if prototype for sockatmark is available
17143 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
17146 : see if socks5_init exists
17147 set socks5_init d_socks5_init
17150 : see if sprintf returns the length of the string in the buffer as per ANSI
17151 $echo "Checking whether sprintf returns the length of the string..." >&4
17154 #$i_stdlib I_STDLIB
17156 #include <stdlib.h>
17158 #$i_string I_STRING
17160 # include <string.h>
17162 # include <strings.h>
17171 int check (size_t expect, int test) {
17172 size_t got = strlen(buffer);
17176 printf("expected %ld, got %ld in test %d '%s'\n", (long) expect, (long) got,
17181 int main(int argc, char **argv) {
17184 check(sprintf(buffer, ""), ++test);
17185 check(sprintf(buffer, "%s %s", "perl", "rules"), ++test);
17186 check(sprintf(buffer, "I like %g", atan2(0,-1)), ++test);
17193 d_sprintf_returns_strlen="$undef"
17194 if eval $compile; then
17198 sprintf returns the length of the string (as ANSI says it should)
17200 d_sprintf_returns_strlen="$define"
17203 sprintf does not return the length of the string (how old is this system?)
17205 d_sprintf_returns_strlen="$undef"
17211 : see if srand48_r exists
17212 set srand48_r d_srand48_r
17214 case "$d_srand48_r" in
17216 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17217 case "$d_srand48_r_proto:$usethreads" in
17218 ":define") d_srand48_r_proto=define
17219 set d_srand48_r_proto srand48_r $hdrs
17223 case "$d_srand48_r_proto" in
17225 case "$srand48_r_proto" in
17226 ''|0) try='int srand48_r(long, struct drand48_data*);'
17227 ./protochk "extern $try" $hdrs && srand48_r_proto=I_LS ;;
17229 case "$srand48_r_proto" in
17230 ''|0) d_srand48_r=undef
17232 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
17233 * ) case "$srand48_r_proto" in
17234 REENTRANT_PROTO*) ;;
17235 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
17237 echo "Prototype: $try" ;;
17240 *) case "$usethreads" in
17241 define) echo "srand48_r has no prototype, not using it." >&4 ;;
17248 *) srand48_r_proto=0
17252 : see if srandom_r exists
17253 set srandom_r d_srandom_r
17255 case "$d_srandom_r" in
17257 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17258 case "$d_srandom_r_proto:$usethreads" in
17259 ":define") d_srandom_r_proto=define
17260 set d_srandom_r_proto srandom_r $hdrs
17264 case "$d_srandom_r_proto" in
17266 case "$srandom_r_proto" in
17267 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
17268 ./protochk "extern $try" $hdrs && srandom_r_proto=I_TS ;;
17270 case "$srandom_r_proto" in
17271 ''|0) d_srandom_r=undef
17273 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
17274 * ) case "$srandom_r_proto" in
17275 REENTRANT_PROTO*) ;;
17276 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
17278 echo "Prototype: $try" ;;
17281 *) case "$usethreads" in
17282 define) echo "srandom_r has no prototype, not using it." >&4 ;;
17289 *) srandom_r_proto=0
17293 : see if prototype for setresgid is available
17295 set d_sresgproto setresgid $i_unistd unistd.h
17298 : see if prototype for setresuid is available
17300 set d_sresuproto setresuid $i_unistd unistd.h
17303 : see if sys/stat.h is available
17304 set sys/stat.h i_sysstat
17308 : see if stat knows about block sizes
17310 echo "Checking to see if your struct stat has st_blocks field..." >&4
17311 set d_statblks stat st_blocks $i_sysstat sys/stat.h
17315 : see if this is a sys/vfs.h system
17316 set sys/vfs.h i_sysvfs
17320 : see if this is a sys/statfs.h system
17321 set sys/statfs.h i_sysstatfs
17326 echo "Checking to see if your system supports struct statfs..." >&4
17327 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
17329 case "$d_statfs_s" in
17330 "$define") echo "Yes, it does." ;;
17331 *) echo "No, it doesn't." ;;
17336 : see if struct statfs knows about f_flags
17337 case "$d_statfs_s" in
17340 echo "Checking to see if your struct statfs has f_flags field..." >&4
17341 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
17345 set d_statfs_f_flags
17349 case "$d_statfs_f_flags" in
17350 "$define") echo "Yes, it does." ;;
17351 *) echo "No, it doesn't." ;;
17355 Checking how to access stdio streams by file descriptor number...
17357 case "$stdio_stream_array" in
17358 '') $cat >try.c <<EOCP
17361 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
17365 for s in _iob __iob __sF
17367 set try -DSTDIO_STREAM_ARRAY=$s
17368 if eval $compile; then
17369 case "`$run ./try`" in
17370 yes) stdio_stream_array=$s; break ;;
17376 case "$stdio_stream_array" in
17378 I can't figure out how to access stdio streams by file descriptor number.
17380 d_stdio_stream_array="$undef"
17383 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
17385 d_stdio_stream_array="$define"
17389 : see if strcoll exists
17390 set strcoll d_strcoll
17393 : check for structure copying
17395 echo "Checking to see if your C compiler can copy structs..." >&4
17396 $cat >try.c <<'EOCP'
17406 if $cc -c try.c >/dev/null 2>&1 ; then
17408 echo "Yup, it can."
17411 echo "Nope, it can't."
17417 : see if strerror and/or sys_errlist[] exist
17419 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
17420 if set strerror val -f d_strerror; eval $csym; $val; then
17421 echo 'strerror() found.' >&4
17422 d_strerror="$define"
17423 d_strerrm='strerror(e)'
17424 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17425 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
17426 d_syserrlst="$define"
17428 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
17429 d_syserrlst="$undef"
17431 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
17432 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
17433 echo 'strerror() found in string header.' >&4
17434 d_strerror="$define"
17435 d_strerrm='strerror(e)'
17436 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17437 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
17438 d_syserrlst="$define"
17440 echo "(You don't appear to have any sys_errlist[], how can this be?)"
17441 d_syserrlst="$undef"
17443 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17444 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
17445 d_strerror="$undef"
17446 d_syserrlst="$define"
17447 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
17449 echo 'strerror() and sys_errlist[] NOT found.' >&4
17450 d_strerror="$undef"
17451 d_syserrlst="$undef"
17452 d_strerrm='"unknown"'
17456 : see if strerror_r exists
17457 set strerror_r d_strerror_r
17459 case "$d_strerror_r" in
17461 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
17462 case "$d_strerror_r_proto:$usethreads" in
17463 ":define") d_strerror_r_proto=define
17464 set d_strerror_r_proto strerror_r $hdrs
17468 case "$d_strerror_r_proto" in
17470 case "$strerror_r_proto" in
17471 ''|0) try='int strerror_r(int, char*, size_t);'
17472 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBW ;;
17474 case "$strerror_r_proto" in
17475 ''|0) try='int strerror_r(int, char*, int);'
17476 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBI ;;
17478 case "$strerror_r_proto" in
17479 ''|0) try='char* strerror_r(int, char*, size_t);'
17480 ./protochk "extern $try" $hdrs && strerror_r_proto=B_IBW ;;
17482 case "$strerror_r_proto" in
17483 ''|0) d_strerror_r=undef
17485 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
17486 * ) case "$strerror_r_proto" in
17487 REENTRANT_PROTO*) ;;
17488 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
17490 echo "Prototype: $try" ;;
17493 *) case "$usethreads" in
17494 define) echo "strerror_r has no prototype, not using it." >&4 ;;
17501 *) strerror_r_proto=0
17505 : see if strftime exists
17506 set strftime d_strftime
17509 : see if strlcat exists
17510 set strlcat d_strlcat
17513 : see if strlcpy exists
17514 set strlcpy d_strlcpy
17517 : see if strtod exists
17518 set strtod d_strtod
17521 : see if strtol exists
17522 set strtol d_strtol
17525 : see if strtold exists
17526 set strtold d_strtold
17529 : see if strtoll exists
17530 set strtoll d_strtoll
17533 case "$d_longlong-$d_strtoll" in
17536 Checking whether your strtoll() works okay...
17538 $cat >try.c <<'EOCP'
17541 #define strtoll __strtoll
17544 #define strtoll _strtoll
17547 extern long long int strtoll(char *s, char **, int);
17548 static int bad = 0;
17549 int check(char *s, long long ell, int een) {
17552 gll = strtoll(s, 0, 10);
17553 if (!((gll == ell) && (errno == een)))
17557 check(" 1", 1LL, 0);
17558 check(" 0", 0LL, 0);
17559 check("-1", -1LL, 0);
17560 check("-9223372036854775808", -9223372036854775808LL, 0);
17561 check("-9223372036854775808", -9223372036854775808LL, 0);
17562 check(" 9223372036854775807", 9223372036854775807LL, 0);
17563 check("-9223372036854775808", -9223372036854775808LL, 0);
17564 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
17565 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
17571 if eval $compile; then
17574 ok) echo "Your strtoll() seems to be working okay." ;;
17576 Your strtoll() doesn't seem to be working okay.
17582 echo "(I can't seem to compile the test program--assuming it doesn't)"
17588 : see if strtoq exists
17589 set strtoq d_strtoq
17592 : see if strtoul exists
17593 set strtoul d_strtoul
17596 case "$d_strtoul" in
17599 Checking whether your strtoul() works okay...
17601 $cat >try.c <<'EOCP'
17604 extern unsigned long int strtoul(char *s, char **, int);
17605 static int bad = 0;
17606 void check(char *s, unsigned long eul, int een) {
17609 gul = strtoul(s, 0, 10);
17610 if (!((gul == eul) && (errno == een)))
17614 check(" 1", 1L, 0);
17615 check(" 0", 0L, 0);
17617 case "$longsize" in
17619 $cat >>try.c <<'EOCP'
17620 check("18446744073709551615", 18446744073709551615UL, 0);
17621 check("18446744073709551616", 18446744073709551615UL, ERANGE);
17622 #if 0 /* strtoul() for /^-/ strings is undefined. */
17623 check("-1", 18446744073709551615UL, 0);
17624 check("-18446744073709551614", 2, 0);
17625 check("-18446744073709551615", 1, 0);
17626 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
17627 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
17632 $cat >>try.c <<'EOCP'
17633 check("4294967295", 4294967295UL, 0);
17634 check("4294967296", 4294967295UL, ERANGE);
17635 #if 0 /* strtoul() for /^-/ strings is undefined. */
17636 check("-1", 4294967295UL, 0);
17637 check("-4294967294", 2, 0);
17638 check("-4294967295", 1, 0);
17639 check("-4294967296", 4294967295UL, ERANGE);
17640 check("-4294967297", 4294967295UL, ERANGE);
17645 : Should we write these tests to be more portable by sprintf-ing
17646 : ~0 and then manipulating that char string as input for strtol?
17649 $cat >>try.c <<'EOCP'
17656 if eval $compile; then
17657 case "`$run ./try`" in
17658 ok) echo "Your strtoul() seems to be working okay." ;;
17660 Your strtoul() doesn't seem to be working okay.
17666 echo "(I can't seem to compile the test program--assuming it doesn't)"
17672 : see if strtoull exists
17673 set strtoull d_strtoull
17676 case "$d_longlong-$d_strtoull" in
17679 Checking whether your strtoull() works okay...
17681 $cat >try.c <<'EOCP'
17684 #define strtoull __strtoull
17687 extern unsigned long long int strtoull(char *s, char **, int);
17688 static int bad = 0;
17689 int check(char *s, long long eull, int een) {
17692 gull = strtoull(s, 0, 10);
17693 if (!((gull == eull) && (errno == een)))
17697 check(" 1", 1LL, 0);
17698 check(" 0", 0LL, 0);
17699 check("18446744073709551615", 18446744073709551615ULL, 0);
17700 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
17701 #if 0 /* strtoull() for /^-/ strings is undefined. */
17702 check("-1", 18446744073709551615ULL, 0);
17703 check("-18446744073709551614", 2LL, 0);
17704 check("-18446744073709551615", 1LL, 0);
17705 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
17706 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
17713 if eval $compile; then
17714 case "`$run ./try`" in
17715 ok) echo "Your strtoull() seems to be working okay." ;;
17717 Your strtoull() doesn't seem to be working okay.
17719 d_strtoull="$undef"
17723 echo "(I can't seem to compile the test program--assuming it doesn't)"
17724 d_strtoull="$undef"
17729 : see if strtouq exists
17730 set strtouq d_strtouq
17733 case "$d_strtouq" in
17736 Checking whether your strtouq() works okay...
17738 $cat >try.c <<'EOCP'
17741 extern unsigned long long int strtouq(char *s, char **, int);
17742 static int bad = 0;
17743 void check(char *s, unsigned long long eull, int een) {
17744 unsigned long long gull;
17746 gull = strtouq(s, 0, 10);
17747 if (!((gull == eull) && (errno == een)))
17751 check(" 1", 1LL, 0);
17752 check(" 0", 0LL, 0);
17753 check("18446744073709551615", 18446744073709551615ULL, 0);
17754 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
17755 #if 0 /* strtouq() for /^-/ strings is undefined. */
17756 check("-1", 18446744073709551615ULL, 0);
17757 check("-18446744073709551614", 2LL, 0);
17758 check("-18446744073709551615", 1LL, 0);
17759 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
17760 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
17768 if eval $compile; then
17769 case "`$run ./try`" in
17770 ok) echo "Your strtouq() seems to be working okay." ;;
17772 Your strtouq() doesn't seem to be working okay.
17778 echo "(I can't seem to compile the test program--assuming it doesn't)"
17784 : see if strxfrm exists
17785 set strxfrm d_strxfrm
17788 : see if symlink exists
17789 set symlink d_symlink
17792 : see if syscall exists
17793 set syscall d_syscall
17796 : see if prototype for syscall is available
17798 set d_syscallproto syscall $i_unistd unistd.h
17801 : see if sysconf exists
17802 set sysconf d_sysconf
17805 : see if system exists
17806 set system d_system
17809 : see if tcgetpgrp exists
17810 set tcgetpgrp d_tcgetpgrp
17813 : see if tcsetpgrp exists
17814 set tcsetpgrp d_tcsetpgrp
17817 : see if prototype for telldir is available
17819 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
17822 : see if time exists
17824 if test "X$d_time" = X -o X"$timetype" = X; then
17825 if set time val -f d_time; eval $csym; $val; then
17826 echo 'time() found.' >&4
17828 rp="What is the type returned by time() on this system?"
17829 set time_t timetype long stdio.h sys/types.h
17832 echo 'time() not found, hope that will do.' >&4
17840 : see if this is a sys/times.h system
17841 set sys/times.h i_systimes
17844 : see if times exists
17846 if set times val -f d_times; eval $csym; $val; then
17847 echo 'times() found.' >&4
17850 case "$i_systimes" in
17851 "$define") inc='sys/times.h';;
17853 rp="What is the type returned by times() on this system?"
17854 set clock_t clocktype long stdio.h sys/types.h $inc
17857 echo 'times() NOT found, hope that will do.' >&4
17862 : see if tmpnam_r exists
17863 set tmpnam_r d_tmpnam_r
17865 case "$d_tmpnam_r" in
17867 hdrs="$i_systypes sys/types.h define stdio.h "
17868 case "$d_tmpnam_r_proto:$usethreads" in
17869 ":define") d_tmpnam_r_proto=define
17870 set d_tmpnam_r_proto tmpnam_r $hdrs
17874 case "$d_tmpnam_r_proto" in
17876 case "$tmpnam_r_proto" in
17877 ''|0) try='char* tmpnam_r(char*);'
17878 ./protochk "extern $try" $hdrs && tmpnam_r_proto=B_B ;;
17880 case "$tmpnam_r_proto" in
17881 ''|0) d_tmpnam_r=undef
17883 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
17884 * ) case "$tmpnam_r_proto" in
17885 REENTRANT_PROTO*) ;;
17886 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
17888 echo "Prototype: $try" ;;
17891 *) case "$usethreads" in
17892 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
17899 *) tmpnam_r_proto=0
17903 : see if truncate exists
17904 set truncate d_truncate
17907 : see if ttyname_r exists
17908 set ttyname_r d_ttyname_r
17910 case "$d_ttyname_r" in
17912 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
17913 case "$d_ttyname_r_proto:$usethreads" in
17914 ":define") d_ttyname_r_proto=define
17915 set d_ttyname_r_proto ttyname_r $hdrs
17919 case "$d_ttyname_r_proto" in
17921 case "$ttyname_r_proto" in
17922 ''|0) try='int ttyname_r(int, char*, size_t);'
17923 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBW ;;
17925 case "$ttyname_r_proto" in
17926 ''|0) try='int ttyname_r(int, char*, int);'
17927 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBI ;;
17929 case "$ttyname_r_proto" in
17930 ''|0) try='char* ttyname_r(int, char*, int);'
17931 ./protochk "extern $try" $hdrs && ttyname_r_proto=B_IBI ;;
17933 case "$ttyname_r_proto" in
17934 ''|0) d_ttyname_r=undef
17936 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
17937 * ) case "$ttyname_r_proto" in
17938 REENTRANT_PROTO*) ;;
17939 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
17941 echo "Prototype: $try" ;;
17944 *) case "$usethreads" in
17945 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
17952 *) ttyname_r_proto=0
17956 : see if tzname[] exists
17958 if set tzname val -a d_tzname; eval $csym; $val; then
17960 echo 'tzname[] found.' >&4
17963 echo 'tzname[] NOT found.' >&4
17969 next|rhapsody|darwin) multiarch="$define" ;;
17971 case "$multiarch" in
17972 ''|[nN]*) multiarch="$undef" ;;
17975 : check for ordering of bytes in a UV
17977 case "$usecrosscompile$multiarch" in
17980 You seem to be either cross-compiling or doing a multiarchitecture build,
17981 skipping the byteorder check.
17987 case "$byteorder" in
17990 In the following, larger digits indicate more significance. A big-endian
17991 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
17992 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
17993 machines may have weird orders like 3412. A Cray will report 87654321,
17994 an Alpha will report 12345678. If the test program works the default is
17996 I'm now running the test program...
18000 #$i_stdlib I_STDLIB
18002 #include <stdlib.h>
18004 #include <sys/types.h>
18005 typedef $uvtype UV;
18015 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
18017 u.l = (UV)0x04030201;
18018 for (i = 0; i < $uvsize; i++)
18019 printf("%c", u.c[i]+'0');
18026 if eval $compile && $run ./try > /dev/null; then
18029 [1-4][1-4][1-4][1-4]|12345678|87654321)
18030 echo "(The test program ran ok.)"
18031 echo "byteorder=$dflt"
18034 ????|????????) echo "(The test program ran ok.)" ;;
18035 *) echo "(The test program didn't run right for some reason.)" ;;
18040 (I can't seem to compile the test program. Guessing big-endian...)
18043 case "$xxx_prompt" in
18045 rp="What is the order of bytes in $uvtype?"
18060 Checking to see whether you can access character data unalignedly...
18062 case "$d_u32align" in
18063 '') $cat >try.c <<EOCP
18065 #$i_stdlib I_STDLIB
18067 #include <stdlib.h>
18069 #define U32 $u32type
18070 #define BYTEORDER 0x$byteorder
18072 #include <signal.h>
18074 $signal_t bletch(int s) { exit(4); }
18077 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
18082 if (sizeof(U32) != 4) {
18083 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
18090 signal(SIGBUS, bletch);
18102 for (i = 0; i < 4; i++) {
18103 up = (U32*)(buf + i);
18104 if (! ((*up == 1 << (8*i)) || /* big-endian */
18105 (*up == 1 << (8*(3-i))) /* little-endian */
18109 printf("read failed (%x)\n", *up);
18115 for (i = 0; i < 4; i++) {
18116 up = (U32*)(buf + i);
18118 if (*up != 0xBeef) {
18119 printf("write failed (%x)\n", *up);
18133 if eval $compile_ok; then
18134 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
18135 $run ./try 2>&1 >/dev/null
18138 You can access character data pretty unalignedly.
18140 d_u32align="$undef"
18143 It seems that you must access character data in an aligned manner.
18145 d_u32align="$define"
18149 rp='Can you access character data at unaligned addresses?'
18153 [yY]*) d_u32align="$undef" ;;
18154 *) d_u32align="$define" ;;
18161 : see if ualarm exists
18162 set ualarm d_ualarm
18165 : see if umask exists
18169 : see if unordered exists
18170 set unordered d_unordered
18173 : see if unsetenv exists
18174 set unsetenv d_unsetenv
18177 : see if usleep exists
18178 set usleep d_usleep
18181 : see if prototype for usleep is available
18183 set d_usleepproto usleep $i_unistd unistd.h
18186 : see if ustat exists
18190 : see if closedir exists
18191 set closedir d_closedir
18194 case "$d_closedir" in
18197 echo "Checking whether closedir() returns a status..." >&4
18199 #$i_dirent I_DIRENT /**/
18200 #$i_sysdir I_SYS_DIR /**/
18201 #$i_sysndir I_SYS_NDIR /**/
18202 #$i_systypes I_SYS_TYPES /**/
18204 #if defined(I_SYS_TYPES)
18205 #include <sys/types.h>
18207 #if defined(I_DIRENT)
18208 #include <dirent.h>
18209 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
18210 #include <sys/dir.h>
18214 #include <sys/ndir.h>
18218 #include <ndir.h> /* may be wrong in the future */
18220 #include <sys/dir.h>
18225 int main() { return closedir(opendir(".")); }
18228 if eval $compile_ok; then
18229 if $run ./try > /dev/null 2>&1 ; then
18230 echo "Yes, it does."
18233 echo "No, it doesn't."
18237 echo "(I can't seem to compile the test program--assuming it doesn't)"
18245 set d_void_closedir
18249 : see if there is a wait4
18253 : see if waitpid exists
18254 set waitpid d_waitpid
18257 : see if wcstombs exists
18258 set wcstombs d_wcstombs
18261 : see if wctomb exists
18262 set wctomb d_wctomb
18265 : see if writev exists
18266 set writev d_writev
18269 : preserve RCS keywords in files with variable substitution, grrr
18274 Revision='$Revision'
18276 : check for alignment requirements
18278 case "$usecrosscompile$multiarch" in
18281 You seem to be either cross-compiling or doing a multiarchitecture build,
18282 skipping the memory alignment check.
18285 case "$alignbytes" in
18286 '') alignbytes=8 ;;
18290 case "$alignbytes" in
18291 '') echo "Checking alignment constraints..." >&4
18292 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
18293 $cat >try.c <<'EOCP'
18294 typedef long double NV;
18297 $cat >try.c <<'EOCP'
18301 $cat >>try.c <<'EOCP'
18309 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
18314 if eval $compile_ok; then
18318 echo "(I can't seem to compile the test program...)"
18321 *) dflt="$alignbytes"
18324 rp="Doubles must be aligned on a how-many-byte boundary?"
18332 : set the base revision
18335 : how do we concatenate cpp tokens here?
18337 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
18338 $cat >cpp_stuff.c <<'EOCP'
18339 #define RCAT(a,b)a/**/b
18340 #define ACAT(a,b)a ## b
18344 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
18345 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
18346 echo "Oh! Smells like ANSI's been here." >&4
18347 echo "We can catify or stringify, separately or together!"
18349 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
18350 echo "Ah, yes! The good old days!" >&4
18351 echo "However, in the good old days we don't know how to stringify and"
18352 echo "catify at the same time."
18356 Hmm, I don't seem to be able to concatenate tokens with your cpp.
18357 You're going to have to edit the values of CAT[2-5] in config.h...
18359 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
18363 : see if this is a db.h system
18369 : Check db version.
18371 echo "Checking Berkeley DB version ..." >&4
18377 #include <sys/types.h>
18379 #$i_stdlib I_STDLIB
18381 #include <stdlib.h>
18384 int main(int argc, char *argv[])
18386 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
18387 int Major, Minor, Patch ;
18388 unsigned long Version ;
18389 (void)db_version(&Major, &Minor, &Patch) ;
18391 printf("%d %d %d %d %d %d\n",
18392 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
18393 Major, Minor, Patch);
18396 printf("You have Berkeley DB Version 2 or greater.\n");
18398 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
18399 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
18400 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
18401 Major, Minor, Patch) ;
18403 /* check that db.h & libdb are compatible */
18404 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
18405 printf("db.h and libdb are incompatible.\n") ;
18409 printf("db.h and libdb are compatible.\n") ;
18411 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
18412 + DB_VERSION_PATCH ;
18414 /* needs to be >= 2.3.4 */
18415 if (Version < 2003004) {
18416 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
18417 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
18423 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
18428 printf("You have Berkeley DB Version 1.\n");
18429 exit(0); /* DB version < 2: the coast is clear. */
18431 exit(1); /* <db.h> not Berkeley DB? */
18437 if eval $compile_ok && $run ./try; then
18438 echo 'Looks OK.' >&4
18440 db_version_major=$1
18441 db_version_minor=$2
18442 db_version_patch=$3
18444 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
18448 : Remove db from list of libraries to use
18449 echo "Removing unusable -ldb from library list" >&4
18450 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
18453 echo "libs = $libs" >&4
18463 : Check the return type needed for hash
18465 echo "Checking return type needed for hash for Berkeley DB ..." >&4
18471 #include <sys/types.h>
18474 #ifndef DB_VERSION_MAJOR
18475 u_int32_t hash_cb (ptr, size)
18483 info.hash = hash_cb;
18487 if $cc $ccflags -c try.c >try.out 2>&1 ; then
18488 if $contains warning try.out >>/dev/null 2>&1 ; then
18491 db_hashtype='u_int32_t'
18494 : XXX Maybe we should just give up here.
18495 db_hashtype=u_int32_t
18497 echo "Help: I can't seem to compile the db test program." >&4
18498 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
18501 echo "Your version of Berkeley DB uses $db_hashtype for hash."
18503 *) db_hashtype=u_int32_t
18508 : Check the return type needed for prefix
18510 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
18516 #include <sys/types.h>
18519 #ifndef DB_VERSION_MAJOR
18520 size_t prefix_cb (key1, key2)
18528 info.prefix = prefix_cb;
18532 if $cc $ccflags -c try.c >try.out 2>&1 ; then
18533 if $contains warning try.out >>/dev/null 2>&1 ; then
18534 db_prefixtype='int'
18536 db_prefixtype='size_t'
18539 db_prefixtype='size_t'
18540 : XXX Maybe we should just give up here.
18542 echo "Help: I can't seem to compile the db test program." >&4
18543 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
18546 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
18548 *) db_prefixtype='size_t'
18552 : How can we generate normalized random numbers ?
18554 echo "Looking for a random number function..." >&4
18555 case "$randfunc" in
18557 if set drand48 val -f; eval $csym; $val; then
18559 echo "Good, found drand48()." >&4
18560 elif set random val -f; eval $csym; $val; then
18562 echo "OK, found random()." >&4
18565 echo "Yick, looks like I have to use rand()." >&4
18576 *-Dmy_rand=*|*-Dmy_srand=*)
18577 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
18578 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
18579 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
18580 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
18584 while $test "$cont"; do
18585 rp="Use which function to generate random numbers?"
18587 if $test "$ans" = "$dflt"; then
18593 if set $ans val -f; eval $csym; $val; then
18597 rp="I cannot find function $ans. Use that name anyway?"
18606 case "$randfunc" in
18608 drand01="drand48()"
18614 case "$randbits" in
18616 echo "Checking to see how many bits your $randfunc() function produces..." >&4
18618 #$i_unistd I_UNISTD
18619 #$i_stdlib I_STDLIB
18622 # include <unistd.h>
18625 # include <stdlib.h>
18630 register unsigned long tmp;
18631 register unsigned long max = 0L;
18633 for (i = 1000; i; i--) {
18634 tmp = (unsigned long) $randfunc();
18635 if (tmp > max) max = tmp;
18637 for (i = 0; max; i++)
18643 if eval $compile_ok; then
18647 echo "(I can't seem to compile the test program...)"
18654 rp="How many bits does your $randfunc() function produce?"
18658 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
18659 seedfunc="s$randfunc"
18660 randseedtype=unsigned
18664 rp="How many bits does your $randfunc() function produce?"
18667 seedfunc="s$randfunc"
18668 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
18669 if set $seedfunc val -f; eval $csym; $val; then
18670 echo "(Using $seedfunc() to seed random generator)"
18672 echo "(Warning: no $seedfunc() to seed random generator)"
18675 randseedtype=unsigned
18683 echo "Determining whether or not we are on an EBCDIC system..." >&4
18684 $cat >try.c <<'EOM'
18687 if ('M'==0xd4) return 0;
18694 if eval $compile_ok; then
18695 if $run ./try; then
18696 echo "You seem to speak EBCDIC." >&4
18699 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
18702 echo "I'm unable to compile the test program." >&4
18703 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
18711 Checking how to flush all pending stdio output...
18713 # I only know how to find the first 32 possibly open files on SunOS.
18714 # See also hints/sunos_4_1.sh and util.c --AD
18716 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
18718 $cat >>try.c <<EOCP
18720 #$i_stdlib I_STDLIB
18722 #include <stdlib.h>
18724 #$i_unistd I_UNISTD
18726 # include <unistd.h>
18728 #$d_sysconf HAS_SYSCONF
18729 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
18730 #ifdef HAS_STDIO_STREAM_ARRAY
18731 # define STDIO_STREAM_ARRAY $stdio_stream_array
18736 p = fopen("try.out", "w");
18740 # ifdef TRY_FPRINTF
18744 #ifdef TRY_FFLUSH_NULL
18747 #ifdef TRY_FFLUSH_ALL
18749 long open_max = -1;
18750 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
18751 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
18753 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
18754 open_max = sysconf(_SC_OPEN_MAX);
18757 open_max = FOPEN_MAX;
18760 open_max = OPEN_MAX;
18769 # ifdef HAS_STDIO_STREAM_ARRAY
18770 if (open_max > 0) {
18772 for (i = 0; i < open_max; i++)
18773 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
18774 STDIO_STREAM_ARRAY[i]._file < open_max &&
18775 STDIO_STREAM_ARRAY[i]._flag)
18776 fflush(&STDIO_STREAM_ARRAY[i]);
18784 : first we have to find out how _not_ to flush
18786 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
18788 set try -DTRY_FPUTC
18789 if eval $compile; then
18790 $run ./try 2>/dev/null
18793 if $test ! -s try.out -a "X$code" = X42; then
18799 set try -DTRY_FPRINTF
18800 if eval $compile; then
18801 $run ./try 2>/dev/null
18804 if $test ! -s try.out -a "X$code" = X42; then
18805 output=-DTRY_FPRINTF
18811 : check for fflush NULL behaviour
18812 case "$fflushNULL" in
18813 '') set try -DTRY_FFLUSH_NULL $output
18814 if eval $compile; then
18815 $run ./try 2>/dev/null
18818 if $test -s try.out -a "X$code" = X42; then
18819 fflushNULL="`$cat try.out`"
18821 if $test "X$code" != X42; then
18823 (If this test failed, don't worry, we'll try another method shortly.)
18829 case "$fflushNULL" in
18831 Your fflush(NULL) works okay for output streams.
18832 Let's see if it clobbers input pipes...
18834 # As of mid-March 2000 all versions of Solaris appear to have a stdio
18835 # bug that improperly flushes the input end of pipes. So we avoid the
18836 # autoflush on fork/system/exec support for now. :-(
18837 $cat >tryp.c <<EOCP
18840 main(int argc, char **argv)
18846 while ((i = getc(stdin)) != -1
18847 && (*bp++ = i) != '\n'
18848 && bp < &buf[1024])
18851 fprintf(stdout, "%s", buf);
18859 fflushNULL="$define"
18861 if eval $compile; then
18863 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
18864 if cmp tryp.c tryp.out >/dev/null 2>&1; then
18866 fflush(NULL) seems to behave okay with input streams.
18868 fflushNULL="$define"
18871 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
18873 fflushNULL="$undef"
18876 $rm -f core tryp.c tryp.core core.tryp.*
18879 Your fflush(NULL) isn't working (contrary to ANSI C).
18881 fflushNULL="$undef"
18884 Cannot figure out whether your fflush(NULL) works or not.
18885 I'm assuming it doesn't (contrary to ANSI C).
18887 fflushNULL="$undef"
18891 $define|true|[yY]*)
18892 fflushNULL="$define"
18895 fflushNULL="$undef"
18898 : check explicit looping only if NULL did not work, and if the pipe
18899 : bug does not show up on an explicit flush too
18900 case "$fflushNULL" in
18902 $cat >tryp.c <<EOCP
18905 main(int argc, char **argv)
18911 while ((i = getc(stdin)) != -1
18912 && (*bp++ = i) != '\n'
18913 && bp < &buf[1024])
18916 fprintf(stdout, "%s", buf);
18925 if eval $compile; then
18927 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
18928 if cmp tryp.c tryp.out >/dev/null 2>&1; then
18930 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
18932 : now check for fflushall behaviour
18933 case "$fflushall" in
18934 '') set try -DTRY_FFLUSH_ALL $output
18935 if eval $compile; then
18937 (Now testing the other method--but note that this also may fail.)
18939 $run ./try 2>/dev/null
18942 if $test -s try.out -a "X$code" = X42; then
18943 fflushall="`$cat try.out`"
18947 case "$fflushall" in
18949 Whew. Flushing explicitly all the stdio streams works.
18951 fflushall="$define"
18954 Sigh. Flushing explicitly all the stdio streams doesn't work.
18959 Cannot figure out whether flushing stdio streams explicitly works or not.
18960 I'm assuming it doesn't.
18966 "$define"|true|[yY]*)
18967 fflushall="$define"
18975 All is futile. Even fflush(stdin) clobbers input pipes!
18982 $rm -f core tryp.c tryp.core core.tryp.*
18984 *) fflushall="$undef"
18988 case "$fflushNULL$fflushall" in
18991 OK, I give up. I cannot figure out how to flush pending stdio output.
18992 We won't be flushing handles at all before fork/exec/popen.
18998 : Store the full pathname to the ar program for use in the C program
18999 : Respect a hint or command line value for full_ar.
19004 : Store the full pathname to the sed program for use in the C program
19007 : see what type gids are declared as in the kernel
19009 echo "Looking for the type for group ids returned by getgid()."
19010 set gid_t gidtype xxx stdio.h sys/types.h
19014 xxx=`./findhdr sys/user.h`
19015 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
19017 unsigned) dflt="$1 $2" ;;
19021 *) dflt="$gidtype";;
19024 gid_t) echo "gid_t found." ;;
19025 *) rp="What is the type for group ids returned by getgid()?"
19033 *_t) zzz="$gidtype" ;;
19036 echo "Checking the size of $zzz..." >&4
19038 #include <sys/types.h>
19040 #$i_stdlib I_STDLIB
19042 #include <stdlib.h>
19045 printf("%d\n", (int)sizeof($gidtype));
19050 if eval $compile_ok; then
19054 echo "(I can't execute the test program--guessing $gidsize.)" >&4
19057 echo "Your $zzz is $gidsize bytes long."
19062 echo "(I can't compile the test program--guessing $gidsize.)" >&4
19068 *_t) zzz="$gidtype" ;;
19071 echo "Checking the sign of $zzz..." >&4
19073 #include <sys/types.h>
19084 if eval $compile; then
19088 echo "(I can't execute the test program--guessing unsigned.)" >&4
19092 1) echo "Your $zzz is unsigned." ;;
19093 -1) echo "Your $zzz is signed." ;;
19099 echo "(I can't compile the test program--guessing unsigned.)" >&4
19105 if $test X"$quadtype" != X; then
19107 echo "Checking how to print 64-bit integers..." >&4
19109 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
19110 $cat >try.c <<'EOCP'
19111 #include <sys/types.h>
19114 int q = 12345678901;
19115 printf("%ld\n", q);
19119 if eval $compile; then
19123 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
19124 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
19125 echo "We will use %d."
19131 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
19132 $cat >try.c <<'EOCP'
19133 #include <sys/types.h>
19136 long q = 12345678901;
19137 printf("%ld\n", q);
19141 if eval $compile; then
19145 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
19146 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
19147 echo "We will use %ld."
19153 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
19154 $cat >try.c <<'EOCP'
19155 #include <sys/types.h>
19156 #include <inttypes.h>
19159 int64_t q = 12345678901;
19160 printf("%" PRId64 "\n", q);
19164 if eval $compile; then
19168 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
19169 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
19170 echo "We will use the C9X style."
19176 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
19178 #include <sys/types.h>
19181 $quadtype q = 12345678901;
19182 printf("%Ld\n", q);
19186 if eval $compile; then
19190 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
19191 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
19192 echo "We will use %Ld."
19198 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
19199 $cat >try.c <<'EOCP'
19200 #include <sys/types.h>
19203 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
19204 printf("%lld\n", q);
19208 if eval $compile; then
19212 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
19213 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
19214 echo "We will use the %lld style."
19220 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
19222 #include <sys/types.h>
19225 $quadtype q = 12345678901;
19226 printf("%qd\n", q);
19230 if eval $compile; then
19234 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
19235 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
19236 echo "We will use %qd."
19242 if $test X"$sPRId64" = X; then
19243 echo "Cannot figure out how to print 64-bit integers." >&4
19250 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
19251 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
19253 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
19254 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
19260 $echo "Checking the format strings to be used for Perl's internal types..." >&4
19262 if $test X"$ivsize" = X8; then
19263 ivdformat="$sPRId64"
19264 uvuformat="$sPRIu64"
19265 uvoformat="$sPRIo64"
19266 uvxformat="$sPRIx64"
19267 uvXUformat="$sPRIXU64"
19269 if $test X"$ivsize" = X"$longsize"; then
19276 if $test X"$ivsize" = X"$intsize"; then
19284 if $test X"$ivsize" = X"$shortsize"; then
19295 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
19296 nveformat="$sPRIeldbl"
19297 nvfformat="$sPRIfldbl"
19298 nvgformat="$sPRIgldbl"
19299 nvEUformat="$sPRIEUldbl"
19300 nvFUformat="$sPRIFUldbl"
19301 nvGUformat="$sPRIGUldbl"
19311 case "$ivdformat" in
19312 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
19319 $echo "Checking the format string to be used for gids..." >&4
19322 -1) if $test X"$gidsize" = X"$ivsize"; then
19323 gidformat="$ivdformat"
19325 if $test X"$gidsize" = X"$longsize"; then
19328 if $test X"$gidsize" = X"$intsize"; then
19331 if $test X"$gidsize" = X"$shortsize"; then
19338 *) if $test X"$gidsize" = X"$uvsize"; then
19339 gidformat="$uvuformat"
19341 if $test X"$gidsize" = X"$longsize"; then
19344 if $test X"$gidsize" = X"$intsize"; then
19347 if $test X"$gidsize" = X"$shortsize"; then
19356 : see if getgroups exists
19357 set getgroups d_getgrps
19360 : see if setgroups exists
19361 set setgroups d_setgrps
19365 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
19367 case "$d_getgrps$d_setgrps" in
19369 case "$groupstype" in
19370 '') dflt="$gidtype" ;;
19371 *) dflt="$groupstype" ;;
19374 What type of pointer is the second argument to getgroups() and setgroups()?
19375 Usually this is the same as group ids, $gidtype, but not always.
19378 rp='What type pointer is the second argument to getgroups() and setgroups()?'
19382 *) groupstype="$gidtype";;
19386 if $test $patchlevel -lt 9; then
19387 : MAD is not available in 5.8.x or earlier.
19391 $define|true|[yY]*) dflt='y' ;;
19396 Would you like to build with Misc Attribute Decoration? This is development
19397 work leading to a Perl 5 to Perl 6 convertor, which imposes a space and speed
19398 overhead on the interpreter.
19400 If this doesn't make any sense to you, just accept the default '$dflt'.
19402 rp='Build Perl with MAD?'
19407 madlyh='madly.h madly.act madly.tab'
19409 madlyobj="madly$_o" ;;
19419 echo "Checking if your $make program sets \$(MAKE)..." >&4
19420 case "$make_set_make" in
19422 $sed 's/^X //' > testmake.mak << 'EOF'
19424 X @echo 'maketemp="$(MAKE)"'
19426 case "`$make -f testmake.mak 2>/dev/null`" in
19427 *maketemp=*) make_set_make='#' ;;
19428 *) make_set_make="MAKE=$make" ;;
19430 $rm -f testmake.mak
19433 case "$make_set_make" in
19434 '#') echo "Yup, it does.";;
19435 *) echo "Nope, it doesn't.";;
19438 : see what type is used for mode_t
19439 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
19440 set mode_t modetype int stdio.h sys/types.h
19443 : see if we need va_copy
19445 case "$i_stdarg" in
19448 #include <stdarg.h>
19450 #$i_stdlib I_STDLIB
19452 #include <stdlib.h>
19454 #include <signal.h>
19457 ivfprintf(FILE *f, const char *fmt, va_list *valp)
19459 return vfprintf(f, fmt, *valp);
19463 myvfprintf(FILE *f, const char *fmt, va_list val)
19465 return ivfprintf(f, fmt, &val);
19469 myprintf(char *fmt, ...)
19472 va_start(val, fmt);
19473 return myvfprintf(stdout, fmt, val);
19477 main(int ac, char **av)
19479 signal(SIGSEGV, exit);
19481 myprintf("%s%cs all right, then\n", "that", '\'');
19486 if eval $compile && $run ./try 2>&1 >/dev/null; then
19487 case "`$run ./try`" in
19488 "that's all right, then")
19494 yes) echo "It seems that you don't need va_copy()." >&4
19495 need_va_copy="$undef"
19497 *) echo "It seems that va_copy() or similar will be needed." >&4
19498 need_va_copy="$define"
19503 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
19507 : see what type is used for size_t
19508 rp="What is the type used for the length parameter for string functions?"
19509 set size_t sizetype 'unsigned int' stdio.h sys/types.h
19512 : check for type of arguments to gethostbyaddr.
19513 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
19514 case "$d_gethbyaddr" in
19518 Checking to see what type of arguments are accepted by gethostbyaddr().
19520 hdrs="$define sys/types.h
19521 $d_socket sys/socket.h
19522 $i_niin netinet/in.h
19524 $i_unistd unistd.h"
19525 : The first arg can 'char *' or 'void *'
19526 : The second arg is some of integral type
19527 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
19528 for yyy in size_t long int; do
19529 case "$netdb_host_type" in
19530 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
19531 if ./protochk "$try" $hdrs; then
19532 echo "Your system accepts $xxx for the first arg."
19533 echo "...and $yyy for the second arg."
19534 netdb_host_type="$xxx"
19535 netdb_hlen_type="$yyy"
19541 : In case none of those worked, prompt the user.
19542 case "$netdb_host_type" in
19543 '') rp='What is the type for the 1st argument to gethostbyaddr?'
19546 netdb_host_type=$ans
19547 rp='What is the type for the 2nd argument to gethostbyaddr?'
19550 netdb_hlen_type=$ans
19554 *) : no gethostbyaddr, so pick harmless defaults
19555 netdb_host_type='char *'
19556 netdb_hlen_type="$sizetype"
19559 # Remove the "const" if needed. -- but then we'll have a
19561 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
19564 : check for type of argument to gethostbyname.
19565 if test "X$netdb_name_type" = X ; then
19566 case "$d_gethbyname" in
19570 Checking to see what type of argument is accepted by gethostbyname().
19572 hdrs="$define sys/types.h
19573 $d_socket sys/socket.h
19574 $i_niin netinet/in.h
19576 $i_unistd unistd.h"
19577 for xxx in "const char *" "char *"; do
19578 case "$netdb_name_type" in
19579 '') try="extern struct hostent *gethostbyname($xxx);"
19580 if ./protochk "$try" $hdrs; then
19581 echo "Your system accepts $xxx."
19582 netdb_name_type="$xxx"
19587 : In case none of those worked, prompt the user.
19588 case "$netdb_name_type" in
19589 '') rp='What is the type for the 1st argument to gethostbyname?'
19592 netdb_name_type=$ans
19596 *) : no gethostbyname, so pick harmless default
19597 netdb_name_type='char *'
19602 : check for type of 1st argument to getnetbyaddr.
19603 if test "X$netdb_net_type" = X ; then
19604 case "$d_getnbyaddr" in
19608 Checking to see what type of 1st argument is accepted by getnetbyaddr().
19610 hdrs="$define sys/types.h
19611 $d_socket sys/socket.h
19612 $i_niin netinet/in.h
19614 $i_unistd unistd.h"
19615 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
19616 case "$netdb_net_type" in
19617 '') try="extern struct netent *getnetbyaddr($xxx, int);"
19618 if ./protochk "$try" $hdrs; then
19619 echo "Your system accepts $xxx."
19620 netdb_net_type="$xxx"
19625 : In case none of those worked, prompt the user.
19626 case "$netdb_net_type" in
19627 '') rp='What is the type for the 1st argument to getnetbyaddr?'
19630 netdb_net_type=$ans
19634 *) : no getnetbyaddr, so pick harmless default
19635 netdb_net_type='long'
19639 : locate the preferred pager for this system
19646 [a-zA-Z]:/*) dflt=$pg;;
19650 [a-zA-Z]:/*) dflt=$more;;
19654 [a-zA-Z]:/*) dflt=$less;;
19657 '') dflt=/usr/ucb/more;;
19661 : Instruct ./getfile to trust the hinted or previous pager value,
19662 : even if it does not begin with a slash. For example, on os2,
19663 : pager might be cmd /c more. See comments in UU/getfile.
19668 rp='What pager is used on your system?'
19672 : see what type pids are declared as in the kernel
19673 rp="What is the type of process ids on this system?"
19674 set pid_t pidtype int stdio.h sys/types.h
19677 : see if ar generates random libraries by itself
19679 echo "Checking how to generate random libraries on your machine..." >&4
19680 echo 'int bar1() { return bar2(); }' > bar1.c
19681 echo 'int bar2() { return 2; }' > bar2.c
19683 #$i_stdlib I_STDLIB
19685 #include <stdlib.h>
19687 int main() { printf("%d\n", bar1()); exit(0); }
19689 $cc $ccflags -c bar1.c >/dev/null 2>&1
19690 $cc $ccflags -c bar2.c >/dev/null 2>&1
19691 $cc $ccflags -c foo.c >/dev/null 2>&1
19692 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
19693 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19694 $run ./foobar >/dev/null 2>&1; then
19695 echo "$ar appears to generate random libraries itself."
19697 if [ "X$ranlib" = "X" ]; then
19700 elif $ar s bar$_a >/dev/null 2>&1 &&
19701 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19702 $run ./foobar >/dev/null 2>&1; then
19703 echo "a table of contents needs to be added with '$ar s'."
19706 elif $ar ts bar$_a >/dev/null 2>&1 &&
19707 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19708 $run ./foobar >/dev/null 2>&1; then
19709 echo "a table of contents needs to be added with '$ar ts'."
19716 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
19717 $test -f $ranlib || ranlib=''
19720 if $test -n "$ranlib"; then
19721 echo "your system has '$ranlib'; we'll use that."
19724 echo "your system doesn't seem to support random libraries"
19725 echo "so we'll use lorder and tsort to order the libraries."
19732 : check for type of arguments to select.
19733 case "$selecttype" in
19734 '') case "$d_select" in
19738 Checking to see what type of arguments are accepted by select().
19740 hdrs="$define sys/types.h
19741 $i_systime sys/time.h
19742 $i_sysselct sys/select.h
19743 $d_socket sys/socket.h"
19744 : The first arg can be int, unsigned, or size_t
19745 : The last arg may or may not be 'const'
19747 : void pointer has been seen but using that
19748 : breaks the selectminbits test
19749 for xxx in 'fd_set *' 'int *'; do
19750 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
19751 for tmo in 'struct timeval *' 'const struct timeval *'; do
19753 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
19754 if ./protochk "$try" $hdrs; then
19755 echo "Your system accepts $xxx."
19764 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
19765 case "$d_fd_set" in
19766 $define) dflt="fd_set *" ;;
19775 *) : no select, so pick a harmless default
19782 : check for the select 'width'
19783 case "$selectminbits" in
19784 '') safebits=`expr $ptrsize \* 8`
19785 case "$d_select" in
19789 Checking to see on how many bits at a time your select() operates...
19792 #include <sys/types.h>
19794 #$i_systime I_SYS_TIME
19795 #$i_systimek I_SYS_TIME_KERNEL
19800 # ifdef I_SYS_TIME_KERNEL
19803 # include <sys/time.h>
19804 # ifdef I_SYS_TIME_KERNEL
19808 #$i_sysselct I_SYS_SELECT
19809 #ifdef I_SYS_SELECT
19810 #include <sys/select.h>
19812 #$d_socket HAS_SOCKET
19814 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
19817 #$i_stdlib I_STDLIB
19819 #include <stdlib.h>
19822 #define S sizeof(*(b))
19824 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
19825 #define NBITS (NBYTES * 8)
19827 char *s = (char *)malloc(NBYTES);
19836 fp = fopen("try.c", "r");
19842 b = ($selecttype)s;
19843 for (i = 0; i < NBITS; i++)
19847 select(fd + 1, b, 0, 0, &t);
19848 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
19850 printf("%d\n", i + 1);
19855 if eval $compile_ok; then
19856 selectminbits=`$run ./try`
19857 case "$selectminbits" in
19859 Cannot figure out on how many bits at a time your select() operates.
19860 I'll play safe and guess it is $safebits bits.
19862 selectminbits=$safebits
19863 bits="$safebits bits"
19866 *) bits="$selectminbits bits" ;;
19868 echo "Your select() operates on $bits at a time." >&4
19870 rp='What is the minimum number of bits your select() operates on?'
19871 case "$byteorder" in
19872 12345678) dflt=64 ;;
19878 selectminbits="$val"
19882 *) : no select, so pick a harmless default
19883 selectminbits=$safebits
19889 : Trace out the files included by signal.h, then look for SIGxxx names.
19890 : Remove SIGARRAYSIZE used by HPUX.
19891 : Remove SIGSTKSIZE used by Linux.
19892 : Remove SIGSTKSZ used by Posix.
19893 : Remove SIGTYP void lines used by OS2.
19894 : Some cpps, like os390, dont give the file name anywhere
19895 if [ "X$fieldn" = X ]; then
19896 : Just make some guesses. We check them later.
19897 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
19899 xxx=`echo '#include <signal.h>' |
19900 $cppstdin $cppminus $cppflags 2>/dev/null |
19901 $grep '^[ ]*#.*include' |
19902 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
19904 : Check this list of files to be sure we have parsed the cpp output ok.
19905 : This will also avoid potentially non-existent files, such
19908 for xx in $xxx /dev/null ; do
19909 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
19911 : If we have found no files, at least try signal.h
19912 case "$xxxfiles" in
19913 '') xxxfiles=`./findhdr signal.h` ;;
19916 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
19917 print substr($2, 4, 20)
19919 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
19920 print substr($3, 4, 20)
19922 : Append some common names just in case the awk scan failed.
19923 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
19924 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
19925 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
19926 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
19927 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
19929 : generate a few handy files for later
19930 $cat > signal.c <<EOCP
19931 #include <sys/types.h>
19932 #include <signal.h>
19933 #$i_stdlib I_STDLIB
19935 #include <stdlib.h>
19940 /* Strange style to avoid deeply-nested #if/#else/#endif */
19943 # define NSIG (_NSIG)
19949 # define NSIG (SIGMAX+1)
19955 # define NSIG (SIG_MAX+1)
19961 # define NSIG (_SIG_MAX+1)
19967 # define NSIG (MAXSIG+1)
19973 # define NSIG (MAX_SIG+1)
19978 # ifdef SIGARRAYSIZE
19979 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
19985 # define NSIG (_sys_nsig) /* Solaris 2.5 */
19989 /* Default to some arbitrary number that's big enough to get most
19990 of the common signals.
19996 printf("NSIG %d\n", NSIG);
20002 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
20004 printf "#ifdef SIG"; printf $1; printf "\n"
20005 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
20006 printf $1; printf ");\n"
20010 printf "#endif /* JUST_NSIG */\n";
20011 printf "exit(0);\n}\n";
20014 $cat >signal.awk <<'EOP'
20015 BEGIN { ndups = 0 }
20016 $1 ~ /^NSIG$/ { nsig = $2 }
20017 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
20018 if ($2 > maxsig) { maxsig = $2 }
20019 if (sig_name[$2]) {
20020 dup_name[ndups] = $1
20021 dup_num[ndups] = $2
20033 printf("NSIG %d\n", nsig);
20034 for (n = 1; n < nsig; n++) {
20036 printf("%s %d\n", sig_name[n], sig_num[n])
20039 printf("NUM%d %d\n", n, n)
20042 for (n = 0; n < ndups; n++) {
20043 printf("%s %d\n", dup_name[n], dup_num[n])
20047 $cat >signal_cmd <<EOS
20049 if $test -s signal.lst; then
20050 echo "Using your existing signal.lst file"
20055 $cat >>signal_cmd <<'EOS'
20058 if eval $compile_ok; then
20059 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) | $uniq | $awk -f signal.awk >signal.lst
20061 echo "(I can't seem be able to compile the whole test program)" >&4
20062 echo "(I'll try it in little pieces.)" >&4
20063 set signal -DJUST_NSIG
20064 if eval $compile_ok; then
20065 $run ./signal$_exe > signal.nsg
20068 echo "I can't seem to figure out how many signals you have." >&4
20069 echo "Guessing 50." >&4
20070 echo 'NSIG 50' > signal.nsg
20072 : Now look at all the signal names, one at a time.
20073 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
20074 $cat > signal.c <<EOCP
20075 #include <sys/types.h>
20076 #include <signal.h>
20079 printf("$xx %d\n", SIG${xx});
20084 if eval $compile; then
20085 echo "SIG${xx} found."
20086 $run ./signal$_exe >> signal.ls1
20088 echo "SIG${xx} NOT found."
20091 if $test -s signal.ls1; then
20092 $cat signal.nsg signal.ls1 |
20093 $sort -n | $uniq | $awk -f signal.awk >signal.lst
20097 if $test -s signal.lst; then
20100 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
20101 echo 'kill -l' >signal
20102 set X `csh -f <signal`
20106 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
20108 echo $@ | $tr ' ' $trnl | \
20109 $awk '{ printf "%s %d\n", $1, ++s; }
20110 END { printf "NSIG %d\n", ++s }' >signal.lst
20112 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
20114 chmod a+x signal_cmd
20115 $eunicefix signal_cmd
20117 : generate list of signal names
20119 case "$sig_name_init" in
20121 *) case "$sig_num_init" in
20122 ''|*,*) doinit=yes ;;
20127 echo "Generating a list of signal names and numbers..." >&4
20129 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
20130 sig_name=`$awk 'BEGIN { printf "ZERO " }
20131 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
20132 sig_num=`$awk 'BEGIN { printf "0 " }
20133 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
20134 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
20135 !/^NSIG/ { printf "\"%s\", ", $1 }
20136 END { printf "0\n" }' signal.lst`
20137 sig_num_init=`$awk 'BEGIN { printf "0, " }
20138 !/^NSIG/ { printf "%d, ", $2}
20139 END { printf "0\n"}' signal.lst`
20142 echo "The following $sig_count signals are available:"
20144 echo $sig_name | $awk \
20145 'BEGIN { linelen = 0 }
20147 for (i = 1; i <= NF; i++) {
20148 name = "SIG" $i " "
20149 linelen = linelen + length(name)
20150 if (linelen > 70) {
20152 linelen = length(name)
20158 sig_size=`echo $sig_name | awk '{print NF}'`
20159 $rm -f signal signal.c signal.awk signal.lst signal_cmd
20162 case "$sizetype" in
20163 *_t) zzz="$sizetype" ;;
20164 *) zzz="filesize" ;;
20166 echo "Checking the size of $zzz..." >&4
20168 #include <sys/types.h>
20170 #$i_stdlib I_STDLIB
20172 #include <stdlib.h>
20175 printf("%d\n", (int)sizeof($sizetype));
20180 if eval $compile_ok; then
20184 echo "(I can't execute the test program--guessing $sizesize.)" >&4
20187 echo "Your $zzz size is $sizesize bytes."
20192 echo "(I can't compile the test program--guessing $sizesize.)" >&4
20196 : check for socklen_t
20198 echo "Checking to see if you have socklen_t..." >&4
20200 #include <sys/types.h>
20201 #$d_socket HAS_SOCKET
20203 #include <sys/socket.h>
20205 int main() { socklen_t x = 16; }
20208 if eval $compile; then
20210 echo "You have socklen_t."
20213 echo "You do not have socklen_t."
20214 case "$sizetype" in
20215 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
20222 : see if this is a socks.h system
20223 set socks.h i_socks
20226 : check for type of the size argument to socket calls
20227 case "$d_socket" in
20231 Checking to see what type is the last argument of accept().
20234 case "$d_socklen_t" in
20235 "$define") yyy="$yyy socklen_t"
20237 yyy="$yyy $sizetype int long unsigned"
20238 for xxx in $yyy; do
20239 case "$socksizetype" in
20240 '') try="extern int accept(int, struct sockaddr *, $xxx *);"
20241 case "$usesocks" in
20243 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
20244 echo "Your system accepts '$xxx *' for the last argument of accept()."
20245 socksizetype="$xxx"
20248 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
20249 echo "Your system accepts '$xxx *' for the last argument of accept()."
20250 socksizetype="$xxx"
20257 : In case none of those worked, prompt the user.
20258 case "$socksizetype" in
20259 '') rp='What is the type for socket address structure sizes?'
20266 *) : no sockets, so pick relatively harmless default
20271 : see what type is used for signed size_t
20272 set ssize_t ssizetype int stdio.h sys/types.h
20277 #$i_stdlib I_STDLIB
20279 #include <stdlib.h>
20281 #include <sys/types.h>
20282 #define Size_t $sizetype
20283 #define SSize_t $dflt
20286 if (sizeof(Size_t) == sizeof(SSize_t))
20288 else if (sizeof(Size_t) == sizeof(int))
20297 if eval $compile_ok && $run ./try > /dev/null; then
20298 ssizetype=`$run ./try`
20299 echo "I'll be using $ssizetype for functions returning a byte count." >&4
20302 Help! I can't compile and run the ssize_t test program: please enlighten me!
20303 (This is probably a misconfiguration in your system or libraries, and
20304 you really ought to fix it. Still, I'll try anyway.)
20306 I need a type that is the same size as $sizetype, but is guaranteed to
20307 be signed. Common values are ssize_t, int and long.
20310 rp="What signed type is the same size as $sizetype?"
20316 : see what type of char stdio uses.
20318 echo '#include <stdio.h>' > stdio.c
20319 $cppstdin $cppminus < stdio.c > stdioh
20320 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
20321 echo "Your stdio uses unsigned chars." >&4
20322 stdchar="unsigned char"
20324 echo "Your stdio uses signed chars." >&4
20327 $rm -f stdio.* stdioh
20329 : see what type uids are declared as in the kernel
20331 echo "Looking for the type for user ids returned by getuid()."
20332 set uid_t uidtype xxx stdio.h sys/types.h
20336 xxx=`./findhdr sys/user.h`
20337 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
20339 unsigned) dflt="$1 $2" ;;
20343 *) dflt="$uidtype";;
20346 uid_t) echo "uid_t found." ;;
20347 *) rp="What is the type for user ids returned by getuid()?"
20355 *_t) zzz="$uidtype" ;;
20358 echo "Checking the size of $zzz..." >&4
20360 #include <sys/types.h>
20362 #$i_stdlib I_STDLIB
20364 #include <stdlib.h>
20367 printf("%d\n", (int)sizeof($uidtype));
20372 if eval $compile_ok; then
20376 echo "(I can't execute the test program--guessing $uidsize.)" >&4
20379 echo "Your $zzz is $uidsize bytes long."
20384 echo "(I can't compile the test program--guessing $uidsize.)" >&4
20389 *_t) zzz="$uidtype" ;;
20392 echo "Checking the sign of $zzz..." >&4
20394 #include <sys/types.h>
20405 if eval $compile; then
20409 echo "(I can't execute the test program--guessing unsigned.)" >&4
20413 1) echo "Your $zzz is unsigned." ;;
20414 -1) echo "Your $zzz is signed." ;;
20420 echo "(I can't compile the test program--guessing unsigned.)" >&4
20426 $echo "Checking the format string to be used for uids..." >&4
20429 -1) if $test X"$uidsize" = X"$ivsize"; then
20430 uidformat="$ivdformat"
20432 if $test X"$uidsize" = X"$longsize"; then
20435 if $test X"$uidsize" = X"$intsize"; then
20438 if $test X"$uidsize" = X"$shortsize"; then
20445 *) if $test X"$uidsize" = X"$uvsize"; then
20446 uidformat="$uvuformat"
20448 if $test X"$uidsize" = X"$longsize"; then
20451 if $test X"$uidsize" = X"$intsize"; then
20454 if $test X"$uidsize" = X"$shortsize"; then
20464 case "$usesitecustomize" in
20465 $define|true|[Yy]*)
20466 usesitecustomize="$define"
20469 usesitecustomize="$undef"
20473 : determine compiler compiler
20482 if $test -f "$byacc$_exe"; then
20484 comp="byacc or $comp"
20486 if $test -f "$bison$_exe"; then
20487 comp="$comp or bison -y"
20489 rp="Which compiler compiler ($comp) shall I use?"
20498 echo "(Adding -y option to bison to get yacc-compatible behaviour.)"
20504 : see if this is a fp.h system
20508 : see if this is a fp_class.h system
20509 set fp_class.h i_fp_class
20512 : see if gdbm.h is available
20517 : see if gdbm_open exists
20518 set gdbm_open d_gdbm_open
20520 case "$d_gdbm_open" in
20523 echo "We won't be including <gdbm.h>"
20532 : see if this is a ieeefp.h system
20533 case "$i_ieeefp" in
20534 '' ) set ieeefp.h i_ieeefp
20539 : see if this is a libutil.h system
20540 set libutil.h i_libutil
20543 : see if mach cthreads are available
20544 if test "X$usethreads" = "X$define"; then
20545 set mach/cthreads.h i_machcthr
20548 i_machcthr="$undef"
20553 : see if this is a mntent.h system
20554 set mntent.h i_mntent
20557 : see if ndbm.h is available
20563 # Some Linux distributions such as RedHat 7.1 put the
20564 # ndbm.h header in /usr/include/gdbm/ndbm.h.
20565 if $test -f /usr/include/gdbm/ndbm.h; then
20566 echo '<gdbm/ndbm.h> found.'
20567 ccflags="$ccflags -I/usr/include/gdbm"
20568 cppflags="$cppflags -I/usr/include/gdbm"
20576 : see if dbm_open exists
20577 set dbm_open d_dbm_open
20579 case "$d_dbm_open" in
20582 echo "We won't be including <ndbm.h>"
20591 : see if net/errno.h is available
20593 set net/errno.h val
20596 : Unfortunately, it causes problems on some systems. Arrgh.
20599 cat > try.c <<'EOM'
20602 #include <net/errno.h>
20608 if $cc $ccflags -c try.c >/dev/null 2>&1; then
20609 echo "We'll be including <net/errno.h>." >&4
20611 echo "We won't be including <net/errno.h>." >&4
20620 : see if netinet/tcp.h is available
20621 set netinet/tcp.h i_netinettcp
20624 : see if this is a poll.h system
20628 : see if this is a prot.h system
20633 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
20634 $cat <<'EOSH' > Cppsym.know
20635 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
20636 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
20637 alliant alpha am29000 AM29000 AMD64 amd64 amiga AMIGAOS AMIX
20638 ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
20639 BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
20640 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
20641 bull c cadmus clipper CMU COFF COMPILER_VERSION
20642 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
20643 CYGWIN DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
20644 Dynix DynixPTX ELF encore EPI EXTENSIONS FAVOR_BSD
20645 FILE_OFFSET_BITS FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
20647 GNU_SOURCE GNUC GNUC_MINOR GNU_LIBRARY GO32 gould GOULD_PN
20648 H3050R H3050RX hbullx20 hcx host_mips
20649 hp200 hp300 hp700 HP700 hp800 hp9000
20650 hp9000s200 hp9000s300 hp9000s400 hp9000s500
20651 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
20652 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
20653 IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
20654 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
20655 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
20656 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
20657 LIBCATAMOUNT Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
20658 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
20659 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
20660 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
20661 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
20662 MATH_HAS_NO_SIDE_EFFECTS
20663 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
20664 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
20665 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
20666 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
20667 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
20668 NetBSD news1500 news1700 news1800 news1900 news3700
20669 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
20670 ns32016 ns32332 ns32k nsc32000
20671 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
20672 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
20673 pc532 pdp11 PGC PIC plexus PORTAR posix
20674 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
20675 POSIX_C_SOURCE POSIX_SOURCE POWER
20676 PROTOTYPES PWB pyr QNX QK_USER R3000 REENTRANT RES Rhapsody RISC6000
20677 riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
20678 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
20679 sony sony_news sonyrisc sparc sparclite spectrum
20680 stardent stdc STDC_EXT stratos sun sun3 sun386
20681 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
20682 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
20683 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
20684 sysV68 sysV88 Tek4132 Tek4300 titan
20685 TM3200 TM5400 TM5600
20686 tower tower32 tower32_200 tower32_600 tower32_700
20687 tower32_800 tower32_850 tss
20688 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
20689 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
20690 unix UNIX95 UNIX99 unixpc unos
20691 USE_BSD USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE USE_LARGEFILE64
20692 USE_MISC USE_POSIX USE_POSIX199309 USE_POSIX199506 USE_POSIX2
20693 USE_REENTRANT USE_SVID USE_UNIX98 USE_XOPEN USE_XOPEN_EXTENDED
20695 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms x86_64 xenix Xenix286
20696 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
20697 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
20700 # Maybe put other stuff here too.
20701 cat <<EOSH >>Cppsym.know
20704 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
20705 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
20706 $cat Cppsym.know > Cppsym.c
20707 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
20708 $rm -f Cppsym.a Cppsym.b Cppsym.c
20709 cat <<EOSH > Cppsym
20711 if $test \$# -gt 0; then
20712 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
20713 if $test -s Cppsym.got; then
20720 $tr " " "$trnl" | ./Cppsym.try
20726 cat <<EOSH > Cppsym.try
20728 cat <<'EOCP' > try.c
20731 #define STRINGIFY(a) "a"
20733 #if cpp_stuff == 42
20734 #define StGiFy(a) #a
20735 #define STRINGIFY(a) StGiFy(a)
20737 #if $cpp_stuff != 1 && $cpp_stuff != 42
20738 # include "Bletch: How does this C preprocessor stringify macros?"
20744 cat <<'EOSH' >> Cppsym.try
20746 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
20747 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
20748 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
20749 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
20751 echo 'return 0;}' >> try.c
20753 cat <<EOSH >> Cppsym.try
20755 case "$osname-$gccversion" in
20756 irix-) ccflags="\$ccflags -woff 1178" ;;
20757 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
20759 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs && $run ./try | $sed 's/ /\\\\ /g'
20761 chmod +x Cppsym.try
20762 $eunicefix Cppsym.try
20763 ./Cppsym < Cppsym.know > Cppsym.true
20764 : Add in any linux cpp "predefined macros":
20765 case "$osname::$gccversion" in
20768 rm -f $tHdrH'.h' $tHdrH
20770 if cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
20771 sed 's/#define[\ \ ]*//;s/[\ \ ].*$//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
20772 if [ -s $tHdrH'_cppsym.real' ]; then
20773 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
20776 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
20779 : now check the C compiler for additional symbols
20780 postprocess_cc_v=''
20782 aix) postprocess_cc_v="|$tr , ' '" ;;
20789 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
20792 -D*) echo "\$i" | $sed 's/^-D//';;
20793 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
20798 postprocess_cc_v=''
20801 ./ccsym > ccsym1.raw
20802 if $test -s ccsym1.raw; then
20803 $sort ccsym1.raw | $uniq >ccsym.raw
20805 mv ccsym1.raw ccsym.raw
20808 $awk '/\=/ { print $0; next }
20809 { print $0"=1" }' ccsym.raw >ccsym.list
20810 $comm -13 Cppsym.true ccsym.list >ccsym.own
20811 $comm -12 Cppsym.true ccsym.list >ccsym.com
20812 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
20814 if $test -z ccsym.raw; then
20815 echo "Your C compiler doesn't seem to define any symbols!" >&4
20817 echo "However, your C preprocessor defines the following symbols:"
20820 cppsymbols=`$cat Cppsym.true`
20821 cppsymbols=`echo $cppsymbols`
20822 cppccsymbols="$cppsymbols"
20824 if $test -s ccsym.com; then
20825 echo "Your C compiler and pre-processor define these symbols:"
20826 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
20829 cppccsymbols=`$cat ccsym.com`
20830 cppccsymbols=`echo $cppccsymbols`
20831 $test "$silent" || sleep 1
20833 if $test -s ccsym.cpp; then
20834 $test "$also" && echo " "
20835 echo "Your C pre-processor ${also}defines the following symbols:"
20836 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
20838 cppsymbols=`$cat ccsym.cpp`
20839 cppsymbols=`echo $cppsymbols`
20840 $test "$silent" || sleep 1
20842 if $test -s ccsym.own; then
20843 $test "$also" && echo " "
20844 echo "Your C compiler ${also}defines the following cpp symbols:"
20845 $sed -e 's/\(..*\)=1/\1/' ccsym.own
20846 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
20847 ccsymbols=`$cat ccsym.own`
20848 ccsymbols=`echo $ccsymbols`
20849 $test "$silent" || sleep 1
20853 : see if this is a termio system
20857 if $test `./findhdr termios.h`; then
20858 set tcsetattr i_termios
20864 "$define") echo "You have POSIX termios.h... good!" >&4;;
20865 *) if ./Cppsym pyr; then
20866 case "`/bin/universe`" in
20867 ucb) if $test `./findhdr sgtty.h`; then
20869 echo "<sgtty.h> found." >&4
20871 echo "System is pyramid with BSD universe."
20872 echo "<sgtty.h> not found--you could have problems." >&4
20874 *) if $test `./findhdr termio.h`; then
20876 echo "<termio.h> found." >&4
20878 echo "System is pyramid with USG universe."
20879 echo "<termio.h> not found--you could have problems." >&4
20883 if $test `./findhdr termio.h`; then
20884 echo "<termio.h> found." >&4
20886 elif $test `./findhdr sgtty.h`; then
20887 echo "<sgtty.h> found." >&4
20890 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
20893 if $test `./findhdr sgtty.h`; then
20894 echo "<sgtty.h> found." >&4
20896 elif $test `./findhdr termio.h`; then
20897 echo "<termio.h> found." >&4
20900 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
20904 set i_termio; eval $setvar
20905 val=$val2; set i_sgtty; eval $setvar
20906 val=$val3; set i_termios; eval $setvar
20908 : see if stddef is available
20909 set stddef.h i_stddef
20912 : see if sys/access.h is available
20913 set sys/access.h i_sysaccess
20916 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
20917 set sys/filio.h i_sysfilio
20920 if $test `./findhdr sys/ioctl.h`; then
20922 echo '<sys/ioctl.h> found.' >&4
20925 if $test $i_sysfilio = "$define"; then
20926 echo '<sys/ioctl.h> NOT found.' >&4
20928 $test $i_sgtty = "$define" && xxx="sgtty.h"
20929 $test $i_termio = "$define" && xxx="termio.h"
20930 $test $i_termios = "$define" && xxx="termios.h"
20931 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
20937 : see if socket ioctl defs are in sys/sockio.h
20939 xxx=`./findhdr sys/sockio.h`
20940 if $test "$xxx"; then
20941 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
20943 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
20946 echo "No socket ioctls found in <sys/sockio.h>." >&4
20951 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
20958 : see if this is a syslog.h system
20959 set syslog.h i_syslog
20963 : see if this is a sys/mode.h system
20964 set sys/mode.h i_sysmode
20967 : see if sys/resource.h has to be included
20968 set sys/resource.h i_sysresrc
20971 : see if sys/security.h is available
20972 set sys/security.h i_syssecrt
20975 : see if this is a sys/statvfs.h system
20976 set sys/statvfs.h i_sysstatvfs
20979 : see if this is a sys/un.h system
20980 set sys/un.h i_sysun
20984 : see if this is a sys/utsname.h system
20985 set sys/utsname.h i_sysutsname
20988 : see if this is a syswait system
20989 set sys/wait.h i_syswait
20992 : see if this is a ustat.h system
20993 set ustat.h i_ustat
20996 : see if this is an utime system
20997 set utime.h i_utime
21000 : see if this is a values.h system
21001 set values.h i_values
21004 : see if this is a vfork system
21007 set vfork.h i_vfork
21016 echo "Looking for extensions..." >&4
21017 : If we are using the old config.sh, known_extensions may contain
21018 : old or inaccurate or duplicate values.
21019 known_extensions=''
21020 nonxs_extensions=''
21021 : We do not use find because it might not be available.
21022 : We do not just use MANIFEST because the user may have dropped
21023 : some additional extensions into the source tree and expect them
21026 : Function to recursively find available extensions, ignoring DynaLoader
21027 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
21031 DynaLoader|dynaload) ;;
21033 if $test -f $xxx/$xxx.xs -o -f $xxx/$xxx.c; then
21034 known_extensions="$known_extensions $1$xxx";
21035 elif $test -f $xxx/Makefile.PL; then
21036 nonxs_extensions="$nonxs_extensions $1$xxx";
21038 if $test -d $xxx -a $# -lt 10; then
21041 eval $find_extensions;
21053 eval $find_extensions
21054 # Special case: Add in modules that nest beyond the first level.
21055 # Currently threads/shared and Hash/Util/FieldHash, since they are
21056 # not picked up by the recursive find above (and adding in general
21057 # recursive finding breaks SDBM_File/sdbm).
21058 # A.D. 20011025 (SDBM), ajgough 20071008 (FieldHash)
21059 known_extensions="$known_extensions threads/shared Hash/Util/FieldHash"
21060 set X $known_extensions
21062 known_extensions="$*"
21063 set X $nonxs_extensions
21065 nonxs_extensions="$*"
21068 : Now see which are supported on this system.
21070 for xxx in $known_extensions ; do
21074 $define) avail_ext="$avail_ext $xxx" ;;
21077 GDBM_File|gdbm_fil)
21079 $define) avail_ext="$avail_ext $xxx" ;;
21082 I18N/Langinfo|i18n_lan)
21083 case "$i_langinfo$d_nl_langinfo" in
21084 $define$define) avail_ext="$avail_ext $xxx" ;;
21088 : XXX Do we need a useipcsysv variable here
21089 case "${d_msg}${d_sem}${d_shm}" in
21090 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
21093 NDBM_File|ndbm_fil)
21096 case "$osname-$use64bitint" in
21099 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
21102 *) avail_ext="$avail_ext $xxx" ;;
21107 ODBM_File|odbm_fil)
21108 case "${i_dbm}${i_rpcsvcdbm}" in
21110 case "$d_cplusplus" in
21111 define) ;; # delete as a function name will not work
21112 *) case "$osname-$use64bitint" in
21115 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
21118 *) avail_ext="$avail_ext $xxx" ;;
21126 case "$useopcode" in
21127 true|define|y) avail_ext="$avail_ext $xxx" ;;
21131 case "$useposix" in
21132 true|define|y) avail_ext="$avail_ext $xxx" ;;
21136 case "$d_socket" in
21139 beos) ;; # not unless BONE
21140 *) avail_ext="$avail_ext $xxx" ;;
21145 Sys/Syslog|sys/syslog)
21146 : XXX syslog requires socket
21147 case "$d_socket" in
21148 true|$define|y) avail_ext="$avail_ext $xxx" ;;
21152 case "$usethreads" in
21154 case "$use5005threads" in
21155 $define|true|[yY]*) avail_ext="$avail_ext $xxx" ;;
21159 threads|threads/shared)
21160 # threads and threads::shared are special cases.
21161 # To stop people from asking "Perl 5.8.0 was supposed
21162 # to have this new fancy threads implementation but my
21163 # perl doesn't have it" and from people trying to
21164 # (re)install the threads module using CPAN.pm and
21165 # CPAN.pm then offering to reinstall Perl 5.8.0,
21166 # the threads.pm and threads/shared.pm will always be
21167 # there, croaking informatively ("you need to rebuild
21168 # all of Perl with threads, sorry") when threads haven't
21169 # been compiled in.
21171 avail_ext="$avail_ext $xxx"
21175 cygwin) avail_ext="$avail_ext $xxx" ;;
21178 XS/APItest|xs/apitest)
21179 # This is just for testing. Skip it unless we have dynamic loading.
21182 $define) avail_ext="$avail_ext $xxx" ;;
21185 XS/Typemap|xs/typemap)
21186 # This is just for testing. Skip it unless we have dynamic loading.
21188 $define) avail_ext="$avail_ext $xxx" ;;
21191 *) avail_ext="$avail_ext $xxx"
21200 case "$onlyextensions" in
21202 *) keepextensions=''
21203 echo "You have requested that only certains extensions be included..." >&4
21204 for i in $onlyextensions; do
21205 case " $avail_ext " in
21207 echo "Keeping extension $i."
21208 keepextensions="$keepextensions $i"
21210 *) echo "Ignoring extension $i." ;;
21213 avail_ext="$keepextensions"
21217 case "$noextensions" in
21219 *) keepextensions=''
21220 echo "You have requested that certain extensions be ignored..." >&4
21221 for i in $avail_ext; do
21222 case " $noextensions " in
21223 *" $i "*) echo "Ignoring extension $i." ;;
21224 *) echo "Keeping extension $i.";
21225 keepextensions="$keepextensions $i"
21229 avail_ext="$keepextensions"
21233 : Now see which nonxs extensions are supported on this system.
21234 : For now assume all are.
21236 for xxx in $nonxs_extensions ; do
21238 *) nonxs_ext="$nonxs_ext $xxx"
21250 A number of extensions are supplied with $package. You may choose to
21251 compile these extensions for dynamic loading (the default), compile
21252 them into the $package executable (static loading), or not include
21253 them at all. Answer "none" to include no extensions.
21254 Note that DynaLoader is always built and need not be mentioned here.
21257 case "$dynamic_ext" in
21259 : Exclude those listed in static_ext
21261 for xxx in $avail_ext; do
21262 case " $static_ext " in
21264 *) dflt="$dflt $xxx" ;;
21271 *) dflt="$dynamic_ext"
21272 # Perhaps we are reusing an old out-of-date config.sh.
21275 if test X"$dynamic_ext" != X"$avail_ext"; then
21277 NOTICE: Your previous config.sh list may be incorrect.
21278 The extensions now available to you are
21280 but the default list from your previous config.sh is
21292 rp="What extensions do you wish to load dynamically?"
21295 none) dynamic_ext=' ' ;;
21296 *) dynamic_ext="$ans" ;;
21299 case "$static_ext" in
21301 : Exclude those already listed in dynamic linking
21303 for xxx in $avail_ext; do
21304 case " $dynamic_ext " in
21306 *) dflt="$dflt $xxx" ;;
21313 *) dflt="$static_ext"
21320 rp="What extensions do you wish to load statically?"
21323 none) static_ext=' ' ;;
21324 *) static_ext="$ans" ;;
21329 A number of extensions are supplied with $package. Answer "none"
21330 to include no extensions.
21331 Note that DynaLoader is always built and need not be mentioned here.
21334 case "$static_ext" in
21335 '') dflt="$avail_ext" ;;
21336 *) dflt="$static_ext"
21337 # Perhaps we are reusing an old out-of-date config.sh.
21340 if test X"$static_ext" != X"$avail_ext"; then
21342 NOTICE: Your previous config.sh list may be incorrect.
21343 The extensions now available to you are
21345 but the default list from your previous config.sh is
21354 : Exclude those that are not xs extensions
21358 rp="What extensions do you wish to include?"
21361 none) static_ext=' ' ;;
21362 *) static_ext="$ans" ;;
21367 # Encode is a special case. If we are building Encode as a static
21368 # extension, we need to explicitly list its subextensions as well.
21369 # For other nested extensions, this is handled automatically by
21370 # the appropriate Makefile.PL.
21371 case " $static_ext " in
21372 *" Encode "*) # Add the subextensions of Encode
21374 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
21375 static_ext="$static_ext Encode/$xxx"
21381 set X $dynamic_ext $static_ext $nonxs_ext
21385 # Sanity check: We require an extension suitable for use with
21386 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
21387 # should show up as failures in the test suite, but it's helpful to
21388 # catch them now.) The 'extensions' list is normally sorted
21389 # alphabetically, so we need to accept either
21390 # DB_File ... Fcntl ... IO ....
21391 # or something like
21392 # Fcntl ... NDBM_File ... IO ....
21393 case " $extensions" in
21394 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
21395 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
21396 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
21397 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
21398 echo "WARNING: The Perl you are building will be quite crippled." >& 4
21402 : Remove libraries needed only for extensions
21403 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
21404 : The exception is SunOS 4.x, which needs them.
21405 case "${osname}X${osvers}" in
21409 *) case "$usedl" in
21410 $define|true|[yY]*)
21411 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
21415 *) perllibs="$libs"
21421 : Remove build directory name from cppstdin so it can be used from
21422 : either the present location or the final installed location.
21424 : Get out of the UU directory to get correct path name.
21426 case "$cppstdin" in
21428 echo "Stripping down cppstdin path name"
21434 : end of configuration questions
21436 echo "End of configuration questions."
21439 : back to where it started
21440 if test -d ../UU; then
21444 : configuration may be patched via a 'config.arch' file
21445 if $test -f config.arch; then
21446 echo "I see a config.arch file, loading it."
21450 : configuration may be patched via a 'config.over' file
21451 if $test -f config.over; then
21454 rp='I see a config.over file. Do you wish to load it?'
21457 n*) echo "OK, I'll ignore it.";;
21459 echo "Configuration override changes have been loaded."
21464 : in case they want portability, strip down executable paths
21465 case "$d_portable" in
21468 echo "Stripping down executable paths..." >&4
21469 for file in $loclist $trylist; do
21471 eval $file=`basename $temp`
21476 : create config.sh file
21478 echo "Creating config.sh..." >&4
21479 $spitshell <<EOT >config.sh
21482 # This file was produced by running the Configure script. It holds all the
21483 # definitions figured out by Configure. Should you modify one of these values,
21484 # do not forget to propagate your changes by running "Configure -der". You may
21485 # instead choose to run each of the .SH files by yourself, or "Configure -S".
21488 # Package name : $package
21489 # Source directory : $src
21490 # Configuration time: $cf_time
21491 # Configured by : $cf_by
21492 # Target system : $myuname
21502 Revision='$Revision'
21510 alignbytes='$alignbytes'
21511 ansi2knr='$ansi2knr'
21512 aphostname='$aphostname'
21513 api_revision='$api_revision'
21514 api_subversion='$api_subversion'
21515 api_version='$api_version'
21516 api_versionstring='$api_versionstring'
21519 archlibexp='$archlibexp'
21520 archname64='$archname64'
21521 archname='$archname'
21522 archobjs='$archobjs'
21523 asctime_r_proto='$asctime_r_proto'
21531 byteorder='$byteorder'
21533 castflags='$castflags'
21536 cccdlflags='$cccdlflags'
21537 ccdlflags='$ccdlflags'
21539 ccflags_uselargefiles='$ccflags_uselargefiles'
21541 ccsymbols='$ccsymbols'
21542 ccversion='$ccversion'
21544 cf_email='$cf_email'
21549 clocktype='$clocktype'
21551 compress='$compress'
21552 contains='$contains'
21556 cpp_stuff='$cpp_stuff'
21557 cppccsymbols='$cppccsymbols'
21558 cppflags='$cppflags'
21560 cppminus='$cppminus'
21562 cppstdin='$cppstdin'
21563 cppsymbols='$cppsymbols'
21564 crypt_r_proto='$crypt_r_proto'
21565 cryptlib='$cryptlib'
21567 ctermid_r_proto='$ctermid_r_proto'
21568 ctime_r_proto='$ctime_r_proto'
21569 d_Gconvert='$d_Gconvert'
21570 d_PRIEUldbl='$d_PRIEUldbl'
21571 d_PRIFUldbl='$d_PRIFUldbl'
21572 d_PRIGUldbl='$d_PRIGUldbl'
21573 d_PRIXU64='$d_PRIXU64'
21574 d_PRId64='$d_PRId64'
21575 d_PRIeldbl='$d_PRIeldbl'
21576 d_PRIfldbl='$d_PRIfldbl'
21577 d_PRIgldbl='$d_PRIgldbl'
21578 d_PRIi64='$d_PRIi64'
21579 d_PRIo64='$d_PRIo64'
21580 d_PRIu64='$d_PRIu64'
21581 d_PRIx64='$d_PRIx64'
21582 d_SCNfldbl='$d_SCNfldbl'
21583 d__fwalk='$d__fwalk'
21584 d_access='$d_access'
21585 d_accessx='$d_accessx'
21588 d_archlib='$d_archlib'
21589 d_asctime_r='$d_asctime_r'
21592 d_attribute_format='$d_attribute_format'
21593 d_attribute_malloc='$d_attribute_malloc'
21594 d_attribute_nonnull='$d_attribute_nonnull'
21595 d_attribute_noreturn='$d_attribute_noreturn'
21596 d_attribute_pure='$d_attribute_pure'
21597 d_attribute_unused='$d_attribute_unused'
21598 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
21602 d_bsdgetpgrp='$d_bsdgetpgrp'
21603 d_bsdsetpgrp='$d_bsdsetpgrp'
21604 d_builtin_choose_expr='$d_builtin_choose_expr'
21605 d_builtin_expect='$d_builtin_expect'
21607 d_c99_variadic_macros='$d_c99_variadic_macros'
21608 d_casti32='$d_casti32'
21609 d_castneg='$d_castneg'
21610 d_charvspr='$d_charvspr'
21612 d_chroot='$d_chroot'
21613 d_chsize='$d_chsize'
21615 d_clearenv='$d_clearenv'
21616 d_closedir='$d_closedir'
21617 d_cmsghdr_s='$d_cmsghdr_s'
21619 d_copysignl='$d_copysignl'
21620 d_cplusplus='$d_cplusplus'
21622 d_crypt_r='$d_crypt_r'
21624 d_ctermid='$d_ctermid'
21625 d_ctermid_r='$d_ctermid_r'
21626 d_ctime_r='$d_ctime_r'
21627 d_cuserid='$d_cuserid'
21628 d_dbl_dig='$d_dbl_dig'
21629 d_dbminitproto='$d_dbminitproto'
21630 d_difftime='$d_difftime'
21631 d_dir_dd_fd='$d_dir_dd_fd'
21633 d_dirnamlen='$d_dirnamlen'
21634 d_dlerror='$d_dlerror'
21635 d_dlopen='$d_dlopen'
21636 d_dlsymun='$d_dlsymun'
21637 d_dosuid='$d_dosuid'
21638 d_drand48_r='$d_drand48_r'
21639 d_drand48proto='$d_drand48proto'
21641 d_eaccess='$d_eaccess'
21642 d_endgrent='$d_endgrent'
21643 d_endgrent_r='$d_endgrent_r'
21644 d_endhent='$d_endhent'
21645 d_endhostent_r='$d_endhostent_r'
21646 d_endnent='$d_endnent'
21647 d_endnetent_r='$d_endnetent_r'
21648 d_endpent='$d_endpent'
21649 d_endprotoent_r='$d_endprotoent_r'
21650 d_endpwent='$d_endpwent'
21651 d_endpwent_r='$d_endpwent_r'
21652 d_endsent='$d_endsent'
21653 d_endservent_r='$d_endservent_r'
21654 d_eofnblk='$d_eofnblk'
21655 d_eunice='$d_eunice'
21656 d_faststdio='$d_faststdio'
21657 d_fchdir='$d_fchdir'
21658 d_fchmod='$d_fchmod'
21659 d_fchown='$d_fchown'
21661 d_fcntl_can_lock='$d_fcntl_can_lock'
21662 d_fd_macros='$d_fd_macros'
21663 d_fd_set='$d_fd_set'
21664 d_fds_bits='$d_fds_bits'
21665 d_fgetpos='$d_fgetpos'
21666 d_finite='$d_finite'
21667 d_finitel='$d_finitel'
21668 d_flexfnam='$d_flexfnam'
21670 d_flockproto='$d_flockproto'
21672 d_fp_class='$d_fp_class'
21673 d_fpathconf='$d_fpathconf'
21674 d_fpclass='$d_fpclass'
21675 d_fpclassify='$d_fpclassify'
21676 d_fpclassl='$d_fpclassl'
21677 d_fpos64_t='$d_fpos64_t'
21678 d_frexpl='$d_frexpl'
21679 d_fs_data_s='$d_fs_data_s'
21680 d_fseeko='$d_fseeko'
21681 d_fsetpos='$d_fsetpos'
21682 d_fstatfs='$d_fstatfs'
21683 d_fstatvfs='$d_fstatvfs'
21685 d_ftello='$d_ftello'
21687 d_futimes='$d_futimes'
21688 d_getcwd='$d_getcwd'
21689 d_getespwnam='$d_getespwnam'
21690 d_getfsstat='$d_getfsstat'
21691 d_getgrent='$d_getgrent'
21692 d_getgrent_r='$d_getgrent_r'
21693 d_getgrgid_r='$d_getgrgid_r'
21694 d_getgrnam_r='$d_getgrnam_r'
21695 d_getgrps='$d_getgrps'
21696 d_gethbyaddr='$d_gethbyaddr'
21697 d_gethbyname='$d_gethbyname'
21698 d_gethent='$d_gethent'
21699 d_gethname='$d_gethname'
21700 d_gethostbyaddr_r='$d_gethostbyaddr_r'
21701 d_gethostbyname_r='$d_gethostbyname_r'
21702 d_gethostent_r='$d_gethostent_r'
21703 d_gethostprotos='$d_gethostprotos'
21704 d_getitimer='$d_getitimer'
21705 d_getlogin='$d_getlogin'
21706 d_getlogin_r='$d_getlogin_r'
21707 d_getmnt='$d_getmnt'
21708 d_getmntent='$d_getmntent'
21709 d_getnbyaddr='$d_getnbyaddr'
21710 d_getnbyname='$d_getnbyname'
21711 d_getnent='$d_getnent'
21712 d_getnetbyaddr_r='$d_getnetbyaddr_r'
21713 d_getnetbyname_r='$d_getnetbyname_r'
21714 d_getnetent_r='$d_getnetent_r'
21715 d_getnetprotos='$d_getnetprotos'
21716 d_getpagsz='$d_getpagsz'
21717 d_getpbyname='$d_getpbyname'
21718 d_getpbynumber='$d_getpbynumber'
21719 d_getpent='$d_getpent'
21720 d_getpgid='$d_getpgid'
21721 d_getpgrp2='$d_getpgrp2'
21722 d_getpgrp='$d_getpgrp'
21723 d_getppid='$d_getppid'
21724 d_getprior='$d_getprior'
21725 d_getprotobyname_r='$d_getprotobyname_r'
21726 d_getprotobynumber_r='$d_getprotobynumber_r'
21727 d_getprotoent_r='$d_getprotoent_r'
21728 d_getprotoprotos='$d_getprotoprotos'
21729 d_getprpwnam='$d_getprpwnam'
21730 d_getpwent='$d_getpwent'
21731 d_getpwent_r='$d_getpwent_r'
21732 d_getpwnam_r='$d_getpwnam_r'
21733 d_getpwuid_r='$d_getpwuid_r'
21734 d_getsbyname='$d_getsbyname'
21735 d_getsbyport='$d_getsbyport'
21736 d_getsent='$d_getsent'
21737 d_getservbyname_r='$d_getservbyname_r'
21738 d_getservbyport_r='$d_getservbyport_r'
21739 d_getservent_r='$d_getservent_r'
21740 d_getservprotos='$d_getservprotos'
21741 d_getspnam='$d_getspnam'
21742 d_getspnam_r='$d_getspnam_r'
21743 d_gettimeod='$d_gettimeod'
21744 d_gmtime_r='$d_gmtime_r'
21745 d_gnulibc='$d_gnulibc'
21746 d_grpasswd='$d_grpasswd'
21747 d_hasmntopt='$d_hasmntopt'
21749 d_ilogbl='$d_ilogbl'
21750 d_inc_version_list='$d_inc_version_list'
21752 d_inetaton='$d_inetaton'
21753 d_int64_t='$d_int64_t'
21754 d_isascii='$d_isascii'
21755 d_isfinite='$d_isfinite'
21758 d_isnanl='$d_isnanl'
21759 d_killpg='$d_killpg'
21760 d_lchown='$d_lchown'
21761 d_ldbl_dig='$d_ldbl_dig'
21762 d_libm_lib_version='$d_libm_lib_version'
21764 d_localtime_r='$d_localtime_r'
21765 d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset'
21766 d_locconv='$d_locconv'
21768 d_longdbl='$d_longdbl'
21769 d_longlong='$d_longlong'
21770 d_lseekproto='$d_lseekproto'
21772 d_madvise='$d_madvise'
21773 d_malloc_good_size='$d_malloc_good_size'
21774 d_malloc_size='$d_malloc_size'
21776 d_mbstowcs='$d_mbstowcs'
21777 d_mbtowc='$d_mbtowc'
21778 d_memchr='$d_memchr'
21779 d_memcmp='$d_memcmp'
21780 d_memcpy='$d_memcpy'
21781 d_memmove='$d_memmove'
21782 d_memset='$d_memset'
21784 d_mkdtemp='$d_mkdtemp'
21785 d_mkfifo='$d_mkfifo'
21786 d_mkstemp='$d_mkstemp'
21787 d_mkstemps='$d_mkstemps'
21788 d_mktime='$d_mktime'
21791 d_modfl_pow32_bug='$d_modfl_pow32_bug'
21792 d_modflproto='$d_modflproto'
21793 d_mprotect='$d_mprotect'
21795 d_msg_ctrunc='$d_msg_ctrunc'
21796 d_msg_dontroute='$d_msg_dontroute'
21797 d_msg_oob='$d_msg_oob'
21798 d_msg_peek='$d_msg_peek'
21799 d_msg_proxy='$d_msg_proxy'
21800 d_msgctl='$d_msgctl'
21801 d_msgget='$d_msgget'
21802 d_msghdr_s='$d_msghdr_s'
21803 d_msgrcv='$d_msgrcv'
21804 d_msgsnd='$d_msgsnd'
21806 d_munmap='$d_munmap'
21807 d_mymalloc='$d_mymalloc'
21809 d_nl_langinfo='$d_nl_langinfo'
21810 d_nv_preserves_uv='$d_nv_preserves_uv'
21811 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
21812 d_off64_t='$d_off64_t'
21813 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
21814 d_oldpthreads='$d_oldpthreads'
21815 d_oldsock='$d_oldsock'
21817 d_pathconf='$d_pathconf'
21819 d_perl_otherlibdirs='$d_perl_otherlibdirs'
21820 d_phostname='$d_phostname'
21823 d_portable='$d_portable'
21824 d_printf_format_null='$d_printf_format_null'
21825 d_procselfexe='$d_procselfexe'
21826 d_pseudofork='$d_pseudofork'
21827 d_pthread_atfork='$d_pthread_atfork'
21828 d_pthread_attr_setscope='$d_pthread_attr_setscope'
21829 d_pthread_yield='$d_pthread_yield'
21831 d_pwchange='$d_pwchange'
21832 d_pwclass='$d_pwclass'
21833 d_pwcomment='$d_pwcomment'
21834 d_pwexpire='$d_pwexpire'
21835 d_pwgecos='$d_pwgecos'
21836 d_pwpasswd='$d_pwpasswd'
21837 d_pwquota='$d_pwquota'
21840 d_random_r='$d_random_r'
21841 d_readdir64_r='$d_readdir64_r'
21842 d_readdir='$d_readdir'
21843 d_readdir_r='$d_readdir_r'
21844 d_readlink='$d_readlink'
21846 d_recvmsg='$d_recvmsg'
21847 d_rename='$d_rename'
21848 d_rewinddir='$d_rewinddir'
21850 d_safebcpy='$d_safebcpy'
21851 d_safemcpy='$d_safemcpy'
21852 d_sanemcmp='$d_sanemcmp'
21853 d_sbrkproto='$d_sbrkproto'
21854 d_scalbnl='$d_scalbnl'
21855 d_sched_yield='$d_sched_yield'
21856 d_scm_rights='$d_scm_rights'
21857 d_seekdir='$d_seekdir'
21858 d_select='$d_select'
21860 d_semctl='$d_semctl'
21861 d_semctl_semid_ds='$d_semctl_semid_ds'
21862 d_semctl_semun='$d_semctl_semun'
21863 d_semget='$d_semget'
21865 d_sendmsg='$d_sendmsg'
21866 d_setegid='$d_setegid'
21867 d_seteuid='$d_seteuid'
21868 d_setgrent='$d_setgrent'
21869 d_setgrent_r='$d_setgrent_r'
21870 d_setgrps='$d_setgrps'
21871 d_sethent='$d_sethent'
21872 d_sethostent_r='$d_sethostent_r'
21873 d_setitimer='$d_setitimer'
21874 d_setlinebuf='$d_setlinebuf'
21875 d_setlocale='$d_setlocale'
21876 d_setlocale_r='$d_setlocale_r'
21877 d_setnent='$d_setnent'
21878 d_setnetent_r='$d_setnetent_r'
21879 d_setpent='$d_setpent'
21880 d_setpgid='$d_setpgid'
21881 d_setpgrp2='$d_setpgrp2'
21882 d_setpgrp='$d_setpgrp'
21883 d_setprior='$d_setprior'
21884 d_setproctitle='$d_setproctitle'
21885 d_setprotoent_r='$d_setprotoent_r'
21886 d_setpwent='$d_setpwent'
21887 d_setpwent_r='$d_setpwent_r'
21888 d_setregid='$d_setregid'
21889 d_setresgid='$d_setresgid'
21890 d_setresuid='$d_setresuid'
21891 d_setreuid='$d_setreuid'
21892 d_setrgid='$d_setrgid'
21893 d_setruid='$d_setruid'
21894 d_setsent='$d_setsent'
21895 d_setservent_r='$d_setservent_r'
21896 d_setsid='$d_setsid'
21897 d_setvbuf='$d_setvbuf'
21901 d_shmatprototype='$d_shmatprototype'
21902 d_shmctl='$d_shmctl'
21904 d_shmget='$d_shmget'
21905 d_sigaction='$d_sigaction'
21906 d_signbit='$d_signbit'
21907 d_sigprocmask='$d_sigprocmask'
21908 d_sigsetjmp='$d_sigsetjmp'
21909 d_sitearch='$d_sitearch'
21910 d_snprintf='$d_snprintf'
21911 d_sockatmark='$d_sockatmark'
21912 d_sockatmarkproto='$d_sockatmarkproto'
21913 d_socket='$d_socket'
21914 d_socklen_t='$d_socklen_t'
21915 d_sockpair='$d_sockpair'
21916 d_socks5_init='$d_socks5_init'
21917 d_sprintf_returns_strlen='$d_sprintf_returns_strlen'
21919 d_srand48_r='$d_srand48_r'
21920 d_srandom_r='$d_srandom_r'
21921 d_sresgproto='$d_sresgproto'
21922 d_sresuproto='$d_sresuproto'
21923 d_statblks='$d_statblks'
21924 d_statfs_f_flags='$d_statfs_f_flags'
21925 d_statfs_s='$d_statfs_s'
21926 d_statvfs='$d_statvfs'
21927 d_stdio_cnt_lval='$d_stdio_cnt_lval'
21928 d_stdio_ptr_lval='$d_stdio_ptr_lval'
21929 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
21930 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
21931 d_stdio_stream_array='$d_stdio_stream_array'
21932 d_stdiobase='$d_stdiobase'
21933 d_stdstdio='$d_stdstdio'
21934 d_strchr='$d_strchr'
21935 d_strcoll='$d_strcoll'
21936 d_strctcpy='$d_strctcpy'
21937 d_strerrm='$d_strerrm'
21938 d_strerror='$d_strerror'
21939 d_strerror_r='$d_strerror_r'
21940 d_strftime='$d_strftime'
21941 d_strlcat='$d_strlcat'
21942 d_strlcpy='$d_strlcpy'
21943 d_strtod='$d_strtod'
21944 d_strtol='$d_strtol'
21945 d_strtold='$d_strtold'
21946 d_strtoll='$d_strtoll'
21947 d_strtoq='$d_strtoq'
21948 d_strtoul='$d_strtoul'
21949 d_strtoull='$d_strtoull'
21950 d_strtouq='$d_strtouq'
21951 d_strxfrm='$d_strxfrm'
21952 d_suidsafe='$d_suidsafe'
21953 d_symlink='$d_symlink'
21954 d_syscall='$d_syscall'
21955 d_syscallproto='$d_syscallproto'
21956 d_sysconf='$d_sysconf'
21957 d_sysernlst='$d_sysernlst'
21958 d_syserrlst='$d_syserrlst'
21959 d_system='$d_system'
21960 d_tcgetpgrp='$d_tcgetpgrp'
21961 d_tcsetpgrp='$d_tcsetpgrp'
21962 d_telldir='$d_telldir'
21963 d_telldirproto='$d_telldirproto'
21966 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
21967 d_tm_tm_zone='$d_tm_tm_zone'
21968 d_tmpnam_r='$d_tmpnam_r'
21969 d_truncate='$d_truncate'
21970 d_ttyname_r='$d_ttyname_r'
21971 d_tzname='$d_tzname'
21972 d_u32align='$d_u32align'
21973 d_ualarm='$d_ualarm'
21976 d_union_semun='$d_union_semun'
21977 d_unordered='$d_unordered'
21978 d_unsetenv='$d_unsetenv'
21979 d_usleep='$d_usleep'
21980 d_usleepproto='$d_usleepproto'
21982 d_vendorarch='$d_vendorarch'
21983 d_vendorbin='$d_vendorbin'
21984 d_vendorlib='$d_vendorlib'
21985 d_vendorscript='$d_vendorscript'
21987 d_void_closedir='$d_void_closedir'
21988 d_voidsig='$d_voidsig'
21989 d_voidtty='$d_voidtty'
21990 d_volatile='$d_volatile'
21991 d_vprintf='$d_vprintf'
21992 d_vsnprintf='$d_vsnprintf'
21994 d_waitpid='$d_waitpid'
21995 d_wcstombs='$d_wcstombs'
21996 d_wctomb='$d_wctomb'
21997 d_writev='$d_writev'
22000 db_hashtype='$db_hashtype'
22001 db_prefixtype='$db_prefixtype'
22002 db_version_major='$db_version_major'
22003 db_version_minor='$db_version_minor'
22004 db_version_patch='$db_version_patch'
22005 defvoidused='$defvoidused'
22006 direntrytype='$direntrytype'
22009 doublesize='$doublesize'
22011 drand48_r_proto='$drand48_r_proto'
22012 dynamic_ext='$dynamic_ext'
22018 endgrent_r_proto='$endgrent_r_proto'
22019 endhostent_r_proto='$endhostent_r_proto'
22020 endnetent_r_proto='$endnetent_r_proto'
22021 endprotoent_r_proto='$endprotoent_r_proto'
22022 endpwent_r_proto='$endpwent_r_proto'
22023 endservent_r_proto='$endservent_r_proto'
22024 eunicefix='$eunicefix'
22027 extensions='$extensions'
22029 fflushNULL='$fflushNULL'
22030 fflushall='$fflushall'
22032 firstmakefile='$firstmakefile'
22034 fpossize='$fpossize'
22035 fpostype='$fpostype'
22036 freetype='$freetype'
22039 full_csh='$full_csh'
22040 full_sed='$full_sed'
22041 gccansipedantic='$gccansipedantic'
22042 gccosandvers='$gccosandvers'
22043 gccversion='$gccversion'
22044 getgrent_r_proto='$getgrent_r_proto'
22045 getgrgid_r_proto='$getgrgid_r_proto'
22046 getgrnam_r_proto='$getgrnam_r_proto'
22047 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
22048 gethostbyname_r_proto='$gethostbyname_r_proto'
22049 gethostent_r_proto='$gethostent_r_proto'
22050 getlogin_r_proto='$getlogin_r_proto'
22051 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
22052 getnetbyname_r_proto='$getnetbyname_r_proto'
22053 getnetent_r_proto='$getnetent_r_proto'
22054 getprotobyname_r_proto='$getprotobyname_r_proto'
22055 getprotobynumber_r_proto='$getprotobynumber_r_proto'
22056 getprotoent_r_proto='$getprotoent_r_proto'
22057 getpwent_r_proto='$getpwent_r_proto'
22058 getpwnam_r_proto='$getpwnam_r_proto'
22059 getpwuid_r_proto='$getpwuid_r_proto'
22060 getservbyname_r_proto='$getservbyname_r_proto'
22061 getservbyport_r_proto='$getservbyport_r_proto'
22062 getservent_r_proto='$getservent_r_proto'
22063 getspnam_r_proto='$getspnam_r_proto'
22064 gidformat='$gidformat'
22070 gmtime_r_proto='$gmtime_r_proto'
22071 gnulibc_version='$gnulibc_version'
22073 groupcat='$groupcat'
22074 groupstype='$groupstype'
22077 h_sysfile='$h_sysfile'
22080 html1dir='$html1dir'
22081 html1direxp='$html1direxp'
22082 html3dir='$html3dir'
22083 html3direxp='$html3direxp'
22092 i_arpainet='$i_arpainet'
22093 i_bsdioctl='$i_bsdioctl'
22097 i_dirent='$i_dirent'
22103 i_fp_class='$i_fp_class'
22106 i_ieeefp='$i_ieeefp'
22107 i_inttypes='$i_inttypes'
22108 i_langinfo='$i_langinfo'
22109 i_libutil='$i_libutil'
22110 i_limits='$i_limits'
22111 i_locale='$i_locale'
22112 i_machcthr='$i_machcthr'
22113 i_malloc='$i_malloc'
22115 i_memory='$i_memory'
22116 i_mntent='$i_mntent'
22119 i_neterrno='$i_neterrno'
22120 i_netinettcp='$i_netinettcp'
22124 i_pthread='$i_pthread'
22126 i_rpcsvcdbm='$i_rpcsvcdbm'
22129 i_shadow='$i_shadow'
22131 i_stdarg='$i_stdarg'
22132 i_stddef='$i_stddef'
22133 i_stdlib='$i_stdlib'
22134 i_string='$i_string'
22135 i_sunmath='$i_sunmath'
22136 i_sysaccess='$i_sysaccess'
22137 i_sysdir='$i_sysdir'
22138 i_sysfile='$i_sysfile'
22139 i_sysfilio='$i_sysfilio'
22141 i_sysioctl='$i_sysioctl'
22142 i_syslog='$i_syslog'
22143 i_sysmman='$i_sysmman'
22144 i_sysmode='$i_sysmode'
22145 i_sysmount='$i_sysmount'
22146 i_sysndir='$i_sysndir'
22147 i_sysparam='$i_sysparam'
22148 i_sysresrc='$i_sysresrc'
22149 i_syssecrt='$i_syssecrt'
22150 i_sysselct='$i_sysselct'
22151 i_syssockio='$i_syssockio'
22152 i_sysstat='$i_sysstat'
22153 i_sysstatfs='$i_sysstatfs'
22154 i_sysstatvfs='$i_sysstatvfs'
22155 i_systime='$i_systime'
22156 i_systimek='$i_systimek'
22157 i_systimes='$i_systimes'
22158 i_systypes='$i_systypes'
22159 i_sysuio='$i_sysuio'
22161 i_sysutsname='$i_sysutsname'
22162 i_sysvfs='$i_sysvfs'
22163 i_syswait='$i_syswait'
22164 i_termio='$i_termio'
22165 i_termios='$i_termios'
22167 i_unistd='$i_unistd'
22170 i_values='$i_values'
22171 i_varargs='$i_varargs'
22172 i_varhdr='$i_varhdr'
22174 ignore_versioned_solibs='$ignore_versioned_solibs'
22175 inc_version_list='$inc_version_list'
22176 inc_version_list_init='$inc_version_list_init'
22179 initialinstalllocation='$initialinstalllocation'
22180 installarchlib='$installarchlib'
22181 installbin='$installbin'
22182 installhtml1dir='$installhtml1dir'
22183 installhtml3dir='$installhtml3dir'
22184 installman1dir='$installman1dir'
22185 installman3dir='$installman3dir'
22186 installprefix='$installprefix'
22187 installprefixexp='$installprefixexp'
22188 installprivlib='$installprivlib'
22189 installscript='$installscript'
22190 installsitearch='$installsitearch'
22191 installsitebin='$installsitebin'
22192 installsitehtml1dir='$installsitehtml1dir'
22193 installsitehtml3dir='$installsitehtml3dir'
22194 installsitelib='$installsitelib'
22195 installsiteman1dir='$installsiteman1dir'
22196 installsiteman3dir='$installsiteman3dir'
22197 installsitescript='$installsitescript'
22198 installstyle='$installstyle'
22199 installusrbinperl='$installusrbinperl'
22200 installvendorarch='$installvendorarch'
22201 installvendorbin='$installvendorbin'
22202 installvendorhtml1dir='$installvendorhtml1dir'
22203 installvendorhtml3dir='$installvendorhtml3dir'
22204 installvendorlib='$installvendorlib'
22205 installvendorman1dir='$installvendorman1dir'
22206 installvendorman3dir='$installvendorman3dir'
22207 installvendorscript='$installvendorscript'
22209 issymlink='$issymlink'
22210 ivdformat='$ivdformat'
22213 known_extensions='$known_extensions'
22216 lddlflags='$lddlflags'
22218 ldflags_uselargefiles='$ldflags_uselargefiles'
22219 ldlibpthname='$ldlibpthname'
22226 libsdirs='$libsdirs'
22227 libsfiles='$libsfiles'
22228 libsfound='$libsfound'
22229 libspath='$libspath'
22230 libswanted='$libswanted'
22231 libswanted_uselargefiles='$libswanted_uselargefiles'
22237 localtime_r_proto='$localtime_r_proto'
22238 locincpth='$locincpth'
22239 loclibpth='$loclibpth'
22240 longdblsize='$longdblsize'
22241 longlongsize='$longlongsize'
22242 longsize='$longsize'
22246 lseeksize='$lseeksize'
22247 lseektype='$lseektype'
22250 madlyobj='$madlyobj'
22251 madlysrc='$madlysrc'
22255 make_set_make='$make_set_make'
22256 mallocobj='$mallocobj'
22257 mallocsrc='$mallocsrc'
22258 malloctype='$malloctype'
22260 man1direxp='$man1direxp'
22263 man3direxp='$man3direxp'
22265 mips_type='$mips_type'
22266 mistrustnm='$mistrustnm'
22268 mmaptype='$mmaptype'
22269 modetype='$modetype'
22271 multiarch='$multiarch'
22273 myarchname='$myarchname'
22274 mydomain='$mydomain'
22275 myhostname='$myhostname'
22278 need_va_copy='$need_va_copy'
22279 netdb_hlen_type='$netdb_hlen_type'
22280 netdb_host_type='$netdb_host_type'
22281 netdb_name_type='$netdb_name_type'
22282 netdb_net_type='$netdb_net_type'
22285 nm_so_opt='$nm_so_opt'
22286 nonxs_ext='$nonxs_ext'
22288 nvEUformat='$nvEUformat'
22289 nvFUformat='$nvFUformat'
22290 nvGUformat='$nvGUformat'
22291 nv_preserves_uv_bits='$nv_preserves_uv_bits'
22292 nveformat='$nveformat'
22293 nvfformat='$nvfformat'
22294 nvgformat='$nvgformat'
22297 o_nonblock='$o_nonblock'
22299 old_pthread_create_joinable='$old_pthread_create_joinable'
22300 optimize='$optimize'
22301 orderlib='$orderlib'
22304 otherlibdirs='$otherlibdirs'
22308 patchlevel='$patchlevel'
22309 path_sep='$path_sep'
22312 perl_patchlevel='$perl_patchlevel'
22313 perladmin='$perladmin'
22314 perllibs='$perllibs'
22315 perlpath='$perlpath'
22317 phostname='$phostname'
22323 prefixexp='$prefixexp'
22325 privlibexp='$privlibexp'
22326 procselfexe='$procselfexe'
22327 prototype='$prototype'
22329 quadkind='$quadkind'
22330 quadtype='$quadtype'
22331 randbits='$randbits'
22332 randfunc='$randfunc'
22333 random_r_proto='$random_r_proto'
22334 randseedtype='$randseedtype'
22336 rd_nodata='$rd_nodata'
22337 readdir64_r_proto='$readdir64_r_proto'
22338 readdir_r_proto='$readdir_r_proto'
22339 revision='$revision'
22345 sPRIEUldbl='$sPRIEUldbl'
22346 sPRIFUldbl='$sPRIFUldbl'
22347 sPRIGUldbl='$sPRIGUldbl'
22348 sPRIXU64='$sPRIXU64'
22350 sPRIeldbl='$sPRIeldbl'
22351 sPRIfldbl='$sPRIfldbl'
22352 sPRIgldbl='$sPRIgldbl'
22357 sSCNfldbl='$sSCNfldbl'
22358 sched_yield='$sched_yield'
22359 scriptdir='$scriptdir'
22360 scriptdirexp='$scriptdirexp'
22362 seedfunc='$seedfunc'
22363 selectminbits='$selectminbits'
22364 selecttype='$selecttype'
22365 sendmail='$sendmail'
22366 setgrent_r_proto='$setgrent_r_proto'
22367 sethostent_r_proto='$sethostent_r_proto'
22368 setlocale_r_proto='$setlocale_r_proto'
22369 setnetent_r_proto='$setnetent_r_proto'
22370 setprotoent_r_proto='$setprotoent_r_proto'
22371 setpwent_r_proto='$setpwent_r_proto'
22372 setservent_r_proto='$setservent_r_proto'
22375 sharpbang='$sharpbang'
22376 shmattype='$shmattype'
22377 shortsize='$shortsize'
22380 sig_count='$sig_count'
22381 sig_name='$sig_name'
22382 sig_name_init='$sig_name_init'
22384 sig_num_init='$sig_num_init'
22385 sig_size='$sig_size'
22386 signal_t='$signal_t'
22387 sitearch='$sitearch'
22388 sitearchexp='$sitearchexp'
22390 sitebinexp='$sitebinexp'
22391 sitehtml1dir='$sitehtml1dir'
22392 sitehtml1direxp='$sitehtml1direxp'
22393 sitehtml3dir='$sitehtml3dir'
22394 sitehtml3direxp='$sitehtml3direxp'
22396 sitelib_stem='$sitelib_stem'
22397 sitelibexp='$sitelibexp'
22398 siteman1dir='$siteman1dir'
22399 siteman1direxp='$siteman1direxp'
22400 siteman3dir='$siteman3dir'
22401 siteman3direxp='$siteman3direxp'
22402 siteprefix='$siteprefix'
22403 siteprefixexp='$siteprefixexp'
22404 sitescript='$sitescript'
22405 sitescriptexp='$sitescriptexp'
22406 sizesize='$sizesize'
22407 sizetype='$sizetype'
22411 sockethdr='$sockethdr'
22412 socketlib='$socketlib'
22413 socksizetype='$socksizetype'
22415 spackage='$spackage'
22416 spitshell='$spitshell'
22417 srand48_r_proto='$srand48_r_proto'
22418 srandom_r_proto='$srandom_r_proto'
22420 ssizetype='$ssizetype'
22421 startperl='$startperl'
22423 static_ext='$static_ext'
22425 stdio_base='$stdio_base'
22426 stdio_bufsiz='$stdio_bufsiz'
22427 stdio_cnt='$stdio_cnt'
22428 stdio_filbuf='$stdio_filbuf'
22429 stdio_ptr='$stdio_ptr'
22430 stdio_stream_array='$stdio_stream_array'
22431 strerror_r_proto='$strerror_r_proto'
22434 subversion='$subversion'
22438 targetarch='$targetarch'
22442 timeincl='$timeincl'
22443 timetype='$timetype'
22444 tmpnam_r_proto='$tmpnam_r_proto'
22450 ttyname_r_proto='$ttyname_r_proto'
22459 uidformat='$uidformat'
22465 uquadtype='$uquadtype'
22466 use5005threads='$use5005threads'
22467 use64bitall='$use64bitall'
22468 use64bitint='$use64bitint'
22469 usecrosscompile='$usecrosscompile'
22471 usefaststdio='$usefaststdio'
22472 useithreads='$useithreads'
22473 uselargefiles='$uselargefiles'
22474 uselongdouble='$uselongdouble'
22475 usemallocwrap='$usemallocwrap'
22476 usemorebits='$usemorebits'
22477 usemultiplicity='$usemultiplicity'
22478 usemymalloc='$usemymalloc'
22480 useopcode='$useopcode'
22481 useperlio='$useperlio'
22482 useposix='$useposix'
22483 usereentrant='$usereentrant'
22484 userelocatableinc='$userelocatableinc'
22486 useshrplib='$useshrplib'
22487 usesitecustomize='$usesitecustomize'
22488 usesocks='$usesocks'
22489 usethreads='$usethreads'
22490 usevendorprefix='$usevendorprefix'
22491 usevfork='$usevfork'
22494 uvXUformat='$uvXUformat'
22495 uvoformat='$uvoformat'
22498 uvuformat='$uvuformat'
22499 uvxformat='$uvxformat'
22500 vendorarch='$vendorarch'
22501 vendorarchexp='$vendorarchexp'
22502 vendorbin='$vendorbin'
22503 vendorbinexp='$vendorbinexp'
22504 vendorhtml1dir='$vendorhtml1dir'
22505 vendorhtml1direxp='$vendorhtml1direxp'
22506 vendorhtml3dir='$vendorhtml3dir'
22507 vendorhtml3direxp='$vendorhtml3direxp'
22508 vendorlib='$vendorlib'
22509 vendorlib_stem='$vendorlib_stem'
22510 vendorlibexp='$vendorlibexp'
22511 vendorman1dir='$vendorman1dir'
22512 vendorman1direxp='$vendorman1direxp'
22513 vendorman3dir='$vendorman3dir'
22514 vendorman3direxp='$vendorman3direxp'
22515 vendorprefix='$vendorprefix'
22516 vendorprefixexp='$vendorprefixexp'
22517 vendorscript='$vendorscript'
22518 vendorscriptexp='$vendorscriptexp'
22520 version_patchlevel_string='$version_patchlevel_string'
22521 versiononly='$versiononly'
22523 voidflags='$voidflags'
22526 yaccflags='$yaccflags'
22531 : Add in command line options if available
22532 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
22534 : add special variables
22535 $test -f $src/patchlevel.h && \
22536 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
22537 echo "PERL_PATCHLEVEL=$perl_patchlevel" >>config.sh
22538 echo "PERL_CONFIG_SH=true" >>config.sh
22540 : propagate old symbols
22541 if $test -f UU/config.sh; then
22542 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
22543 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
22544 $sort | $uniq -u >UU/oldsyms
22545 set X `cat UU/oldsyms`
22551 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
22553 echo "# Variables propagated from previous config.sh file." >>config.sh
22554 for sym in `cat UU/oldsyms`; do
22555 echo " Propagating $hint variable "'$'"$sym..."
22556 eval 'tmp="$'"${sym}"'"'
22558 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
22564 : Finish up by extracting the .SH files
22568 echo "Extraction done."
22578 If you'd like to make any changes to the config.sh file before I begin
22579 to configure things, do it as a shell escape now (e.g. !vi config.sh).
22582 rp="Press return or use a shell escape to edit config.sh:"
22587 *) : in case they cannot read
22588 sh 1>&4 -c "$ans";;
22593 : if this fails, just run all the .SH files by hand
22602 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
22609 Now you need to generate make dependencies by running "$make depend".
22610 You might prefer to run it in background: "$make depend > makedepend.out &"
22611 It can take a while, so you might not want to run it right now.
22616 rp="Run $make depend now?"
22620 $make depend && echo "Now you must run '$make'."
22623 echo "You must run '$make depend' then '$make'."
22626 elif test -f [Mm]akefile; then
22628 echo "Now you must run a $make."
22630 echo "Configure done."
22633 if $test -f Policy.sh; then
22636 If you compile $package on a different machine or from a different object
22637 directory, copy the Policy.sh file from this object directory to the
22638 new one before you run Configure -- this will help you with most of
22639 the policy defaults.
22643 if $test -f config.msg; then
22644 echo "Hmm. I also noted the following information while running:"
22646 $cat config.msg >&4
22649 $rm -f kit*isdone ark*isdone