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 Tue Aug 21 15:53:52 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"
2489 cat <<'EOSC' >>trygcc
2494 int main(int argc, char *argv[]) {
2498 if $cc -o try $ccflags $ldflags try.c; then
2501 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2507 # Skip this test because it gives a false match on output like:
2508 # ./trygcc: line 23: cc: command not found
2509 # case "`$cc -v -c try.c 2>&1`" in
2510 # *gcc*) trygcc=no ;;
2512 if $test X"$trygcc" = Xyes; then
2513 if gcc -o try -c try.c; then
2515 echo "You seem to have a working gcc, though." >&4
2516 # Switching compilers may undo the work of hints files.
2517 # The most common problem is -D_REENTRANT for threads.
2518 # This heuristic catches that case, but gets false positives
2519 # if -Dusethreads was not actually specified. Better to
2520 # bail out here with a useful message than fail
2521 # mysteriously later. Should we perhaps just try to
2522 # re-invoke Configure -Dcc=gcc config_args ?
2523 if $test -f usethreads.cbu; then
2526 *** However, any setting of the C compiler flags (e.g. for thread support)
2527 *** will be lost. It may be necessary for you to restart Configure and
2528 *** add -Dcc=gcc to your Configure command line.
2531 rp="Would you like to go ahead and try gcc anyway?"
2534 rp="Would you like to use it?"
2537 if $test -f myread; then
2540 if $test -f UU/myread; then
2543 echo "Cannot find myread, sorry. Aborting." >&2
2548 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2561 cat <<'EOSC' >>checkcc
2566 int main(int argc, char *argv[]) {
2570 if $cc -o try $ccflags $ldflags try.c; then
2573 if $test X"$despair" = Xyes; then
2574 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2577 You need to find a working C compiler.
2578 Either (purchase and) install the C compiler supplied by your OS vendor,
2579 or for a free C compiler try http://gcc.gnu.org/
2580 I cannot continue any further, aborting.
2589 : determine whether symbolic links are supported
2592 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2593 echo "Symbolic links are supported." >&4
2596 echo "Symbolic links are NOT supported." >&4
2601 : determine whether symbolic links are supported
2605 echo "Checking how to test for symbolic links..." >&4
2607 if $test "X$issymlink" = X; then
2609 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2610 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2612 if test $? = 0; then
2615 echo "Your builtin 'test -h' may be broken." >&4
2618 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2621 if test -f "$p/$test"; then
2630 echo "Trying external '$test -h'." >&4
2631 issymlink="$test -h"
2632 if $test ! -h sym >/dev/null 2>&1; then
2633 echo "External '$test -h' is broken, too." >&4
2641 if $test "X$issymlink" = X; then
2642 if $test -L sym 2>/dev/null; then
2643 issymlink="$test -L"
2644 echo "The builtin '$test -L' worked." >&4
2647 if $test "X$issymlink" != X; then
2648 echo "You can test for symbolic links with '$issymlink'." >&4
2650 echo "I do not know how you can test for symbolic links." >&4
2654 *) echo "No symbolic links, so not testing for their testing..." >&4
2660 case "$mksymlinks" in
2663 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2666 *) case "$lns:$issymlink" in
2667 *"ln"*" -s:"*"test -"?)
2668 echo "Creating the symbolic links..." >&4
2669 echo "(First creating the subdirectories...)" >&4
2671 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2673 test -z "$directory" && break
2677 if test ! -d t/base; then
2678 echo "Failed to create the subdirectories. Aborting." >&4
2681 echo "(Then creating the symlinks...)" >&4
2682 awk '{print $1}' $src/MANIFEST | while true; do
2684 test -z "$filename" && break
2685 if test -f $filename; then
2686 if $issymlink $filename; then
2690 if test -f $filename; then
2691 echo "$filename already exists, not symlinking."
2693 ln -s $src/$filename $filename
2697 if test ! -f t/base/lex.t; then
2698 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2703 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2712 case "$usecrosscompile" in
2714 $echo "Cross-compiling..."
2717 *-*-gcc) # A cross-compiling gcc, probably.
2718 targetarch=`$echo $cc|$sed 's/-gcc$//'`
2720 # leave out ld, choosing it is more complex
2722 ranlib=$targetarch-ranlib
2723 $echo 'extern int foo;' > try.c
2724 set X `$cc -v -E try.c 2>&1 | $awk '/^#include </,/^End of search /'|$grep '/include'`
2726 if $test $# -gt 0; then
2728 incpth="`$echo $incpth|$sed 's/^ //'`"
2729 echo "Guessing incpth '$incpth'." >&4
2731 j="`$echo $i|$sed 's,/include$,/lib,'`"
2732 if $test -d $j; then
2736 libpth="`$echo $libpth|$sed 's/^ //'`"
2737 echo "Guessing libpth '$libpth'." >&4
2742 case "$targetarch" in
2743 '') echo "Targetarch not defined." >&4; croak=y ;;
2744 *) echo "Using targetarch $targetarch." >&4 ;;
2747 '') echo "Incpth not defined." >&4; croak=y ;;
2748 *) echo "Using incpth '$incpth'." >&4 ;;
2751 '') echo "Libpth not defined." >&4; croak=y ;;
2752 *) echo "Using libpth '$libpth'." >&4 ;;
2755 '') for i in $incpth; do
2756 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
2758 echo "Guessing usrinc $usrinc." >&4
2763 '') echo "Usrinc not defined." >&4; croak=y ;;
2766 *) echo "Using usrinc $usrinc." >&4 ;;
2768 case "$targethost" in
2769 '') echo "Targethost not defined." >&4; croak=y ;;
2770 *) echo "Using targethost $targethost." >&4
2775 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2778 /*) run=$src/Cross/run
2779 targetmkdir=$src/Cross/mkdir
2781 from=$src/Cross/from
2783 *) pwd=`$test -f ../Configure & cd ..; pwd`
2785 targetmkdir=$pwd/Cross/mkdir
2787 from=$pwd/Cross/from
2790 case "$targetrun" in
2791 '') targetrun=ssh ;;
2796 case "$targetfrom" in
2797 '') targetfrom=scp ;;
2801 from=$from-$targetfrom
2802 case "$targetdir" in
2804 echo "Guessing targetdir $targetdir." >&4
2807 case "$targetuser" in
2809 echo "Guessing targetuser $targetuser." >&4
2812 case "$targetfrom" in
2816 case "$targetrun" in
2828 '') cwd=$targetdir ;;
2832 if $test ! -f \$exe.xok; then
2836 $targetrun -l $targetuser $targethost "cd \$cwd && ./\$exe \$@"
2839 *) echo "Unknown targetrun '$targetrun'" >&4
2843 case "$targetmkdir" in
2845 cat >$targetmkdir <<EOF
2847 $targetrun -l $targetuser $targethost "mkdir -p \$@"
2849 $chmod a+rx $targetmkdir
2851 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
2863 $targetmkdir \`dirname \$f\`
2864 $targetto $q \$f $targetuser@$targethost:\$f || exit 1
2867 $targetmkdir $targetdir/\`dirname \$f\`
2868 $targetto $q \$f $targetuser@$targethost:$targetdir/\$f || exit 1
2881 $mkdir -p $targetdir/\`dirname \$f\`
2882 $cp \$f $targetdir/\$f || exit 1
2885 $targetmkdir $targetdir/\`dirname \$f\`
2886 $cp \$f $targetdir/\$f || exit 1
2893 *) echo "Unknown targetto '$targetto'" >&4
2897 case "$targetfrom" in
2904 $targetfrom $q $targetuser@$targethost:$targetdir/\$f . || exit 1
2909 cp) cat >$from <<EOF
2914 cp $targetdir/\$f . || exit 1
2919 *) echo "Unknown targetfrom '$targetfrom'" >&4
2923 if $test ! -f $run; then
2924 echo "Target 'run' script '$run' not found." >&4
2928 if $test ! -f $to; then
2929 echo "Target 'to' script '$to' not found." >&4
2933 if $test ! -f $from; then
2934 echo "Target 'from' script '$from' not found." >&4
2938 if $test ! -f $run -o ! -f $to -o ! -f $from; then
2942 Using '$run' for remote execution,
2943 and '$from' and '$to'
2944 for remote file transfer.
2950 usecrosscompile='undef'
2955 : see whether [:lower:] and [:upper:] are supported character classes
2957 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2959 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2963 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
2964 # (0xd9 and 0xe2), therefore that is a nice testing point.
2965 if test "X$up" = X -o "X$low" = X; then
2966 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
2972 if test "X$up" = X -o "X$low" = X; then
2973 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
2979 if test "X$up" = X -o "X$low" = X; then
2980 case "`echo RS | od -x 2>/dev/null`" in
2982 echo "Hey, this might be EBCDIC." >&4
2983 if test "X$up" = X -o "X$low" = X; then
2984 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2985 rs) up='[A-IJ-RS-Z]'
2990 if test "X$up" = X -o "X$low" = X; then
2991 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
3001 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
3003 echo "Using $up and $low to convert case." >&4
3006 echo "I don't know how to translate letters from upper to lower case." >&4
3007 echo "Your tr is not acting any way I know of." >&4
3011 : set up the translation script tr, must be called with ./tr of course
3015 '[A-Z][a-z]') exec $tr '$up' '$low';;
3016 '[a-z][A-Z]') exec $tr '$low' '$up';;
3023 : Try to determine whether config.sh was made on this system
3024 case "$config_sh" in
3026 myuname=`$uname -a 2>/dev/null`
3027 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
3028 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
3029 # because the A-Z/a-z are not consecutive.
3030 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e "s,['/],,g" | \
3031 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
3032 newmyuname="$myuname"
3034 case "$knowitall" in
3036 if test -f ../config.sh; then
3037 if $contains myuname= ../config.sh >/dev/null 2>&1; then
3038 eval "`grep myuname= ../config.sh`"
3040 if test "X$myuname" = "X$newmyuname"; then
3048 : Get old answers from old config file if Configure was run on the
3049 : same system, otherwise use the hints.
3052 if test -f config.sh; then
3054 rp="I see a config.sh file. Shall I use it to set the defaults?"
3057 n*|N*) echo "OK, I'll ignore it."
3058 mv config.sh config.sh.old
3059 myuname="$newmyuname"
3061 *) echo "Fetching default answers from your old config.sh file..." >&4
3069 : Older versions did not always set $sh. Catch re-use of such
3079 if test ! -f config.sh; then
3082 First time through, eh? I have some defaults handy for some systems
3083 that need some extra help getting the Configure answers right:
3086 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3088 : Half the following guesses are probably wrong... If you have better
3089 : tests or hints, please send them to perlbug@perl.org
3090 : The metaconfig authors would also appreciate a copy...
3091 $test -f /irix && osname=irix
3092 $test -f /xenix && osname=sco_xenix
3093 $test -f /dynix && osname=dynix
3094 $test -f /dnix && osname=dnix
3095 $test -f /lynx.os && osname=lynxos
3096 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3097 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3098 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3099 $test -f /bin/mips && /bin/mips && osname=mips
3100 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
3101 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
3102 $test -d /usr/apollo/bin && osname=apollo
3103 $test -f /etc/saf/_sactab && osname=svr4
3104 $test -d /usr/include/minix && osname=minix
3105 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3106 if $test -d /MachTen -o -d /MachTen_Folder; then
3108 if $test -x /sbin/version; then
3109 osvers=`/sbin/version | $awk '{print $2}' |
3110 $sed -e 's/[A-Za-z]$//'`
3111 elif $test -x /usr/etc/version; then
3112 osvers=`/usr/etc/version | $awk '{print $2}' |
3113 $sed -e 's/[A-Za-z]$//'`
3119 $test -f /sys/posix.dll &&
3120 $test -f /usr/bin/what &&
3121 set X `/usr/bin/what /sys/posix.dll` &&
3122 $test "$3" = UWIN &&
3126 if $test -f $uname; then
3134 umips) osname=umips ;;
3137 [23]100) osname=mips ;;
3138 next*) osname=next ;;
3140 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3141 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3144 elif $test -f /etc/kconfig; then
3146 if test "$lns" = "$ln -s"; then
3148 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3150 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3157 if test -n "$DJGPP"; then
3166 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3168 # oslevel can fail with:
3169 # oslevel: Unable to acquire lock.
3170 *not\ found) osvers="$4"."$3" ;;
3171 '<3240'|'<>3240') osvers=3.2.0 ;;
3172 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3173 '=3250'|'>3250') osvers=3.2.5 ;;
3177 bsd386) osname=bsd386
3180 cygwin*) osname=cygwin
3183 *dc.osx) osname=dcosx
3189 domainos) osname=apollo
3195 dragonfly) osname=dragonfly
3198 dynixptx*) osname=dynixptx
3199 osvers=`echo "$4"|sed 's/^v//'`
3201 freebsd) osname=freebsd
3203 genix) osname=genix ;;
3207 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3223 netbsd*) osname=netbsd
3226 news-os) osvers="$3"
3228 4*) osname=newsos4 ;;
3232 next*) osname=next ;;
3233 nonstop-ux) osname=nonstopux ;;
3234 openbsd) osname=openbsd
3240 POSIX-BC | posix-bc ) osname=posix-bc
3243 powerux | power_ux | powermax_os | powermaxos | \
3244 powerunix | power_unix) osname=powerux
3250 solaris) osname=solaris
3252 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3259 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3263 titanos) osname=titanos
3272 ultrix) osname=ultrix
3275 osf1|mls+) case "$5" in
3278 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3281 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3284 hp*) osname=hp_osf1 ;;
3285 mips) osname=mips_osf1 ;;
3288 # UnixWare 7.1.2 is known as Open UNIX 8
3289 openunix|unixware) osname=svr5
3297 $2) case "$osname" in
3301 : svr4.x or possibly later
3311 if test -f /stand/boot ; then
3312 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3313 if test -n "$INITPROG" -a -f "$INITPROG"; then
3314 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3315 if test -n "$isesix"; then
3323 *) if test -f /etc/systemid; then
3325 set `echo $3 | $sed 's/\./ /g'` $4
3326 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3328 elif $test -f $src/hints/sco_$1_$2.sh; then
3330 elif $test -f $src/hints/sco_$1.sh; then
3335 '') : Still unknown. Probably a generic Sys V.
3344 *) case "$osname" in
3345 '') : Still unknown. Probably a generic BSD.
3353 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3354 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3355 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3358 $rm -f UU/kernel.what
3359 elif test -d c:/. -o -n "$is_os2" ; then
3366 case "$targetarch" in
3369 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3374 : Now look for a hint file osname_osvers, unless one has been
3375 : specified already.
3378 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3379 : Also try without trailing minor version numbers.
3380 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3381 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3382 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3383 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3386 *) case "$osvers" in
3389 *) if $test -f $src/hints/$file.sh ; then
3391 elif $test -f $src/hints/$xfile.sh ; then
3393 elif $test -f $src/hints/$xxfile.sh ; then
3395 elif $test -f $src/hints/$xxxfile.sh ; then
3397 elif $test -f $src/hints/$xxxxfile.sh ; then
3399 elif $test -f "$src/hints/${osname}.sh" ; then
3408 if $test -f Policy.sh ; then
3411 none) dflt="Policy" ;;
3412 *) dflt="Policy $dflt" ;;
3417 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3421 if $test -f Policy.sh ; then
3424 There's also a Policy hint file available, which should make the
3425 site-specific (policy) questions easier to answer.
3432 You may give one or more space-separated answers, or "none" if appropriate.
3433 If you have a handcrafted Policy.sh file or a Policy.sh file generated by a
3434 previous run of Configure, you may specify it as well as or instead of
3435 OS-specific hints. If hints are provided for your OS, you should use them:
3436 although Perl can probably be built without hints on many platforms, using
3437 hints often improve performance and may enable features that Configure can't
3438 set up on its own. If there are no hints that match your OS, specify "none";
3439 DO NOT give a wrong version or a wrong OS.
3443 rp="Which of these apply, if any?"
3446 for file in $tans; do
3447 if $test X$file = XPolicy -a -f Policy.sh; then
3449 $cat Policy.sh >> UU/config.sh
3450 elif $test -f $src/hints/$file.sh; then
3451 . $src/hints/$file.sh
3452 $cat $src/hints/$file.sh >> UU/config.sh
3453 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3456 : Give one chance to correct a possible typo.
3457 echo "$file.sh does not exist"
3459 rp="hint to use instead?"
3461 for file in $ans; do
3462 if $test -f "$src/hints/$file.sh"; then
3463 . $src/hints/$file.sh
3464 $cat $src/hints/$file.sh >> UU/config.sh
3465 elif $test X$ans = X -o X$ans = Xnone ; then
3468 echo "$file.sh does not exist -- ignored."
3475 : Remember our hint file for later.
3476 if $test -f "$src/hints/$file.sh" ; then
3486 echo "Fetching default answers from $config_sh..." >&4
3490 cp $config_sh config.sh 2>/dev/null
3500 test "$override" && . ./optdef.sh
3502 : Restore computed paths
3503 for file in $loclist $trylist; do
3504 eval $file="\$_$file"
3509 Configure uses the operating system name and version to set some defaults.
3510 The default value is probably right if the name rings a bell. Otherwise,
3511 since spelling matters for me, either accept the default or answer "none"
3518 ''|' '|none) dflt=none ;;
3519 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3522 *) dflt="$osname" ;;
3524 rp="Operating system name?"
3528 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3534 ''|' '|none) dflt=none ;;
3535 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3536 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3538 ''|' ') dflt=none ;;
3543 *) dflt="$osvers" ;;
3545 rp="Operating system version?"
3555 : who configured the system
3556 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3559 cf_by=`(logname) 2>/dev/null`
3562 cf_by=`(whoami) 2>/dev/null`
3564 "") cf_by=unknown ;;
3569 : decide how portable to be. Allow command line overrides.
3570 case "$d_portable" in
3572 *) d_portable="$define" ;;
3575 : set up shell script to do ~ expansion
3581 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3584 if $test -f /bin/csh; then
3585 /bin/csh -f -c "glob \$1"
3590 name=\`$expr x\$1 : '..\([^/]*\)'\`
3591 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3592 if $test ! -d "\$dir"; then
3594 echo "\$me: can't locate home directory for: \$name" >&2
3599 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3615 : now set up to get a file name
3619 cat <<'EOSC' >>getfile
3635 : getfile will accept an answer from the comma-separated list
3636 : enclosed in parentheses even if it does not meet other criteria.
3637 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3638 fn=`echo $fn | sed 's/(.*)//'`
3644 loc_file=`expr $fn : '.*:\(.*\)'`
3645 fn=`expr $fn : '\(.*\):.*'`
3653 */*) fullpath=true;;
3662 *e*) exp_file=true;;
3665 *p*) nopath_ok=true;;
3670 *d*) type='Directory';;
3671 *l*) type='Locate';;
3676 Locate) what='File';;
3681 case "$d_portable" in
3689 while test "$type"; do
3694 true) rp="$rp (~name ok)";;
3697 if test -f UU/getfile.ok && \
3698 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3717 value=`UU/filexp $ans`
3720 if test "$ans" != "$value"; then
3721 echo "(That expands to $value on this system.)"
3735 /*) value="$ansexp" ;;
3736 [a-zA-Z]:/*) value="$ansexp" ;;
3741 echo "I shall only accept a full path name, as in /bin/ls." >&4
3742 echo "Use a ! shell escape if you wish to check pathnames." >&4
3745 echo "Please give a full path name, starting with slash." >&4
3748 echo "Note that using ~name is ok provided it expands well." >&4
3761 for fp in $gfpth; do
3762 if test "X$fp" = X.; then
3767 if test -f "$pf"; then
3769 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3771 echo "($value is not a plain file, but that's ok.)"
3774 if test X"$type" = X; then
3781 for fp in $gfpth; do
3782 if test "X$fp" = X.; then
3787 direxp="$fp/$ansexp"
3789 if test -d "$direxp"; then
3797 if test -d "$ansexp"; then
3798 echo "(Looking for $loc_file in directory $value.)"
3799 value="$value/$loc_file"
3800 ansexp="$ansexp/$loc_file"
3802 if test -f "$ansexp"; then
3805 case "$nopath_ok" in
3806 true) case "$value" in
3808 *) echo "Assuming $value will be in people's path."
3824 if test "$fastread" = yes; then
3829 rp="$what $value doesn't exist. Use that name anyway?"
3848 test "X$gfpthkeep" != Xy && gfpth=""
3851 : determine root of directory hierarchy where package will be installed.
3854 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
3857 dflt=`echo "$prefix" | sed 's/.$//'`
3865 By default, $package will be installed in $dflt/bin, manual pages
3866 under $dflt/man, etc..., i.e. with $dflt as prefix for all
3867 installation directories. Typically this is something like /usr/local.
3868 If you wish to have binaries under /usr/bin but other parts of the
3869 installation under /usr/local, that's ok: you will be prompted
3870 separately for each of the installation directories, the prefix being
3871 only used to set the defaults.
3875 rp='Installation prefix to use?'
3883 *) oldprefix="$prefix";;
3892 *) afsroot=$afsroot ;;
3898 $define|true) afs=true ;;
3899 $undef|false) afs=false ;;
3900 *) if test -d $afsroot; then
3908 echo "AFS may be running... I'll be extra cautious then..." >&4
3910 echo "AFS does not seem to be running..." >&4
3913 : determine installation prefix for where package is to be installed.
3917 Since you are running AFS, I need to distinguish the directory in which
3918 files will reside from the directory in which they are installed (and from
3919 which they are presumably copied to the former directory by occult means).
3922 case "$installprefix" in
3923 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
3924 *) dflt="$installprefix";;
3929 In some special cases, particularly when building $package for distribution,
3930 it is convenient to distinguish the directory in which files should be
3931 installed from the directory ($prefix) in which they will
3932 eventually reside. For most users, these two directories are the same.
3935 case "$installprefix" in
3937 *) dflt=$installprefix;;
3941 rp='What installation prefix should I use for installing files?'
3943 installprefix="$ans"
3944 installprefixexp="$ansexp"
3946 : Perform the prefixexp/installprefixexp correction if necessary
3947 cat <<EOS >installprefix
3950 cat <<'EOSC' >>installprefix
3951 : Change installation prefix, if necessary.
3952 if $test X"$prefix" != X"$installprefix"; then
3953 eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`"
3955 eval "install${prefixvar}=\"\$${prefixvar}exp\""
3958 chmod +x installprefix
3959 $eunicefix installprefix
3961 : Set variables such as privlib and privlibexp from the output of ./getfile
3962 : performing the prefixexp/installprefixexp correction if necessary.
3963 cat <<EOS >setprefixvar
3966 cat <<'EOSC' >>setprefixvar
3967 eval "${prefixvar}=\"\$ans\""
3968 eval "${prefixvar}exp=\"\$ansexp\""
3971 chmod +x setprefixvar
3972 $eunicefix setprefixvar
3974 : set up the script used to warn in case of inconsistency
3983 '') echo "The $hint value for \$$var on this machine was \"$was\"!" >&4
3985 *) echo "Hmm. Based on the hints in hints/$hintfile.sh, " >&4
3986 echo "the $hint value for \$$var on this machine was \"$was\"!" >&4
3991 echo "*** WHOA THERE!!! ***" >&4
3992 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
3995 rp=" Keep the $hint value?"
3998 y) td=$was; tu=$was;;
4002 : function used to set $1 to $val
4003 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
4005 $define$undef) . ./whoa; eval "$var=\$td";;
4006 $undef$define) . ./whoa; eval "$var=\$tu";;
4007 *) eval "$var=$val";;
4011 $define|true|[yY]*) dflt='y';;
4016 Perl can be built to use the SOCKS proxy protocol library. To do so,
4017 Configure must be run with -Dusesocks. If you use SOCKS you also need
4018 to use the PerlIO abstraction layer, this will be implicitly selected.
4020 If this doesn't make any sense to you, just accept the default '$dflt'.
4022 rp='Build Perl for SOCKS?'
4025 y|Y) val="$define" ;;
4032 $define|true|[yY]*) useperlio="$define";;
4035 case "$useperlio" in
4036 $define|true|[yY]*|'') dflt='y';;
4041 Previous version of $package used the standard IO mechanisms as
4042 defined in <stdio.h>. Versions 5.003_02 and later of $package allow
4043 alternate IO mechanisms via the PerlIO abstraction layer, but the
4044 stdio mechanism is still available if needed. The abstraction layer
4045 can use AT&T's sfio (if you already have sfio installed) or regular stdio.
4046 Using PerlIO with sfio may cause problems with some extension modules.
4048 If this doesn't make any sense to you, just accept the default '$dflt'.
4050 rp='Use the PerlIO abstraction layer?'
4057 echo "Ok, doing things the stdio way."
4066 case "$useperlio" in
4067 $define|true|[yY]*) ;;
4070 You are using the SOCKS proxy protocol library which means that you
4071 should also use the PerlIO layer. You may be headed for trouble.
4080 : get the patchlevel
4082 echo "Getting the current patchlevel..." >&4
4083 if $test -r $rsrc/patchlevel.h;then
4084 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
4085 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
4086 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4087 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
4088 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
4089 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4090 perl_patchlevel=`egrep ',"(MAINT|SMOKE)[0-9][0-9]*"' $rsrc/patchlevel.h|tail -1|sed 's/[^0-9]//g'`
4099 $echo "(You do not have patchlevel.h. Eek.)"
4101 if $test -r $rsrc/.patch ; then
4102 if $test "X$perl_patchlevel" = "X" || $test "`cat $rsrc/.patch`" -gt "$perl_patchlevel" ; then
4103 perl_patchlevel=`cat $rsrc/.patch`
4106 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
4107 version_patchlevel_string="version $patchlevel subversion $subversion"
4108 case "$perl_patchlevel" in
4110 *) version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel" ;;
4113 $echo "(You have $package $version_patchlevel_string.)"
4117 : XXX Should be a Configure test for double-dots in filenames.
4118 version=`echo $revision $patchlevel $subversion | \
4119 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4120 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4121 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4124 version=`echo $revision $patchlevel $subversion | \
4125 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4126 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4127 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4130 : Special case the 5.005_xx maintenance series, which used 5.005
4131 : without any subversion label as a subdirectory in $sitelib
4132 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
4133 api_versionstring='5.005'
4136 case "$usethreads" in
4137 $define|true|[yY]*) dflt='y';;
4138 *) # Catch case where user specified ithreads or 5005threads but
4139 # forgot -Dusethreads (A.D. 4/2002)
4140 case "$useithreads$use5005threads" in
4142 case "$useperlio" in
4143 "$define") dflt='y' ;;
4153 Perl can be built to take advantage of threads on some systems.
4154 To do so, Configure can be run with -Dusethreads.
4156 Note that Perl built with threading support runs slightly slower
4157 and uses more memory than plain Perl. The current implementation
4158 is believed to be stable, but it is fairly new, and so should be
4159 treated with caution.
4161 If this doesn't make any sense to you, just accept the default '$dflt'.
4163 rp='Build a threading Perl?'
4166 y|Y) val="$define" ;;
4172 if $test $patchlevel -lt 9; then
4173 case "$usethreads" in
4177 Since release 5.6, Perl has had two different threading implementations,
4178 the newer interpreter-based version (ithreads) with one interpreter per
4179 thread, and the older 5.005 version (5005threads).
4180 The 5005threads version is effectively unmaintained and will probably be
4181 removed in Perl 5.10, so there should be no need to build a Perl using it
4182 unless needed for backwards compatibility with some existing 5.005threads
4186 : Default to ithreads unless overridden on command line or with
4189 case "$use5005threads" in
4190 $define|true|[yY]*) dflt='n';;
4192 case "$useithreads" in
4193 $undef|false|[nN]*) dflt='n';;
4195 rp='Use the newer interpreter-based ithreads?'
4198 y|Y) val="$define" ;;
4203 : Now set use5005threads to the opposite value.
4204 case "$useithreads" in
4205 $define) val="$undef" ;;
4212 useithreads="$undef"
4213 use5005threads="$undef"
4217 case "$useithreads$use5005threads" in
4221 You cannot have both the ithreads and the 5.005 threads enabled
4222 at the same time. Disabling the 5.005 threads since they are
4223 much less stable than the ithreads.
4226 use5005threads="$undef"
4231 : perl-5.9.x and later
4233 if test X"$usethreads" = "X$define"; then
4234 case "$use5005threads" in
4238 5.005 threads has been removed for 5.10. Perl will be built using ithreads.
4245 use5005threads="$undef"
4246 useithreads="$usethreads"
4249 if test X"$usethreads" = "X$define" -a "X$useperlio" = "Xundef"; then
4252 *** To build with ithreads you must also use the PerlIO layer.
4253 *** Cannot continue, aborting.
4259 case "$d_oldpthreads" in
4260 '') : Configure tests would be welcome here. For now, assume undef.
4262 *) val="$d_oldpthreads" ;;
4268 : Look for a hint-file generated 'call-back-unit'. If the
4269 : user has specified that a threading perl is to be built,
4270 : we may need to set or change some other defaults.
4271 if $test -f usethreads.cbu; then
4272 echo "Your platform has some specific hints regarding threaded builds, using them..."
4275 case "$usethreads" in
4276 "$define"|true|[yY]*)
4278 (Your platform does not have any specific hints for threaded builds.
4279 Assuming POSIX threads, then.)
4287 Perl can be built so that multiple Perl interpreters can coexist
4288 within the same Perl executable.
4291 case "$useithreads" in
4294 This multiple interpreter support is required for interpreter-based threads.
4298 *) case "$usemultiplicity" in
4299 $define|true|[yY]*) dflt='y';;
4303 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
4304 rp='Build Perl for multiplicity?'
4307 y|Y) val="$define" ;;
4316 case "$usemorebits" in
4317 "$define"|true|[yY]*)
4318 use64bitint="$define"
4319 uselongdouble="$define"
4320 usemorebits="$define"
4322 *) usemorebits="$undef"
4326 : make some quick guesses about what we are up against
4328 $echo $n "Hmm... $c"
4338 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
4339 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
4341 echo "Looks kind of like an OSF/1 system, but we'll see..."
4343 elif test `echo abc | $tr a-z A-Z` = Abc ; then
4344 xxx=`./loc addbib blurfl $pth`
4345 if $test -f $xxx; then
4346 echo "Looks kind of like a USG system with BSD features, but we'll see..."
4350 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
4351 echo "Looks kind of like an extended USG system, but we'll see..."
4353 echo "Looks kind of like a USG system, but we'll see..."
4357 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
4358 echo "Looks kind of like a BSD system, but we'll see..."
4362 echo "Looks kind of like a Version 7 system, but we'll see..."
4365 case "$eunicefix" in
4368 There is, however, a strange, musty smell in the air that reminds me of
4369 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
4373 : it so happens the Eunice I know will not run shell scripts in Unix format
4377 echo "Congratulations. You aren't running Eunice."
4381 : Detect OS2. The p_ variable is set above in the Head.U unit.
4382 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
4383 : semicolon as a patch separator
4388 I have the feeling something is not exactly right, however...don't tell me...
4389 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
4390 (Or you may be running DOS with DJGPP.)
4395 if test -f /xenix; then
4396 echo "Actually, this looks more like a XENIX system..."
4401 echo "It's not Xenix..."
4406 if test -f /venix; then
4407 echo "Actually, this looks more like a VENIX system..."
4414 echo "Nor is it Venix..."
4417 chmod +x bsd usg v7 osf1 eunice xenix venix os2
4418 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
4425 rp="Use which C compiler?"
4429 : See if they have not cc but they do have gcc
4431 : Look for a hint-file generated 'call-back-unit'. Now that the
4432 : user has specified the compiler, we may need to set or change some
4434 if $test -f cc.cbu; then
4440 echo "Checking for GNU cc in disguise and/or its version number..." >&4
4444 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
4446 printf("%s\n", __VERSION__);
4448 printf("%s\n", "1");
4454 if $cc -o try $ccflags $ldflags try.c; then
4455 gccversion=`$run ./try`
4456 case "$gccversion" in
4457 '') echo "You are not using GNU cc." ;;
4458 *) echo "You are using GNU cc $gccversion."
4464 echo "*** WHOA THERE!!! ***" >&4
4465 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
4466 case "$knowitall" in
4468 echo " You'd better start hunting for one and let me know about it." >&4
4474 case "$gccversion" in
4475 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
4477 case "$gccversion" in
4478 '') gccosandvers='' ;;
4479 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
4480 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
4482 case "$gccosandvers" in
4483 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
4484 $osname$osvers) ;; # looking good
4485 $osname*) cat <<EOM >&4
4487 *** WHOA THERE!!! ***
4489 Your gcc has not been compiled for the exact release of
4490 your operating system ($gccosandvers versus $osname$osvers).
4492 In general it is a good idea to keep gcc synchronized with
4493 the operating system because otherwise serious problems
4494 may ensue when trying to compile software, like Perl.
4496 I'm trying to be optimistic here, though, and will continue.
4497 If later during the configuration and build icky compilation
4498 problems appear (headerfile conflicts being the most common
4499 manifestation), I suggest reinstalling the gcc to match
4500 your operating system release.
4504 *) gccosandvers='' ;; # failed to parse, better be silent
4512 # gcc 3.* complain about adding -Idirectories that they already know about,
4513 # so we will take those off from locincpth.
4514 case "$gccversion" in
4516 echo "main(){}">try.c
4517 for incdir in $locincpth; do
4518 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
4519 grep '^c[cp]p*[01]: warning: changing search order '`
4520 if test "X$warn" != X; then
4521 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
4527 : What should the include directory be ?
4529 $echo $n "Hmm... $c"
4533 if $test -f /bin/mips && /bin/mips; then
4534 echo "Looks like a MIPS system..."
4535 $cat >usr.c <<'EOCP'
4536 #ifdef SYSTYPE_BSD43
4540 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4541 dflt='/bsd43/usr/include'
4545 mips_type='System V'
4547 $rm -f usr.c usr.out
4548 echo "and you're compiling with the $mips_type compiler and libraries."
4552 echo "Doesn't look like a MIPS system."
4562 case "$xxx_prompt" in
4565 rp='Where are the include files you want to use?'
4573 : see how we invoke the C preprocessor
4575 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4576 cat <<'EOT' >testcpp.c
4582 if test ! -f cppstdin; then
4583 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4584 # AIX cc -E doesn't show the absolute headerfile
4585 # locations but we'll cheat by using the -M flag.
4586 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
4588 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4591 echo "Keeping your $hint cppstdin wrapper."
4594 wrapper=`pwd`/cppstdin
4598 if $test "X$cppstdin" != "X" && \
4599 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4600 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4602 echo "You used to use $cppstdin $cppminus so we'll use that again."
4604 '') echo "But let's see if we can live without a wrapper..." ;;
4606 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4607 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4609 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4612 echo "(However, $cpprun $cpplast does not work, let's see...)"
4620 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4627 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4628 $cc -E <testcpp.c >testcpp.out 2>&1; \
4629 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4630 echo "Yup, it does."
4633 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4634 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4635 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4636 echo "Yup, it does."
4639 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4640 $cc -P <testcpp.c >testcpp.out 2>&1; \
4641 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4642 echo "Yipee, that works!"
4645 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4646 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4647 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4648 echo "At long last!"
4651 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4652 $cpp <testcpp.c >testcpp.out 2>&1; \
4653 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4657 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4658 $cpp - <testcpp.c >testcpp.out 2>&1; \
4659 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4660 echo "Hooray, it works! I was beginning to wonder."
4663 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4664 $wrapper <testcpp.c >testcpp.out 2>&1; \
4665 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4671 rp="No dice. I can't find a C preprocessor. Name one:"
4675 $x_cpp <testcpp.c >testcpp.out 2>&1
4676 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4677 echo "OK, that will do." >&4
4679 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4694 echo "Perhaps can we force $cc -E using a wrapper..."
4695 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4696 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4702 echo "Nope, we'll have to live without it..."
4716 "$wrapper"|'cppstdin') ;;
4717 *) $rm -f $wrapper;;
4719 $rm -f testcpp.c testcpp.out
4721 : Set private lib path
4724 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4729 '') dlist="$loclibpth $plibpth $glibpth";;
4730 *) dlist="$libpth";;
4733 : Now check and see which directories actually exist, avoiding duplicates
4737 if $test -d $xxx; then
4740 *) libpth="$libpth $xxx";;
4746 Some systems have incompatible or broken versions of libraries. Among
4747 the directories listed in the question below, please remove any you
4748 know not to be holding relevant libraries, and add any that are needed.
4749 Say "none" for none.
4760 rp="Directories to use for library searches?"
4767 : compute shared library extension
4770 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4780 On some systems, shared libraries may be available. Answer 'none' if
4781 you want to suppress searching of shared libraries for the remainder
4782 of this configuration.
4785 rp='What is the file extension used for shared libraries?'
4789 : Define several unixisms.
4790 : Hints files or command line option can be used to override them.
4791 : The convoluted testing is in case hints files set either the old
4794 '') case "$exe_ext" in
4796 *) _exe="$exe_ext" ;;
4801 '') case "$lib_ext" in
4808 '') case "$obj_ext" in
4815 '') case "$path_sep" in
4826 rm_try="$rm -f try try$_exe a.out .out try.[cho] try.$_o core core.try* try.core*"
4828 : Which makefile gets called first. This is used by make depend.
4829 case "$firstmakefile" in
4830 '') firstmakefile='makefile';;
4834 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
4837 case "$uselongdouble" in
4838 $define|true|[yY]*) dflt='y';;
4843 Perl can be built to take advantage of long doubles which
4844 (if available) may give more accuracy and range for floating point numbers.
4846 If this doesn't make any sense to you, just accept the default '$dflt'.
4848 rp='Try to use long doubles if available?'
4851 y|Y) val="$define" ;;
4857 case "$uselongdouble" in
4858 true|[yY]*) uselongdouble="$define" ;;
4861 : Look for a hint-file generated 'call-back-unit'. If the
4862 : user has specified that long doubles should be used,
4863 : we may need to set or change some other defaults.
4864 if $test -f uselongdouble.cbu; then
4865 echo "Your platform has some specific hints regarding long doubles, using them..."
4866 . ./uselongdouble.cbu
4868 case "$uselongdouble" in
4871 (Your platform does not have any specific hints for long doubles.)
4877 : Looking for optional libraries
4879 echo "Checking for optional libraries..." >&4
4884 case "$libswanted" in
4885 '') libswanted='c_s';;
4888 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
4894 for thisdir in $libpth $xlibpth; do
4895 test -d $thisdir && libspath="$libspath $thisdir"
4897 for thislib in $libswanted; do
4898 for thisdir in $libspath; do
4900 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4901 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
4902 $test -f "$xxx" && eval $libscheck
4903 $test -f "$xxx" && libstyle=shared
4905 if test ! -f "$xxx"; then
4906 xxx=$thisdir/lib$thislib.$so
4907 $test -f "$xxx" && eval $libscheck
4908 $test -f "$xxx" && libstyle=shared
4910 if test ! -f "$xxx"; then
4911 xxx=$thisdir/lib$thislib$_a
4912 $test -f "$xxx" && eval $libscheck
4913 $test -f "$xxx" && libstyle=static
4915 if test ! -f "$xxx"; then
4916 xxx=$thisdir/$thislib$_a
4917 $test -f "$xxx" && eval $libscheck
4918 $test -f "$xxx" && libstyle=static
4920 if test ! -f "$xxx"; then
4921 xxx=$thisdir/lib${thislib}_s$_a
4922 $test -f "$xxx" && eval $libscheck
4923 $test -f "$xxx" && libstyle=static
4924 $test -f "$xxx" && thislib=${thislib}_s
4926 if test ! -f "$xxx"; then
4927 xxx=$thisdir/Slib$thislib$_a
4928 $test -f "$xxx" && eval $libscheck
4929 $test -f "$xxx" && libstyle=static
4931 if $test -f "$xxx"; then
4933 shared) echo "Found -l$thislib (shared)." ;;
4934 static) echo "Found -l$thislib." ;;
4935 *) echo "Found -l$thislib ($libstyle)." ;;
4939 *) dflt="$dflt -l$thislib"
4940 libsfound="$libsfound $xxx"
4942 libsfiles="$libsfiles $yyy"
4943 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
4944 case " $libsdirs " in
4946 *) libsdirs="$libsdirs $yyy" ;;
4953 if $test ! -f "$xxx"; then
4954 echo "No -l$thislib."
4965 ' '|'') dflt='none';;
4970 In order to compile $package on your machine, a number of libraries
4971 are usually needed. Include any other special libraries here as well.
4972 Say "none" for none. The default list is almost always right.
4976 rp="What libraries to use?"
4983 : determine optimization, if desired, or use for debug flag also
4985 ' '|$undef) dflt='none';;
4987 *) dflt="$optimize";;
4991 By default, $package compiles with the -O flag to use the optimizer.
4992 Alternately, you might want to use the symbolic debugger, which uses
4993 the -g flag (on traditional Unix systems). Either flag can be
4994 specified here. To use neither flag, specify the word "none".
4997 rp="What optimizer/debugger flag should be used?"
5001 'none') optimize=" ";;
5004 : Check what DEBUGGING is required from the command line
5005 : -DEBUGGING or -DDEBUGGING or
5006 : -DEBUGGING=both = -g + -DDEBUGGING
5007 : -DEBUGGING=-g or -Doptimize=-g = -g
5008 : -DEBUGGING=none or -UDEBUGGING =
5009 : -DEBUGGING=old or -DEBUGGING=default = ? $optimize
5012 *) DEBUGGING=$EBUGGING ;;
5015 case "$DEBUGGING" in
5019 *) optimize="$optimize -g" ;;
5023 *-g*) set `echo "X $optimize " | sed 's/ -g / /'`
5031 case "$DEBUGGING" in
5032 both|$define) dflt='-DDEBUGGING'
5035 : We will not override a previous value, but we might want to
5036 : augment a hint file
5038 default|recommended)
5039 case "$gccversion" in
5040 1*) dflt="$dflt -fpcc-struct-return" ;;
5042 case "$optimize:$DEBUGGING" in
5043 *-g*:old) dflt="$dflt -DDEBUGGING";;
5045 case "$gccversion" in
5046 2*) if test -d /etc/conf/kconfig.d &&
5047 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
5049 # Interactive Systems (ISC) POSIX mode.
5054 case "$gccversion" in
5058 echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
5059 echo 'int main(void) { return 0; }' > gcctest.c
5060 if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
5061 echo "Yes, it does." 2>&1
5064 echo "Leaving current flags $ccflags alone." 2>&1
5066 *) dflt="$dflt -fno-strict-aliasing" ;;
5069 echo "Nope, it doesn't, but that's ok." 2>&1
5073 # For gcc, adding -pipe speeds up compilations for some, but apparently
5074 # some assemblers can't read from stdin. (It also slows down compilations
5075 # in other cases, but those are apparently rarer these days.) AD 5/2004.
5076 case "$gccversion" in
5078 echo "Checking if your compiler accepts -pipe" 2>&1
5079 echo 'int main(void) { return 0; }' > gcctest.c
5080 if $cc -pipe -o gcctest gcctest.c; then
5081 echo "Yes, it does." 2>&1
5084 echo "Leaving current flags $ccflags alone." 2>&1
5086 *) dflt="$dflt -pipe" ;;
5089 echo "Nope, it doesn't, but that's ok." 2>&1
5096 case "$mips_type" in
5097 *BSD*|'') inclwanted="$locincpth $usrinc";;
5098 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
5100 for thisincl in $inclwanted; do
5101 if $test -d $thisincl; then
5102 if $test x$thisincl != x$usrinc; then
5104 *" -I$thisincl "*);;
5105 *) dflt="$dflt -I$thisincl ";;
5111 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
5113 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
5121 *) dflt="$dflt -D$2";;
5125 set signal.h LANGUAGE_C; eval $inctest
5129 ccflags="$ccflags -DSOCKS"
5134 default|recommended) dflt="$ccflags $dflt" ;;
5135 *) dflt="$ccflags";;
5144 Your C compiler may want other flags. For this question you should include
5145 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
5146 but you should NOT include libraries or ld flags like -lwhatever. If you
5147 want $package to honor its debug switch, you should include -DDEBUGGING here.
5148 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
5150 To use no flags, specify the word "none".
5156 rp="Any additional cc flags?"
5163 : the following weeds options from ccflags that are of no interest to cpp
5165 '') cppflags="$ccflags" ;;
5166 *) cppflags="$cppflags $ccflags" ;;
5168 case "$gccversion" in
5169 1*) cppflags="$cppflags -D__GNUC__"
5171 case "$mips_type" in
5173 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
5179 echo "Let me guess what the preprocessor flags are..." >&4
5193 *) ftry="$previous $flag";;
5195 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
5196 >cpp1.out 2>/dev/null && \
5197 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
5198 >cpp2.out 2>/dev/null && \
5199 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
5200 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
5202 cppflags="$cppflags $ftry"
5212 *-*) echo "They appear to be: $cppflags";;
5214 $rm -f cpp.c cpp?.out
5218 : flags used in final linking phase
5220 '') if ./venix; then
5226 *-posix*) dflt="$dflt -posix" ;;
5229 *) dflt="$ldflags";;
5232 : Try to guess additional flags to pick up local libraries.
5233 for thislibdir in $libpth; do
5234 case " $loclibpth " in
5237 *"-L$thislibdir "*) ;;
5238 *) dflt="$dflt -L$thislibdir" ;;
5250 Your C linker may need flags. For this question you should
5251 include -L/whatever and any other flags used by the C linker, but you
5252 should NOT include libraries like -lwhatever.
5254 Make sure you include the appropriate -L/path flags if your C linker
5255 does not normally search all of the directories you specified above,
5258 To use no flags, specify the word "none".
5262 rp="Any additional ld flags (NOT including libraries)?"
5268 rmlist="$rmlist pdp11"
5272 echo "Checking your choice of C compiler and flags for coherency..." >&4
5273 $cat > try.c <<'EOF'
5275 int main() { printf("Ok\n"); return(0); }
5277 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
5279 $cat >try.msg <<'EOM'
5280 I've tried to compile and run the following simple program:
5283 $cat try.c >> try.msg
5285 $cat >> try.msg <<EOM
5292 and I got the following output:
5296 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5297 if $sh -c "$run ./try" >>try.msg 2>&1; then
5301 *) echo 'The program compiled OK, but produced no output.' >> try.msg
5304 cat >> try.msg <<'EOQS'
5305 If $libs contains -lsfio, and sfio is mis-configured, then it
5306 sometimes (apparently) runs and exits with a 0 status, but with no
5307 output! It may have to do with sfio's use of _exit vs. exit.
5310 rp="You have a big problem. Shall I abort Configure"
5317 echo "The program compiled OK, but exited with status $?." >>try.msg
5318 rp="You have a problem. Shall I abort Configure"
5322 echo "I can't compile the test program." >>try.msg
5323 rp="You have a BIG problem. Shall I abort Configure"
5329 case "$knowitall" in
5331 echo "(The supplied flags or libraries might be incorrect.)"
5339 *) echo "Ok. Stopping Configure." >&4
5344 n) echo "OK, that should do.";;
5348 : define a shorthand compile call
5352 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5353 : define a shorthand compile call for compilations that should be ok.
5357 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5359 : determine filename position in cpp output
5361 echo "Computing filename position in cpp output for #include directives..." >&4
5363 vos) testaccess=-e ;;
5366 echo '#include <stdio.h>' > foo.c
5369 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5370 $grep '^[ ]*#.*stdio\.h' | \
5371 while read cline; do
5374 while $test \$# -gt 0; do
5375 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5380 pos=\`expr \$pos + 1\`
5392 *) pos="${fieldn}th";;
5394 echo "Your cpp writes the filename in the $pos field of the line."
5397 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
5398 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
5401 : locate header file
5406 for usrincdir in $usrinc
5408 if test -f \$usrincdir/\$wanted; then
5409 echo "\$usrincdir/\$wanted"
5413 awkprg='{ print \$$fieldn }'
5414 echo "#include <\$wanted>" > foo\$\$.c
5415 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5416 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5417 while read cline; do
5418 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5420 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5421 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5426 # status = 0: grep returned 0 lines, case statement not executed
5427 # status = 1: headerfile found
5428 # status = 2: while loop executed, no headerfile found
5432 if test \$status -eq 1; then
5439 : define an alternate in-header-list? function
5440 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5441 cont=true; xxf="echo \"<\$1> found.\" >&4";
5442 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5443 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5445 case $# in 4) instead=instead;; *) instead="at last";; esac;
5446 while $test "$cont"; do
5448 var=$2; eval "was=\$$2";
5449 if $test "$xxx" && $test -r "$xxx";
5451 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5454 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5455 set $yyy; shift; shift; yyy=$@;
5456 case $# in 0) cont="";;
5457 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5458 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5459 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5460 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5464 do set $yyy; var=$2; eval "was=\$$2";
5465 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5466 set $yyy; shift; shift; yyy=$@;
5469 : see if stdlib is available
5470 set stdlib.h i_stdlib
5473 : check for lengths of integral types
5477 echo "Checking to see how big your integers are..." >&4
5486 printf("intsize=%d;\n", (int)sizeof(int));
5487 printf("longsize=%d;\n", (int)sizeof(long));
5488 printf("shortsize=%d;\n", (int)sizeof(short));
5493 if eval $compile_ok && $run ./try > /dev/null; then
5495 echo "Your integers are $intsize bytes long."
5496 echo "Your long integers are $longsize bytes long."
5497 echo "Your short integers are $shortsize bytes long."
5501 Help! I can't compile and run the intsize test program: please enlighten me!
5502 (This is probably a misconfiguration in your system or libraries, and
5503 you really ought to fix it. Still, I'll try anyway.)
5507 rp="What is the size of an integer (in bytes)?"
5511 rp="What is the size of a long integer (in bytes)?"
5515 rp="What is the size of a short integer (in bytes)?"
5523 : check for long long
5525 echo "Checking to see if you have long long..." >&4
5526 echo 'int main() { long long x = 7; return 0; }' > try.c
5528 if eval $compile; then
5530 echo "You have long long."
5533 echo "You do not have long long."
5539 : check for length of long long
5540 case "${d_longlong}${longlongsize}" in
5543 echo "Checking to see how big your long longs are..." >&4
5544 $cat >try.c <<'EOCP'
5548 printf("%d\n", (int)sizeof(long long));
5553 if eval $compile_ok; then
5554 longlongsize=`$run ./try`
5555 echo "Your long longs are $longlongsize bytes long."
5559 echo "(I can't seem to compile the test program. Guessing...)"
5560 rp="What is the size of a long long (in bytes)?"
5564 if $test "X$longsize" = "X$longlongsize"; then
5565 echo "(That isn't any different from an ordinary long.)"
5571 : see if inttypes.h is available
5572 : we want a real compile instead of Inhdr because some systems
5573 : have an inttypes.h which includes non-existent headers
5576 #include <inttypes.h>
5578 static int32_t foo32 = 0x12345678;
5582 if eval $compile; then
5583 echo "<inttypes.h> found." >&4
5586 echo "<inttypes.h> NOT found." >&4
5595 echo "Checking to see if you have int64_t..." >&4
5597 #include <sys/types.h>
5598 #$i_inttypes I_INTTYPES
5600 #include <inttypes.h>
5602 int main() { int64_t x = 7; }
5605 if eval $compile; then
5607 echo "You have int64_t."
5610 echo "You do not have int64_t."
5618 echo "Checking which 64-bit integer type we could use..." >&4
5624 val='"unsigned int"'
5629 *) case "$longsize" in
5633 val='"unsigned long"'
5638 *) case "$d_longlong:$longlongsize" in
5643 val='"unsigned long long"'
5648 *) case "$d_int64_t" in
5667 '') echo "Alas, no 64-bit integer types in sight." >&4
5670 *) echo "We could use '$quadtype' for 64-bit integers." >&4
5676 case "$uselonglong" in
5677 "$define"|true|[yY]*)
5680 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
5682 use64bitint="$define"
5685 case "$use64bits" in
5686 "$define"|true|[yY]*)
5689 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
5691 use64bitint="$define"
5694 case "$use64bitints" in
5695 "$define"|true|[yY]*)
5698 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
5700 use64bitint="$define"
5703 case "$use64bitsint" in
5704 "$define"|true|[yY]*)
5707 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
5709 use64bitint="$define"
5712 case "$uselonglongs" in
5713 "$define"|true|[yY]*)
5716 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
5718 use64bitint="$define"
5721 case "$use64bitsall" in
5722 "$define"|true|[yY]*)
5725 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
5727 use64bitall="$define"
5732 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
5734 case "$use64bitall" in
5735 "$define"|true|[yY]*) use64bitint="$define" ;;
5741 You have natively 64-bit long integers.
5745 *) case "$use64bitint" in
5746 "$define"|true|[yY]*) dflt='y';;
5755 Perl can be built to take advantage of 64-bit integer types
5756 on some systems. To do so, Configure can be run with -Duse64bitint.
5757 Choosing this option will most probably introduce binary incompatibilities.
5759 If this doesn't make any sense to you, just accept the default '$dflt'.
5760 (The default has been chosen based on your configuration.)
5762 rp='Try to use 64-bit integers, if available?'
5765 [yY]*) val="$define" ;;
5773 case "$use64bitall" in
5774 "$define"|true|[yY]*) dflt='y' ;;
5775 *) case "$longsize" in
5783 You may also choose to try maximal 64-bitness. It means using as much
5784 64-bitness as possible on the platform. This in turn means even more
5785 binary incompatibilities. On the other hand, your platform may not
5786 have any more 64-bitness available than what you already have chosen.
5788 If this doesn't make any sense to you, just accept the default '$dflt'.
5789 (The default has been chosen based on your configuration.)
5791 rp='Try to use maximal 64-bit support, if available?'
5794 [yY]*) val="$define" ;;
5799 case "$use64bitall" in
5801 case "$use64bitint" in
5805 Since you have chosen a maximally 64-bit build, I'm also turning on
5806 the use of 64-bit integers.
5808 use64bitint="$define" ;;
5813 : Look for a hint-file generated 'call-back-unit'. If the
5814 : user has specified that a 64-bit perl is to be built,
5815 : we may need to set or change some other defaults.
5816 if $test -f use64bitint.cbu; then
5817 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
5820 case "$use64bitint" in
5821 "$define"|true|[yY]*)
5823 4) case "$archname64" in
5824 '') archname64=64int ;;
5831 : Look for a hint-file generated 'call-back-unit'. If the
5832 : user has specified that a maximally 64-bit perl is to be built,
5833 : we may need to set or change some other defaults.
5834 if $test -f use64bitall.cbu; then
5835 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
5838 case "$use64bitall" in
5839 "$define"|true|[yY]*)
5841 4) case "$archname64" in
5842 ''|64int) archname64=64all ;;
5849 case "$d_quad:$use64bitint" in
5853 *** You have chosen to use 64-bit integers,
5854 *** but none can be found.
5855 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
5856 *** Cannot continue, aborting.
5863 : check for length of double
5865 case "$doublesize" in
5867 echo "Checking to see how big your double precision numbers are..." >&4
5876 printf("%d\n", (int)sizeof(double));
5881 if eval $compile_ok; then
5882 doublesize=`$run ./try`
5883 echo "Your double is $doublesize bytes long."
5886 echo "(I can't seem to compile the test program. Guessing...)"
5887 rp="What is the size of a double precision number (in bytes)?"
5895 : check for long doubles
5897 echo "Checking to see if you have long double..." >&4
5898 echo 'int main() { long double x = 7.0; }' > try.c
5900 if eval $compile; then
5902 echo "You have long double."
5905 echo "You do not have long double."
5911 : check for length of long double
5912 case "${d_longdbl}${longdblsize}" in
5915 echo "Checking to see how big your long doubles are..." >&4
5916 $cat >try.c <<'EOCP'
5920 printf("%d\n", sizeof(long double));
5925 if eval $compile; then
5926 longdblsize=`$run ./try`
5927 echo "Your long doubles are $longdblsize bytes long."
5931 echo "(I can't seem to compile the test program. Guessing...)" >&4
5932 rp="What is the size of a long double (in bytes)?"
5936 if $test "X$doublesize" = "X$longdblsize"; then
5937 echo "That isn't any different from an ordinary double."
5938 echo "I'll keep your setting anyway, but you may see some"
5939 echo "harmless compilation warnings."
5945 : determine the architecture name
5947 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
5948 tarch=`arch`"-$osname"
5949 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
5950 if uname -m > tmparch 2>&1 ; then
5951 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
5952 -e 's/$/'"-$osname/" tmparch`
5960 case "$myarchname" in
5963 echo "(Your architecture name used to be $myarchname.)"
5967 case "$targetarch" in
5969 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
5974 *) dflt="$archname";;
5976 rp='What is your architecture name'
5979 case "$usethreads" in
5981 echo "Threads selected." >&4
5983 *-thread*) echo "...and architecture name already has -thread." >&4
5985 *) archname="$archname-thread"
5986 echo "...setting architecture name to $archname." >&4
5991 case "$usemultiplicity" in
5993 echo "Multiplicity selected." >&4
5995 *-multi*) echo "...and architecture name already has -multi." >&4
5997 *) archname="$archname-multi"
5998 echo "...setting architecture name to $archname." >&4
6003 case "$use64bitint$use64bitall" in
6005 case "$archname64" in
6007 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
6010 case "$use64bitint" in
6011 "$define") echo "64 bit integers selected." >&4 ;;
6013 case "$use64bitall" in
6014 "$define") echo "Maximal 64 bitness selected." >&4 ;;
6017 *-$archname64*) echo "...and architecture name already has $archname64." >&4
6019 *) archname="$archname-$archname64"
6020 echo "...setting architecture name to $archname." >&4
6026 case "$uselongdouble" in
6028 echo "Long doubles selected." >&4
6029 case "$longdblsize" in
6031 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
6035 *-ld*) echo "...and architecture name already has -ld." >&4
6037 *) archname="$archname-ld"
6038 echo "...setting architecture name to $archname." >&4
6045 case "$useperlio" in
6047 echo "Perlio selected." >&4
6050 echo "Perlio not selected, using stdio." >&4
6052 *-stdio*) echo "...and architecture name already has -stdio." >&4
6054 *) archname="$archname-stdio"
6055 echo "...setting architecture name to $archname." >&4
6060 if $test -f archname.cbu; then
6061 echo "Your platform has some specific hints for architecture name, using them..."
6065 : set the prefixit variable, to compute a suitable default value
6066 prefixit='case "$3" in
6068 case "$oldprefix" in
6069 "") eval "$1=\"\$$2\"";;
6076 ""|" ") eval "$1=\"\$$2\"";;
6082 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
6084 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
6085 /*-$oldprefix/*|\~*-$oldprefix/*)
6086 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
6087 *) eval "$1=\"\$$2\"";;
6091 : determine installation style
6092 : For now, try to deduce it from prefix unless it is already set.
6093 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
6094 case "$installstyle" in
6095 '') case "$prefix" in
6096 *perl*) dflt='lib';;
6097 *) dflt='lib/perl5' ;;
6100 *) dflt="$installstyle" ;;
6102 : Probably not worth prompting for this since we prompt for all
6103 : the directories individually, and the prompt would be too long and
6107 : determine where public executables go
6112 rp='Pathname where the public executables will reside?'
6114 if $test "X$ansexp" != "X$binexp"; then
6118 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
6119 : XXX If this is fixed, also fix the "start perl" hunk below, which relies on
6120 : this via initialinstalllocation
6123 case "$userelocatableinc" in
6124 $define|true|[yY]*) dflt='y' ;;
6129 Would you like to build Perl so that the installation is relocatable, so that
6130 library paths in @INC are determined relative to the path of the perl binary?
6131 This is not advised for system Perl installs, or if you need to run setid
6132 scripts or scripts under taint mode.
6134 If this doesn't make any sense to you, just accept the default '$dflt'.
6136 rp='Use relocatable @INC?'
6139 y|Y) val="$define" ;;
6142 set userelocatableinc
6145 initialinstalllocation="$binexp"
6146 : Default prefix is now "up one level from where the binaries are"
6147 case "$userelocatableinc" in
6153 installprefixexp=".../.."
6157 : determine where private library files go
6158 : Usual default is /usr/local/lib/perl5/$version.
6159 : Also allow things like /opt/perl/lib/$version, since
6160 : /opt/perl/lib/perl5... would be redundant.
6161 : The default "style" setting is made in installstyle.U
6162 case "$installstyle" in
6163 *lib/perl5*) set dflt privlib lib/$package/$version ;;
6164 *) set dflt privlib lib/$version ;;
6169 There are some auxiliary files for $package that need to be put into a
6170 private library directory that is accessible by everyone.
6175 rp='Pathname where the private library files will reside?'
6180 : set the prefixup variable, to restore leading tilda escape
6181 prefixup='case "$prefixexp" in
6183 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
6186 : determine where public architecture dependent libraries go
6189 : privlib default is /usr/local/lib/$package/$version
6190 : archlib default is /usr/local/lib/$package/$version/$archname
6191 : privlib may have an optional trailing /share.
6192 tdflt=`echo $privlib | $sed 's,/share$,,'`
6193 tdflt=$tdflt/$archname
6202 $spackage contains architecture-dependent library files. If you are
6203 sharing libraries in a heterogeneous environment, you might store
6204 these files in a separate location. Otherwise, you can just include
6205 them with the rest of the public library files.
6210 rp='Where do you want to put the public architecture-dependent libraries?'
6214 if $test X"$archlib" = X"$privlib"; then
6220 : see if setuid scripts can be secure
6223 Some kernels have a bug that prevents setuid #! scripts from being
6224 secure. Some sites have disabled setuid #! scripts because of this.
6226 First let's decide if your kernel supports secure setuid #! scripts.
6227 (If setuid #! scripts would be secure but have been disabled anyway,
6228 don't say that they are secure if asked.)
6233 if $test -d /dev/fd; then
6234 echo "#!$ls" >reflect
6235 chmod +x,u+s reflect
6236 ./reflect >flect 2>&1
6237 if $contains "/dev/fd" flect >/dev/null; then
6238 echo "Congratulations, your kernel has secure setuid scripts!" >&4
6242 If you are not sure if they are secure, I can check but I'll need a
6243 username and password different from the one you are using right now.
6244 If you don't have such a username or don't want me to test, simply
6248 rp='Other username to test security of setuid scripts with?'
6253 case "$d_suidsafe" in
6254 '') echo "I'll assume setuid scripts are *not* secure." >&4
6257 echo "Well, the $hint value is *not* secure." >&4
6259 *) echo "Well, the $hint value *is* secure." >&4
6264 $rm -f reflect flect
6265 echo "#!$ls" >reflect
6266 chmod +x,u+s reflect
6269 echo '"su" will (probably) prompt you for '"$ans's password."
6270 su $ans -c './reflect >flect'
6271 if $contains "/dev/fd" flect >/dev/null; then
6272 echo "Okay, it looks like setuid scripts are secure." >&4
6275 echo "I don't think setuid scripts are secure." >&4
6280 rp='Does your kernel have *secure* setuid scripts?'
6283 [yY]*) val="$define";;
6288 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
6289 echo "(That's for file descriptors, not floppy disks.)"
6295 $rm -f reflect flect
6297 : now see if they want to do setuid emulation
6300 case "$d_suidsafe" in
6303 echo "No need to emulate SUID scripts since they are secure here." >&4
6307 Some systems have disabled setuid scripts, especially systems where
6308 setuid scripts cannot be secure. On systems where setuid scripts have
6309 been disabled, the setuid/setgid bits on scripts are currently
6310 useless. It is possible for $package to detect those bits and emulate
6311 setuid/setgid in a secure fashion. This emulation will only work if
6312 setuid scripts have been disabled in your kernel.
6316 "$define") dflt=y ;;
6319 rp="Do you want to do setuid/setgid emulation?"
6322 [yY]*) val="$define";;
6330 : Find perl5.005 or later.
6331 echo "Looking for a previously installed perl5.005 or later... "
6333 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
6334 : Check if this perl is recent and can load a simple module
6335 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6338 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6348 '') echo "None found. That's ok.";;
6349 *) echo "Using $perl5." ;;
6354 After $package is installed, you may wish to install various
6355 add-on modules and utilities. Typically, these add-ons will
6356 be installed under $prefix with the rest
6357 of this package. However, you may wish to install such add-ons
6358 elsewhere under a different prefix.
6360 If you do not wish to put everything under a single prefix, that's
6361 ok. You will be prompted for the individual locations; this siteprefix
6362 is only used to suggest the defaults.
6364 The default should be fine for most people.
6368 rp='Installation prefix to use for add-on modules and utilities?'
6369 : XXX Here might be another good place for an installstyle setting.
6370 case "$siteprefix" in
6372 *) dflt=$siteprefix ;;
6375 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6377 case "$siteprefix" in
6381 *) oldsiteprefix="$prefix";;
6386 siteprefixexp="$ansexp"
6388 : determine where site specific libraries go.
6389 : Usual default is /usr/local/lib/perl5/site_perl/$version
6390 : The default "style" setting is made in installstyle.U
6391 : XXX No longer works with Prefixit stuff.
6392 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6394 '') case "$installstyle" in
6395 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
6396 *) dflt=$siteprefix/lib/site_$prog/$version ;;
6404 The installation process will create a directory for
6405 site-specific extensions and modules. Most users find it convenient
6406 to place all site-specific files in this directory rather than in the
6407 main distribution directory.
6411 rp='Pathname for the site-specific library files?'
6415 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6417 : Determine list of previous versions to include in @INC
6418 $cat > getverlist <<EOPL
6421 \$api_versionstring = "$api_versionstring";
6422 \$version = "$version";
6423 \$stem = "$sitelib_stem";
6424 \$archname = "$archname";
6426 $cat >> getverlist <<'EOPL'
6427 # The list found is store twice for each entry: the original name, and
6428 # the binary broken down version as pack "sss", so sorting is easy and
6429 # unambiguous. This will work for all versions that have a maximum of
6430 # three digit groups, separate by '.'s or '_'s. Names are extended with
6431 # ".0.0" to ensure at least three elements for the pack.
6432 # -- H.Merijn Brand (m)'06 23-10-2006
6434 # Can't have leading @ because metaconfig interprets it as a command!
6435 ;@inc_version_list=();
6436 # XXX Redo to do opendir/readdir?
6439 ;@candidates = map {
6440 [ $_, pack "sss", split m/[._]/, "$_.0.0" ] } glob("5.*");
6446 ($pversion, $aversion, $vsn5005) = map {
6447 pack "sss", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005";
6448 foreach $d (@candidates) {
6449 if ($d->[1] lt $pversion) {
6450 if ($d->[1] ge $aversion) {
6451 unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]);
6453 elsif ($d->[1] ge $vsn5005) {
6454 unshift(@inc_version_list, grep { -d } $d->[0]);
6458 # Skip newer version. I.e. don't look in
6459 # 5.7.0 if we're installing 5.6.1.
6463 if (@inc_version_list) {
6464 print join(' ', @inc_version_list);
6467 # Blank space to preserve value for next Configure run.
6472 case "$inc_version_list" in
6473 '') if test -x "$perl5$exe_ext"; then
6474 dflt=`$perl5 getverlist`
6479 $undef) dflt='none' ;;
6480 *) eval dflt=\"$inc_version_list\" ;;
6483 ''|' ') dflt=none ;;
6490 In order to ease the process of upgrading, this version of perl
6491 can be configured to use modules built and installed with earlier
6492 versions of perl that were installed under $prefix. Specify here
6493 the list of earlier versions that this version of perl should check.
6494 If Configure detected no earlier versions of perl installed under
6495 $prefix, then the list will be empty. Answer 'none' to tell perl
6496 to not search earlier versions.
6498 The default should almost always be sensible, so if you're not sure,
6499 just accept the default.
6502 rp='List of earlier versions to include in @INC?'
6505 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
6506 *) inc_version_list="$ans" ;;
6508 case "$inc_version_list" in
6510 inc_version_list_init='0'
6511 d_inc_version_list="$undef"
6513 *) inc_version_list_init=`echo $inc_version_list |
6514 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
6515 d_inc_version_list="$define"
6520 : see if this is a malloc.h system
6521 : we want a real compile instead of Inhdr because some systems have a
6522 : malloc.h that just gives a compile error saying to use stdlib.h instead
6527 int main () { return 0; }
6530 if eval $compile; then
6531 echo "<malloc.h> found." >&4
6534 echo "<malloc.h> NOT found." >&4
6541 : check for void type
6543 echo "Checking to see how well your C compiler groks the void type..." >&4
6544 case "$voidflags" in
6556 extern void moo(); /* function returning void */
6557 void (*goo)(); /* ptr to func returning void */
6559 void *hue; /* generic ptr */
6572 int main() { sub(); }
6574 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
6575 voidflags=$defvoidused
6576 echo "Good. It appears to support void to the level $package wants.">&4
6577 if $contains warning .out >/dev/null 2>&1; then
6578 echo "However, you might get some warnings that look like this:"
6582 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
6583 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
6584 echo "It supports 1..."
6585 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
6586 echo "It also supports 2..."
6587 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
6589 echo "And it supports 4 but not 8 definitely."
6591 echo "It doesn't support 4..."
6592 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
6594 echo "But it supports 8."
6597 echo "Neither does it support 8."
6601 echo "It does not support 2..."
6602 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
6604 echo "But it supports 4 and 8."
6606 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
6608 echo "And it supports 4 but has not heard about 8."
6610 echo "However it supports 8 but not 4."
6615 echo "There is no support at all for void."
6620 case "$voidflags" in
6623 Support flag bits are:
6624 1: basic void declarations.
6625 2: arrays of pointers to functions returning void.
6626 4: operations between pointers to and addresses of void functions.
6627 8: generic void pointers.
6630 rp="Your void support flags add up to what?"
6637 : check for length of pointer
6641 echo "Checking to see how big your pointers are..." >&4
6642 if test "$voidflags" -gt 7; then
6643 echo '#define VOID_PTR char *' > try.c
6645 echo '#define VOID_PTR void *' > try.c
6655 printf("%d\n", (int)sizeof(VOID_PTR));
6660 if eval $compile_ok; then
6661 ptrsize=`$run ./try`
6662 echo "Your pointers are $ptrsize bytes long."
6665 echo "(I can't seem to compile the test program. Guessing...)" >&4
6666 rp="What is the size of a pointer (in bytes)?"
6673 case "$use64bitall" in
6674 "$define"|true|[yY]*)
6678 *** You have chosen a maximally 64-bit build,
6679 *** but your pointers are only 4 bytes wide.
6680 *** Please rerun Configure without -Duse64bitall.
6685 *** Since you have quads, you could possibly try with -Duse64bitint.
6690 *** Cannot continue, aborting.
6701 : determine whether to use malloc wrapping
6703 case "$usemallocwrap" in
6704 [yY]*|true|$define) dflt='y' ;;
6705 [nN]*|false|$undef) dflt='n' ;;
6706 *) case "$usedevel" in
6707 [yY]*|true|$define) dflt='y' ;;
6712 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
6714 usemallocwrap="$ans"
6717 usemallocwrap="$define" ;;
6719 usemallocwrap="$undef" ;;
6722 : determine which malloc to compile in
6724 case "$usemymalloc" in
6725 [yY]*|true|$define) dflt='y' ;;
6726 [nN]*|false|$undef) dflt='n' ;;
6727 *) case "$ptrsize" in
6733 rp="Do you wish to attempt to use the malloc that comes with $package?"
6739 mallocsrc='malloc.c'
6740 mallocobj="malloc$_o"
6741 d_mymalloc="$define"
6744 : Remove malloc from list of libraries to use
6745 echo "Removing unneeded -lmalloc from library list" >&4
6746 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
6749 echo "libs = $libs" >&4
6761 : compute the return types of malloc and free
6763 $cat >malloc.c <<END
6767 #include <sys/types.h>
6781 case "$malloctype" in
6783 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
6790 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
6794 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
6801 echo "Your system uses $freetype free(), it would seem." >&4
6803 : determine where site specific architecture-dependent libraries go.
6804 : sitelib default is /usr/local/lib/perl5/site_perl/$version
6805 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6806 : sitelib may have an optional trailing /share.
6808 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
6809 dflt="$dflt/$archname"
6814 set sitearch sitearch none
6818 The installation process will also create a directory for
6819 architecture-dependent site-specific extensions and modules.
6823 rp='Pathname for the site-specific architecture-dependent library files?'
6827 if $test X"$sitearch" = X"$sitelib"; then
6830 d_sitearch="$define"
6835 The installation process will also create a directory for
6836 vendor-supplied add-ons. Vendors who supply perl with their system
6837 may find it convenient to place all vendor-supplied files in this
6838 directory rather than in the main distribution directory. This will
6839 ease upgrades between binary-compatible maintenance versions of perl.
6841 Of course you may also use these directories in whatever way you see
6842 fit. For example, you might use them to access modules shared over a
6843 company-wide network.
6845 The default answer should be fine for most people.
6846 This causes further questions about vendor add-ons to be skipped
6847 and no vendor-specific directories will be configured for perl.
6850 rp='Do you want to configure vendor-specific add-on directories?'
6851 case "$usevendorprefix" in
6852 define|true|[yY]*) dflt=y ;;
6853 *) : User may have set vendorprefix directly on Configure command line.
6854 case "$vendorprefix" in
6863 rp='Installation prefix to use for vendor-supplied add-ons?'
6864 case "$vendorprefix" in
6866 *) dflt=$vendorprefix ;;
6869 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6871 case "$vendorprefix" in
6875 *) oldvendorprefix="$prefix";;
6879 usevendorprefix="$define"
6881 vendorprefixexp="$ansexp"
6883 *) usevendorprefix="$undef"
6889 case "$vendorprefix" in
6890 '') d_vendorlib="$undef"
6894 *) d_vendorlib="$define"
6895 : determine where vendor-supplied modules go.
6896 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
6897 case "$vendorlib" in
6899 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6900 case "$installstyle" in
6901 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
6902 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
6905 *) dflt="$vendorlib"
6909 rp='Pathname for the vendor-supplied library files?'
6912 vendorlibexp="$ansexp"
6915 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
6919 case "$vendorprefix" in
6920 '') d_vendorarch="$undef"
6924 *) d_vendorarch="$define"
6925 : determine where vendor-supplied architecture-dependent libraries go.
6926 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
6927 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
6928 : vendorlib may have an optional trailing /share.
6929 case "$vendorarch" in
6930 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
6931 dflt="$dflt/$archname"
6933 *) dflt="$vendorarch" ;;
6936 rp='Pathname for vendor-supplied architecture-dependent files?'
6939 vendorarchexp="$ansexp"
6942 prefixvar=vendorarch
6945 : Final catch-all directories to search
6948 Lastly, you can have perl look in other directories for extensions and
6949 modules in addition to those already specified.
6950 These directories will be searched after
6954 test X"$vendorlib" != "X" && echo ' ' $vendorlib
6955 test X"$vendorarch" != "X" && echo ' ' $vendorarch
6957 case "$otherlibdirs" in
6958 ''|' ') dflt='none' ;;
6959 *) dflt="$otherlibdirs" ;;
6962 Enter a colon-separated set of extra paths to include in perl's @INC
6963 search path, or enter 'none' for no extra paths.
6967 rp='Colon-separated list of additional directories for perl to search?'
6970 ' '|''|none) otherlibdirs=' ' ;;
6971 *) otherlibdirs="$ans" ;;
6973 case "$otherlibdirs" in
6977 set d_perl_otherlibdirs
6980 : Cruising for prototypes
6982 echo "Checking out function prototypes..." >&4
6983 $cat >prototype.c <<EOCP
6988 int main(int argc, char *argv[]) {
6991 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
6992 echo "Your C compiler appears to support function prototypes."
6995 echo "Your C compiler doesn't seem to understand function prototypes."
7002 case "$prototype" in
7004 *) ansi2knr='ansi2knr'
7009 This version of $package can only be compiled by a compiler that
7010 understands function prototypes. Unfortunately, your C compiler
7012 doesn't seem to understand them. Sorry about that.
7014 If GNU cc is available for your system, perhaps you could try that instead.
7016 Eventually, we hope to support building Perl with pre-ANSI compilers.
7017 If you would like to help in that effort, please contact <perlbug@perl.org>.
7019 Aborting Configure now.
7031 Perl can be built with extra modules or bundles of modules which
7032 will be fetched from the CPAN and installed alongside Perl.
7034 Notice that you will need access to the CPAN; either via the Internet,
7035 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
7036 be asked later to configure the CPAN.pm module which will in turn do
7037 the installation of the rest of the extra modules or bundles.)
7039 Notice also that if the modules require any external software such as
7040 libraries and headers (the libz library and the zlib.h header for the
7041 Compress::Zlib module, for example) you MUST have any such software
7042 already installed, this configuration process will NOT install such
7045 If this doesn't make any sense to you, just accept the default '$dflt'.
7047 rp='Install any extra modules (y or n)?'
7053 Please list any extra modules or bundles to be installed from CPAN,
7054 with spaces between the names. The names can be in any format the
7055 'install' command of CPAN.pm will understand. (Answer 'none',
7056 without the quotes, to install no extra modules or bundles.)
7066 $rm -f ../extras.lst
7068 *) echo "(Saving the list of extras for later...)"
7069 echo "$extras" > ../extras.lst
7077 : determine where html pages for programs go
7078 set html1dir html1dir none
7082 If you wish to install html files for programs in $spackage, indicate
7083 the appropriate directory here. To skip installing html files,
7087 ''|none|$undef|' ') dflt=none ;;
7088 *) dflt=$html1dir ;;
7091 rp="Directory for the main $spackage html pages?"
7095 : Use ' ' for none so value is preserved next time through Configure
7096 $test X"$html1dir" = "X" && html1dir=' '
7098 : determine where html pages for libraries and modules go
7099 set html3dir html3dir none
7103 If you wish to install html files for modules associated with $spackage,
7104 indicate the appropriate directory here. To skip installing html files,
7107 : There is no obvious default. If they have specified html1dir, then
7108 : try to key off that, possibly changing .../html1 into .../html3.
7110 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
7111 *) dflt=$html3dir ;;
7114 rp="Directory for the $spackage module html pages?"
7118 : Use ' ' for none so value is preserved next time through Configure
7119 $test X"$html3dir" = "X" && html3dir=' '
7121 : determine whether to install perl also as /usr/bin/perl
7124 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
7126 Many scripts expect perl to be installed as /usr/bin/perl.
7128 If you want to, I can install the perl you are about to compile
7129 as /usr/bin/perl (in addition to $bin/perl).
7131 if test -f /usr/bin/perl; then
7134 However, please note that because you already have a /usr/bin/perl,
7135 overwriting that with a new Perl would very probably cause problems.
7136 Therefore I'm assuming you don't want to do that (unless you insist).
7139 case "$installusrbinperl" in
7140 "$define"|[yY]*) dflt='y';;
7146 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
7149 case "$installusrbinperl" in
7150 "$undef"|[nN]*) dflt='n';;
7154 rp="Do you want to install perl as /usr/bin/perl?"
7157 [yY]*) val="$define";;
7163 set installusrbinperl
7167 echo "Checking for GNU C Library..." >&4
7169 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
7170 alone are insufficient to distinguish different versions, such as
7171 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
7172 libc version 2.1.0. A. Dougherty, June 3, 2002.
7178 # ifdef __GLIBC_MINOR__
7179 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus)
7180 # include <gnu/libc-version.h>
7181 printf("%s\n", gnu_get_libc_version());
7183 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
7186 printf("%d\n", __GLIBC__);
7195 if eval $compile_ok && $run ./try > glibc.ver; then
7197 gnulibc_version=`$cat glibc.ver`
7198 echo "You are using the GNU C Library version $gnulibc_version"
7202 echo "You are not using the GNU C Library"
7208 : see if nm is to be used to determine whether a symbol is defined or not
7212 case "$d_gnulibc" in
7215 echo "nm probably won't work on the GNU C Library." >&4
7221 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
7223 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
7224 echo "'nm' won't be sufficient on this sytem." >&4
7230 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
7231 if $test $dflt -gt 20; then
7241 true|$define) dflt=y;;
7248 I can use $nm to extract the symbols from your C libraries. This
7249 is a time consuming task which may generate huge output on the disk (up
7250 to 3 megabytes) but that should make the symbols extraction faster. The
7251 alternative is to skip the 'nm' extraction part and to compile a small
7252 test program instead to determine whether each symbol is present. If
7253 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
7254 this may be the best solution.
7256 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
7259 rp="Shall I use $nm to extract C symbols from the libraries?"
7262 [Nn]*) usenm=false;;
7271 : nm options which may be necessary
7273 '') if $test -f /mach_boot; then
7275 elif $test -d /usr/ccs/lib; then
7276 nm_opt='-p' # Solaris (and SunOS?)
7277 elif $test -f /dgux; then
7279 elif $test -f /lib64/rld; then
7280 nm_opt='-p' # 64-bit Irix
7286 : nm options which may be necessary for shared libraries but illegal
7287 : for archive libraries. Thank you, Linux.
7288 case "$nm_so_opt" in
7289 '') case "$myuname" in
7291 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
7292 nm_so_opt='--dynamic'
7301 : get list of predefined functions in a handy place
7306 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
7312 *) for thislib in $libs; do
7315 : Handle C library specially below.
7318 thislib=`echo $thislib | $sed -e 's/^-l//'`
7319 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
7321 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
7323 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
7325 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
7327 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
7329 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
7331 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
7336 libnames="$libnames $try"
7338 *) libnames="$libnames $thislib" ;;
7347 for xxx in $libpth; do
7348 $test -r $1 || set $xxx/libc.$so
7349 : The messy sed command sorts on library version numbers.
7351 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
7352 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
7354 s/[0-9][0-9]*/0000&/g
7355 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
7358 $sort | $sed -e 's/^.* //'`
7361 $test -r $1 || set /usr/ccs/lib/libc.$so
7362 $test -r $1 || set /lib/libsys_s$_a
7368 if $test -r "$1"; then
7369 echo "Your (shared) C library seems to be in $1."
7371 elif $test -r /lib/libc && $test -r /lib/clib; then
7372 echo "Your C library seems to be in both /lib/clib and /lib/libc."
7374 libc='/lib/clib /lib/libc'
7375 if $test -r /lib/syslib; then
7376 echo "(Your math library is in /lib/syslib.)"
7377 libc="$libc /lib/syslib"
7379 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7380 echo "Your C library seems to be in $libc, as you said before."
7381 elif $test -r $incpath/usr/lib/libc$_a; then
7382 libc=$incpath/usr/lib/libc$_a;
7383 echo "Your C library seems to be in $libc. That's fine."
7384 elif $test -r /lib/libc$_a; then
7386 echo "Your C library seems to be in $libc. You're normal."
7388 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
7390 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
7391 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
7392 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
7394 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7396 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7399 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
7401 if $test -r "$tans"; then
7402 echo "Your C library seems to be in $tans, of all places."
7408 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7412 If the guess above is wrong (which it might be if you're using a strange
7413 compiler, or your machine supports multiple models), you can override it here.
7418 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
7420 I can't seem to find your C library. I've looked in the following places:
7423 $sed 's/^/ /' libpath
7426 None of these seems to contain your C library. I need to get its name...
7431 rp='Where is your C library?'
7436 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
7437 set X `cat libnames`
7440 case $# in 1) xxx=file; esac
7441 echo "Extracting names from the following $xxx for later perusal:" >&4
7443 $sed 's/^/ /' libnames >&4
7445 $echo $n "This may take a while...$c" >&4
7449 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
7450 *) $nm $nm_opt $file 2>/dev/null;;
7455 $grep fprintf libc.tmp > libc.ptf
7456 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
7457 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
7459 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
7461 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7463 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
7465 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7467 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
7469 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7471 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
7473 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7475 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
7477 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7479 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
7481 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7483 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
7484 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
7486 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7488 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
7490 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7492 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
7494 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7496 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
7498 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7500 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
7502 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7504 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
7506 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7508 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
7510 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7512 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
7514 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7517 $nm -p $* 2>/dev/null >libc.tmp
7518 $grep fprintf libc.tmp > libc.ptf
7519 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
7520 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
7526 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
7528 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
7529 for thisname in $libnames $libc; do
7530 $ar t $thisname >>libc.tmp
7532 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
7534 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
7535 # Repeat libc to extract forwarders to DLL entries too
7536 for thisname in $libnames $libc; do
7537 $ar tv $thisname >>libc.tmp
7538 # Revision 50 of EMX has bug in $ar.
7539 # it will not extract forwarders to DLL entries
7540 # Use emximp which will extract exactly them.
7541 emximp -o tmp.imp $thisname \
7543 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
7544 < tmp.imp >>libc.tmp
7547 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
7550 echo "$ar didn't seem to work right." >&4
7551 echo "Maybe this is a Cray...trying bld instead..." >&4
7552 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
7554 for thisname in $libnames; do
7556 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
7557 $ar t $thisname >>libc.tmp
7561 echo "That didn't work either. Giving up." >&4
7571 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
7572 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
7574 *) if $test -f /lib/syscalls.exp; then
7576 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
7577 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' /lib/syscalls.exp >>libc.list
7583 $rm -f libnames libpath
7585 : see if dld is available
7591 echo "Checking for C++..." >&4
7592 $cat >try.c <<'EOCP'
7604 if eval $compile_ok && $run ./try; then
7606 echo "You are using a C++ compiler."
7609 echo "You are not using a C++ compiler."
7615 : is a C symbol defined?
7618 -v) tf=libc.tmp; tdc="";;
7619 -a) tf=libc.tmp; tdc="[]";;
7620 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
7623 case "$reuseval-$4" in
7625 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
7630 case "$d_cplusplus" in
7631 $define) extern_C=\"C\";;
7633 if $test "$runnm" = true; then
7634 if $contains $tlook $tf >/dev/null 2>&1; then
7636 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
7637 echo "extern $extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7638 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
7639 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
7643 echo "extern $extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7644 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
7650 $define) tval=true;;
7657 : define an is-in-libc? function
7658 inlibc='echo " "; td=$define; tu=$undef;
7659 sym=$1; var=$2; eval "was=\$$2";
7661 case "$reuseval$was" in
7671 echo "$sym() found." >&4;
7672 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
7674 echo "$sym() NOT found." >&4;
7675 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
7679 $define) echo "$sym() found." >&4;;
7680 *) echo "$sym() NOT found." >&4;;
7684 : see if dlopen exists
7686 xxx_ccflags="$ccflags"
7688 : with g++ one needs -shared to get is-in-libc to work for dlopen
7689 case "$gccversion" in
7691 *) case "$d_cplusplus" in
7692 "$define") ccflags="$ccflags -shared" ;;
7699 ccflags="$xxx_ccflags"
7701 : see if this is a unistd.h system
7702 set unistd.h i_unistd
7705 : determine which dynamic loading, if any, to compile in
7707 dldir="ext/DynaLoader"
7720 $define) dflt='y' ;;
7723 $define) dflt='y' ;;
7725 : Does a dl_xxx.xs file exist for this operating system
7726 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
7729 rp="Do you wish to use dynamic loading?"
7736 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
7737 dflt="$dldir/dl_${osname}.xs"
7738 elif $test "$d_dlopen" = "$define" ; then
7739 dflt="$dldir/dl_dlopen.xs"
7740 elif $test "$i_dld" = "$define" ; then
7741 dflt="$dldir/dl_dld.xs"
7746 *) dflt="$dldir/$dlsrc"
7749 echo "The following dynamic loading files are available:"
7750 : Can not go over to $dldir because getfile has path hard-coded in.
7751 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
7752 rp="Source file to use for dynamic loading"
7758 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
7762 Some systems may require passing special flags to $cc -c to
7763 compile modules that will be used to create a shared library.
7764 To use no flags, say "none".
7767 case "$cccdlflags" in
7768 '') case "$gccversion" in
7769 '') case "$osname" in
7771 next) dflt='none' ;;
7772 irix*) dflt='-KPIC' ;;
7773 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
7774 sunos) dflt='-pic' ;;
7778 *) case "$osname" in
7779 darwin) dflt='none' ;;
7780 linux*|svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
7785 *) dflt="$cccdlflags" ;;
7787 rp="Any special flags to pass to $cc -c to compile shared library modules?"
7790 none) cccdlflags=' ' ;;
7791 *) cccdlflags="$ans" ;;
7796 Some systems use ld to create libraries that can be dynamically loaded,
7797 while other systems (such as those using ELF) use $cc.
7801 '') $cat >try.c <<EOM
7802 /* Test for whether ELF binaries are produced */
7814 int i = open("a.out",O_RDONLY);
7817 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
7818 exit(0); /* succeed (yes, it's ELF) */
7823 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
7825 You appear to have ELF support. I'll use $cc to build dynamic libraries.
7829 echo "I'll use ld to build dynamic libraries."
7838 rp="What command should be used to create dynamic libraries?"
7844 Some systems may require passing special flags to $ld to create a
7845 library that can be dynamically loaded. If your ld flags include
7846 -L/other/path options to locate libraries outside your loader's normal
7847 search path, you may need to specify those -L options here as well. To
7848 use no flags, say "none".
7851 case "$lddlflags" in
7852 '') case "$osname" in
7853 beos) dflt='-nostart' ;;
7855 case "$gccversion" in
7856 '') dflt="$dflt +vnocompatwarnings" ;;
7859 linux|irix*|gnu*) dflt="-shared $optimize" ;;
7860 next) dflt='none' ;;
7861 solaris) dflt='-G' ;;
7862 sunos) dflt='-assert nodefinitions' ;;
7863 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
7867 *) dflt="$lddlflags" ;;
7870 : Try to guess additional flags to pick up local libraries.
7871 : Be careful not to append to a plain 'none'
7875 for thisflag in $ldflags; do
7880 *) dflt="$dflt $thisflag" ;;
7887 ''|' ') dflt='none' ;;
7890 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
7893 none) lddlflags=' ' ;;
7894 *) lddlflags="$ans" ;;
7899 Some systems may require passing special flags to $cc to indicate that
7900 the resulting executable will use dynamic linking. To use no flags,
7904 case "$ccdlflags" in
7905 '') case "$osname" in
7906 linux|hpux|gnu*) dflt='-Wl,-E' ;;
7907 next|sunos) dflt='none' ;;
7911 *) dflt="$ccdlflags" ;;
7913 rp="Any special flags to pass to $cc to use dynamic linking?"
7916 none) ccdlflags=' ' ;;
7917 *) ccdlflags="$ans" ;;
7931 # No dynamic loading being used, so don't bother even to prompt.
7934 *) case "$useshrplib" in
7935 '') case "$osname" in
7936 svr4*|nonstopux|dgux|dynixptx|esix|powerux|beos|cygwin*)
7938 also='Building a shared libperl is required for dynamic loading to work on your system.'
7943 also='Building a shared libperl is needed for MAB support.'
7961 The perl executable is normally obtained by linking perlmain.c with
7962 libperl${_a}, any static extensions (usually just DynaLoader), and
7963 any other libraries needed on this system (such as -lm, etc.). Since
7964 your system supports dynamic loading, it is probably possible to build
7965 a shared libperl.$so. If you will have more than one executable linked
7966 to libperl.$so, this will significantly reduce the size of each
7967 executable, but it may have a noticeable effect on performance. The
7968 default is probably sensible for your system.
7972 rp="Build a shared libperl.$so (y/n)"
7976 useshrplib='true' ;;
7977 *) useshrplib='false' ;;
7982 case "$useshrplib" in
7986 # Figure out a good name for libperl.so. Since it gets stored in
7987 # a version-specific architecture-dependent library, the version
7988 # number isn't really that important, except for making cc/ld happy.
7990 # A name such as libperl.so.3.1
7991 majmin="libperl.$so.$patchlevel.$subversion"
7992 # A name such as libperl.so.301
7993 majonly=`echo $patchlevel $subversion |
7994 $awk '{printf "%d%02d", $1, $2}'`
7995 majonly=libperl.$so.$majonly
7996 # I'd prefer to keep the os-specific stuff here to a minimum, and
7997 # rely on figuring it out from the naming of libc.
7998 case "${osname}${osvers}" in
8001 # XXX How handle the --version stuff for MAB?
8003 linux*|gnu*) # ld won't link with a bare -lperl otherwise.
8006 cygwin*) # ld links against an importlib
8007 dflt=libperl$lib_ext
8009 *) # Try to guess based on whether libc has major.minor.
8011 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
8012 *libc.$so.[0-9]*) dflt=$majonly ;;
8013 *) dflt=libperl.$so ;;
8023 I need to select a good name for the shared libperl. If your system uses
8024 library names with major and minor numbers, then you might want something
8025 like $majmin. Alternatively, if your system uses a single version
8026 number for shared libraries, then you might want to use $majonly.
8027 Or, your system might be quite happy with a simple libperl.$so.
8029 Since the shared libperl will get installed into a version-specific
8030 architecture-dependent directory, the version number of the shared perl
8031 library probably isn't important, so the default should be o.k.
8034 rp='What name do you want to give to the shared libperl?'
8037 echo "Ok, I'll use $libperl"
8040 libperl="libperl${_a}"
8044 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
8048 WARNING: Use of the shrpdir variable for the installation location of
8049 the shared $libperl is not supported. It was never documented and
8050 will not work in this version. Let me (perlbug@perl.org)
8051 know of any problems this may cause.
8057 But your current setting of $shrpdir is
8058 the default anyway, so it's harmless.
8063 Further, your current attempted setting of $shrpdir
8064 conflicts with the value of $archlibexp/CORE
8065 that installperl will use.
8072 # How will the perl executable find the installed shared $libperl?
8073 # Add $xxx to ccdlflags.
8074 # If we can't figure out a command-line option, use $shrpenv to
8075 # set env LD_RUN_PATH. The main perl makefile uses this.
8076 shrpdir=$archlibexp/CORE
8079 if "$useshrplib"; then
8082 # We'll set it in Makefile.SH...
8087 freebsd|netbsd|openbsd|interix|dragonfly)
8088 xxx="-Wl,-R$shrpdir"
8090 bsdos|linux|irix*|dec_osf|gnu*)
8091 xxx="-Wl,-rpath,$shrpdir"
8094 # next doesn't like the default...
8097 # beos doesn't like the default, either.
8100 # hpux doesn't like the default, either.
8101 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
8104 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
8110 # Only add $xxx if it isn't already in ccdlflags.
8111 case " $ccdlflags " in
8113 *) ccdlflags="$ccdlflags $xxx"
8116 Adding $xxx to the flags
8117 passed to $ld so that the perl executable will find the
8118 installed shared $libperl.
8126 # Fix ccdlflags in AIX for building external extensions.
8127 # (For building Perl itself bare -bE:perl.exp is needed,
8128 # Makefile.SH takes care of this.)
8130 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8132 # Respect a hint or command-line value.
8134 '') shrpenv="$tmp_shrpenv" ;;
8136 case "$ldlibpthname" in
8137 '') ldlibpthname=LD_LIBRARY_PATH ;;
8138 none) ldlibpthname='' ;;
8141 : determine where manual pages are on this system
8145 syspath='/usr/share/man/man1 /usr/man/man1'
8146 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8147 syspath="$syspath /usr/man/u_man/man1"
8148 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8149 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8150 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8151 sysman=`./loc . /usr/man/man1 $syspath`
8154 if $test -d "$sysman"; then
8155 echo "System manual is in $sysman." >&4
8157 echo "Could not find manual pages in source form." >&4
8160 : determine where manual pages go
8161 set man1dir man1dir none
8165 $spackage has manual pages available in source form.
8169 echo "However, you don't have nroff, so they're probably useless to you."
8171 '') man1dir="none";;
8174 echo "If you don't want the manual sources installed, answer 'none'."
8179 lookpath="$prefixexp/share/man/man1"
8180 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8181 lookpath="$lookpath $prefixexp/man/p_man/man1"
8182 lookpath="$lookpath $prefixexp/man/u_man/man1"
8183 lookpath="$lookpath $prefixexp/man/man.1"
8185 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8186 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8196 rp="Where do the main $spackage manual pages (source) go?"
8198 if $test "X$man1direxp" != "X$ansexp"; then
8209 : What suffix to use on installed man pages
8216 rp="What suffix should be used for the main $spackage man pages?"
8218 '') case "$man1dir" in
8232 *) dflt="$man1ext";;
8239 : see if we can have long filenames
8241 first=123456789abcdef
8243 if (echo hi >$first) 2>/dev/null; then
8244 if $test -f 123456789abcde; then
8245 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8248 echo 'You can have filenames longer than 14 characters.'>&4
8253 You can't have filenames longer than 14 chars.
8254 You can't even think about them!
8260 $rm -rf 123456789abcde*
8262 : determine where library module manual pages go
8263 set man3dir man3dir none
8267 $spackage has manual pages for many of the library modules.
8273 However, you don't have nroff, so they're probably useless to you.
8276 '') man3dir="none";;
8280 case "$d_flexfnam" in
8283 However, your system can't handle the long file names like File::Basename.3.
8286 '') man3dir="none";;
8290 echo "If you don't want the manual sources installed, answer 'none'."
8291 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8293 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
8294 if $test -d "$privlib/man/man3"; then
8297 WARNING: Previous versions of perl installed man3 pages into
8298 $privlib/man/man3. This version will suggest a
8299 new default of $dflt.
8303 rp='Do you wish to preserve the old behavior?(y/n)'
8306 y*) dflt="$privlib/man/man3" ;;
8311 *) dflt="$man3dir" ;;
8318 rp="Where do the $package library man pages (source) go?"
8328 : What suffix to use on installed man pages
8334 rp="What suffix should be used for the $package library man pages?"
8336 '') case "$man3dir" in
8350 *) dflt="$man3ext";;
8357 : see if we have to deal with yellow pages, now NIS.
8358 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
8359 if $test -f /usr/etc/nibindd; then
8361 echo "I'm fairly confident you're on a NeXT."
8363 rp='Do you get the hosts file via NetInfo?'
8372 y*) hostcat='nidump hosts .';;
8373 *) case "$hostcat" in
8374 nidump*) hostcat='';;
8384 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
8392 rp='Are you getting the hosts file via yellow pages?'
8395 y*) hostcat='ypcat hosts';;
8396 *) hostcat='cat /etc/hosts';;
8402 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
8405 '') test -f /etc/group && groupcat='cat /etc/group';;
8408 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
8411 : now get the host name
8413 echo "Figuring out host name..." >&4
8414 case "$myhostname" in
8416 echo 'Maybe "hostname" will work...'
8417 if tans=`sh -c hostname 2>&1` ; then
8425 if $test "$cont"; then
8427 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
8428 if tans=`cat /etc/systemid 2>&1` ; then
8430 phostname='cat /etc/systemid'
8431 echo "Whadyaknow. Xenix always was a bit strange..."
8434 elif $test -r /etc/systemid; then
8435 echo "(What is a non-Xenix system doing with /etc/systemid?)"
8438 if $test "$cont"; then
8439 echo 'No, maybe "uuname -l" will work...'
8440 if tans=`sh -c 'uuname -l' 2>&1` ; then
8442 phostname='uuname -l'
8444 echo 'Strange. Maybe "uname -n" will work...'
8445 if tans=`sh -c 'uname -n' 2>&1` ; then
8447 phostname='uname -n'
8449 echo 'Oh well, maybe I can mine it out of whoami.h...'
8450 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
8451 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
8452 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
8454 case "$myhostname" in
8455 '') echo "Does this machine have an identity crisis or something?"
8458 echo "Well, you said $myhostname before..."
8459 phostname='echo $myhostname';;
8465 case "$myhostname" in
8466 '') myhostname=noname ;;
8468 : you do not want to know about this
8473 if $test "$myhostname" ; then
8475 rp='Your host name appears to be "'$myhostname'".'" Right?"
8483 : bad guess or no guess
8484 while $test "X$myhostname" = X ; do
8486 rp="Please type the (one word) name of your host:"
8491 : translate upper to lower if necessary
8492 case "$myhostname" in
8494 echo "(Normalizing case in your host name)"
8495 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
8499 case "$myhostname" in
8501 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
8502 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
8503 echo "(Trimming domain name from host name--host name is now $myhostname)"
8505 *) case "$mydomain" in
8508 test "X$hostcat" = "Xypcat hosts" &&
8509 ypmatch "$myhostname" hosts 2>/dev/null |\
8510 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
8513 test "X$hostcat" != "X" &&
8514 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
8515 /[ ]$myhostname[ . ]/p" > hosts
8518 if $test -f hosts; then
8519 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
8520 END { print sum }" hosts` = x1 || tmp_re="[ ]"
8521 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
8522 hosts | $sort | $uniq | \
8523 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
8524 case `$echo X$dflt` in
8525 X*\ *) echo "(Several hosts in the database matched hostname)"
8528 X.) echo "(You do not have fully-qualified names in the hosts database)"
8532 echo "(I cannot locate a hosts database anywhere)"
8537 tans=`./loc resolv.conf X /etc /usr/etc`
8538 if $test -f "$tans"; then
8539 echo "(Attempting domain name extraction from $tans)"
8540 dflt=.`$sed -n -e 's/ / /g' \
8541 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
8542 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8544 .) dflt=.`$sed -n -e 's/ / /g' \
8545 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
8546 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8553 .) echo "(No help from resolv.conf either -- attempting clever guess)"
8554 dflt=.`sh -c domainname 2>/dev/null`
8557 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
8561 case "$dflt$osname" in
8562 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
8563 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
8567 .) echo "(Lost all hope -- silly guess then)"
8573 *) dflt="$mydomain";;
8577 rp="What is your domain name?"
8587 : translate upper to lower if necessary
8590 echo "(Normalizing case in your domain name)"
8591 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
8595 : a little sanity check here
8596 case "$phostname" in
8599 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
8600 $myhostname$mydomain|$myhostname) ;;
8602 case "$phostname" in
8604 echo "(That doesn't agree with your whoami.h file, by the way.)"
8607 echo "(That doesn't agree with your $phostname command, by the way.)"
8617 I need to get your e-mail address in Internet format if possible, i.e.
8618 something like user@host.domain. Please answer accurately since I have
8619 no easy means to double check it. The default value provided below
8620 is most probably close to reality but may not be valid from outside
8621 your organization...
8625 while test "$cont"; do
8627 '') dflt="$cf_by@$myhostname$mydomain";;
8628 *) dflt="$cf_email";;
8630 rp='What is your e-mail address?'
8636 rp='Address does not look like an Internet one. Use it anyway?'
8652 If you or somebody else will be maintaining perl at your site, please
8653 fill in the correct e-mail address here so that they may be contacted
8654 if necessary. Currently, the "perlbug" program included with perl
8655 will send mail to this address in addition to perlbug@perl.org. You may
8656 enter "none" for no administrator.
8659 case "$perladmin" in
8660 '') dflt="$cf_email";;
8661 *) dflt="$perladmin";;
8663 rp='Perl administrator e-mail address'
8667 : determine whether to only install version-specific parts.
8670 Do you want to install only the version-specific parts of the perl
8671 distribution? Usually you do *not* want to do this.
8673 case "$versiononly" in
8674 "$define"|[Yy]*|true) dflt='y' ;;
8677 rp="Do you want to install only the version-specific parts of perl?"
8680 [yY]*) val="$define";;
8686 case "$versiononly" in
8687 "$define") inc_version_list=''
8688 inc_version_list_init=0
8692 : figure out how to guarantee perl startup
8693 : XXX Note that this currently takes advantage of the bug that binexp ignores
8694 : the Configure -Dinstallprefix setting, which in turn means that under
8695 : relocatable @INC, initialinstalllocation is what binexp started as.
8696 case "$startperl" in
8698 case "$sharpbang" in
8702 I can use the #! construct to start perl on your system. This will
8703 make startup of perl scripts faster, but may cause problems if you
8704 want to share those scripts and perl is not in a standard place
8705 ($initialinstalllocation/perl) on all your platforms. The alternative
8706 is to force a shell by starting the script with a single ':' character.
8709 case "$versiononly" in
8710 "$define") dflt="$initialinstalllocation/perl$version";;
8711 *) dflt="$initialinstalllocation/perl";;
8713 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
8716 none) startperl=": # use perl";;
8717 *) startperl="#!$ans"
8718 if $test 30 -lt `echo "$ans" | wc -c`; then
8721 WARNING: Some systems limit the #! command to 32 characters.
8722 If you experience difficulty running Perl scripts with #!, try
8723 installing Perl in a directory with a shorter pathname.
8729 *) startperl=": # use perl"
8734 echo "I'll use $startperl to start perl scripts."
8736 : figure best path for perl in scripts
8739 case "$versiononly" in
8740 "$define") perlpath="$initialinstalllocation/perl$version";;
8741 *) perlpath="$initialinstalllocation/perl";;
8743 case "$startperl" in
8748 I will use the "eval 'exec'" idiom to start Perl on your system.
8749 I can use the full path of your Perl binary for this purpose, but
8750 doing so may cause problems if you want to share those scripts and
8751 Perl is not always in a standard place ($initialinstalllocation/perl).
8754 dflt="$initialinstalllocation/perl"
8755 rp="What path shall I use in \"eval 'exec'\"?"
8762 case "$startperl" in
8764 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
8767 : determine where public executable scripts go
8768 set scriptdir scriptdir
8770 case "$scriptdir" in
8773 : guess some guesses
8774 $test -d /usr/share/scripts && dflt=/usr/share/scripts
8775 $test -d /usr/share/bin && dflt=/usr/share/bin
8776 $test -d /usr/local/script && dflt=/usr/local/script
8777 $test -d /usr/local/scripts && dflt=/usr/local/scripts
8778 $test -d $prefixexp/script && dflt=$prefixexp/script
8782 *) dflt="$scriptdir"
8787 Some installations have a separate directory just for executable scripts so
8788 that they can mount it across multiple architectures but keep the scripts in
8789 one spot. You might, for example, have a subdirectory of /usr/share for this.
8790 Or you might just lump your scripts in with all your other executables.
8794 rp='Where do you keep publicly executable scripts?'
8796 if $test "X$ansexp" != "X$scriptdirexp"; then
8802 : A little fix up for an irregularly named variable.
8803 installscript="$installscriptdir"
8805 : determine where add-on public executables go
8807 '') dflt=$siteprefix/bin ;;
8811 rp='Pathname where the add-on public executables should be installed?'
8816 : determine where add-on html pages go
8817 : There is no standard location, so try to copy the previously-selected
8818 : directory structure for the core html pages.
8819 case "$sitehtml1dir" in
8820 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
8821 *) dflt=$sitehtml1dir ;;
8824 ''|' ') dflt=none ;;
8827 rp='Pathname where the site-specific html pages should be installed?'
8829 prefixvar=sitehtml1dir
8832 : determine where add-on library html pages go
8833 : There is no standard location, so try to copy the previously-selected
8834 : directory structure for the core html pages.
8835 case "$sitehtml3dir" in
8836 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
8837 *) dflt=$sitehtml3dir ;;
8840 ''|' ') dflt=none ;;
8843 rp='Pathname where the site-specific library html pages should be installed?'
8845 prefixvar=sitehtml3dir
8848 : determine where add-on manual pages go
8849 case "$siteman1dir" in
8850 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
8851 *) dflt=$siteman1dir ;;
8854 ''|' ') dflt=none ;;
8857 rp='Pathname where the site-specific manual pages should be installed?'
8859 prefixvar=siteman1dir
8862 : determine where add-on library man pages go
8863 case "$siteman3dir" in
8864 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
8865 *) dflt=$siteman3dir ;;
8868 ''|' ') dflt=none ;;
8871 rp='Pathname where the site-specific library manual pages should be installed?'
8873 prefixvar=siteman3dir
8876 : determine where add-on public executable scripts go
8877 case "$sitescript" in
8878 '') dflt=$siteprefix/script
8879 $test -d $dflt || dflt=$sitebin ;;
8880 *) dflt="$sitescript" ;;
8883 rp='Pathname where add-on public executable scripts should be installed?'
8885 prefixvar=sitescript
8888 case "$usefaststdio" in
8889 $define|true|[yY]*|'')
8890 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
8900 Perl can be built to use 'fast stdio', which means using the stdio
8901 library but also directly manipulating the stdio buffers to enable
8902 faster I/O. Using stdio is better for backward compatibility (especially
8903 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
8904 interface has been preferred instead of stdio.
8906 If this doesn't make any sense to you, just accept the default '$dflt'.
8908 rp='Use the "fast stdio" if available?'
8911 y|Y) val="$define" ;;
8918 : define an is-a-typedef? function
8919 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8921 "") inclist="sys/types.h";;
8923 eval "varval=\$$var";
8927 for inc in $inclist; do
8928 echo "#include <$inc>" >>temp.c;
8930 echo "#ifdef $type" >> temp.c;
8931 echo "printf(\"We have $type\");" >> temp.c;
8932 echo "#endif" >> temp.c;
8933 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8934 if $contains $type temp.E >/dev/null 2>&1; then
8940 *) eval "$var=\$varval";;
8943 : define an is-a-typedef? function that prompts if the type is not available.
8944 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8946 "") inclist="sys/types.h";;
8948 eval "varval=\$$var";
8952 for inc in $inclist; do
8953 echo "#include <$inc>" >>temp.c;
8955 echo "#ifdef $type" >> temp.c;
8956 echo "printf(\"We have $type\");" >> temp.c;
8957 echo "#endif" >> temp.c;
8958 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8960 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
8961 if $contains $type temp.E >/dev/null 2>&1; then
8962 echo "$type found." >&4;
8965 echo "$type NOT found." >&4;
8971 *) eval "$var=\$varval";;
8974 : see what type lseek is declared as in the kernel
8975 rp="What is the type used for lseek's offset on this system?"
8976 set off_t lseektype long stdio.h sys/types.h
8980 echo "Checking to see how big your file offsets are..." >&4
8982 #include <sys/types.h>
8986 printf("%d\n", (int)sizeof($lseektype));
8991 if eval $compile_ok; then
8992 lseeksize=`$run ./try`
8993 echo "Your file offsets are $lseeksize bytes long."
8997 echo "(I can't seem to compile the test program. Guessing...)"
8998 rp="What is the size of your file offsets (in bytes)?"
9004 : see what type file positions are declared as in the library
9005 rp="What is the type for file position used by fsetpos()?"
9006 set fpos_t fpostype long stdio.h sys/types.h
9011 *_t) zzz="$fpostype" ;;
9014 echo "Checking the size of $zzz..." >&4
9016 #include <sys/types.h>
9023 printf("%d\n", (int)sizeof($fpostype));
9028 if eval $compile_ok; then
9032 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9035 echo "Your $zzz is $fpossize bytes long."
9041 echo "(I can't compile the test program. Guessing...)" >&4
9042 rp="What is the size of your file positions (in bytes)?"
9047 # Backward compatibility (uselfs is deprecated).
9049 "$define"|true|[yY]*)
9052 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
9054 uselargefiles="$define"
9058 case "$lseeksize:$fpossize" in
9061 You can have files larger than 2 gigabytes.
9064 *) case "$uselargefiles" in
9065 "$undef"|false|[nN]*) dflt='n' ;;
9070 Perl can be built to understand large files (files larger than 2 gigabytes)
9071 on some systems. To do so, Configure can be run with -Duselargefiles.
9073 If this doesn't make any sense to you, just accept the default '$dflt'.
9075 rp='Try to understand large files, if available?'
9078 y|Y) val="$define" ;;
9085 : Look for a hint-file generated 'call-back-unit'. If the
9086 : user has specified that a large files perl is to be built,
9087 : we may need to set or change some other defaults.
9088 if $test -f uselargefiles.cbu; then
9089 echo "Your platform has some specific hints regarding large file builds, using them..."
9090 . ./uselargefiles.cbu
9092 case "$uselargefiles" in
9094 if $test -f uselargefiles.cbu; then
9096 echo "Rechecking to see how big your file offsets are..." >&4
9098 #include <sys/types.h>
9102 printf("%d\n", (int)sizeof($lseektype));
9107 if eval $compile_ok; then
9108 lseeksize=`$run ./try`
9109 $echo "Your file offsets are now $lseeksize bytes long."
9113 echo "(I can't seem to compile the test program. Guessing...)"
9114 rp="What is the size of your file offsets (in bytes)?"
9119 *_t) zzz="$fpostype" ;;
9122 $echo $n "Rechecking the size of $zzz...$c" >&4
9124 #include <sys/types.h>
9131 printf("%d\n", (int)sizeof($fpostype));
9136 if eval $compile_ok; then
9141 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9144 echo " $fpossize bytes." >&4
9150 echo "(I can't compile the test program. Guessing...)" >&4
9151 rp="What is the size of your file positions (in bytes)?"
9160 case "$vendorprefix" in
9161 '') d_vendorbin="$undef"
9165 *) d_vendorbin="$define"
9166 : determine where vendor-supplied executables go.
9167 case "$vendorbin" in
9168 '') dflt=$vendorprefix/bin ;;
9169 *) dflt="$vendorbin" ;;
9172 rp='Pathname for the vendor-supplied executables directory?'
9175 vendorbinexp="$ansexp"
9181 case "$vendorprefix" in
9182 '') vendorhtml1dir=''
9183 vendorhtml1direxp=''
9185 *) : determine where vendor-supplied html pages go.
9186 : There is no standard location, so try to copy the previously-selected
9187 : directory structure for the core html pages.
9188 : XXX Better default suggestions would be welcome.
9189 case "$vendorhtml1dir" in
9190 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9191 *) dflt=$vendorhtml1dir ;;
9194 ''|' ') dflt=none ;;
9197 rp='Pathname for the vendor-supplied html pages?'
9199 vendorhtml1dir="$ans"
9200 vendorhtml1direxp="$ansexp"
9203 : Use ' ' for none so value is preserved next time through Configure
9204 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9205 prefixvar=vendorhtml1dir
9208 case "$vendorprefix" in
9209 '') vendorhtml3dir=''
9210 vendorhtml3direxp=''
9212 *) : determine where vendor-supplied module html pages go.
9213 : There is no standard location, so try to copy the previously-selected
9214 : directory structure for the core html pages.
9215 : XXX Better default suggestions would be welcome.
9216 case "$vendorhtml3dir" in
9217 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9218 *) dflt=$vendorhtml3dir ;;
9221 ''|' ') dflt=none ;;
9224 rp='Pathname for the vendor-supplied html pages?'
9226 vendorhtml3dir="$ans"
9227 vendorhtml3direxp="$ansexp"
9230 : Use ' ' for none so value is preserved next time through Configure
9231 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9232 prefixvar=vendorhtml3dir
9235 case "$vendorprefix" in
9236 '') vendorman1dir=''
9239 *) : determine where vendor-supplied manual pages go.
9240 case "$vendorman1dir" in
9241 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9242 *) dflt=$vendorman1dir ;;
9245 ''|' ') dflt=none ;;
9248 rp='Pathname for the vendor-supplied manual section 1 pages?'
9250 vendorman1dir="$ans"
9251 vendorman1direxp="$ansexp"
9254 : Use ' ' for none so value is preserved next time through Configure
9255 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
9256 prefixvar=vendorman1dir
9259 case "$vendorprefix" in
9260 '') vendorman3dir=''
9263 *) : determine where vendor-supplied module manual pages go.
9264 case "$vendorman3dir" in
9265 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9266 *) dflt=$vendorman3dir ;;
9269 ''|' ') dflt=none ;;
9272 rp='Pathname for the vendor-supplied manual section 3 pages?'
9274 vendorman3dir="$ans"
9275 vendorman3direxp="$ansexp"
9278 : Use ' ' for none so value is preserved next time through Configure
9279 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
9280 prefixvar=vendorman3dir
9283 case "$vendorprefix" in
9284 '') d_vendorscript="$undef"
9288 *) d_vendorscript="$define"
9289 : determine where vendor-supplied scripts go.
9290 case "$vendorscript" in
9291 '') dflt=$vendorprefix/script
9292 $test -d $dflt || dflt=$vendorbin ;;
9293 *) dflt="$vendorscript" ;;
9297 The installation process will create a directory for
9298 vendor-supplied scripts.
9302 rp='Pathname for the vendor-supplied scripts directory?'
9305 vendorscriptexp="$ansexp"
9308 prefixvar=vendorscript
9311 : see if qgcvt exists
9317 if $test X"$d_longdbl" = X"$define"; then
9319 echo "Checking how to print long doubles..." >&4
9321 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
9322 $cat >try.c <<'EOCP'
9323 #include <sys/types.h>
9327 printf("%.3f\n", d);
9331 if eval $compile; then
9335 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
9336 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
9337 echo "We will use %f."
9343 if $test X"$sPRIfldbl" = X; then
9344 $cat >try.c <<'EOCP'
9345 #include <sys/types.h>
9348 long double d = 123.456;
9349 printf("%.3Lf\n", d);
9353 if eval $compile; then
9357 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
9358 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
9359 echo "We will use %Lf."
9365 if $test X"$sPRIfldbl" = X; then
9366 $cat >try.c <<'EOCP'
9367 #include <sys/types.h>
9370 long double d = 123.456;
9371 printf("%.3llf\n", d);
9375 if eval $compile; then
9379 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
9380 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
9381 echo "We will use %llf."
9387 if $test X"$sPRIfldbl" = X; then
9388 $cat >try.c <<'EOCP'
9389 #include <sys/types.h>
9392 long double d = 123.456;
9393 printf("%.3lf\n", d);
9397 if eval $compile; then
9401 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
9402 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
9403 echo "We will use %lf."
9409 if $test X"$sPRIfldbl" = X; then
9410 echo "Cannot figure out how to print long doubles." >&4
9412 sSCNfldbl=$sPRIfldbl # expect consistency
9419 case "$sPRIfldbl" in
9420 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
9421 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
9422 d_SCNfldbl="$undef";
9424 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
9425 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
9426 d_SCNfldbl="$define";
9430 : Check how to convert floats to strings.
9432 if test "X$d_Gconvert" = X; then
9435 echo "Checking for an efficient way to convert floats to strings."
9437 case "$uselongdouble" in
9438 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
9440 case "$d_longdbl" in
9441 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
9443 case "$d_PRIgldbl" in
9444 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
9448 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
9449 char *myname = "gconvert";
9452 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
9453 char *myname = "gcvt";
9456 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
9457 char *myname = "qgcvt";
9458 #define DOUBLETYPE long double
9461 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9463 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
9465 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
9468 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
9470 char *myname = "sprintf";
9474 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9475 #define DOUBLETYPE long double
9477 #define DOUBLETYPE double
9483 #define I_STDLIB $i_stdlib
9489 checkit(expect, got)
9493 if (strcmp(expect, got)) {
9494 printf("%s oddity: Expected %s, got %s\n",
9495 myname, expect, got);
9505 /* This must be 1st test on (which?) platform */
9506 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
9507 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
9508 checkit("0.1", buf);
9510 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
9511 checkit("0.01", buf);
9513 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
9514 checkit("0.001", buf);
9516 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
9517 checkit("0.0001", buf);
9519 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
9520 if (strlen(buf) > 5)
9521 checkit("9e-005", buf); /* for Microsoft ?? */
9523 checkit("9e-05", buf);
9525 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
9528 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
9529 checkit("1.1", buf);
9531 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
9532 checkit("1.01", buf);
9534 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
9535 checkit("1.001", buf);
9537 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
9538 checkit("1.0001", buf);
9540 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
9541 checkit("1.00001", buf);
9543 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
9544 checkit("1.000001", buf);
9546 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
9549 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
9552 /* Some Linux gcvt's give 1.e+5 here. */
9553 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
9554 checkit("100000", buf);
9556 /* Some Linux gcvt's give -1.e+5 here. */
9557 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
9558 checkit("-100000", buf);
9560 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
9561 checkit("123.456", buf);
9563 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
9564 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
9565 /* 34 should be enough to scare even long double
9566 * places into using the e notation. */
9567 if (strlen(buf) > 5)
9568 checkit("1e+034", buf); /* for Microsoft */
9570 checkit("1e+34", buf);
9572 /* For Perl, if you add additional tests here, also add them to
9573 * t/base/num.t for benefit of platforms not using Configure or
9574 * overriding d_Gconvert */
9579 : first add preferred functions to our list
9581 for xxx_convert in $gconvert_preference; do
9582 case $xxx_convert in
9583 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
9584 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
9587 : then add any others
9588 for xxx_convert in gconvert gcvt sprintf; do
9591 *) xxx_list="$xxx_list $xxx_convert" ;;
9595 case "$d_longdbl$uselongdouble" in
9597 : again, add prefered functions to our list first
9599 for xxx_convert in $gconvert_ld_preference; do
9600 case $xxx_convert in
9601 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9602 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
9605 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
9606 for xxx_convert in qgcvt sprintf $xxx_list; do
9607 case "$xxx_ld_list" in
9608 $xxx_convert*|*" $xxx_convert"*) ;;
9609 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9612 : if sprintf cannot do long doubles, move it to the end
9613 if test "$d_PRIgldbl" != "$define"; then
9614 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
9616 : if no qgcvt, remove it
9617 if test "$d_qgcvt" != "$define"; then
9618 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
9621 xxx_list="$xxx_ld_list"
9625 for xxx_convert in $xxx_list; do
9626 echo "Trying $xxx_convert..."
9627 $rm -f try try$_o core
9628 set try -DTRY_$xxx_convert
9629 if eval $compile; then
9630 echo "$xxx_convert() found." >&4
9632 echo "I'll use $xxx_convert to convert floats into a string." >&4
9635 echo "...But $xxx_convert didn't work as I expected."
9639 echo "$xxx_convert NOT found." >&4
9643 if test X$xxx_convert = X; then
9644 echo "*** WHOA THERE!!! ***" >&4
9645 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
9649 case "$xxx_convert" in
9650 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
9651 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
9652 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
9653 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
9654 "$define$define$define")
9655 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
9656 "$define$define$undef")
9657 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
9658 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
9666 : see if _fwalk exists
9670 : Initialize h_fcntl
9673 : Initialize h_sysfile
9676 : access call always available on UNIX
9680 : locate the flags for 'access()'
9684 $cat >access.c <<EOCP
9685 #include <sys/types.h>
9690 #include <sys/file.h>
9703 : check sys/file.h first, no particular reason here
9704 if $test `./findhdr sys/file.h` && \
9705 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
9707 echo "<sys/file.h> defines the *_OK access constants." >&4
9708 elif $test `./findhdr fcntl.h` && \
9709 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
9711 echo "<fcntl.h> defines the *_OK access constants." >&4
9712 elif $test `./findhdr unistd.h` && \
9713 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
9714 echo "<unistd.h> defines the *_OK access constants." >&4
9716 echo "I can't find the four *_OK access constants--I'll use mine." >&4
9722 : see if accessx exists
9723 set accessx d_accessx
9726 : see if aintl exists
9730 : see if alarm exists
9734 : see if POSIX threads are available
9735 set pthread.h i_pthread
9738 : define a fucntion to check prototypes
9739 $cat > protochk <<EOSH
9742 optimize="$optimize"
9744 prototype="$prototype"
9747 usethreads=$usethreads
9748 i_pthread=$i_pthread
9749 pthread_h_first=$pthread_h_first
9752 $cat >> protochk <<'EOSH'
9757 while test $# -ge 2; do
9759 $define) echo "#include <$2>" >> try.c ;;
9760 literal) echo "$2" >> try.c ;;
9762 # Extra magic for the benefit of systems that need pthread.h
9763 # to be included early to correctly detect threadsafe functions.
9764 # Such functions must guarantee themselves, though, that the usethreads
9765 # and i_pthread have been defined, before calling protochk.
9766 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
9767 echo "#include <pthread.h>" >> try.c
9772 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
9773 cat >> try.c <<'EOCP'
9774 #ifdef CAN_PROTOTYPE
9775 #define _(args) args
9780 echo "$foo" >> try.c
9781 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
9782 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
9790 hasproto='varname=$1; func=$2; shift; shift;
9791 while $test $# -ge 2; do
9793 $define) echo "#include <$2>";;
9797 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
9798 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
9799 echo "$func() prototype found.";
9802 echo "$func() prototype NOT found.";
9809 : see if sys/types.h has to be included
9810 set sys/types.h i_systypes
9813 : see if sys/select.h has to be included
9814 set sys/select.h i_sysselct
9817 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
9818 while $test $# -ge 2; do
9820 $define) echo "#include <$2>";;
9824 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
9826 if eval $compile; then
9835 : see if we should include time.h, sys/time.h, or both
9837 if test "X$timeincl" = X; then
9838 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
9839 $echo $n "I'm now running the test program...$c"
9841 #include <sys/types.h>
9846 #ifdef SYSTIMEKERNEL
9849 #include <sys/time.h>
9852 #include <sys/select.h>
9865 struct timezone tzp;
9867 if (foo.tm_sec == foo.tm_sec)
9870 if (bar.tv_sec == bar.tv_sec)
9877 for s_timezone in '-DS_TIMEZONE' ''; do
9879 for s_timeval in '-DS_TIMEVAL' ''; do
9880 for i_systimek in '' '-DSYSTIMEKERNEL'; do
9881 for i_time in '' '-DI_TIME'; do
9882 for i_systime in '-DI_SYSTIME' ''; do
9885 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
9886 if eval $compile; then
9887 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
9891 $echo $n "Succeeded with $flags$c"
9903 *SYSTIMEKERNEL*) i_systimek="$define"
9904 timeincl=`./findhdr sys/time.h`
9905 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
9906 *) i_systimek="$undef";;
9909 *I_TIME*) i_time="$define"
9910 timeincl=`./findhdr time.h`" $timeincl"
9911 echo "We'll include <time.h>." >&4;;
9912 *) i_time="$undef";;
9915 *I_SYSTIME*) i_systime="$define"
9916 timeincl=`./findhdr sys/time.h`" $timeincl"
9917 echo "We'll include <sys/time.h>." >&4;;
9918 *) i_systime="$undef";;
9922 : see if struct tm knows about tm_zone
9923 case "$i_systime$i_time" in
9926 echo "Checking to see if your struct tm has tm_zone field..." >&4
9927 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
9935 case "$d_tm_tm_zone" in
9936 "$define") echo "Yes, it does." ;;
9937 *) echo "No, it doesn't." ;;
9939 : see if struct tm knows about tm_gmtoff
9940 case "$i_systime$i_time" in
9943 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
9944 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
9952 case "$d_tm_tm_gmtoff" in
9953 "$define") echo "Yes, it does." ;;
9954 *) echo "No, it doesn't." ;;
9957 : see if asctime_r exists
9958 set asctime_r d_asctime_r
9960 case "$d_asctime_r" in
9962 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
9963 case "$d_asctime_r_proto:$usethreads" in
9964 ":define") d_asctime_r_proto=define
9965 set d_asctime_r_proto asctime_r $hdrs
9969 case "$d_asctime_r_proto" in
9971 case "$asctime_r_proto" in
9972 ''|0) try='char* asctime_r(const struct tm*, char*);'
9973 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SB ;;
9975 case "$asctime_r_proto" in
9976 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
9977 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SBI ;;
9979 case "$asctime_r_proto" in
9980 ''|0) try='int asctime_r(const struct tm*, char*);'
9981 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SB ;;
9983 case "$asctime_r_proto" in
9984 ''|0) try='int asctime_r(const struct tm*, char*, int);'
9985 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SBI ;;
9987 case "$asctime_r_proto" in
9988 ''|0) d_asctime_r=undef
9990 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
9991 * ) case "$asctime_r_proto" in
9992 REENTRANT_PROTO*) ;;
9993 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
9995 echo "Prototype: $try" ;;
9998 *) case "$usethreads" in
9999 define) echo "asctime_r has no prototype, not using it." >&4 ;;
10006 *) asctime_r_proto=0
10010 : see if atolf exists
10014 : see if atoll exists
10018 : Look for GCC-style attribute format
10019 case "$d_attribute_format" in
10022 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
10023 $cat >attrib.c <<'EOCP'
10025 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
10027 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10028 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10029 echo "Your C compiler doesn't support __attribute__((format))."
10032 echo "Your C compiler supports __attribute__((format))."
10036 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10040 *) val="$d_attribute_format" ;;
10042 set d_attribute_format
10046 : Look for GCC-style attribute format with null format allowed
10047 case "$d_printf_format_null" in
10048 '') case "$d_attribute_format" in
10051 echo "Checking whether your compiler allows __printf__ format to be null ..." >&4
10052 $cat >attrib.c <<EOCP
10054 #$i_stdlib I_STDLIB
10056 #include <stdlib.h>
10058 int null_printf (char* pat,...) __attribute__((__format__(__printf__,1,2)));
10059 int null_printf (char* pat,...) { return (int)pat; }
10060 int main () { exit(null_printf(NULL)); }
10062 if $cc $ccflags -o attrib attrib.c >attrib.out 2>&1 ; then
10063 : run the executable in case it produces a run-time warning
10064 if $run ./attrib >>attrib.out 2>&1; then
10065 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10066 echo "Your C compiler doesn't allow __printf__ format to be null."
10069 echo "Your C compiler allows __printf__ format to be null."
10073 echo "Your C compiler executable failed with __printf__ format null."
10077 echo "Your C compiler fails with __printf__ format null."
10084 *) val="$d_printf_format_null" ;;
10086 set d_printf_format_null
10090 : Look for GCC-style attribute malloc
10091 case "$d_attribute_malloc" in
10094 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
10095 $cat >attrib.c <<'EOCP'
10097 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
10099 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10100 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10101 echo "Your C compiler doesn't support __attribute__((malloc))."
10104 echo "Your C compiler supports __attribute__((malloc))."
10108 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10112 *) val="$d_attribute_malloc" ;;
10114 set d_attribute_malloc
10118 : Look for GCC-style attribute nonnull
10119 case "$d_attribute_nonnull" in
10122 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
10123 $cat >attrib.c <<'EOCP'
10125 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
10127 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10128 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10129 echo "Your C compiler doesn't support __attribute__((nonnull))."
10132 echo "Your C compiler supports __attribute__((nonnull))."
10136 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10140 *) val="$d_attribute_nonnull" ;;
10142 set d_attribute_nonnull
10146 : Look for GCC-style attribute noreturn
10147 case "$d_attribute_noreturn" in
10150 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
10151 $cat >attrib.c <<'EOCP'
10153 void fall_over_dead( void ) __attribute__((noreturn));
10155 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10156 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10157 echo "Your C compiler doesn't support __attribute__((noreturn))."
10160 echo "Your C compiler supports __attribute__((noreturn))."
10164 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10168 *) val="$d_attribute_noreturn" ;;
10170 set d_attribute_noreturn
10174 : Look for GCC-style attribute pure
10175 case "$d_attribute_pure" in
10178 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
10179 $cat >attrib.c <<'EOCP'
10181 int square( int n ) __attribute__((pure));
10183 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10184 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10185 echo "Your C compiler doesn't support __attribute__((pure))."
10188 echo "Your C compiler supports __attribute__((pure))."
10192 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10196 *) val="$d_attribute_pure" ;;
10198 set d_attribute_pure
10202 : Look for GCC-style attribute unused
10203 case "$d_attribute_unused" in
10206 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
10207 $cat >attrib.c <<'EOCP'
10209 int do_something( int dummy __attribute__((unused)), int n );
10211 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10212 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10213 echo "Your C compiler doesn't support __attribute__((unused))."
10216 echo "Your C compiler supports __attribute__((unused))."
10220 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10224 *) val="$d_attribute_unused" ;;
10226 set d_attribute_unused
10230 : Look for GCC-style attribute warn_unused_result
10231 case "$d_attribute_warn_unused_result" in
10234 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
10235 $cat >attrib.c <<'EOCP'
10237 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
10239 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10240 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10241 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
10244 echo "Your C compiler supports __attribute__((warn_unused_result))."
10248 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10252 *) val="$d_attribute_warn_unused_result" ;;
10254 set d_attribute_warn_unused_result
10258 : see if bcmp exists
10262 : see if bcopy exists
10266 : see if getpgrp exists
10267 set getpgrp d_getpgrp
10270 case "$d_getpgrp" in
10273 echo "Checking to see which flavor of getpgrp is in use..."
10275 #$i_unistd I_UNISTD
10276 #include <sys/types.h>
10278 # include <unistd.h>
10280 #$i_stdlib I_STDLIB
10282 #include <stdlib.h>
10286 if (getuid() == 0) {
10287 printf("(I see you are running Configure as super-user...)\n");
10290 #ifdef TRY_BSD_PGRP
10291 if (getpgrp(1) == 0)
10300 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10301 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
10303 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10304 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
10307 echo "I can't seem to compile and run the test program."
10309 xxx="a USG one, i.e. you use getpgrp()."
10311 # SVR4 systems can appear rather BSD-ish.
10312 case "$i_unistd" in
10314 xxx="a BSD one, i.e. you use getpgrp(pid)."
10318 xxx="probably a USG one, i.e. you use getpgrp()."
10323 echo "Assuming your getpgrp is $xxx" >&4
10332 : see if setpgrp exists
10333 set setpgrp d_setpgrp
10336 case "$d_setpgrp" in
10339 echo "Checking to see which flavor of setpgrp is in use..."
10341 #$i_unistd I_UNISTD
10342 #include <sys/types.h>
10344 # include <unistd.h>
10346 #$i_stdlib I_STDLIB
10348 #include <stdlib.h>
10352 if (getuid() == 0) {
10353 printf("(I see you are running Configure as super-user...)\n");
10356 #ifdef TRY_BSD_PGRP
10357 if (-1 == setpgrp(1, 1))
10360 if (setpgrp() != -1)
10366 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10367 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
10369 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10370 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
10373 echo "(I can't seem to compile and run the test program.)"
10375 xxx="a USG one, i.e. you use setpgrp()."
10377 # SVR4 systems can appear rather BSD-ish.
10378 case "$i_unistd" in
10380 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
10384 xxx="probably a USG one, i.e. you use setpgrp()."
10389 echo "Assuming your setpgrp is $xxx" >&4
10398 : Look for GCC-style __builtin_choose_expr
10399 case "$d_builtin_choose_expr" in
10402 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
10403 $cat >try.c <<'EOCP'
10404 #include <assert.h>
10405 #include <stdlib.h>
10408 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
10411 assert( SYRINX(1) == 2112 );
10412 assert( SYRINX(1) != 5150 );
10413 assert( SYRINX(0) == 5150 );
10414 assert( SYRINX(0) != 2112 );
10415 puts( "All good!" );
10421 if eval $compile; then
10422 echo "Your C compiler supports __builtin_choose_expr."
10425 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
10429 *) val="$d_builtin_choose_expr" ;;
10432 set d_builtin_choose_expr
10436 : Look for GCC-style __builtin_expect
10437 case "$d_builtin_expect" in
10440 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
10441 $cat >builtin.c <<'EOCP'
10444 if ( __builtin_expect(n, 0) ) n = 1;
10448 if eval $compile; then
10449 echo "Your C compiler supports __builtin_choose_expr."
10452 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
10456 *) val="$d_builtin_expect" ;;
10459 set d_builtin_expect
10463 : see if bzero exists
10467 : see if stdarg is available
10469 if $test `./findhdr stdarg.h`; then
10470 echo "<stdarg.h> found." >&4
10473 echo "<stdarg.h> NOT found." >&4
10477 : see if varags is available
10479 if $test `./findhdr varargs.h`; then
10480 echo "<varargs.h> found." >&4
10482 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
10485 : set up the varargs testing programs
10486 $cat > varargs.c <<EOP
10488 #include <stdarg.h>
10491 #include <varargs.h>
10495 int f(char *p, ...)
10509 p = va_arg(ap, char *);
10515 $cat > varargs <<EOP
10517 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
10526 : now check which varargs header should be included
10531 if `./varargs I_STDARG`; then
10533 elif `./varargs I_VARARGS`; then
10538 if `./varargs I_VARARGS`; then
10545 echo "I could not find the definition for va_dcl... You have problems..." >&4
10546 val="$undef"; set i_stdarg; eval $setvar
10547 val="$undef"; set i_varargs; eval $setvar
10552 case "$i_varhdr" in
10554 val="$define"; set i_stdarg; eval $setvar
10555 val="$undef"; set i_varargs; eval $setvar
10558 val="$undef"; set i_stdarg; eval $setvar
10559 val="$define"; set i_varargs; eval $setvar
10562 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
10566 : see if the Compiler supports C99 variadic macros
10567 case "$i_stdarg$i_stdlib" in
10569 echo "You have <stdarg.h> and <stdlib.h>, so checking for C99 variadic macros." >&4
10572 #include <stdarg.h>
10574 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
10578 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
10584 if eval $compile && $run ./try 2>&1 >/dev/null; then
10585 case "`$run ./try`" in
10587 echo "You have C99 variadic macros." >&4
10588 d_c99_variadic_macros="$define"
10591 echo "You don't have functional C99 variadic macros." >&4
10592 d_c99_variadic_macros="$undef"
10596 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
10597 d_c99_variadic_macros="$undef"
10602 echo "You don't have <stdarg.h> and <stdlib.h>, so not checking for C99 variadic macros." >&4
10603 d_c99_variadic_macros="$undef"
10607 : see if signal is declared as pointer to function returning int or void
10609 xxx=`./findhdr signal.h`
10610 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
10611 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10612 echo "You have int (*signal())() instead of void." >&4
10614 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10615 echo "You have void (*signal())()." >&4
10617 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
10618 echo "You have int (*signal())() instead of void." >&4
10620 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
10621 echo "You have void (*signal())()." >&4
10624 case "$d_voidsig" in
10626 echo "I can't determine whether signal handler returns void or int..." >&4
10628 rp="What type does your signal handler return?"
10631 v*) val="$define";;
10635 echo "As you already told me, signal handler returns void." >&4
10638 *) echo "As you already told me, signal handler returns int." >&4
10645 case "$d_voidsig" in
10646 "$define") signal_t="void";;
10647 *) signal_t="int";;
10651 : check for ability to cast large floats to 32-bit ints.
10653 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
10654 if $test "$intsize" -ge 4; then
10661 #$i_stdlib I_STDLIB
10663 #include <stdlib.h>
10665 #include <sys/types.h>
10666 #include <signal.h>
10667 $signal_t blech(int s) { exit(3); }
10674 signal(SIGFPE, blech);
10676 /* Don't let compiler optimize the test away. Store the number
10677 in a writable string for gcc to pass to sscanf under HP/UX.
10679 sprintf(str, "2147483647");
10680 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
10684 /* x86 processors will probably give 0x8000 0000, which is a
10685 sign change. We don't want that. We want to mimic SPARC
10686 behavior here, which is to preserve the sign and give
10689 if (i32 != ($xxx) f)
10695 if eval $compile_ok; then
10699 echo "(I can't seem to compile the test program--assuming it can't)"
10704 echo "Yup, it can."
10707 echo "Nope, it can't."
10714 : check for ability to cast negative floats to unsigned
10716 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
10719 #$i_stdlib I_STDLIB
10721 #include <stdlib.h>
10723 #include <sys/types.h>
10724 #include <signal.h>
10725 $signal_t blech(int s) { exit(7); }
10726 $signal_t blech_in_list(int s) { exit(4); }
10727 unsigned long dummy_long(unsigned long p) { return p; }
10728 unsigned int dummy_int(unsigned int p) { return p; }
10729 unsigned short dummy_short(unsigned short p) { return p; }
10733 unsigned long along;
10735 unsigned short ashort;
10739 /* Frustrate gcc-2.7.2's optimizer which failed this test with
10740 a direct f = -123. assignment. gcc-2.8.0 reportedly
10741 optimized the whole file away
10743 /* Store the number in a writable string for gcc to pass to
10744 sscanf under HP/UX.
10746 sprintf(str, "-123");
10747 sscanf(str, "%lf", &f); /* f = -123.; */
10749 signal(SIGFPE, blech);
10750 along = (unsigned long)f;
10751 aint = (unsigned int)f;
10752 ashort = (unsigned short)f;
10753 if (along != (unsigned long)-123)
10755 if (aint != (unsigned int)-123)
10757 if (ashort != (unsigned short)-123)
10759 sprintf(str, "1073741824.");
10760 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
10763 along = (unsigned long)f;
10764 if (along != 0x80000000)
10768 along = (unsigned long)f;
10769 if (along != 0x7fffffff)
10773 along = (unsigned long)f;
10774 if (along != 0x80000001)
10778 signal(SIGFPE, blech_in_list);
10779 sprintf(str, "123.");
10780 sscanf(str, "%lf", &f); /* f = 123.; */
10781 along = dummy_long((unsigned long)f);
10782 aint = dummy_int((unsigned int)f);
10783 ashort = dummy_short((unsigned short)f);
10784 if (along != (unsigned long)123)
10786 if (aint != (unsigned int)123)
10788 if (ashort != (unsigned short)123)
10795 if eval $compile_ok; then
10799 echo "(I can't seem to compile the test program--assuming it can't)"
10802 case "$castflags" in
10804 echo "Yup, it can."
10807 echo "Nope, it can't."
10814 : see if vprintf exists
10816 if set vprintf val -f d_vprintf; eval $csym; $val; then
10817 echo 'vprintf() found.' >&4
10820 #$i_stdarg I_STDARG /* Only one of these can be defined by i_varhrd */
10821 #$i_varargs I_VARARGS
10823 #$i_stdlib I_STDLIB
10824 #$i_unistd I_UNISTD
10827 # include <stdarg.h>
10828 #else /* I_VARARGS */
10829 # include <varargs.h>
10833 # include <unistd.h>
10837 # include <stdlib.h>
10840 #include <stdio.h> /* vsprintf prototype */
10843 void xxx(int n, ...)
10848 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
10850 int main() { xxx(1, "foo"); }
10852 #else /* I_VARARGS */
10860 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
10862 int main() { xxx("foo"); }
10868 if eval $compile_ok; then
10869 if $run ./try; then
10870 echo "Your vsprintf() returns (int)." >&4
10873 echo "Your vsprintf() returns (char*)." >&4
10877 echo 'I am unable to compile the vsprintf() test program.' >&4
10878 # We shouldn't get here. If we do, assume the standard signature,
10879 # not the old BSD one.
10880 echo 'Guessing that vsprintf() returns (int).' >&4
10884 echo 'vprintf() NOT found.' >&4
10895 : see if chown exists
10899 : see if chroot exists
10900 set chroot d_chroot
10903 : see if chsize exists
10904 set chsize d_chsize
10907 : see if class exists
10911 : see if clearenv exists
10912 set clearenv d_clearenv
10915 hasstruct='varname=$1; struct=$2; shift; shift;
10916 while $test $# -ge 2; do
10918 $define) echo "#include <$2>";;
10922 echo "int main () { struct $struct foo; }" >> try.c;
10924 if eval $compile; then
10935 : see whether socket exists
10937 $echo $n "Hmm... $c" >&4
10938 if set socket val -f d_socket; eval $csym; $val; then
10939 echo "Looks like you have Berkeley networking support." >&4
10941 if set setsockopt val -f; eval $csym; $val; then
10944 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
10945 d_oldsock="$define"
10948 if $contains socklib libc.list >/dev/null 2>&1; then
10949 echo "Looks like you have Berkeley networking support." >&4
10951 : we will have to assume that it supports the 4.2 BSD interface
10954 echo "You don't have Berkeley networking in libc$_a..." >&4
10955 if test "X$d_socket" = "X$define"; then
10956 echo "...but you seem to believe that you have sockets." >&4
10958 for net in net socket
10960 if test -f /usr/lib/lib$net$_a; then
10961 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
10962 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
10963 if $contains socket libc.list >/dev/null 2>&1; then
10968 echo "...but the Wollongong group seems to have hacked it in." >&4
10969 sockethdr="-I/usr/netinclude"
10972 echo "Found Berkeley sockets interface in lib$net." >&4
10973 if $contains setsockopt libc.list >/dev/null 2>&1; then
10976 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
10977 d_oldsock="$define"
10983 if test "X$d_socket" != "X$define"; then
10984 echo "or anywhere else I see." >&4
10992 : see if socketpair exists
10993 set socketpair d_sockpair
10998 echo "Checking the availability of certain socket constants..." >&4
10999 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
11000 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
11002 #include <sys/types.h>
11003 #include <sys/socket.h>
11009 set try; if eval $compile; then
11012 set d_${enum}; eval $setvar
11016 : see if this is a sys/uio.h system
11017 set sys/uio.h i_sysuio
11022 echo "Checking to see if your system supports struct cmsghdr..." >&4
11023 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
11025 case "$d_cmsghdr_s" in
11026 "$define") echo "Yes, it does." ;;
11027 *) echo "No, it doesn't." ;;
11031 : check for const keyword
11033 echo 'Checking to see if your C compiler knows about "const"...' >&4
11034 $cat >const.c <<'EOCP'
11035 typedef struct spug { int drokk; } spug;
11039 const spug y = { 0 };
11042 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
11044 echo "Yup, it does."
11047 echo "Nope, it doesn't."
11052 : see if copysignl exists
11053 set copysignl d_copysignl
11056 : see if crypt exists
11061 $define) cryptlib='' ;;
11062 *) if set crypt val -f d_crypt; eval $csym; $val; then
11063 echo 'crypt() found.' >&4
11067 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
11068 if $test -z "$cryptlib"; then
11069 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
11073 if $test -z "$cryptlib"; then
11074 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
11078 if $test -z "$cryptlib"; then
11079 cryptlib=`./loc libcrypt$_a "" $libpth`
11083 if $test -z "$cryptlib"; then
11084 echo 'crypt() NOT found.' >&4
11095 : see if this is a crypt.h system
11096 set crypt.h i_crypt
11099 : see if crypt_r exists
11100 set crypt_r d_crypt_r
11102 case "$d_crypt_r" in
11104 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
11105 case "$d_crypt_r_proto:$usethreads" in
11106 ":define") d_crypt_r_proto=define
11107 set d_crypt_r_proto crypt_r $hdrs
11111 case "$d_crypt_r_proto" in
11113 case "$crypt_r_proto" in
11114 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
11115 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCS ;;
11117 case "$crypt_r_proto" in
11118 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
11119 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCD ;;
11121 case "$crypt_r_proto" in
11122 ''|0) d_crypt_r=undef
11124 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
11125 * ) case "$crypt_r_proto" in
11126 REENTRANT_PROTO*) ;;
11127 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
11129 echo "Prototype: $try" ;;
11132 *) case "$usethreads" in
11133 define) echo "crypt_r has no prototype, not using it." >&4 ;;
11144 : get csh whereabouts
11146 'csh') val="$undef" ;;
11147 *) val="$define" ;;
11151 : Respect a hint or command line value for full_csh.
11152 case "$full_csh" in
11153 '') full_csh=$csh ;;
11156 : see if ctermid exists
11157 set ctermid d_ctermid
11160 : see if ctermid_r exists
11161 set ctermid_r d_ctermid_r
11163 case "$d_ctermid_r" in
11165 hdrs="$i_systypes sys/types.h define stdio.h "
11166 case "$d_ctermid_r_proto:$usethreads" in
11167 ":define") d_ctermid_r_proto=define
11168 set d_ctermid_r_proto ctermid_r $hdrs
11172 case "$d_ctermid_r_proto" in
11174 case "$ctermid_r_proto" in
11175 ''|0) try='char* ctermid_r(char*);'
11176 ./protochk "extern $try" $hdrs && ctermid_r_proto=B_B ;;
11178 case "$ctermid_r_proto" in
11179 ''|0) d_ctermid_r=undef
11181 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
11182 * ) case "$ctermid_r_proto" in
11183 REENTRANT_PROTO*) ;;
11184 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
11186 echo "Prototype: $try" ;;
11189 *) case "$usethreads" in
11190 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
11197 *) ctermid_r_proto=0
11201 : see if ctime_r exists
11202 set ctime_r d_ctime_r
11204 case "$d_ctime_r" in
11206 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
11207 case "$d_ctime_r_proto:$usethreads" in
11208 ":define") d_ctime_r_proto=define
11209 set d_ctime_r_proto ctime_r $hdrs
11213 case "$d_ctime_r_proto" in
11215 case "$ctime_r_proto" in
11216 ''|0) try='char* ctime_r(const time_t*, char*);'
11217 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SB ;;
11219 case "$ctime_r_proto" in
11220 ''|0) try='char* ctime_r(const time_t*, char*, int);'
11221 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SBI ;;
11223 case "$ctime_r_proto" in
11224 ''|0) try='int ctime_r(const time_t*, char*);'
11225 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SB ;;
11227 case "$ctime_r_proto" in
11228 ''|0) try='int ctime_r(const time_t*, char*, int);'
11229 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SBI ;;
11231 case "$ctime_r_proto" in
11232 ''|0) d_ctime_r=undef
11234 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
11235 * ) case "$ctime_r_proto" in
11236 REENTRANT_PROTO*) ;;
11237 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
11239 echo "Prototype: $try" ;;
11242 *) case "$usethreads" in
11243 define) echo "ctime_r has no prototype, not using it." >&4 ;;
11254 : see if cuserid exists
11255 set cuserid d_cuserid
11258 : see if this is a limits.h system
11259 set limits.h i_limits
11262 : see if this is a float.h system
11263 set float.h i_float
11266 : See if number of significant digits in a double precision number is known
11268 $cat >dbl_dig.c <<EOM
11269 #$i_limits I_LIMITS
11272 #include <limits.h>
11278 printf("Contains DBL_DIG");
11281 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
11282 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
11283 echo "DBL_DIG found." >&4
11286 echo "DBL_DIG NOT found." >&4
11293 : see if dbm.h is available
11294 : see if dbmclose exists
11295 set dbmclose d_dbmclose
11298 case "$d_dbmclose" in
11308 *) set rpcsvc/dbm.h i_rpcsvcdbm
11313 *) echo "We won't be including <dbm.h>"
11323 : see if prototype for dbminit is available
11325 set d_dbminitproto dbminit $i_dbm dbm.h
11328 : see if difftime exists
11329 set difftime d_difftime
11332 : see if this is a dirent system
11334 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
11336 echo "<dirent.h> found." >&4
11339 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
11340 echo "<sys/dir.h> found." >&4
11343 xinc=`./findhdr sys/ndir.h`
11345 echo "<dirent.h> NOT found." >&4
11350 : Look for type of directory structure.
11352 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11354 case "$direntrytype" in
11356 case "$i_dirent" in
11357 $define) guess1='struct dirent' ;;
11358 *) guess1='struct direct' ;;
11361 *) guess1="$direntrytype"
11366 'struct dirent') guess2='struct direct' ;;
11367 *) guess2='struct dirent' ;;
11370 if $contains "$guess1" try.c >/dev/null 2>&1; then
11371 direntrytype="$guess1"
11372 echo "Your directory entries are $direntrytype." >&4
11373 elif $contains "$guess2" try.c >/dev/null 2>&1; then
11374 direntrytype="$guess2"
11375 echo "Your directory entries seem to be $direntrytype." >&4
11377 echo "I don't recognize your system's directory entries." >&4
11378 rp="What type is used for directory entries on this system?"
11381 direntrytype="$ans"
11385 : see if the directory entry stores field length
11387 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11388 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
11389 echo "Good, your directory entry keeps length information in d_namlen." >&4
11392 echo "Your directory entry does not know about the d_namlen field." >&4
11399 : Look for DIR.dd_fd
11400 case "$i_dirent" in
11402 echo "Checking to see if DIR has a dd_fd member variable" >&4
11404 #$i_stdlib I_STDLIB
11406 #include <stdlib.h>
11408 #include <dirent.h>
11418 if eval $compile; then
11419 echo "Yes, it does."
11422 echo "No, it does not."
11427 echo "You don't have a <dirent.h>, so not checking for dd_fd." >&4
11435 : see if this is an sysdir system
11436 set sys/dir.h i_sysdir
11439 : see if this is an sysndir system
11440 set sys/ndir.h i_sysndir
11445 $cat >dirfd.c <<EOM
11447 #$i_stdlib I_STDLIB
11449 #include <stdlib.h>
11451 #$i_dirent I_DIRENT /**/
11452 #$i_sysdir I_SYS_DIR /**/
11453 #$i_sysndir I_SYS_NDIR /**/
11454 #$i_systypes I_SYS_TYPES /**/
11455 #if defined(I_SYS_TYPES)
11456 #include <sys/types.h>
11458 #if defined(I_DIRENT)
11459 #include <dirent.h>
11460 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
11461 #include <sys/dir.h>
11465 #include <sys/ndir.h>
11469 #include <ndir.h> /* may be wrong in the future */
11471 #include <sys/dir.h>
11477 DIR *dirp = opendir(".");
11478 if (dirfd(dirp) >= 0)
11486 if eval $compile; then
11490 $define) echo "dirfd() found." >&4 ;;
11491 *) echo "dirfd() NOT found." >&4 ;;
11497 : see if dlerror exists
11500 set dlerror d_dlerror
11504 : see if dlfcn is available
11505 set dlfcn.h i_dlfcn
11512 On a few systems, the dynamically loaded modules that perl generates and uses
11513 will need a different extension than shared libs. The default will probably
11519 *) dflt="$dlext" ;;
11521 rp='What is the extension of dynamically loaded modules'
11530 : Check if dlsym need a leading underscore
11536 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
11537 $cat >dyna.c <<'EOM'
11544 #$i_stdlib I_STDLIB
11546 #include <stdlib.h>
11550 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
11552 #include <sys/types.h>
11557 extern int fred() ;
11566 int mode = RTLD_LAZY ;
11568 handle = dlopen("./dyna.$dlext", mode) ;
11569 if (handle == NULL) {
11574 symbol = dlsym(handle, "fred") ;
11575 if (symbol == NULL) {
11576 /* try putting a leading underscore */
11577 symbol = dlsym(handle, "_fred") ;
11578 if (symbol == NULL) {
11591 : Call the object file tmp-dyna.o in case dlext=o.
11592 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
11593 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
11594 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
11595 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
11598 1) echo "Test program failed using dlopen." >&4
11599 echo "Perhaps you should not use dynamic loading." >&4;;
11600 2) echo "Test program failed using dlsym." >&4
11601 echo "Perhaps you should not use dynamic loading." >&4;;
11602 3) echo "dlsym needs a leading underscore" >&4
11604 4) echo "dlsym doesn't need a leading underscore." >&4;;
11607 echo "I can't compile and run the test program." >&4
11608 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
11613 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
11618 : see if drand48_r exists
11619 set drand48_r d_drand48_r
11621 case "$d_drand48_r" in
11623 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
11624 case "$d_drand48_r_proto:$usethreads" in
11625 ":define") d_drand48_r_proto=define
11626 set d_drand48_r_proto drand48_r $hdrs
11630 case "$d_drand48_r_proto" in
11632 case "$drand48_r_proto" in
11633 ''|0) try='int drand48_r(struct drand48_data*, double*);'
11634 ./protochk "extern $try" $hdrs && drand48_r_proto=I_ST ;;
11636 case "$drand48_r_proto" in
11637 ''|0) d_drand48_r=undef
11639 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
11640 * ) case "$drand48_r_proto" in
11641 REENTRANT_PROTO*) ;;
11642 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
11644 echo "Prototype: $try" ;;
11647 *) case "$usethreads" in
11648 define) echo "drand48_r has no prototype, not using it." >&4 ;;
11655 *) drand48_r_proto=0
11659 : see if prototype for drand48 is available
11661 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
11664 : see if dup2 exists
11668 : see if eaccess exists
11669 set eaccess d_eaccess
11672 : see if endgrent exists
11673 set endgrent d_endgrent
11676 : see if this is an grp system
11682 xxx=`./findhdr grp.h`
11683 $cppstdin $cppflags $cppminus < $xxx >$$.h
11685 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
11697 set d_grpasswd; eval $setvar
11701 : see if endgrent_r exists
11702 set endgrent_r d_endgrent_r
11704 case "$d_endgrent_r" in
11706 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
11707 case "$d_endgrent_r_proto:$usethreads" in
11708 ":define") d_endgrent_r_proto=define
11709 set d_endgrent_r_proto endgrent_r $hdrs
11713 case "$d_endgrent_r_proto" in
11715 case "$endgrent_r_proto" in
11716 ''|0) try='int endgrent_r(FILE**);'
11717 ./protochk "extern $try" $hdrs && endgrent_r_proto=I_H ;;
11719 case "$endgrent_r_proto" in
11720 ''|0) try='void endgrent_r(FILE**);'
11721 ./protochk "extern $try" $hdrs && endgrent_r_proto=V_H ;;
11723 case "$endgrent_r_proto" in
11724 ''|0) d_endgrent_r=undef
11726 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
11727 * ) case "$endgrent_r_proto" in
11728 REENTRANT_PROTO*) ;;
11729 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
11731 echo "Prototype: $try" ;;
11734 *) case "$usethreads" in
11735 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
11742 *) endgrent_r_proto=0
11746 : see if endhostent exists
11747 set endhostent d_endhent
11750 : see if this is a netdb.h system
11751 set netdb.h i_netdb
11754 : see if endhostent_r exists
11755 set endhostent_r d_endhostent_r
11757 case "$d_endhostent_r" in
11759 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11760 case "$d_endhostent_r_proto:$usethreads" in
11761 ":define") d_endhostent_r_proto=define
11762 set d_endhostent_r_proto endhostent_r $hdrs
11766 case "$d_endhostent_r_proto" in
11768 case "$endhostent_r_proto" in
11769 ''|0) try='int endhostent_r(struct hostent_data*);'
11770 ./protochk "extern $try" $hdrs && endhostent_r_proto=I_D ;;
11772 case "$endhostent_r_proto" in
11773 ''|0) try='void endhostent_r(struct hostent_data*);'
11774 ./protochk "extern $try" $hdrs && endhostent_r_proto=V_D ;;
11776 case "$endhostent_r_proto" in
11777 ''|0) d_endhostent_r=undef
11778 endhostent_r_proto=0
11779 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
11780 * ) case "$endhostent_r_proto" in
11781 REENTRANT_PROTO*) ;;
11782 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
11784 echo "Prototype: $try" ;;
11787 *) case "$usethreads" in
11788 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
11790 d_endhostent_r=undef
11791 endhostent_r_proto=0
11795 *) endhostent_r_proto=0
11799 : see if endnetent exists
11800 set endnetent d_endnent
11803 : see if endnetent_r exists
11804 set endnetent_r d_endnetent_r
11806 case "$d_endnetent_r" in
11808 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11809 case "$d_endnetent_r_proto:$usethreads" in
11810 ":define") d_endnetent_r_proto=define
11811 set d_endnetent_r_proto endnetent_r $hdrs
11815 case "$d_endnetent_r_proto" in
11817 case "$endnetent_r_proto" in
11818 ''|0) try='int endnetent_r(struct netent_data*);'
11819 ./protochk "extern $try" $hdrs && endnetent_r_proto=I_D ;;
11821 case "$endnetent_r_proto" in
11822 ''|0) try='void endnetent_r(struct netent_data*);'
11823 ./protochk "extern $try" $hdrs && endnetent_r_proto=V_D ;;
11825 case "$endnetent_r_proto" in
11826 ''|0) d_endnetent_r=undef
11827 endnetent_r_proto=0
11828 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
11829 * ) case "$endnetent_r_proto" in
11830 REENTRANT_PROTO*) ;;
11831 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
11833 echo "Prototype: $try" ;;
11836 *) case "$usethreads" in
11837 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
11839 d_endnetent_r=undef
11840 endnetent_r_proto=0
11844 *) endnetent_r_proto=0
11848 : see if endprotoent exists
11849 set endprotoent d_endpent
11852 : see if endprotoent_r exists
11853 set endprotoent_r d_endprotoent_r
11855 case "$d_endprotoent_r" in
11857 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11858 case "$d_endprotoent_r_proto:$usethreads" in
11859 ":define") d_endprotoent_r_proto=define
11860 set d_endprotoent_r_proto endprotoent_r $hdrs
11864 case "$d_endprotoent_r_proto" in
11866 case "$endprotoent_r_proto" in
11867 ''|0) try='int endprotoent_r(struct protoent_data*);'
11868 ./protochk "extern $try" $hdrs && endprotoent_r_proto=I_D ;;
11870 case "$endprotoent_r_proto" in
11871 ''|0) try='void endprotoent_r(struct protoent_data*);'
11872 ./protochk "extern $try" $hdrs && endprotoent_r_proto=V_D ;;
11874 case "$endprotoent_r_proto" in
11875 ''|0) d_endprotoent_r=undef
11876 endprotoent_r_proto=0
11877 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
11878 * ) case "$endprotoent_r_proto" in
11879 REENTRANT_PROTO*) ;;
11880 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
11882 echo "Prototype: $try" ;;
11885 *) case "$usethreads" in
11886 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
11888 d_endprotoent_r=undef
11889 endprotoent_r_proto=0
11893 *) endprotoent_r_proto=0
11897 : see if endpwent exists
11898 set endpwent d_endpwent
11901 : see if this is a pwd.h system
11907 xxx=`./findhdr pwd.h`
11908 $cppstdin $cppflags $cppminus < $xxx >$$.h
11910 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
11918 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
11926 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
11934 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
11942 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
11950 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
11958 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
11966 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
11978 set d_pwquota; eval $setvar
11979 set d_pwage; eval $setvar
11980 set d_pwchange; eval $setvar
11981 set d_pwclass; eval $setvar
11982 set d_pwexpire; eval $setvar
11983 set d_pwcomment; eval $setvar
11984 set d_pwgecos; eval $setvar
11985 set d_pwpasswd; eval $setvar
11989 : see if endpwent_r exists
11990 set endpwent_r d_endpwent_r
11992 case "$d_endpwent_r" in
11994 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
11995 case "$d_endpwent_r_proto:$usethreads" in
11996 ":define") d_endpwent_r_proto=define
11997 set d_endpwent_r_proto endpwent_r $hdrs
12001 case "$d_endpwent_r_proto" in
12003 case "$endpwent_r_proto" in
12004 ''|0) try='int endpwent_r(FILE**);'
12005 ./protochk "extern $try" $hdrs && endpwent_r_proto=I_H ;;
12007 case "$endpwent_r_proto" in
12008 ''|0) try='void endpwent_r(FILE**);'
12009 ./protochk "extern $try" $hdrs && endpwent_r_proto=V_H ;;
12011 case "$endpwent_r_proto" in
12012 ''|0) d_endpwent_r=undef
12014 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
12015 * ) case "$endpwent_r_proto" in
12016 REENTRANT_PROTO*) ;;
12017 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
12019 echo "Prototype: $try" ;;
12022 *) case "$usethreads" in
12023 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
12030 *) endpwent_r_proto=0
12034 : see if endservent exists
12035 set endservent d_endsent
12038 : see if endservent_r exists
12039 set endservent_r d_endservent_r
12041 case "$d_endservent_r" in
12043 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12044 case "$d_endservent_r_proto:$usethreads" in
12045 ":define") d_endservent_r_proto=define
12046 set d_endservent_r_proto endservent_r $hdrs
12050 case "$d_endservent_r_proto" in
12052 case "$endservent_r_proto" in
12053 ''|0) try='int endservent_r(struct servent_data*);'
12054 ./protochk "extern $try" $hdrs && endservent_r_proto=I_D ;;
12056 case "$endservent_r_proto" in
12057 ''|0) try='void endservent_r(struct servent_data*);'
12058 ./protochk "extern $try" $hdrs && endservent_r_proto=V_D ;;
12060 case "$endservent_r_proto" in
12061 ''|0) d_endservent_r=undef
12062 endservent_r_proto=0
12063 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
12064 * ) case "$endservent_r_proto" in
12065 REENTRANT_PROTO*) ;;
12066 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
12068 echo "Prototype: $try" ;;
12071 *) case "$usethreads" in
12072 define) echo "endservent_r has no prototype, not using it." >&4 ;;
12074 d_endservent_r=undef
12075 endservent_r_proto=0
12079 *) endservent_r_proto=0
12083 : Locate the flags for 'open()'
12086 #include <sys/types.h>
12091 #include <sys/file.h>
12093 #$i_stdlib I_STDLIB
12095 #include <stdlib.h>
12106 : check sys/file.h first to get FREAD on Sun
12107 if $test `./findhdr sys/file.h` && \
12108 set try -DI_SYS_FILE && eval $compile; then
12110 echo "<sys/file.h> defines the O_* constants..." >&4
12111 if $run ./try; then
12112 echo "and you have the 3 argument form of open()." >&4
12115 echo "but not the 3 argument form of open(). Oh, well." >&4
12118 elif $test `./findhdr fcntl.h` && \
12119 set try -DI_FCNTL && eval $compile; then
12121 echo "<fcntl.h> defines the O_* constants..." >&4
12122 if $run ./try; then
12123 echo "and you have the 3 argument form of open()." >&4
12126 echo "but not the 3 argument form of open(). Oh, well." >&4
12131 echo "I can't find the O_* constant definitions! You got problems." >&4
12137 : see which of string.h or strings.h is needed
12139 strings=`./findhdr string.h`
12140 if $test "$strings" && $test -r "$strings"; then
12141 echo "Using <string.h> instead of <strings.h>." >&4
12145 strings=`./findhdr strings.h`
12146 if $test "$strings" && $test -r "$strings"; then
12147 echo "Using <strings.h> instead of <string.h>." >&4
12149 echo "No string header found -- You'll surely have problems." >&4
12154 case "$i_string" in
12155 "$undef") strings=`./findhdr strings.h`;;
12156 *) strings=`./findhdr string.h`;;
12159 : see if this is a sys/file.h system
12164 : do we need to include sys/file.h ?
12168 if $h_sysfile; then
12170 echo "We'll be including <sys/file.h>." >&4
12173 echo "We won't be including <sys/file.h>." >&4
12183 : see if fcntl.h is there
12188 : see if we can include fcntl.h
12194 echo "We'll be including <fcntl.h>." >&4
12197 if $h_sysfile; then
12198 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
12200 echo "We won't be including <fcntl.h>." >&4
12212 : see if fork exists
12216 : see if pipe exists
12220 : check for non-blocking I/O stuff
12221 case "$h_sysfile" in
12222 true) echo "#include <sys/file.h>" > head.c;;
12225 true) echo "#include <fcntl.h>" > head.c;;
12226 *) echo "#include <sys/fcntl.h>" > head.c;;
12231 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
12232 case "$o_nonblock" in
12234 $cat head.c > try.c
12235 $cat >>try.c <<EOCP
12237 #$i_stdlib I_STDLIB
12239 #include <stdlib.h>
12247 printf("O_NONBLOCK\n");
12251 printf("O_NDELAY\n");
12255 printf("FNDELAY\n");
12262 if eval $compile_ok; then
12263 o_nonblock=`$run ./try`
12264 case "$o_nonblock" in
12265 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
12266 *) echo "Seems like we can use $o_nonblock.";;
12269 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
12272 *) echo "Using $hint value $o_nonblock.";;
12277 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
12280 case "$d_fork:$d_pipe" in
12282 $cat head.c > try.c
12283 $cat >>try.c <<EOCP
12285 #include <sys/types.h>
12286 #include <signal.h>
12288 #$i_stdlib I_STDLIB
12290 #include <stdlib.h>
12296 #define MY_O_NONBLOCK $o_nonblock
12297 #ifndef errno /* XXX need better Configure test */
12300 #$i_unistd I_UNISTD
12302 #include <unistd.h>
12304 #$i_string I_STRING
12306 #include <string.h>
12308 #include <strings.h>
12310 $signal_t blech(int x) { exit(3); }
12312 $cat >> try.c <<'EOCP'
12320 pipe(pd); /* Down: child -> parent */
12321 pipe(pu); /* Up: parent -> child */
12324 close(pd[1]); /* Parent reads from pd[0] */
12325 close(pu[0]); /* Parent writes (blocking) to pu[1] */
12327 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
12332 signal(SIGALRM, blech);
12334 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
12336 sprintf(string, "%d\n", ret);
12337 write(2, string, strlen(string));
12340 if (errno == EAGAIN) {
12341 printf("EAGAIN\n");
12346 if (errno == EWOULDBLOCK)
12347 printf("EWOULDBLOCK\n");
12350 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
12351 sleep(2); /* Give it time to close our pipe */
12353 ret = read(pd[0], buf, 1); /* Should read EOF */
12355 sprintf(string, "%d\n", ret);
12356 write(4, string, strlen(string));
12360 close(pd[0]); /* We write to pd[1] */
12361 close(pu[1]); /* We read from pu[0] */
12362 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
12363 close(pd[1]); /* Pipe pd is now fully closed! */
12364 exit(0); /* Bye bye, thank you for playing! */
12368 if eval $compile_ok; then
12369 echo "$startsh" >mtry
12370 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
12372 ./mtry >/dev/null 2>&1
12374 0) eagain=`$cat try.out`;;
12375 1) echo "Could not perform non-blocking setting!";;
12376 2) echo "I did a successful read() for something that was not there!";;
12377 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
12378 4) echo "Could not find F_SETFL!";;
12379 *) echo "Something terribly wrong happened during testing.";;
12381 rd_nodata=`$cat try.ret`
12382 echo "A read() system call with no data present returns $rd_nodata."
12383 case "$rd_nodata" in
12386 echo "(That's peculiar, fixing that to be -1.)"
12392 echo "Forcing errno EAGAIN on read() with no data available."
12396 echo "Your read() sets errno to $eagain when no data is available."
12399 status=`$cat try.err`
12401 0) echo "And it correctly returns 0 to signal EOF.";;
12402 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
12403 *) echo "However, your read() returns '$status' on EOF??";;
12406 if test "$status" = "$rd_nodata"; then
12407 echo "WARNING: you can't distinguish between EOF and no data!"
12411 echo "I can't compile the test program--assuming errno EAGAIN will do."
12415 *) echo "Can't figure out how to test this--assuming errno EAGAIN will do."
12424 echo "Using $hint value $eagain."
12425 echo "Your read() returns $rd_nodata when no data is present."
12426 case "$d_eofnblk" in
12427 "$define") echo "And you can see EOF because read() returns 0.";;
12428 "$undef") echo "But you can't see EOF status from read() returned value.";;
12430 echo "(Assuming you can't see EOF status from read anyway.)"
12436 $rm_try head.c mtry
12438 : see if _ptr and _cnt from stdio act std
12441 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
12442 echo "(Looks like you have stdio.h from BSD.)"
12443 case "$stdio_ptr" in
12444 '') stdio_ptr='((fp)->_p)'
12447 *) ptr_lval=$d_stdio_ptr_lval;;
12449 case "$stdio_cnt" in
12450 '') stdio_cnt='((fp)->_r)'
12453 *) cnt_lval=$d_stdio_cnt_lval;;
12455 case "$stdio_base" in
12456 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
12458 case "$stdio_bufsiz" in
12459 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
12461 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
12462 echo "(Looks like you have stdio.h from Linux.)"
12463 case "$stdio_ptr" in
12464 '') stdio_ptr='((fp)->_IO_read_ptr)'
12467 *) ptr_lval=$d_stdio_ptr_lval;;
12469 case "$stdio_cnt" in
12470 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
12473 *) cnt_lval=$d_stdio_cnt_lval;;
12475 case "$stdio_base" in
12476 '') stdio_base='((fp)->_IO_read_base)';;
12478 case "$stdio_bufsiz" in
12479 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
12482 case "$stdio_ptr" in
12483 '') stdio_ptr='((fp)->_ptr)'
12486 *) ptr_lval=$d_stdio_ptr_lval;;
12488 case "$stdio_cnt" in
12489 '') stdio_cnt='((fp)->_cnt)'
12492 *) cnt_lval=$d_stdio_cnt_lval;;
12494 case "$stdio_base" in
12495 '') stdio_base='((fp)->_base)';;
12497 case "$stdio_bufsiz" in
12498 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
12502 : test whether _ptr and _cnt really work
12503 echo "Checking how std your stdio is..." >&4
12506 #$i_stdlib I_STDLIB
12508 #include <stdlib.h>
12510 #define FILE_ptr(fp) $stdio_ptr
12511 #define FILE_cnt(fp) $stdio_cnt
12513 FILE *fp = fopen("try.c", "r");
12516 18 <= FILE_cnt(fp) &&
12517 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12525 if eval $compile && $to try.c; then
12526 if $run ./try; then
12527 echo "Your stdio acts pretty std."
12530 echo "Your stdio isn't very std."
12533 echo "Your stdio doesn't appear very std."
12537 # glibc 2.2.90 and above apparently change stdio streams so Perl's
12538 # direct buffer manipulation no longer works. The Configure tests
12539 # should be changed to correctly detect this, but until then,
12540 # the following check should at least let perl compile and run.
12541 # (This quick fix should be updated before 5.8.1.)
12542 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
12543 # A. Dougherty, June 3, 2002.
12544 case "$d_gnulibc" in
12546 case "$gnulibc_version" in
12550 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
12559 : Can _ptr be used as an lvalue?
12560 case "$d_stdstdio$ptr_lval" in
12561 $define$define) val=$define ;;
12564 set d_stdio_ptr_lval
12567 : Can _cnt be used as an lvalue?
12568 case "$d_stdstdio$cnt_lval" in
12569 $define$define) val=$define ;;
12572 set d_stdio_cnt_lval
12576 : test whether setting _ptr sets _cnt as a side effect
12577 d_stdio_ptr_lval_sets_cnt="$undef"
12578 d_stdio_ptr_lval_nochange_cnt="$undef"
12579 case "$d_stdio_ptr_lval$d_stdstdio" in
12581 echo "Checking to see what happens if we set the stdio ptr..." >&4
12584 /* Can we scream? */
12585 /* Eat dust sed :-) */
12586 /* In the buffer space, no one can hear you scream. */
12587 #$i_stdlib I_STDLIB
12589 #include <stdlib.h>
12591 #define FILE_ptr(fp) $stdio_ptr
12592 #define FILE_cnt(fp) $stdio_cnt
12593 #include <sys/types.h>
12595 FILE *fp = fopen("try.c", "r");
12600 puts("Fail even to read");
12603 c = getc(fp); /* Read away the first # */
12605 puts("Fail even to read");
12609 18 <= FILE_cnt(fp) &&
12610 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12612 puts("Fail even to read");
12615 ptr = (char*) FILE_ptr(fp);
12616 cnt = (size_t)FILE_cnt(fp);
12618 FILE_ptr(fp) += 42;
12620 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
12621 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
12624 if (FILE_cnt(fp) <= 20) {
12625 printf ("Fail (<20 chars to test)");
12628 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
12629 puts("Fail compare");
12632 if (cnt == FILE_cnt(fp)) {
12633 puts("Pass_unchanged");
12636 if (FILE_cnt(fp) == (cnt - 42)) {
12637 puts("Pass_changed");
12640 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
12646 if eval $compile && $to try.c; then
12647 case `$run ./try` in
12649 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
12650 d_stdio_ptr_lval_sets_cnt="$define" ;;
12652 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
12653 d_stdio_ptr_lval_nochange_cnt="$define" ;;
12655 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
12657 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
12660 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
12666 : see if _base is also standard
12668 case "$d_stdstdio" in
12672 #$i_stdlib I_STDLIB
12674 #include <stdlib.h>
12676 #define FILE_base(fp) $stdio_base
12677 #define FILE_bufsiz(fp) $stdio_bufsiz
12679 FILE *fp = fopen("try.c", "r");
12682 19 <= FILE_bufsiz(fp) &&
12683 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
12690 if eval $compile && $to try.c; then
12691 if $run ./try; then
12692 echo "And its _base field acts std."
12695 echo "But its _base field isn't std."
12698 echo "However, it seems to be lacking the _base field."
12706 : see if fast_stdio exists
12708 case "$d_stdstdio:$d_stdio_ptr_lval" in
12710 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
12712 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
12723 : see if fchdir exists
12724 set fchdir d_fchdir
12727 : see if fchmod exists
12728 set fchmod d_fchmod
12731 : see if fchown exists
12732 set fchown d_fchown
12735 : see if this is an fcntl system
12740 : See if fcntl-based locking works.
12742 #$i_stdlib I_STDLIB
12744 #include <stdlib.h>
12746 #include <unistd.h>
12748 #include <signal.h>
12749 $signal_t blech(int x) { exit(3); }
12751 #if defined(F_SETLK) && defined(F_SETLKW)
12752 struct flock flock;
12754 fd = open("try.c", O_RDONLY);
12755 flock.l_type = F_RDLCK;
12756 flock.l_whence = SEEK_SET;
12757 flock.l_start = flock.l_len = 0;
12758 signal(SIGALRM, blech);
12760 retval = fcntl(fd, F_SETLK, &flock);
12762 (retval < 0 ? exit(2) : exit(0));
12768 echo "Checking if fcntl-based file locking works... "
12772 if eval $compile_ok; then
12773 if $run ./try; then
12774 echo "Yes, it seems to work."
12777 echo "Nope, it didn't work."
12782 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
12783 *** This is (almost) impossible.
12784 *** If your NFS lock daemons are not feeling well, something like
12785 *** this may happen, please investigate. Cannot continue, aborting.
12793 echo "I'm unable to compile the test program, so I'll assume not."
12798 echo "Nope, since you don't even have fcntl()."
12801 set d_fcntl_can_lock
12805 : check for fd_set items
12808 Checking to see how well your C compiler handles fd_set and friends ...
12811 #$i_stdlib I_STDLIB
12813 #include <stdlib.h>
12815 #$i_systime I_SYS_TIME
12816 #$i_sysselct I_SYS_SELECT
12817 #$d_socket HAS_SOCKET
12818 #include <sys/types.h>
12820 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
12823 #include <sys/time.h>
12825 #ifdef I_SYS_SELECT
12826 #include <sys/select.h>
12835 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
12843 if eval $compile; then
12844 d_fds_bits="$define"
12846 echo "Well, your system knows about the normal fd_set typedef..." >&4
12847 if $run ./try; then
12848 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
12849 d_fd_macros="$define"
12852 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
12854 d_fd_macros="$undef"
12858 Hmm, your compiler has some difficulty with fd_set. Checking further...
12861 if eval $compile; then
12862 d_fds_bits="$undef"
12864 echo "Well, your system has some sort of fd_set available..." >&4
12865 if $run ./try; then
12866 echo "and you have the normal fd_set macros." >&4
12867 d_fd_macros="$define"
12870 but not the normal fd_set macros! Gross! More work for me...
12872 d_fd_macros="$undef"
12875 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
12877 d_fds_bits="$undef"
12878 d_fd_macros="$undef"
12883 : see if fgetpos exists
12884 set fgetpos d_fgetpos
12887 : see if finite exists
12888 set finite d_finite
12891 : see if finitel exists
12892 set finitel d_finitel
12895 : see if flock exists
12899 : see if prototype for flock is available
12901 set d_flockproto flock $i_sysfile sys/file.h
12904 : see if fp_class exists
12905 set fp_class d_fp_class
12908 : see if pathconf exists
12909 set pathconf d_pathconf
12912 : see if fpathconf exists
12913 set fpathconf d_fpathconf
12916 : see if fpclass exists
12917 set fpclass d_fpclass
12920 : see if fpclassify exists
12921 set fpclassify d_fpclassify
12924 : see if fpclassl exists
12925 set fpclassl d_fpclassl
12929 : check for fpos64_t
12931 echo "Checking to see if you have fpos64_t..." >&4
12934 int main() { fpos64_t x = 7; }
12937 if eval $compile; then
12939 echo "You have fpos64_t."
12942 echo "You do not have fpos64_t."
12943 case "$fpossize" in
12944 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
12951 : see if frexpl exists
12952 set frexpl d_frexpl
12955 : see if this is a sys/param system
12956 set sys/param.h i_sysparam
12959 : see if this is a sys/mount.h system
12960 set sys/mount.h i_sysmount
12965 echo "Checking to see if your system supports struct fs_data..." >&4
12966 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
12968 case "$d_fs_data_s" in
12969 "$define") echo "Yes, it does." ;;
12970 *) echo "No, it doesn't." ;;
12973 : see if fseeko exists
12974 set fseeko d_fseeko
12976 case "$longsize" in
12977 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
12980 : see if fsetpos exists
12981 set fsetpos d_fsetpos
12985 : see if fstatfs exists
12986 set fstatfs d_fstatfs
12990 : see if statvfs exists
12991 set statvfs d_statvfs
12994 : see if fstatvfs exists
12995 set fstatvfs d_fstatvfs
12999 : see if fsync exists
13003 : see if ftello exists
13004 set ftello d_ftello
13006 case "$longsize" in
13007 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
13011 : check for a working futimes
13013 echo "Checking if you have a working futimes()" >&4
13016 #include <sys/time.h>
13023 fd = open ("try.c", O_RDWR);
13024 if (-1 == fd) exit (1);
13025 rv = futimes (fd, NULL);
13026 exit (rv == -1 ? errno : 0);
13030 if eval $compile; then
13034 0) echo "Yes, you have" >&4
13035 d_futimes="$define"
13037 *) echo "No, you have futimes, but it isn't working ($rc) (probably harmless)" >&4
13041 echo "No, it does not (probably harmless)" >&4
13045 : see if getcwd exists
13046 set getcwd d_getcwd
13049 : see if getespwnam exists
13050 set getespwnam d_getespwnam
13054 : see if getfsstat exists
13055 set getfsstat d_getfsstat
13058 : see if getgrent exists
13059 set getgrent d_getgrent
13062 : see if getgrent_r exists
13063 set getgrent_r d_getgrent_r
13065 case "$d_getgrent_r" in
13067 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13068 case "$d_getgrent_r_proto:$usethreads" in
13069 ":define") d_getgrent_r_proto=define
13070 set d_getgrent_r_proto getgrent_r $hdrs
13074 case "$d_getgrent_r_proto" in
13076 case "$getgrent_r_proto" in
13077 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
13078 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBWR ;;
13080 case "$getgrent_r_proto" in
13081 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
13082 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIR ;;
13084 case "$getgrent_r_proto" in
13085 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
13086 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBW ;;
13088 case "$getgrent_r_proto" in
13089 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
13090 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBI ;;
13092 case "$getgrent_r_proto" in
13093 ''|0) try='int getgrent_r(struct group*, char*, int);'
13094 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBI ;;
13096 case "$getgrent_r_proto" in
13097 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
13098 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIH ;;
13100 case "$getgrent_r_proto" in
13101 ''|0) d_getgrent_r=undef
13103 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
13104 * ) case "$getgrent_r_proto" in
13105 REENTRANT_PROTO*) ;;
13106 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
13108 echo "Prototype: $try" ;;
13111 *) case "$usethreads" in
13112 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
13119 *) getgrent_r_proto=0
13123 : see if getgrgid_r exists
13124 set getgrgid_r d_getgrgid_r
13126 case "$d_getgrgid_r" in
13128 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13129 case "$d_getgrgid_r_proto:$usethreads" in
13130 ":define") d_getgrgid_r_proto=define
13131 set d_getgrgid_r_proto getgrgid_r $hdrs
13135 case "$d_getgrgid_r_proto" in
13137 case "$getgrgid_r_proto" in
13138 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
13139 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
13141 case "$getgrgid_r_proto" in
13142 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
13143 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
13145 case "$getgrgid_r_proto" in
13146 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
13147 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
13149 case "$getgrgid_r_proto" in
13150 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
13151 ./protochk "extern $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
13153 case "$getgrgid_r_proto" in
13154 ''|0) d_getgrgid_r=undef
13156 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
13157 * ) case "$getgrgid_r_proto" in
13158 REENTRANT_PROTO*) ;;
13159 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
13161 echo "Prototype: $try" ;;
13164 *) case "$usethreads" in
13165 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
13172 *) getgrgid_r_proto=0
13176 : see if getgrnam_r exists
13177 set getgrnam_r d_getgrnam_r
13179 case "$d_getgrnam_r" in
13181 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13182 case "$d_getgrnam_r_proto:$usethreads" in
13183 ":define") d_getgrnam_r_proto=define
13184 set d_getgrnam_r_proto getgrnam_r $hdrs
13188 case "$d_getgrnam_r_proto" in
13190 case "$getgrnam_r_proto" in
13191 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
13192 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
13194 case "$getgrnam_r_proto" in
13195 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
13196 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
13198 case "$getgrnam_r_proto" in
13199 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
13200 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CBI ;;
13202 case "$getgrnam_r_proto" in
13203 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
13204 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
13206 case "$getgrnam_r_proto" in
13207 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
13208 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
13210 case "$getgrnam_r_proto" in
13211 ''|0) d_getgrnam_r=undef
13213 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
13214 * ) case "$getgrnam_r_proto" in
13215 REENTRANT_PROTO*) ;;
13216 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
13218 echo "Prototype: $try" ;;
13221 *) case "$usethreads" in
13222 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
13229 *) getgrnam_r_proto=0
13233 : see if gethostbyaddr exists
13234 set gethostbyaddr d_gethbyaddr
13237 : see if gethostbyname exists
13238 set gethostbyname d_gethbyname
13241 : see if gethostent exists
13242 set gethostent d_gethent
13245 : see how we will look up host name
13248 if set gethostname val -f d_gethname; eval $csym; $val; then
13249 echo 'gethostname() found.' >&4
13250 d_gethname="$define"
13253 if set uname val -f d_uname; eval $csym; $val; then
13256 uname() was found, but you're running xenix, and older versions of xenix
13257 have a broken uname(). If you don't really know whether your xenix is old
13258 enough to have a broken system call, use the default answer.
13263 "$define") dflt=n;;
13265 rp='Is your uname() broken?'
13268 n*) d_uname="$define"; call=uname;;
13271 echo 'uname() found.' >&4
13278 case "$d_gethname" in
13279 '') d_gethname="$undef";;
13282 '') d_uname="$undef";;
13284 case "$d_uname$d_gethname" in
13289 Every now and then someone has a $call() that lies about the hostname
13290 but can't be fixed for political or economic reasons. If you wish, I can
13291 pretend $call() isn't there and maybe compute hostname at run-time
13292 thanks to the '$phostname' command.
13295 rp="Shall I ignore $call() from now on?"
13298 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
13301 case "$phostname" in
13302 '') aphostname='';;
13303 *) case "$aphostname" in
13305 *) set X $phostname
13309 file=`./loc $file $file $pth`
13310 aphostname=`echo $file $*`
13315 case "$d_uname$d_gethname" in
13318 case "$phostname" in
13320 echo "There will be no way for $package to get your hostname." >&4;;
13322 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
13326 case "$d_phostname" in
13327 '') d_phostname="$undef";;
13330 : see if gethostbyaddr_r exists
13331 set gethostbyaddr_r d_gethostbyaddr_r
13333 case "$d_gethostbyaddr_r" in
13335 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13336 case "$d_gethostbyaddr_r_proto:$usethreads" in
13337 ":define") d_gethostbyaddr_r_proto=define
13338 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
13342 case "$d_gethostbyaddr_r_proto" in
13344 case "$gethostbyaddr_r_proto" in
13345 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13346 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
13348 case "$gethostbyaddr_r_proto" in
13349 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
13350 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
13352 case "$gethostbyaddr_r_proto" in
13353 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
13354 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
13356 case "$gethostbyaddr_r_proto" in
13357 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
13358 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
13360 case "$gethostbyaddr_r_proto" in
13361 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
13362 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
13364 case "$gethostbyaddr_r_proto" in
13365 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
13366 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
13368 case "$gethostbyaddr_r_proto" in
13369 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
13370 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
13372 case "$gethostbyaddr_r_proto" in
13373 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
13374 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
13376 case "$gethostbyaddr_r_proto" in
13377 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
13378 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
13380 case "$gethostbyaddr_r_proto" in
13381 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
13382 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
13384 case "$gethostbyaddr_r_proto" in
13385 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13386 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
13388 case "$gethostbyaddr_r_proto" in
13389 ''|0) d_gethostbyaddr_r=undef
13390 gethostbyaddr_r_proto=0
13391 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
13392 * ) case "$gethostbyaddr_r_proto" in
13393 REENTRANT_PROTO*) ;;
13394 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
13396 echo "Prototype: $try" ;;
13399 *) case "$usethreads" in
13400 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
13402 d_gethostbyaddr_r=undef
13403 gethostbyaddr_r_proto=0
13407 *) gethostbyaddr_r_proto=0
13411 : see if gethostbyname_r exists
13412 set gethostbyname_r d_gethostbyname_r
13414 case "$d_gethostbyname_r" in
13416 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13417 case "$d_gethostbyname_r_proto:$usethreads" in
13418 ":define") d_gethostbyname_r_proto=define
13419 set d_gethostbyname_r_proto gethostbyname_r $hdrs
13423 case "$d_gethostbyname_r_proto" in
13425 case "$gethostbyname_r_proto" in
13426 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
13427 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
13429 case "$gethostbyname_r_proto" in
13430 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
13431 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
13433 case "$gethostbyname_r_proto" in
13434 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
13435 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
13437 case "$gethostbyname_r_proto" in
13438 ''|0) d_gethostbyname_r=undef
13439 gethostbyname_r_proto=0
13440 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
13441 * ) case "$gethostbyname_r_proto" in
13442 REENTRANT_PROTO*) ;;
13443 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
13445 echo "Prototype: $try" ;;
13448 *) case "$usethreads" in
13449 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
13451 d_gethostbyname_r=undef
13452 gethostbyname_r_proto=0
13456 *) gethostbyname_r_proto=0
13460 : see if gethostent_r exists
13461 set gethostent_r d_gethostent_r
13463 case "$d_gethostent_r" in
13465 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13466 case "$d_gethostent_r_proto:$usethreads" in
13467 ":define") d_gethostent_r_proto=define
13468 set d_gethostent_r_proto gethostent_r $hdrs
13472 case "$d_gethostent_r_proto" in
13474 case "$gethostent_r_proto" in
13475 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
13476 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
13478 case "$gethostent_r_proto" in
13479 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
13480 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBIE ;;
13482 case "$gethostent_r_proto" in
13483 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
13484 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBIE ;;
13486 case "$gethostent_r_proto" in
13487 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
13488 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBI ;;
13490 case "$gethostent_r_proto" in
13491 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
13492 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBI ;;
13494 case "$gethostent_r_proto" in
13495 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
13496 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SD ;;
13498 case "$gethostent_r_proto" in
13499 ''|0) d_gethostent_r=undef
13500 gethostent_r_proto=0
13501 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
13502 * ) case "$gethostent_r_proto" in
13503 REENTRANT_PROTO*) ;;
13504 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
13506 echo "Prototype: $try" ;;
13509 *) case "$usethreads" in
13510 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
13512 d_gethostent_r=undef
13513 gethostent_r_proto=0
13517 *) gethostent_r_proto=0
13521 : see if prototypes for various gethostxxx netdb.h functions are available
13523 set d_gethostprotos gethostent $i_netdb netdb.h
13526 : see if getitimer exists
13527 set getitimer d_getitimer
13530 : see if getlogin exists
13531 set getlogin d_getlogin
13534 : see if getlogin_r exists
13535 set getlogin_r d_getlogin_r
13537 case "$d_getlogin_r" in
13539 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
13540 case "$d_getlogin_r_proto:$usethreads" in
13541 ":define") d_getlogin_r_proto=define
13542 set d_getlogin_r_proto getlogin_r $hdrs
13546 case "$d_getlogin_r_proto" in
13548 case "$getlogin_r_proto" in
13549 ''|0) try='int getlogin_r(char*, size_t);'
13550 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BW ;;
13552 case "$getlogin_r_proto" in
13553 ''|0) try='int getlogin_r(char*, int);'
13554 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BI ;;
13556 case "$getlogin_r_proto" in
13557 ''|0) try='char* getlogin_r(char*, size_t);'
13558 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BW ;;
13560 case "$getlogin_r_proto" in
13561 ''|0) try='char* getlogin_r(char*, int);'
13562 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BI ;;
13564 case "$getlogin_r_proto" in
13565 ''|0) d_getlogin_r=undef
13567 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
13568 * ) case "$getlogin_r_proto" in
13569 REENTRANT_PROTO*) ;;
13570 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
13572 echo "Prototype: $try" ;;
13575 *) case "$usethreads" in
13576 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
13583 *) getlogin_r_proto=0
13587 : see if getmnt exists
13588 set getmnt d_getmnt
13591 : see if getmntent exists
13592 set getmntent d_getmntent
13595 : see if getnetbyaddr exists
13596 set getnetbyaddr d_getnbyaddr
13599 : see if getnetbyname exists
13600 set getnetbyname d_getnbyname
13603 : see if getnetent exists
13604 set getnetent d_getnent
13607 : see if getnetbyaddr_r exists
13608 set getnetbyaddr_r d_getnetbyaddr_r
13610 case "$d_getnetbyaddr_r" in
13612 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13613 case "$d_getnetbyaddr_r_proto:$usethreads" in
13614 ":define") d_getnetbyaddr_r_proto=define
13615 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
13619 case "$d_getnetbyaddr_r_proto" in
13621 case "$getnetbyaddr_r_proto" in
13622 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
13623 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
13625 case "$getnetbyaddr_r_proto" in
13626 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
13627 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
13629 case "$getnetbyaddr_r_proto" in
13630 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
13631 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
13633 case "$getnetbyaddr_r_proto" in
13634 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
13635 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
13637 case "$getnetbyaddr_r_proto" in
13638 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
13639 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
13641 case "$getnetbyaddr_r_proto" in
13642 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
13643 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
13645 case "$getnetbyaddr_r_proto" in
13646 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
13647 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
13649 case "$getnetbyaddr_r_proto" in
13650 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
13651 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
13653 case "$getnetbyaddr_r_proto" in
13654 ''|0) d_getnetbyaddr_r=undef
13655 getnetbyaddr_r_proto=0
13656 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
13657 * ) case "$getnetbyaddr_r_proto" in
13658 REENTRANT_PROTO*) ;;
13659 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
13661 echo "Prototype: $try" ;;
13664 *) case "$usethreads" in
13665 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
13667 d_getnetbyaddr_r=undef
13668 getnetbyaddr_r_proto=0
13672 *) getnetbyaddr_r_proto=0
13676 : see if getnetbyname_r exists
13677 set getnetbyname_r d_getnetbyname_r
13679 case "$d_getnetbyname_r" in
13681 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13682 case "$d_getnetbyname_r_proto:$usethreads" in
13683 ":define") d_getnetbyname_r_proto=define
13684 set d_getnetbyname_r_proto getnetbyname_r $hdrs
13688 case "$d_getnetbyname_r_proto" in
13690 case "$getnetbyname_r_proto" in
13691 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
13692 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
13694 case "$getnetbyname_r_proto" in
13695 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
13696 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
13698 case "$getnetbyname_r_proto" in
13699 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
13700 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
13702 case "$getnetbyname_r_proto" in
13703 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
13704 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
13706 case "$getnetbyname_r_proto" in
13707 ''|0) d_getnetbyname_r=undef
13708 getnetbyname_r_proto=0
13709 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
13710 * ) case "$getnetbyname_r_proto" in
13711 REENTRANT_PROTO*) ;;
13712 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
13714 echo "Prototype: $try" ;;
13717 *) case "$usethreads" in
13718 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
13720 d_getnetbyname_r=undef
13721 getnetbyname_r_proto=0
13725 *) getnetbyname_r_proto=0
13729 : see if getnetent_r exists
13730 set getnetent_r d_getnetent_r
13732 case "$d_getnetent_r" in
13734 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13735 case "$d_getnetent_r_proto:$usethreads" in
13736 ":define") d_getnetent_r_proto=define
13737 set d_getnetent_r_proto getnetent_r $hdrs
13741 case "$d_getnetent_r_proto" in
13743 case "$getnetent_r_proto" in
13744 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
13745 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
13747 case "$getnetent_r_proto" in
13748 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
13749 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBIE ;;
13751 case "$getnetent_r_proto" in
13752 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
13753 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBIE ;;
13755 case "$getnetent_r_proto" in
13756 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
13757 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBI ;;
13759 case "$getnetent_r_proto" in
13760 ''|0) try='int getnetent_r(struct netent*, char*, int);'
13761 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBI ;;
13763 case "$getnetent_r_proto" in
13764 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
13765 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SD ;;
13767 case "$getnetent_r_proto" in
13768 ''|0) d_getnetent_r=undef
13769 getnetent_r_proto=0
13770 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
13771 * ) case "$getnetent_r_proto" in
13772 REENTRANT_PROTO*) ;;
13773 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
13775 echo "Prototype: $try" ;;
13778 *) case "$usethreads" in
13779 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
13781 d_getnetent_r=undef
13782 getnetent_r_proto=0
13786 *) getnetent_r_proto=0
13790 : see if prototypes for various getnetxxx netdb.h functions are available
13792 set d_getnetprotos getnetent $i_netdb netdb.h
13795 : see if getpagesize exists
13796 set getpagesize d_getpagsz
13800 : see if getprotobyname exists
13801 set getprotobyname d_getpbyname
13804 : see if getprotobynumber exists
13805 set getprotobynumber d_getpbynumber
13808 : see if getprotoent exists
13809 set getprotoent d_getpent
13812 : see if getpgid exists
13813 set getpgid d_getpgid
13816 : see if getpgrp2 exists
13817 set getpgrp2 d_getpgrp2
13820 : see if getppid exists
13821 set getppid d_getppid
13824 : see if getpriority exists
13825 set getpriority d_getprior
13828 : see if getprotobyname_r exists
13829 set getprotobyname_r d_getprotobyname_r
13831 case "$d_getprotobyname_r" in
13833 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13834 case "$d_getprotobyname_r_proto:$usethreads" in
13835 ":define") d_getprotobyname_r_proto=define
13836 set d_getprotobyname_r_proto getprotobyname_r $hdrs
13840 case "$d_getprotobyname_r_proto" in
13842 case "$getprotobyname_r_proto" in
13843 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
13844 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
13846 case "$getprotobyname_r_proto" in
13847 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
13848 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
13850 case "$getprotobyname_r_proto" in
13851 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
13852 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
13854 case "$getprotobyname_r_proto" in
13855 ''|0) d_getprotobyname_r=undef
13856 getprotobyname_r_proto=0
13857 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
13858 * ) case "$getprotobyname_r_proto" in
13859 REENTRANT_PROTO*) ;;
13860 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
13862 echo "Prototype: $try" ;;
13865 *) case "$usethreads" in
13866 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
13868 d_getprotobyname_r=undef
13869 getprotobyname_r_proto=0
13873 *) getprotobyname_r_proto=0
13877 : see if getprotobynumber_r exists
13878 set getprotobynumber_r d_getprotobynumber_r
13880 case "$d_getprotobynumber_r" in
13882 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13883 case "$d_getprotobynumber_r_proto:$usethreads" in
13884 ":define") d_getprotobynumber_r_proto=define
13885 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
13889 case "$d_getprotobynumber_r_proto" in
13891 case "$getprotobynumber_r_proto" in
13892 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
13893 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
13895 case "$getprotobynumber_r_proto" in
13896 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
13897 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
13899 case "$getprotobynumber_r_proto" in
13900 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
13901 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
13903 case "$getprotobynumber_r_proto" in
13904 ''|0) d_getprotobynumber_r=undef
13905 getprotobynumber_r_proto=0
13906 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
13907 * ) case "$getprotobynumber_r_proto" in
13908 REENTRANT_PROTO*) ;;
13909 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
13911 echo "Prototype: $try" ;;
13914 *) case "$usethreads" in
13915 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
13917 d_getprotobynumber_r=undef
13918 getprotobynumber_r_proto=0
13922 *) getprotobynumber_r_proto=0
13926 : see if getprotoent_r exists
13927 set getprotoent_r d_getprotoent_r
13929 case "$d_getprotoent_r" in
13931 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13932 case "$d_getprotoent_r_proto:$usethreads" in
13933 ":define") d_getprotoent_r_proto=define
13934 set d_getprotoent_r_proto getprotoent_r $hdrs
13938 case "$d_getprotoent_r_proto" in
13940 case "$getprotoent_r_proto" in
13941 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
13942 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
13944 case "$getprotoent_r_proto" in
13945 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
13946 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBI ;;
13948 case "$getprotoent_r_proto" in
13949 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
13950 ./protochk "extern $try" $hdrs && getprotoent_r_proto=S_SBI ;;
13952 case "$getprotoent_r_proto" in
13953 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
13954 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SD ;;
13956 case "$getprotoent_r_proto" in
13957 ''|0) d_getprotoent_r=undef
13958 getprotoent_r_proto=0
13959 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
13960 * ) case "$getprotoent_r_proto" in
13961 REENTRANT_PROTO*) ;;
13962 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
13964 echo "Prototype: $try" ;;
13967 *) case "$usethreads" in
13968 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
13970 d_getprotoent_r=undef
13971 getprotoent_r_proto=0
13975 *) getprotoent_r_proto=0
13979 : see if prototypes for various getprotoxxx netdb.h functions are available
13981 set d_getprotoprotos getprotoent $i_netdb netdb.h
13984 : see if getprpwnam exists
13985 set getprpwnam d_getprpwnam
13988 : see if getpwent exists
13989 set getpwent d_getpwent
13992 : see if getpwent_r exists
13993 set getpwent_r d_getpwent_r
13995 case "$d_getpwent_r" in
13997 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13998 case "$d_getpwent_r_proto:$usethreads" in
13999 ":define") d_getpwent_r_proto=define
14000 set d_getpwent_r_proto getpwent_r $hdrs
14004 case "$d_getpwent_r_proto" in
14006 case "$getpwent_r_proto" in
14007 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
14008 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBWR ;;
14010 case "$getpwent_r_proto" in
14011 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
14012 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIR ;;
14014 case "$getpwent_r_proto" in
14015 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
14016 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBW ;;
14018 case "$getpwent_r_proto" in
14019 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
14020 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBI ;;
14022 case "$getpwent_r_proto" in
14023 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
14024 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBI ;;
14026 case "$getpwent_r_proto" in
14027 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
14028 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIH ;;
14030 case "$getpwent_r_proto" in
14031 ''|0) d_getpwent_r=undef
14033 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
14034 * ) case "$getpwent_r_proto" in
14035 REENTRANT_PROTO*) ;;
14036 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
14038 echo "Prototype: $try" ;;
14041 *) case "$usethreads" in
14042 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
14049 *) getpwent_r_proto=0
14053 : see if getpwnam_r exists
14054 set getpwnam_r d_getpwnam_r
14056 case "$d_getpwnam_r" in
14058 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14059 case "$d_getpwnam_r_proto:$usethreads" in
14060 ":define") d_getpwnam_r_proto=define
14061 set d_getpwnam_r_proto getpwnam_r $hdrs
14065 case "$d_getpwnam_r_proto" in
14067 case "$getpwnam_r_proto" in
14068 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
14069 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
14071 case "$getpwnam_r_proto" in
14072 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
14073 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
14075 case "$getpwnam_r_proto" in
14076 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
14077 ./protochk "extern $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
14079 case "$getpwnam_r_proto" in
14080 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
14081 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
14083 case "$getpwnam_r_proto" in
14084 ''|0) d_getpwnam_r=undef
14086 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
14087 * ) case "$getpwnam_r_proto" in
14088 REENTRANT_PROTO*) ;;
14089 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
14091 echo "Prototype: $try" ;;
14094 *) case "$usethreads" in
14095 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
14102 *) getpwnam_r_proto=0
14106 : see if getpwuid_r exists
14107 set getpwuid_r d_getpwuid_r
14109 case "$d_getpwuid_r" in
14111 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14112 case "$d_getpwuid_r_proto:$usethreads" in
14113 ":define") d_getpwuid_r_proto=define
14114 set d_getpwuid_r_proto getpwuid_r $hdrs
14118 case "$d_getpwuid_r_proto" in
14120 case "$getpwuid_r_proto" in
14121 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
14122 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
14124 case "$getpwuid_r_proto" in
14125 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
14126 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
14128 case "$getpwuid_r_proto" in
14129 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
14130 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
14132 case "$getpwuid_r_proto" in
14133 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
14134 ./protochk "extern $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
14136 case "$getpwuid_r_proto" in
14137 ''|0) d_getpwuid_r=undef
14139 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
14140 * ) case "$getpwuid_r_proto" in
14141 REENTRANT_PROTO*) ;;
14142 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
14144 echo "Prototype: $try" ;;
14147 *) case "$usethreads" in
14148 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
14155 *) getpwuid_r_proto=0
14160 : see if getservbyname exists
14161 set getservbyname d_getsbyname
14164 : see if getservbyport exists
14165 set getservbyport d_getsbyport
14168 : see if getservent exists
14169 set getservent d_getsent
14172 : see if getservbyname_r exists
14173 set getservbyname_r d_getservbyname_r
14175 case "$d_getservbyname_r" in
14177 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14178 case "$d_getservbyname_r_proto:$usethreads" in
14179 ":define") d_getservbyname_r_proto=define
14180 set d_getservbyname_r_proto getservbyname_r $hdrs
14184 case "$d_getservbyname_r_proto" in
14186 case "$getservbyname_r_proto" in
14187 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
14188 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
14190 case "$getservbyname_r_proto" in
14191 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
14192 ./protochk "extern $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
14194 case "$getservbyname_r_proto" in
14195 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
14196 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
14198 case "$getservbyname_r_proto" in
14199 ''|0) d_getservbyname_r=undef
14200 getservbyname_r_proto=0
14201 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
14202 * ) case "$getservbyname_r_proto" in
14203 REENTRANT_PROTO*) ;;
14204 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
14206 echo "Prototype: $try" ;;
14209 *) case "$usethreads" in
14210 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
14212 d_getservbyname_r=undef
14213 getservbyname_r_proto=0
14217 *) getservbyname_r_proto=0
14221 : see if getservbyport_r exists
14222 set getservbyport_r d_getservbyport_r
14224 case "$d_getservbyport_r" in
14226 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14227 case "$d_getservbyport_r_proto:$usethreads" in
14228 ":define") d_getservbyport_r_proto=define
14229 set d_getservbyport_r_proto getservbyport_r $hdrs
14233 case "$d_getservbyport_r_proto" in
14235 case "$getservbyport_r_proto" in
14236 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
14237 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
14239 case "$getservbyport_r_proto" in
14240 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
14241 ./protochk "extern $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
14243 case "$getservbyport_r_proto" in
14244 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
14245 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
14247 case "$getservbyport_r_proto" in
14248 ''|0) d_getservbyport_r=undef
14249 getservbyport_r_proto=0
14250 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
14251 * ) case "$getservbyport_r_proto" in
14252 REENTRANT_PROTO*) ;;
14253 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
14255 echo "Prototype: $try" ;;
14258 *) case "$usethreads" in
14259 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
14261 d_getservbyport_r=undef
14262 getservbyport_r_proto=0
14266 *) getservbyport_r_proto=0
14270 : see if getservent_r exists
14271 set getservent_r d_getservent_r
14273 case "$d_getservent_r" in
14275 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14276 case "$d_getservent_r_proto:$usethreads" in
14277 ":define") d_getservent_r_proto=define
14278 set d_getservent_r_proto getservent_r $hdrs
14282 case "$d_getservent_r_proto" in
14284 case "$getservent_r_proto" in
14285 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
14286 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBWR ;;
14288 case "$getservent_r_proto" in
14289 ''|0) try='int getservent_r(struct servent*, char*, int);'
14290 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBI ;;
14292 case "$getservent_r_proto" in
14293 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
14294 ./protochk "extern $try" $hdrs && getservent_r_proto=S_SBI ;;
14296 case "$getservent_r_proto" in
14297 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
14298 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SD ;;
14300 case "$getservent_r_proto" in
14301 ''|0) d_getservent_r=undef
14302 getservent_r_proto=0
14303 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
14304 * ) case "$getservent_r_proto" in
14305 REENTRANT_PROTO*) ;;
14306 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
14308 echo "Prototype: $try" ;;
14311 *) case "$usethreads" in
14312 define) echo "getservent_r has no prototype, not using it." >&4 ;;
14314 d_getservent_r=undef
14315 getservent_r_proto=0
14319 *) getservent_r_proto=0
14323 : see if prototypes for various getservxxx netdb.h functions are available
14325 set d_getservprotos getservent $i_netdb netdb.h
14328 : see if getspnam exists
14329 set getspnam d_getspnam
14332 : see if this is a shadow.h system
14333 set shadow.h i_shadow
14336 : see if getspnam_r exists
14337 set getspnam_r d_getspnam_r
14339 case "$d_getspnam_r" in
14341 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
14342 case "$d_getspnam_r_proto:$usethreads" in
14343 ":define") d_getspnam_r_proto=define
14344 set d_getspnam_r_proto getspnam_r $hdrs
14348 case "$d_getspnam_r_proto" in
14350 case "$getspnam_r_proto" in
14351 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
14352 ./protochk "extern $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
14354 case "$getspnam_r_proto" in
14355 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
14356 ./protochk "extern $try" $hdrs && getspnam_r_proto=S_CSBI ;;
14358 case "$getspnam_r_proto" in
14359 ''|0) d_getspnam_r=undef
14361 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
14362 * ) case "$getspnam_r_proto" in
14363 REENTRANT_PROTO*) ;;
14364 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
14366 echo "Prototype: $try" ;;
14369 *) case "$usethreads" in
14370 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
14377 *) getspnam_r_proto=0
14381 : see if gettimeofday or ftime exists
14382 set gettimeofday d_gettimeod
14384 case "$d_gettimeod" in
14390 val="$undef"; set d_ftime; eval $setvar
14393 case "$d_gettimeod$d_ftime" in
14396 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
14400 : see if gmtime_r exists
14401 set gmtime_r d_gmtime_r
14403 case "$d_gmtime_r" in
14405 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14406 case "$d_gmtime_r_proto:$usethreads" in
14407 ":define") d_gmtime_r_proto=define
14408 set d_gmtime_r_proto gmtime_r $hdrs
14412 case "$d_gmtime_r_proto" in
14414 case "$gmtime_r_proto" in
14415 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
14416 ./protochk "extern $try" $hdrs && gmtime_r_proto=S_TS ;;
14418 case "$gmtime_r_proto" in
14419 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
14420 ./protochk "extern $try" $hdrs && gmtime_r_proto=I_TS ;;
14422 case "$gmtime_r_proto" in
14423 ''|0) d_gmtime_r=undef
14425 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
14426 * ) case "$gmtime_r_proto" in
14427 REENTRANT_PROTO*) ;;
14428 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
14430 echo "Prototype: $try" ;;
14433 *) case "$usethreads" in
14434 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
14441 *) gmtime_r_proto=0
14445 : see if hasmntopt exists
14446 set hasmntopt d_hasmntopt
14449 : see if this is a netinet/in.h or sys/in.h system
14450 set netinet/in.h i_niin sys/in.h i_sysin
14453 : see if arpa/inet.h has to be included
14454 set arpa/inet.h i_arpainet
14457 : see if htonl --and friends-- exists
14462 : Maybe they are macros.
14465 $cat >htonl.c <<EOM
14467 #include <sys/types.h>
14468 #$i_niin I_NETINET_IN
14470 #$i_arpainet I_ARPA_INET
14471 #ifdef I_NETINET_IN
14472 #include <netinet/in.h>
14475 #include <sys/in.h>
14478 #include <arpa/inet.h>
14481 printf("Defined as a macro.");
14484 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
14485 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
14487 echo "But it seems to be defined as a macro." >&4
14495 : see if ilogbl exists
14496 set ilogbl d_ilogbl
14501 if set index val -f; eval $csym; $val; then
14502 if set strchr val -f d_strchr; eval $csym; $val; then
14503 if $contains strchr "$strings" >/dev/null 2>&1 ; then
14506 echo "strchr() found." >&4
14510 echo "index() found." >&4
14515 echo "index() found." >&4
14518 if set strchr val -f d_strchr; eval $csym; $val; then
14521 echo "strchr() found." >&4
14523 echo "No index() or strchr() found!" >&4
14528 set d_strchr; eval $setvar
14530 set d_index; eval $setvar
14532 : check whether inet_aton exists
14533 set inet_aton d_inetaton
14538 $cat >isascii.c <<EOCP
14541 #$i_stdlib I_STDLIB
14543 #include <stdlib.h>
14554 if eval $compile; then
14555 echo "isascii() found." >&4
14558 echo "isascii() NOT found." >&4
14565 : see if isfinite exists
14566 set isfinite d_isfinite
14569 : see if isinf exists
14573 : see if isnan exists
14577 : see if isnanl exists
14578 set isnanl d_isnanl
14581 : see if killpg exists
14582 set killpg d_killpg
14585 : see if lchown exists
14587 $cat > try.c <<'EOCP'
14588 /* System header to define __stub macros and hopefully few prototypes,
14589 which can conflict with char lchown(); below. */
14590 #include <assert.h>
14591 /* Override any gcc2 internal prototype to avoid an error. */
14592 /* We use char because int might match the return type of a gcc2
14593 builtin and then its argument prototype would still apply. */
14596 /* The GNU C library defines this for functions which it implements
14597 to always fail with ENOSYS. Some functions are actually named
14598 something starting with __ and the normal name is an alias. */
14599 #if defined (__stub_lchown) || defined (__stub___lchown)
14607 if eval $compile; then
14608 $echo "lchown() found." >&4
14611 $echo "lchown() NOT found." >&4
14617 : See if number of significant digits in a double precision number is known
14619 $cat >ldbl_dig.c <<EOM
14620 #$i_limits I_LIMITS
14623 #include <limits.h>
14629 printf("Contains LDBL_DIG");
14632 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
14633 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
14634 echo "LDBL_DIG found." >&4
14637 echo "LDBL_DIG NOT found." >&4
14644 : see if this is a math.h system
14648 d_libm_lib_version="$undef"
14651 : check to see if math.h defines _LIB_VERSION
14653 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
14655 #include <unistd.h>
14657 int main (int argc, char *argv[])
14659 printf ("%d\n", _LIB_VERSION);
14664 if eval $compile; then
14666 echo "Yes, it does ($foo)" >&4
14667 d_libm_lib_version="$define"
14669 echo "No, it does not (probably harmless)" >&4
14676 : see if link exists
14680 : see if localtime_r exists
14681 set localtime_r d_localtime_r
14683 case "$d_localtime_r" in
14685 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14686 case "$d_localtime_r_proto:$usethreads" in
14687 ":define") d_localtime_r_proto=define
14688 set d_localtime_r_proto localtime_r $hdrs
14692 case "$d_localtime_r_proto" in
14694 case "$localtime_r_proto" in
14695 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
14696 ./protochk "extern $try" $hdrs && localtime_r_proto=S_TS ;;
14698 case "$localtime_r_proto" in
14699 ''|0) try='int localtime_r(const time_t*, struct tm*);'
14700 ./protochk "extern $try" $hdrs && localtime_r_proto=I_TS ;;
14702 case "$localtime_r_proto" in
14703 ''|0) d_localtime_r=undef
14704 localtime_r_proto=0
14705 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
14706 * ) case "$localtime_r_proto" in
14707 REENTRANT_PROTO*) ;;
14708 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
14710 echo "Prototype: $try" ;;
14713 *) case "$usethreads" in
14714 define) echo "localtime_r has no prototype, not using it." >&4 ;;
14716 d_localtime_r=undef
14717 localtime_r_proto=0
14721 *) localtime_r_proto=0
14725 : see if localtime_r calls tzset
14726 case "$localtime_r_proto" in
14729 /* Does our libc's localtime_r call tzset ?
14730 * return 0 if so, 1 otherwise.
14732 #include <sys/types.h>
14733 #include <unistd.h>
14735 #include <string.h>
14736 #include <malloc.h>
14739 time_t t = time(0L);
14740 char w_tz[]="TZ" "=GMT+5",
14741 e_tz[]="TZ" "=GMT-5",
14742 *tz_e = (char*)malloc(16),
14743 *tz_w = (char*)malloc(16);
14744 struct tm tm_e, tm_w;
14745 memset(&tm_e,'\0',sizeof(struct tm));
14746 memset(&tm_w,'\0',sizeof(struct tm));
14751 localtime_r(&t, &tm_e);
14754 localtime_r(&t, &tm_w);
14756 if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 )
14762 if eval $compile; then
14763 if $run ./try; then
14764 d_localtime_r_needs_tzset=undef;
14766 d_localtime_r_needs_tzset=define;
14769 d_localtime_r_needs_tzset=undef;
14773 d_localtime_r_needs_tzset=undef;
14778 : see if localeconv exists
14779 set localeconv d_locconv
14782 : see if lockf exists
14786 : see if prototype for lseek is available
14788 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
14791 : see if lstat exists
14795 : see if madvise exists
14796 set madvise d_madvise
14799 : see if malloc_size exists
14800 set malloc_size d_malloc_size
14803 : see if malloc_size_good exists
14804 set malloc_good_size d_malloc_good_size
14807 : see if mblen exists
14811 : see if mbstowcs exists
14812 set mbstowcs d_mbstowcs
14815 : see if mbtowc exists
14816 set mbtowc d_mbtowc
14819 : see if memchr exists
14820 set memchr d_memchr
14823 : see if memcmp exists
14824 set memcmp d_memcmp
14827 : see if memcpy exists
14828 set memcpy d_memcpy
14831 : see if memmove exists
14832 set memmove d_memmove
14835 : see if memset exists
14836 set memset d_memset
14839 : see if mkdir exists
14843 : see if mkdtemp exists
14844 set mkdtemp d_mkdtemp
14847 : see if mkfifo exists
14848 set mkfifo d_mkfifo
14851 : see if mkstemp exists
14852 set mkstemp d_mkstemp
14855 : see if mkstemps exists
14856 set mkstemps d_mkstemps
14859 : see if mktime exists
14860 set mktime d_mktime
14863 : see if this is a sys/mman.h system
14864 set sys/mman.h i_sysmman
14867 : see if mmap exists
14870 : see what shmat returns
14871 : default to something harmless
14873 case "$i_sysmman$d_mmap" in
14875 $cat >mmap.c <<'END'
14876 #include <sys/mman.h>
14879 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
14884 echo "and it returns ($mmaptype)." >&4
14890 : see if sqrtl exists
14894 : see if scalbnl exists
14895 set scalbnl d_scalbnl
14898 : see if modfl exists
14902 : see if prototype for modfl is available
14904 set d_modflproto modfl $i_math math.h
14907 d_modfl_pow32_bug="$undef"
14909 case "$d_longdbl$d_modfl" in
14912 Checking to see whether your modfl() is okay for large values...
14918 if $test "X$d_modflproto" != "X$define"; then
14919 $cat >>try.c <<EOCP
14920 /* Sigh. many current glibcs provide the function, but do not prototype it. */
14921 long double modfl (long double, long double *);
14924 $cat >>try.c <<EOCP
14926 long double nv = 4294967303.15;
14932 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
14936 case "$osname:$gccversion" in
14937 aix:) saveccflags="$ccflags"
14938 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
14941 if eval $compile; then
14944 *" 4294967303.150000 1.150000 4294967302.000000")
14945 echo >&4 "Your modfl() is broken for large values."
14946 d_modfl_pow32_bug="$define"
14948 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
14952 *" 4294967303.150000 0.150000 4294967303.000000")
14953 echo >&4 "Your modfl() seems okay for large values."
14955 *) echo >&4 "I don't understand your modfl() at all."
14961 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
14964 case "$osname:$gccversion" in
14965 aix:) ccflags="$saveccflags" ;; # restore
14970 if $test "$uselongdouble" = "$define"; then
14972 if $test "$d_sqrtl" != "$define"; then
14973 message="$message sqrtl"
14975 if $test "$d_modfl" != "$define"; then
14976 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
14977 echo "You have both aintl and copysignl, so I can emulate modfl."
14979 message="$message modfl"
14982 if $test "$d_frexpl" != "$define"; then
14983 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
14984 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
14986 message="$message frexpl"
14990 if $test "$message" != ""; then
14993 *** You requested the use of long doubles but you do not seem to have
14994 *** the following mathematical functions needed for long double support:
14996 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
14997 *** Cannot continue, aborting.
15005 : see if mprotect exists
15006 set mprotect d_mprotect
15009 : see if msgctl exists
15010 set msgctl d_msgctl
15013 : see if msgget exists
15014 set msgget d_msgget
15017 : see if msgsnd exists
15018 set msgsnd d_msgsnd
15021 : see if msgrcv exists
15022 set msgrcv d_msgrcv
15025 : see how much of the 'msg*(2)' library is present.
15028 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
15029 *"$undef"*) h_msg=false;;
15033 case "`ipcs 2>&1`" in
15034 "SVID messages"*"not configured"*)
15035 echo "Your $osname does not have the msg*(2) configured." >&4
15038 set msgctl d_msgctl
15040 set msgget d_msgget
15042 set msgsnd d_msgsnd
15044 set msgrcv d_msgrcv
15050 : we could also check for sys/ipc.h ...
15051 if $h_msg && $test `./findhdr sys/msg.h`; then
15052 echo "You have the full msg*(2) library." >&4
15055 echo "You don't have the full msg*(2) library." >&4
15063 echo "Checking to see if your system supports struct msghdr..." >&4
15064 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
15066 case "$d_msghdr_s" in
15067 "$define") echo "Yes, it does." ;;
15068 *) echo "No, it doesn't." ;;
15072 : see if msync exists
15076 : see if munmap exists
15077 set munmap d_munmap
15080 : see if nice exists
15084 : see if this is a langinfo.h system
15085 set langinfo.h i_langinfo
15088 : see if nl_langinfo exists
15089 set nl_langinfo d_nl_langinfo
15092 : check for volatile keyword
15094 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
15095 $cat >try.c <<'EOCP'
15098 typedef struct _goo_struct goo_struct;
15099 goo_struct * volatile goo = ((goo_struct *)0);
15100 struct _goo_struct {
15105 typedef unsigned short foo_t;
15106 char *volatile foo;
15108 volatile foo_t blech;
15112 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
15114 echo "Yup, it does."
15117 echo "Nope, it doesn't."
15125 $echo "Choosing the C types to be used for Perl's internal types..." >&4
15127 case "$use64bitint:$d_quad:$quadtype" in
15130 uvtype="$uquadtype"
15135 uvtype="unsigned long"
15141 case "$uselongdouble:$d_longdbl" in
15143 nvtype="long double"
15144 nvsize=$longdblsize
15151 $echo "(IV will be "$ivtype", $ivsize bytes)"
15152 $echo "(UV will be "$uvtype", $uvsize bytes)"
15153 $echo "(NV will be "$nvtype", $nvsize bytes)"
15156 #$i_inttypes I_INTTYPES
15158 #include <inttypes.h>
15163 int8_t i = INT8_MAX;
15164 uint8_t u = UINT8_MAX;
15165 printf("int8_t\n");
15168 int16_t i = INT16_MAX;
15169 uint16_t i = UINT16_MAX;
15170 printf("int16_t\n");
15173 int32_t i = INT32_MAX;
15174 uint32_t u = UINT32_MAX;
15175 printf("int32_t\n");
15181 u8type="unsigned char"
15186 '') case "$shortsize" in
15188 u16type="unsigned short"
15196 '') set try -DINT16
15197 if eval $compile; then
15198 case "`$run ./try`" in
15210 '') if $test $shortsize -ge 2; then
15212 u16type="unsigned short"
15220 '') case "$longsize" in
15222 u32type="unsigned long"
15226 *) case "$intsize" in
15228 u32type="unsigned int"
15238 '') set try -DINT32
15239 if eval $compile; then
15240 case "`$run ./try`" in
15252 '') if $test $intsize -ge 4; then
15254 u32type="unsigned int"
15262 '') case "$d_quad:$quadtype" in
15264 i64type="$quadtype"
15265 u64type="$uquadtype"
15273 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
15274 : volatile so that the compiler has to store it out to memory.
15275 if test X"$d_volatile" = X"$define"; then
15280 #$i_stdlib I_STDLIB
15282 #include <stdlib.h>
15284 #include <sys/types.h>
15285 #include <signal.h>
15287 $volatile int bletched = 0;
15288 $signal_t blech(int s) { bletched = 1; }
15293 int n = 8 * $uvsize;
15296 signal(SIGFPE, blech);
15299 for (i = 0; i < n; i++) {
15300 u = u << 1 | ($uvtype)1;
15302 if (($uvtype)d != u)
15306 d = ($nvtype)(u - 1);
15307 if (($uvtype)d != (u - 1))
15314 printf("%d\n", ((i == n) ? -n : i));
15320 d_nv_preserves_uv="$undef"
15321 if eval $compile; then
15322 nv_preserves_uv_bits="`$run ./try`"
15324 case "$nv_preserves_uv_bits" in
15326 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
15327 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
15328 d_nv_preserves_uv="$define"
15330 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
15331 d_nv_preserves_uv="$undef" ;;
15332 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
15333 nv_preserves_uv_bits="0" ;;
15337 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
15338 : volatile so that the compiler has to store it out to memory.
15339 if test X"$d_volatile" = X"$define"; then
15344 #$i_stdlib I_STDLIB
15346 #include <stdlib.h>
15348 #$i_string I_STRING
15350 # include <string.h>
15352 # include <strings.h>
15354 #include <sys/types.h>
15355 #include <signal.h>
15357 $volatile int bletched = 0;
15358 $signal_t blech(int s) { bletched = 1; }
15361 int checkit($nvtype d, char *where) {
15362 unsigned char *p = (char *)&d;
15363 unsigned char *end = p + sizeof(d);
15373 printf("No - %s: 0x", where);
15375 printf ("%02X", *p++);
15380 int main(int argc, char **argv) {
15383 fail += checkit(d, "0.0");
15385 /* The compiler shouldn't be assuming that bletched is 0 */
15388 fail += checkit(d, "bleched");
15391 signal(SIGFPE, blech);
15394 /* Paranoia - the compiler should have no way of knowing that ANSI says
15395 that argv[argc] will always be NULL. Actually, if it did assume this it
15396 would be buggy, as this is C and main() can be called from elsewhere in
15398 d = argv[argc] ? 1 : 0;
15401 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
15404 fail += checkit(d, "ternary");
15406 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
15409 printf("No - memset doesn't give 0.0\n");
15410 /* This might just blow up: */
15411 printf("(gives %g)\n", d);
15417 printf("No - something bleched\n");
15422 printf("No - %d fail(s)\n", fail);
15431 d_nv_zero_is_allbits_zero="$undef"
15432 if eval $compile; then
15438 0.0 is represented as all bits zero in memory
15440 d_nv_zero_is_allbits_zero="$define"
15443 0.0 is not represented as all bits zero in memory
15445 d_nv_zero_is_allbits_zero="$undef"
15450 0.0 is not represented as all bits zero in memory
15452 d_nv_zero_is_allbits_zero="$undef"
15458 : check for off64_t
15460 echo "Checking to see if you have off64_t..." >&4
15462 #include <sys/types.h>
15463 #include <unistd.h>
15464 int main() { off64_t x = 7; }
15467 if eval $compile; then
15469 echo "You have off64_t."
15472 echo "You do not have off64_t."
15473 case "$lseeksize" in
15474 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
15481 : how to create joinable pthreads
15482 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
15484 echo "Checking what constant to use for creating joinable pthreads..." >&4
15485 $cat >try.c <<'EOCP'
15486 #include <pthread.h>
15488 int detachstate = JOINABLE;
15491 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
15492 if eval $compile; then
15493 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
15494 val="$undef" # Yes, undef.
15495 set d_old_pthread_create_joinable
15498 set old_pthread_create_joinable
15501 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
15502 if eval $compile; then
15503 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
15505 set d_old_pthread_create_joinable
15507 val=PTHREAD_CREATE_UNDETACHED
15508 set old_pthread_create_joinable
15511 set try -DJOINABLE=__UNDETACHED
15512 if eval $compile; then
15513 echo "You seem to use __UNDETACHED." >&4
15515 set d_old_pthread_create_joinable
15518 set old_pthread_create_joinable
15521 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
15523 set d_old_pthread_create_joinable
15526 set old_pthread_create_joinable
15533 d_old_pthread_create_joinable="$undef"
15534 old_pthread_create_joinable=""
15537 : see if pause exists
15541 : see if poll exists
15545 : see if readlink exists
15546 set readlink d_readlink
15552 case "$d_readlink" in
15554 if $issymlink /proc/self/exe ; then
15555 $ls -l /proc/self/exe > reflect
15556 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
15557 echo "You have Linux-like /proc/self/exe."
15558 procselfexe='"/proc/self/exe"'
15562 if $issymlink /proc/curproc/file ; then
15563 $ls -l /proc/curproc/file > reflect
15564 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
15565 echo "You have BSD-like /proc/curproc/file."
15566 procselfexe='"/proc/curproc/file"'
15576 : backward compatibility for d_hvfork
15577 if test X$d_hvfork != X; then
15578 d_vfork="$d_hvfork"
15581 : see if there is a vfork
15586 d_pseudofork=$undef
15588 : Ok, but do we want to use it. vfork is reportedly unreliable in
15589 : perl on Solaris 2.x, and probably elsewhere.
15593 case "$usevfork" in
15599 Perl can only use a vfork() that doesn't suffer from strict
15600 restrictions on calling functions or modifying global data in
15601 the child. For example, glibc-2.1 contains such a vfork()
15602 that is unsuitable. If your system provides a proper fork()
15603 call, chances are that you do NOT want perl to use vfork().
15606 rp="Do you still want to use vfork()?"
15611 echo "Ok, we won't use vfork()."
15620 $define) usevfork='true';;
15621 *) usevfork='false';;
15624 : see whether the pthread_atfork exists
15626 #include <pthread.h>
15629 #ifdef PTHREAD_ATFORK
15630 pthread_atfork(NULL,NULL,NULL);
15635 : see if pthread_atfork exists
15636 set try -DPTHREAD_ATFORK
15637 if eval $compile; then
15642 case "$usethreads" in
15645 $define) echo 'pthread_atfork found.' >&4 ;;
15646 *) echo 'pthread_atfork NOT found.' >&4 ;;
15649 set d_pthread_atfork
15652 : see if pthread_attr_setscope exists
15653 set pthread_attr_setscope d_pthread_attr_setscope
15657 : see whether the various POSIXish _yields exist
15659 #include <pthread.h>
15665 #ifdef PTHREAD_YIELD
15668 #ifdef PTHREAD_YIELD_NULL
15669 pthread_yield(NULL);
15675 : see if sched_yield exists
15676 set try -DSCHED_YIELD
15677 if eval $compile; then
15679 sched_yield='sched_yield()'
15683 case "$usethreads" in
15686 $define) echo 'sched_yield() found.' >&4 ;;
15687 *) echo 'sched_yield() NOT found.' >&4 ;;
15693 : see if pthread_yield exists
15694 set try -DPTHREAD_YIELD
15695 if eval $compile; then
15697 case "$sched_yield" in
15698 '') sched_yield='pthread_yield()' ;;
15701 set try -DPTHREAD_YIELD_NULL
15702 if eval $compile; then
15704 case "$sched_yield" in
15705 '') sched_yield='pthread_yield(NULL)' ;;
15711 case "$usethreads" in
15714 $define) echo 'pthread_yield() found.' >&4 ;;
15715 *) echo 'pthread_yield() NOT found.' >&4 ;;
15719 set d_pthread_yield
15721 case "$sched_yield" in
15722 '') sched_yield=undef ;;
15726 : see if random_r exists
15727 set random_r d_random_r
15729 case "$d_random_r" in
15731 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
15732 case "$d_random_r_proto:$usethreads" in
15733 ":define") d_random_r_proto=define
15734 set d_random_r_proto random_r $hdrs
15738 case "$d_random_r_proto" in
15740 case "$random_r_proto" in
15741 ''|0) try='int random_r(int*, struct random_data*);'
15742 ./protochk "extern $try" $hdrs && random_r_proto=I_iS ;;
15744 case "$random_r_proto" in
15745 ''|0) try='int random_r(long*, struct random_data*);'
15746 ./protochk "extern $try" $hdrs && random_r_proto=I_lS ;;
15748 case "$random_r_proto" in
15749 ''|0) try='int random_r(struct random_data*, int32_t*);'
15750 ./protochk "extern $try" $hdrs && random_r_proto=I_St ;;
15752 case "$random_r_proto" in
15753 ''|0) d_random_r=undef
15755 echo "Disabling random_r, cannot determine prototype." >&4 ;;
15756 * ) case "$random_r_proto" in
15757 REENTRANT_PROTO*) ;;
15758 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
15760 echo "Prototype: $try" ;;
15763 *) case "$usethreads" in
15764 define) echo "random_r has no prototype, not using it." >&4 ;;
15771 *) random_r_proto=0
15775 : see if readdir and friends exist
15776 set readdir d_readdir
15778 set seekdir d_seekdir
15780 set telldir d_telldir
15782 set rewinddir d_rewinddir
15785 : see if readdir64_r exists
15786 set readdir64_r d_readdir64_r
15788 case "$d_readdir64_r" in
15790 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
15791 case "$d_readdir64_r_proto:$usethreads" in
15792 ":define") d_readdir64_r_proto=define
15793 set d_readdir64_r_proto readdir64_r $hdrs
15797 case "$d_readdir64_r_proto" in
15799 case "$readdir64_r_proto" in
15800 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
15801 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TSR ;;
15803 case "$readdir64_r_proto" in
15804 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
15805 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TS ;;
15807 case "$readdir64_r_proto" in
15808 ''|0) d_readdir64_r=undef
15809 readdir64_r_proto=0
15810 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
15811 * ) case "$readdir64_r_proto" in
15812 REENTRANT_PROTO*) ;;
15813 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
15815 echo "Prototype: $try" ;;
15818 *) case "$usethreads" in
15819 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
15821 d_readdir64_r=undef
15822 readdir64_r_proto=0
15826 *) readdir64_r_proto=0
15830 : see if readdir_r exists
15831 set readdir_r d_readdir_r
15833 case "$d_readdir_r" in
15835 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
15836 case "$d_readdir_r_proto:$usethreads" in
15837 ":define") d_readdir_r_proto=define
15838 set d_readdir_r_proto readdir_r $hdrs
15842 case "$d_readdir_r_proto" in
15844 case "$readdir_r_proto" in
15845 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
15846 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TSR ;;
15848 case "$readdir_r_proto" in
15849 ''|0) try='int readdir_r(DIR*, struct dirent*);'
15850 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TS ;;
15852 case "$readdir_r_proto" in
15853 ''|0) d_readdir_r=undef
15855 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
15856 * ) case "$readdir_r_proto" in
15857 REENTRANT_PROTO*) ;;
15858 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
15860 echo "Prototype: $try" ;;
15863 *) case "$usethreads" in
15864 define) echo "readdir_r has no prototype, not using it." >&4 ;;
15871 *) readdir_r_proto=0
15875 : see if readv exists
15879 : see if recvmsg exists
15880 set recvmsg d_recvmsg
15883 : see if rename exists
15884 set rename d_rename
15887 : see if rmdir exists
15891 : see if memory.h is available.
15896 : See if it conflicts with string.h
15902 $cppstdin $cppflags $cppminus < $strings > mem.h
15903 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
15905 echo "We won't be including <memory.h>."
15915 : can bcopy handle overlapping blocks?
15918 case "$d_memmove" in
15919 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
15920 *) case "$d_bcopy" in
15922 echo "Checking to see if bcopy() can do overlapping copies..." >&4
15924 #$i_memory I_MEMORY
15925 #$i_stdlib I_STDLIB
15926 #$i_string I_STRING
15927 #$i_unistd I_UNISTD
15929 $cat >>try.c <<'EOCP'
15932 # include <memory.h>
15935 # include <stdlib.h>
15938 # include <string.h>
15940 # include <strings.h>
15943 # include <unistd.h> /* Needed for NetBSD */
15947 char buf[128], abc[128];
15953 /* Copy "abcde..." string to char abc[] so that gcc doesn't
15954 try to store the string in read-only memory. */
15955 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
15957 for (align = 7; align >= 0; align--) {
15958 for (len = 36; len; len--) {
15960 bcopy(abc, b, len);
15961 for (off = 1; off <= len; off++) {
15962 bcopy(b, b+off, len);
15963 bcopy(b+off, b, len);
15964 if (bcmp(b, abc, len))
15973 if eval $compile_ok; then
15974 if $run ./try 2>/dev/null; then
15975 echo "Yes, it can."
15978 echo "It can't, sorry."
15981 echo "(I can't compile the test program, so we'll assume not...)"
15991 : can memcpy handle overlapping blocks?
15994 case "$d_memmove" in
15995 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
15996 *) case "$d_memcpy" in
15998 echo "Checking to see if memcpy() can do overlapping copies..." >&4
16000 #$i_memory I_MEMORY
16001 #$i_stdlib I_STDLIB
16002 #$i_string I_STRING
16003 #$i_unistd I_UNISTD
16005 $cat >>try.c <<'EOCP'
16008 # include <memory.h>
16011 # include <stdlib.h>
16014 # include <string.h>
16016 # include <strings.h>
16019 # include <unistd.h> /* Needed for NetBSD */
16023 char buf[128], abc[128];
16029 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16030 try to store the string in read-only memory. */
16031 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
16033 for (align = 7; align >= 0; align--) {
16034 for (len = 36; len; len--) {
16036 memcpy(b, abc, len);
16037 for (off = 1; off <= len; off++) {
16038 memcpy(b+off, b, len);
16039 memcpy(b, b+off, len);
16040 if (memcmp(b, abc, len))
16049 if eval $compile_ok; then
16050 if $run ./try 2>/dev/null; then
16051 echo "Yes, it can."
16054 echo "It can't, sorry."
16057 echo "(I can't compile the test program, so we'll assume not...)"
16067 : can memcmp be trusted to compare relative magnitude?
16069 case "$d_memcmp" in
16072 echo "Checking if your memcmp() can compare relative magnitude..." >&4
16074 #$i_memory I_MEMORY
16075 #$i_stdlib I_STDLIB
16076 #$i_string I_STRING
16077 #$i_unistd I_UNISTD
16079 $cat >>try.c <<'EOCP'
16082 # include <memory.h>
16085 # include <stdlib.h>
16088 # include <string.h>
16090 # include <strings.h>
16093 # include <unistd.h> /* Needed for NetBSD */
16099 if ((a < b) && memcmp(&a, &b, 1) < 0)
16105 if eval $compile_ok; then
16106 if $run ./try 2>/dev/null; then
16107 echo "Yes, it can."
16110 echo "No, it can't (it uses signed chars)."
16113 echo "(I can't compile the test program, so we'll assume not...)"
16121 : see if prototype for sbrk is available
16123 set d_sbrkproto sbrk $i_unistd unistd.h
16126 : see if select exists
16127 set select d_select
16130 : see if semctl exists
16131 set semctl d_semctl
16134 : see if semget exists
16135 set semget d_semget
16138 : see if semop exists
16142 : see how much of the 'sem*(2)' library is present.
16145 case "$d_semctl$d_semget$d_semop" in
16146 *"$undef"*) h_sem=false;;
16150 case "`ipcs 2>&1`" in
16151 "SVID messages"*"not configured"*)
16152 echo "Your $osname does not have the sem*(2) configured." >&4
16155 set semctl d_semctl
16157 set semget d_semget
16165 : we could also check for sys/ipc.h ...
16166 if $h_sem && $test `./findhdr sys/sem.h`; then
16167 echo "You have the full sem*(2) library." >&4
16170 echo "You don't have the full sem*(2) library." >&4
16176 : see whether sys/sem.h defines union semun
16178 $cat > try.c <<'END'
16179 #include <sys/types.h>
16180 #include <sys/ipc.h>
16181 #include <sys/sem.h>
16182 int main () { union semun semun; semun.buf = 0; }
16185 if eval $compile; then
16186 echo "You have union semun in <sys/sem.h>." >&4
16189 echo "You do not have union semun in <sys/sem.h>." >&4
16196 : see how to do semctl IPC_STAT
16200 $cat > tryh.h <<END
16203 # define S_IRUSR S_IREAD
16204 # define S_IWUSR S_IWRITE
16205 # define S_IXUSR S_IEXEC
16207 # define S_IRUSR 0400
16208 # define S_IWUSR 0200
16209 # define S_IXUSR 0100
16211 # define S_IRGRP (S_IRUSR>>3)
16212 # define S_IWGRP (S_IWUSR>>3)
16213 # define S_IXGRP (S_IXUSR>>3)
16214 # define S_IROTH (S_IRUSR>>6)
16215 # define S_IWOTH (S_IWUSR>>6)
16216 # define S_IXOTH (S_IXUSR>>6)
16219 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
16220 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
16221 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
16224 : see whether semctl IPC_STAT can use union semun
16225 case "$d_semctl_semun" in
16229 #include <sys/types.h>
16230 #include <sys/ipc.h>
16231 #include <sys/sem.h>
16232 #include <sys/stat.h>
16239 #$d_union_semun HAS_UNION_SEMUN
16242 #ifndef HAS_UNION_SEMUN
16245 struct semid_ds *buf;
16246 unsigned short *array;
16252 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16253 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16255 struct semid_ds argbuf;
16258 st = semctl(sem, 0, IPC_STAT, arg);
16262 # endif /* IPC_STAT */
16263 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16265 if (semctl(sem, 0, IPC_RMID, arg) != 0)
16266 # endif /* IPC_RMID */
16267 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16269 #endif /* IPC_PRIVATE && ... */
16270 printf("semget failed: errno = %d\n", errno);
16275 if eval $compile; then
16278 semun) val="$define" ;;
16286 case "$d_semctl_semun" in
16288 echo "You can use union semun for semctl IPC_STAT." >&4
16291 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
16296 : see whether semctl IPC_STAT can use struct semid_ds pointer
16297 case "$d_semctl_semid_ds" in
16300 $cat > try.c <<'END'
16301 #include <sys/types.h>
16302 #include <sys/ipc.h>
16303 #include <sys/sem.h>
16304 #include <sys/stat.h>
16312 struct semid_ds arg;
16315 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16316 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16319 st = semctl(sem, 0, IPC_STAT, &arg);
16321 printf("semid_ds\n");
16323 # endif /* IPC_STAT */
16324 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16326 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
16327 # endif /* IPC_RMID */
16328 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16330 #endif /* IPC_PRIVATE && ... */
16331 printf("semget failed: errno = %d\n", errno);
16337 if eval $compile; then
16340 semid_ds) val="$define" ;;
16344 set d_semctl_semid_ds
16348 case "$d_semctl_semid_ds" in
16350 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
16352 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
16358 # We do not have the full sem*(2) library, so assume we can not
16364 set d_semctl_semid_ds
16370 : see if sendmsg exists
16371 set sendmsg d_sendmsg
16374 : see if setegid exists
16375 set setegid d_setegid
16378 : see if seteuid exists
16379 set seteuid d_seteuid
16382 : see if setgrent exists
16383 set setgrent d_setgrent
16386 : see if setgrent_r exists
16387 set setgrent_r d_setgrent_r
16389 case "$d_setgrent_r" in
16391 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
16392 case "$d_setgrent_r_proto:$usethreads" in
16393 ":define") d_setgrent_r_proto=define
16394 set d_setgrent_r_proto setgrent_r $hdrs
16398 case "$d_setgrent_r_proto" in
16400 case "$setgrent_r_proto" in
16401 ''|0) try='int setgrent_r(FILE**);'
16402 ./protochk "extern $try" $hdrs && setgrent_r_proto=I_H ;;
16404 case "$setgrent_r_proto" in
16405 ''|0) try='void setgrent_r(FILE**);'
16406 ./protochk "extern $try" $hdrs && setgrent_r_proto=V_H ;;
16408 case "$setgrent_r_proto" in
16409 ''|0) d_setgrent_r=undef
16411 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
16412 * ) case "$setgrent_r_proto" in
16413 REENTRANT_PROTO*) ;;
16414 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
16416 echo "Prototype: $try" ;;
16419 *) case "$usethreads" in
16420 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
16427 *) setgrent_r_proto=0
16431 : see if sethostent exists
16432 set sethostent d_sethent
16435 : see if sethostent_r exists
16436 set sethostent_r d_sethostent_r
16438 case "$d_sethostent_r" in
16440 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16441 case "$d_sethostent_r_proto:$usethreads" in
16442 ":define") d_sethostent_r_proto=define
16443 set d_sethostent_r_proto sethostent_r $hdrs
16447 case "$d_sethostent_r_proto" in
16449 case "$sethostent_r_proto" in
16450 ''|0) try='int sethostent_r(int, struct hostent_data*);'
16451 ./protochk "extern $try" $hdrs && sethostent_r_proto=I_ID ;;
16453 case "$sethostent_r_proto" in
16454 ''|0) try='void sethostent_r(int, struct hostent_data*);'
16455 ./protochk "extern $try" $hdrs && sethostent_r_proto=V_ID ;;
16457 case "$sethostent_r_proto" in
16458 ''|0) d_sethostent_r=undef
16459 sethostent_r_proto=0
16460 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
16461 * ) case "$sethostent_r_proto" in
16462 REENTRANT_PROTO*) ;;
16463 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
16465 echo "Prototype: $try" ;;
16468 *) case "$usethreads" in
16469 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
16471 d_sethostent_r=undef
16472 sethostent_r_proto=0
16476 *) sethostent_r_proto=0
16480 : see if setitimer exists
16481 set setitimer d_setitimer
16484 : see if setlinebuf exists
16485 set setlinebuf d_setlinebuf
16488 : see if setlocale exists
16489 set setlocale d_setlocale
16492 : see if locale.h is available
16493 set locale.h i_locale
16496 : see if setlocale_r exists
16497 set setlocale_r d_setlocale_r
16499 case "$d_setlocale_r" in
16501 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
16502 case "$d_setlocale_r_proto:$usethreads" in
16503 ":define") d_setlocale_r_proto=define
16504 set d_setlocale_r_proto setlocale_r $hdrs
16508 case "$d_setlocale_r_proto" in
16510 case "$setlocale_r_proto" in
16511 ''|0) try='int setlocale_r(int, const char*, char*, int);'
16512 ./protochk "extern $try" $hdrs && setlocale_r_proto=I_ICBI ;;
16514 case "$setlocale_r_proto" in
16515 ''|0) d_setlocale_r=undef
16516 setlocale_r_proto=0
16517 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
16518 * ) case "$setlocale_r_proto" in
16519 REENTRANT_PROTO*) ;;
16520 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
16522 echo "Prototype: $try" ;;
16525 *) case "$usethreads" in
16526 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
16528 d_setlocale_r=undef
16529 setlocale_r_proto=0
16533 *) setlocale_r_proto=0
16537 : see if setnetent exists
16538 set setnetent d_setnent
16541 : see if setnetent_r exists
16542 set setnetent_r d_setnetent_r
16544 case "$d_setnetent_r" in
16546 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16547 case "$d_setnetent_r_proto:$usethreads" in
16548 ":define") d_setnetent_r_proto=define
16549 set d_setnetent_r_proto setnetent_r $hdrs
16553 case "$d_setnetent_r_proto" in
16555 case "$setnetent_r_proto" in
16556 ''|0) try='int setnetent_r(int, struct netent_data*);'
16557 ./protochk "extern $try" $hdrs && setnetent_r_proto=I_ID ;;
16559 case "$setnetent_r_proto" in
16560 ''|0) try='void setnetent_r(int, struct netent_data*);'
16561 ./protochk "extern $try" $hdrs && setnetent_r_proto=V_ID ;;
16563 case "$setnetent_r_proto" in
16564 ''|0) d_setnetent_r=undef
16565 setnetent_r_proto=0
16566 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
16567 * ) case "$setnetent_r_proto" in
16568 REENTRANT_PROTO*) ;;
16569 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
16571 echo "Prototype: $try" ;;
16574 *) case "$usethreads" in
16575 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
16577 d_setnetent_r=undef
16578 setnetent_r_proto=0
16582 *) setnetent_r_proto=0
16586 : see if setprotoent exists
16587 set setprotoent d_setpent
16590 : see if setpgid exists
16591 set setpgid d_setpgid
16594 : see if setpgrp2 exists
16595 set setpgrp2 d_setpgrp2
16598 : see if setpriority exists
16599 set setpriority d_setprior
16602 : see if setproctitle exists
16603 set setproctitle d_setproctitle
16606 : see if setprotoent_r exists
16607 set setprotoent_r d_setprotoent_r
16609 case "$d_setprotoent_r" in
16611 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16612 case "$d_setprotoent_r_proto:$usethreads" in
16613 ":define") d_setprotoent_r_proto=define
16614 set d_setprotoent_r_proto setprotoent_r $hdrs
16618 case "$d_setprotoent_r_proto" in
16620 case "$setprotoent_r_proto" in
16621 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
16622 ./protochk "extern $try" $hdrs && setprotoent_r_proto=I_ID ;;
16624 case "$setprotoent_r_proto" in
16625 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
16626 ./protochk "extern $try" $hdrs && setprotoent_r_proto=V_ID ;;
16628 case "$setprotoent_r_proto" in
16629 ''|0) d_setprotoent_r=undef
16630 setprotoent_r_proto=0
16631 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
16632 * ) case "$setprotoent_r_proto" in
16633 REENTRANT_PROTO*) ;;
16634 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
16636 echo "Prototype: $try" ;;
16639 *) case "$usethreads" in
16640 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
16642 d_setprotoent_r=undef
16643 setprotoent_r_proto=0
16647 *) setprotoent_r_proto=0
16651 : see if setpwent exists
16652 set setpwent d_setpwent
16655 : see if setpwent_r exists
16656 set setpwent_r d_setpwent_r
16658 case "$d_setpwent_r" in
16660 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
16661 case "$d_setpwent_r_proto:$usethreads" in
16662 ":define") d_setpwent_r_proto=define
16663 set d_setpwent_r_proto setpwent_r $hdrs
16667 case "$d_setpwent_r_proto" in
16669 case "$setpwent_r_proto" in
16670 ''|0) try='int setpwent_r(FILE**);'
16671 ./protochk "extern $try" $hdrs && setpwent_r_proto=I_H ;;
16673 case "$setpwent_r_proto" in
16674 ''|0) try='void setpwent_r(FILE**);'
16675 ./protochk "extern $try" $hdrs && setpwent_r_proto=V_H ;;
16677 case "$setpwent_r_proto" in
16678 ''|0) d_setpwent_r=undef
16680 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
16681 * ) case "$setpwent_r_proto" in
16682 REENTRANT_PROTO*) ;;
16683 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
16685 echo "Prototype: $try" ;;
16688 *) case "$usethreads" in
16689 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
16696 *) setpwent_r_proto=0
16700 : see if setregid exists
16701 set setregid d_setregid
16703 set setresgid d_setresgid
16706 : see if setreuid exists
16707 set setreuid d_setreuid
16709 set setresuid d_setresuid
16712 : see if setrgid exists
16713 set setrgid d_setrgid
16716 : see if setruid exists
16717 set setruid d_setruid
16720 : see if setservent exists
16721 set setservent d_setsent
16724 : see if setservent_r exists
16725 set setservent_r d_setservent_r
16727 case "$d_setservent_r" in
16729 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16730 case "$d_setservent_r_proto:$usethreads" in
16731 ":define") d_setservent_r_proto=define
16732 set d_setservent_r_proto setservent_r $hdrs
16736 case "$d_setservent_r_proto" in
16738 case "$setservent_r_proto" in
16739 ''|0) try='int setservent_r(int, struct servent_data*);'
16740 ./protochk "extern $try" $hdrs && setservent_r_proto=I_ID ;;
16742 case "$setservent_r_proto" in
16743 ''|0) try='void setservent_r(int, struct servent_data*);'
16744 ./protochk "extern $try" $hdrs && setservent_r_proto=V_ID ;;
16746 case "$setservent_r_proto" in
16747 ''|0) d_setservent_r=undef
16748 setservent_r_proto=0
16749 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
16750 * ) case "$setservent_r_proto" in
16751 REENTRANT_PROTO*) ;;
16752 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
16754 echo "Prototype: $try" ;;
16757 *) case "$usethreads" in
16758 define) echo "setservent_r has no prototype, not using it." >&4 ;;
16760 d_setservent_r=undef
16761 setservent_r_proto=0
16765 *) setservent_r_proto=0
16769 : see if setsid exists
16770 set setsid d_setsid
16773 : see if setvbuf exists
16774 set setvbuf d_setvbuf
16777 : see if sfio.h is available
16782 : see if sfio library is available
16793 : Ok, but do we want to use it.
16797 true|$define|[yY]*) dflt='y';;
16800 echo "$package can use the sfio library, but it is experimental."
16801 case "$useperlio" in
16803 echo "For sfio also the PerlIO abstraction layer is needed."
16804 echo "Earlier you said you wouldn't want that."
16807 rp="You seem to have sfio available, do you want to try using it?"
16810 y|Y) echo "Ok, turning on both sfio and PerlIO, then."
16811 useperlio="$define"
16814 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
16819 *) case "$usesfio" in
16820 true|$define|[yY]*)
16821 echo "Sorry, cannot find sfio on this machine." >&4
16822 echo "Ignoring your setting of usesfio=$usesfio." >&4
16831 $define) usesfio='true';;
16832 *) usesfio='false';;
16836 *) : Remove sfio from list of libraries to use
16839 echo "Removing unneeded -lsfio from library list" >&4
16840 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
16843 echo "libs = $libs" >&4
16850 : see if shmctl exists
16851 set shmctl d_shmctl
16854 : see if shmget exists
16855 set shmget d_shmget
16858 : see if shmat exists
16861 : see what shmat returns
16864 $cat >shmat.c <<'END'
16865 #include <sys/shm.h>
16868 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
16873 echo "and it returns ($shmattype)." >&4
16874 : see if a prototype for shmat is available
16875 xxx=`./findhdr sys/shm.h`
16876 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
16877 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
16888 set d_shmatprototype
16891 : see if shmdt exists
16895 : see how much of the 'shm*(2)' library is present.
16898 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
16899 *"$undef"*) h_shm=false;;
16903 case "`ipcs 2>&1`" in
16904 "SVID shared memory"*"not configured"*)
16905 echo "Your $osname does not have the shm*(2) configured." >&4
16908 set shmctl d_shmctl
16910 set shmget d_shmget
16920 : we could also check for sys/ipc.h ...
16921 if $h_shm && $test `./findhdr sys/shm.h`; then
16922 echo "You have the full shm*(2) library." >&4
16925 echo "You don't have the full shm*(2) library." >&4
16932 : see if we have sigaction
16933 if set sigaction val -f d_sigaction; eval $csym; $val; then
16934 echo 'sigaction() found.' >&4
16937 #include <sys/types.h>
16938 #include <signal.h>
16939 #$i_stdlib I_STDLIB
16941 #include <stdlib.h>
16945 struct sigaction act, oact;
16947 oact.sa_handler = 0;
16948 /* so that act and oact are used */
16949 exit(act.sa_flags == 0 && oact.sa_handler == 0);
16953 if eval $compile_ok; then
16956 echo "But you don't seem to have a useable struct sigaction." >&4
16960 echo 'sigaction NOT found.' >&4
16963 set d_sigaction; eval $setvar
16966 : see if this is a sunmath.h system
16967 set sunmath.h i_sunmath
16970 : see if signbit exists
16971 $echo $n "Checking to see if you have signbit() available to work on $nvtype... $c" >&4
16974 #$i_sunmath I_SUNMATH
16978 #ifdef I_SUNMATH /* Solaris special math library */
16979 # include <sunmath.h>
16982 int main(int argc, char **argv)
16986 if ((signbit(x) == 0) && (signbit(y) != 0))
16994 if eval $compile; then
16995 if $run ./try; then
16999 $echo "Signbit seems to be available, but doesn't work as I expected."
17000 $echo "I won't use it." >&4
17011 : see if sigprocmask exists
17012 set sigprocmask d_sigprocmask
17015 : see if sigsetjmp exists
17017 case "$d_sigsetjmp" in
17020 #include <setjmp.h>
17021 #$i_stdlib I_STDLIB
17023 #include <stdlib.h>
17029 if (sigsetjmp(env,1))
17032 siglongjmp(env, 1);
17037 if eval $compile; then
17038 if $run ./try >/dev/null 2>&1; then
17039 echo "POSIX sigsetjmp found." >&4
17043 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
17049 echo "sigsetjmp not found." >&4
17053 *) val="$d_sigsetjmp"
17054 case "$d_sigsetjmp" in
17055 $define) echo "POSIX sigsetjmp found." >&4;;
17056 $undef) echo "sigsetjmp not found." >&4;;
17064 : see if snprintf exists
17065 set snprintf d_snprintf
17068 : see if vsnprintf exists
17069 set vsnprintf d_vsnprintf
17072 case "$d_snprintf-$d_vsnprintf" in
17075 Checking whether your snprintf() and vsnprintf() work okay...
17077 $cat >try.c <<'EOCP'
17078 /* v?snprintf testing logic courtesy of Russ Allbery.
17079 * According to C99:
17080 * - if the buffer is too short it still must be \0-terminated
17081 * - if the buffer is too short the potentially required length
17082 * must be returned and not -1
17083 * - if the buffer is NULL the potentially required length
17084 * must be returned and not -1 or core dump
17087 #include <stdarg.h>
17091 int test (char *format, ...)
17096 va_start (args, format);
17097 count = vsnprintf (buf, sizeof buf, format, args);
17104 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
17105 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
17109 if eval $compile; then
17112 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
17114 Your snprintf() and snprintf() don't seem to be working okay.
17116 d_snprintf="$undef"
17117 d_vsnprintf="$undef"
17121 echo "(I can't seem to compile the test program--assuming they don't)"
17122 d_snprintf="$undef"
17123 d_vsnprintf="$undef"
17129 : see if sockatmark exists
17130 set sockatmark d_sockatmark
17133 : see if prototype for sockatmark is available
17135 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
17138 : see if socks5_init exists
17139 set socks5_init d_socks5_init
17142 : see if sprintf returns the length of the string in the buffer as per ANSI
17143 $echo "Checking whether sprintf returns the length of the string..." >&4
17146 #$i_stdlib I_STDLIB
17148 #include <stdlib.h>
17150 #$i_string I_STRING
17152 # include <string.h>
17154 # include <strings.h>
17163 int check (size_t expect, int test) {
17164 size_t got = strlen(buffer);
17168 printf("expected %ld, got %ld in test %d '%s'\n", (long) expect, (long) got,
17173 int main(int argc, char **argv) {
17176 check(sprintf(buffer, ""), ++test);
17177 check(sprintf(buffer, "%s %s", "perl", "rules"), ++test);
17178 check(sprintf(buffer, "I like %g", atan2(0,-1)), ++test);
17185 d_sprintf_returns_strlen="$undef"
17186 if eval $compile; then
17190 sprintf returns the length of the string (as ANSI says it should)
17192 d_sprintf_returns_strlen="$define"
17195 sprintf does not return the length of the string (how old is this system?)
17197 d_sprintf_returns_strlen="$undef"
17203 : see if srand48_r exists
17204 set srand48_r d_srand48_r
17206 case "$d_srand48_r" in
17208 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17209 case "$d_srand48_r_proto:$usethreads" in
17210 ":define") d_srand48_r_proto=define
17211 set d_srand48_r_proto srand48_r $hdrs
17215 case "$d_srand48_r_proto" in
17217 case "$srand48_r_proto" in
17218 ''|0) try='int srand48_r(long, struct drand48_data*);'
17219 ./protochk "extern $try" $hdrs && srand48_r_proto=I_LS ;;
17221 case "$srand48_r_proto" in
17222 ''|0) d_srand48_r=undef
17224 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
17225 * ) case "$srand48_r_proto" in
17226 REENTRANT_PROTO*) ;;
17227 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
17229 echo "Prototype: $try" ;;
17232 *) case "$usethreads" in
17233 define) echo "srand48_r has no prototype, not using it." >&4 ;;
17240 *) srand48_r_proto=0
17244 : see if srandom_r exists
17245 set srandom_r d_srandom_r
17247 case "$d_srandom_r" in
17249 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17250 case "$d_srandom_r_proto:$usethreads" in
17251 ":define") d_srandom_r_proto=define
17252 set d_srandom_r_proto srandom_r $hdrs
17256 case "$d_srandom_r_proto" in
17258 case "$srandom_r_proto" in
17259 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
17260 ./protochk "extern $try" $hdrs && srandom_r_proto=I_TS ;;
17262 case "$srandom_r_proto" in
17263 ''|0) d_srandom_r=undef
17265 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
17266 * ) case "$srandom_r_proto" in
17267 REENTRANT_PROTO*) ;;
17268 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
17270 echo "Prototype: $try" ;;
17273 *) case "$usethreads" in
17274 define) echo "srandom_r has no prototype, not using it." >&4 ;;
17281 *) srandom_r_proto=0
17285 : see if prototype for setresgid is available
17287 set d_sresgproto setresgid $i_unistd unistd.h
17290 : see if prototype for setresuid is available
17292 set d_sresuproto setresuid $i_unistd unistd.h
17295 : see if sys/stat.h is available
17296 set sys/stat.h i_sysstat
17300 : see if stat knows about block sizes
17302 echo "Checking to see if your struct stat has st_blocks field..." >&4
17303 set d_statblks stat st_blocks $i_sysstat sys/stat.h
17307 : see if this is a sys/vfs.h system
17308 set sys/vfs.h i_sysvfs
17312 : see if this is a sys/statfs.h system
17313 set sys/statfs.h i_sysstatfs
17318 echo "Checking to see if your system supports struct statfs..." >&4
17319 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
17321 case "$d_statfs_s" in
17322 "$define") echo "Yes, it does." ;;
17323 *) echo "No, it doesn't." ;;
17328 : see if struct statfs knows about f_flags
17329 case "$d_statfs_s" in
17332 echo "Checking to see if your struct statfs has f_flags field..." >&4
17333 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
17337 set d_statfs_f_flags
17341 case "$d_statfs_f_flags" in
17342 "$define") echo "Yes, it does." ;;
17343 *) echo "No, it doesn't." ;;
17347 Checking how to access stdio streams by file descriptor number...
17349 case "$stdio_stream_array" in
17350 '') $cat >try.c <<EOCP
17353 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
17357 for s in _iob __iob __sF
17359 set try -DSTDIO_STREAM_ARRAY=$s
17360 if eval $compile; then
17361 case "`$run ./try`" in
17362 yes) stdio_stream_array=$s; break ;;
17368 case "$stdio_stream_array" in
17370 I can't figure out how to access stdio streams by file descriptor number.
17372 d_stdio_stream_array="$undef"
17375 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
17377 d_stdio_stream_array="$define"
17381 : see if strcoll exists
17382 set strcoll d_strcoll
17385 : check for structure copying
17387 echo "Checking to see if your C compiler can copy structs..." >&4
17388 $cat >try.c <<'EOCP'
17398 if $cc -c try.c >/dev/null 2>&1 ; then
17400 echo "Yup, it can."
17403 echo "Nope, it can't."
17409 : see if strerror and/or sys_errlist[] exist
17411 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
17412 if set strerror val -f d_strerror; eval $csym; $val; then
17413 echo 'strerror() found.' >&4
17414 d_strerror="$define"
17415 d_strerrm='strerror(e)'
17416 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17417 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
17418 d_syserrlst="$define"
17420 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
17421 d_syserrlst="$undef"
17423 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
17424 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
17425 echo 'strerror() found in string header.' >&4
17426 d_strerror="$define"
17427 d_strerrm='strerror(e)'
17428 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17429 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
17430 d_syserrlst="$define"
17432 echo "(You don't appear to have any sys_errlist[], how can this be?)"
17433 d_syserrlst="$undef"
17435 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17436 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
17437 d_strerror="$undef"
17438 d_syserrlst="$define"
17439 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
17441 echo 'strerror() and sys_errlist[] NOT found.' >&4
17442 d_strerror="$undef"
17443 d_syserrlst="$undef"
17444 d_strerrm='"unknown"'
17448 : see if strerror_r exists
17449 set strerror_r d_strerror_r
17451 case "$d_strerror_r" in
17453 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
17454 case "$d_strerror_r_proto:$usethreads" in
17455 ":define") d_strerror_r_proto=define
17456 set d_strerror_r_proto strerror_r $hdrs
17460 case "$d_strerror_r_proto" in
17462 case "$strerror_r_proto" in
17463 ''|0) try='int strerror_r(int, char*, size_t);'
17464 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBW ;;
17466 case "$strerror_r_proto" in
17467 ''|0) try='int strerror_r(int, char*, int);'
17468 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBI ;;
17470 case "$strerror_r_proto" in
17471 ''|0) try='char* strerror_r(int, char*, size_t);'
17472 ./protochk "extern $try" $hdrs && strerror_r_proto=B_IBW ;;
17474 case "$strerror_r_proto" in
17475 ''|0) d_strerror_r=undef
17477 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
17478 * ) case "$strerror_r_proto" in
17479 REENTRANT_PROTO*) ;;
17480 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
17482 echo "Prototype: $try" ;;
17485 *) case "$usethreads" in
17486 define) echo "strerror_r has no prototype, not using it." >&4 ;;
17493 *) strerror_r_proto=0
17497 : see if strftime exists
17498 set strftime d_strftime
17501 : see if strlcat exists
17502 set strlcat d_strlcat
17505 : see if strlcpy exists
17506 set strlcpy d_strlcpy
17509 : see if strtod exists
17510 set strtod d_strtod
17513 : see if strtol exists
17514 set strtol d_strtol
17517 : see if strtold exists
17518 set strtold d_strtold
17521 : see if strtoll exists
17522 set strtoll d_strtoll
17525 case "$d_longlong-$d_strtoll" in
17528 Checking whether your strtoll() works okay...
17530 $cat >try.c <<'EOCP'
17533 #define strtoll __strtoll
17536 #define strtoll _strtoll
17539 extern long long int strtoll(char *s, char **, int);
17540 static int bad = 0;
17541 int check(char *s, long long ell, int een) {
17544 gll = strtoll(s, 0, 10);
17545 if (!((gll == ell) && (errno == een)))
17549 check(" 1", 1LL, 0);
17550 check(" 0", 0LL, 0);
17551 check("-1", -1LL, 0);
17552 check("-9223372036854775808", -9223372036854775808LL, 0);
17553 check("-9223372036854775808", -9223372036854775808LL, 0);
17554 check(" 9223372036854775807", 9223372036854775807LL, 0);
17555 check("-9223372036854775808", -9223372036854775808LL, 0);
17556 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
17557 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
17563 if eval $compile; then
17566 ok) echo "Your strtoll() seems to be working okay." ;;
17568 Your strtoll() doesn't seem to be working okay.
17574 echo "(I can't seem to compile the test program--assuming it doesn't)"
17580 : see if strtoq exists
17581 set strtoq d_strtoq
17584 : see if strtoul exists
17585 set strtoul d_strtoul
17588 case "$d_strtoul" in
17591 Checking whether your strtoul() works okay...
17593 $cat >try.c <<'EOCP'
17596 extern unsigned long int strtoul(char *s, char **, int);
17597 static int bad = 0;
17598 void check(char *s, unsigned long eul, int een) {
17601 gul = strtoul(s, 0, 10);
17602 if (!((gul == eul) && (errno == een)))
17606 check(" 1", 1L, 0);
17607 check(" 0", 0L, 0);
17609 case "$longsize" in
17611 $cat >>try.c <<'EOCP'
17612 check("18446744073709551615", 18446744073709551615UL, 0);
17613 check("18446744073709551616", 18446744073709551615UL, ERANGE);
17614 #if 0 /* strtoul() for /^-/ strings is undefined. */
17615 check("-1", 18446744073709551615UL, 0);
17616 check("-18446744073709551614", 2, 0);
17617 check("-18446744073709551615", 1, 0);
17618 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
17619 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
17624 $cat >>try.c <<'EOCP'
17625 check("4294967295", 4294967295UL, 0);
17626 check("4294967296", 4294967295UL, ERANGE);
17627 #if 0 /* strtoul() for /^-/ strings is undefined. */
17628 check("-1", 4294967295UL, 0);
17629 check("-4294967294", 2, 0);
17630 check("-4294967295", 1, 0);
17631 check("-4294967296", 4294967295UL, ERANGE);
17632 check("-4294967297", 4294967295UL, ERANGE);
17637 : Should we write these tests to be more portable by sprintf-ing
17638 : ~0 and then manipulating that char string as input for strtol?
17641 $cat >>try.c <<'EOCP'
17648 if eval $compile; then
17649 case "`$run ./try`" in
17650 ok) echo "Your strtoul() seems to be working okay." ;;
17652 Your strtoul() doesn't seem to be working okay.
17658 echo "(I can't seem to compile the test program--assuming it doesn't)"
17664 : see if strtoull exists
17665 set strtoull d_strtoull
17668 case "$d_longlong-$d_strtoull" in
17671 Checking whether your strtoull() works okay...
17673 $cat >try.c <<'EOCP'
17676 #define strtoull __strtoull
17679 extern unsigned long long int strtoull(char *s, char **, int);
17680 static int bad = 0;
17681 int check(char *s, long long eull, int een) {
17684 gull = strtoull(s, 0, 10);
17685 if (!((gull == eull) && (errno == een)))
17689 check(" 1", 1LL, 0);
17690 check(" 0", 0LL, 0);
17691 check("18446744073709551615", 18446744073709551615ULL, 0);
17692 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
17693 #if 0 /* strtoull() for /^-/ strings is undefined. */
17694 check("-1", 18446744073709551615ULL, 0);
17695 check("-18446744073709551614", 2LL, 0);
17696 check("-18446744073709551615", 1LL, 0);
17697 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
17698 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
17705 if eval $compile; then
17706 case "`$run ./try`" in
17707 ok) echo "Your strtoull() seems to be working okay." ;;
17709 Your strtoull() doesn't seem to be working okay.
17711 d_strtoull="$undef"
17715 echo "(I can't seem to compile the test program--assuming it doesn't)"
17716 d_strtoull="$undef"
17721 : see if strtouq exists
17722 set strtouq d_strtouq
17725 case "$d_strtouq" in
17728 Checking whether your strtouq() works okay...
17730 $cat >try.c <<'EOCP'
17733 extern unsigned long long int strtouq(char *s, char **, int);
17734 static int bad = 0;
17735 void check(char *s, unsigned long long eull, int een) {
17736 unsigned long long gull;
17738 gull = strtouq(s, 0, 10);
17739 if (!((gull == eull) && (errno == een)))
17743 check(" 1", 1LL, 0);
17744 check(" 0", 0LL, 0);
17745 check("18446744073709551615", 18446744073709551615ULL, 0);
17746 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
17747 #if 0 /* strtouq() for /^-/ strings is undefined. */
17748 check("-1", 18446744073709551615ULL, 0);
17749 check("-18446744073709551614", 2LL, 0);
17750 check("-18446744073709551615", 1LL, 0);
17751 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
17752 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
17760 if eval $compile; then
17761 case "`$run ./try`" in
17762 ok) echo "Your strtouq() seems to be working okay." ;;
17764 Your strtouq() doesn't seem to be working okay.
17770 echo "(I can't seem to compile the test program--assuming it doesn't)"
17776 : see if strxfrm exists
17777 set strxfrm d_strxfrm
17780 : see if symlink exists
17781 set symlink d_symlink
17784 : see if syscall exists
17785 set syscall d_syscall
17788 : see if prototype for syscall is available
17790 set d_syscallproto syscall $i_unistd unistd.h
17793 : see if sysconf exists
17794 set sysconf d_sysconf
17797 : see if system exists
17798 set system d_system
17801 : see if tcgetpgrp exists
17802 set tcgetpgrp d_tcgetpgrp
17805 : see if tcsetpgrp exists
17806 set tcsetpgrp d_tcsetpgrp
17809 : see if prototype for telldir is available
17811 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
17814 : see if time exists
17816 if test "X$d_time" = X -o X"$timetype" = X; then
17817 if set time val -f d_time; eval $csym; $val; then
17818 echo 'time() found.' >&4
17820 rp="What is the type returned by time() on this system?"
17821 set time_t timetype long stdio.h sys/types.h
17824 echo 'time() not found, hope that will do.' >&4
17832 : see if this is a sys/times.h system
17833 set sys/times.h i_systimes
17836 : see if times exists
17838 if set times val -f d_times; eval $csym; $val; then
17839 echo 'times() found.' >&4
17842 case "$i_systimes" in
17843 "$define") inc='sys/times.h';;
17845 rp="What is the type returned by times() on this system?"
17846 set clock_t clocktype long stdio.h sys/types.h $inc
17849 echo 'times() NOT found, hope that will do.' >&4
17854 : see if tmpnam_r exists
17855 set tmpnam_r d_tmpnam_r
17857 case "$d_tmpnam_r" in
17859 hdrs="$i_systypes sys/types.h define stdio.h "
17860 case "$d_tmpnam_r_proto:$usethreads" in
17861 ":define") d_tmpnam_r_proto=define
17862 set d_tmpnam_r_proto tmpnam_r $hdrs
17866 case "$d_tmpnam_r_proto" in
17868 case "$tmpnam_r_proto" in
17869 ''|0) try='char* tmpnam_r(char*);'
17870 ./protochk "extern $try" $hdrs && tmpnam_r_proto=B_B ;;
17872 case "$tmpnam_r_proto" in
17873 ''|0) d_tmpnam_r=undef
17875 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
17876 * ) case "$tmpnam_r_proto" in
17877 REENTRANT_PROTO*) ;;
17878 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
17880 echo "Prototype: $try" ;;
17883 *) case "$usethreads" in
17884 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
17891 *) tmpnam_r_proto=0
17895 : see if truncate exists
17896 set truncate d_truncate
17899 : see if ttyname_r exists
17900 set ttyname_r d_ttyname_r
17902 case "$d_ttyname_r" in
17904 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
17905 case "$d_ttyname_r_proto:$usethreads" in
17906 ":define") d_ttyname_r_proto=define
17907 set d_ttyname_r_proto ttyname_r $hdrs
17911 case "$d_ttyname_r_proto" in
17913 case "$ttyname_r_proto" in
17914 ''|0) try='int ttyname_r(int, char*, size_t);'
17915 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBW ;;
17917 case "$ttyname_r_proto" in
17918 ''|0) try='int ttyname_r(int, char*, int);'
17919 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBI ;;
17921 case "$ttyname_r_proto" in
17922 ''|0) try='char* ttyname_r(int, char*, int);'
17923 ./protochk "extern $try" $hdrs && ttyname_r_proto=B_IBI ;;
17925 case "$ttyname_r_proto" in
17926 ''|0) d_ttyname_r=undef
17928 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
17929 * ) case "$ttyname_r_proto" in
17930 REENTRANT_PROTO*) ;;
17931 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
17933 echo "Prototype: $try" ;;
17936 *) case "$usethreads" in
17937 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
17944 *) ttyname_r_proto=0
17948 : see if tzname[] exists
17950 if set tzname val -a d_tzname; eval $csym; $val; then
17952 echo 'tzname[] found.' >&4
17955 echo 'tzname[] NOT found.' >&4
17961 next|rhapsody|darwin) multiarch="$define" ;;
17963 case "$multiarch" in
17964 ''|[nN]*) multiarch="$undef" ;;
17967 : check for ordering of bytes in a UV
17969 case "$usecrosscompile$multiarch" in
17972 You seem to be either cross-compiling or doing a multiarchitecture build,
17973 skipping the byteorder check.
17979 case "$byteorder" in
17982 In the following, larger digits indicate more significance. A big-endian
17983 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
17984 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
17985 machines may have weird orders like 3412. A Cray will report 87654321,
17986 an Alpha will report 12345678. If the test program works the default is
17988 I'm now running the test program...
17992 #$i_stdlib I_STDLIB
17994 #include <stdlib.h>
17996 #include <sys/types.h>
17997 typedef $uvtype UV;
18007 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
18009 u.l = (UV)0x04030201;
18010 for (i = 0; i < $uvsize; i++)
18011 printf("%c", u.c[i]+'0');
18018 if eval $compile && $run ./try > /dev/null; then
18021 [1-4][1-4][1-4][1-4]|12345678|87654321)
18022 echo "(The test program ran ok.)"
18023 echo "byteorder=$dflt"
18026 ????|????????) echo "(The test program ran ok.)" ;;
18027 *) echo "(The test program didn't run right for some reason.)" ;;
18032 (I can't seem to compile the test program. Guessing big-endian...)
18035 case "$xxx_prompt" in
18037 rp="What is the order of bytes in $uvtype?"
18052 Checking to see whether you can access character data unalignedly...
18054 case "$d_u32align" in
18055 '') $cat >try.c <<EOCP
18057 #$i_stdlib I_STDLIB
18059 #include <stdlib.h>
18061 #define U32 $u32type
18062 #define BYTEORDER 0x$byteorder
18064 #include <signal.h>
18066 $signal_t bletch(int s) { exit(4); }
18069 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
18074 if (sizeof(U32) != 4) {
18075 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
18082 signal(SIGBUS, bletch);
18094 for (i = 0; i < 4; i++) {
18095 up = (U32*)(buf + i);
18096 if (! ((*up == 1 << (8*i)) || /* big-endian */
18097 (*up == 1 << (8*(3-i))) /* little-endian */
18101 printf("read failed (%x)\n", *up);
18107 for (i = 0; i < 4; i++) {
18108 up = (U32*)(buf + i);
18110 if (*up != 0xBeef) {
18111 printf("write failed (%x)\n", *up);
18125 if eval $compile_ok; then
18126 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
18127 $run ./try 2>&1 >/dev/null
18130 You can access character data pretty unalignedly.
18132 d_u32align="$undef"
18135 It seems that you must access character data in an aligned manner.
18137 d_u32align="$define"
18141 rp='Can you access character data at unaligned addresses?'
18145 [yY]*) d_u32align="$undef" ;;
18146 *) d_u32align="$define" ;;
18153 : see if ualarm exists
18154 set ualarm d_ualarm
18157 : see if umask exists
18161 : see if unordered exists
18162 set unordered d_unordered
18165 : see if unsetenv exists
18166 set unsetenv d_unsetenv
18169 : see if usleep exists
18170 set usleep d_usleep
18173 : see if prototype for usleep is available
18175 set d_usleepproto usleep $i_unistd unistd.h
18178 : see if ustat exists
18182 : see if closedir exists
18183 set closedir d_closedir
18186 case "$d_closedir" in
18189 echo "Checking whether closedir() returns a status..." >&4
18191 #$i_dirent I_DIRENT /**/
18192 #$i_sysdir I_SYS_DIR /**/
18193 #$i_sysndir I_SYS_NDIR /**/
18194 #$i_systypes I_SYS_TYPES /**/
18196 #if defined(I_SYS_TYPES)
18197 #include <sys/types.h>
18199 #if defined(I_DIRENT)
18200 #include <dirent.h>
18201 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
18202 #include <sys/dir.h>
18206 #include <sys/ndir.h>
18210 #include <ndir.h> /* may be wrong in the future */
18212 #include <sys/dir.h>
18217 int main() { return closedir(opendir(".")); }
18220 if eval $compile_ok; then
18221 if $run ./try > /dev/null 2>&1 ; then
18222 echo "Yes, it does."
18225 echo "No, it doesn't."
18229 echo "(I can't seem to compile the test program--assuming it doesn't)"
18237 set d_void_closedir
18241 : see if there is a wait4
18245 : see if waitpid exists
18246 set waitpid d_waitpid
18249 : see if wcstombs exists
18250 set wcstombs d_wcstombs
18253 : see if wctomb exists
18254 set wctomb d_wctomb
18257 : see if writev exists
18258 set writev d_writev
18261 : preserve RCS keywords in files with variable substitution, grrr
18266 Revision='$Revision'
18268 : check for alignment requirements
18270 case "$usecrosscompile$multiarch" in
18273 You seem to be either cross-compiling or doing a multiarchitecture build,
18274 skipping the memory alignment check.
18277 case "$alignbytes" in
18278 '') alignbytes=8 ;;
18282 case "$alignbytes" in
18283 '') echo "Checking alignment constraints..." >&4
18284 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
18285 $cat >try.c <<'EOCP'
18286 typedef long double NV;
18289 $cat >try.c <<'EOCP'
18293 $cat >>try.c <<'EOCP'
18301 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
18306 if eval $compile_ok; then
18310 echo "(I can't seem to compile the test program...)"
18313 *) dflt="$alignbytes"
18316 rp="Doubles must be aligned on a how-many-byte boundary?"
18324 : set the base revision
18327 : how do we concatenate cpp tokens here?
18329 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
18330 $cat >cpp_stuff.c <<'EOCP'
18331 #define RCAT(a,b)a/**/b
18332 #define ACAT(a,b)a ## b
18336 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
18337 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
18338 echo "Oh! Smells like ANSI's been here." >&4
18339 echo "We can catify or stringify, separately or together!"
18341 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
18342 echo "Ah, yes! The good old days!" >&4
18343 echo "However, in the good old days we don't know how to stringify and"
18344 echo "catify at the same time."
18348 Hmm, I don't seem to be able to concatenate tokens with your cpp.
18349 You're going to have to edit the values of CAT[2-5] in config.h...
18351 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
18355 : see if this is a db.h system
18361 : Check db version.
18363 echo "Checking Berkeley DB version ..." >&4
18369 #include <sys/types.h>
18371 #$i_stdlib I_STDLIB
18373 #include <stdlib.h>
18376 int main(int argc, char *argv[])
18378 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
18379 int Major, Minor, Patch ;
18380 unsigned long Version ;
18381 (void)db_version(&Major, &Minor, &Patch) ;
18383 printf("%d %d %d %d %d %d\n",
18384 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
18385 Major, Minor, Patch);
18388 printf("You have Berkeley DB Version 2 or greater.\n");
18390 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
18391 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
18392 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
18393 Major, Minor, Patch) ;
18395 /* check that db.h & libdb are compatible */
18396 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
18397 printf("db.h and libdb are incompatible.\n") ;
18401 printf("db.h and libdb are compatible.\n") ;
18403 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
18404 + DB_VERSION_PATCH ;
18406 /* needs to be >= 2.3.4 */
18407 if (Version < 2003004) {
18408 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
18409 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
18415 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
18420 printf("You have Berkeley DB Version 1.\n");
18421 exit(0); /* DB version < 2: the coast is clear. */
18423 exit(1); /* <db.h> not Berkeley DB? */
18429 if eval $compile_ok && $run ./try; then
18430 echo 'Looks OK.' >&4
18432 db_version_major=$1
18433 db_version_minor=$2
18434 db_version_patch=$3
18436 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
18440 : Remove db from list of libraries to use
18441 echo "Removing unusable -ldb from library list" >&4
18442 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
18445 echo "libs = $libs" >&4
18455 : Check the return type needed for hash
18457 echo "Checking return type needed for hash for Berkeley DB ..." >&4
18463 #include <sys/types.h>
18466 #ifndef DB_VERSION_MAJOR
18467 u_int32_t hash_cb (ptr, size)
18475 info.hash = hash_cb;
18479 if $cc $ccflags -c try.c >try.out 2>&1 ; then
18480 if $contains warning try.out >>/dev/null 2>&1 ; then
18483 db_hashtype='u_int32_t'
18486 : XXX Maybe we should just give up here.
18487 db_hashtype=u_int32_t
18489 echo "Help: I can't seem to compile the db test program." >&4
18490 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
18493 echo "Your version of Berkeley DB uses $db_hashtype for hash."
18495 *) db_hashtype=u_int32_t
18500 : Check the return type needed for prefix
18502 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
18508 #include <sys/types.h>
18511 #ifndef DB_VERSION_MAJOR
18512 size_t prefix_cb (key1, key2)
18520 info.prefix = prefix_cb;
18524 if $cc $ccflags -c try.c >try.out 2>&1 ; then
18525 if $contains warning try.out >>/dev/null 2>&1 ; then
18526 db_prefixtype='int'
18528 db_prefixtype='size_t'
18531 db_prefixtype='size_t'
18532 : XXX Maybe we should just give up here.
18534 echo "Help: I can't seem to compile the db test program." >&4
18535 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
18538 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
18540 *) db_prefixtype='size_t'
18544 : How can we generate normalized random numbers ?
18546 echo "Looking for a random number function..." >&4
18547 case "$randfunc" in
18549 if set drand48 val -f; eval $csym; $val; then
18551 echo "Good, found drand48()." >&4
18552 elif set random val -f; eval $csym; $val; then
18554 echo "OK, found random()." >&4
18557 echo "Yick, looks like I have to use rand()." >&4
18568 *-Dmy_rand=*|*-Dmy_srand=*)
18569 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
18570 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
18571 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
18572 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
18576 while $test "$cont"; do
18577 rp="Use which function to generate random numbers?"
18579 if $test "$ans" = "$dflt"; then
18585 if set $ans val -f; eval $csym; $val; then
18589 rp="I cannot find function $ans. Use that name anyway?"
18598 case "$randfunc" in
18600 drand01="drand48()"
18606 case "$randbits" in
18608 echo "Checking to see how many bits your $randfunc() function produces..." >&4
18610 #$i_unistd I_UNISTD
18611 #$i_stdlib I_STDLIB
18614 # include <unistd.h>
18617 # include <stdlib.h>
18622 register unsigned long tmp;
18623 register unsigned long max = 0L;
18625 for (i = 1000; i; i--) {
18626 tmp = (unsigned long) $randfunc();
18627 if (tmp > max) max = tmp;
18629 for (i = 0; max; i++)
18635 if eval $compile_ok; then
18639 echo "(I can't seem to compile the test program...)"
18646 rp="How many bits does your $randfunc() function produce?"
18650 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
18651 seedfunc="s$randfunc"
18652 randseedtype=unsigned
18656 rp="How many bits does your $randfunc() function produce?"
18659 seedfunc="s$randfunc"
18660 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
18661 if set $seedfunc val -f; eval $csym; $val; then
18662 echo "(Using $seedfunc() to seed random generator)"
18664 echo "(Warning: no $seedfunc() to seed random generator)"
18667 randseedtype=unsigned
18675 echo "Determining whether or not we are on an EBCDIC system..." >&4
18676 $cat >try.c <<'EOM'
18679 if ('M'==0xd4) return 0;
18686 if eval $compile_ok; then
18687 if $run ./try; then
18688 echo "You seem to speak EBCDIC." >&4
18691 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
18694 echo "I'm unable to compile the test program." >&4
18695 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
18703 Checking how to flush all pending stdio output...
18705 # I only know how to find the first 32 possibly open files on SunOS.
18706 # See also hints/sunos_4_1.sh and util.c --AD
18708 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
18710 $cat >>try.c <<EOCP
18712 #$i_stdlib I_STDLIB
18714 #include <stdlib.h>
18716 #$i_unistd I_UNISTD
18718 # include <unistd.h>
18720 #$d_sysconf HAS_SYSCONF
18721 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
18722 #ifdef HAS_STDIO_STREAM_ARRAY
18723 # define STDIO_STREAM_ARRAY $stdio_stream_array
18728 p = fopen("try.out", "w");
18732 # ifdef TRY_FPRINTF
18736 #ifdef TRY_FFLUSH_NULL
18739 #ifdef TRY_FFLUSH_ALL
18741 long open_max = -1;
18742 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
18743 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
18745 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
18746 open_max = sysconf(_SC_OPEN_MAX);
18749 open_max = FOPEN_MAX;
18752 open_max = OPEN_MAX;
18761 # ifdef HAS_STDIO_STREAM_ARRAY
18762 if (open_max > 0) {
18764 for (i = 0; i < open_max; i++)
18765 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
18766 STDIO_STREAM_ARRAY[i]._file < open_max &&
18767 STDIO_STREAM_ARRAY[i]._flag)
18768 fflush(&STDIO_STREAM_ARRAY[i]);
18776 : first we have to find out how _not_ to flush
18778 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
18780 set try -DTRY_FPUTC
18781 if eval $compile; then
18782 $run ./try 2>/dev/null
18785 if $test ! -s try.out -a "X$code" = X42; then
18791 set try -DTRY_FPRINTF
18792 if eval $compile; then
18793 $run ./try 2>/dev/null
18796 if $test ! -s try.out -a "X$code" = X42; then
18797 output=-DTRY_FPRINTF
18803 : check for fflush NULL behaviour
18804 case "$fflushNULL" in
18805 '') set try -DTRY_FFLUSH_NULL $output
18806 if eval $compile; then
18807 $run ./try 2>/dev/null
18810 if $test -s try.out -a "X$code" = X42; then
18811 fflushNULL="`$cat try.out`"
18813 if $test "X$code" != X42; then
18815 (If this test failed, don't worry, we'll try another method shortly.)
18821 case "$fflushNULL" in
18823 Your fflush(NULL) works okay for output streams.
18824 Let's see if it clobbers input pipes...
18826 # As of mid-March 2000 all versions of Solaris appear to have a stdio
18827 # bug that improperly flushes the input end of pipes. So we avoid the
18828 # autoflush on fork/system/exec support for now. :-(
18829 $cat >tryp.c <<EOCP
18832 main(int argc, char **argv)
18838 while ((i = getc(stdin)) != -1
18839 && (*bp++ = i) != '\n'
18840 && bp < &buf[1024])
18843 fprintf(stdout, "%s", buf);
18851 fflushNULL="$define"
18853 if eval $compile; then
18855 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
18856 if cmp tryp.c tryp.out >/dev/null 2>&1; then
18858 fflush(NULL) seems to behave okay with input streams.
18860 fflushNULL="$define"
18863 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
18865 fflushNULL="$undef"
18868 $rm -f core tryp.c tryp.core core.tryp.*
18871 Your fflush(NULL) isn't working (contrary to ANSI C).
18873 fflushNULL="$undef"
18876 Cannot figure out whether your fflush(NULL) works or not.
18877 I'm assuming it doesn't (contrary to ANSI C).
18879 fflushNULL="$undef"
18883 $define|true|[yY]*)
18884 fflushNULL="$define"
18887 fflushNULL="$undef"
18890 : check explicit looping only if NULL did not work, and if the pipe
18891 : bug does not show up on an explicit flush too
18892 case "$fflushNULL" in
18894 $cat >tryp.c <<EOCP
18897 main(int argc, char **argv)
18903 while ((i = getc(stdin)) != -1
18904 && (*bp++ = i) != '\n'
18905 && bp < &buf[1024])
18908 fprintf(stdout, "%s", buf);
18917 if eval $compile; then
18919 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
18920 if cmp tryp.c tryp.out >/dev/null 2>&1; then
18922 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
18924 : now check for fflushall behaviour
18925 case "$fflushall" in
18926 '') set try -DTRY_FFLUSH_ALL $output
18927 if eval $compile; then
18929 (Now testing the other method--but note that this also may fail.)
18931 $run ./try 2>/dev/null
18934 if $test -s try.out -a "X$code" = X42; then
18935 fflushall="`$cat try.out`"
18939 case "$fflushall" in
18941 Whew. Flushing explicitly all the stdio streams works.
18943 fflushall="$define"
18946 Sigh. Flushing explicitly all the stdio streams doesn't work.
18951 Cannot figure out whether flushing stdio streams explicitly works or not.
18952 I'm assuming it doesn't.
18958 "$define"|true|[yY]*)
18959 fflushall="$define"
18967 All is futile. Even fflush(stdin) clobbers input pipes!
18974 $rm -f core tryp.c tryp.core core.tryp.*
18976 *) fflushall="$undef"
18980 case "$fflushNULL$fflushall" in
18983 OK, I give up. I cannot figure out how to flush pending stdio output.
18984 We won't be flushing handles at all before fork/exec/popen.
18990 : Store the full pathname to the ar program for use in the C program
18991 : Respect a hint or command line value for full_ar.
18996 : Store the full pathname to the sed program for use in the C program
18999 : see what type gids are declared as in the kernel
19001 echo "Looking for the type for group ids returned by getgid()."
19002 set gid_t gidtype xxx stdio.h sys/types.h
19006 xxx=`./findhdr sys/user.h`
19007 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
19009 unsigned) dflt="$1 $2" ;;
19013 *) dflt="$gidtype";;
19016 gid_t) echo "gid_t found." ;;
19017 *) rp="What is the type for group ids returned by getgid()?"
19025 *_t) zzz="$gidtype" ;;
19028 echo "Checking the size of $zzz..." >&4
19030 #include <sys/types.h>
19032 #$i_stdlib I_STDLIB
19034 #include <stdlib.h>
19037 printf("%d\n", (int)sizeof($gidtype));
19042 if eval $compile_ok; then
19046 echo "(I can't execute the test program--guessing $gidsize.)" >&4
19049 echo "Your $zzz is $gidsize bytes long."
19054 echo "(I can't compile the test program--guessing $gidsize.)" >&4
19060 *_t) zzz="$gidtype" ;;
19063 echo "Checking the sign of $zzz..." >&4
19065 #include <sys/types.h>
19076 if eval $compile; then
19080 echo "(I can't execute the test program--guessing unsigned.)" >&4
19084 1) echo "Your $zzz is unsigned." ;;
19085 -1) echo "Your $zzz is signed." ;;
19091 echo "(I can't compile the test program--guessing unsigned.)" >&4
19097 if $test X"$quadtype" != X; then
19099 echo "Checking how to print 64-bit integers..." >&4
19101 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
19102 $cat >try.c <<'EOCP'
19103 #include <sys/types.h>
19106 int q = 12345678901;
19107 printf("%ld\n", q);
19111 if eval $compile; then
19115 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
19116 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
19117 echo "We will use %d."
19123 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
19124 $cat >try.c <<'EOCP'
19125 #include <sys/types.h>
19128 long q = 12345678901;
19129 printf("%ld\n", q);
19133 if eval $compile; then
19137 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
19138 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
19139 echo "We will use %ld."
19145 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
19146 $cat >try.c <<'EOCP'
19147 #include <sys/types.h>
19148 #include <inttypes.h>
19151 int64_t q = 12345678901;
19152 printf("%" PRId64 "\n", q);
19156 if eval $compile; then
19160 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
19161 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
19162 echo "We will use the C9X style."
19168 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
19170 #include <sys/types.h>
19173 $quadtype q = 12345678901;
19174 printf("%Ld\n", q);
19178 if eval $compile; then
19182 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
19183 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
19184 echo "We will use %Ld."
19190 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
19191 $cat >try.c <<'EOCP'
19192 #include <sys/types.h>
19195 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
19196 printf("%lld\n", q);
19200 if eval $compile; then
19204 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
19205 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
19206 echo "We will use the %lld style."
19212 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
19214 #include <sys/types.h>
19217 $quadtype q = 12345678901;
19218 printf("%qd\n", q);
19222 if eval $compile; then
19226 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
19227 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
19228 echo "We will use %qd."
19234 if $test X"$sPRId64" = X; then
19235 echo "Cannot figure out how to print 64-bit integers." >&4
19242 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
19243 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
19245 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
19246 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
19252 $echo "Checking the format strings to be used for Perl's internal types..." >&4
19254 if $test X"$ivsize" = X8; then
19255 ivdformat="$sPRId64"
19256 uvuformat="$sPRIu64"
19257 uvoformat="$sPRIo64"
19258 uvxformat="$sPRIx64"
19259 uvXUformat="$sPRIXU64"
19261 if $test X"$ivsize" = X"$longsize"; then
19268 if $test X"$ivsize" = X"$intsize"; then
19276 if $test X"$ivsize" = X"$shortsize"; then
19287 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
19288 nveformat="$sPRIeldbl"
19289 nvfformat="$sPRIfldbl"
19290 nvgformat="$sPRIgldbl"
19291 nvEUformat="$sPRIEUldbl"
19292 nvFUformat="$sPRIFUldbl"
19293 nvGUformat="$sPRIGUldbl"
19303 case "$ivdformat" in
19304 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
19311 $echo "Checking the format string to be used for gids..." >&4
19314 -1) if $test X"$gidsize" = X"$ivsize"; then
19315 gidformat="$ivdformat"
19317 if $test X"$gidsize" = X"$longsize"; then
19320 if $test X"$gidsize" = X"$intsize"; then
19323 if $test X"$gidsize" = X"$shortsize"; then
19330 *) if $test X"$gidsize" = X"$uvsize"; then
19331 gidformat="$uvuformat"
19333 if $test X"$gidsize" = X"$longsize"; then
19336 if $test X"$gidsize" = X"$intsize"; then
19339 if $test X"$gidsize" = X"$shortsize"; then
19348 : see if getgroups exists
19349 set getgroups d_getgrps
19352 : see if setgroups exists
19353 set setgroups d_setgrps
19357 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
19359 case "$d_getgrps$d_setgrps" in
19361 case "$groupstype" in
19362 '') dflt="$gidtype" ;;
19363 *) dflt="$groupstype" ;;
19366 What type of pointer is the second argument to getgroups() and setgroups()?
19367 Usually this is the same as group ids, $gidtype, but not always.
19370 rp='What type pointer is the second argument to getgroups() and setgroups()?'
19374 *) groupstype="$gidtype";;
19378 if $test $patchlevel -lt 9; then
19379 : MAD is not available in 5.8.x or earlier.
19383 $define|true|[yY]*) dflt='y' ;;
19388 Would you like to build with Misc Attribute Decoration? This is development
19389 work leading to a Perl 5 to Perl 6 convertor, which imposes a space and speed
19390 overhead on the interpreter.
19392 If this doesn't make any sense to you, just accept the default '$dflt'.
19394 rp='Build Perl with MAD?'
19399 madlyh='madly.h madly.act madly.tab'
19401 madlyobj="madly$_o" ;;
19411 echo "Checking if your $make program sets \$(MAKE)..." >&4
19412 case "$make_set_make" in
19414 $sed 's/^X //' > testmake.mak << 'EOF'
19416 X @echo 'maketemp="$(MAKE)"'
19418 case "`$make -f testmake.mak 2>/dev/null`" in
19419 *maketemp=*) make_set_make='#' ;;
19420 *) make_set_make="MAKE=$make" ;;
19422 $rm -f testmake.mak
19425 case "$make_set_make" in
19426 '#') echo "Yup, it does.";;
19427 *) echo "Nope, it doesn't.";;
19430 : see what type is used for mode_t
19431 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
19432 set mode_t modetype int stdio.h sys/types.h
19435 : see if we need va_copy
19437 case "$i_stdarg" in
19440 #include <stdarg.h>
19442 #$i_stdlib I_STDLIB
19444 #include <stdlib.h>
19446 #include <signal.h>
19449 ivfprintf(FILE *f, const char *fmt, va_list *valp)
19451 return vfprintf(f, fmt, *valp);
19455 myvfprintf(FILE *f, const char *fmt, va_list val)
19457 return ivfprintf(f, fmt, &val);
19461 myprintf(char *fmt, ...)
19464 va_start(val, fmt);
19465 return myvfprintf(stdout, fmt, val);
19469 main(int ac, char **av)
19471 signal(SIGSEGV, exit);
19473 myprintf("%s%cs all right, then\n", "that", '\'');
19478 if eval $compile && $run ./try 2>&1 >/dev/null; then
19479 case "`$run ./try`" in
19480 "that's all right, then")
19486 yes) echo "It seems that you don't need va_copy()." >&4
19487 need_va_copy="$undef"
19489 *) echo "It seems that va_copy() or similar will be needed." >&4
19490 need_va_copy="$define"
19495 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
19499 : see what type is used for size_t
19500 rp="What is the type used for the length parameter for string functions?"
19501 set size_t sizetype 'unsigned int' stdio.h sys/types.h
19504 : check for type of arguments to gethostbyaddr.
19505 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
19506 case "$d_gethbyaddr" in
19510 Checking to see what type of arguments are accepted by gethostbyaddr().
19512 hdrs="$define sys/types.h
19513 $d_socket sys/socket.h
19514 $i_niin netinet/in.h
19516 $i_unistd unistd.h"
19517 : The first arg can 'char *' or 'void *'
19518 : The second arg is some of integral type
19519 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
19520 for yyy in size_t long int; do
19521 case "$netdb_host_type" in
19522 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
19523 if ./protochk "$try" $hdrs; then
19524 echo "Your system accepts $xxx for the first arg."
19525 echo "...and $yyy for the second arg."
19526 netdb_host_type="$xxx"
19527 netdb_hlen_type="$yyy"
19533 : In case none of those worked, prompt the user.
19534 case "$netdb_host_type" in
19535 '') rp='What is the type for the 1st argument to gethostbyaddr?'
19538 netdb_host_type=$ans
19539 rp='What is the type for the 2nd argument to gethostbyaddr?'
19542 netdb_hlen_type=$ans
19546 *) : no gethostbyaddr, so pick harmless defaults
19547 netdb_host_type='char *'
19548 netdb_hlen_type="$sizetype"
19551 # Remove the "const" if needed. -- but then we'll have a
19553 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
19556 : check for type of argument to gethostbyname.
19557 if test "X$netdb_name_type" = X ; then
19558 case "$d_gethbyname" in
19562 Checking to see what type of argument is accepted by gethostbyname().
19564 hdrs="$define sys/types.h
19565 $d_socket sys/socket.h
19566 $i_niin netinet/in.h
19568 $i_unistd unistd.h"
19569 for xxx in "const char *" "char *"; do
19570 case "$netdb_name_type" in
19571 '') try="extern struct hostent *gethostbyname($xxx);"
19572 if ./protochk "$try" $hdrs; then
19573 echo "Your system accepts $xxx."
19574 netdb_name_type="$xxx"
19579 : In case none of those worked, prompt the user.
19580 case "$netdb_name_type" in
19581 '') rp='What is the type for the 1st argument to gethostbyname?'
19584 netdb_name_type=$ans
19588 *) : no gethostbyname, so pick harmless default
19589 netdb_name_type='char *'
19594 : check for type of 1st argument to getnetbyaddr.
19595 if test "X$netdb_net_type" = X ; then
19596 case "$d_getnbyaddr" in
19600 Checking to see what type of 1st argument is accepted by getnetbyaddr().
19602 hdrs="$define sys/types.h
19603 $d_socket sys/socket.h
19604 $i_niin netinet/in.h
19606 $i_unistd unistd.h"
19607 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
19608 case "$netdb_net_type" in
19609 '') try="extern struct netent *getnetbyaddr($xxx, int);"
19610 if ./protochk "$try" $hdrs; then
19611 echo "Your system accepts $xxx."
19612 netdb_net_type="$xxx"
19617 : In case none of those worked, prompt the user.
19618 case "$netdb_net_type" in
19619 '') rp='What is the type for the 1st argument to getnetbyaddr?'
19622 netdb_net_type=$ans
19626 *) : no getnetbyaddr, so pick harmless default
19627 netdb_net_type='long'
19631 : locate the preferred pager for this system
19638 [a-zA-Z]:/*) dflt=$pg;;
19642 [a-zA-Z]:/*) dflt=$more;;
19646 [a-zA-Z]:/*) dflt=$less;;
19649 '') dflt=/usr/ucb/more;;
19653 : Instruct ./getfile to trust the hinted or previous pager value,
19654 : even if it does not begin with a slash. For example, on os2,
19655 : pager might be cmd /c more. See comments in UU/getfile.
19660 rp='What pager is used on your system?'
19664 : see what type pids are declared as in the kernel
19665 rp="What is the type of process ids on this system?"
19666 set pid_t pidtype int stdio.h sys/types.h
19669 : see if ar generates random libraries by itself
19671 echo "Checking how to generate random libraries on your machine..." >&4
19672 echo 'int bar1() { return bar2(); }' > bar1.c
19673 echo 'int bar2() { return 2; }' > bar2.c
19675 #$i_stdlib I_STDLIB
19677 #include <stdlib.h>
19679 int main() { printf("%d\n", bar1()); exit(0); }
19681 $cc $ccflags -c bar1.c >/dev/null 2>&1
19682 $cc $ccflags -c bar2.c >/dev/null 2>&1
19683 $cc $ccflags -c foo.c >/dev/null 2>&1
19684 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
19685 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19686 $run ./foobar >/dev/null 2>&1; then
19687 echo "$ar appears to generate random libraries itself."
19689 if [ "X$ranlib" = "X" ]; then
19692 elif $ar s bar$_a >/dev/null 2>&1 &&
19693 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19694 $run ./foobar >/dev/null 2>&1; then
19695 echo "a table of contents needs to be added with '$ar s'."
19698 elif $ar ts bar$_a >/dev/null 2>&1 &&
19699 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19700 $run ./foobar >/dev/null 2>&1; then
19701 echo "a table of contents needs to be added with '$ar ts'."
19708 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
19709 $test -f $ranlib || ranlib=''
19712 if $test -n "$ranlib"; then
19713 echo "your system has '$ranlib'; we'll use that."
19716 echo "your system doesn't seem to support random libraries"
19717 echo "so we'll use lorder and tsort to order the libraries."
19724 : check for type of arguments to select.
19725 case "$selecttype" in
19726 '') case "$d_select" in
19730 Checking to see what type of arguments are accepted by select().
19732 hdrs="$define sys/types.h
19733 $i_systime sys/time.h
19734 $i_sysselct sys/select.h
19735 $d_socket sys/socket.h"
19736 : The first arg can be int, unsigned, or size_t
19737 : The last arg may or may not be 'const'
19739 : void pointer has been seen but using that
19740 : breaks the selectminbits test
19741 for xxx in 'fd_set *' 'int *'; do
19742 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
19743 for tmo in 'struct timeval *' 'const struct timeval *'; do
19745 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
19746 if ./protochk "$try" $hdrs; then
19747 echo "Your system accepts $xxx."
19756 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
19757 case "$d_fd_set" in
19758 $define) dflt="fd_set *" ;;
19767 *) : no select, so pick a harmless default
19774 : check for the select 'width'
19775 case "$selectminbits" in
19776 '') safebits=`expr $ptrsize \* 8`
19777 case "$d_select" in
19781 Checking to see on how many bits at a time your select() operates...
19784 #include <sys/types.h>
19786 #$i_systime I_SYS_TIME
19787 #$i_systimek I_SYS_TIME_KERNEL
19792 # ifdef I_SYS_TIME_KERNEL
19795 # include <sys/time.h>
19796 # ifdef I_SYS_TIME_KERNEL
19800 #$i_sysselct I_SYS_SELECT
19801 #ifdef I_SYS_SELECT
19802 #include <sys/select.h>
19804 #$d_socket HAS_SOCKET
19806 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
19809 #$i_stdlib I_STDLIB
19811 #include <stdlib.h>
19814 #define S sizeof(*(b))
19816 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
19817 #define NBITS (NBYTES * 8)
19819 char *s = (char *)malloc(NBYTES);
19828 fp = fopen("try.c", "r");
19834 b = ($selecttype)s;
19835 for (i = 0; i < NBITS; i++)
19839 select(fd + 1, b, 0, 0, &t);
19840 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
19842 printf("%d\n", i + 1);
19847 if eval $compile_ok; then
19848 selectminbits=`$run ./try`
19849 case "$selectminbits" in
19851 Cannot figure out on how many bits at a time your select() operates.
19852 I'll play safe and guess it is $safebits bits.
19854 selectminbits=$safebits
19855 bits="$safebits bits"
19858 *) bits="$selectminbits bits" ;;
19860 echo "Your select() operates on $bits at a time." >&4
19862 rp='What is the minimum number of bits your select() operates on?'
19863 case "$byteorder" in
19864 12345678) dflt=64 ;;
19870 selectminbits="$val"
19874 *) : no select, so pick a harmless default
19875 selectminbits=$safebits
19881 : Trace out the files included by signal.h, then look for SIGxxx names.
19882 : Remove SIGARRAYSIZE used by HPUX.
19883 : Remove SIGSTKSIZE used by Linux.
19884 : Remove SIGSTKSZ used by Posix.
19885 : Remove SIGTYP void lines used by OS2.
19886 : Some cpps, like os390, dont give the file name anywhere
19887 if [ "X$fieldn" = X ]; then
19888 : Just make some guesses. We check them later.
19889 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
19891 xxx=`echo '#include <signal.h>' |
19892 $cppstdin $cppminus $cppflags 2>/dev/null |
19893 $grep '^[ ]*#.*include' |
19894 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
19896 : Check this list of files to be sure we have parsed the cpp output ok.
19897 : This will also avoid potentially non-existent files, such
19900 for xx in $xxx /dev/null ; do
19901 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
19903 : If we have found no files, at least try signal.h
19904 case "$xxxfiles" in
19905 '') xxxfiles=`./findhdr signal.h` ;;
19908 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
19909 print substr($2, 4, 20)
19911 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
19912 print substr($3, 4, 20)
19914 : Append some common names just in case the awk scan failed.
19915 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
19916 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
19917 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
19918 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
19919 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
19921 : generate a few handy files for later
19922 $cat > signal.c <<EOCP
19923 #include <sys/types.h>
19924 #include <signal.h>
19925 #$i_stdlib I_STDLIB
19927 #include <stdlib.h>
19932 /* Strange style to avoid deeply-nested #if/#else/#endif */
19935 # define NSIG (_NSIG)
19941 # define NSIG (SIGMAX+1)
19947 # define NSIG (SIG_MAX+1)
19953 # define NSIG (_SIG_MAX+1)
19959 # define NSIG (MAXSIG+1)
19965 # define NSIG (MAX_SIG+1)
19970 # ifdef SIGARRAYSIZE
19971 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
19977 # define NSIG (_sys_nsig) /* Solaris 2.5 */
19981 /* Default to some arbitrary number that's big enough to get most
19982 of the common signals.
19988 printf("NSIG %d\n", NSIG);
19994 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
19996 printf "#ifdef SIG"; printf $1; printf "\n"
19997 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
19998 printf $1; printf ");\n"
20002 printf "#endif /* JUST_NSIG */\n";
20003 printf "exit(0);\n}\n";
20006 $cat >signal.awk <<'EOP'
20007 BEGIN { ndups = 0 }
20008 $1 ~ /^NSIG$/ { nsig = $2 }
20009 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
20010 if ($2 > maxsig) { maxsig = $2 }
20011 if (sig_name[$2]) {
20012 dup_name[ndups] = $1
20013 dup_num[ndups] = $2
20025 printf("NSIG %d\n", nsig);
20026 for (n = 1; n < nsig; n++) {
20028 printf("%s %d\n", sig_name[n], sig_num[n])
20031 printf("NUM%d %d\n", n, n)
20034 for (n = 0; n < ndups; n++) {
20035 printf("%s %d\n", dup_name[n], dup_num[n])
20039 $cat >signal_cmd <<EOS
20041 if $test -s signal.lst; then
20042 echo "Using your existing signal.lst file"
20047 $cat >>signal_cmd <<'EOS'
20050 if eval $compile_ok; then
20051 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) | $uniq | $awk -f signal.awk >signal.lst
20053 echo "(I can't seem be able to compile the whole test program)" >&4
20054 echo "(I'll try it in little pieces.)" >&4
20055 set signal -DJUST_NSIG
20056 if eval $compile_ok; then
20057 $run ./signal$_exe > signal.nsg
20060 echo "I can't seem to figure out how many signals you have." >&4
20061 echo "Guessing 50." >&4
20062 echo 'NSIG 50' > signal.nsg
20064 : Now look at all the signal names, one at a time.
20065 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
20066 $cat > signal.c <<EOCP
20067 #include <sys/types.h>
20068 #include <signal.h>
20071 printf("$xx %d\n", SIG${xx});
20076 if eval $compile; then
20077 echo "SIG${xx} found."
20078 $run ./signal$_exe >> signal.ls1
20080 echo "SIG${xx} NOT found."
20083 if $test -s signal.ls1; then
20084 $cat signal.nsg signal.ls1 |
20085 $sort -n | $uniq | $awk -f signal.awk >signal.lst
20089 if $test -s signal.lst; then
20092 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
20093 echo 'kill -l' >signal
20094 set X `csh -f <signal`
20098 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
20100 echo $@ | $tr ' ' $trnl | \
20101 $awk '{ printf "%s %d\n", $1, ++s; }
20102 END { printf "NSIG %d\n", ++s }' >signal.lst
20104 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
20106 chmod a+x signal_cmd
20107 $eunicefix signal_cmd
20109 : generate list of signal names
20111 case "$sig_name_init" in
20113 *) case "$sig_num_init" in
20114 ''|*,*) doinit=yes ;;
20119 echo "Generating a list of signal names and numbers..." >&4
20121 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
20122 sig_name=`$awk 'BEGIN { printf "ZERO " }
20123 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
20124 sig_num=`$awk 'BEGIN { printf "0 " }
20125 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
20126 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
20127 !/^NSIG/ { printf "\"%s\", ", $1 }
20128 END { printf "0\n" }' signal.lst`
20129 sig_num_init=`$awk 'BEGIN { printf "0, " }
20130 !/^NSIG/ { printf "%d, ", $2}
20131 END { printf "0\n"}' signal.lst`
20134 echo "The following $sig_count signals are available:"
20136 echo $sig_name | $awk \
20137 'BEGIN { linelen = 0 }
20139 for (i = 1; i <= NF; i++) {
20140 name = "SIG" $i " "
20141 linelen = linelen + length(name)
20142 if (linelen > 70) {
20144 linelen = length(name)
20150 sig_size=`echo $sig_name | awk '{print NF}'`
20151 $rm -f signal signal.c signal.awk signal.lst signal_cmd
20154 case "$sizetype" in
20155 *_t) zzz="$sizetype" ;;
20156 *) zzz="filesize" ;;
20158 echo "Checking the size of $zzz..." >&4
20160 #include <sys/types.h>
20162 #$i_stdlib I_STDLIB
20164 #include <stdlib.h>
20167 printf("%d\n", (int)sizeof($sizetype));
20172 if eval $compile_ok; then
20176 echo "(I can't execute the test program--guessing $sizesize.)" >&4
20179 echo "Your $zzz size is $sizesize bytes."
20184 echo "(I can't compile the test program--guessing $sizesize.)" >&4
20188 : check for socklen_t
20190 echo "Checking to see if you have socklen_t..." >&4
20192 #include <sys/types.h>
20193 #$d_socket HAS_SOCKET
20195 #include <sys/socket.h>
20197 int main() { socklen_t x = 16; }
20200 if eval $compile; then
20202 echo "You have socklen_t."
20205 echo "You do not have socklen_t."
20206 case "$sizetype" in
20207 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
20214 : see if this is a socks.h system
20215 set socks.h i_socks
20218 : check for type of the size argument to socket calls
20219 case "$d_socket" in
20223 Checking to see what type is the last argument of accept().
20226 case "$d_socklen_t" in
20227 "$define") yyy="$yyy socklen_t"
20229 yyy="$yyy $sizetype int long unsigned"
20230 for xxx in $yyy; do
20231 case "$socksizetype" in
20232 '') try="extern int accept(int, struct sockaddr *, $xxx *);"
20233 case "$usesocks" in
20235 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
20236 echo "Your system accepts '$xxx *' for the last argument of accept()."
20237 socksizetype="$xxx"
20240 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
20241 echo "Your system accepts '$xxx *' for the last argument of accept()."
20242 socksizetype="$xxx"
20249 : In case none of those worked, prompt the user.
20250 case "$socksizetype" in
20251 '') rp='What is the type for socket address structure sizes?'
20258 *) : no sockets, so pick relatively harmless default
20263 : see what type is used for signed size_t
20264 set ssize_t ssizetype int stdio.h sys/types.h
20269 #$i_stdlib I_STDLIB
20271 #include <stdlib.h>
20273 #include <sys/types.h>
20274 #define Size_t $sizetype
20275 #define SSize_t $dflt
20278 if (sizeof(Size_t) == sizeof(SSize_t))
20280 else if (sizeof(Size_t) == sizeof(int))
20289 if eval $compile_ok && $run ./try > /dev/null; then
20290 ssizetype=`$run ./try`
20291 echo "I'll be using $ssizetype for functions returning a byte count." >&4
20294 Help! I can't compile and run the ssize_t test program: please enlighten me!
20295 (This is probably a misconfiguration in your system or libraries, and
20296 you really ought to fix it. Still, I'll try anyway.)
20298 I need a type that is the same size as $sizetype, but is guaranteed to
20299 be signed. Common values are ssize_t, int and long.
20302 rp="What signed type is the same size as $sizetype?"
20308 : see what type of char stdio uses.
20310 echo '#include <stdio.h>' > stdio.c
20311 $cppstdin $cppminus < stdio.c > stdioh
20312 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
20313 echo "Your stdio uses unsigned chars." >&4
20314 stdchar="unsigned char"
20316 echo "Your stdio uses signed chars." >&4
20319 $rm -f stdio.* stdioh
20321 : see what type uids are declared as in the kernel
20323 echo "Looking for the type for user ids returned by getuid()."
20324 set uid_t uidtype xxx stdio.h sys/types.h
20328 xxx=`./findhdr sys/user.h`
20329 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
20331 unsigned) dflt="$1 $2" ;;
20335 *) dflt="$uidtype";;
20338 uid_t) echo "uid_t found." ;;
20339 *) rp="What is the type for user ids returned by getuid()?"
20347 *_t) zzz="$uidtype" ;;
20350 echo "Checking the size of $zzz..." >&4
20352 #include <sys/types.h>
20354 #$i_stdlib I_STDLIB
20356 #include <stdlib.h>
20359 printf("%d\n", (int)sizeof($uidtype));
20364 if eval $compile_ok; then
20368 echo "(I can't execute the test program--guessing $uidsize.)" >&4
20371 echo "Your $zzz is $uidsize bytes long."
20376 echo "(I can't compile the test program--guessing $uidsize.)" >&4
20381 *_t) zzz="$uidtype" ;;
20384 echo "Checking the sign of $zzz..." >&4
20386 #include <sys/types.h>
20397 if eval $compile; then
20401 echo "(I can't execute the test program--guessing unsigned.)" >&4
20405 1) echo "Your $zzz is unsigned." ;;
20406 -1) echo "Your $zzz is signed." ;;
20412 echo "(I can't compile the test program--guessing unsigned.)" >&4
20418 $echo "Checking the format string to be used for uids..." >&4
20421 -1) if $test X"$uidsize" = X"$ivsize"; then
20422 uidformat="$ivdformat"
20424 if $test X"$uidsize" = X"$longsize"; then
20427 if $test X"$uidsize" = X"$intsize"; then
20430 if $test X"$uidsize" = X"$shortsize"; then
20437 *) if $test X"$uidsize" = X"$uvsize"; then
20438 uidformat="$uvuformat"
20440 if $test X"$uidsize" = X"$longsize"; then
20443 if $test X"$uidsize" = X"$intsize"; then
20446 if $test X"$uidsize" = X"$shortsize"; then
20456 case "$usesitecustomize" in
20457 $define|true|[Yy]*)
20458 usesitecustomize="$define"
20461 usesitecustomize="$undef"
20465 : determine compiler compiler
20474 if $test -f "$byacc$_exe"; then
20476 comp="byacc or $comp"
20478 if $test -f "$bison$_exe"; then
20479 comp="$comp or bison -y"
20481 rp="Which compiler compiler ($comp) shall I use?"
20490 echo "(Adding -y option to bison to get yacc-compatible behaviour.)"
20496 : see if this is a fp.h system
20500 : see if this is a fp_class.h system
20501 set fp_class.h i_fp_class
20504 : see if gdbm.h is available
20509 : see if gdbm_open exists
20510 set gdbm_open d_gdbm_open
20512 case "$d_gdbm_open" in
20515 echo "We won't be including <gdbm.h>"
20524 : see if this is a ieeefp.h system
20525 case "$i_ieeefp" in
20526 '' ) set ieeefp.h i_ieeefp
20531 : see if this is a libutil.h system
20532 set libutil.h i_libutil
20535 : see if mach cthreads are available
20536 if test "X$usethreads" = "X$define"; then
20537 set mach/cthreads.h i_machcthr
20540 i_machcthr="$undef"
20545 : see if this is a mntent.h system
20546 set mntent.h i_mntent
20549 : see if ndbm.h is available
20555 # Some Linux distributions such as RedHat 7.1 put the
20556 # ndbm.h header in /usr/include/gdbm/ndbm.h.
20557 if $test -f /usr/include/gdbm/ndbm.h; then
20558 echo '<gdbm/ndbm.h> found.'
20559 ccflags="$ccflags -I/usr/include/gdbm"
20560 cppflags="$cppflags -I/usr/include/gdbm"
20568 : see if dbm_open exists
20569 set dbm_open d_dbm_open
20571 case "$d_dbm_open" in
20574 echo "We won't be including <ndbm.h>"
20583 : see if net/errno.h is available
20585 set net/errno.h val
20588 : Unfortunately, it causes problems on some systems. Arrgh.
20591 cat > try.c <<'EOM'
20594 #include <net/errno.h>
20600 if $cc $ccflags -c try.c >/dev/null 2>&1; then
20601 echo "We'll be including <net/errno.h>." >&4
20603 echo "We won't be including <net/errno.h>." >&4
20612 : see if netinet/tcp.h is available
20613 set netinet/tcp.h i_netinettcp
20616 : see if this is a poll.h system
20620 : see if this is a prot.h system
20625 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
20626 $cat <<'EOSH' > Cppsym.know
20627 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
20628 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
20629 alliant alpha am29000 AM29000 AMD64 amd64 amiga AMIGAOS AMIX
20630 ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
20631 BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
20632 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
20633 bull c cadmus clipper CMU COFF COMPILER_VERSION
20634 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
20635 CYGWIN DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
20636 Dynix DynixPTX ELF encore EPI EXTENSIONS FAVOR_BSD
20637 FILE_OFFSET_BITS FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
20639 GNU_SOURCE GNUC GNUC_MINOR GNU_LIBRARY GO32 gould GOULD_PN
20640 H3050R H3050RX hbullx20 hcx host_mips
20641 hp200 hp300 hp700 HP700 hp800 hp9000
20642 hp9000s200 hp9000s300 hp9000s400 hp9000s500
20643 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
20644 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
20645 IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
20646 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
20647 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
20648 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
20649 LIBCATAMOUNT Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
20650 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
20651 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
20652 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
20653 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
20654 MATH_HAS_NO_SIDE_EFFECTS
20655 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
20656 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
20657 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
20658 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
20659 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
20660 NetBSD news1500 news1700 news1800 news1900 news3700
20661 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
20662 ns32016 ns32332 ns32k nsc32000
20663 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
20664 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
20665 pc532 pdp11 PGC PIC plexus PORTAR posix
20666 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
20667 POSIX_C_SOURCE POSIX_SOURCE POWER
20668 PROTOTYPES PWB pyr QNX QK_USER R3000 REENTRANT RES Rhapsody RISC6000
20669 riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
20670 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
20671 sony sony_news sonyrisc sparc sparclite spectrum
20672 stardent stdc STDC_EXT stratos sun sun3 sun386
20673 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
20674 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
20675 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
20676 sysV68 sysV88 Tek4132 Tek4300 titan
20677 TM3200 TM5400 TM5600
20678 tower tower32 tower32_200 tower32_600 tower32_700
20679 tower32_800 tower32_850 tss
20680 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
20681 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
20682 unix UNIX95 UNIX99 unixpc unos
20683 USE_BSD USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE USE_LARGEFILE64
20684 USE_MISC USE_POSIX USE_POSIX199309 USE_POSIX199506 USE_POSIX2
20685 USE_REENTRANT USE_SVID USE_UNIX98 USE_XOPEN USE_XOPEN_EXTENDED
20687 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms x86_64 xenix Xenix286
20688 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
20689 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
20692 # Maybe put other stuff here too.
20693 cat <<EOSH >>Cppsym.know
20696 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
20697 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
20698 $cat Cppsym.know > Cppsym.c
20699 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
20700 $rm -f Cppsym.a Cppsym.b Cppsym.c
20701 cat <<EOSH > Cppsym
20703 if $test \$# -gt 0; then
20704 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
20705 if $test -s Cppsym.got; then
20712 $tr " " "$trnl" | ./Cppsym.try
20718 cat <<EOSH > Cppsym.try
20720 cat <<'EOCP' > try.c
20723 #define STRINGIFY(a) "a"
20725 #if cpp_stuff == 42
20726 #define StGiFy(a) #a
20727 #define STRINGIFY(a) StGiFy(a)
20729 #if $cpp_stuff != 1 && $cpp_stuff != 42
20730 # include "Bletch: How does this C preprocessor stringify macros?"
20736 cat <<'EOSH' >> Cppsym.try
20738 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
20739 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
20740 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
20741 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
20743 echo 'return 0;}' >> try.c
20745 cat <<EOSH >> Cppsym.try
20747 case "$osname-$gccversion" in
20748 irix-) ccflags="\$ccflags -woff 1178" ;;
20749 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
20751 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs && $run ./try | $sed 's/ /\\\\ /g'
20753 chmod +x Cppsym.try
20754 $eunicefix Cppsym.try
20755 ./Cppsym < Cppsym.know > Cppsym.true
20756 : Add in any linux cpp "predefined macros":
20757 case "$osname::$gccversion" in
20760 rm -f $tHdrH'.h' $tHdrH
20762 if cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
20763 sed 's/#define[\ \ ]*//;s/[\ \ ].*$//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
20764 if [ -s $tHdrH'_cppsym.real' ]; then
20765 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
20768 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
20771 : now check the C compiler for additional symbols
20772 postprocess_cc_v=''
20774 aix) postprocess_cc_v="|$tr , ' '" ;;
20781 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
20784 -D*) echo "\$i" | $sed 's/^-D//';;
20785 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
20790 postprocess_cc_v=''
20793 ./ccsym > ccsym1.raw
20794 if $test -s ccsym1.raw; then
20795 $sort ccsym1.raw | $uniq >ccsym.raw
20797 mv ccsym1.raw ccsym.raw
20800 $awk '/\=/ { print $0; next }
20801 { print $0"=1" }' ccsym.raw >ccsym.list
20802 $comm -13 Cppsym.true ccsym.list >ccsym.own
20803 $comm -12 Cppsym.true ccsym.list >ccsym.com
20804 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
20806 if $test -z ccsym.raw; then
20807 echo "Your C compiler doesn't seem to define any symbols!" >&4
20809 echo "However, your C preprocessor defines the following symbols:"
20812 cppsymbols=`$cat Cppsym.true`
20813 cppsymbols=`echo $cppsymbols`
20814 cppccsymbols="$cppsymbols"
20816 if $test -s ccsym.com; then
20817 echo "Your C compiler and pre-processor define these symbols:"
20818 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
20821 cppccsymbols=`$cat ccsym.com`
20822 cppccsymbols=`echo $cppccsymbols`
20823 $test "$silent" || sleep 1
20825 if $test -s ccsym.cpp; then
20826 $test "$also" && echo " "
20827 echo "Your C pre-processor ${also}defines the following symbols:"
20828 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
20830 cppsymbols=`$cat ccsym.cpp`
20831 cppsymbols=`echo $cppsymbols`
20832 $test "$silent" || sleep 1
20834 if $test -s ccsym.own; then
20835 $test "$also" && echo " "
20836 echo "Your C compiler ${also}defines the following cpp symbols:"
20837 $sed -e 's/\(..*\)=1/\1/' ccsym.own
20838 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
20839 ccsymbols=`$cat ccsym.own`
20840 ccsymbols=`echo $ccsymbols`
20841 $test "$silent" || sleep 1
20845 : see if this is a termio system
20849 if $test `./findhdr termios.h`; then
20850 set tcsetattr i_termios
20856 "$define") echo "You have POSIX termios.h... good!" >&4;;
20857 *) if ./Cppsym pyr; then
20858 case "`/bin/universe`" in
20859 ucb) if $test `./findhdr sgtty.h`; then
20861 echo "<sgtty.h> found." >&4
20863 echo "System is pyramid with BSD universe."
20864 echo "<sgtty.h> not found--you could have problems." >&4
20866 *) if $test `./findhdr termio.h`; then
20868 echo "<termio.h> found." >&4
20870 echo "System is pyramid with USG universe."
20871 echo "<termio.h> not found--you could have problems." >&4
20875 if $test `./findhdr termio.h`; then
20876 echo "<termio.h> found." >&4
20878 elif $test `./findhdr sgtty.h`; then
20879 echo "<sgtty.h> found." >&4
20882 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
20885 if $test `./findhdr sgtty.h`; then
20886 echo "<sgtty.h> found." >&4
20888 elif $test `./findhdr termio.h`; then
20889 echo "<termio.h> found." >&4
20892 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
20896 set i_termio; eval $setvar
20897 val=$val2; set i_sgtty; eval $setvar
20898 val=$val3; set i_termios; eval $setvar
20900 : see if stddef is available
20901 set stddef.h i_stddef
20904 : see if sys/access.h is available
20905 set sys/access.h i_sysaccess
20908 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
20909 set sys/filio.h i_sysfilio
20912 if $test `./findhdr sys/ioctl.h`; then
20914 echo '<sys/ioctl.h> found.' >&4
20917 if $test $i_sysfilio = "$define"; then
20918 echo '<sys/ioctl.h> NOT found.' >&4
20920 $test $i_sgtty = "$define" && xxx="sgtty.h"
20921 $test $i_termio = "$define" && xxx="termio.h"
20922 $test $i_termios = "$define" && xxx="termios.h"
20923 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
20929 : see if socket ioctl defs are in sys/sockio.h
20931 xxx=`./findhdr sys/sockio.h`
20932 if $test "$xxx"; then
20933 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
20935 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
20938 echo "No socket ioctls found in <sys/sockio.h>." >&4
20943 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
20950 : see if this is a syslog.h system
20951 set syslog.h i_syslog
20955 : see if this is a sys/mode.h system
20956 set sys/mode.h i_sysmode
20959 : see if sys/resource.h has to be included
20960 set sys/resource.h i_sysresrc
20963 : see if sys/security.h is available
20964 set sys/security.h i_syssecrt
20967 : see if this is a sys/statvfs.h system
20968 set sys/statvfs.h i_sysstatvfs
20971 : see if this is a sys/un.h system
20972 set sys/un.h i_sysun
20976 : see if this is a sys/utsname.h system
20977 set sys/utsname.h i_sysutsname
20980 : see if this is a syswait system
20981 set sys/wait.h i_syswait
20984 : see if this is a ustat.h system
20985 set ustat.h i_ustat
20988 : see if this is an utime system
20989 set utime.h i_utime
20992 : see if this is a values.h system
20993 set values.h i_values
20996 : see if this is a vfork system
20999 set vfork.h i_vfork
21008 echo "Looking for extensions..." >&4
21009 : If we are using the old config.sh, known_extensions may contain
21010 : old or inaccurate or duplicate values.
21011 known_extensions=''
21012 nonxs_extensions=''
21013 : We do not use find because it might not be available.
21014 : We do not just use MANIFEST because the user may have dropped
21015 : some additional extensions into the source tree and expect them
21018 : Function to recursively find available extensions, ignoring DynaLoader
21019 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
21023 DynaLoader|dynaload) ;;
21025 if $test -f $xxx/$xxx.xs -o -f $xxx/$xxx.c; then
21026 known_extensions="$known_extensions $1$xxx";
21027 elif $test -f $xxx/Makefile.PL; then
21028 nonxs_extensions="$nonxs_extensions $1$xxx";
21030 if $test -d $xxx -a $# -lt 10; then
21033 eval $find_extensions;
21045 eval $find_extensions
21046 # Special case: Add in threads/shared since it is not picked up by the
21047 # recursive find above (and adding in general recursive finding breaks
21048 # SDBM_File/sdbm). A.D. 10/25/2001.
21049 known_extensions="$known_extensions threads/shared"
21050 set X $known_extensions
21052 known_extensions="$*"
21053 set X $nonxs_extensions
21055 nonxs_extensions="$*"
21058 : Now see which are supported on this system.
21060 for xxx in $known_extensions ; do
21064 $define) avail_ext="$avail_ext $xxx" ;;
21067 GDBM_File|gdbm_fil)
21069 $define) avail_ext="$avail_ext $xxx" ;;
21072 I18N/Langinfo|i18n_lan)
21073 case "$i_langinfo$d_nl_langinfo" in
21074 $define$define) avail_ext="$avail_ext $xxx" ;;
21078 : XXX Do we need a useipcsysv variable here
21079 case "${d_msg}${d_sem}${d_shm}" in
21080 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
21083 NDBM_File|ndbm_fil)
21086 case "$osname-$use64bitint" in
21089 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
21092 *) avail_ext="$avail_ext $xxx" ;;
21097 ODBM_File|odbm_fil)
21098 case "${i_dbm}${i_rpcsvcdbm}" in
21100 case "$d_cplusplus" in
21101 define) ;; # delete as a function name will not work
21102 *) case "$osname-$use64bitint" in
21105 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
21108 *) avail_ext="$avail_ext $xxx" ;;
21116 case "$useopcode" in
21117 true|define|y) avail_ext="$avail_ext $xxx" ;;
21121 case "$useposix" in
21122 true|define|y) avail_ext="$avail_ext $xxx" ;;
21126 case "$d_socket" in
21129 beos) ;; # not unless BONE
21130 *) avail_ext="$avail_ext $xxx" ;;
21135 Sys/Syslog|sys/syslog)
21136 : XXX syslog requires socket
21137 case "$d_socket" in
21138 true|$define|y) avail_ext="$avail_ext $xxx" ;;
21142 case "$usethreads" in
21144 case "$use5005threads" in
21145 $define|true|[yY]*) avail_ext="$avail_ext $xxx" ;;
21149 threads|threads/shared)
21150 # threads and threads::shared are special cases.
21151 # To stop people from asking "Perl 5.8.0 was supposed
21152 # to have this new fancy threads implementation but my
21153 # perl doesn't have it" and from people trying to
21154 # (re)install the threads module using CPAN.pm and
21155 # CPAN.pm then offering to reinstall Perl 5.8.0,
21156 # the threads.pm and threads/shared.pm will always be
21157 # there, croaking informatively ("you need to rebuild
21158 # all of Perl with threads, sorry") when threads haven't
21159 # been compiled in.
21161 avail_ext="$avail_ext $xxx"
21165 cygwin) avail_ext="$avail_ext $xxx" ;;
21168 XS/APItest|xs/apitest)
21169 # This is just for testing. Skip it unless we have dynamic loading.
21172 $define) avail_ext="$avail_ext $xxx" ;;
21175 XS/Typemap|xs/typemap)
21176 # This is just for testing. Skip it unless we have dynamic loading.
21178 $define) avail_ext="$avail_ext $xxx" ;;
21181 *) avail_ext="$avail_ext $xxx"
21190 case "$onlyextensions" in
21192 *) keepextensions=''
21193 echo "You have requested that only certains extensions be included..." >&4
21194 for i in $onlyextensions; do
21195 case " $avail_ext " in
21197 echo "Keeping extension $i."
21198 keepextensions="$keepextensions $i"
21200 *) echo "Ignoring extension $i." ;;
21203 avail_ext="$keepextensions"
21207 case "$noextensions" in
21209 *) keepextensions=''
21210 echo "You have requested that certain extensions be ignored..." >&4
21211 for i in $avail_ext; do
21212 case " $noextensions " in
21213 *" $i "*) echo "Ignoring extension $i." ;;
21214 *) echo "Keeping extension $i.";
21215 keepextensions="$keepextensions $i"
21219 avail_ext="$keepextensions"
21223 : Now see which nonxs extensions are supported on this system.
21224 : For now assume all are.
21226 for xxx in $nonxs_extensions ; do
21228 *) nonxs_ext="$nonxs_ext $xxx"
21240 A number of extensions are supplied with $package. You may choose to
21241 compile these extensions for dynamic loading (the default), compile
21242 them into the $package executable (static loading), or not include
21243 them at all. Answer "none" to include no extensions.
21244 Note that DynaLoader is always built and need not be mentioned here.
21247 case "$dynamic_ext" in
21249 : Exclude those listed in static_ext
21251 for xxx in $avail_ext; do
21252 case " $static_ext " in
21254 *) dflt="$dflt $xxx" ;;
21261 *) dflt="$dynamic_ext"
21262 # Perhaps we are reusing an old out-of-date config.sh.
21265 if test X"$dynamic_ext" != X"$avail_ext"; then
21267 NOTICE: Your previous config.sh list may be incorrect.
21268 The extensions now available to you are
21270 but the default list from your previous config.sh is
21282 rp="What extensions do you wish to load dynamically?"
21285 none) dynamic_ext=' ' ;;
21286 *) dynamic_ext="$ans" ;;
21289 case "$static_ext" in
21291 : Exclude those already listed in dynamic linking
21293 for xxx in $avail_ext; do
21294 case " $dynamic_ext " in
21296 *) dflt="$dflt $xxx" ;;
21303 *) dflt="$static_ext"
21310 rp="What extensions do you wish to load statically?"
21313 none) static_ext=' ' ;;
21314 *) static_ext="$ans" ;;
21319 A number of extensions are supplied with $package. Answer "none"
21320 to include no extensions.
21321 Note that DynaLoader is always built and need not be mentioned here.
21324 case "$static_ext" in
21325 '') dflt="$avail_ext" ;;
21326 *) dflt="$static_ext"
21327 # Perhaps we are reusing an old out-of-date config.sh.
21330 if test X"$static_ext" != X"$avail_ext"; then
21332 NOTICE: Your previous config.sh list may be incorrect.
21333 The extensions now available to you are
21335 but the default list from your previous config.sh is
21344 : Exclude those that are not xs extensions
21348 rp="What extensions do you wish to include?"
21351 none) static_ext=' ' ;;
21352 *) static_ext="$ans" ;;
21357 # Encode is a special case. If we are building Encode as a static
21358 # extension, we need to explicitly list its subextensions as well.
21359 # For other nested extensions, this is handled automatically by
21360 # the appropriate Makefile.PL.
21361 case " $static_ext " in
21362 *" Encode "*) # Add the subextensions of Encode
21364 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
21365 static_ext="$static_ext Encode/$xxx"
21371 set X $dynamic_ext $static_ext $nonxs_ext
21375 # Sanity check: We require an extension suitable for use with
21376 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
21377 # should show up as failures in the test suite, but it's helpful to
21378 # catch them now.) The 'extensions' list is normally sorted
21379 # alphabetically, so we need to accept either
21380 # DB_File ... Fcntl ... IO ....
21381 # or something like
21382 # Fcntl ... NDBM_File ... IO ....
21383 case " $extensions" in
21384 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
21385 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
21386 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
21387 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
21388 echo "WARNING: The Perl you are building will be quite crippled." >& 4
21392 : Remove libraries needed only for extensions
21393 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
21394 : The exception is SunOS 4.x, which needs them.
21395 case "${osname}X${osvers}" in
21399 *) case "$usedl" in
21400 $define|true|[yY]*)
21401 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
21405 *) perllibs="$libs"
21411 : Remove build directory name from cppstdin so it can be used from
21412 : either the present location or the final installed location.
21414 : Get out of the UU directory to get correct path name.
21416 case "$cppstdin" in
21418 echo "Stripping down cppstdin path name"
21424 : end of configuration questions
21426 echo "End of configuration questions."
21429 : back to where it started
21430 if test -d ../UU; then
21434 : configuration may be patched via a 'config.arch' file
21435 if $test -f config.arch; then
21436 echo "I see a config.arch file, loading it."
21440 : configuration may be patched via a 'config.over' file
21441 if $test -f config.over; then
21444 rp='I see a config.over file. Do you wish to load it?'
21447 n*) echo "OK, I'll ignore it.";;
21449 echo "Configuration override changes have been loaded."
21454 : in case they want portability, strip down executable paths
21455 case "$d_portable" in
21458 echo "Stripping down executable paths..." >&4
21459 for file in $loclist $trylist; do
21461 eval $file=`basename $temp`
21466 : create config.sh file
21468 echo "Creating config.sh..." >&4
21469 $spitshell <<EOT >config.sh
21472 # This file was produced by running the Configure script. It holds all the
21473 # definitions figured out by Configure. Should you modify one of these values,
21474 # do not forget to propagate your changes by running "Configure -der". You may
21475 # instead choose to run each of the .SH files by yourself, or "Configure -S".
21478 # Package name : $package
21479 # Source directory : $src
21480 # Configuration time: $cf_time
21481 # Configured by : $cf_by
21482 # Target system : $myuname
21492 Revision='$Revision'
21500 alignbytes='$alignbytes'
21501 ansi2knr='$ansi2knr'
21502 aphostname='$aphostname'
21503 api_revision='$api_revision'
21504 api_subversion='$api_subversion'
21505 api_version='$api_version'
21506 api_versionstring='$api_versionstring'
21509 archlibexp='$archlibexp'
21510 archname64='$archname64'
21511 archname='$archname'
21512 archobjs='$archobjs'
21513 asctime_r_proto='$asctime_r_proto'
21521 byteorder='$byteorder'
21523 castflags='$castflags'
21526 cccdlflags='$cccdlflags'
21527 ccdlflags='$ccdlflags'
21529 ccflags_uselargefiles='$ccflags_uselargefiles'
21531 ccsymbols='$ccsymbols'
21532 ccversion='$ccversion'
21534 cf_email='$cf_email'
21539 clocktype='$clocktype'
21541 compress='$compress'
21542 contains='$contains'
21546 cpp_stuff='$cpp_stuff'
21547 cppccsymbols='$cppccsymbols'
21548 cppflags='$cppflags'
21550 cppminus='$cppminus'
21552 cppstdin='$cppstdin'
21553 cppsymbols='$cppsymbols'
21554 crypt_r_proto='$crypt_r_proto'
21555 cryptlib='$cryptlib'
21557 ctermid_r_proto='$ctermid_r_proto'
21558 ctime_r_proto='$ctime_r_proto'
21559 d_Gconvert='$d_Gconvert'
21560 d_PRIEUldbl='$d_PRIEUldbl'
21561 d_PRIFUldbl='$d_PRIFUldbl'
21562 d_PRIGUldbl='$d_PRIGUldbl'
21563 d_PRIXU64='$d_PRIXU64'
21564 d_PRId64='$d_PRId64'
21565 d_PRIeldbl='$d_PRIeldbl'
21566 d_PRIfldbl='$d_PRIfldbl'
21567 d_PRIgldbl='$d_PRIgldbl'
21568 d_PRIi64='$d_PRIi64'
21569 d_PRIo64='$d_PRIo64'
21570 d_PRIu64='$d_PRIu64'
21571 d_PRIx64='$d_PRIx64'
21572 d_SCNfldbl='$d_SCNfldbl'
21573 d__fwalk='$d__fwalk'
21574 d_access='$d_access'
21575 d_accessx='$d_accessx'
21578 d_archlib='$d_archlib'
21579 d_asctime_r='$d_asctime_r'
21582 d_attribute_format='$d_attribute_format'
21583 d_attribute_malloc='$d_attribute_malloc'
21584 d_attribute_nonnull='$d_attribute_nonnull'
21585 d_attribute_noreturn='$d_attribute_noreturn'
21586 d_attribute_pure='$d_attribute_pure'
21587 d_attribute_unused='$d_attribute_unused'
21588 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
21592 d_bsdgetpgrp='$d_bsdgetpgrp'
21593 d_bsdsetpgrp='$d_bsdsetpgrp'
21594 d_builtin_choose_expr='$d_builtin_choose_expr'
21595 d_builtin_expect='$d_builtin_expect'
21597 d_c99_variadic_macros='$d_c99_variadic_macros'
21598 d_casti32='$d_casti32'
21599 d_castneg='$d_castneg'
21600 d_charvspr='$d_charvspr'
21602 d_chroot='$d_chroot'
21603 d_chsize='$d_chsize'
21605 d_clearenv='$d_clearenv'
21606 d_closedir='$d_closedir'
21607 d_cmsghdr_s='$d_cmsghdr_s'
21609 d_copysignl='$d_copysignl'
21610 d_cplusplus='$d_cplusplus'
21612 d_crypt_r='$d_crypt_r'
21614 d_ctermid='$d_ctermid'
21615 d_ctermid_r='$d_ctermid_r'
21616 d_ctime_r='$d_ctime_r'
21617 d_cuserid='$d_cuserid'
21618 d_dbl_dig='$d_dbl_dig'
21619 d_dbminitproto='$d_dbminitproto'
21620 d_difftime='$d_difftime'
21621 d_dir_dd_fd='$d_dir_dd_fd'
21623 d_dirnamlen='$d_dirnamlen'
21624 d_dlerror='$d_dlerror'
21625 d_dlopen='$d_dlopen'
21626 d_dlsymun='$d_dlsymun'
21627 d_dosuid='$d_dosuid'
21628 d_drand48_r='$d_drand48_r'
21629 d_drand48proto='$d_drand48proto'
21631 d_eaccess='$d_eaccess'
21632 d_endgrent='$d_endgrent'
21633 d_endgrent_r='$d_endgrent_r'
21634 d_endhent='$d_endhent'
21635 d_endhostent_r='$d_endhostent_r'
21636 d_endnent='$d_endnent'
21637 d_endnetent_r='$d_endnetent_r'
21638 d_endpent='$d_endpent'
21639 d_endprotoent_r='$d_endprotoent_r'
21640 d_endpwent='$d_endpwent'
21641 d_endpwent_r='$d_endpwent_r'
21642 d_endsent='$d_endsent'
21643 d_endservent_r='$d_endservent_r'
21644 d_eofnblk='$d_eofnblk'
21645 d_eunice='$d_eunice'
21646 d_faststdio='$d_faststdio'
21647 d_fchdir='$d_fchdir'
21648 d_fchmod='$d_fchmod'
21649 d_fchown='$d_fchown'
21651 d_fcntl_can_lock='$d_fcntl_can_lock'
21652 d_fd_macros='$d_fd_macros'
21653 d_fd_set='$d_fd_set'
21654 d_fds_bits='$d_fds_bits'
21655 d_fgetpos='$d_fgetpos'
21656 d_finite='$d_finite'
21657 d_finitel='$d_finitel'
21658 d_flexfnam='$d_flexfnam'
21660 d_flockproto='$d_flockproto'
21662 d_fp_class='$d_fp_class'
21663 d_fpathconf='$d_fpathconf'
21664 d_fpclass='$d_fpclass'
21665 d_fpclassify='$d_fpclassify'
21666 d_fpclassl='$d_fpclassl'
21667 d_fpos64_t='$d_fpos64_t'
21668 d_frexpl='$d_frexpl'
21669 d_fs_data_s='$d_fs_data_s'
21670 d_fseeko='$d_fseeko'
21671 d_fsetpos='$d_fsetpos'
21672 d_fstatfs='$d_fstatfs'
21673 d_fstatvfs='$d_fstatvfs'
21675 d_ftello='$d_ftello'
21677 d_futimes='$d_futimes'
21678 d_getcwd='$d_getcwd'
21679 d_getespwnam='$d_getespwnam'
21680 d_getfsstat='$d_getfsstat'
21681 d_getgrent='$d_getgrent'
21682 d_getgrent_r='$d_getgrent_r'
21683 d_getgrgid_r='$d_getgrgid_r'
21684 d_getgrnam_r='$d_getgrnam_r'
21685 d_getgrps='$d_getgrps'
21686 d_gethbyaddr='$d_gethbyaddr'
21687 d_gethbyname='$d_gethbyname'
21688 d_gethent='$d_gethent'
21689 d_gethname='$d_gethname'
21690 d_gethostbyaddr_r='$d_gethostbyaddr_r'
21691 d_gethostbyname_r='$d_gethostbyname_r'
21692 d_gethostent_r='$d_gethostent_r'
21693 d_gethostprotos='$d_gethostprotos'
21694 d_getitimer='$d_getitimer'
21695 d_getlogin='$d_getlogin'
21696 d_getlogin_r='$d_getlogin_r'
21697 d_getmnt='$d_getmnt'
21698 d_getmntent='$d_getmntent'
21699 d_getnbyaddr='$d_getnbyaddr'
21700 d_getnbyname='$d_getnbyname'
21701 d_getnent='$d_getnent'
21702 d_getnetbyaddr_r='$d_getnetbyaddr_r'
21703 d_getnetbyname_r='$d_getnetbyname_r'
21704 d_getnetent_r='$d_getnetent_r'
21705 d_getnetprotos='$d_getnetprotos'
21706 d_getpagsz='$d_getpagsz'
21707 d_getpbyname='$d_getpbyname'
21708 d_getpbynumber='$d_getpbynumber'
21709 d_getpent='$d_getpent'
21710 d_getpgid='$d_getpgid'
21711 d_getpgrp2='$d_getpgrp2'
21712 d_getpgrp='$d_getpgrp'
21713 d_getppid='$d_getppid'
21714 d_getprior='$d_getprior'
21715 d_getprotobyname_r='$d_getprotobyname_r'
21716 d_getprotobynumber_r='$d_getprotobynumber_r'
21717 d_getprotoent_r='$d_getprotoent_r'
21718 d_getprotoprotos='$d_getprotoprotos'
21719 d_getprpwnam='$d_getprpwnam'
21720 d_getpwent='$d_getpwent'
21721 d_getpwent_r='$d_getpwent_r'
21722 d_getpwnam_r='$d_getpwnam_r'
21723 d_getpwuid_r='$d_getpwuid_r'
21724 d_getsbyname='$d_getsbyname'
21725 d_getsbyport='$d_getsbyport'
21726 d_getsent='$d_getsent'
21727 d_getservbyname_r='$d_getservbyname_r'
21728 d_getservbyport_r='$d_getservbyport_r'
21729 d_getservent_r='$d_getservent_r'
21730 d_getservprotos='$d_getservprotos'
21731 d_getspnam='$d_getspnam'
21732 d_getspnam_r='$d_getspnam_r'
21733 d_gettimeod='$d_gettimeod'
21734 d_gmtime_r='$d_gmtime_r'
21735 d_gnulibc='$d_gnulibc'
21736 d_grpasswd='$d_grpasswd'
21737 d_hasmntopt='$d_hasmntopt'
21739 d_ilogbl='$d_ilogbl'
21740 d_inc_version_list='$d_inc_version_list'
21742 d_inetaton='$d_inetaton'
21743 d_int64_t='$d_int64_t'
21744 d_isascii='$d_isascii'
21745 d_isfinite='$d_isfinite'
21748 d_isnanl='$d_isnanl'
21749 d_killpg='$d_killpg'
21750 d_lchown='$d_lchown'
21751 d_ldbl_dig='$d_ldbl_dig'
21752 d_libm_lib_version='$d_libm_lib_version'
21754 d_localtime_r='$d_localtime_r'
21755 d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset'
21756 d_locconv='$d_locconv'
21758 d_longdbl='$d_longdbl'
21759 d_longlong='$d_longlong'
21760 d_lseekproto='$d_lseekproto'
21762 d_madvise='$d_madvise'
21763 d_malloc_good_size='$d_malloc_good_size'
21764 d_malloc_size='$d_malloc_size'
21766 d_mbstowcs='$d_mbstowcs'
21767 d_mbtowc='$d_mbtowc'
21768 d_memchr='$d_memchr'
21769 d_memcmp='$d_memcmp'
21770 d_memcpy='$d_memcpy'
21771 d_memmove='$d_memmove'
21772 d_memset='$d_memset'
21774 d_mkdtemp='$d_mkdtemp'
21775 d_mkfifo='$d_mkfifo'
21776 d_mkstemp='$d_mkstemp'
21777 d_mkstemps='$d_mkstemps'
21778 d_mktime='$d_mktime'
21781 d_modfl_pow32_bug='$d_modfl_pow32_bug'
21782 d_modflproto='$d_modflproto'
21783 d_mprotect='$d_mprotect'
21785 d_msg_ctrunc='$d_msg_ctrunc'
21786 d_msg_dontroute='$d_msg_dontroute'
21787 d_msg_oob='$d_msg_oob'
21788 d_msg_peek='$d_msg_peek'
21789 d_msg_proxy='$d_msg_proxy'
21790 d_msgctl='$d_msgctl'
21791 d_msgget='$d_msgget'
21792 d_msghdr_s='$d_msghdr_s'
21793 d_msgrcv='$d_msgrcv'
21794 d_msgsnd='$d_msgsnd'
21796 d_munmap='$d_munmap'
21797 d_mymalloc='$d_mymalloc'
21799 d_nl_langinfo='$d_nl_langinfo'
21800 d_nv_preserves_uv='$d_nv_preserves_uv'
21801 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
21802 d_off64_t='$d_off64_t'
21803 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
21804 d_oldpthreads='$d_oldpthreads'
21805 d_oldsock='$d_oldsock'
21807 d_pathconf='$d_pathconf'
21809 d_perl_otherlibdirs='$d_perl_otherlibdirs'
21810 d_phostname='$d_phostname'
21813 d_portable='$d_portable'
21814 d_printf_format_null='$d_printf_format_null'
21815 d_procselfexe='$d_procselfexe'
21816 d_pseudofork='$d_pseudofork'
21817 d_pthread_atfork='$d_pthread_atfork'
21818 d_pthread_attr_setscope='$d_pthread_attr_setscope'
21819 d_pthread_yield='$d_pthread_yield'
21821 d_pwchange='$d_pwchange'
21822 d_pwclass='$d_pwclass'
21823 d_pwcomment='$d_pwcomment'
21824 d_pwexpire='$d_pwexpire'
21825 d_pwgecos='$d_pwgecos'
21826 d_pwpasswd='$d_pwpasswd'
21827 d_pwquota='$d_pwquota'
21830 d_random_r='$d_random_r'
21831 d_readdir64_r='$d_readdir64_r'
21832 d_readdir='$d_readdir'
21833 d_readdir_r='$d_readdir_r'
21834 d_readlink='$d_readlink'
21836 d_recvmsg='$d_recvmsg'
21837 d_rename='$d_rename'
21838 d_rewinddir='$d_rewinddir'
21840 d_safebcpy='$d_safebcpy'
21841 d_safemcpy='$d_safemcpy'
21842 d_sanemcmp='$d_sanemcmp'
21843 d_sbrkproto='$d_sbrkproto'
21844 d_scalbnl='$d_scalbnl'
21845 d_sched_yield='$d_sched_yield'
21846 d_scm_rights='$d_scm_rights'
21847 d_seekdir='$d_seekdir'
21848 d_select='$d_select'
21850 d_semctl='$d_semctl'
21851 d_semctl_semid_ds='$d_semctl_semid_ds'
21852 d_semctl_semun='$d_semctl_semun'
21853 d_semget='$d_semget'
21855 d_sendmsg='$d_sendmsg'
21856 d_setegid='$d_setegid'
21857 d_seteuid='$d_seteuid'
21858 d_setgrent='$d_setgrent'
21859 d_setgrent_r='$d_setgrent_r'
21860 d_setgrps='$d_setgrps'
21861 d_sethent='$d_sethent'
21862 d_sethostent_r='$d_sethostent_r'
21863 d_setitimer='$d_setitimer'
21864 d_setlinebuf='$d_setlinebuf'
21865 d_setlocale='$d_setlocale'
21866 d_setlocale_r='$d_setlocale_r'
21867 d_setnent='$d_setnent'
21868 d_setnetent_r='$d_setnetent_r'
21869 d_setpent='$d_setpent'
21870 d_setpgid='$d_setpgid'
21871 d_setpgrp2='$d_setpgrp2'
21872 d_setpgrp='$d_setpgrp'
21873 d_setprior='$d_setprior'
21874 d_setproctitle='$d_setproctitle'
21875 d_setprotoent_r='$d_setprotoent_r'
21876 d_setpwent='$d_setpwent'
21877 d_setpwent_r='$d_setpwent_r'
21878 d_setregid='$d_setregid'
21879 d_setresgid='$d_setresgid'
21880 d_setresuid='$d_setresuid'
21881 d_setreuid='$d_setreuid'
21882 d_setrgid='$d_setrgid'
21883 d_setruid='$d_setruid'
21884 d_setsent='$d_setsent'
21885 d_setservent_r='$d_setservent_r'
21886 d_setsid='$d_setsid'
21887 d_setvbuf='$d_setvbuf'
21891 d_shmatprototype='$d_shmatprototype'
21892 d_shmctl='$d_shmctl'
21894 d_shmget='$d_shmget'
21895 d_sigaction='$d_sigaction'
21896 d_signbit='$d_signbit'
21897 d_sigprocmask='$d_sigprocmask'
21898 d_sigsetjmp='$d_sigsetjmp'
21899 d_sitearch='$d_sitearch'
21900 d_snprintf='$d_snprintf'
21901 d_sockatmark='$d_sockatmark'
21902 d_sockatmarkproto='$d_sockatmarkproto'
21903 d_socket='$d_socket'
21904 d_socklen_t='$d_socklen_t'
21905 d_sockpair='$d_sockpair'
21906 d_socks5_init='$d_socks5_init'
21907 d_sprintf_returns_strlen='$d_sprintf_returns_strlen'
21909 d_srand48_r='$d_srand48_r'
21910 d_srandom_r='$d_srandom_r'
21911 d_sresgproto='$d_sresgproto'
21912 d_sresuproto='$d_sresuproto'
21913 d_statblks='$d_statblks'
21914 d_statfs_f_flags='$d_statfs_f_flags'
21915 d_statfs_s='$d_statfs_s'
21916 d_statvfs='$d_statvfs'
21917 d_stdio_cnt_lval='$d_stdio_cnt_lval'
21918 d_stdio_ptr_lval='$d_stdio_ptr_lval'
21919 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
21920 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
21921 d_stdio_stream_array='$d_stdio_stream_array'
21922 d_stdiobase='$d_stdiobase'
21923 d_stdstdio='$d_stdstdio'
21924 d_strchr='$d_strchr'
21925 d_strcoll='$d_strcoll'
21926 d_strctcpy='$d_strctcpy'
21927 d_strerrm='$d_strerrm'
21928 d_strerror='$d_strerror'
21929 d_strerror_r='$d_strerror_r'
21930 d_strftime='$d_strftime'
21931 d_strlcat='$d_strlcat'
21932 d_strlcpy='$d_strlcpy'
21933 d_strtod='$d_strtod'
21934 d_strtol='$d_strtol'
21935 d_strtold='$d_strtold'
21936 d_strtoll='$d_strtoll'
21937 d_strtoq='$d_strtoq'
21938 d_strtoul='$d_strtoul'
21939 d_strtoull='$d_strtoull'
21940 d_strtouq='$d_strtouq'
21941 d_strxfrm='$d_strxfrm'
21942 d_suidsafe='$d_suidsafe'
21943 d_symlink='$d_symlink'
21944 d_syscall='$d_syscall'
21945 d_syscallproto='$d_syscallproto'
21946 d_sysconf='$d_sysconf'
21947 d_sysernlst='$d_sysernlst'
21948 d_syserrlst='$d_syserrlst'
21949 d_system='$d_system'
21950 d_tcgetpgrp='$d_tcgetpgrp'
21951 d_tcsetpgrp='$d_tcsetpgrp'
21952 d_telldir='$d_telldir'
21953 d_telldirproto='$d_telldirproto'
21956 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
21957 d_tm_tm_zone='$d_tm_tm_zone'
21958 d_tmpnam_r='$d_tmpnam_r'
21959 d_truncate='$d_truncate'
21960 d_ttyname_r='$d_ttyname_r'
21961 d_tzname='$d_tzname'
21962 d_u32align='$d_u32align'
21963 d_ualarm='$d_ualarm'
21966 d_union_semun='$d_union_semun'
21967 d_unordered='$d_unordered'
21968 d_unsetenv='$d_unsetenv'
21969 d_usleep='$d_usleep'
21970 d_usleepproto='$d_usleepproto'
21972 d_vendorarch='$d_vendorarch'
21973 d_vendorbin='$d_vendorbin'
21974 d_vendorlib='$d_vendorlib'
21975 d_vendorscript='$d_vendorscript'
21977 d_void_closedir='$d_void_closedir'
21978 d_voidsig='$d_voidsig'
21979 d_voidtty='$d_voidtty'
21980 d_volatile='$d_volatile'
21981 d_vprintf='$d_vprintf'
21982 d_vsnprintf='$d_vsnprintf'
21984 d_waitpid='$d_waitpid'
21985 d_wcstombs='$d_wcstombs'
21986 d_wctomb='$d_wctomb'
21987 d_writev='$d_writev'
21990 db_hashtype='$db_hashtype'
21991 db_prefixtype='$db_prefixtype'
21992 db_version_major='$db_version_major'
21993 db_version_minor='$db_version_minor'
21994 db_version_patch='$db_version_patch'
21995 defvoidused='$defvoidused'
21996 direntrytype='$direntrytype'
21999 doublesize='$doublesize'
22001 drand48_r_proto='$drand48_r_proto'
22002 dynamic_ext='$dynamic_ext'
22008 endgrent_r_proto='$endgrent_r_proto'
22009 endhostent_r_proto='$endhostent_r_proto'
22010 endnetent_r_proto='$endnetent_r_proto'
22011 endprotoent_r_proto='$endprotoent_r_proto'
22012 endpwent_r_proto='$endpwent_r_proto'
22013 endservent_r_proto='$endservent_r_proto'
22014 eunicefix='$eunicefix'
22017 extensions='$extensions'
22019 fflushNULL='$fflushNULL'
22020 fflushall='$fflushall'
22022 firstmakefile='$firstmakefile'
22024 fpossize='$fpossize'
22025 fpostype='$fpostype'
22026 freetype='$freetype'
22029 full_csh='$full_csh'
22030 full_sed='$full_sed'
22031 gccansipedantic='$gccansipedantic'
22032 gccosandvers='$gccosandvers'
22033 gccversion='$gccversion'
22034 getgrent_r_proto='$getgrent_r_proto'
22035 getgrgid_r_proto='$getgrgid_r_proto'
22036 getgrnam_r_proto='$getgrnam_r_proto'
22037 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
22038 gethostbyname_r_proto='$gethostbyname_r_proto'
22039 gethostent_r_proto='$gethostent_r_proto'
22040 getlogin_r_proto='$getlogin_r_proto'
22041 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
22042 getnetbyname_r_proto='$getnetbyname_r_proto'
22043 getnetent_r_proto='$getnetent_r_proto'
22044 getprotobyname_r_proto='$getprotobyname_r_proto'
22045 getprotobynumber_r_proto='$getprotobynumber_r_proto'
22046 getprotoent_r_proto='$getprotoent_r_proto'
22047 getpwent_r_proto='$getpwent_r_proto'
22048 getpwnam_r_proto='$getpwnam_r_proto'
22049 getpwuid_r_proto='$getpwuid_r_proto'
22050 getservbyname_r_proto='$getservbyname_r_proto'
22051 getservbyport_r_proto='$getservbyport_r_proto'
22052 getservent_r_proto='$getservent_r_proto'
22053 getspnam_r_proto='$getspnam_r_proto'
22054 gidformat='$gidformat'
22060 gmtime_r_proto='$gmtime_r_proto'
22061 gnulibc_version='$gnulibc_version'
22063 groupcat='$groupcat'
22064 groupstype='$groupstype'
22067 h_sysfile='$h_sysfile'
22070 html1dir='$html1dir'
22071 html1direxp='$html1direxp'
22072 html3dir='$html3dir'
22073 html3direxp='$html3direxp'
22082 i_arpainet='$i_arpainet'
22083 i_bsdioctl='$i_bsdioctl'
22087 i_dirent='$i_dirent'
22093 i_fp_class='$i_fp_class'
22096 i_ieeefp='$i_ieeefp'
22097 i_inttypes='$i_inttypes'
22098 i_langinfo='$i_langinfo'
22099 i_libutil='$i_libutil'
22100 i_limits='$i_limits'
22101 i_locale='$i_locale'
22102 i_machcthr='$i_machcthr'
22103 i_malloc='$i_malloc'
22105 i_memory='$i_memory'
22106 i_mntent='$i_mntent'
22109 i_neterrno='$i_neterrno'
22110 i_netinettcp='$i_netinettcp'
22114 i_pthread='$i_pthread'
22116 i_rpcsvcdbm='$i_rpcsvcdbm'
22119 i_shadow='$i_shadow'
22121 i_stdarg='$i_stdarg'
22122 i_stddef='$i_stddef'
22123 i_stdlib='$i_stdlib'
22124 i_string='$i_string'
22125 i_sunmath='$i_sunmath'
22126 i_sysaccess='$i_sysaccess'
22127 i_sysdir='$i_sysdir'
22128 i_sysfile='$i_sysfile'
22129 i_sysfilio='$i_sysfilio'
22131 i_sysioctl='$i_sysioctl'
22132 i_syslog='$i_syslog'
22133 i_sysmman='$i_sysmman'
22134 i_sysmode='$i_sysmode'
22135 i_sysmount='$i_sysmount'
22136 i_sysndir='$i_sysndir'
22137 i_sysparam='$i_sysparam'
22138 i_sysresrc='$i_sysresrc'
22139 i_syssecrt='$i_syssecrt'
22140 i_sysselct='$i_sysselct'
22141 i_syssockio='$i_syssockio'
22142 i_sysstat='$i_sysstat'
22143 i_sysstatfs='$i_sysstatfs'
22144 i_sysstatvfs='$i_sysstatvfs'
22145 i_systime='$i_systime'
22146 i_systimek='$i_systimek'
22147 i_systimes='$i_systimes'
22148 i_systypes='$i_systypes'
22149 i_sysuio='$i_sysuio'
22151 i_sysutsname='$i_sysutsname'
22152 i_sysvfs='$i_sysvfs'
22153 i_syswait='$i_syswait'
22154 i_termio='$i_termio'
22155 i_termios='$i_termios'
22157 i_unistd='$i_unistd'
22160 i_values='$i_values'
22161 i_varargs='$i_varargs'
22162 i_varhdr='$i_varhdr'
22164 ignore_versioned_solibs='$ignore_versioned_solibs'
22165 inc_version_list='$inc_version_list'
22166 inc_version_list_init='$inc_version_list_init'
22169 initialinstalllocation='$initialinstalllocation'
22170 installarchlib='$installarchlib'
22171 installbin='$installbin'
22172 installhtml1dir='$installhtml1dir'
22173 installhtml3dir='$installhtml3dir'
22174 installman1dir='$installman1dir'
22175 installman3dir='$installman3dir'
22176 installprefix='$installprefix'
22177 installprefixexp='$installprefixexp'
22178 installprivlib='$installprivlib'
22179 installscript='$installscript'
22180 installsitearch='$installsitearch'
22181 installsitebin='$installsitebin'
22182 installsitehtml1dir='$installsitehtml1dir'
22183 installsitehtml3dir='$installsitehtml3dir'
22184 installsitelib='$installsitelib'
22185 installsiteman1dir='$installsiteman1dir'
22186 installsiteman3dir='$installsiteman3dir'
22187 installsitescript='$installsitescript'
22188 installstyle='$installstyle'
22189 installusrbinperl='$installusrbinperl'
22190 installvendorarch='$installvendorarch'
22191 installvendorbin='$installvendorbin'
22192 installvendorhtml1dir='$installvendorhtml1dir'
22193 installvendorhtml3dir='$installvendorhtml3dir'
22194 installvendorlib='$installvendorlib'
22195 installvendorman1dir='$installvendorman1dir'
22196 installvendorman3dir='$installvendorman3dir'
22197 installvendorscript='$installvendorscript'
22199 issymlink='$issymlink'
22200 ivdformat='$ivdformat'
22203 known_extensions='$known_extensions'
22206 lddlflags='$lddlflags'
22208 ldflags_uselargefiles='$ldflags_uselargefiles'
22209 ldlibpthname='$ldlibpthname'
22216 libsdirs='$libsdirs'
22217 libsfiles='$libsfiles'
22218 libsfound='$libsfound'
22219 libspath='$libspath'
22220 libswanted='$libswanted'
22221 libswanted_uselargefiles='$libswanted_uselargefiles'
22227 localtime_r_proto='$localtime_r_proto'
22228 locincpth='$locincpth'
22229 loclibpth='$loclibpth'
22230 longdblsize='$longdblsize'
22231 longlongsize='$longlongsize'
22232 longsize='$longsize'
22236 lseeksize='$lseeksize'
22237 lseektype='$lseektype'
22240 madlyobj='$madlyobj'
22241 madlysrc='$madlysrc'
22245 make_set_make='$make_set_make'
22246 mallocobj='$mallocobj'
22247 mallocsrc='$mallocsrc'
22248 malloctype='$malloctype'
22250 man1direxp='$man1direxp'
22253 man3direxp='$man3direxp'
22255 mips_type='$mips_type'
22256 mistrustnm='$mistrustnm'
22258 mmaptype='$mmaptype'
22259 modetype='$modetype'
22261 multiarch='$multiarch'
22263 myarchname='$myarchname'
22264 mydomain='$mydomain'
22265 myhostname='$myhostname'
22268 need_va_copy='$need_va_copy'
22269 netdb_hlen_type='$netdb_hlen_type'
22270 netdb_host_type='$netdb_host_type'
22271 netdb_name_type='$netdb_name_type'
22272 netdb_net_type='$netdb_net_type'
22275 nm_so_opt='$nm_so_opt'
22276 nonxs_ext='$nonxs_ext'
22278 nvEUformat='$nvEUformat'
22279 nvFUformat='$nvFUformat'
22280 nvGUformat='$nvGUformat'
22281 nv_preserves_uv_bits='$nv_preserves_uv_bits'
22282 nveformat='$nveformat'
22283 nvfformat='$nvfformat'
22284 nvgformat='$nvgformat'
22287 o_nonblock='$o_nonblock'
22289 old_pthread_create_joinable='$old_pthread_create_joinable'
22290 optimize='$optimize'
22291 orderlib='$orderlib'
22294 otherlibdirs='$otherlibdirs'
22298 patchlevel='$patchlevel'
22299 path_sep='$path_sep'
22302 perl_patchlevel='$perl_patchlevel'
22303 perladmin='$perladmin'
22304 perllibs='$perllibs'
22305 perlpath='$perlpath'
22307 phostname='$phostname'
22313 prefixexp='$prefixexp'
22315 privlibexp='$privlibexp'
22316 procselfexe='$procselfexe'
22317 prototype='$prototype'
22319 quadkind='$quadkind'
22320 quadtype='$quadtype'
22321 randbits='$randbits'
22322 randfunc='$randfunc'
22323 random_r_proto='$random_r_proto'
22324 randseedtype='$randseedtype'
22326 rd_nodata='$rd_nodata'
22327 readdir64_r_proto='$readdir64_r_proto'
22328 readdir_r_proto='$readdir_r_proto'
22329 revision='$revision'
22335 sPRIEUldbl='$sPRIEUldbl'
22336 sPRIFUldbl='$sPRIFUldbl'
22337 sPRIGUldbl='$sPRIGUldbl'
22338 sPRIXU64='$sPRIXU64'
22340 sPRIeldbl='$sPRIeldbl'
22341 sPRIfldbl='$sPRIfldbl'
22342 sPRIgldbl='$sPRIgldbl'
22347 sSCNfldbl='$sSCNfldbl'
22348 sched_yield='$sched_yield'
22349 scriptdir='$scriptdir'
22350 scriptdirexp='$scriptdirexp'
22352 seedfunc='$seedfunc'
22353 selectminbits='$selectminbits'
22354 selecttype='$selecttype'
22355 sendmail='$sendmail'
22356 setgrent_r_proto='$setgrent_r_proto'
22357 sethostent_r_proto='$sethostent_r_proto'
22358 setlocale_r_proto='$setlocale_r_proto'
22359 setnetent_r_proto='$setnetent_r_proto'
22360 setprotoent_r_proto='$setprotoent_r_proto'
22361 setpwent_r_proto='$setpwent_r_proto'
22362 setservent_r_proto='$setservent_r_proto'
22365 sharpbang='$sharpbang'
22366 shmattype='$shmattype'
22367 shortsize='$shortsize'
22370 sig_count='$sig_count'
22371 sig_name='$sig_name'
22372 sig_name_init='$sig_name_init'
22374 sig_num_init='$sig_num_init'
22375 sig_size='$sig_size'
22376 signal_t='$signal_t'
22377 sitearch='$sitearch'
22378 sitearchexp='$sitearchexp'
22380 sitebinexp='$sitebinexp'
22381 sitehtml1dir='$sitehtml1dir'
22382 sitehtml1direxp='$sitehtml1direxp'
22383 sitehtml3dir='$sitehtml3dir'
22384 sitehtml3direxp='$sitehtml3direxp'
22386 sitelib_stem='$sitelib_stem'
22387 sitelibexp='$sitelibexp'
22388 siteman1dir='$siteman1dir'
22389 siteman1direxp='$siteman1direxp'
22390 siteman3dir='$siteman3dir'
22391 siteman3direxp='$siteman3direxp'
22392 siteprefix='$siteprefix'
22393 siteprefixexp='$siteprefixexp'
22394 sitescript='$sitescript'
22395 sitescriptexp='$sitescriptexp'
22396 sizesize='$sizesize'
22397 sizetype='$sizetype'
22401 sockethdr='$sockethdr'
22402 socketlib='$socketlib'
22403 socksizetype='$socksizetype'
22405 spackage='$spackage'
22406 spitshell='$spitshell'
22407 srand48_r_proto='$srand48_r_proto'
22408 srandom_r_proto='$srandom_r_proto'
22410 ssizetype='$ssizetype'
22411 startperl='$startperl'
22413 static_ext='$static_ext'
22415 stdio_base='$stdio_base'
22416 stdio_bufsiz='$stdio_bufsiz'
22417 stdio_cnt='$stdio_cnt'
22418 stdio_filbuf='$stdio_filbuf'
22419 stdio_ptr='$stdio_ptr'
22420 stdio_stream_array='$stdio_stream_array'
22421 strerror_r_proto='$strerror_r_proto'
22424 subversion='$subversion'
22428 targetarch='$targetarch'
22432 timeincl='$timeincl'
22433 timetype='$timetype'
22434 tmpnam_r_proto='$tmpnam_r_proto'
22440 ttyname_r_proto='$ttyname_r_proto'
22449 uidformat='$uidformat'
22455 uquadtype='$uquadtype'
22456 use5005threads='$use5005threads'
22457 use64bitall='$use64bitall'
22458 use64bitint='$use64bitint'
22459 usecrosscompile='$usecrosscompile'
22461 usefaststdio='$usefaststdio'
22462 useithreads='$useithreads'
22463 uselargefiles='$uselargefiles'
22464 uselongdouble='$uselongdouble'
22465 usemallocwrap='$usemallocwrap'
22466 usemorebits='$usemorebits'
22467 usemultiplicity='$usemultiplicity'
22468 usemymalloc='$usemymalloc'
22470 useopcode='$useopcode'
22471 useperlio='$useperlio'
22472 useposix='$useposix'
22473 usereentrant='$usereentrant'
22474 userelocatableinc='$userelocatableinc'
22476 useshrplib='$useshrplib'
22477 usesitecustomize='$usesitecustomize'
22478 usesocks='$usesocks'
22479 usethreads='$usethreads'
22480 usevendorprefix='$usevendorprefix'
22481 usevfork='$usevfork'
22484 uvXUformat='$uvXUformat'
22485 uvoformat='$uvoformat'
22488 uvuformat='$uvuformat'
22489 uvxformat='$uvxformat'
22490 vendorarch='$vendorarch'
22491 vendorarchexp='$vendorarchexp'
22492 vendorbin='$vendorbin'
22493 vendorbinexp='$vendorbinexp'
22494 vendorhtml1dir='$vendorhtml1dir'
22495 vendorhtml1direxp='$vendorhtml1direxp'
22496 vendorhtml3dir='$vendorhtml3dir'
22497 vendorhtml3direxp='$vendorhtml3direxp'
22498 vendorlib='$vendorlib'
22499 vendorlib_stem='$vendorlib_stem'
22500 vendorlibexp='$vendorlibexp'
22501 vendorman1dir='$vendorman1dir'
22502 vendorman1direxp='$vendorman1direxp'
22503 vendorman3dir='$vendorman3dir'
22504 vendorman3direxp='$vendorman3direxp'
22505 vendorprefix='$vendorprefix'
22506 vendorprefixexp='$vendorprefixexp'
22507 vendorscript='$vendorscript'
22508 vendorscriptexp='$vendorscriptexp'
22510 version_patchlevel_string='$version_patchlevel_string'
22511 versiononly='$versiononly'
22513 voidflags='$voidflags'
22516 yaccflags='$yaccflags'
22521 : Add in command line options if available
22522 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
22524 : add special variables
22525 $test -f $src/patchlevel.h && \
22526 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
22527 echo "PERL_PATCHLEVEL=$perl_patchlevel" >>config.sh
22528 echo "PERL_CONFIG_SH=true" >>config.sh
22530 : propagate old symbols
22531 if $test -f UU/config.sh; then
22532 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
22533 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
22534 $sort | $uniq -u >UU/oldsyms
22535 set X `cat UU/oldsyms`
22541 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
22543 echo "# Variables propagated from previous config.sh file." >>config.sh
22544 for sym in `cat UU/oldsyms`; do
22545 echo " Propagating $hint variable "'$'"$sym..."
22546 eval 'tmp="$'"${sym}"'"'
22548 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
22554 : Finish up by extracting the .SH files
22558 echo "Extraction done."
22568 If you'd like to make any changes to the config.sh file before I begin
22569 to configure things, do it as a shell escape now (e.g. !vi config.sh).
22572 rp="Press return or use a shell escape to edit config.sh:"
22577 *) : in case they cannot read
22578 sh 1>&4 -c "$ans";;
22583 : if this fails, just run all the .SH files by hand
22592 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
22599 Now you need to generate make dependencies by running "$make depend".
22600 You might prefer to run it in background: "$make depend > makedepend.out &"
22601 It can take a while, so you might not want to run it right now.
22606 rp="Run $make depend now?"
22610 $make depend && echo "Now you must run '$make'."
22613 echo "You must run '$make depend' then '$make'."
22616 elif test -f [Mm]akefile; then
22618 echo "Now you must run a $make."
22620 echo "Configure done."
22623 if $test -f Policy.sh; then
22626 If you compile $package on a different machine or from a different object
22627 directory, copy the Policy.sh file from this object directory to the
22628 new one before you run Configure -- this will help you with most of
22629 the policy defaults.
22633 if $test -f config.msg; then
22634 echo "Hmm. I also noted the following information while running:"
22636 $cat config.msg >&4
22639 $rm -f kit*isdone ark*isdone