3 # If these # comments don't work, trim them. Don't worry about any other
4 # shell scripts, Configure will trim # comments from them for you.
6 # (If you are trying to port this package to a machine without sh,
7 # I would suggest you have a look at the prototypical config_h.SH file
8 # and edit it to reflect your system. Some packages may include samples
9 # of config.h for certain machines, so you might look for one of those.)
11 # Yes, you may rip this off to use in other distribution packages. This
12 # script belongs to the public domain and cannot be copyrighted.
14 # (Note: this Configure script was generated automatically. Rather than
15 # working with this copy of Configure, you may wish to get metaconfig.
16 # The dist-3.0 package (which contains metaconfig) was posted in
17 # comp.sources.misc and is available on CPAN under authors/id/RAM so
18 # you may fetch it yourself from your nearest archive site.)
21 # Though this script was generated by metaconfig, it is OK to send
22 # patches against it. It's up to the Configure pumpkin to backport
23 # the patch to the metaunits if it is accepted.
24 # See Porting/pumpkin.pod for more information on metaconfig.
27 # $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $
29 # Generated on Mon Oct 8 10:22:27 CEST 2007 [metaconfig 3.0 PL70]
30 # (with additional metaconfig patches by perlbug@perl.org)
35 SCO csh still thinks true is false. Write to SCO today and tell them that next
36 year Configure ought to "rm /bin/csh" unless they fix their blasted shell. :-)
38 (Actually, Configure ought to just patch csh in place. Hmm. Hmmmmm. All
39 we'd have to do is go in and swap the && and || tokens, wherever they are.)
41 [End of diatribe. We now return you to your regularly scheduled programming...]
45 OOPS! You naughty creature! You didn't run Configure with sh!
46 I will attempt to remedy the situation by running sh for you...
50 true || exec sh $0 $argv:q
52 (exit $?0) || cat c2$$
53 (exit $?0) || exec sh $0 $argv:q
56 if test -f /dev/cputype -a -f /dev/drivers -a -f /dev/osversion; then
59 *** I'm sorry but this system looks like Plan 9 and Plan 9 doesn't do
60 *** Configure that well. (Plan 9 is close to UNIX but not close enough.)
61 *** Please read the README.plan9 for further instructions.
62 *** Cannot continue, aborting.
68 if test ! -c /dev/null ; then
71 *** I'm sorry, but /dev/null appears to be a file rather than a device.
72 *** Please consult your operating sytem's notes for making a device
74 *** Cannot continue, aborting.
80 : compute my invocation name
84 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
89 : Proper separator for the PATH environment variable
91 : On OS/2 this directory should exist if this is not floppy only system :-]
92 if test -d c:/. || ( uname -a | grep -i 'os\(/\|\)2' ) 2>&1 >/dev/null ; then
93 if test -n "$OS2_SHELL"; then
95 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
96 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
98 elif test -n "$DJGPP"; then
99 case "X${MACHTYPE:-nonesuchmach}" in
106 : Proper PATH setting
107 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
108 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
109 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
110 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
111 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
112 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /opt/ansic/bin /usr/ccs/bin"
113 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
114 paths="$paths /sbin /usr/sbin /usr/libexec"
115 paths="$paths /system/gnu_library/bin"
119 case "$p_$PATH$p_" in
121 *) test -d $p && PATH=$PATH$p_$p ;;
128 : shall we be using ksh?
134 if (PATH=.; alias -x) >/dev/null 2>&1; then
137 if test -f /hp-ux -a -f /bin/ksh; then
138 needksh='to avoid sh bug in "here document" expansion'
140 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
141 if test X`/usr/bin/uname -v` = X4; then
142 avoidksh="to avoid AIX 4's /bin/sh"
146 if test -f /osf_boot -a -f /usr/sbin/setld; then
147 if test X`/usr/bin/uname -s` = XOSF1; then
148 avoidksh="to avoid Digital UNIX' ksh"
150 unset BIN_SH # if this is 'xpg4' sh will start up ksh
153 case "$inksh/$needksh" in
160 case "$inksh/$avoidksh" in
166 case "$inksh/$needksh-$avoidksh-" in
169 (I see you are using the Korn shell. Some ksh's blow up on $me,
170 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
177 echo "(Feeding myself to $newsh $reason.)"
179 Configure|*/Configure) exec $newsh $0 "$@";;
180 *) exec $newsh Configure "$@";;
184 test -x "${newsh}" || unset newsh
186 : if needed set CDPATH to a harmless value that is not chatty
187 : avoid bash 2.02 problems with empty CDPATH.
191 *bash*) CDPATH='.' ;;
196 : Configure runs within the UU subdirectory
197 test -d UU || mkdir UU
336 initialinstalllocation=''
363 d_attribute_format=''
364 d_attribute_malloc=''
365 d_attribute_nonnull=''
366 d_attribute_noreturn=''
368 d_attribute_unused=''
369 d_attribute_warn_unused_result=''
370 d_printf_format_null=''
373 d_builtin_choose_expr=''
376 d_c99_variadic_macros=''
423 endhostent_r_proto=''
429 endprotoent_r_proto=''
435 endservent_r_proto=''
487 gethostbyaddr_r_proto=''
489 gethostbyname_r_proto=''
491 gethostent_r_proto=''
503 getnetbyaddr_r_proto=''
505 getnetbyname_r_proto=''
519 d_getprotobyname_r=''
520 getprotobyname_r_proto=''
521 d_getprotobynumber_r=''
522 getprotobynumber_r_proto=''
524 getprotoent_r_proto=''
536 getservbyname_r_proto=''
538 getservbyport_r_proto=''
540 getservent_r_proto=''
564 d_libm_lib_version=''
567 d_localtime_r_needs_tzset=''
578 d_malloc_good_size=''
620 d_old_pthread_create_joinable=''
621 old_pthread_create_joinable=''
623 d_pthread_attr_setscope=''
662 sethostent_r_proto=''
679 setprotoent_r_proto=''
691 setservent_r_proto=''
725 d_sprintf_returns_strlen=''
740 d_stdio_ptr_lval_nochange_cnt=''
741 d_stdio_ptr_lval_sets_cnt=''
945 d_inc_version_list=''
947 inc_version_list_init=''
966 ignore_versioned_solibs=''
1030 d_perl_otherlibdirs=''
1038 api_versionstring=''
1044 version_patchlevel_string=''
1048 d_nv_preserves_uv=''
1049 d_nv_zero_is_allbits_zero=''
1060 nv_preserves_uv_bits=''
1132 installsitehtml1dir=''
1135 installsitehtml3dir=''
1142 installsiteman1dir=''
1145 installsiteman3dir=''
1150 installsitescript=''
1165 d_stdio_stream_array=''
1166 stdio_stream_array=''
1177 ccflags_uselargefiles=''
1178 ldflags_uselargefiles=''
1179 libswanted_uselargefiles=''
1199 installvendorarch=''
1206 installvendorhtml1dir=''
1208 vendorhtml1direxp=''
1209 installvendorhtml3dir=''
1211 vendorhtml3direxp=''
1217 installvendorman1dir=''
1220 installvendorman3dir=''
1227 installvendorscript=''
1239 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1242 : We must find out about Eunice early
1244 if test -f /etc/unixtovms; then
1245 eunicefix=/etc/unixtovms
1247 if test -f /etc/unixtovms.exe; then
1248 eunicefix=/etc/unixtovms.exe
1251 : Set executable suffix now -- needed before hints available
1252 if test -f "/libs/version.library"; then
1255 elif test -f "/system/gnu_library/bin/ar.pm"; then
1258 elif test -n "$DJGPP"; then
1261 elif test -d c:/. -o -n "$is_os2" ; then
1267 : Trailing extension. Override this in a hint file, if needed.
1268 : Extra object files, if any, needed on this platform.
1273 : change the next line if compiling for Xenix/286 on Xenix/386
1274 xlibpth='/usr/lib/386 /lib/386'
1275 : Possible local library directories to search.
1276 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1277 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1279 : general looking path for locating libraries
1280 glibpth="/lib /usr/lib $xlibpth"
1281 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1282 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1283 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1284 test -d /usr/lib64 && glibpth="$glibpth /lib64 /usr/lib64 /usr/local/lib64"
1286 : Private path used by Configure to find libraries. Its value
1287 : is prepended to libpth. This variable takes care of special
1288 : machines, like the mips. Usually, it should be empty.
1291 : default library list
1293 : some systems want to use only the non-versioned libso:s
1294 ignore_versioned_solibs=''
1298 : set usethreads on the Configure command line to enable threads.
1299 usereentrant='undef'
1300 : full support for void wanted by default
1303 : Possible local include directories to search.
1304 : Set locincpth to "" in a hint file to defeat local include searches.
1305 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1306 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1308 : no include file wanted by default
1311 : Enable -DEBUGGING and -DDEBUGGING from the command line
1318 : set useposix=false in your hint file to disable the POSIX extension.
1320 : set useopcode=false in your hint file to disable the Opcode extension.
1323 ccflags_uselargefiles=''
1324 ldflags_uselargefiles=''
1325 libswanted_uselargefiles=''
1326 : set usemultiplicity on the Configure command line to enable multiplicity.
1327 : set usesocks on the Configure command line to enable socks.
1328 : List of libraries we want.
1329 : If anyone needs extra -lxxx, put those in a hint file.
1330 libswanted="sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun"
1331 libswanted="$libswanted m crypt sec util c cposix posix ucb bsd BSD"
1332 : We probably want to search /usr/shlib before most other libraries.
1333 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1334 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1335 glibpth="/usr/shlib $glibpth"
1336 : Do not use vfork unless overridden by a hint file.
1339 : Find the basic shell for Bourne shell scripts
1343 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1346 if test -f "$xxx"; then
1349 : Build up a list and do a single loop so we can 'break' out.
1350 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1351 for xxx in sh bash ksh pdksh ash; do
1353 try="$try ${p}/${xxx}"
1357 if test -f "$xxx"; then
1360 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1363 elif test -f "$xxx.exe"; then
1374 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1376 Usually it's in /bin/sh. How did you even get this far?
1377 Please contact me (Perl Maintainers) at perlbug@perl.org and
1378 we'll try to straighten this all out.
1384 : see if sh knows # comments
1385 if `$sh -c '#' >/dev/null 2>&1`; then
1389 test -f $xcat$_exe || xcat=/usr/bin/cat
1390 if test ! -f $xcat$_exe; then
1391 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1392 if test -f $p/cat$_exe; then
1397 if test ! -f $xcat$_exe; then
1398 echo "Can't find cat anywhere!"
1402 echo "#!$xcat" >sharp
1406 if test -s today; then
1409 echo "#! $xcat" > sharp
1413 if test -s today; then
1421 echo "Your $sh doesn't grok # comments--I will strip them later on."
1424 echo "exec grep -v '^[ ]*#'" >spitshell
1426 $eunicefix spitshell
1427 spitshell=`pwd`/spitshell
1429 echo "I presume that if # doesn't work, #! won't work either!"
1434 : figure out how to guarantee sh startup
1436 '') startsh=${sharpbang}${sh} ;;
1448 : echo "Yup, it does."
1450 echo "Hmm... '$startsh' does not guarantee sh startup..."
1451 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1456 : Save command line options in file UU/cmdline.opt for later use in
1457 : generating config.sh.
1458 cat > cmdline.opt <<EOSH
1459 # Configure command line arguments.
1468 cat >>cmdline.opt <<EOSH
1469 config_arg$argn='$arg'
1471 # Extreme backslashitis: replace each ' by '"'"'
1472 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1475 arg_exp=`cat cmdl.opt`
1476 args_exp="$args_exp$args_sep'$arg_exp'"
1477 argn=`expr $argn + 1`
1480 # args_exp is good for restarting self: eval "set X $args_exp"; shift; $0 "$@"
1481 # used by ./hints/os2.sh
1484 : produce awk script to parse command line options
1485 cat >options.awk <<'EOF'
1487 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1489 len = length(optstr);
1490 for (i = 1; i <= len; i++) {
1491 c = substr(optstr, i, 1);
1492 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1503 if (substr(str, 1, 1) != "-") {
1504 printf("'%s'\n", str);
1508 for (i = 2; i <= len; i++) {
1509 c = substr(str, i, 1);
1511 printf("-%s\n", substr(str, i));
1517 printf("'%s'\n", substr(str, i + 1));
1530 : process the command line options
1531 set X `for arg in "$@"; do echo "X$arg"; done |
1532 sed -e s/X// | awk -f options.awk`
1537 : set up default values
1547 rm -f optdef.sh posthint.sh
1548 cat >optdef.sh <<EOS
1554 while test $# -gt 0; do
1556 -d) shift; fastread=yes;;
1557 -e) shift; alldone=cont;;
1561 if test -r "$1"; then
1564 echo "$me: cannot read config file $1." >&2
1570 -h) shift; error=true;;
1571 -r) shift; reuseval=true;;
1572 -s) shift; silent=true; realsilent=true;;
1573 -E) shift; alldone=exit;;
1574 -K) shift; knowitall=true;;
1575 -O) shift; override=true;;
1576 -S) shift; silent=true; extractsh=true;;
1581 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1582 echo "$me: ignoring -D $1" >&2
1585 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1586 *) echo "$1='define'" >> optdef.sh;;
1593 *=) echo "$1" >> optdef.sh;;
1595 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1596 echo "$me: ignoring -U $1" >&2
1598 *) echo "$1='undef'" >> optdef.sh;;
1609 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1613 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1614 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1620 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1621 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1622 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1623 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1624 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1625 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1631 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1633 echo "$yyy=''" >> posthint.sh ;;
1638 echo "$yyy='$zzz'" >> posthint.sh ;;
1640 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1642 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1647 echo "$yyy=$zzz" >> posthint.sh ;;
1648 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1652 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1655 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1663 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1664 [-U symbol] [-U symbol=] [-A command:symbol...]
1665 -d : use defaults for all answers.
1666 -e : go on without questioning past the production of config.sh.
1667 -f : specify an alternate default configuration file.
1668 -h : print this help message and exit (with an error status).
1669 -r : reuse C symbols value if possible (skips costly nm extraction).
1670 -s : silent mode, only echoes questions and essential information.
1671 -D : define symbol to have some value:
1672 -D symbol symbol gets the value 'define'
1673 -D symbol=value symbol gets the value 'value'
1674 common used examples (see INSTALL for more info):
1675 -Duse64bitint use 64bit integers
1676 -Duse64bitall use 64bit integers and pointers
1677 -Dusethreads use thread support
1678 -Dinc_version_list=none do not include older perl trees in @INC
1679 -DEBUGGING=none DEBUGGING options
1680 -Dcc=gcc choose your compiler
1681 -Dprefix=/opt/perl5 choose your destination
1682 -E : stop at the end of questions, after having produced config.sh.
1683 -K : do not use unless you know what you are doing.
1684 -O : let -D and -U override definitions from loaded configuration file.
1685 -S : perform variable substitutions on all .SH files (can mix with -f)
1686 -U : undefine symbol:
1687 -U symbol symbol gets the value 'undef'
1688 -U symbol= symbol gets completely empty
1690 -A : manipulate symbol after the platform specific hints have been applied:
1691 -A append:symbol=value append value to symbol
1692 -A symbol=value like append:, but with a separating space
1693 -A define:symbol=value define symbol to have value
1694 -A clear:symbol define symbol to be ''
1695 -A define:symbol define symbol to be 'define'
1696 -A eval:symbol=value define symbol to be eval of value
1697 -A prepend:symbol=value prepend value to symbol
1698 -A undef:symbol define symbol to be 'undef'
1699 -A undef:symbol= define symbol to be ''
1700 e.g.: -A prepend:libswanted='cl pthread '
1701 -A ccflags=-DSOME_MACRO
1702 -V : print version number and exit (with a zero status).
1709 case "$fastread$alldone" in
1712 case "$extractsh" in
1715 if test ! -t 0; then
1716 echo "Say 'sh Configure', not 'sh <Configure'"
1726 true) exec 1>/dev/null;;
1729 : run the defines and the undefines, if any, but leave the file out there...
1732 : create the posthint manipulation script and leave the file out there...
1737 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1738 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1739 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1740 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1741 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1744 : Some greps do not return status, grrr.
1745 echo "grimblepritz" >grimble
1746 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1748 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1754 : the following should work in any shell
1758 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1759 cat >contains <<'EOSS'
1760 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1765 : Find the path to the source tree
1768 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1772 *) src=`cd ../$src && pwd` ;;
1785 if test -f $rsrc/Configure && \
1786 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1788 : found it, so we are ok.
1791 for src in . .. ../.. ../../.. ../../../..; do
1792 if test -f ../$src/Configure && \
1793 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1804 Sorry, I can't seem to locate the source dir for $package. Please start
1805 Configure with an explicit path -- i.e. /some/path/Configure.
1813 echo "Sources for $package found in \"$src\"." >&4
1817 : script used to extract .SH files with variable substitutions
1818 cat >extract <<'EOS'
1820 echo "Doing variable substitutions on .SH files..."
1821 if test -f MANIFEST; then
1822 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1824 echo "(Looking for .SH files under the source directory.)"
1825 set x `(cd "$src"; find . -name "*.SH" -print)`
1829 0) set x `(cd "$src"; echo *.SH)`; shift;;
1831 if test ! -f "$src/$1"; then
1837 while test $name; do
1838 if test ! -d "$name"; then
1839 create="$name $create";
1840 name=`echo $name | sed -e "s|^[^/]*$||"`;
1841 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1846 for file in $create; do
1855 dir=`expr X$file : 'X\(.*\)/'`
1856 file=`expr X$file : 'X.*/\(.*\)'`
1857 (cd "$dir" && . ./$file)
1867 dir=`expr X$file : 'X\(.*\)/'`
1868 file=`expr X$file : 'X.*/\(.*\)'`
1869 (set x $dir; shift; eval $mkdir_p)
1870 sh <"$src/$dir/$file"
1879 if test -f "$src/config_h.SH"; then
1880 if test ! -f config.h; then
1881 : oops, they left it out of MANIFEST, probably, so do it anyway.
1882 . "$src/config_h.SH"
1887 : extract files and exit if asked to do so
1888 case "$extractsh" in
1890 case "$realsilent" in
1894 case "$config_sh" in
1895 '') config_sh='config.sh';;
1898 echo "Fetching answers from $config_sh..."
1901 test "$override" && . ./optdef.sh
1905 echo "Extraction done."
1910 : Eunice requires " " instead of "", can you believe it
1913 echo "Beginning of configuration questions for $package."
1915 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1917 : first determine how to suppress newline on echo command
1919 echo "Checking echo to see how to suppress newlines..."
1920 (echo "hi there\c" ; echo " ") >.echotmp
1921 if $contains c .echotmp >/dev/null 2>&1 ; then
1932 echo $n "The star should be here-->$c"
1936 : Now test for existence of everything in MANIFEST
1938 if test -f "$rsrc/MANIFEST"; then
1939 echo "First let's make sure your kit is complete. Checking..." >&4
1940 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | (split -l 50 2>/dev/null || split -50)
1943 for filelist in x??; do
1944 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` >/dev/null 2>>"$tmppwd/missing")
1946 if test -s missing; then
1950 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1952 You have the option of continuing the configuration process, despite the
1953 distinct possibility that your kit is damaged, by typing 'y'es. If you
1954 do, don't blame me if something goes wrong. I advise you to type 'n'o
1955 and contact the author (perlbug@perl.org).
1958 echo $n "Continue? [n] $c" >&4
1962 echo "Continuing..." >&4
1966 echo "ABORTING..." >&4
1971 echo "Looks good..."
1974 echo "There is no MANIFEST file. I hope your kit is complete !"
1979 : Find the appropriate value for a newline for tr
1980 if test -n "$DJGPP"; then
1983 if test X"$trnl" = X; then
1984 case "`echo foo|tr '\n' x 2>/dev/null`" in
1988 if test X"$trnl" = X; then
1989 case "`echo foo|tr '\012' x 2>/dev/null`" in
1990 foox) trnl='\012' ;;
1993 if test X"$trnl" = X; then
1994 case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
1995 fooxy) trnl='\n\r' ;;
1998 if test X"$trnl" = X; then
2001 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
2007 : compute the number of columns on the terminal for proper question formatting
2012 : set up the echo used in my read
2013 myecho="case \"\$xxxm\" in
2014 '') echo $n \"\$rp $c\" >&4;;
2016 '') echo $n \"[\$xxxm] $c\";;
2018 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
2020 echo $n \"[\$xxxm] $c\" >&4
2022 echo $n \"\$rp [\$xxxm] $c\" >&4
2028 : now set up to do reads with possible shell escape and default assignment
2034 case "\$fastread" in
2035 yes) case "\$dflt" in
2038 case "\$silent-\$rp" in
2043 *) case "\$silent" in
2044 true) case "\$rp" in
2049 while expr "X\$ans" : "X!" >/dev/null; do
2053 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2061 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2070 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2075 echo "(OK, I'll run with -d after this question.)" >&4
2078 echo "*** Sorry, \$1 not supported yet." >&4
2088 echo "*** Substitution done -- please confirm."
2090 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2095 echo "*** Error -- try again."
2102 case "\$ans\$xxxm\$nostick" in
2114 : create .config dir to save info across Configure sessions
2115 test -d ../.config || mkdir ../.config
2116 cat >../.config/README <<EOF
2117 This directory created by Configure to save information that should
2118 persist across sessions for $package.
2120 You may safely delete it if you wish.
2123 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2125 $define|true|[yY]*) ;;
2126 *) case "$xversion" in
2129 *** WHOA THERE!!! ***
2131 This is an UNSTABLE DEVELOPMENT release.
2132 The version of this $package distribution is $xversion, that is, odd,
2133 (as opposed to even) and that signifies a development release.
2134 If you want a maintenance release, you want an even-numbered version.
2136 Do ***NOT*** install this into production use.
2137 Data corruption and crashes are possible.
2139 It is most seriously suggested that you do not continue any further
2140 unless you want to help in developing and debugging Perl.
2142 If you *still* want to build perl, you can answer 'y' now,
2143 or pass -Dusedevel to Configure.
2146 rp='Do you really want to continue?'
2150 [yY]) echo >&4 "Okay, continuing."
2151 usedevel="$define" ;;
2152 *) echo >&4 "Okay, bye."
2162 case "$versiononly" in
2163 '') versiononly="$define" ;;
2165 case "$installusrbinperl" in
2166 '') installusrbinperl="$undef" ;;
2171 : general instructions
2174 user=`(logname) 2>/dev/null`
2176 '') user=`whoami 2>&1`;;
2178 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2181 rp='Would you like to see the instructions?'
2192 This installation shell script will examine your system and ask you questions
2193 to determine how the perl5 package should be installed. If you get
2194 stuck on a question, you may use a ! shell escape to start a subshell or
2195 execute a command. Many of the questions will have default answers in square
2196 brackets; typing carriage return will give you the default.
2198 On some of the questions which ask for file or directory names you are allowed
2199 to use the ~name construct to specify the login directory belonging to "name",
2200 even if you don't have a shell which knows about that. Questions where this is
2201 allowed will be marked "(~name ok)".
2205 dflt='Type carriage return to continue'
2209 The prompter used in this script allows you to use shell variables and
2210 backticks in your answers. You may use $1, $2, etc... to refer to the words
2211 in the default answer, as if the default line was a set of arguments given to a
2212 script shell. This means you may also use $* to repeat the whole default line,
2213 so you do not have to re-type everything to add something to the default.
2215 Everytime there is a substitution, you will have to confirm. If there is an
2216 error (e.g. an unmatched backtick), the default answer will remain unchanged
2217 and you will be prompted again.
2219 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2220 the questions and use the computed defaults (or the previous answers if there
2221 was already a config.sh file). Type 'Configure -h' for a list of options.
2222 You may also start interactively and then answer '& -d' at any prompt to turn
2223 on the non-interactive behaviour for the remainder of the execution.
2229 Much effort has been expended to ensure that this shell script will run on any
2230 Unix system. If despite that it blows up on yours, your best bet is to edit
2231 Configure and run it again. If you can't run Configure for some reason,
2232 you'll have to generate a config.sh file by hand. Whatever problems you
2233 have, let me (perlbug@perl.org) know how I blew it.
2235 This installation script affects things in two ways:
2237 1) it may do direct variable substitutions on some of the files included
2239 2) it builds a config.h file for inclusion in C programs. You may edit
2240 any of these files as the need arises after running this script.
2242 If you make a mistake on a question, there is no easy way to back up to it
2243 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2244 files. Configure will offer to let you do this before it runs the SH files.
2247 dflt='Type carriage return to continue'
2249 case "$firsttime" in
2250 true) echo $user >>../.config/instruct;;
2254 : find out where common programs are
2256 echo "Locating common programs..." >&4
2269 if test -d \$dir/\$thing; then
2275 for thisthing in \$dir/\$thing; do
2276 : just loop through to pick last item
2278 if test -f \$thisthing; then
2281 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2284 elif test -f \$dir/\$thing.exe; then
2285 if test -n "$DJGPP"; then
2286 echo \$dir/\$thing.exe
2287 elif test "$eunicefix" != ":"; then
2288 : on Eunice apparently
2342 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2343 pth="$pth /lib /usr/lib"
2344 for file in $loclist; do
2348 if test -f "$xxx"; then
2351 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2352 xxx=`./loc $file $file $pth`
2355 '') xxx=`./loc $file $file $pth`;;
2356 *) xxx=`./loc $xxx $xxx $pth`;;
2358 eval $file=$xxx$_exe
2362 echo $file is in $xxx.
2365 echo $file is in $xxx.
2368 echo "I don't know where '$file' is, and my life depends on it." >&4
2369 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2375 echo "Don't worry if any of the following aren't found..."
2377 for file in $trylist; do
2381 if test -f "$xxx"; then
2384 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2385 xxx=`./loc $file $file $pth`
2388 '') xxx=`./loc $file $file $pth`;;
2389 *) xxx=`./loc $xxx $xxx $pth`;;
2391 eval $file=$xxx$_exe
2395 echo $file is in $xxx.
2398 echo $file is in $xxx.
2401 echo "I don't see $file out there, $say."
2408 echo "Substituting grep for egrep."
2415 echo "Substituting cp for ln."
2424 echo "I can't find make or gmake, and my life depends on it." >&4
2425 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2433 *) # We can't have osname yet.
2434 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2435 # Assume that gmake, if found, is definitely GNU make
2436 # and prefer it over the system make.
2437 echo "Substituting gmake for make."
2445 echo "Hopefully test is built into your sh."
2448 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2449 echo "Using the test built into your sh."
2457 echo "Hopefully echo is built into your sh."
2462 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2463 $echo $n "hi there$c" >foo1
2464 echo $n "hi there$c" >foo2
2465 if cmp foo1 foo2 >/dev/null 2>&1; then
2466 echo "They are compatible. In fact, they may be identical."
2473 They are not compatible! You are probably running ksh on a non-USG system.
2474 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2475 have echo built in and we may have to run some Bourne shell scripts. That
2476 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2479 $echo $n "The star should be here-->$c"
2486 # This question was auctioned at YAPC::Europe-2007 in Vienna
2487 # I never promised you could answer it. I only auctioned the question.
2489 The following message is sponsored by
2491 Dresden.pm<--The stars should be here.
2493 Dear Perl user, system administrator or package
2494 maintainer, the Perl community sends greetings to
2495 you. Do you (emblematical) greet back [Y/n]? n
2502 cat <<'EOSC' >>trygcc
2507 int main(int argc, char *argv[]) {
2511 if $cc -o try $ccflags $ldflags try.c; then
2514 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2520 # Skip this test because it gives a false match on output like:
2521 # ./trygcc: line 23: cc: command not found
2522 # case "`$cc -v -c try.c 2>&1`" in
2523 # *gcc*) trygcc=no ;;
2525 if $test X"$trygcc" = Xyes; then
2526 if gcc -o try -c try.c; then
2528 echo "You seem to have a working gcc, though." >&4
2529 # Switching compilers may undo the work of hints files.
2530 # The most common problem is -D_REENTRANT for threads.
2531 # This heuristic catches that case, but gets false positives
2532 # if -Dusethreads was not actually specified. Better to
2533 # bail out here with a useful message than fail
2534 # mysteriously later. Should we perhaps just try to
2535 # re-invoke Configure -Dcc=gcc config_args ?
2536 if $test -f usethreads.cbu; then
2539 *** However, any setting of the C compiler flags (e.g. for thread support)
2540 *** will be lost. It may be necessary for you to restart Configure and
2541 *** add -Dcc=gcc to your Configure command line.
2544 rp="Would you like to go ahead and try gcc anyway?"
2547 rp="Would you like to use it?"
2550 if $test -f myread; then
2553 if $test -f UU/myread; then
2556 echo "Cannot find myread, sorry. Aborting." >&2
2561 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2574 cat <<'EOSC' >>checkcc
2579 int main(int argc, char *argv[]) {
2583 if $cc -o try $ccflags $ldflags try.c; then
2586 if $test X"$despair" = Xyes; then
2587 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2590 You need to find a working C compiler.
2591 Either (purchase and) install the C compiler supplied by your OS vendor,
2592 or for a free C compiler try http://gcc.gnu.org/
2593 I cannot continue any further, aborting.
2602 : determine whether symbolic links are supported
2605 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2606 echo "Symbolic links are supported." >&4
2609 echo "Symbolic links are NOT supported." >&4
2614 : determine whether symbolic links are supported
2618 echo "Checking how to test for symbolic links..." >&4
2620 if $test "X$issymlink" = X; then
2622 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2623 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2625 if test $? = 0; then
2628 echo "Your builtin 'test -h' may be broken." >&4
2631 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2634 if test -f "$p/$test"; then
2643 echo "Trying external '$test -h'." >&4
2644 issymlink="$test -h"
2645 if $test ! -h sym >/dev/null 2>&1; then
2646 echo "External '$test -h' is broken, too." >&4
2654 if $test "X$issymlink" = X; then
2655 if $test -L sym 2>/dev/null; then
2656 issymlink="$test -L"
2657 echo "The builtin '$test -L' worked." >&4
2660 if $test "X$issymlink" != X; then
2661 echo "You can test for symbolic links with '$issymlink'." >&4
2663 echo "I do not know how you can test for symbolic links." >&4
2667 *) echo "No symbolic links, so not testing for their testing..." >&4
2673 case "$mksymlinks" in
2676 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2679 *) case "$lns:$issymlink" in
2680 *"ln"*" -s:"*"test -"?)
2681 echo "Creating the symbolic links..." >&4
2682 echo "(First creating the subdirectories...)" >&4
2684 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2686 test -z "$directory" && break
2690 if test ! -d t/base; then
2691 echo "Failed to create the subdirectories. Aborting." >&4
2694 echo "(Then creating the symlinks...)" >&4
2695 awk '{print $1}' $src/MANIFEST | while true; do
2697 test -z "$filename" && break
2698 if test -f $filename; then
2699 if $issymlink $filename; then
2703 if test -f $filename; then
2704 echo "$filename already exists, not symlinking."
2706 ln -s $src/$filename $filename
2710 if test ! -f t/base/lex.t; then
2711 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2716 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2725 case "$usecrosscompile" in
2727 $echo "Cross-compiling..."
2730 *-*-gcc) # A cross-compiling gcc, probably.
2731 targetarch=`$echo $cc|$sed 's/-gcc$//'`
2733 # leave out ld, choosing it is more complex
2735 ranlib=$targetarch-ranlib
2736 $echo 'extern int foo;' > try.c
2737 set X `$cc -v -E try.c 2>&1 | $awk '/^#include </,/^End of search /'|$grep '/include'`
2739 if $test $# -gt 0; then
2741 incpth="`$echo $incpth|$sed 's/^ //'`"
2742 echo "Guessing incpth '$incpth'." >&4
2744 j="`$echo $i|$sed 's,/include$,/lib,'`"
2745 if $test -d $j; then
2749 libpth="`$echo $libpth|$sed 's/^ //'`"
2750 echo "Guessing libpth '$libpth'." >&4
2755 case "$targetarch" in
2756 '') echo "Targetarch not defined." >&4; croak=y ;;
2757 *) echo "Using targetarch $targetarch." >&4 ;;
2760 '') echo "Incpth not defined." >&4; croak=y ;;
2761 *) echo "Using incpth '$incpth'." >&4 ;;
2764 '') echo "Libpth not defined." >&4; croak=y ;;
2765 *) echo "Using libpth '$libpth'." >&4 ;;
2768 '') for i in $incpth; do
2769 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
2771 echo "Guessing usrinc $usrinc." >&4
2776 '') echo "Usrinc not defined." >&4; croak=y ;;
2779 *) echo "Using usrinc $usrinc." >&4 ;;
2781 case "$targethost" in
2782 '') echo "Targethost not defined." >&4; croak=y ;;
2783 *) echo "Using targethost $targethost." >&4
2788 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2791 /*) run=$src/Cross/run
2792 targetmkdir=$src/Cross/mkdir
2794 from=$src/Cross/from
2796 *) pwd=`$test -f ../Configure & cd ..; pwd`
2798 targetmkdir=$pwd/Cross/mkdir
2800 from=$pwd/Cross/from
2803 case "$targetrun" in
2804 '') targetrun=ssh ;;
2809 case "$targetfrom" in
2810 '') targetfrom=scp ;;
2814 from=$from-$targetfrom
2815 case "$targetdir" in
2817 echo "Guessing targetdir $targetdir." >&4
2820 case "$targetuser" in
2822 echo "Guessing targetuser $targetuser." >&4
2825 case "$targetfrom" in
2829 case "$targetrun" in
2841 '') cwd=$targetdir ;;
2845 if $test ! -f \$exe.xok; then
2849 $targetrun -l $targetuser $targethost "cd \$cwd && ./\$exe \$@"
2852 *) echo "Unknown targetrun '$targetrun'" >&4
2856 case "$targetmkdir" in
2858 cat >$targetmkdir <<EOF
2860 $targetrun -l $targetuser $targethost "mkdir -p \$@"
2862 $chmod a+rx $targetmkdir
2864 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
2876 $targetmkdir \`dirname \$f\`
2877 $targetto $q \$f $targetuser@$targethost:\$f || exit 1
2880 $targetmkdir $targetdir/\`dirname \$f\`
2881 $targetto $q \$f $targetuser@$targethost:$targetdir/\$f || exit 1
2894 $mkdir -p $targetdir/\`dirname \$f\`
2895 $cp \$f $targetdir/\$f || exit 1
2898 $targetmkdir $targetdir/\`dirname \$f\`
2899 $cp \$f $targetdir/\$f || exit 1
2906 *) echo "Unknown targetto '$targetto'" >&4
2910 case "$targetfrom" in
2917 $targetfrom $q $targetuser@$targethost:$targetdir/\$f . || exit 1
2922 cp) cat >$from <<EOF
2927 cp $targetdir/\$f . || exit 1
2932 *) echo "Unknown targetfrom '$targetfrom'" >&4
2936 if $test ! -f $run; then
2937 echo "Target 'run' script '$run' not found." >&4
2941 if $test ! -f $to; then
2942 echo "Target 'to' script '$to' not found." >&4
2946 if $test ! -f $from; then
2947 echo "Target 'from' script '$from' not found." >&4
2951 if $test ! -f $run -o ! -f $to -o ! -f $from; then
2955 Using '$run' for remote execution,
2956 and '$from' and '$to'
2957 for remote file transfer.
2963 usecrosscompile='undef'
2968 : see whether [:lower:] and [:upper:] are supported character classes
2970 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2972 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2976 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
2977 # (0xd9 and 0xe2), therefore that is a nice testing point.
2978 if test "X$up" = X -o "X$low" = X; then
2979 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
2985 if test "X$up" = X -o "X$low" = X; then
2986 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
2992 if test "X$up" = X -o "X$low" = X; then
2993 case "`echo RS | od -x 2>/dev/null`" in
2995 echo "Hey, this might be EBCDIC." >&4
2996 if test "X$up" = X -o "X$low" = X; then
2997 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2998 rs) up='[A-IJ-RS-Z]'
3003 if test "X$up" = X -o "X$low" = X; then
3004 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
3014 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
3016 echo "Using $up and $low to convert case." >&4
3019 echo "I don't know how to translate letters from upper to lower case." >&4
3020 echo "Your tr is not acting any way I know of." >&4
3024 : set up the translation script tr, must be called with ./tr of course
3028 '[A-Z][a-z]') exec $tr '$up' '$low';;
3029 '[a-z][A-Z]') exec $tr '$low' '$up';;
3036 : Try to determine whether config.sh was made on this system
3037 case "$config_sh" in
3039 myuname=`$uname -a 2>/dev/null`
3040 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
3041 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
3042 # because the A-Z/a-z are not consecutive.
3043 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e "s,['/],,g" | \
3044 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
3045 newmyuname="$myuname"
3047 case "$knowitall" in
3049 if test -f ../config.sh; then
3050 if $contains myuname= ../config.sh >/dev/null 2>&1; then
3051 eval "`grep myuname= ../config.sh`"
3053 if test "X$myuname" = "X$newmyuname"; then
3061 : Get old answers from old config file if Configure was run on the
3062 : same system, otherwise use the hints.
3065 if test -f config.sh; then
3067 rp="I see a config.sh file. Shall I use it to set the defaults?"
3070 n*|N*) echo "OK, I'll ignore it."
3071 mv config.sh config.sh.old
3072 myuname="$newmyuname"
3074 *) echo "Fetching default answers from your old config.sh file..." >&4
3082 : Older versions did not always set $sh. Catch re-use of such
3092 if test ! -f config.sh; then
3095 First time through, eh? I have some defaults handy for some systems
3096 that need some extra help getting the Configure answers right:
3099 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3101 : Half the following guesses are probably wrong... If you have better
3102 : tests or hints, please send them to perlbug@perl.org
3103 : The metaconfig authors would also appreciate a copy...
3104 $test -f /irix && osname=irix
3105 $test -f /xenix && osname=sco_xenix
3106 $test -f /dynix && osname=dynix
3107 $test -f /dnix && osname=dnix
3108 $test -f /lynx.os && osname=lynxos
3109 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3110 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3111 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3112 $test -f /bin/mips && /bin/mips && osname=mips
3113 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
3114 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
3115 $test -d /usr/apollo/bin && osname=apollo
3116 $test -f /etc/saf/_sactab && osname=svr4
3117 $test -d /usr/include/minix && osname=minix
3118 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3119 if $test -d /MachTen -o -d /MachTen_Folder; then
3121 if $test -x /sbin/version; then
3122 osvers=`/sbin/version | $awk '{print $2}' |
3123 $sed -e 's/[A-Za-z]$//'`
3124 elif $test -x /usr/etc/version; then
3125 osvers=`/usr/etc/version | $awk '{print $2}' |
3126 $sed -e 's/[A-Za-z]$//'`
3132 $test -f /sys/posix.dll &&
3133 $test -f /usr/bin/what &&
3134 set X `/usr/bin/what /sys/posix.dll` &&
3135 $test "$3" = UWIN &&
3139 if $test -f $uname; then
3147 umips) osname=umips ;;
3150 [23]100) osname=mips ;;
3151 next*) osname=next ;;
3153 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3154 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3157 elif $test -f /etc/kconfig; then
3159 if test "$lns" = "$ln -s"; then
3161 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3163 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3170 if test -n "$DJGPP"; then
3179 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3181 # oslevel can fail with:
3182 # oslevel: Unable to acquire lock.
3183 *not\ found) osvers="$4"."$3" ;;
3184 '<3240'|'<>3240') osvers=3.2.0 ;;
3185 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3186 '=3250'|'>3250') osvers=3.2.5 ;;
3190 bsd386) osname=bsd386
3193 cygwin*) osname=cygwin
3196 *dc.osx) osname=dcosx
3202 domainos) osname=apollo
3208 dragonfly) osname=dragonfly
3211 dynixptx*) osname=dynixptx
3212 osvers=`echo "$4"|sed 's/^v//'`
3214 freebsd) osname=freebsd
3216 genix) osname=genix ;;
3220 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3236 netbsd*) osname=netbsd
3239 news-os) osvers="$3"
3241 4*) osname=newsos4 ;;
3245 next*) osname=next ;;
3246 nonstop-ux) osname=nonstopux ;;
3247 openbsd) osname=openbsd
3253 POSIX-BC | posix-bc ) osname=posix-bc
3256 powerux | power_ux | powermax_os | powermaxos | \
3257 powerunix | power_unix) osname=powerux
3263 solaris) osname=solaris
3265 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3272 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3276 titanos) osname=titanos
3285 ultrix) osname=ultrix
3288 osf1|mls+) case "$5" in
3291 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3294 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3297 hp*) osname=hp_osf1 ;;
3298 mips) osname=mips_osf1 ;;
3301 # UnixWare 7.1.2 is known as Open UNIX 8
3302 openunix|unixware) osname=svr5
3310 $2) case "$osname" in
3314 : svr4.x or possibly later
3324 if test -f /stand/boot ; then
3325 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3326 if test -n "$INITPROG" -a -f "$INITPROG"; then
3327 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3328 if test -n "$isesix"; then
3336 *) if test -f /etc/systemid; then
3338 set `echo $3 | $sed 's/\./ /g'` $4
3339 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3341 elif $test -f $src/hints/sco_$1_$2.sh; then
3343 elif $test -f $src/hints/sco_$1.sh; then
3348 '') : Still unknown. Probably a generic Sys V.
3357 *) case "$osname" in
3358 '') : Still unknown. Probably a generic BSD.
3366 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3367 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3368 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3371 $rm -f UU/kernel.what
3372 elif test -d c:/. -o -n "$is_os2" ; then
3379 case "$targetarch" in
3382 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3387 : Now look for a hint file osname_osvers, unless one has been
3388 : specified already.
3391 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3392 : Also try without trailing minor version numbers.
3393 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3394 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3395 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3396 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3399 *) case "$osvers" in
3402 *) if $test -f $src/hints/$file.sh ; then
3404 elif $test -f $src/hints/$xfile.sh ; then
3406 elif $test -f $src/hints/$xxfile.sh ; then
3408 elif $test -f $src/hints/$xxxfile.sh ; then
3410 elif $test -f $src/hints/$xxxxfile.sh ; then
3412 elif $test -f "$src/hints/${osname}.sh" ; then
3421 if $test -f Policy.sh ; then
3424 none) dflt="Policy" ;;
3425 *) dflt="Policy $dflt" ;;
3430 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3434 if $test -f Policy.sh ; then
3437 There's also a Policy hint file available, which should make the
3438 site-specific (policy) questions easier to answer.
3445 You may give one or more space-separated answers, or "none" if appropriate.
3446 If you have a handcrafted Policy.sh file or a Policy.sh file generated by a
3447 previous run of Configure, you may specify it as well as or instead of
3448 OS-specific hints. If hints are provided for your OS, you should use them:
3449 although Perl can probably be built without hints on many platforms, using
3450 hints often improve performance and may enable features that Configure can't
3451 set up on its own. If there are no hints that match your OS, specify "none";
3452 DO NOT give a wrong version or a wrong OS.
3456 rp="Which of these apply, if any?"
3459 for file in $tans; do
3460 if $test X$file = XPolicy -a -f Policy.sh; then
3462 $cat Policy.sh >> UU/config.sh
3463 elif $test -f $src/hints/$file.sh; then
3464 . $src/hints/$file.sh
3465 $cat $src/hints/$file.sh >> UU/config.sh
3466 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3469 : Give one chance to correct a possible typo.
3470 echo "$file.sh does not exist"
3472 rp="hint to use instead?"
3474 for file in $ans; do
3475 if $test -f "$src/hints/$file.sh"; then
3476 . $src/hints/$file.sh
3477 $cat $src/hints/$file.sh >> UU/config.sh
3478 elif $test X$ans = X -o X$ans = Xnone ; then
3481 echo "$file.sh does not exist -- ignored."
3488 : Remember our hint file for later.
3489 if $test -f "$src/hints/$file.sh" ; then
3499 echo "Fetching default answers from $config_sh..." >&4
3503 cp $config_sh config.sh 2>/dev/null
3513 test "$override" && . ./optdef.sh
3515 : Restore computed paths
3516 for file in $loclist $trylist; do
3517 eval $file="\$_$file"
3522 Configure uses the operating system name and version to set some defaults.
3523 The default value is probably right if the name rings a bell. Otherwise,
3524 since spelling matters for me, either accept the default or answer "none"
3531 ''|' '|none) dflt=none ;;
3532 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3535 *) dflt="$osname" ;;
3537 rp="Operating system name?"
3541 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3547 ''|' '|none) dflt=none ;;
3548 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3549 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3551 ''|' ') dflt=none ;;
3556 *) dflt="$osvers" ;;
3558 rp="Operating system version?"
3568 : who configured the system
3569 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3572 cf_by=`(logname) 2>/dev/null`
3575 cf_by=`(whoami) 2>/dev/null`
3577 "") cf_by=unknown ;;
3582 : decide how portable to be. Allow command line overrides.
3583 case "$d_portable" in
3585 *) d_portable="$define" ;;
3588 : set up shell script to do ~ expansion
3594 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3597 if $test -f /bin/csh; then
3598 /bin/csh -f -c "glob \$1"
3603 name=\`$expr x\$1 : '..\([^/]*\)'\`
3604 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3605 if $test ! -d "\$dir"; then
3607 echo "\$me: can't locate home directory for: \$name" >&2
3612 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3628 : now set up to get a file name
3632 cat <<'EOSC' >>getfile
3648 : getfile will accept an answer from the comma-separated list
3649 : enclosed in parentheses even if it does not meet other criteria.
3650 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3651 fn=`echo $fn | sed 's/(.*)//'`
3657 loc_file=`expr $fn : '.*:\(.*\)'`
3658 fn=`expr $fn : '\(.*\):.*'`
3666 */*) fullpath=true;;
3675 *e*) exp_file=true;;
3678 *p*) nopath_ok=true;;
3683 *d*) type='Directory';;
3684 *l*) type='Locate';;
3689 Locate) what='File';;
3694 case "$d_portable" in
3702 while test "$type"; do
3707 true) rp="$rp (~name ok)";;
3710 if test -f UU/getfile.ok && \
3711 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3730 value=`UU/filexp $ans`
3733 if test "$ans" != "$value"; then
3734 echo "(That expands to $value on this system.)"
3748 /*) value="$ansexp" ;;
3749 [a-zA-Z]:/*) value="$ansexp" ;;
3754 echo "I shall only accept a full path name, as in /bin/ls." >&4
3755 echo "Use a ! shell escape if you wish to check pathnames." >&4
3758 echo "Please give a full path name, starting with slash." >&4
3761 echo "Note that using ~name is ok provided it expands well." >&4
3774 for fp in $gfpth; do
3775 if test "X$fp" = X.; then
3780 if test -f "$pf"; then
3782 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3784 echo "($value is not a plain file, but that's ok.)"
3787 if test X"$type" = X; then
3794 for fp in $gfpth; do
3795 if test "X$fp" = X.; then
3800 direxp="$fp/$ansexp"
3802 if test -d "$direxp"; then
3810 if test -d "$ansexp"; then
3811 echo "(Looking for $loc_file in directory $value.)"
3812 value="$value/$loc_file"
3813 ansexp="$ansexp/$loc_file"
3815 if test -f "$ansexp"; then
3818 case "$nopath_ok" in
3819 true) case "$value" in
3821 *) echo "Assuming $value will be in people's path."
3837 if test "$fastread" = yes; then
3842 rp="$what $value doesn't exist. Use that name anyway?"
3861 test "X$gfpthkeep" != Xy && gfpth=""
3864 : determine root of directory hierarchy where package will be installed.
3867 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
3870 dflt=`echo "$prefix" | sed 's/.$//'`
3878 By default, $package will be installed in $dflt/bin, manual pages
3879 under $dflt/man, etc..., i.e. with $dflt as prefix for all
3880 installation directories. Typically this is something like /usr/local.
3881 If you wish to have binaries under /usr/bin but other parts of the
3882 installation under /usr/local, that's ok: you will be prompted
3883 separately for each of the installation directories, the prefix being
3884 only used to set the defaults.
3888 rp='Installation prefix to use?'
3896 *) oldprefix="$prefix";;
3905 *) afsroot=$afsroot ;;
3911 $define|true) afs=true ;;
3912 $undef|false) afs=false ;;
3913 *) if test -d $afsroot; then
3921 echo "AFS may be running... I'll be extra cautious then..." >&4
3923 echo "AFS does not seem to be running..." >&4
3926 : determine installation prefix for where package is to be installed.
3930 Since you are running AFS, I need to distinguish the directory in which
3931 files will reside from the directory in which they are installed (and from
3932 which they are presumably copied to the former directory by occult means).
3935 case "$installprefix" in
3936 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
3937 *) dflt="$installprefix";;
3942 In some special cases, particularly when building $package for distribution,
3943 it is convenient to distinguish the directory in which files should be
3944 installed from the directory ($prefix) in which they will
3945 eventually reside. For most users, these two directories are the same.
3948 case "$installprefix" in
3950 *) dflt=$installprefix;;
3954 rp='What installation prefix should I use for installing files?'
3956 installprefix="$ans"
3957 installprefixexp="$ansexp"
3959 : Perform the prefixexp/installprefixexp correction if necessary
3960 cat <<EOS >installprefix
3963 cat <<'EOSC' >>installprefix
3964 : Change installation prefix, if necessary.
3965 if $test X"$prefix" != X"$installprefix"; then
3966 eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`"
3968 eval "install${prefixvar}=\"\$${prefixvar}exp\""
3971 chmod +x installprefix
3972 $eunicefix installprefix
3974 : Set variables such as privlib and privlibexp from the output of ./getfile
3975 : performing the prefixexp/installprefixexp correction if necessary.
3976 cat <<EOS >setprefixvar
3979 cat <<'EOSC' >>setprefixvar
3980 eval "${prefixvar}=\"\$ans\""
3981 eval "${prefixvar}exp=\"\$ansexp\""
3984 chmod +x setprefixvar
3985 $eunicefix setprefixvar
3987 : set up the script used to warn in case of inconsistency
3996 '') echo "The $hint value for \$$var on this machine was \"$was\"!" >&4
3998 *) echo "Hmm. Based on the hints in hints/$hintfile.sh, " >&4
3999 echo "the $hint value for \$$var on this machine was \"$was\"!" >&4
4004 echo "*** WHOA THERE!!! ***" >&4
4005 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
4008 rp=" Keep the $hint value?"
4011 y) td=$was; tu=$was;;
4015 : function used to set $1 to $val
4016 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
4018 $define$undef) . ./whoa; eval "$var=\$td";;
4019 $undef$define) . ./whoa; eval "$var=\$tu";;
4020 *) eval "$var=$val";;
4024 $define|true|[yY]*) dflt='y';;
4029 Perl can be built to use the SOCKS proxy protocol library. To do so,
4030 Configure must be run with -Dusesocks. If you use SOCKS you also need
4031 to use the PerlIO abstraction layer, this will be implicitly selected.
4033 If this doesn't make any sense to you, just accept the default '$dflt'.
4035 rp='Build Perl for SOCKS?'
4038 y|Y) val="$define" ;;
4045 $define|true|[yY]*) useperlio="$define";;
4048 case "$useperlio" in
4049 $define|true|[yY]*|'') dflt='y';;
4054 Previous version of $package used the standard IO mechanisms as
4055 defined in <stdio.h>. Versions 5.003_02 and later of $package allow
4056 alternate IO mechanisms via the PerlIO abstraction layer, but the
4057 stdio mechanism is still available if needed. The abstraction layer
4058 can use AT&T's sfio (if you already have sfio installed) or regular stdio.
4059 Using PerlIO with sfio may cause problems with some extension modules.
4061 If this doesn't make any sense to you, just accept the default '$dflt'.
4063 rp='Use the PerlIO abstraction layer?'
4070 echo "Ok, doing things the stdio way."
4079 case "$useperlio" in
4080 $define|true|[yY]*) ;;
4083 You are using the SOCKS proxy protocol library which means that you
4084 should also use the PerlIO layer. You may be headed for trouble.
4093 : get the patchlevel
4095 echo "Getting the current patchlevel..." >&4
4096 if $test -r $rsrc/patchlevel.h;then
4097 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
4098 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
4099 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4100 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
4101 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
4102 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4103 perl_patchlevel=`egrep ',"(MAINT|SMOKE)[0-9][0-9]*"' $rsrc/patchlevel.h|tail -1|sed 's/[^0-9]//g'`
4112 $echo "(You do not have patchlevel.h. Eek.)"
4114 if $test -r $rsrc/.patch ; then
4115 if $test "X$perl_patchlevel" = "X" || $test "`cat $rsrc/.patch`" -gt "$perl_patchlevel" ; then
4116 perl_patchlevel=`cat $rsrc/.patch`
4119 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
4120 version_patchlevel_string="version $patchlevel subversion $subversion"
4121 case "$perl_patchlevel" in
4123 *) version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel" ;;
4126 $echo "(You have $package $version_patchlevel_string.)"
4130 : XXX Should be a Configure test for double-dots in filenames.
4131 version=`echo $revision $patchlevel $subversion | \
4132 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4133 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4134 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4137 version=`echo $revision $patchlevel $subversion | \
4138 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4139 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4140 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4143 : Special case the 5.005_xx maintenance series, which used 5.005
4144 : without any subversion label as a subdirectory in $sitelib
4145 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
4146 api_versionstring='5.005'
4149 case "$usethreads" in
4150 $define|true|[yY]*) dflt='y';;
4151 *) # Catch case where user specified ithreads or 5005threads but
4152 # forgot -Dusethreads (A.D. 4/2002)
4153 case "$useithreads$use5005threads" in
4155 case "$useperlio" in
4156 "$define") dflt='y' ;;
4166 Perl can be built to take advantage of threads on some systems.
4167 To do so, Configure can be run with -Dusethreads.
4169 Note that Perl built with threading support runs slightly slower
4170 and uses more memory than plain Perl. The current implementation
4171 is believed to be stable, but it is fairly new, and so should be
4172 treated with caution.
4174 If this doesn't make any sense to you, just accept the default '$dflt'.
4176 rp='Build a threading Perl?'
4179 y|Y) val="$define" ;;
4185 if $test $patchlevel -lt 9; then
4186 case "$usethreads" in
4190 Since release 5.6, Perl has had two different threading implementations,
4191 the newer interpreter-based version (ithreads) with one interpreter per
4192 thread, and the older 5.005 version (5005threads).
4193 The 5005threads version is effectively unmaintained and will probably be
4194 removed in Perl 5.10, so there should be no need to build a Perl using it
4195 unless needed for backwards compatibility with some existing 5.005threads
4199 : Default to ithreads unless overridden on command line or with
4202 case "$use5005threads" in
4203 $define|true|[yY]*) dflt='n';;
4205 case "$useithreads" in
4206 $undef|false|[nN]*) dflt='n';;
4208 rp='Use the newer interpreter-based ithreads?'
4211 y|Y) val="$define" ;;
4216 : Now set use5005threads to the opposite value.
4217 case "$useithreads" in
4218 $define) val="$undef" ;;
4225 useithreads="$undef"
4226 use5005threads="$undef"
4230 case "$useithreads$use5005threads" in
4234 You cannot have both the ithreads and the 5.005 threads enabled
4235 at the same time. Disabling the 5.005 threads since they are
4236 much less stable than the ithreads.
4239 use5005threads="$undef"
4244 : perl-5.9.x and later
4246 if test X"$usethreads" = "X$define"; then
4247 case "$use5005threads" in
4251 5.005 threads has been removed for 5.10. Perl will be built using ithreads.
4258 use5005threads="$undef"
4259 useithreads="$usethreads"
4262 if test X"$usethreads" = "X$define" -a "X$useperlio" = "Xundef"; then
4265 *** To build with ithreads you must also use the PerlIO layer.
4266 *** Cannot continue, aborting.
4272 case "$d_oldpthreads" in
4273 '') : Configure tests would be welcome here. For now, assume undef.
4275 *) val="$d_oldpthreads" ;;
4281 : Look for a hint-file generated 'call-back-unit'. If the
4282 : user has specified that a threading perl is to be built,
4283 : we may need to set or change some other defaults.
4284 if $test -f usethreads.cbu; then
4285 echo "Your platform has some specific hints regarding threaded builds, using them..."
4288 case "$usethreads" in
4289 "$define"|true|[yY]*)
4291 (Your platform does not have any specific hints for threaded builds.
4292 Assuming POSIX threads, then.)
4300 Perl can be built so that multiple Perl interpreters can coexist
4301 within the same Perl executable.
4304 case "$useithreads" in
4307 This multiple interpreter support is required for interpreter-based threads.
4311 *) case "$usemultiplicity" in
4312 $define|true|[yY]*) dflt='y';;
4316 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
4317 rp='Build Perl for multiplicity?'
4320 y|Y) val="$define" ;;
4329 case "$usemorebits" in
4330 "$define"|true|[yY]*)
4331 use64bitint="$define"
4332 uselongdouble="$define"
4333 usemorebits="$define"
4335 *) usemorebits="$undef"
4339 : make some quick guesses about what we are up against
4341 $echo $n "Hmm... $c"
4351 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
4352 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
4354 echo "Looks kind of like an OSF/1 system, but we'll see..."
4356 elif test `echo abc | $tr a-z A-Z` = Abc ; then
4357 xxx=`./loc addbib blurfl $pth`
4358 if $test -f $xxx; then
4359 echo "Looks kind of like a USG system with BSD features, but we'll see..."
4363 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
4364 echo "Looks kind of like an extended USG system, but we'll see..."
4366 echo "Looks kind of like a USG system, but we'll see..."
4370 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
4371 echo "Looks kind of like a BSD system, but we'll see..."
4375 echo "Looks kind of like a Version 7 system, but we'll see..."
4378 case "$eunicefix" in
4381 There is, however, a strange, musty smell in the air that reminds me of
4382 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
4386 : it so happens the Eunice I know will not run shell scripts in Unix format
4390 echo "Congratulations. You aren't running Eunice."
4394 : Detect OS2. The p_ variable is set above in the Head.U unit.
4395 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
4396 : semicolon as a patch separator
4401 I have the feeling something is not exactly right, however...don't tell me...
4402 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
4403 (Or you may be running DOS with DJGPP.)
4408 if test -f /xenix; then
4409 echo "Actually, this looks more like a XENIX system..."
4414 echo "It's not Xenix..."
4419 if test -f /venix; then
4420 echo "Actually, this looks more like a VENIX system..."
4427 echo "Nor is it Venix..."
4430 chmod +x bsd usg v7 osf1 eunice xenix venix os2
4431 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
4438 rp="Use which C compiler?"
4442 : See if they have not cc but they do have gcc
4444 : Look for a hint-file generated 'call-back-unit'. Now that the
4445 : user has specified the compiler, we may need to set or change some
4447 if $test -f cc.cbu; then
4453 echo "Checking for GNU cc in disguise and/or its version number..." >&4
4457 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
4459 printf("%s\n", __VERSION__);
4461 printf("%s\n", "1");
4467 if $cc -o try $ccflags $ldflags try.c; then
4468 gccversion=`$run ./try`
4469 case "$gccversion" in
4470 '') echo "You are not using GNU cc." ;;
4471 *) echo "You are using GNU cc $gccversion."
4477 echo "*** WHOA THERE!!! ***" >&4
4478 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
4479 case "$knowitall" in
4481 echo " You'd better start hunting for one and let me know about it." >&4
4487 case "$gccversion" in
4488 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
4490 case "$gccversion" in
4491 '') gccosandvers='' ;;
4492 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
4493 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
4495 case "$gccosandvers" in
4496 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
4497 $osname$osvers) ;; # looking good
4498 $osname*) cat <<EOM >&4
4500 *** WHOA THERE!!! ***
4502 Your gcc has not been compiled for the exact release of
4503 your operating system ($gccosandvers versus $osname$osvers).
4505 In general it is a good idea to keep gcc synchronized with
4506 the operating system because otherwise serious problems
4507 may ensue when trying to compile software, like Perl.
4509 I'm trying to be optimistic here, though, and will continue.
4510 If later during the configuration and build icky compilation
4511 problems appear (headerfile conflicts being the most common
4512 manifestation), I suggest reinstalling the gcc to match
4513 your operating system release.
4517 *) gccosandvers='' ;; # failed to parse, better be silent
4525 # gcc 3.* complain about adding -Idirectories that they already know about,
4526 # so we will take those off from locincpth.
4527 case "$gccversion" in
4529 echo "main(){}">try.c
4530 for incdir in $locincpth; do
4531 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
4532 grep '^c[cp]p*[01]: warning: changing search order '`
4533 if test "X$warn" != X; then
4534 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
4540 : What should the include directory be ?
4542 $echo $n "Hmm... $c"
4546 if $test -f /bin/mips && /bin/mips; then
4547 echo "Looks like a MIPS system..."
4548 $cat >usr.c <<'EOCP'
4549 #ifdef SYSTYPE_BSD43
4553 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4554 dflt='/bsd43/usr/include'
4558 mips_type='System V'
4560 $rm -f usr.c usr.out
4561 echo "and you're compiling with the $mips_type compiler and libraries."
4565 echo "Doesn't look like a MIPS system."
4575 case "$xxx_prompt" in
4578 rp='Where are the include files you want to use?'
4586 : see how we invoke the C preprocessor
4588 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4589 cat <<'EOT' >testcpp.c
4595 if test ! -f cppstdin; then
4596 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4597 # AIX cc -E doesn't show the absolute headerfile
4598 # locations but we'll cheat by using the -M flag.
4599 echo 'cat >.$$.c; rm -f .$$.u; '"$cc"' ${1+"$@"} -M -c .$$.c 2>/dev/null; test -s .$$.u && awk '"'"'$2 ~ /\.h$/ { print "# 0 \""$2"\"" }'"'"' .$$.u; rm -f .$$.o .$$.u; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' > cppstdin
4601 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4604 echo "Keeping your $hint cppstdin wrapper."
4607 wrapper=`pwd`/cppstdin
4611 if $test "X$cppstdin" != "X" && \
4612 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4613 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4615 echo "You used to use $cppstdin $cppminus so we'll use that again."
4617 '') echo "But let's see if we can live without a wrapper..." ;;
4619 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4620 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4622 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4625 echo "(However, $cpprun $cpplast does not work, let's see...)"
4633 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4640 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4641 $cc -E <testcpp.c >testcpp.out 2>&1; \
4642 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4643 echo "Yup, it does."
4646 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4647 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4648 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4649 echo "Yup, it does."
4652 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4653 $cc -P <testcpp.c >testcpp.out 2>&1; \
4654 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4655 echo "Yipee, that works!"
4658 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4659 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4660 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4661 echo "At long last!"
4664 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4665 $cpp <testcpp.c >testcpp.out 2>&1; \
4666 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4670 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4671 $cpp - <testcpp.c >testcpp.out 2>&1; \
4672 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4673 echo "Hooray, it works! I was beginning to wonder."
4676 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4677 $wrapper <testcpp.c >testcpp.out 2>&1; \
4678 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4684 rp="No dice. I can't find a C preprocessor. Name one:"
4688 $x_cpp <testcpp.c >testcpp.out 2>&1
4689 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4690 echo "OK, that will do." >&4
4692 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4707 echo "Perhaps can we force $cc -E using a wrapper..."
4708 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4709 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4715 echo "Nope, we'll have to live without it..."
4729 "$wrapper"|'cppstdin') ;;
4730 *) $rm -f $wrapper;;
4732 $rm -f testcpp.c testcpp.out
4734 : Set private lib path
4737 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4742 '') dlist="$loclibpth $plibpth $glibpth";;
4743 *) dlist="$libpth";;
4746 : Now check and see which directories actually exist, avoiding duplicates
4750 if $test -d $xxx; then
4753 *) libpth="$libpth $xxx";;
4759 Some systems have incompatible or broken versions of libraries. Among
4760 the directories listed in the question below, please remove any you
4761 know not to be holding relevant libraries, and add any that are needed.
4762 Say "none" for none.
4773 rp="Directories to use for library searches?"
4780 : compute shared library extension
4783 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4793 On some systems, shared libraries may be available. Answer 'none' if
4794 you want to suppress searching of shared libraries for the remainder
4795 of this configuration.
4798 rp='What is the file extension used for shared libraries?'
4802 : Define several unixisms.
4803 : Hints files or command line option can be used to override them.
4804 : The convoluted testing is in case hints files set either the old
4807 '') case "$exe_ext" in
4809 *) _exe="$exe_ext" ;;
4814 '') case "$lib_ext" in
4821 '') case "$obj_ext" in
4828 '') case "$path_sep" in
4839 rm_try="$rm -f try try$_exe a.out .out try.[cho] try.$_o core core.try* try.core*"
4841 : Which makefile gets called first. This is used by make depend.
4842 case "$firstmakefile" in
4843 '') firstmakefile='makefile';;
4847 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
4850 case "$uselongdouble" in
4851 $define|true|[yY]*) dflt='y';;
4856 Perl can be built to take advantage of long doubles which
4857 (if available) may give more accuracy and range for floating point numbers.
4859 If this doesn't make any sense to you, just accept the default '$dflt'.
4861 rp='Try to use long doubles if available?'
4864 y|Y) val="$define" ;;
4870 case "$uselongdouble" in
4871 true|[yY]*) uselongdouble="$define" ;;
4874 : Look for a hint-file generated 'call-back-unit'. If the
4875 : user has specified that long doubles should be used,
4876 : we may need to set or change some other defaults.
4877 if $test -f uselongdouble.cbu; then
4878 echo "Your platform has some specific hints regarding long doubles, using them..."
4879 . ./uselongdouble.cbu
4881 case "$uselongdouble" in
4884 (Your platform does not have any specific hints for long doubles.)
4890 : Looking for optional libraries
4892 echo "Checking for optional libraries..." >&4
4897 case "$libswanted" in
4898 '') libswanted='c_s';;
4901 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
4907 for thisdir in $libpth $xlibpth; do
4908 test -d $thisdir && libspath="$libspath $thisdir"
4910 for thislib in $libswanted; do
4911 for thisdir in $libspath; do
4913 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4914 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
4915 $test -f "$xxx" && eval $libscheck
4916 $test -f "$xxx" && libstyle=shared
4918 if test ! -f "$xxx"; then
4919 xxx=$thisdir/lib$thislib.$so
4920 $test -f "$xxx" && eval $libscheck
4921 $test -f "$xxx" && libstyle=shared
4923 if test ! -f "$xxx"; then
4924 xxx=$thisdir/lib$thislib$_a
4925 $test -f "$xxx" && eval $libscheck
4926 $test -f "$xxx" && libstyle=static
4928 if test ! -f "$xxx"; then
4929 xxx=$thisdir/$thislib$_a
4930 $test -f "$xxx" && eval $libscheck
4931 $test -f "$xxx" && libstyle=static
4933 if test ! -f "$xxx"; then
4934 xxx=$thisdir/lib${thislib}_s$_a
4935 $test -f "$xxx" && eval $libscheck
4936 $test -f "$xxx" && libstyle=static
4937 $test -f "$xxx" && thislib=${thislib}_s
4939 if test ! -f "$xxx"; then
4940 xxx=$thisdir/Slib$thislib$_a
4941 $test -f "$xxx" && eval $libscheck
4942 $test -f "$xxx" && libstyle=static
4944 if $test -f "$xxx"; then
4946 shared) echo "Found -l$thislib (shared)." ;;
4947 static) echo "Found -l$thislib." ;;
4948 *) echo "Found -l$thislib ($libstyle)." ;;
4952 *) dflt="$dflt -l$thislib"
4953 libsfound="$libsfound $xxx"
4955 libsfiles="$libsfiles $yyy"
4956 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
4957 case " $libsdirs " in
4959 *) libsdirs="$libsdirs $yyy" ;;
4966 if $test ! -f "$xxx"; then
4967 echo "No -l$thislib."
4978 ' '|'') dflt='none';;
4983 In order to compile $package on your machine, a number of libraries
4984 are usually needed. Include any other special libraries here as well.
4985 Say "none" for none. The default list is almost always right.
4989 rp="What libraries to use?"
4996 : determine optimization, if desired, or use for debug flag also
4998 ' '|$undef) dflt='none';;
5000 *) dflt="$optimize";;
5004 By default, $package compiles with the -O flag to use the optimizer.
5005 Alternately, you might want to use the symbolic debugger, which uses
5006 the -g flag (on traditional Unix systems). Either flag can be
5007 specified here. To use neither flag, specify the word "none".
5010 rp="What optimizer/debugger flag should be used?"
5014 'none') optimize=" ";;
5017 : Check what DEBUGGING is required from the command line
5018 : -DEBUGGING or -DDEBUGGING or
5019 : -DEBUGGING=both = -g + -DDEBUGGING
5020 : -DEBUGGING=-g or -Doptimize=-g = -g
5021 : -DEBUGGING=none or -UDEBUGGING =
5022 : -DEBUGGING=old or -DEBUGGING=default = ? $optimize
5025 *) DEBUGGING=$EBUGGING ;;
5028 case "$DEBUGGING" in
5032 *) optimize="$optimize -g" ;;
5036 *-g*) set `echo "X $optimize " | sed 's/ -g / /'`
5044 case "$DEBUGGING" in
5045 both|$define) dflt='-DDEBUGGING'
5048 : argument order is deliberate, as the flag will start with - which set could
5049 : think is an option
5050 checkccflag='check=$1; flag=$2; callback=$3;
5052 echo "Checking if your compiler accepts $flag" 2>&1;
5053 echo "int main(void) { return 0; }" > gcctest.c;
5054 if $cc -O2 $flag -o gcctest gcctest.c && ./gcctest; then
5055 echo "Yes, it does." 2>&1;
5058 echo "Leaving current flags $ccflags alone." 2>&1
5060 *) dflt="$dflt $flag";
5065 echo "Nope, it does not, but that is ok." 2>&1;
5069 : We will not override a previous value, but we might want to
5070 : augment a hint file
5072 default|recommended)
5073 case "$gccversion" in
5074 1*) dflt="$dflt -fpcc-struct-return" ;;
5076 case "$optimize:$DEBUGGING" in
5077 *-g*:old) dflt="$dflt -DDEBUGGING";;
5079 case "$gccversion" in
5080 2*) if test -d /etc/conf/kconfig.d &&
5081 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
5083 # Interactive Systems (ISC) POSIX mode.
5088 case "$gccversion" in
5091 ?*) set strict-aliasing -fno-strict-aliasing
5095 # For gcc, adding -pipe speeds up compilations for some, but apparently
5096 # some assemblers can't read from stdin. (It also slows down compilations
5097 # in other cases, but those are apparently rarer these days.) AD 5/2004.
5098 case "$gccversion" in
5104 # on x86_64 (at least) we require an extra library (libssp) in the
5105 # link command line. This library is not named, so I infer that it is
5106 # an implementation detail that may change. Hence the safest approach
5107 # is to add the flag to the flags passed to the compiler at link time,
5108 # as that way the compiler can do the right implementation dependant
5110 case "$gccversion" in
5111 ?*) set stack-protector -fstack-protector 'ldflags="$ldflags -fstack-protector"'
5118 case "$mips_type" in
5119 *BSD*|'') inclwanted="$locincpth $usrinc";;
5120 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
5122 for thisincl in $inclwanted; do
5123 if $test -d $thisincl; then
5124 if $test x$thisincl != x$usrinc; then
5126 *" -I$thisincl "*);;
5127 *) dflt="$dflt -I$thisincl ";;
5133 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
5135 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
5143 *) dflt="$dflt -D$2";;
5147 set signal.h LANGUAGE_C; eval $inctest
5151 ccflags="$ccflags -DSOCKS"
5156 default|recommended) dflt="$ccflags $dflt" ;;
5157 *) dflt="$ccflags";;
5166 Your C compiler may want other flags. For this question you should include
5167 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
5168 but you should NOT include libraries or ld flags like -lwhatever. If you
5169 want $package to honor its debug switch, you should include -DDEBUGGING here.
5170 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
5172 To use no flags, specify the word "none".
5178 rp="Any additional cc flags?"
5185 : the following weeds options from ccflags that are of no interest to cpp
5187 '') cppflags="$ccflags" ;;
5188 *) cppflags="$cppflags $ccflags" ;;
5190 case "$gccversion" in
5191 1*) cppflags="$cppflags -D__GNUC__"
5193 case "$mips_type" in
5195 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
5201 echo "Let me guess what the preprocessor flags are..." >&4
5215 *) ftry="$previous $flag";;
5217 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
5218 >cpp1.out 2>/dev/null && \
5219 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
5220 >cpp2.out 2>/dev/null && \
5221 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
5222 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
5224 cppflags="$cppflags $ftry"
5234 *-*) echo "They appear to be: $cppflags";;
5236 $rm -f cpp.c cpp?.out
5240 : flags used in final linking phase
5242 '') if ./venix; then
5248 *-posix*) dflt="$dflt -posix" ;;
5251 *) dflt="$ldflags";;
5254 : Try to guess additional flags to pick up local libraries.
5255 for thislibdir in $libpth; do
5256 case " $loclibpth " in
5259 *"-L$thislibdir "*) ;;
5260 *) dflt="$dflt -L$thislibdir" ;;
5272 Your C linker may need flags. For this question you should
5273 include -L/whatever and any other flags used by the C linker, but you
5274 should NOT include libraries like -lwhatever.
5276 Make sure you include the appropriate -L/path flags if your C linker
5277 does not normally search all of the directories you specified above,
5280 To use no flags, specify the word "none".
5284 rp="Any additional ld flags (NOT including libraries)?"
5290 rmlist="$rmlist pdp11"
5294 echo "Checking your choice of C compiler and flags for coherency..." >&4
5295 $cat > try.c <<'EOF'
5297 int main() { printf("Ok\n"); return(0); }
5299 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
5301 $cat >try.msg <<'EOM'
5302 I've tried to compile and run the following simple program:
5305 $cat try.c >> try.msg
5307 $cat >> try.msg <<EOM
5314 and I got the following output:
5318 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5319 if $sh -c "$run ./try" >>try.msg 2>&1; then
5323 *) echo 'The program compiled OK, but produced no output.' >> try.msg
5326 cat >> try.msg <<'EOQS'
5327 If $libs contains -lsfio, and sfio is mis-configured, then it
5328 sometimes (apparently) runs and exits with a 0 status, but with no
5329 output! It may have to do with sfio's use of _exit vs. exit.
5332 rp="You have a big problem. Shall I abort Configure"
5339 echo "The program compiled OK, but exited with status $?." >>try.msg
5340 rp="You have a problem. Shall I abort Configure"
5344 echo "I can't compile the test program." >>try.msg
5345 rp="You have a BIG problem. Shall I abort Configure"
5351 case "$knowitall" in
5353 echo "(The supplied flags or libraries might be incorrect.)"
5361 *) echo "Ok. Stopping Configure." >&4
5366 n) echo "OK, that should do.";;
5370 : define a shorthand compile call
5374 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5375 : define a shorthand compile call for compilations that should be ok.
5379 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5381 : determine filename position in cpp output
5383 echo "Computing filename position in cpp output for #include directives..." >&4
5385 vos) testaccess=-e ;;
5388 echo '#include <stdio.h>' > foo.c
5391 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5392 $grep '^[ ]*#.*stdio\.h' | \
5393 while read cline; do
5396 while $test \$# -gt 0; do
5397 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5402 pos=\`expr \$pos + 1\`
5414 *) pos="${fieldn}th";;
5416 echo "Your cpp writes the filename in the $pos field of the line."
5419 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
5420 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
5423 : locate header file
5428 for usrincdir in $usrinc
5430 if test -f \$usrincdir/\$wanted; then
5431 echo "\$usrincdir/\$wanted"
5435 awkprg='{ print \$$fieldn }'
5436 echo "#include <\$wanted>" > foo\$\$.c
5437 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5438 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5439 while read cline; do
5440 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5442 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5443 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5448 # status = 0: grep returned 0 lines, case statement not executed
5449 # status = 1: headerfile found
5450 # status = 2: while loop executed, no headerfile found
5454 if test \$status -eq 1; then
5461 : define an alternate in-header-list? function
5462 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5463 cont=true; xxf="echo \"<\$1> found.\" >&4";
5464 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5465 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5467 case $# in 4) instead=instead;; *) instead="at last";; esac;
5468 while $test "$cont"; do
5470 var=$2; eval "was=\$$2";
5471 if $test "$xxx" && $test -r "$xxx";
5473 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5476 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5477 set $yyy; shift; shift; yyy=$@;
5478 case $# in 0) cont="";;
5479 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5480 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5481 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5482 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5486 do set $yyy; var=$2; eval "was=\$$2";
5487 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5488 set $yyy; shift; shift; yyy=$@;
5491 : see if stdlib is available
5492 set stdlib.h i_stdlib
5495 : check for lengths of integral types
5499 echo "Checking to see how big your integers are..." >&4
5508 printf("intsize=%d;\n", (int)sizeof(int));
5509 printf("longsize=%d;\n", (int)sizeof(long));
5510 printf("shortsize=%d;\n", (int)sizeof(short));
5515 if eval $compile_ok && $run ./try > /dev/null; then
5517 echo "Your integers are $intsize bytes long."
5518 echo "Your long integers are $longsize bytes long."
5519 echo "Your short integers are $shortsize bytes long."
5523 Help! I can't compile and run the intsize test program: please enlighten me!
5524 (This is probably a misconfiguration in your system or libraries, and
5525 you really ought to fix it. Still, I'll try anyway.)
5529 rp="What is the size of an integer (in bytes)?"
5533 rp="What is the size of a long integer (in bytes)?"
5537 rp="What is the size of a short integer (in bytes)?"
5545 : check for long long
5547 echo "Checking to see if you have long long..." >&4
5548 echo 'int main() { long long x = 7; return 0; }' > try.c
5550 if eval $compile; then
5552 echo "You have long long."
5555 echo "You do not have long long."
5561 : check for length of long long
5562 case "${d_longlong}${longlongsize}" in
5565 echo "Checking to see how big your long longs are..." >&4
5566 $cat >try.c <<'EOCP'
5570 printf("%d\n", (int)sizeof(long long));
5575 if eval $compile_ok; then
5576 longlongsize=`$run ./try`
5577 echo "Your long longs are $longlongsize bytes long."
5581 echo "(I can't seem to compile the test program. Guessing...)"
5582 rp="What is the size of a long long (in bytes)?"
5586 if $test "X$longsize" = "X$longlongsize"; then
5587 echo "(That isn't any different from an ordinary long.)"
5593 : see if inttypes.h is available
5594 : we want a real compile instead of Inhdr because some systems
5595 : have an inttypes.h which includes non-existent headers
5598 #include <inttypes.h>
5600 static int32_t foo32 = 0x12345678;
5604 if eval $compile; then
5605 echo "<inttypes.h> found." >&4
5608 echo "<inttypes.h> NOT found." >&4
5617 echo "Checking to see if you have int64_t..." >&4
5619 #include <sys/types.h>
5620 #$i_inttypes I_INTTYPES
5622 #include <inttypes.h>
5624 int main() { int64_t x = 7; }
5627 if eval $compile; then
5629 echo "You have int64_t."
5632 echo "You do not have int64_t."
5640 echo "Checking which 64-bit integer type we could use..." >&4
5646 val='"unsigned int"'
5651 *) case "$longsize" in
5655 val='"unsigned long"'
5660 *) case "$d_longlong:$longlongsize" in
5665 val='"unsigned long long"'
5670 *) case "$d_int64_t" in
5689 '') echo "Alas, no 64-bit integer types in sight." >&4
5692 *) echo "We could use '$quadtype' for 64-bit integers." >&4
5698 case "$uselonglong" in
5699 "$define"|true|[yY]*)
5702 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
5704 use64bitint="$define"
5707 case "$use64bits" in
5708 "$define"|true|[yY]*)
5711 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
5713 use64bitint="$define"
5716 case "$use64bitints" in
5717 "$define"|true|[yY]*)
5720 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
5722 use64bitint="$define"
5725 case "$use64bitsint" in
5726 "$define"|true|[yY]*)
5729 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
5731 use64bitint="$define"
5734 case "$uselonglongs" in
5735 "$define"|true|[yY]*)
5738 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
5740 use64bitint="$define"
5743 case "$use64bitsall" in
5744 "$define"|true|[yY]*)
5747 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
5749 use64bitall="$define"
5754 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
5756 case "$use64bitall" in
5757 "$define"|true|[yY]*) use64bitint="$define" ;;
5763 You have natively 64-bit long integers.
5767 *) case "$use64bitint" in
5768 "$define"|true|[yY]*) dflt='y';;
5777 Perl can be built to take advantage of 64-bit integer types
5778 on some systems. To do so, Configure can be run with -Duse64bitint.
5779 Choosing this option will most probably introduce binary incompatibilities.
5781 If this doesn't make any sense to you, just accept the default '$dflt'.
5782 (The default has been chosen based on your configuration.)
5784 rp='Try to use 64-bit integers, if available?'
5787 [yY]*) val="$define" ;;
5795 case "$use64bitall" in
5796 "$define"|true|[yY]*) dflt='y' ;;
5797 *) case "$longsize" in
5805 You may also choose to try maximal 64-bitness. It means using as much
5806 64-bitness as possible on the platform. This in turn means even more
5807 binary incompatibilities. On the other hand, your platform may not
5808 have any more 64-bitness available than what you already have chosen.
5810 If this doesn't make any sense to you, just accept the default '$dflt'.
5811 (The default has been chosen based on your configuration.)
5813 rp='Try to use maximal 64-bit support, if available?'
5816 [yY]*) val="$define" ;;
5821 case "$use64bitall" in
5823 case "$use64bitint" in
5827 Since you have chosen a maximally 64-bit build, I'm also turning on
5828 the use of 64-bit integers.
5830 use64bitint="$define" ;;
5835 : Look for a hint-file generated 'call-back-unit'. If the
5836 : user has specified that a 64-bit perl is to be built,
5837 : we may need to set or change some other defaults.
5838 if $test -f use64bitint.cbu; then
5839 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
5842 case "$use64bitint" in
5843 "$define"|true|[yY]*)
5845 4) case "$archname64" in
5846 '') archname64=64int ;;
5853 : Look for a hint-file generated 'call-back-unit'. If the
5854 : user has specified that a maximally 64-bit perl is to be built,
5855 : we may need to set or change some other defaults.
5856 if $test -f use64bitall.cbu; then
5857 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
5860 case "$use64bitall" in
5861 "$define"|true|[yY]*)
5863 4) case "$archname64" in
5864 ''|64int) archname64=64all ;;
5871 case "$d_quad:$use64bitint" in
5875 *** You have chosen to use 64-bit integers,
5876 *** but none can be found.
5877 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
5878 *** Cannot continue, aborting.
5885 : check for length of double
5887 case "$doublesize" in
5889 echo "Checking to see how big your double precision numbers are..." >&4
5898 printf("%d\n", (int)sizeof(double));
5903 if eval $compile_ok; then
5904 doublesize=`$run ./try`
5905 echo "Your double is $doublesize bytes long."
5908 echo "(I can't seem to compile the test program. Guessing...)"
5909 rp="What is the size of a double precision number (in bytes)?"
5917 : check for long doubles
5919 echo "Checking to see if you have long double..." >&4
5920 echo 'int main() { long double x = 7.0; }' > try.c
5922 if eval $compile; then
5924 echo "You have long double."
5927 echo "You do not have long double."
5933 : check for length of long double
5934 case "${d_longdbl}${longdblsize}" in
5937 echo "Checking to see how big your long doubles are..." >&4
5938 $cat >try.c <<'EOCP'
5942 printf("%d\n", sizeof(long double));
5947 if eval $compile; then
5948 longdblsize=`$run ./try`
5949 echo "Your long doubles are $longdblsize bytes long."
5953 echo "(I can't seem to compile the test program. Guessing...)" >&4
5954 rp="What is the size of a long double (in bytes)?"
5958 if $test "X$doublesize" = "X$longdblsize"; then
5959 echo "That isn't any different from an ordinary double."
5960 echo "I'll keep your setting anyway, but you may see some"
5961 echo "harmless compilation warnings."
5967 : determine the architecture name
5969 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
5970 tarch=`arch`"-$osname"
5971 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
5972 if uname -m > tmparch 2>&1 ; then
5973 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
5974 -e 's/$/'"-$osname/" tmparch`
5982 case "$myarchname" in
5985 echo "(Your architecture name used to be $myarchname.)"
5989 case "$targetarch" in
5991 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
5996 *) dflt="$archname";;
5998 rp='What is your architecture name'
6001 case "$usethreads" in
6003 echo "Threads selected." >&4
6005 *-thread*) echo "...and architecture name already has -thread." >&4
6007 *) archname="$archname-thread"
6008 echo "...setting architecture name to $archname." >&4
6013 case "$usemultiplicity" in
6015 echo "Multiplicity selected." >&4
6017 *-multi*) echo "...and architecture name already has -multi." >&4
6019 *) archname="$archname-multi"
6020 echo "...setting architecture name to $archname." >&4
6025 case "$use64bitint$use64bitall" in
6027 case "$archname64" in
6029 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
6032 case "$use64bitint" in
6033 "$define") echo "64 bit integers selected." >&4 ;;
6035 case "$use64bitall" in
6036 "$define") echo "Maximal 64 bitness selected." >&4 ;;
6039 *-$archname64*) echo "...and architecture name already has $archname64." >&4
6041 *) archname="$archname-$archname64"
6042 echo "...setting architecture name to $archname." >&4
6048 case "$uselongdouble" in
6050 echo "Long doubles selected." >&4
6051 case "$longdblsize" in
6053 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
6057 *-ld*) echo "...and architecture name already has -ld." >&4
6059 *) archname="$archname-ld"
6060 echo "...setting architecture name to $archname." >&4
6067 case "$useperlio" in
6069 echo "Perlio selected." >&4
6072 echo "Perlio not selected, using stdio." >&4
6074 *-stdio*) echo "...and architecture name already has -stdio." >&4
6076 *) archname="$archname-stdio"
6077 echo "...setting architecture name to $archname." >&4
6082 if $test -f archname.cbu; then
6083 echo "Your platform has some specific hints for architecture name, using them..."
6087 : set the prefixit variable, to compute a suitable default value
6088 prefixit='case "$3" in
6090 case "$oldprefix" in
6091 "") eval "$1=\"\$$2\"";;
6098 ""|" ") eval "$1=\"\$$2\"";;
6104 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
6106 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
6107 /*-$oldprefix/*|\~*-$oldprefix/*)
6108 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
6109 *) eval "$1=\"\$$2\"";;
6113 : determine installation style
6114 : For now, try to deduce it from prefix unless it is already set.
6115 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
6116 case "$installstyle" in
6117 '') case "$prefix" in
6118 *perl*) dflt='lib';;
6119 *) dflt='lib/perl5' ;;
6122 *) dflt="$installstyle" ;;
6124 : Probably not worth prompting for this since we prompt for all
6125 : the directories individually, and the prompt would be too long and
6129 : determine where public executables go
6134 rp='Pathname where the public executables will reside?'
6136 if $test "X$ansexp" != "X$binexp"; then
6140 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
6141 : XXX If this is fixed, also fix the "start perl" hunk below, which relies on
6142 : this via initialinstalllocation
6145 case "$userelocatableinc" in
6146 $define|true|[yY]*) dflt='y' ;;
6151 Would you like to build Perl so that the installation is relocatable, so that
6152 library paths in @INC are determined relative to the path of the perl binary?
6153 This is not advised for system Perl installs, or if you need to run setid
6154 scripts or scripts under taint mode.
6156 If this doesn't make any sense to you, just accept the default '$dflt'.
6158 rp='Use relocatable @INC?'
6161 y|Y) val="$define" ;;
6164 set userelocatableinc
6167 initialinstalllocation="$binexp"
6168 : Default prefix is now "up one level from where the binaries are"
6169 case "$userelocatableinc" in
6175 installprefixexp=".../.."
6179 : determine where private library files go
6180 : Usual default is /usr/local/lib/perl5/$version.
6181 : Also allow things like /opt/perl/lib/$version, since
6182 : /opt/perl/lib/perl5... would be redundant.
6183 : The default "style" setting is made in installstyle.U
6184 case "$installstyle" in
6185 *lib/perl5*) set dflt privlib lib/$package/$version ;;
6186 *) set dflt privlib lib/$version ;;
6191 There are some auxiliary files for $package that need to be put into a
6192 private library directory that is accessible by everyone.
6197 rp='Pathname where the private library files will reside?'
6202 : set the prefixup variable, to restore leading tilda escape
6203 prefixup='case "$prefixexp" in
6205 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
6208 : determine where public architecture dependent libraries go
6211 : privlib default is /usr/local/lib/$package/$version
6212 : archlib default is /usr/local/lib/$package/$version/$archname
6213 : privlib may have an optional trailing /share.
6214 tdflt=`echo $privlib | $sed 's,/share$,,'`
6215 tdflt=$tdflt/$archname
6224 $spackage contains architecture-dependent library files. If you are
6225 sharing libraries in a heterogeneous environment, you might store
6226 these files in a separate location. Otherwise, you can just include
6227 them with the rest of the public library files.
6232 rp='Where do you want to put the public architecture-dependent libraries?'
6236 if $test X"$archlib" = X"$privlib"; then
6242 : see if setuid scripts can be secure
6245 Some kernels have a bug that prevents setuid #! scripts from being
6246 secure. Some sites have disabled setuid #! scripts because of this.
6248 First let's decide if your kernel supports secure setuid #! scripts.
6249 (If setuid #! scripts would be secure but have been disabled anyway,
6250 don't say that they are secure if asked.)
6255 if $test -d /dev/fd; then
6256 echo "#!$ls" >reflect
6257 chmod +x,u+s reflect
6258 ./reflect >flect 2>&1
6259 if $contains "/dev/fd" flect >/dev/null; then
6260 echo "Congratulations, your kernel has secure setuid scripts!" >&4
6264 If you are not sure if they are secure, I can check but I'll need a
6265 username and password different from the one you are using right now.
6266 If you don't have such a username or don't want me to test, simply
6270 rp='Other username to test security of setuid scripts with?'
6275 case "$d_suidsafe" in
6276 '') echo "I'll assume setuid scripts are *not* secure." >&4
6279 echo "Well, the $hint value is *not* secure." >&4
6281 *) echo "Well, the $hint value *is* secure." >&4
6286 $rm -f reflect flect
6287 echo "#!$ls" >reflect
6288 chmod +x,u+s reflect
6291 echo '"su" will (probably) prompt you for '"$ans's password."
6292 su $ans -c './reflect >flect'
6293 if $contains "/dev/fd" flect >/dev/null; then
6294 echo "Okay, it looks like setuid scripts are secure." >&4
6297 echo "I don't think setuid scripts are secure." >&4
6302 rp='Does your kernel have *secure* setuid scripts?'
6305 [yY]*) val="$define";;
6310 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
6311 echo "(That's for file descriptors, not floppy disks.)"
6317 $rm -f reflect flect
6319 : now see if they want to do setuid emulation
6322 case "$d_suidsafe" in
6325 echo "No need to emulate SUID scripts since they are secure here." >&4
6329 Some systems have disabled setuid scripts, especially systems where
6330 setuid scripts cannot be secure. On systems where setuid scripts have
6331 been disabled, the setuid/setgid bits on scripts are currently
6332 useless. It is possible for $package to detect those bits and emulate
6333 setuid/setgid in a secure fashion. This emulation will only work if
6334 setuid scripts have been disabled in your kernel.
6338 "$define") dflt=y ;;
6341 rp="Do you want to do setuid/setgid emulation?"
6344 [yY]*) val="$define";;
6352 : Find perl5.005 or later.
6353 echo "Looking for a previously installed perl5.005 or later... "
6355 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
6356 : Check if this perl is recent and can load a simple module
6357 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6360 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6370 '') echo "None found. That's ok.";;
6371 *) echo "Using $perl5." ;;
6376 After $package is installed, you may wish to install various
6377 add-on modules and utilities. Typically, these add-ons will
6378 be installed under $prefix with the rest
6379 of this package. However, you may wish to install such add-ons
6380 elsewhere under a different prefix.
6382 If you do not wish to put everything under a single prefix, that's
6383 ok. You will be prompted for the individual locations; this siteprefix
6384 is only used to suggest the defaults.
6386 The default should be fine for most people.
6390 rp='Installation prefix to use for add-on modules and utilities?'
6391 : XXX Here might be another good place for an installstyle setting.
6392 case "$siteprefix" in
6394 *) dflt=$siteprefix ;;
6397 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6399 case "$siteprefix" in
6403 *) oldsiteprefix="$prefix";;
6408 siteprefixexp="$ansexp"
6410 : determine where site specific libraries go.
6411 : Usual default is /usr/local/lib/perl5/site_perl/$version
6412 : The default "style" setting is made in installstyle.U
6413 : XXX No longer works with Prefixit stuff.
6414 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6416 '') case "$installstyle" in
6417 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
6418 *) dflt=$siteprefix/lib/site_$prog/$version ;;
6426 The installation process will create a directory for
6427 site-specific extensions and modules. Most users find it convenient
6428 to place all site-specific files in this directory rather than in the
6429 main distribution directory.
6433 rp='Pathname for the site-specific library files?'
6437 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6439 : Determine list of previous versions to include in @INC
6440 $cat > getverlist <<EOPL
6443 \$api_versionstring = "$api_versionstring";
6444 \$version = "$version";
6445 \$stem = "$sitelib_stem";
6446 \$archname = "$archname";
6448 $cat >> getverlist <<'EOPL'
6449 # The list found is store twice for each entry: the original name, and
6450 # the binary broken down version as pack "sss", so sorting is easy and
6451 # unambiguous. This will work for all versions that have a maximum of
6452 # three digit groups, separate by '.'s or '_'s. Names are extended with
6453 # ".0.0" to ensure at least three elements for the pack.
6454 # -- H.Merijn Brand (m)'06 23-10-2006
6456 # Can't have leading @ because metaconfig interprets it as a command!
6457 ;@inc_version_list=();
6458 # XXX Redo to do opendir/readdir?
6461 ;@candidates = map {
6462 [ $_, pack "sss", split m/[._]/, "$_.0.0" ] } glob("5.*");
6468 ($pversion, $aversion, $vsn5005) = map {
6469 pack "sss", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005";
6470 foreach $d (@candidates) {
6471 if ($d->[1] lt $pversion) {
6472 if ($d->[1] ge $aversion) {
6473 unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]);
6475 elsif ($d->[1] ge $vsn5005) {
6476 unshift(@inc_version_list, grep { -d } $d->[0]);
6480 # Skip newer version. I.e. don't look in
6481 # 5.7.0 if we're installing 5.6.1.
6485 if (@inc_version_list) {
6486 print join(' ', @inc_version_list);
6489 # Blank space to preserve value for next Configure run.
6494 case "$inc_version_list" in
6495 '') if test -x "$perl5$exe_ext"; then
6496 dflt=`$perl5 getverlist`
6501 $undef) dflt='none' ;;
6502 *) eval dflt=\"$inc_version_list\" ;;
6505 ''|' ') dflt=none ;;
6512 In order to ease the process of upgrading, this version of perl
6513 can be configured to use modules built and installed with earlier
6514 versions of perl that were installed under $prefix. Specify here
6515 the list of earlier versions that this version of perl should check.
6516 If Configure detected no earlier versions of perl installed under
6517 $prefix, then the list will be empty. Answer 'none' to tell perl
6518 to not search earlier versions.
6520 The default should almost always be sensible, so if you're not sure,
6521 just accept the default.
6524 rp='List of earlier versions to include in @INC?'
6527 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
6528 *) inc_version_list="$ans" ;;
6530 case "$inc_version_list" in
6532 inc_version_list_init='0'
6533 d_inc_version_list="$undef"
6535 *) inc_version_list_init=`echo $inc_version_list |
6536 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
6537 d_inc_version_list="$define"
6542 : see if this is a malloc.h system
6543 : we want a real compile instead of Inhdr because some systems have a
6544 : malloc.h that just gives a compile error saying to use stdlib.h instead
6549 int main () { return 0; }
6552 if eval $compile; then
6553 echo "<malloc.h> found." >&4
6556 echo "<malloc.h> NOT found." >&4
6563 : check for void type
6565 echo "Checking to see how well your C compiler groks the void type..." >&4
6566 case "$voidflags" in
6578 extern void moo(); /* function returning void */
6579 void (*goo)(); /* ptr to func returning void */
6581 void *hue; /* generic ptr */
6594 int main() { sub(); }
6596 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
6597 voidflags=$defvoidused
6598 echo "Good. It appears to support void to the level $package wants.">&4
6599 if $contains warning .out >/dev/null 2>&1; then
6600 echo "However, you might get some warnings that look like this:"
6604 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
6605 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
6606 echo "It supports 1..."
6607 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
6608 echo "It also supports 2..."
6609 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
6611 echo "And it supports 4 but not 8 definitely."
6613 echo "It doesn't support 4..."
6614 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
6616 echo "But it supports 8."
6619 echo "Neither does it support 8."
6623 echo "It does not support 2..."
6624 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
6626 echo "But it supports 4 and 8."
6628 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
6630 echo "And it supports 4 but has not heard about 8."
6632 echo "However it supports 8 but not 4."
6637 echo "There is no support at all for void."
6642 case "$voidflags" in
6645 Support flag bits are:
6646 1: basic void declarations.
6647 2: arrays of pointers to functions returning void.
6648 4: operations between pointers to and addresses of void functions.
6649 8: generic void pointers.
6652 rp="Your void support flags add up to what?"
6659 : check for length of pointer
6663 echo "Checking to see how big your pointers are..." >&4
6664 if test "$voidflags" -gt 7; then
6665 echo '#define VOID_PTR char *' > try.c
6667 echo '#define VOID_PTR void *' > try.c
6677 printf("%d\n", (int)sizeof(VOID_PTR));
6682 if eval $compile_ok; then
6683 ptrsize=`$run ./try`
6684 echo "Your pointers are $ptrsize bytes long."
6687 echo "(I can't seem to compile the test program. Guessing...)" >&4
6688 rp="What is the size of a pointer (in bytes)?"
6695 case "$use64bitall" in
6696 "$define"|true|[yY]*)
6700 *** You have chosen a maximally 64-bit build,
6701 *** but your pointers are only 4 bytes wide.
6702 *** Please rerun Configure without -Duse64bitall.
6707 *** Since you have quads, you could possibly try with -Duse64bitint.
6712 *** Cannot continue, aborting.
6723 : determine whether to use malloc wrapping
6725 case "$usemallocwrap" in
6726 [yY]*|true|$define) dflt='y' ;;
6727 [nN]*|false|$undef) dflt='n' ;;
6728 *) case "$usedevel" in
6729 [yY]*|true|$define) dflt='y' ;;
6734 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
6736 usemallocwrap="$ans"
6739 usemallocwrap="$define" ;;
6741 usemallocwrap="$undef" ;;
6744 : determine which malloc to compile in
6746 case "$usemymalloc" in
6747 [yY]*|true|$define) dflt='y' ;;
6748 [nN]*|false|$undef) dflt='n' ;;
6749 *) case "$ptrsize" in
6755 rp="Do you wish to attempt to use the malloc that comes with $package?"
6761 mallocsrc='malloc.c'
6762 mallocobj="malloc$_o"
6763 d_mymalloc="$define"
6766 : Remove malloc from list of libraries to use
6767 echo "Removing unneeded -lmalloc from library list" >&4
6768 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
6771 echo "libs = $libs" >&4
6783 : compute the return types of malloc and free
6785 $cat >malloc.c <<END
6789 #include <sys/types.h>
6803 case "$malloctype" in
6805 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
6812 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
6816 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
6823 echo "Your system uses $freetype free(), it would seem." >&4
6825 : determine where site specific architecture-dependent libraries go.
6826 : sitelib default is /usr/local/lib/perl5/site_perl/$version
6827 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6828 : sitelib may have an optional trailing /share.
6830 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
6831 dflt="$dflt/$archname"
6836 set sitearch sitearch none
6840 The installation process will also create a directory for
6841 architecture-dependent site-specific extensions and modules.
6845 rp='Pathname for the site-specific architecture-dependent library files?'
6849 if $test X"$sitearch" = X"$sitelib"; then
6852 d_sitearch="$define"
6857 The installation process will also create a directory for
6858 vendor-supplied add-ons. Vendors who supply perl with their system
6859 may find it convenient to place all vendor-supplied files in this
6860 directory rather than in the main distribution directory. This will
6861 ease upgrades between binary-compatible maintenance versions of perl.
6863 Of course you may also use these directories in whatever way you see
6864 fit. For example, you might use them to access modules shared over a
6865 company-wide network.
6867 The default answer should be fine for most people.
6868 This causes further questions about vendor add-ons to be skipped
6869 and no vendor-specific directories will be configured for perl.
6872 rp='Do you want to configure vendor-specific add-on directories?'
6873 case "$usevendorprefix" in
6874 define|true|[yY]*) dflt=y ;;
6875 *) : User may have set vendorprefix directly on Configure command line.
6876 case "$vendorprefix" in
6885 rp='Installation prefix to use for vendor-supplied add-ons?'
6886 case "$vendorprefix" in
6888 *) dflt=$vendorprefix ;;
6891 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6893 case "$vendorprefix" in
6897 *) oldvendorprefix="$prefix";;
6901 usevendorprefix="$define"
6903 vendorprefixexp="$ansexp"
6905 *) usevendorprefix="$undef"
6911 case "$vendorprefix" in
6912 '') d_vendorlib="$undef"
6916 *) d_vendorlib="$define"
6917 : determine where vendor-supplied modules go.
6918 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
6919 case "$vendorlib" in
6921 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6922 case "$installstyle" in
6923 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
6924 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
6927 *) dflt="$vendorlib"
6931 rp='Pathname for the vendor-supplied library files?'
6934 vendorlibexp="$ansexp"
6937 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
6941 case "$vendorprefix" in
6942 '') d_vendorarch="$undef"
6946 *) d_vendorarch="$define"
6947 : determine where vendor-supplied architecture-dependent libraries go.
6948 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
6949 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
6950 : vendorlib may have an optional trailing /share.
6951 case "$vendorarch" in
6952 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
6953 dflt="$dflt/$archname"
6955 *) dflt="$vendorarch" ;;
6958 rp='Pathname for vendor-supplied architecture-dependent files?'
6961 vendorarchexp="$ansexp"
6964 prefixvar=vendorarch
6967 : Final catch-all directories to search
6970 Lastly, you can have perl look in other directories for extensions and
6971 modules in addition to those already specified.
6972 These directories will be searched after
6976 test X"$vendorlib" != "X" && echo ' ' $vendorlib
6977 test X"$vendorarch" != "X" && echo ' ' $vendorarch
6979 case "$otherlibdirs" in
6980 ''|' ') dflt='none' ;;
6981 *) dflt="$otherlibdirs" ;;
6984 Enter a colon-separated set of extra paths to include in perl's @INC
6985 search path, or enter 'none' for no extra paths.
6989 rp='Colon-separated list of additional directories for perl to search?'
6992 ' '|''|none) otherlibdirs=' ' ;;
6993 *) otherlibdirs="$ans" ;;
6995 case "$otherlibdirs" in
6999 set d_perl_otherlibdirs
7002 : Cruising for prototypes
7004 echo "Checking out function prototypes..." >&4
7005 $cat >prototype.c <<EOCP
7010 int main(int argc, char *argv[]) {
7013 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
7014 echo "Your C compiler appears to support function prototypes."
7017 echo "Your C compiler doesn't seem to understand function prototypes."
7024 case "$prototype" in
7026 *) ansi2knr='ansi2knr'
7031 This version of $package can only be compiled by a compiler that
7032 understands function prototypes. Unfortunately, your C compiler
7034 doesn't seem to understand them. Sorry about that.
7036 If GNU cc is available for your system, perhaps you could try that instead.
7038 Eventually, we hope to support building Perl with pre-ANSI compilers.
7039 If you would like to help in that effort, please contact <perlbug@perl.org>.
7041 Aborting Configure now.
7053 Perl can be built with extra modules or bundles of modules which
7054 will be fetched from the CPAN and installed alongside Perl.
7056 Notice that you will need access to the CPAN; either via the Internet,
7057 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
7058 be asked later to configure the CPAN.pm module which will in turn do
7059 the installation of the rest of the extra modules or bundles.)
7061 Notice also that if the modules require any external software such as
7062 libraries and headers (the libz library and the zlib.h header for the
7063 Compress::Zlib module, for example) you MUST have any such software
7064 already installed, this configuration process will NOT install such
7067 If this doesn't make any sense to you, just accept the default '$dflt'.
7069 rp='Install any extra modules (y or n)?'
7075 Please list any extra modules or bundles to be installed from CPAN,
7076 with spaces between the names. The names can be in any format the
7077 'install' command of CPAN.pm will understand. (Answer 'none',
7078 without the quotes, to install no extra modules or bundles.)
7088 $rm -f ../extras.lst
7090 *) echo "(Saving the list of extras for later...)"
7091 echo "$extras" > ../extras.lst
7099 : determine where html pages for programs go
7100 set html1dir html1dir none
7104 If you wish to install html files for programs in $spackage, indicate
7105 the appropriate directory here. To skip installing html files,
7109 ''|none|$undef|' ') dflt=none ;;
7110 *) dflt=$html1dir ;;
7113 rp="Directory for the main $spackage html pages?"
7117 : Use ' ' for none so value is preserved next time through Configure
7118 $test X"$html1dir" = "X" && html1dir=' '
7120 : determine where html pages for libraries and modules go
7121 set html3dir html3dir none
7125 If you wish to install html files for modules associated with $spackage,
7126 indicate the appropriate directory here. To skip installing html files,
7129 : There is no obvious default. If they have specified html1dir, then
7130 : try to key off that, possibly changing .../html1 into .../html3.
7132 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
7133 *) dflt=$html3dir ;;
7136 rp="Directory for the $spackage module html pages?"
7140 : Use ' ' for none so value is preserved next time through Configure
7141 $test X"$html3dir" = "X" && html3dir=' '
7143 : determine whether to install perl also as /usr/bin/perl
7146 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
7148 Many scripts expect perl to be installed as /usr/bin/perl.
7150 If you want to, I can install the perl you are about to compile
7151 as /usr/bin/perl (in addition to $bin/perl).
7153 if test -f /usr/bin/perl; then
7156 However, please note that because you already have a /usr/bin/perl,
7157 overwriting that with a new Perl would very probably cause problems.
7158 Therefore I'm assuming you don't want to do that (unless you insist).
7161 case "$installusrbinperl" in
7162 "$define"|[yY]*) dflt='y';;
7168 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
7171 case "$installusrbinperl" in
7172 "$undef"|[nN]*) dflt='n';;
7176 rp="Do you want to install perl as /usr/bin/perl?"
7179 [yY]*) val="$define";;
7185 set installusrbinperl
7189 echo "Checking for GNU C Library..." >&4
7191 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
7192 alone are insufficient to distinguish different versions, such as
7193 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
7194 libc version 2.1.0. A. Dougherty, June 3, 2002.
7200 # ifdef __GLIBC_MINOR__
7201 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus)
7202 # include <gnu/libc-version.h>
7203 printf("%s\n", gnu_get_libc_version());
7205 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
7208 printf("%d\n", __GLIBC__);
7217 if eval $compile_ok && $run ./try > glibc.ver; then
7219 gnulibc_version=`$cat glibc.ver`
7220 echo "You are using the GNU C Library version $gnulibc_version"
7224 echo "You are not using the GNU C Library"
7230 : see if nm is to be used to determine whether a symbol is defined or not
7234 case "$d_gnulibc" in
7237 echo "nm probably won't work on the GNU C Library." >&4
7243 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
7245 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
7246 echo "'nm' won't be sufficient on this sytem." >&4
7252 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
7253 if $test $dflt -gt 20; then
7263 true|$define) dflt=y;;
7270 I can use $nm to extract the symbols from your C libraries. This
7271 is a time consuming task which may generate huge output on the disk (up
7272 to 3 megabytes) but that should make the symbols extraction faster. The
7273 alternative is to skip the 'nm' extraction part and to compile a small
7274 test program instead to determine whether each symbol is present. If
7275 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
7276 this may be the best solution.
7278 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
7281 rp="Shall I use $nm to extract C symbols from the libraries?"
7284 [Nn]*) usenm=false;;
7293 : nm options which may be necessary
7295 '') if $test -f /mach_boot; then
7297 elif $test -d /usr/ccs/lib; then
7298 nm_opt='-p' # Solaris (and SunOS?)
7299 elif $test -f /dgux; then
7301 elif $test -f /lib64/rld; then
7302 nm_opt='-p' # 64-bit Irix
7308 : nm options which may be necessary for shared libraries but illegal
7309 : for archive libraries. Thank you, Linux.
7310 case "$nm_so_opt" in
7311 '') case "$myuname" in
7313 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
7314 nm_so_opt='--dynamic'
7323 : get list of predefined functions in a handy place
7328 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
7334 *) for thislib in $libs; do
7337 : Handle C library specially below.
7340 thislib=`echo $thislib | $sed -e 's/^-l//'`
7341 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
7343 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
7345 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
7347 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
7349 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
7351 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
7353 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
7358 libnames="$libnames $try"
7360 *) libnames="$libnames $thislib" ;;
7369 for xxx in $libpth; do
7370 $test -r $1 || set $xxx/libc.$so
7371 : The messy sed command sorts on library version numbers.
7373 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
7374 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
7376 s/[0-9][0-9]*/0000&/g
7377 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
7380 $sort | $sed -e 's/^.* //'`
7383 $test -r $1 || set /usr/ccs/lib/libc.$so
7384 $test -r $1 || set /lib/libsys_s$_a
7390 if $test -r "$1"; then
7391 echo "Your (shared) C library seems to be in $1."
7393 elif $test -r /lib/libc && $test -r /lib/clib; then
7394 echo "Your C library seems to be in both /lib/clib and /lib/libc."
7396 libc='/lib/clib /lib/libc'
7397 if $test -r /lib/syslib; then
7398 echo "(Your math library is in /lib/syslib.)"
7399 libc="$libc /lib/syslib"
7401 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7402 echo "Your C library seems to be in $libc, as you said before."
7403 elif $test -r $incpath/usr/lib/libc$_a; then
7404 libc=$incpath/usr/lib/libc$_a;
7405 echo "Your C library seems to be in $libc. That's fine."
7406 elif $test -r /lib/libc$_a; then
7408 echo "Your C library seems to be in $libc. You're normal."
7410 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
7412 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
7413 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
7414 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
7416 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7418 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7421 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
7423 if $test -r "$tans"; then
7424 echo "Your C library seems to be in $tans, of all places."
7430 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7434 If the guess above is wrong (which it might be if you're using a strange
7435 compiler, or your machine supports multiple models), you can override it here.
7440 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
7442 I can't seem to find your C library. I've looked in the following places:
7445 $sed 's/^/ /' libpath
7448 None of these seems to contain your C library. I need to get its name...
7453 rp='Where is your C library?'
7458 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
7459 set X `cat libnames`
7462 case $# in 1) xxx=file; esac
7463 echo "Extracting names from the following $xxx for later perusal:" >&4
7465 $sed 's/^/ /' libnames >&4
7467 $echo $n "This may take a while...$c" >&4
7471 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
7472 *) $nm $nm_opt $file 2>/dev/null;;
7477 $grep fprintf libc.tmp > libc.ptf
7478 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
7479 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
7481 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
7483 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7485 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
7487 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7489 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
7491 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7493 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
7495 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7497 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
7499 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7501 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
7503 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7505 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
7506 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
7508 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7510 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
7512 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7514 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
7516 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7518 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
7520 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7522 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
7524 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7526 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
7528 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7530 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
7532 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7534 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
7536 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7539 $nm -p $* 2>/dev/null >libc.tmp
7540 $grep fprintf libc.tmp > libc.ptf
7541 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
7542 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
7548 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
7550 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
7551 for thisname in $libnames $libc; do
7552 $ar t $thisname >>libc.tmp
7554 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
7556 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
7557 # Repeat libc to extract forwarders to DLL entries too
7558 for thisname in $libnames $libc; do
7559 $ar tv $thisname >>libc.tmp
7560 # Revision 50 of EMX has bug in $ar.
7561 # it will not extract forwarders to DLL entries
7562 # Use emximp which will extract exactly them.
7563 emximp -o tmp.imp $thisname \
7565 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
7566 < tmp.imp >>libc.tmp
7569 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
7572 echo "$ar didn't seem to work right." >&4
7573 echo "Maybe this is a Cray...trying bld instead..." >&4
7574 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
7576 for thisname in $libnames; do
7578 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
7579 $ar t $thisname >>libc.tmp
7583 echo "That didn't work either. Giving up." >&4
7593 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
7594 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
7596 *) if $test -f /lib/syscalls.exp; then
7598 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
7599 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' /lib/syscalls.exp >>libc.list
7605 $rm -f libnames libpath
7607 : see if dld is available
7613 echo "Checking for C++..." >&4
7614 $cat >try.c <<'EOCP'
7626 if eval $compile_ok && $run ./try; then
7628 echo "You are using a C++ compiler."
7631 echo "You are not using a C++ compiler."
7637 : is a C symbol defined?
7640 -v) tf=libc.tmp; tdc="";;
7641 -a) tf=libc.tmp; tdc="[]";;
7642 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
7645 case "$reuseval-$4" in
7647 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
7652 case "$d_cplusplus" in
7653 $define) extern_C=\"C\";;
7655 if $test "$runnm" = true; then
7656 if $contains $tlook $tf >/dev/null 2>&1; then
7658 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
7659 echo "extern $extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7660 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
7661 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
7665 echo "extern $extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7666 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
7672 $define) tval=true;;
7679 : define an is-in-libc? function
7680 inlibc='echo " "; td=$define; tu=$undef;
7681 sym=$1; var=$2; eval "was=\$$2";
7683 case "$reuseval$was" in
7693 echo "$sym() found." >&4;
7694 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
7696 echo "$sym() NOT found." >&4;
7697 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
7701 $define) echo "$sym() found." >&4;;
7702 *) echo "$sym() NOT found." >&4;;
7706 : see if dlopen exists
7708 xxx_ccflags="$ccflags"
7710 : with g++ one needs -shared to get is-in-libc to work for dlopen
7711 case "$gccversion" in
7713 *) case "$d_cplusplus" in
7714 "$define") ccflags="$ccflags -shared" ;;
7721 ccflags="$xxx_ccflags"
7723 : see if this is a unistd.h system
7724 set unistd.h i_unistd
7727 : determine which dynamic loading, if any, to compile in
7729 dldir="ext/DynaLoader"
7742 $define) dflt='y' ;;
7745 $define) dflt='y' ;;
7747 : Does a dl_xxx.xs file exist for this operating system
7748 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
7751 rp="Do you wish to use dynamic loading?"
7758 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
7759 dflt="$dldir/dl_${osname}.xs"
7760 elif $test "$d_dlopen" = "$define" ; then
7761 dflt="$dldir/dl_dlopen.xs"
7762 elif $test "$i_dld" = "$define" ; then
7763 dflt="$dldir/dl_dld.xs"
7768 *) dflt="$dldir/$dlsrc"
7771 echo "The following dynamic loading files are available:"
7772 : Can not go over to $dldir because getfile has path hard-coded in.
7773 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
7774 rp="Source file to use for dynamic loading"
7780 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
7784 Some systems may require passing special flags to $cc -c to
7785 compile modules that will be used to create a shared library.
7786 To use no flags, say "none".
7789 case "$cccdlflags" in
7790 '') case "$gccversion" in
7791 '') case "$osname" in
7793 next) dflt='none' ;;
7794 irix*) dflt='-KPIC' ;;
7795 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
7796 sunos) dflt='-pic' ;;
7800 *) case "$osname" in
7801 darwin) dflt='none' ;;
7802 linux*|svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
7807 *) dflt="$cccdlflags" ;;
7809 rp="Any special flags to pass to $cc -c to compile shared library modules?"
7812 none) cccdlflags=' ' ;;
7813 *) cccdlflags="$ans" ;;
7818 Some systems use ld to create libraries that can be dynamically loaded,
7819 while other systems (such as those using ELF) use $cc.
7823 '') $cat >try.c <<EOM
7824 /* Test for whether ELF binaries are produced */
7836 int i = open("a.out",O_RDONLY);
7839 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
7840 exit(0); /* succeed (yes, it's ELF) */
7845 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
7847 You appear to have ELF support. I'll use $cc to build dynamic libraries.
7851 echo "I'll use ld to build dynamic libraries."
7860 rp="What command should be used to create dynamic libraries?"
7866 Some systems may require passing special flags to $ld to create a
7867 library that can be dynamically loaded. If your ld flags include
7868 -L/other/path options to locate libraries outside your loader's normal
7869 search path, you may need to specify those -L options here as well. To
7870 use no flags, say "none".
7873 case "$lddlflags" in
7874 '') case "$osname" in
7875 beos) dflt='-nostart' ;;
7877 case "$gccversion" in
7878 '') dflt="$dflt +vnocompatwarnings" ;;
7881 linux|irix*|gnu*) dflt="-shared $optimize" ;;
7882 next) dflt='none' ;;
7883 solaris) dflt='-G' ;;
7884 sunos) dflt='-assert nodefinitions' ;;
7885 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
7889 *) dflt="$lddlflags" ;;
7892 : Try to guess additional flags to pick up local libraries.
7893 : Be careful not to append to a plain 'none'
7897 for thisflag in $ldflags; do
7902 *) dflt="$dflt $thisflag" ;;
7909 ''|' ') dflt='none' ;;
7912 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
7915 none) lddlflags=' ' ;;
7916 *) lddlflags="$ans" ;;
7921 Some systems may require passing special flags to $cc to indicate that
7922 the resulting executable will use dynamic linking. To use no flags,
7926 case "$ccdlflags" in
7927 '') case "$osname" in
7928 linux|hpux|gnu*) dflt='-Wl,-E' ;;
7929 next|sunos) dflt='none' ;;
7933 *) dflt="$ccdlflags" ;;
7935 rp="Any special flags to pass to $cc to use dynamic linking?"
7938 none) ccdlflags=' ' ;;
7939 *) ccdlflags="$ans" ;;
7953 # No dynamic loading being used, so don't bother even to prompt.
7956 *) case "$useshrplib" in
7957 '') case "$osname" in
7958 svr4*|nonstopux|dgux|dynixptx|esix|powerux|beos|cygwin*)
7960 also='Building a shared libperl is required for dynamic loading to work on your system.'
7965 also='Building a shared libperl is needed for MAB support.'
7983 The perl executable is normally obtained by linking perlmain.c with
7984 libperl${_a}, any static extensions (usually just DynaLoader), and
7985 any other libraries needed on this system (such as -lm, etc.). Since
7986 your system supports dynamic loading, it is probably possible to build
7987 a shared libperl.$so. If you will have more than one executable linked
7988 to libperl.$so, this will significantly reduce the size of each
7989 executable, but it may have a noticeable effect on performance. The
7990 default is probably sensible for your system.
7994 rp="Build a shared libperl.$so (y/n)"
7998 useshrplib='true' ;;
7999 *) useshrplib='false' ;;
8004 case "$useshrplib" in
8008 # Figure out a good name for libperl.so. Since it gets stored in
8009 # a version-specific architecture-dependent library, the version
8010 # number isn't really that important, except for making cc/ld happy.
8012 # A name such as libperl.so.3.1
8013 majmin="libperl.$so.$patchlevel.$subversion"
8014 # A name such as libperl.so.301
8015 majonly=`echo $patchlevel $subversion |
8016 $awk '{printf "%d%02d", $1, $2}'`
8017 majonly=libperl.$so.$majonly
8018 # I'd prefer to keep the os-specific stuff here to a minimum, and
8019 # rely on figuring it out from the naming of libc.
8020 case "${osname}${osvers}" in
8023 # XXX How handle the --version stuff for MAB?
8025 linux*|gnu*) # ld won't link with a bare -lperl otherwise.
8028 cygwin*) # ld links against an importlib
8029 dflt=libperl$lib_ext
8031 *) # Try to guess based on whether libc has major.minor.
8033 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
8034 *libc.$so.[0-9]*) dflt=$majonly ;;
8035 *) dflt=libperl.$so ;;
8045 I need to select a good name for the shared libperl. If your system uses
8046 library names with major and minor numbers, then you might want something
8047 like $majmin. Alternatively, if your system uses a single version
8048 number for shared libraries, then you might want to use $majonly.
8049 Or, your system might be quite happy with a simple libperl.$so.
8051 Since the shared libperl will get installed into a version-specific
8052 architecture-dependent directory, the version number of the shared perl
8053 library probably isn't important, so the default should be o.k.
8056 rp='What name do you want to give to the shared libperl?'
8059 echo "Ok, I'll use $libperl"
8062 libperl="libperl${_a}"
8066 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
8070 WARNING: Use of the shrpdir variable for the installation location of
8071 the shared $libperl is not supported. It was never documented and
8072 will not work in this version. Let me (perlbug@perl.org)
8073 know of any problems this may cause.
8079 But your current setting of $shrpdir is
8080 the default anyway, so it's harmless.
8085 Further, your current attempted setting of $shrpdir
8086 conflicts with the value of $archlibexp/CORE
8087 that installperl will use.
8094 # How will the perl executable find the installed shared $libperl?
8095 # Add $xxx to ccdlflags.
8096 # If we can't figure out a command-line option, use $shrpenv to
8097 # set env LD_RUN_PATH. The main perl makefile uses this.
8098 shrpdir=$archlibexp/CORE
8101 if "$useshrplib"; then
8104 # We'll set it in Makefile.SH...
8109 freebsd|netbsd|openbsd|interix|dragonfly)
8110 xxx="-Wl,-R$shrpdir"
8112 bsdos|linux|irix*|dec_osf|gnu*)
8113 xxx="-Wl,-rpath,$shrpdir"
8116 # next doesn't like the default...
8119 # beos doesn't like the default, either.
8122 # hpux doesn't like the default, either.
8123 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
8126 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
8132 # Only add $xxx if it isn't already in ccdlflags.
8133 case " $ccdlflags " in
8135 *) ccdlflags="$ccdlflags $xxx"
8138 Adding $xxx to the flags
8139 passed to $ld so that the perl executable will find the
8140 installed shared $libperl.
8148 # Fix ccdlflags in AIX for building external extensions.
8149 # (For building Perl itself bare -bE:perl.exp is needed,
8150 # Makefile.SH takes care of this.)
8152 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8154 # Respect a hint or command-line value.
8156 '') shrpenv="$tmp_shrpenv" ;;
8158 case "$ldlibpthname" in
8159 '') ldlibpthname=LD_LIBRARY_PATH ;;
8160 none) ldlibpthname='' ;;
8163 : determine where manual pages are on this system
8167 syspath='/usr/share/man/man1 /usr/man/man1'
8168 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8169 syspath="$syspath /usr/man/u_man/man1"
8170 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8171 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8172 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8173 sysman=`./loc . /usr/man/man1 $syspath`
8176 if $test -d "$sysman"; then
8177 echo "System manual is in $sysman." >&4
8179 echo "Could not find manual pages in source form." >&4
8182 : determine where manual pages go
8183 set man1dir man1dir none
8187 $spackage has manual pages available in source form.
8191 echo "However, you don't have nroff, so they're probably useless to you."
8193 '') man1dir="none";;
8196 echo "If you don't want the manual sources installed, answer 'none'."
8201 lookpath="$prefixexp/share/man/man1"
8202 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8203 lookpath="$lookpath $prefixexp/man/p_man/man1"
8204 lookpath="$lookpath $prefixexp/man/u_man/man1"
8205 lookpath="$lookpath $prefixexp/man/man.1"
8207 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8208 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8218 rp="Where do the main $spackage manual pages (source) go?"
8220 if $test "X$man1direxp" != "X$ansexp"; then
8231 : What suffix to use on installed man pages
8238 rp="What suffix should be used for the main $spackage man pages?"
8240 '') case "$man1dir" in
8254 *) dflt="$man1ext";;
8261 : see if we can have long filenames
8263 first=123456789abcdef
8265 if (echo hi >$first) 2>/dev/null; then
8266 if $test -f 123456789abcde; then
8267 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8270 echo 'You can have filenames longer than 14 characters.'>&4
8275 You can't have filenames longer than 14 chars.
8276 You can't even think about them!
8282 $rm -rf 123456789abcde*
8284 : determine where library module manual pages go
8285 set man3dir man3dir none
8289 $spackage has manual pages for many of the library modules.
8295 However, you don't have nroff, so they're probably useless to you.
8298 '') man3dir="none";;
8302 case "$d_flexfnam" in
8305 However, your system can't handle the long file names like File::Basename.3.
8308 '') man3dir="none";;
8312 echo "If you don't want the manual sources installed, answer 'none'."
8313 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8315 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
8316 if $test -d "$privlib/man/man3"; then
8319 WARNING: Previous versions of perl installed man3 pages into
8320 $privlib/man/man3. This version will suggest a
8321 new default of $dflt.
8325 rp='Do you wish to preserve the old behavior?(y/n)'
8328 y*) dflt="$privlib/man/man3" ;;
8333 *) dflt="$man3dir" ;;
8340 rp="Where do the $package library man pages (source) go?"
8350 : What suffix to use on installed man pages
8356 rp="What suffix should be used for the $package library man pages?"
8358 '') case "$man3dir" in
8372 *) dflt="$man3ext";;
8379 : see if we have to deal with yellow pages, now NIS.
8380 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
8381 if $test -f /usr/etc/nibindd; then
8383 echo "I'm fairly confident you're on a NeXT."
8385 rp='Do you get the hosts file via NetInfo?'
8394 y*) hostcat='nidump hosts .';;
8395 *) case "$hostcat" in
8396 nidump*) hostcat='';;
8406 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
8414 rp='Are you getting the hosts file via yellow pages?'
8417 y*) hostcat='ypcat hosts';;
8418 *) hostcat='cat /etc/hosts';;
8424 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
8427 '') test -f /etc/group && groupcat='cat /etc/group';;
8430 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
8433 : now get the host name
8435 echo "Figuring out host name..." >&4
8436 case "$myhostname" in
8438 echo 'Maybe "hostname" will work...'
8439 if tans=`sh -c hostname 2>&1` ; then
8447 if $test "$cont"; then
8449 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
8450 if tans=`cat /etc/systemid 2>&1` ; then
8452 phostname='cat /etc/systemid'
8453 echo "Whadyaknow. Xenix always was a bit strange..."
8456 elif $test -r /etc/systemid; then
8457 echo "(What is a non-Xenix system doing with /etc/systemid?)"
8460 if $test "$cont"; then
8461 echo 'No, maybe "uuname -l" will work...'
8462 if tans=`sh -c 'uuname -l' 2>&1` ; then
8464 phostname='uuname -l'
8466 echo 'Strange. Maybe "uname -n" will work...'
8467 if tans=`sh -c 'uname -n' 2>&1` ; then
8469 phostname='uname -n'
8471 echo 'Oh well, maybe I can mine it out of whoami.h...'
8472 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
8473 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
8474 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
8476 case "$myhostname" in
8477 '') echo "Does this machine have an identity crisis or something?"
8480 echo "Well, you said $myhostname before..."
8481 phostname='echo $myhostname';;
8487 case "$myhostname" in
8488 '') myhostname=noname ;;
8490 : you do not want to know about this
8495 if $test "$myhostname" ; then
8497 rp='Your host name appears to be "'$myhostname'".'" Right?"
8505 : bad guess or no guess
8506 while $test "X$myhostname" = X ; do
8508 rp="Please type the (one word) name of your host:"
8513 : translate upper to lower if necessary
8514 case "$myhostname" in
8516 echo "(Normalizing case in your host name)"
8517 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
8521 case "$myhostname" in
8523 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
8524 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
8525 echo "(Trimming domain name from host name--host name is now $myhostname)"
8527 *) case "$mydomain" in
8530 test "X$hostcat" = "Xypcat hosts" &&
8531 ypmatch "$myhostname" hosts 2>/dev/null |\
8532 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
8535 test "X$hostcat" != "X" &&
8536 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
8537 /[ ]$myhostname[ . ]/p" > hosts
8540 if $test -f hosts; then
8541 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
8542 END { print sum }" hosts` = x1 || tmp_re="[ ]"
8543 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
8544 hosts | $sort | $uniq | \
8545 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
8546 case `$echo X$dflt` in
8547 X*\ *) echo "(Several hosts in the database matched hostname)"
8550 X.) echo "(You do not have fully-qualified names in the hosts database)"
8554 echo "(I cannot locate a hosts database anywhere)"
8559 tans=`./loc resolv.conf X /etc /usr/etc`
8560 if $test -f "$tans"; then
8561 echo "(Attempting domain name extraction from $tans)"
8562 dflt=.`$sed -n -e 's/ / /g' \
8563 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
8564 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8566 .) dflt=.`$sed -n -e 's/ / /g' \
8567 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
8568 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8575 .) echo "(No help from resolv.conf either -- attempting clever guess)"
8576 dflt=.`sh -c domainname 2>/dev/null`
8579 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
8583 case "$dflt$osname" in
8584 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
8585 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
8589 .) echo "(Lost all hope -- silly guess then)"
8595 *) dflt="$mydomain";;
8599 rp="What is your domain name?"
8609 : translate upper to lower if necessary
8612 echo "(Normalizing case in your domain name)"
8613 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
8617 : a little sanity check here
8618 case "$phostname" in
8621 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
8622 $myhostname$mydomain|$myhostname) ;;
8624 case "$phostname" in
8626 echo "(That doesn't agree with your whoami.h file, by the way.)"
8629 echo "(That doesn't agree with your $phostname command, by the way.)"
8639 I need to get your e-mail address in Internet format if possible, i.e.
8640 something like user@host.domain. Please answer accurately since I have
8641 no easy means to double check it. The default value provided below
8642 is most probably close to reality but may not be valid from outside
8643 your organization...
8647 while test "$cont"; do
8649 '') dflt="$cf_by@$myhostname$mydomain";;
8650 *) dflt="$cf_email";;
8652 rp='What is your e-mail address?'
8658 rp='Address does not look like an Internet one. Use it anyway?'
8674 If you or somebody else will be maintaining perl at your site, please
8675 fill in the correct e-mail address here so that they may be contacted
8676 if necessary. Currently, the "perlbug" program included with perl
8677 will send mail to this address in addition to perlbug@perl.org. You may
8678 enter "none" for no administrator.
8681 case "$perladmin" in
8682 '') dflt="$cf_email";;
8683 *) dflt="$perladmin";;
8685 rp='Perl administrator e-mail address'
8689 : determine whether to only install version-specific parts.
8692 Do you want to install only the version-specific parts of the perl
8693 distribution? Usually you do *not* want to do this.
8695 case "$versiononly" in
8696 "$define"|[Yy]*|true) dflt='y' ;;
8699 rp="Do you want to install only the version-specific parts of perl?"
8702 [yY]*) val="$define";;
8708 case "$versiononly" in
8709 "$define") inc_version_list=''
8710 inc_version_list_init=0
8714 : figure out how to guarantee perl startup
8715 : XXX Note that this currently takes advantage of the bug that binexp ignores
8716 : the Configure -Dinstallprefix setting, which in turn means that under
8717 : relocatable @INC, initialinstalllocation is what binexp started as.
8718 case "$startperl" in
8720 case "$sharpbang" in
8724 I can use the #! construct to start perl on your system. This will
8725 make startup of perl scripts faster, but may cause problems if you
8726 want to share those scripts and perl is not in a standard place
8727 ($initialinstalllocation/perl) on all your platforms. The alternative
8728 is to force a shell by starting the script with a single ':' character.
8731 case "$versiononly" in
8732 "$define") dflt="$initialinstalllocation/perl$version";;
8733 *) dflt="$initialinstalllocation/perl";;
8735 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
8738 none) startperl=": # use perl";;
8739 *) startperl="#!$ans"
8740 if $test 30 -lt `echo "$ans" | wc -c`; then
8743 WARNING: Some systems limit the #! command to 32 characters.
8744 If you experience difficulty running Perl scripts with #!, try
8745 installing Perl in a directory with a shorter pathname.
8751 *) startperl=": # use perl"
8756 echo "I'll use $startperl to start perl scripts."
8758 : figure best path for perl in scripts
8761 case "$versiononly" in
8762 "$define") perlpath="$initialinstalllocation/perl$version";;
8763 *) perlpath="$initialinstalllocation/perl";;
8765 case "$startperl" in
8770 I will use the "eval 'exec'" idiom to start Perl on your system.
8771 I can use the full path of your Perl binary for this purpose, but
8772 doing so may cause problems if you want to share those scripts and
8773 Perl is not always in a standard place ($initialinstalllocation/perl).
8776 dflt="$initialinstalllocation/perl"
8777 rp="What path shall I use in \"eval 'exec'\"?"
8784 case "$startperl" in
8786 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
8789 : determine where public executable scripts go
8790 set scriptdir scriptdir
8792 case "$scriptdir" in
8795 : guess some guesses
8796 $test -d /usr/share/scripts && dflt=/usr/share/scripts
8797 $test -d /usr/share/bin && dflt=/usr/share/bin
8798 $test -d /usr/local/script && dflt=/usr/local/script
8799 $test -d /usr/local/scripts && dflt=/usr/local/scripts
8800 $test -d $prefixexp/script && dflt=$prefixexp/script
8804 *) dflt="$scriptdir"
8809 Some installations have a separate directory just for executable scripts so
8810 that they can mount it across multiple architectures but keep the scripts in
8811 one spot. You might, for example, have a subdirectory of /usr/share for this.
8812 Or you might just lump your scripts in with all your other executables.
8816 rp='Where do you keep publicly executable scripts?'
8818 if $test "X$ansexp" != "X$scriptdirexp"; then
8824 : A little fix up for an irregularly named variable.
8825 installscript="$installscriptdir"
8827 : determine where add-on public executables go
8829 '') dflt=$siteprefix/bin ;;
8833 rp='Pathname where the add-on public executables should be installed?'
8838 : determine where add-on html pages go
8839 : There is no standard location, so try to copy the previously-selected
8840 : directory structure for the core html pages.
8841 case "$sitehtml1dir" in
8842 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
8843 *) dflt=$sitehtml1dir ;;
8846 ''|' ') dflt=none ;;
8849 rp='Pathname where the site-specific html pages should be installed?'
8851 prefixvar=sitehtml1dir
8854 : determine where add-on library html pages go
8855 : There is no standard location, so try to copy the previously-selected
8856 : directory structure for the core html pages.
8857 case "$sitehtml3dir" in
8858 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
8859 *) dflt=$sitehtml3dir ;;
8862 ''|' ') dflt=none ;;
8865 rp='Pathname where the site-specific library html pages should be installed?'
8867 prefixvar=sitehtml3dir
8870 : determine where add-on manual pages go
8871 case "$siteman1dir" in
8872 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
8873 *) dflt=$siteman1dir ;;
8876 ''|' ') dflt=none ;;
8879 rp='Pathname where the site-specific manual pages should be installed?'
8881 prefixvar=siteman1dir
8884 : determine where add-on library man pages go
8885 case "$siteman3dir" in
8886 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
8887 *) dflt=$siteman3dir ;;
8890 ''|' ') dflt=none ;;
8893 rp='Pathname where the site-specific library manual pages should be installed?'
8895 prefixvar=siteman3dir
8898 : determine where add-on public executable scripts go
8899 case "$sitescript" in
8900 '') dflt=$siteprefix/script
8901 $test -d $dflt || dflt=$sitebin ;;
8902 *) dflt="$sitescript" ;;
8905 rp='Pathname where add-on public executable scripts should be installed?'
8907 prefixvar=sitescript
8910 case "$usefaststdio" in
8911 $define|true|[yY]*|'')
8912 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
8922 Perl can be built to use 'fast stdio', which means using the stdio
8923 library but also directly manipulating the stdio buffers to enable
8924 faster I/O. Using stdio is better for backward compatibility (especially
8925 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
8926 interface has been preferred instead of stdio.
8928 If this doesn't make any sense to you, just accept the default '$dflt'.
8930 rp='Use the "fast stdio" if available?'
8933 y|Y) val="$define" ;;
8940 : define an is-a-typedef? function
8941 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8943 "") inclist="sys/types.h";;
8945 eval "varval=\$$var";
8949 for inc in $inclist; do
8950 echo "#include <$inc>" >>temp.c;
8952 echo "#ifdef $type" >> temp.c;
8953 echo "printf(\"We have $type\");" >> temp.c;
8954 echo "#endif" >> temp.c;
8955 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8956 if $contains $type temp.E >/dev/null 2>&1; then
8962 *) eval "$var=\$varval";;
8965 : define an is-a-typedef? function that prompts if the type is not available.
8966 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8968 "") inclist="sys/types.h";;
8970 eval "varval=\$$var";
8974 for inc in $inclist; do
8975 echo "#include <$inc>" >>temp.c;
8977 echo "#ifdef $type" >> temp.c;
8978 echo "printf(\"We have $type\");" >> temp.c;
8979 echo "#endif" >> temp.c;
8980 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8982 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
8983 if $contains $type temp.E >/dev/null 2>&1; then
8984 echo "$type found." >&4;
8987 echo "$type NOT found." >&4;
8993 *) eval "$var=\$varval";;
8996 : see what type lseek is declared as in the kernel
8997 rp="What is the type used for lseek's offset on this system?"
8998 set off_t lseektype long stdio.h sys/types.h
9002 echo "Checking to see how big your file offsets are..." >&4
9004 #include <sys/types.h>
9008 printf("%d\n", (int)sizeof($lseektype));
9013 if eval $compile_ok; then
9014 lseeksize=`$run ./try`
9015 echo "Your file offsets are $lseeksize bytes long."
9019 echo "(I can't seem to compile the test program. Guessing...)"
9020 rp="What is the size of your file offsets (in bytes)?"
9026 : see what type file positions are declared as in the library
9027 rp="What is the type for file position used by fsetpos()?"
9028 set fpos_t fpostype long stdio.h sys/types.h
9033 *_t) zzz="$fpostype" ;;
9036 echo "Checking the size of $zzz..." >&4
9038 #include <sys/types.h>
9045 printf("%d\n", (int)sizeof($fpostype));
9050 if eval $compile_ok; then
9054 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9057 echo "Your $zzz is $fpossize bytes long."
9063 echo "(I can't compile the test program. Guessing...)" >&4
9064 rp="What is the size of your file positions (in bytes)?"
9069 # Backward compatibility (uselfs is deprecated).
9071 "$define"|true|[yY]*)
9074 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
9076 uselargefiles="$define"
9080 case "$lseeksize:$fpossize" in
9083 You can have files larger than 2 gigabytes.
9086 *) case "$uselargefiles" in
9087 "$undef"|false|[nN]*) dflt='n' ;;
9092 Perl can be built to understand large files (files larger than 2 gigabytes)
9093 on some systems. To do so, Configure can be run with -Duselargefiles.
9095 If this doesn't make any sense to you, just accept the default '$dflt'.
9097 rp='Try to understand large files, if available?'
9100 y|Y) val="$define" ;;
9107 : Look for a hint-file generated 'call-back-unit'. If the
9108 : user has specified that a large files perl is to be built,
9109 : we may need to set or change some other defaults.
9110 if $test -f uselargefiles.cbu; then
9111 echo "Your platform has some specific hints regarding large file builds, using them..."
9112 . ./uselargefiles.cbu
9114 case "$uselargefiles" in
9116 if $test -f uselargefiles.cbu; then
9118 echo "Rechecking to see how big your file offsets are..." >&4
9120 #include <sys/types.h>
9124 printf("%d\n", (int)sizeof($lseektype));
9129 if eval $compile_ok; then
9130 lseeksize=`$run ./try`
9131 $echo "Your file offsets are now $lseeksize bytes long."
9135 echo "(I can't seem to compile the test program. Guessing...)"
9136 rp="What is the size of your file offsets (in bytes)?"
9141 *_t) zzz="$fpostype" ;;
9144 $echo $n "Rechecking the size of $zzz...$c" >&4
9146 #include <sys/types.h>
9153 printf("%d\n", (int)sizeof($fpostype));
9158 if eval $compile_ok; then
9163 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9166 echo " $fpossize bytes." >&4
9172 echo "(I can't compile the test program. Guessing...)" >&4
9173 rp="What is the size of your file positions (in bytes)?"
9182 case "$vendorprefix" in
9183 '') d_vendorbin="$undef"
9187 *) d_vendorbin="$define"
9188 : determine where vendor-supplied executables go.
9189 case "$vendorbin" in
9190 '') dflt=$vendorprefix/bin ;;
9191 *) dflt="$vendorbin" ;;
9194 rp='Pathname for the vendor-supplied executables directory?'
9197 vendorbinexp="$ansexp"
9203 case "$vendorprefix" in
9204 '') vendorhtml1dir=''
9205 vendorhtml1direxp=''
9207 *) : determine where vendor-supplied html pages go.
9208 : There is no standard location, so try to copy the previously-selected
9209 : directory structure for the core html pages.
9210 : XXX Better default suggestions would be welcome.
9211 case "$vendorhtml1dir" in
9212 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9213 *) dflt=$vendorhtml1dir ;;
9216 ''|' ') dflt=none ;;
9219 rp='Pathname for the vendor-supplied html pages?'
9221 vendorhtml1dir="$ans"
9222 vendorhtml1direxp="$ansexp"
9225 : Use ' ' for none so value is preserved next time through Configure
9226 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9227 prefixvar=vendorhtml1dir
9230 case "$vendorprefix" in
9231 '') vendorhtml3dir=''
9232 vendorhtml3direxp=''
9234 *) : determine where vendor-supplied module html pages go.
9235 : There is no standard location, so try to copy the previously-selected
9236 : directory structure for the core html pages.
9237 : XXX Better default suggestions would be welcome.
9238 case "$vendorhtml3dir" in
9239 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9240 *) dflt=$vendorhtml3dir ;;
9243 ''|' ') dflt=none ;;
9246 rp='Pathname for the vendor-supplied html pages?'
9248 vendorhtml3dir="$ans"
9249 vendorhtml3direxp="$ansexp"
9252 : Use ' ' for none so value is preserved next time through Configure
9253 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9254 prefixvar=vendorhtml3dir
9257 case "$vendorprefix" in
9258 '') vendorman1dir=''
9261 *) : determine where vendor-supplied manual pages go.
9262 case "$vendorman1dir" in
9263 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9264 *) dflt=$vendorman1dir ;;
9267 ''|' ') dflt=none ;;
9270 rp='Pathname for the vendor-supplied manual section 1 pages?'
9272 vendorman1dir="$ans"
9273 vendorman1direxp="$ansexp"
9276 : Use ' ' for none so value is preserved next time through Configure
9277 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
9278 prefixvar=vendorman1dir
9281 case "$vendorprefix" in
9282 '') vendorman3dir=''
9285 *) : determine where vendor-supplied module manual pages go.
9286 case "$vendorman3dir" in
9287 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9288 *) dflt=$vendorman3dir ;;
9291 ''|' ') dflt=none ;;
9294 rp='Pathname for the vendor-supplied manual section 3 pages?'
9296 vendorman3dir="$ans"
9297 vendorman3direxp="$ansexp"
9300 : Use ' ' for none so value is preserved next time through Configure
9301 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
9302 prefixvar=vendorman3dir
9305 case "$vendorprefix" in
9306 '') d_vendorscript="$undef"
9310 *) d_vendorscript="$define"
9311 : determine where vendor-supplied scripts go.
9312 case "$vendorscript" in
9313 '') dflt=$vendorprefix/script
9314 $test -d $dflt || dflt=$vendorbin ;;
9315 *) dflt="$vendorscript" ;;
9319 The installation process will create a directory for
9320 vendor-supplied scripts.
9324 rp='Pathname for the vendor-supplied scripts directory?'
9327 vendorscriptexp="$ansexp"
9330 prefixvar=vendorscript
9333 : see if qgcvt exists
9339 if $test X"$d_longdbl" = X"$define"; then
9341 echo "Checking how to print long doubles..." >&4
9343 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
9344 $cat >try.c <<'EOCP'
9345 #include <sys/types.h>
9349 printf("%.3f\n", d);
9353 if eval $compile; then
9357 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
9358 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
9359 echo "We will use %f."
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("%.3Lf\n", d);
9375 if eval $compile; then
9379 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
9380 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
9381 echo "We will use %Lf."
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("%.3llf\n", d);
9397 if eval $compile; then
9401 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
9402 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
9403 echo "We will use %llf."
9409 if $test X"$sPRIfldbl" = X; then
9410 $cat >try.c <<'EOCP'
9411 #include <sys/types.h>
9414 long double d = 123.456;
9415 printf("%.3lf\n", d);
9419 if eval $compile; then
9423 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
9424 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
9425 echo "We will use %lf."
9431 if $test X"$sPRIfldbl" = X; then
9432 echo "Cannot figure out how to print long doubles." >&4
9434 sSCNfldbl=$sPRIfldbl # expect consistency
9441 case "$sPRIfldbl" in
9442 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
9443 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
9444 d_SCNfldbl="$undef";
9446 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
9447 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
9448 d_SCNfldbl="$define";
9452 : Check how to convert floats to strings.
9454 if test "X$d_Gconvert" = X; then
9457 echo "Checking for an efficient way to convert floats to strings."
9459 case "$uselongdouble" in
9460 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
9462 case "$d_longdbl" in
9463 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
9465 case "$d_PRIgldbl" in
9466 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
9470 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
9471 char *myname = "gconvert";
9474 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
9475 char *myname = "gcvt";
9478 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
9479 char *myname = "qgcvt";
9480 #define DOUBLETYPE long double
9483 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9485 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
9487 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
9490 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
9492 char *myname = "sprintf";
9496 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9497 #define DOUBLETYPE long double
9499 #define DOUBLETYPE double
9505 #define I_STDLIB $i_stdlib
9511 checkit(expect, got)
9515 if (strcmp(expect, got)) {
9516 printf("%s oddity: Expected %s, got %s\n",
9517 myname, expect, got);
9527 /* This must be 1st test on (which?) platform */
9528 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
9529 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
9530 checkit("0.1", buf);
9532 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
9533 checkit("0.01", buf);
9535 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
9536 checkit("0.001", buf);
9538 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
9539 checkit("0.0001", buf);
9541 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
9542 if (strlen(buf) > 5)
9543 checkit("9e-005", buf); /* for Microsoft ?? */
9545 checkit("9e-05", buf);
9547 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
9550 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
9551 checkit("1.1", buf);
9553 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
9554 checkit("1.01", buf);
9556 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
9557 checkit("1.001", buf);
9559 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
9560 checkit("1.0001", buf);
9562 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
9563 checkit("1.00001", buf);
9565 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
9566 checkit("1.000001", buf);
9568 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
9571 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
9574 /* Some Linux gcvt's give 1.e+5 here. */
9575 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
9576 checkit("100000", buf);
9578 /* Some Linux gcvt's give -1.e+5 here. */
9579 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
9580 checkit("-100000", buf);
9582 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
9583 checkit("123.456", buf);
9585 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
9586 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
9587 /* 34 should be enough to scare even long double
9588 * places into using the e notation. */
9589 if (strlen(buf) > 5)
9590 checkit("1e+034", buf); /* for Microsoft */
9592 checkit("1e+34", buf);
9594 /* For Perl, if you add additional tests here, also add them to
9595 * t/base/num.t for benefit of platforms not using Configure or
9596 * overriding d_Gconvert */
9601 : first add preferred functions to our list
9603 for xxx_convert in $gconvert_preference; do
9604 case $xxx_convert in
9605 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
9606 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
9609 : then add any others
9610 for xxx_convert in gconvert gcvt sprintf; do
9613 *) xxx_list="$xxx_list $xxx_convert" ;;
9617 case "$d_longdbl$uselongdouble" in
9619 : again, add prefered functions to our list first
9621 for xxx_convert in $gconvert_ld_preference; do
9622 case $xxx_convert in
9623 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9624 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
9627 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
9628 for xxx_convert in qgcvt sprintf $xxx_list; do
9629 case "$xxx_ld_list" in
9630 $xxx_convert*|*" $xxx_convert"*) ;;
9631 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9634 : if sprintf cannot do long doubles, move it to the end
9635 if test "$d_PRIgldbl" != "$define"; then
9636 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
9638 : if no qgcvt, remove it
9639 if test "$d_qgcvt" != "$define"; then
9640 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
9643 xxx_list="$xxx_ld_list"
9647 for xxx_convert in $xxx_list; do
9648 echo "Trying $xxx_convert..."
9649 $rm -f try try$_o core
9650 set try -DTRY_$xxx_convert
9651 if eval $compile; then
9652 echo "$xxx_convert() found." >&4
9654 echo "I'll use $xxx_convert to convert floats into a string." >&4
9657 echo "...But $xxx_convert didn't work as I expected."
9661 echo "$xxx_convert NOT found." >&4
9665 if test X$xxx_convert = X; then
9666 echo "*** WHOA THERE!!! ***" >&4
9667 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
9671 case "$xxx_convert" in
9672 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
9673 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
9674 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
9675 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
9676 "$define$define$define")
9677 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
9678 "$define$define$undef")
9679 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
9680 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
9688 : see if _fwalk exists
9692 : Initialize h_fcntl
9695 : Initialize h_sysfile
9698 : access call always available on UNIX
9702 : locate the flags for 'access()'
9706 $cat >access.c <<EOCP
9707 #include <sys/types.h>
9712 #include <sys/file.h>
9725 : check sys/file.h first, no particular reason here
9726 if $test `./findhdr sys/file.h` && \
9727 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
9729 echo "<sys/file.h> defines the *_OK access constants." >&4
9730 elif $test `./findhdr fcntl.h` && \
9731 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
9733 echo "<fcntl.h> defines the *_OK access constants." >&4
9734 elif $test `./findhdr unistd.h` && \
9735 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
9736 echo "<unistd.h> defines the *_OK access constants." >&4
9738 echo "I can't find the four *_OK access constants--I'll use mine." >&4
9744 : see if accessx exists
9745 set accessx d_accessx
9748 : see if aintl exists
9752 : see if alarm exists
9756 : see if POSIX threads are available
9757 set pthread.h i_pthread
9760 : define a fucntion to check prototypes
9761 $cat > protochk <<EOSH
9764 optimize="$optimize"
9766 prototype="$prototype"
9769 usethreads=$usethreads
9770 i_pthread=$i_pthread
9771 pthread_h_first=$pthread_h_first
9774 $cat >> protochk <<'EOSH'
9779 while test $# -ge 2; do
9781 $define) echo "#include <$2>" >> try.c ;;
9782 literal) echo "$2" >> try.c ;;
9784 # Extra magic for the benefit of systems that need pthread.h
9785 # to be included early to correctly detect threadsafe functions.
9786 # Such functions must guarantee themselves, though, that the usethreads
9787 # and i_pthread have been defined, before calling protochk.
9788 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
9789 echo "#include <pthread.h>" >> try.c
9794 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
9795 cat >> try.c <<'EOCP'
9796 #ifdef CAN_PROTOTYPE
9797 #define _(args) args
9802 echo "$foo" >> try.c
9803 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
9804 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
9812 hasproto='varname=$1; func=$2; shift; shift;
9813 while $test $# -ge 2; do
9815 $define) echo "#include <$2>";;
9819 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
9820 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
9821 echo "$func() prototype found.";
9824 echo "$func() prototype NOT found.";
9831 : see if sys/types.h has to be included
9832 set sys/types.h i_systypes
9835 : see if sys/select.h has to be included
9836 set sys/select.h i_sysselct
9839 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
9840 while $test $# -ge 2; do
9842 $define) echo "#include <$2>";;
9846 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
9848 if eval $compile; then
9857 : see if we should include time.h, sys/time.h, or both
9859 if test "X$timeincl" = X; then
9860 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
9861 $echo $n "I'm now running the test program...$c"
9863 #include <sys/types.h>
9868 #ifdef SYSTIMEKERNEL
9871 #include <sys/time.h>
9874 #include <sys/select.h>
9887 struct timezone tzp;
9889 if (foo.tm_sec == foo.tm_sec)
9892 if (bar.tv_sec == bar.tv_sec)
9899 for s_timezone in '-DS_TIMEZONE' ''; do
9901 for s_timeval in '-DS_TIMEVAL' ''; do
9902 for i_systimek in '' '-DSYSTIMEKERNEL'; do
9903 for i_time in '' '-DI_TIME'; do
9904 for i_systime in '-DI_SYSTIME' ''; do
9907 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
9908 if eval $compile; then
9909 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
9913 $echo $n "Succeeded with $flags$c"
9925 *SYSTIMEKERNEL*) i_systimek="$define"
9926 timeincl=`./findhdr sys/time.h`
9927 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
9928 *) i_systimek="$undef";;
9931 *I_TIME*) i_time="$define"
9932 timeincl=`./findhdr time.h`" $timeincl"
9933 echo "We'll include <time.h>." >&4;;
9934 *) i_time="$undef";;
9937 *I_SYSTIME*) i_systime="$define"
9938 timeincl=`./findhdr sys/time.h`" $timeincl"
9939 echo "We'll include <sys/time.h>." >&4;;
9940 *) i_systime="$undef";;
9944 : see if struct tm knows about tm_zone
9945 case "$i_systime$i_time" in
9948 echo "Checking to see if your struct tm has tm_zone field..." >&4
9949 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
9957 case "$d_tm_tm_zone" in
9958 "$define") echo "Yes, it does." ;;
9959 *) echo "No, it doesn't." ;;
9961 : see if struct tm knows about tm_gmtoff
9962 case "$i_systime$i_time" in
9965 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
9966 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
9974 case "$d_tm_tm_gmtoff" in
9975 "$define") echo "Yes, it does." ;;
9976 *) echo "No, it doesn't." ;;
9979 : see if asctime_r exists
9980 set asctime_r d_asctime_r
9982 case "$d_asctime_r" in
9984 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
9985 case "$d_asctime_r_proto:$usethreads" in
9986 ":define") d_asctime_r_proto=define
9987 set d_asctime_r_proto asctime_r $hdrs
9991 case "$d_asctime_r_proto" in
9993 case "$asctime_r_proto" in
9994 ''|0) try='char* asctime_r(const struct tm*, char*);'
9995 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SB ;;
9997 case "$asctime_r_proto" in
9998 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
9999 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SBI ;;
10001 case "$asctime_r_proto" in
10002 ''|0) try='int asctime_r(const struct tm*, char*);'
10003 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SB ;;
10005 case "$asctime_r_proto" in
10006 ''|0) try='int asctime_r(const struct tm*, char*, int);'
10007 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SBI ;;
10009 case "$asctime_r_proto" in
10010 ''|0) d_asctime_r=undef
10012 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
10013 * ) case "$asctime_r_proto" in
10014 REENTRANT_PROTO*) ;;
10015 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
10017 echo "Prototype: $try" ;;
10020 *) case "$usethreads" in
10021 define) echo "asctime_r has no prototype, not using it." >&4 ;;
10028 *) asctime_r_proto=0
10032 : see if atolf exists
10036 : see if atoll exists
10040 : Look for GCC-style attribute format
10041 case "$d_attribute_format" in
10044 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
10045 $cat >attrib.c <<'EOCP'
10047 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
10049 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10050 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10051 echo "Your C compiler doesn't support __attribute__((format))."
10054 echo "Your C compiler supports __attribute__((format))."
10058 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10062 *) val="$d_attribute_format" ;;
10064 set d_attribute_format
10068 : Look for GCC-style attribute format with null format allowed
10069 case "$d_printf_format_null" in
10070 '') case "$d_attribute_format" in
10073 echo "Checking whether your compiler allows __printf__ format to be null ..." >&4
10074 $cat >attrib.c <<EOCP
10076 #$i_stdlib I_STDLIB
10078 #include <stdlib.h>
10080 int null_printf (char* pat,...) __attribute__((__format__(__printf__,1,2)));
10081 int null_printf (char* pat,...) { return (int)pat; }
10082 int main () { exit(null_printf(NULL)); }
10084 if $cc $ccflags -o attrib attrib.c >attrib.out 2>&1 ; then
10085 : run the executable in case it produces a run-time warning
10086 if $run ./attrib >>attrib.out 2>&1; then
10087 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10088 echo "Your C compiler doesn't allow __printf__ format to be null."
10091 echo "Your C compiler allows __printf__ format to be null."
10095 echo "Your C compiler executable failed with __printf__ format null."
10099 echo "Your C compiler fails with __printf__ format null."
10106 *) val="$d_printf_format_null" ;;
10108 set d_printf_format_null
10112 : Look for GCC-style attribute malloc
10113 case "$d_attribute_malloc" in
10116 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
10117 $cat >attrib.c <<'EOCP'
10119 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
10121 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10122 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10123 echo "Your C compiler doesn't support __attribute__((malloc))."
10126 echo "Your C compiler supports __attribute__((malloc))."
10130 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10134 *) val="$d_attribute_malloc" ;;
10136 set d_attribute_malloc
10140 : Look for GCC-style attribute nonnull
10141 case "$d_attribute_nonnull" in
10144 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
10145 $cat >attrib.c <<'EOCP'
10147 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
10149 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10150 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10151 echo "Your C compiler doesn't support __attribute__((nonnull))."
10154 echo "Your C compiler supports __attribute__((nonnull))."
10158 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10162 *) val="$d_attribute_nonnull" ;;
10164 set d_attribute_nonnull
10168 : Look for GCC-style attribute noreturn
10169 case "$d_attribute_noreturn" in
10172 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
10173 $cat >attrib.c <<'EOCP'
10175 void fall_over_dead( void ) __attribute__((noreturn));
10177 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10178 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10179 echo "Your C compiler doesn't support __attribute__((noreturn))."
10182 echo "Your C compiler supports __attribute__((noreturn))."
10186 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10190 *) val="$d_attribute_noreturn" ;;
10192 set d_attribute_noreturn
10196 : Look for GCC-style attribute pure
10197 case "$d_attribute_pure" in
10200 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
10201 $cat >attrib.c <<'EOCP'
10203 int square( int n ) __attribute__((pure));
10205 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10206 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10207 echo "Your C compiler doesn't support __attribute__((pure))."
10210 echo "Your C compiler supports __attribute__((pure))."
10214 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10218 *) val="$d_attribute_pure" ;;
10220 set d_attribute_pure
10224 : Look for GCC-style attribute unused
10225 case "$d_attribute_unused" in
10228 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
10229 $cat >attrib.c <<'EOCP'
10231 int do_something( int dummy __attribute__((unused)), int n );
10233 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10234 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10235 echo "Your C compiler doesn't support __attribute__((unused))."
10238 echo "Your C compiler supports __attribute__((unused))."
10242 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10246 *) val="$d_attribute_unused" ;;
10248 set d_attribute_unused
10252 : Look for GCC-style attribute warn_unused_result
10253 case "$d_attribute_warn_unused_result" in
10256 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
10257 $cat >attrib.c <<'EOCP'
10259 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
10261 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10262 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10263 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
10266 echo "Your C compiler supports __attribute__((warn_unused_result))."
10270 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10274 *) val="$d_attribute_warn_unused_result" ;;
10276 set d_attribute_warn_unused_result
10280 : see if bcmp exists
10284 : see if bcopy exists
10288 : see if getpgrp exists
10289 set getpgrp d_getpgrp
10292 case "$d_getpgrp" in
10295 echo "Checking to see which flavor of getpgrp is in use..."
10297 #$i_unistd I_UNISTD
10298 #include <sys/types.h>
10300 # include <unistd.h>
10302 #$i_stdlib I_STDLIB
10304 #include <stdlib.h>
10308 if (getuid() == 0) {
10309 printf("(I see you are running Configure as super-user...)\n");
10312 #ifdef TRY_BSD_PGRP
10313 if (getpgrp(1) == 0)
10322 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10323 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
10325 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10326 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
10329 echo "I can't seem to compile and run the test program."
10331 xxx="a USG one, i.e. you use getpgrp()."
10333 # SVR4 systems can appear rather BSD-ish.
10334 case "$i_unistd" in
10336 xxx="a BSD one, i.e. you use getpgrp(pid)."
10340 xxx="probably a USG one, i.e. you use getpgrp()."
10345 echo "Assuming your getpgrp is $xxx" >&4
10354 : see if setpgrp exists
10355 set setpgrp d_setpgrp
10358 case "$d_setpgrp" in
10361 echo "Checking to see which flavor of setpgrp is in use..."
10363 #$i_unistd I_UNISTD
10364 #include <sys/types.h>
10366 # include <unistd.h>
10368 #$i_stdlib I_STDLIB
10370 #include <stdlib.h>
10374 if (getuid() == 0) {
10375 printf("(I see you are running Configure as super-user...)\n");
10378 #ifdef TRY_BSD_PGRP
10379 if (-1 == setpgrp(1, 1))
10382 if (setpgrp() != -1)
10388 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10389 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
10391 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10392 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
10395 echo "(I can't seem to compile and run the test program.)"
10397 xxx="a USG one, i.e. you use setpgrp()."
10399 # SVR4 systems can appear rather BSD-ish.
10400 case "$i_unistd" in
10402 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
10406 xxx="probably a USG one, i.e. you use setpgrp()."
10411 echo "Assuming your setpgrp is $xxx" >&4
10420 : Look for GCC-style __builtin_choose_expr
10421 case "$d_builtin_choose_expr" in
10424 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
10425 $cat >try.c <<'EOCP'
10426 #include <assert.h>
10427 #include <stdlib.h>
10430 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
10433 assert( SYRINX(1) == 2112 );
10434 assert( SYRINX(1) != 5150 );
10435 assert( SYRINX(0) == 5150 );
10436 assert( SYRINX(0) != 2112 );
10437 puts( "All good!" );
10443 if eval $compile; then
10444 echo "Your C compiler supports __builtin_choose_expr."
10447 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
10451 *) val="$d_builtin_choose_expr" ;;
10454 set d_builtin_choose_expr
10458 : Look for GCC-style __builtin_expect
10459 case "$d_builtin_expect" in
10462 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
10463 $cat >builtin.c <<'EOCP'
10466 if ( __builtin_expect(n, 0) ) n = 1;
10470 if eval $compile; then
10471 echo "Your C compiler supports __builtin_choose_expr."
10474 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
10478 *) val="$d_builtin_expect" ;;
10481 set d_builtin_expect
10485 : see if bzero exists
10489 : see if stdarg is available
10491 if $test `./findhdr stdarg.h`; then
10492 echo "<stdarg.h> found." >&4
10495 echo "<stdarg.h> NOT found." >&4
10499 : see if varags is available
10501 if $test `./findhdr varargs.h`; then
10502 echo "<varargs.h> found." >&4
10504 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
10507 : set up the varargs testing programs
10508 $cat > varargs.c <<EOP
10510 #include <stdarg.h>
10513 #include <varargs.h>
10517 int f(char *p, ...)
10531 p = va_arg(ap, char *);
10537 $cat > varargs <<EOP
10539 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
10548 : now check which varargs header should be included
10553 if `./varargs I_STDARG`; then
10555 elif `./varargs I_VARARGS`; then
10560 if `./varargs I_VARARGS`; then
10567 echo "I could not find the definition for va_dcl... You have problems..." >&4
10568 val="$undef"; set i_stdarg; eval $setvar
10569 val="$undef"; set i_varargs; eval $setvar
10574 case "$i_varhdr" in
10576 val="$define"; set i_stdarg; eval $setvar
10577 val="$undef"; set i_varargs; eval $setvar
10580 val="$undef"; set i_stdarg; eval $setvar
10581 val="$define"; set i_varargs; eval $setvar
10584 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
10588 : see if the Compiler supports C99 variadic macros
10589 case "$i_stdarg$i_stdlib" in
10591 echo "You have <stdarg.h> and <stdlib.h>, so checking for C99 variadic macros." >&4
10594 #include <stdarg.h>
10596 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
10600 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
10606 if eval $compile && $run ./try 2>&1 >/dev/null; then
10607 case "`$run ./try`" in
10609 echo "You have C99 variadic macros." >&4
10610 d_c99_variadic_macros="$define"
10613 echo "You don't have functional C99 variadic macros." >&4
10614 d_c99_variadic_macros="$undef"
10618 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
10619 d_c99_variadic_macros="$undef"
10624 echo "You don't have <stdarg.h> and <stdlib.h>, so not checking for C99 variadic macros." >&4
10625 d_c99_variadic_macros="$undef"
10629 : see if signal is declared as pointer to function returning int or void
10631 xxx=`./findhdr signal.h`
10632 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
10633 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10634 echo "You have int (*signal())() instead of void." >&4
10636 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10637 echo "You have void (*signal())()." >&4
10639 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
10640 echo "You have int (*signal())() instead of void." >&4
10642 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
10643 echo "You have void (*signal())()." >&4
10646 case "$d_voidsig" in
10648 echo "I can't determine whether signal handler returns void or int..." >&4
10650 rp="What type does your signal handler return?"
10653 v*) val="$define";;
10657 echo "As you already told me, signal handler returns void." >&4
10660 *) echo "As you already told me, signal handler returns int." >&4
10667 case "$d_voidsig" in
10668 "$define") signal_t="void";;
10669 *) signal_t="int";;
10673 : check for ability to cast large floats to 32-bit ints.
10675 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
10676 if $test "$intsize" -ge 4; then
10683 #$i_stdlib I_STDLIB
10685 #include <stdlib.h>
10687 #include <sys/types.h>
10688 #include <signal.h>
10689 $signal_t blech(int s) { exit(3); }
10696 signal(SIGFPE, blech);
10698 /* Don't let compiler optimize the test away. Store the number
10699 in a writable string for gcc to pass to sscanf under HP/UX.
10701 sprintf(str, "2147483647");
10702 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
10706 /* x86 processors will probably give 0x8000 0000, which is a
10707 sign change. We don't want that. We want to mimic SPARC
10708 behavior here, which is to preserve the sign and give
10711 if (i32 != ($xxx) f)
10717 if eval $compile_ok; then
10721 echo "(I can't seem to compile the test program--assuming it can't)"
10726 echo "Yup, it can."
10729 echo "Nope, it can't."
10736 : check for ability to cast negative floats to unsigned
10738 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
10741 #$i_stdlib I_STDLIB
10743 #include <stdlib.h>
10745 #include <sys/types.h>
10746 #include <signal.h>
10747 $signal_t blech(int s) { exit(7); }
10748 $signal_t blech_in_list(int s) { exit(4); }
10749 unsigned long dummy_long(unsigned long p) { return p; }
10750 unsigned int dummy_int(unsigned int p) { return p; }
10751 unsigned short dummy_short(unsigned short p) { return p; }
10755 unsigned long along;
10757 unsigned short ashort;
10761 /* Frustrate gcc-2.7.2's optimizer which failed this test with
10762 a direct f = -123. assignment. gcc-2.8.0 reportedly
10763 optimized the whole file away
10765 /* Store the number in a writable string for gcc to pass to
10766 sscanf under HP/UX.
10768 sprintf(str, "-123");
10769 sscanf(str, "%lf", &f); /* f = -123.; */
10771 signal(SIGFPE, blech);
10772 along = (unsigned long)f;
10773 aint = (unsigned int)f;
10774 ashort = (unsigned short)f;
10775 if (along != (unsigned long)-123)
10777 if (aint != (unsigned int)-123)
10779 if (ashort != (unsigned short)-123)
10781 sprintf(str, "1073741824.");
10782 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
10785 along = (unsigned long)f;
10786 if (along != 0x80000000)
10790 along = (unsigned long)f;
10791 if (along != 0x7fffffff)
10795 along = (unsigned long)f;
10796 if (along != 0x80000001)
10800 signal(SIGFPE, blech_in_list);
10801 sprintf(str, "123.");
10802 sscanf(str, "%lf", &f); /* f = 123.; */
10803 along = dummy_long((unsigned long)f);
10804 aint = dummy_int((unsigned int)f);
10805 ashort = dummy_short((unsigned short)f);
10806 if (along != (unsigned long)123)
10808 if (aint != (unsigned int)123)
10810 if (ashort != (unsigned short)123)
10817 if eval $compile_ok; then
10821 echo "(I can't seem to compile the test program--assuming it can't)"
10824 case "$castflags" in
10826 echo "Yup, it can."
10829 echo "Nope, it can't."
10836 : see if vprintf exists
10838 if set vprintf val -f d_vprintf; eval $csym; $val; then
10839 echo 'vprintf() found.' >&4
10842 #$i_stdarg I_STDARG /* Only one of these can be defined by i_varhrd */
10843 #$i_varargs I_VARARGS
10845 #$i_stdlib I_STDLIB
10846 #$i_unistd I_UNISTD
10849 # include <stdarg.h>
10850 #else /* I_VARARGS */
10851 # include <varargs.h>
10855 # include <unistd.h>
10859 # include <stdlib.h>
10862 #include <stdio.h> /* vsprintf prototype */
10865 void xxx(int n, ...)
10870 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
10872 int main() { xxx(1, "foo"); }
10874 #else /* I_VARARGS */
10882 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
10884 int main() { xxx("foo"); }
10890 if eval $compile_ok; then
10891 if $run ./try; then
10892 echo "Your vsprintf() returns (int)." >&4
10895 echo "Your vsprintf() returns (char*)." >&4
10899 echo 'I am unable to compile the vsprintf() test program.' >&4
10900 # We shouldn't get here. If we do, assume the standard signature,
10901 # not the old BSD one.
10902 echo 'Guessing that vsprintf() returns (int).' >&4
10906 echo 'vprintf() NOT found.' >&4
10917 : see if chown exists
10921 : see if chroot exists
10922 set chroot d_chroot
10925 : see if chsize exists
10926 set chsize d_chsize
10929 : see if class exists
10933 : see if clearenv exists
10934 set clearenv d_clearenv
10937 hasstruct='varname=$1; struct=$2; shift; shift;
10938 while $test $# -ge 2; do
10940 $define) echo "#include <$2>";;
10944 echo "int main () { struct $struct foo; }" >> try.c;
10946 if eval $compile; then
10957 : see whether socket exists
10959 $echo $n "Hmm... $c" >&4
10960 if set socket val -f d_socket; eval $csym; $val; then
10961 echo "Looks like you have Berkeley networking support." >&4
10963 if set setsockopt val -f; eval $csym; $val; then
10966 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
10967 d_oldsock="$define"
10970 if $contains socklib libc.list >/dev/null 2>&1; then
10971 echo "Looks like you have Berkeley networking support." >&4
10973 : we will have to assume that it supports the 4.2 BSD interface
10976 echo "You don't have Berkeley networking in libc$_a..." >&4
10977 if test "X$d_socket" = "X$define"; then
10978 echo "...but you seem to believe that you have sockets." >&4
10980 for net in net socket
10982 if test -f /usr/lib/lib$net$_a; then
10983 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
10984 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
10985 if $contains socket libc.list >/dev/null 2>&1; then
10990 echo "...but the Wollongong group seems to have hacked it in." >&4
10991 sockethdr="-I/usr/netinclude"
10994 echo "Found Berkeley sockets interface in lib$net." >&4
10995 if $contains setsockopt libc.list >/dev/null 2>&1; then
10998 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
10999 d_oldsock="$define"
11005 if test "X$d_socket" != "X$define"; then
11006 echo "or anywhere else I see." >&4
11014 : see if socketpair exists
11015 set socketpair d_sockpair
11020 echo "Checking the availability of certain socket constants..." >&4
11021 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
11022 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
11024 #include <sys/types.h>
11025 #include <sys/socket.h>
11031 set try; if eval $compile; then
11034 set d_${enum}; eval $setvar
11038 : see if this is a sys/uio.h system
11039 set sys/uio.h i_sysuio
11044 echo "Checking to see if your system supports struct cmsghdr..." >&4
11045 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
11047 case "$d_cmsghdr_s" in
11048 "$define") echo "Yes, it does." ;;
11049 *) echo "No, it doesn't." ;;
11053 : check for const keyword
11055 echo 'Checking to see if your C compiler knows about "const"...' >&4
11056 $cat >const.c <<'EOCP'
11057 typedef struct spug { int drokk; } spug;
11061 const spug y = { 0 };
11064 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
11066 echo "Yup, it does."
11069 echo "Nope, it doesn't."
11074 : see if copysignl exists
11075 set copysignl d_copysignl
11078 : see if crypt exists
11083 $define) cryptlib='' ;;
11084 *) if set crypt val -f d_crypt; eval $csym; $val; then
11085 echo 'crypt() found.' >&4
11089 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
11090 if $test -z "$cryptlib"; then
11091 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
11095 if $test -z "$cryptlib"; then
11096 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
11100 if $test -z "$cryptlib"; then
11101 cryptlib=`./loc libcrypt$_a "" $libpth`
11105 if $test -z "$cryptlib"; then
11106 echo 'crypt() NOT found.' >&4
11117 : see if this is a crypt.h system
11118 set crypt.h i_crypt
11121 : see if crypt_r exists
11122 set crypt_r d_crypt_r
11124 case "$d_crypt_r" in
11126 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
11127 case "$d_crypt_r_proto:$usethreads" in
11128 ":define") d_crypt_r_proto=define
11129 set d_crypt_r_proto crypt_r $hdrs
11133 case "$d_crypt_r_proto" in
11135 case "$crypt_r_proto" in
11136 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
11137 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCS ;;
11139 case "$crypt_r_proto" in
11140 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
11141 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCD ;;
11143 case "$crypt_r_proto" in
11144 ''|0) d_crypt_r=undef
11146 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
11147 * ) case "$crypt_r_proto" in
11148 REENTRANT_PROTO*) ;;
11149 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
11151 echo "Prototype: $try" ;;
11154 *) case "$usethreads" in
11155 define) echo "crypt_r has no prototype, not using it." >&4 ;;
11166 : get csh whereabouts
11168 'csh') val="$undef" ;;
11169 *) val="$define" ;;
11173 : Respect a hint or command line value for full_csh.
11174 case "$full_csh" in
11175 '') full_csh=$csh ;;
11178 : see if ctermid exists
11179 set ctermid d_ctermid
11182 : see if ctermid_r exists
11183 set ctermid_r d_ctermid_r
11185 case "$d_ctermid_r" in
11187 hdrs="$i_systypes sys/types.h define stdio.h "
11188 case "$d_ctermid_r_proto:$usethreads" in
11189 ":define") d_ctermid_r_proto=define
11190 set d_ctermid_r_proto ctermid_r $hdrs
11194 case "$d_ctermid_r_proto" in
11196 case "$ctermid_r_proto" in
11197 ''|0) try='char* ctermid_r(char*);'
11198 ./protochk "extern $try" $hdrs && ctermid_r_proto=B_B ;;
11200 case "$ctermid_r_proto" in
11201 ''|0) d_ctermid_r=undef
11203 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
11204 * ) case "$ctermid_r_proto" in
11205 REENTRANT_PROTO*) ;;
11206 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
11208 echo "Prototype: $try" ;;
11211 *) case "$usethreads" in
11212 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
11219 *) ctermid_r_proto=0
11223 : see if ctime_r exists
11224 set ctime_r d_ctime_r
11226 case "$d_ctime_r" in
11228 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
11229 case "$d_ctime_r_proto:$usethreads" in
11230 ":define") d_ctime_r_proto=define
11231 set d_ctime_r_proto ctime_r $hdrs
11235 case "$d_ctime_r_proto" in
11237 case "$ctime_r_proto" in
11238 ''|0) try='char* ctime_r(const time_t*, char*);'
11239 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SB ;;
11241 case "$ctime_r_proto" in
11242 ''|0) try='char* ctime_r(const time_t*, char*, int);'
11243 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SBI ;;
11245 case "$ctime_r_proto" in
11246 ''|0) try='int ctime_r(const time_t*, char*);'
11247 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SB ;;
11249 case "$ctime_r_proto" in
11250 ''|0) try='int ctime_r(const time_t*, char*, int);'
11251 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SBI ;;
11253 case "$ctime_r_proto" in
11254 ''|0) d_ctime_r=undef
11256 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
11257 * ) case "$ctime_r_proto" in
11258 REENTRANT_PROTO*) ;;
11259 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
11261 echo "Prototype: $try" ;;
11264 *) case "$usethreads" in
11265 define) echo "ctime_r has no prototype, not using it." >&4 ;;
11276 : see if cuserid exists
11277 set cuserid d_cuserid
11280 : see if this is a limits.h system
11281 set limits.h i_limits
11284 : see if this is a float.h system
11285 set float.h i_float
11288 : See if number of significant digits in a double precision number is known
11290 $cat >dbl_dig.c <<EOM
11291 #$i_limits I_LIMITS
11294 #include <limits.h>
11300 printf("Contains DBL_DIG");
11303 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
11304 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
11305 echo "DBL_DIG found." >&4
11308 echo "DBL_DIG NOT found." >&4
11315 : see if dbm.h is available
11316 : see if dbmclose exists
11317 set dbmclose d_dbmclose
11320 case "$d_dbmclose" in
11330 *) set rpcsvc/dbm.h i_rpcsvcdbm
11335 *) echo "We won't be including <dbm.h>"
11345 : see if prototype for dbminit is available
11347 set d_dbminitproto dbminit $i_dbm dbm.h
11350 : see if difftime exists
11351 set difftime d_difftime
11354 : see if this is a dirent system
11356 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
11358 echo "<dirent.h> found." >&4
11361 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
11362 echo "<sys/dir.h> found." >&4
11365 xinc=`./findhdr sys/ndir.h`
11367 echo "<dirent.h> NOT found." >&4
11372 : Look for type of directory structure.
11374 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11376 case "$direntrytype" in
11378 case "$i_dirent" in
11379 $define) guess1='struct dirent' ;;
11380 *) guess1='struct direct' ;;
11383 *) guess1="$direntrytype"
11388 'struct dirent') guess2='struct direct' ;;
11389 *) guess2='struct dirent' ;;
11392 if $contains "$guess1" try.c >/dev/null 2>&1; then
11393 direntrytype="$guess1"
11394 echo "Your directory entries are $direntrytype." >&4
11395 elif $contains "$guess2" try.c >/dev/null 2>&1; then
11396 direntrytype="$guess2"
11397 echo "Your directory entries seem to be $direntrytype." >&4
11399 echo "I don't recognize your system's directory entries." >&4
11400 rp="What type is used for directory entries on this system?"
11403 direntrytype="$ans"
11407 : see if the directory entry stores field length
11409 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11410 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
11411 echo "Good, your directory entry keeps length information in d_namlen." >&4
11414 echo "Your directory entry does not know about the d_namlen field." >&4
11421 : Look for DIR.dd_fd
11422 case "$i_dirent" in
11424 echo "Checking to see if DIR has a dd_fd member variable" >&4
11426 #$i_stdlib I_STDLIB
11428 #include <stdlib.h>
11430 #include <dirent.h>
11440 if eval $compile; then
11441 echo "Yes, it does."
11444 echo "No, it does not."
11449 echo "You don't have a <dirent.h>, so not checking for dd_fd." >&4
11457 : see if this is an sysdir system
11458 set sys/dir.h i_sysdir
11461 : see if this is an sysndir system
11462 set sys/ndir.h i_sysndir
11467 $cat >dirfd.c <<EOM
11469 #$i_stdlib I_STDLIB
11471 #include <stdlib.h>
11473 #$i_dirent I_DIRENT /**/
11474 #$i_sysdir I_SYS_DIR /**/
11475 #$i_sysndir I_SYS_NDIR /**/
11476 #$i_systypes I_SYS_TYPES /**/
11477 #if defined(I_SYS_TYPES)
11478 #include <sys/types.h>
11480 #if defined(I_DIRENT)
11481 #include <dirent.h>
11482 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
11483 #include <sys/dir.h>
11487 #include <sys/ndir.h>
11491 #include <ndir.h> /* may be wrong in the future */
11493 #include <sys/dir.h>
11499 DIR *dirp = opendir(".");
11500 if (dirfd(dirp) >= 0)
11508 if eval $compile; then
11512 $define) echo "dirfd() found." >&4 ;;
11513 *) echo "dirfd() NOT found." >&4 ;;
11519 : see if dlerror exists
11522 set dlerror d_dlerror
11526 : see if dlfcn is available
11527 set dlfcn.h i_dlfcn
11534 On a few systems, the dynamically loaded modules that perl generates and uses
11535 will need a different extension than shared libs. The default will probably
11541 *) dflt="$dlext" ;;
11543 rp='What is the extension of dynamically loaded modules'
11552 : Check if dlsym need a leading underscore
11558 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
11559 $cat >dyna.c <<'EOM'
11566 #$i_stdlib I_STDLIB
11568 #include <stdlib.h>
11572 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
11574 #include <sys/types.h>
11579 extern int fred() ;
11588 int mode = RTLD_LAZY ;
11590 handle = dlopen("./dyna.$dlext", mode) ;
11591 if (handle == NULL) {
11596 symbol = dlsym(handle, "fred") ;
11597 if (symbol == NULL) {
11598 /* try putting a leading underscore */
11599 symbol = dlsym(handle, "_fred") ;
11600 if (symbol == NULL) {
11613 : Call the object file tmp-dyna.o in case dlext=o.
11614 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
11615 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
11616 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
11617 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
11620 1) echo "Test program failed using dlopen." >&4
11621 echo "Perhaps you should not use dynamic loading." >&4;;
11622 2) echo "Test program failed using dlsym." >&4
11623 echo "Perhaps you should not use dynamic loading." >&4;;
11624 3) echo "dlsym needs a leading underscore" >&4
11626 4) echo "dlsym doesn't need a leading underscore." >&4;;
11629 echo "I can't compile and run the test program." >&4
11630 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
11635 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
11640 : see if drand48_r exists
11641 set drand48_r d_drand48_r
11643 case "$d_drand48_r" in
11645 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
11646 case "$d_drand48_r_proto:$usethreads" in
11647 ":define") d_drand48_r_proto=define
11648 set d_drand48_r_proto drand48_r $hdrs
11652 case "$d_drand48_r_proto" in
11654 case "$drand48_r_proto" in
11655 ''|0) try='int drand48_r(struct drand48_data*, double*);'
11656 ./protochk "extern $try" $hdrs && drand48_r_proto=I_ST ;;
11658 case "$drand48_r_proto" in
11659 ''|0) d_drand48_r=undef
11661 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
11662 * ) case "$drand48_r_proto" in
11663 REENTRANT_PROTO*) ;;
11664 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
11666 echo "Prototype: $try" ;;
11669 *) case "$usethreads" in
11670 define) echo "drand48_r has no prototype, not using it." >&4 ;;
11677 *) drand48_r_proto=0
11681 : see if prototype for drand48 is available
11683 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
11686 : see if dup2 exists
11690 : see if eaccess exists
11691 set eaccess d_eaccess
11694 : see if endgrent exists
11695 set endgrent d_endgrent
11698 : see if this is an grp system
11704 xxx=`./findhdr grp.h`
11705 $cppstdin $cppflags $cppminus < $xxx >$$.h
11707 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
11719 set d_grpasswd; eval $setvar
11723 : see if endgrent_r exists
11724 set endgrent_r d_endgrent_r
11726 case "$d_endgrent_r" in
11728 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
11729 case "$d_endgrent_r_proto:$usethreads" in
11730 ":define") d_endgrent_r_proto=define
11731 set d_endgrent_r_proto endgrent_r $hdrs
11735 case "$d_endgrent_r_proto" in
11737 case "$endgrent_r_proto" in
11738 ''|0) try='int endgrent_r(FILE**);'
11739 ./protochk "extern $try" $hdrs && endgrent_r_proto=I_H ;;
11741 case "$endgrent_r_proto" in
11742 ''|0) try='void endgrent_r(FILE**);'
11743 ./protochk "extern $try" $hdrs && endgrent_r_proto=V_H ;;
11745 case "$endgrent_r_proto" in
11746 ''|0) d_endgrent_r=undef
11748 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
11749 * ) case "$endgrent_r_proto" in
11750 REENTRANT_PROTO*) ;;
11751 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
11753 echo "Prototype: $try" ;;
11756 *) case "$usethreads" in
11757 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
11764 *) endgrent_r_proto=0
11768 : see if endhostent exists
11769 set endhostent d_endhent
11772 : see if this is a netdb.h system
11773 set netdb.h i_netdb
11776 : see if endhostent_r exists
11777 set endhostent_r d_endhostent_r
11779 case "$d_endhostent_r" in
11781 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11782 case "$d_endhostent_r_proto:$usethreads" in
11783 ":define") d_endhostent_r_proto=define
11784 set d_endhostent_r_proto endhostent_r $hdrs
11788 case "$d_endhostent_r_proto" in
11790 case "$endhostent_r_proto" in
11791 ''|0) try='int endhostent_r(struct hostent_data*);'
11792 ./protochk "extern $try" $hdrs && endhostent_r_proto=I_D ;;
11794 case "$endhostent_r_proto" in
11795 ''|0) try='void endhostent_r(struct hostent_data*);'
11796 ./protochk "extern $try" $hdrs && endhostent_r_proto=V_D ;;
11798 case "$endhostent_r_proto" in
11799 ''|0) d_endhostent_r=undef
11800 endhostent_r_proto=0
11801 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
11802 * ) case "$endhostent_r_proto" in
11803 REENTRANT_PROTO*) ;;
11804 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
11806 echo "Prototype: $try" ;;
11809 *) case "$usethreads" in
11810 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
11812 d_endhostent_r=undef
11813 endhostent_r_proto=0
11817 *) endhostent_r_proto=0
11821 : see if endnetent exists
11822 set endnetent d_endnent
11825 : see if endnetent_r exists
11826 set endnetent_r d_endnetent_r
11828 case "$d_endnetent_r" in
11830 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11831 case "$d_endnetent_r_proto:$usethreads" in
11832 ":define") d_endnetent_r_proto=define
11833 set d_endnetent_r_proto endnetent_r $hdrs
11837 case "$d_endnetent_r_proto" in
11839 case "$endnetent_r_proto" in
11840 ''|0) try='int endnetent_r(struct netent_data*);'
11841 ./protochk "extern $try" $hdrs && endnetent_r_proto=I_D ;;
11843 case "$endnetent_r_proto" in
11844 ''|0) try='void endnetent_r(struct netent_data*);'
11845 ./protochk "extern $try" $hdrs && endnetent_r_proto=V_D ;;
11847 case "$endnetent_r_proto" in
11848 ''|0) d_endnetent_r=undef
11849 endnetent_r_proto=0
11850 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
11851 * ) case "$endnetent_r_proto" in
11852 REENTRANT_PROTO*) ;;
11853 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
11855 echo "Prototype: $try" ;;
11858 *) case "$usethreads" in
11859 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
11861 d_endnetent_r=undef
11862 endnetent_r_proto=0
11866 *) endnetent_r_proto=0
11870 : see if endprotoent exists
11871 set endprotoent d_endpent
11874 : see if endprotoent_r exists
11875 set endprotoent_r d_endprotoent_r
11877 case "$d_endprotoent_r" in
11879 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11880 case "$d_endprotoent_r_proto:$usethreads" in
11881 ":define") d_endprotoent_r_proto=define
11882 set d_endprotoent_r_proto endprotoent_r $hdrs
11886 case "$d_endprotoent_r_proto" in
11888 case "$endprotoent_r_proto" in
11889 ''|0) try='int endprotoent_r(struct protoent_data*);'
11890 ./protochk "extern $try" $hdrs && endprotoent_r_proto=I_D ;;
11892 case "$endprotoent_r_proto" in
11893 ''|0) try='void endprotoent_r(struct protoent_data*);'
11894 ./protochk "extern $try" $hdrs && endprotoent_r_proto=V_D ;;
11896 case "$endprotoent_r_proto" in
11897 ''|0) d_endprotoent_r=undef
11898 endprotoent_r_proto=0
11899 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
11900 * ) case "$endprotoent_r_proto" in
11901 REENTRANT_PROTO*) ;;
11902 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
11904 echo "Prototype: $try" ;;
11907 *) case "$usethreads" in
11908 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
11910 d_endprotoent_r=undef
11911 endprotoent_r_proto=0
11915 *) endprotoent_r_proto=0
11919 : see if endpwent exists
11920 set endpwent d_endpwent
11923 : see if this is a pwd.h system
11929 xxx=`./findhdr pwd.h`
11930 $cppstdin $cppflags $cppminus < $xxx >$$.h
11932 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
11940 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
11948 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
11956 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
11964 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
11972 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
11980 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
11988 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
12000 set d_pwquota; eval $setvar
12001 set d_pwage; eval $setvar
12002 set d_pwchange; eval $setvar
12003 set d_pwclass; eval $setvar
12004 set d_pwexpire; eval $setvar
12005 set d_pwcomment; eval $setvar
12006 set d_pwgecos; eval $setvar
12007 set d_pwpasswd; eval $setvar
12011 : see if endpwent_r exists
12012 set endpwent_r d_endpwent_r
12014 case "$d_endpwent_r" in
12016 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
12017 case "$d_endpwent_r_proto:$usethreads" in
12018 ":define") d_endpwent_r_proto=define
12019 set d_endpwent_r_proto endpwent_r $hdrs
12023 case "$d_endpwent_r_proto" in
12025 case "$endpwent_r_proto" in
12026 ''|0) try='int endpwent_r(FILE**);'
12027 ./protochk "extern $try" $hdrs && endpwent_r_proto=I_H ;;
12029 case "$endpwent_r_proto" in
12030 ''|0) try='void endpwent_r(FILE**);'
12031 ./protochk "extern $try" $hdrs && endpwent_r_proto=V_H ;;
12033 case "$endpwent_r_proto" in
12034 ''|0) d_endpwent_r=undef
12036 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
12037 * ) case "$endpwent_r_proto" in
12038 REENTRANT_PROTO*) ;;
12039 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
12041 echo "Prototype: $try" ;;
12044 *) case "$usethreads" in
12045 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
12052 *) endpwent_r_proto=0
12056 : see if endservent exists
12057 set endservent d_endsent
12060 : see if endservent_r exists
12061 set endservent_r d_endservent_r
12063 case "$d_endservent_r" in
12065 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12066 case "$d_endservent_r_proto:$usethreads" in
12067 ":define") d_endservent_r_proto=define
12068 set d_endservent_r_proto endservent_r $hdrs
12072 case "$d_endservent_r_proto" in
12074 case "$endservent_r_proto" in
12075 ''|0) try='int endservent_r(struct servent_data*);'
12076 ./protochk "extern $try" $hdrs && endservent_r_proto=I_D ;;
12078 case "$endservent_r_proto" in
12079 ''|0) try='void endservent_r(struct servent_data*);'
12080 ./protochk "extern $try" $hdrs && endservent_r_proto=V_D ;;
12082 case "$endservent_r_proto" in
12083 ''|0) d_endservent_r=undef
12084 endservent_r_proto=0
12085 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
12086 * ) case "$endservent_r_proto" in
12087 REENTRANT_PROTO*) ;;
12088 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
12090 echo "Prototype: $try" ;;
12093 *) case "$usethreads" in
12094 define) echo "endservent_r has no prototype, not using it." >&4 ;;
12096 d_endservent_r=undef
12097 endservent_r_proto=0
12101 *) endservent_r_proto=0
12105 : Locate the flags for 'open()'
12108 #include <sys/types.h>
12113 #include <sys/file.h>
12115 #$i_stdlib I_STDLIB
12117 #include <stdlib.h>
12128 : check sys/file.h first to get FREAD on Sun
12129 if $test `./findhdr sys/file.h` && \
12130 set try -DI_SYS_FILE && eval $compile; then
12132 echo "<sys/file.h> defines the O_* constants..." >&4
12133 if $run ./try; then
12134 echo "and you have the 3 argument form of open()." >&4
12137 echo "but not the 3 argument form of open(). Oh, well." >&4
12140 elif $test `./findhdr fcntl.h` && \
12141 set try -DI_FCNTL && eval $compile; then
12143 echo "<fcntl.h> defines the O_* constants..." >&4
12144 if $run ./try; then
12145 echo "and you have the 3 argument form of open()." >&4
12148 echo "but not the 3 argument form of open(). Oh, well." >&4
12153 echo "I can't find the O_* constant definitions! You got problems." >&4
12159 : see which of string.h or strings.h is needed
12161 strings=`./findhdr string.h`
12162 if $test "$strings" && $test -r "$strings"; then
12163 echo "Using <string.h> instead of <strings.h>." >&4
12167 strings=`./findhdr strings.h`
12168 if $test "$strings" && $test -r "$strings"; then
12169 echo "Using <strings.h> instead of <string.h>." >&4
12171 echo "No string header found -- You'll surely have problems." >&4
12176 case "$i_string" in
12177 "$undef") strings=`./findhdr strings.h`;;
12178 *) strings=`./findhdr string.h`;;
12181 : see if this is a sys/file.h system
12186 : do we need to include sys/file.h ?
12190 if $h_sysfile; then
12192 echo "We'll be including <sys/file.h>." >&4
12195 echo "We won't be including <sys/file.h>." >&4
12205 : see if fcntl.h is there
12210 : see if we can include fcntl.h
12216 echo "We'll be including <fcntl.h>." >&4
12219 if $h_sysfile; then
12220 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
12222 echo "We won't be including <fcntl.h>." >&4
12234 : see if fork exists
12238 : see if pipe exists
12242 : check for non-blocking I/O stuff
12243 case "$h_sysfile" in
12244 true) echo "#include <sys/file.h>" > head.c;;
12247 true) echo "#include <fcntl.h>" > head.c;;
12248 *) echo "#include <sys/fcntl.h>" > head.c;;
12253 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
12254 case "$o_nonblock" in
12256 $cat head.c > try.c
12257 $cat >>try.c <<EOCP
12259 #$i_stdlib I_STDLIB
12261 #include <stdlib.h>
12269 printf("O_NONBLOCK\n");
12273 printf("O_NDELAY\n");
12277 printf("FNDELAY\n");
12284 if eval $compile_ok; then
12285 o_nonblock=`$run ./try`
12286 case "$o_nonblock" in
12287 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
12288 *) echo "Seems like we can use $o_nonblock.";;
12291 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
12294 *) echo "Using $hint value $o_nonblock.";;
12299 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
12302 case "$d_fork:$d_pipe" in
12304 $cat head.c > try.c
12305 $cat >>try.c <<EOCP
12307 #include <sys/types.h>
12308 #include <signal.h>
12310 #$i_stdlib I_STDLIB
12312 #include <stdlib.h>
12318 #define MY_O_NONBLOCK $o_nonblock
12319 #ifndef errno /* XXX need better Configure test */
12322 #$i_unistd I_UNISTD
12324 #include <unistd.h>
12326 #$i_string I_STRING
12328 #include <string.h>
12330 #include <strings.h>
12332 $signal_t blech(int x) { exit(3); }
12334 $cat >> try.c <<'EOCP'
12342 pipe(pd); /* Down: child -> parent */
12343 pipe(pu); /* Up: parent -> child */
12346 close(pd[1]); /* Parent reads from pd[0] */
12347 close(pu[0]); /* Parent writes (blocking) to pu[1] */
12349 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
12354 signal(SIGALRM, blech);
12356 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
12358 sprintf(string, "%d\n", ret);
12359 write(2, string, strlen(string));
12362 if (errno == EAGAIN) {
12363 printf("EAGAIN\n");
12368 if (errno == EWOULDBLOCK)
12369 printf("EWOULDBLOCK\n");
12372 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
12373 sleep(2); /* Give it time to close our pipe */
12375 ret = read(pd[0], buf, 1); /* Should read EOF */
12377 sprintf(string, "%d\n", ret);
12378 write(4, string, strlen(string));
12382 close(pd[0]); /* We write to pd[1] */
12383 close(pu[1]); /* We read from pu[0] */
12384 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
12385 close(pd[1]); /* Pipe pd is now fully closed! */
12386 exit(0); /* Bye bye, thank you for playing! */
12390 if eval $compile_ok; then
12391 echo "$startsh" >mtry
12392 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
12394 ./mtry >/dev/null 2>&1
12396 0) eagain=`$cat try.out`;;
12397 1) echo "Could not perform non-blocking setting!";;
12398 2) echo "I did a successful read() for something that was not there!";;
12399 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
12400 4) echo "Could not find F_SETFL!";;
12401 *) echo "Something terribly wrong happened during testing.";;
12403 rd_nodata=`$cat try.ret`
12404 echo "A read() system call with no data present returns $rd_nodata."
12405 case "$rd_nodata" in
12408 echo "(That's peculiar, fixing that to be -1.)"
12414 echo "Forcing errno EAGAIN on read() with no data available."
12418 echo "Your read() sets errno to $eagain when no data is available."
12421 status=`$cat try.err`
12423 0) echo "And it correctly returns 0 to signal EOF.";;
12424 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
12425 *) echo "However, your read() returns '$status' on EOF??";;
12428 if test "$status" = "$rd_nodata"; then
12429 echo "WARNING: you can't distinguish between EOF and no data!"
12433 echo "I can't compile the test program--assuming errno EAGAIN will do."
12437 *) echo "Can't figure out how to test this--assuming errno EAGAIN will do."
12446 echo "Using $hint value $eagain."
12447 echo "Your read() returns $rd_nodata when no data is present."
12448 case "$d_eofnblk" in
12449 "$define") echo "And you can see EOF because read() returns 0.";;
12450 "$undef") echo "But you can't see EOF status from read() returned value.";;
12452 echo "(Assuming you can't see EOF status from read anyway.)"
12458 $rm_try head.c mtry
12460 : see if _ptr and _cnt from stdio act std
12463 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
12464 echo "(Looks like you have stdio.h from BSD.)"
12465 case "$stdio_ptr" in
12466 '') stdio_ptr='((fp)->_p)'
12469 *) ptr_lval=$d_stdio_ptr_lval;;
12471 case "$stdio_cnt" in
12472 '') stdio_cnt='((fp)->_r)'
12475 *) cnt_lval=$d_stdio_cnt_lval;;
12477 case "$stdio_base" in
12478 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
12480 case "$stdio_bufsiz" in
12481 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
12483 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
12484 echo "(Looks like you have stdio.h from Linux.)"
12485 case "$stdio_ptr" in
12486 '') stdio_ptr='((fp)->_IO_read_ptr)'
12489 *) ptr_lval=$d_stdio_ptr_lval;;
12491 case "$stdio_cnt" in
12492 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
12495 *) cnt_lval=$d_stdio_cnt_lval;;
12497 case "$stdio_base" in
12498 '') stdio_base='((fp)->_IO_read_base)';;
12500 case "$stdio_bufsiz" in
12501 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
12504 case "$stdio_ptr" in
12505 '') stdio_ptr='((fp)->_ptr)'
12508 *) ptr_lval=$d_stdio_ptr_lval;;
12510 case "$stdio_cnt" in
12511 '') stdio_cnt='((fp)->_cnt)'
12514 *) cnt_lval=$d_stdio_cnt_lval;;
12516 case "$stdio_base" in
12517 '') stdio_base='((fp)->_base)';;
12519 case "$stdio_bufsiz" in
12520 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
12524 : test whether _ptr and _cnt really work
12525 echo "Checking how std your stdio is..." >&4
12528 #$i_stdlib I_STDLIB
12530 #include <stdlib.h>
12532 #define FILE_ptr(fp) $stdio_ptr
12533 #define FILE_cnt(fp) $stdio_cnt
12535 FILE *fp = fopen("try.c", "r");
12538 18 <= FILE_cnt(fp) &&
12539 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12547 if eval $compile && $to try.c; then
12548 if $run ./try; then
12549 echo "Your stdio acts pretty std."
12552 echo "Your stdio isn't very std."
12555 echo "Your stdio doesn't appear very std."
12559 # glibc 2.2.90 and above apparently change stdio streams so Perl's
12560 # direct buffer manipulation no longer works. The Configure tests
12561 # should be changed to correctly detect this, but until then,
12562 # the following check should at least let perl compile and run.
12563 # (This quick fix should be updated before 5.8.1.)
12564 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
12565 # A. Dougherty, June 3, 2002.
12566 case "$d_gnulibc" in
12568 case "$gnulibc_version" in
12572 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
12581 : Can _ptr be used as an lvalue?
12582 case "$d_stdstdio$ptr_lval" in
12583 $define$define) val=$define ;;
12586 set d_stdio_ptr_lval
12589 : Can _cnt be used as an lvalue?
12590 case "$d_stdstdio$cnt_lval" in
12591 $define$define) val=$define ;;
12594 set d_stdio_cnt_lval
12598 : test whether setting _ptr sets _cnt as a side effect
12599 d_stdio_ptr_lval_sets_cnt="$undef"
12600 d_stdio_ptr_lval_nochange_cnt="$undef"
12601 case "$d_stdio_ptr_lval$d_stdstdio" in
12603 echo "Checking to see what happens if we set the stdio ptr..." >&4
12606 /* Can we scream? */
12607 /* Eat dust sed :-) */
12608 /* In the buffer space, no one can hear you scream. */
12609 #$i_stdlib I_STDLIB
12611 #include <stdlib.h>
12613 #define FILE_ptr(fp) $stdio_ptr
12614 #define FILE_cnt(fp) $stdio_cnt
12615 #include <sys/types.h>
12617 FILE *fp = fopen("try.c", "r");
12622 puts("Fail even to read");
12625 c = getc(fp); /* Read away the first # */
12627 puts("Fail even to read");
12631 18 <= FILE_cnt(fp) &&
12632 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12634 puts("Fail even to read");
12637 ptr = (char*) FILE_ptr(fp);
12638 cnt = (size_t)FILE_cnt(fp);
12640 FILE_ptr(fp) += 42;
12642 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
12643 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
12646 if (FILE_cnt(fp) <= 20) {
12647 printf ("Fail (<20 chars to test)");
12650 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
12651 puts("Fail compare");
12654 if (cnt == FILE_cnt(fp)) {
12655 puts("Pass_unchanged");
12658 if (FILE_cnt(fp) == (cnt - 42)) {
12659 puts("Pass_changed");
12662 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
12668 if eval $compile && $to try.c; then
12669 case `$run ./try` in
12671 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
12672 d_stdio_ptr_lval_sets_cnt="$define" ;;
12674 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
12675 d_stdio_ptr_lval_nochange_cnt="$define" ;;
12677 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
12679 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
12682 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
12688 : see if _base is also standard
12690 case "$d_stdstdio" in
12694 #$i_stdlib I_STDLIB
12696 #include <stdlib.h>
12698 #define FILE_base(fp) $stdio_base
12699 #define FILE_bufsiz(fp) $stdio_bufsiz
12701 FILE *fp = fopen("try.c", "r");
12704 19 <= FILE_bufsiz(fp) &&
12705 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
12712 if eval $compile && $to try.c; then
12713 if $run ./try; then
12714 echo "And its _base field acts std."
12717 echo "But its _base field isn't std."
12720 echo "However, it seems to be lacking the _base field."
12728 : see if fast_stdio exists
12730 case "$d_stdstdio:$d_stdio_ptr_lval" in
12732 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
12734 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
12745 : see if fchdir exists
12746 set fchdir d_fchdir
12749 : see if fchmod exists
12750 set fchmod d_fchmod
12753 : see if fchown exists
12754 set fchown d_fchown
12757 : see if this is an fcntl system
12762 : See if fcntl-based locking works.
12764 #$i_stdlib I_STDLIB
12766 #include <stdlib.h>
12768 #include <unistd.h>
12770 #include <signal.h>
12771 $signal_t blech(int x) { exit(3); }
12773 #if defined(F_SETLK) && defined(F_SETLKW)
12774 struct flock flock;
12776 fd = open("try.c", O_RDONLY);
12777 flock.l_type = F_RDLCK;
12778 flock.l_whence = SEEK_SET;
12779 flock.l_start = flock.l_len = 0;
12780 signal(SIGALRM, blech);
12782 retval = fcntl(fd, F_SETLK, &flock);
12784 (retval < 0 ? exit(2) : exit(0));
12790 echo "Checking if fcntl-based file locking works... "
12794 if eval $compile_ok; then
12795 if $run ./try; then
12796 echo "Yes, it seems to work."
12799 echo "Nope, it didn't work."
12804 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
12805 *** This is (almost) impossible.
12806 *** If your NFS lock daemons are not feeling well, something like
12807 *** this may happen, please investigate. Cannot continue, aborting.
12815 echo "I'm unable to compile the test program, so I'll assume not."
12820 echo "Nope, since you don't even have fcntl()."
12823 set d_fcntl_can_lock
12827 : check for fd_set items
12830 Checking to see how well your C compiler handles fd_set and friends ...
12833 #$i_stdlib I_STDLIB
12835 #include <stdlib.h>
12837 #$i_systime I_SYS_TIME
12838 #$i_sysselct I_SYS_SELECT
12839 #$d_socket HAS_SOCKET
12840 #include <sys/types.h>
12842 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
12845 #include <sys/time.h>
12847 #ifdef I_SYS_SELECT
12848 #include <sys/select.h>
12857 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
12865 if eval $compile; then
12866 d_fds_bits="$define"
12868 echo "Well, your system knows about the normal fd_set typedef..." >&4
12869 if $run ./try; then
12870 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
12871 d_fd_macros="$define"
12874 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
12876 d_fd_macros="$undef"
12880 Hmm, your compiler has some difficulty with fd_set. Checking further...
12883 if eval $compile; then
12884 d_fds_bits="$undef"
12886 echo "Well, your system has some sort of fd_set available..." >&4
12887 if $run ./try; then
12888 echo "and you have the normal fd_set macros." >&4
12889 d_fd_macros="$define"
12892 but not the normal fd_set macros! Gross! More work for me...
12894 d_fd_macros="$undef"
12897 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
12899 d_fds_bits="$undef"
12900 d_fd_macros="$undef"
12905 : see if fgetpos exists
12906 set fgetpos d_fgetpos
12909 : see if finite exists
12910 set finite d_finite
12913 : see if finitel exists
12914 set finitel d_finitel
12917 : see if flock exists
12921 : see if prototype for flock is available
12923 set d_flockproto flock $i_sysfile sys/file.h
12926 : see if fp_class exists
12927 set fp_class d_fp_class
12930 : see if pathconf exists
12931 set pathconf d_pathconf
12934 : see if fpathconf exists
12935 set fpathconf d_fpathconf
12938 : see if fpclass exists
12939 set fpclass d_fpclass
12942 : see if fpclassify exists
12943 set fpclassify d_fpclassify
12946 : see if fpclassl exists
12947 set fpclassl d_fpclassl
12951 : check for fpos64_t
12953 echo "Checking to see if you have fpos64_t..." >&4
12956 int main() { fpos64_t x = 7; }
12959 if eval $compile; then
12961 echo "You have fpos64_t."
12964 echo "You do not have fpos64_t."
12965 case "$fpossize" in
12966 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
12973 : see if frexpl exists
12974 set frexpl d_frexpl
12977 : see if this is a sys/param system
12978 set sys/param.h i_sysparam
12981 : see if this is a sys/mount.h system
12982 set sys/mount.h i_sysmount
12987 echo "Checking to see if your system supports struct fs_data..." >&4
12988 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
12990 case "$d_fs_data_s" in
12991 "$define") echo "Yes, it does." ;;
12992 *) echo "No, it doesn't." ;;
12995 : see if fseeko exists
12996 set fseeko d_fseeko
12998 case "$longsize" in
12999 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
13002 : see if fsetpos exists
13003 set fsetpos d_fsetpos
13007 : see if fstatfs exists
13008 set fstatfs d_fstatfs
13012 : see if statvfs exists
13013 set statvfs d_statvfs
13016 : see if fstatvfs exists
13017 set fstatvfs d_fstatvfs
13021 : see if fsync exists
13025 : see if ftello exists
13026 set ftello d_ftello
13028 case "$longsize" in
13029 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
13033 : check for a working futimes
13035 echo "Checking if you have a working futimes()" >&4
13038 #include <sys/time.h>
13045 fd = open ("try.c", O_RDWR);
13046 if (-1 == fd) exit (1);
13047 rv = futimes (fd, NULL);
13048 exit (rv == -1 ? errno : 0);
13052 if eval $compile; then
13056 0) echo "Yes, you have" >&4
13057 d_futimes="$define"
13059 *) echo "No, you have futimes, but it isn't working ($rc) (probably harmless)" >&4
13063 echo "No, it does not (probably harmless)" >&4
13067 : see if getcwd exists
13068 set getcwd d_getcwd
13071 : see if getespwnam exists
13072 set getespwnam d_getespwnam
13076 : see if getfsstat exists
13077 set getfsstat d_getfsstat
13080 : see if getgrent exists
13081 set getgrent d_getgrent
13084 : see if getgrent_r exists
13085 set getgrent_r d_getgrent_r
13087 case "$d_getgrent_r" in
13089 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13090 case "$d_getgrent_r_proto:$usethreads" in
13091 ":define") d_getgrent_r_proto=define
13092 set d_getgrent_r_proto getgrent_r $hdrs
13096 case "$d_getgrent_r_proto" in
13098 case "$getgrent_r_proto" in
13099 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
13100 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBWR ;;
13102 case "$getgrent_r_proto" in
13103 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
13104 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIR ;;
13106 case "$getgrent_r_proto" in
13107 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
13108 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBW ;;
13110 case "$getgrent_r_proto" in
13111 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
13112 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBI ;;
13114 case "$getgrent_r_proto" in
13115 ''|0) try='int getgrent_r(struct group*, char*, int);'
13116 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBI ;;
13118 case "$getgrent_r_proto" in
13119 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
13120 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIH ;;
13122 case "$getgrent_r_proto" in
13123 ''|0) d_getgrent_r=undef
13125 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
13126 * ) case "$getgrent_r_proto" in
13127 REENTRANT_PROTO*) ;;
13128 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
13130 echo "Prototype: $try" ;;
13133 *) case "$usethreads" in
13134 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
13141 *) getgrent_r_proto=0
13145 : see if getgrgid_r exists
13146 set getgrgid_r d_getgrgid_r
13148 case "$d_getgrgid_r" in
13150 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13151 case "$d_getgrgid_r_proto:$usethreads" in
13152 ":define") d_getgrgid_r_proto=define
13153 set d_getgrgid_r_proto getgrgid_r $hdrs
13157 case "$d_getgrgid_r_proto" in
13159 case "$getgrgid_r_proto" in
13160 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
13161 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
13163 case "$getgrgid_r_proto" in
13164 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
13165 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
13167 case "$getgrgid_r_proto" in
13168 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
13169 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
13171 case "$getgrgid_r_proto" in
13172 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
13173 ./protochk "extern $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
13175 case "$getgrgid_r_proto" in
13176 ''|0) d_getgrgid_r=undef
13178 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
13179 * ) case "$getgrgid_r_proto" in
13180 REENTRANT_PROTO*) ;;
13181 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
13183 echo "Prototype: $try" ;;
13186 *) case "$usethreads" in
13187 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
13194 *) getgrgid_r_proto=0
13198 : see if getgrnam_r exists
13199 set getgrnam_r d_getgrnam_r
13201 case "$d_getgrnam_r" in
13203 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13204 case "$d_getgrnam_r_proto:$usethreads" in
13205 ":define") d_getgrnam_r_proto=define
13206 set d_getgrnam_r_proto getgrnam_r $hdrs
13210 case "$d_getgrnam_r_proto" in
13212 case "$getgrnam_r_proto" in
13213 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
13214 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
13216 case "$getgrnam_r_proto" in
13217 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
13218 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
13220 case "$getgrnam_r_proto" in
13221 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
13222 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CBI ;;
13224 case "$getgrnam_r_proto" in
13225 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
13226 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
13228 case "$getgrnam_r_proto" in
13229 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
13230 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
13232 case "$getgrnam_r_proto" in
13233 ''|0) d_getgrnam_r=undef
13235 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
13236 * ) case "$getgrnam_r_proto" in
13237 REENTRANT_PROTO*) ;;
13238 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
13240 echo "Prototype: $try" ;;
13243 *) case "$usethreads" in
13244 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
13251 *) getgrnam_r_proto=0
13255 : see if gethostbyaddr exists
13256 set gethostbyaddr d_gethbyaddr
13259 : see if gethostbyname exists
13260 set gethostbyname d_gethbyname
13263 : see if gethostent exists
13264 set gethostent d_gethent
13267 : see how we will look up host name
13270 if set gethostname val -f d_gethname; eval $csym; $val; then
13271 echo 'gethostname() found.' >&4
13272 d_gethname="$define"
13275 if set uname val -f d_uname; eval $csym; $val; then
13278 uname() was found, but you're running xenix, and older versions of xenix
13279 have a broken uname(). If you don't really know whether your xenix is old
13280 enough to have a broken system call, use the default answer.
13285 "$define") dflt=n;;
13287 rp='Is your uname() broken?'
13290 n*) d_uname="$define"; call=uname;;
13293 echo 'uname() found.' >&4
13300 case "$d_gethname" in
13301 '') d_gethname="$undef";;
13304 '') d_uname="$undef";;
13306 case "$d_uname$d_gethname" in
13311 Every now and then someone has a $call() that lies about the hostname
13312 but can't be fixed for political or economic reasons. If you wish, I can
13313 pretend $call() isn't there and maybe compute hostname at run-time
13314 thanks to the '$phostname' command.
13317 rp="Shall I ignore $call() from now on?"
13320 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
13323 case "$phostname" in
13324 '') aphostname='';;
13325 *) case "$aphostname" in
13327 *) set X $phostname
13331 file=`./loc $file $file $pth`
13332 aphostname=`echo $file $*`
13337 case "$d_uname$d_gethname" in
13340 case "$phostname" in
13342 echo "There will be no way for $package to get your hostname." >&4;;
13344 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
13348 case "$d_phostname" in
13349 '') d_phostname="$undef";;
13352 : see if gethostbyaddr_r exists
13353 set gethostbyaddr_r d_gethostbyaddr_r
13355 case "$d_gethostbyaddr_r" in
13357 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13358 case "$d_gethostbyaddr_r_proto:$usethreads" in
13359 ":define") d_gethostbyaddr_r_proto=define
13360 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
13364 case "$d_gethostbyaddr_r_proto" in
13366 case "$gethostbyaddr_r_proto" in
13367 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13368 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
13370 case "$gethostbyaddr_r_proto" in
13371 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
13372 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
13374 case "$gethostbyaddr_r_proto" in
13375 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
13376 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
13378 case "$gethostbyaddr_r_proto" in
13379 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
13380 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
13382 case "$gethostbyaddr_r_proto" in
13383 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
13384 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
13386 case "$gethostbyaddr_r_proto" in
13387 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
13388 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
13390 case "$gethostbyaddr_r_proto" in
13391 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
13392 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
13394 case "$gethostbyaddr_r_proto" in
13395 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
13396 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
13398 case "$gethostbyaddr_r_proto" in
13399 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
13400 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
13402 case "$gethostbyaddr_r_proto" in
13403 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
13404 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
13406 case "$gethostbyaddr_r_proto" in
13407 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13408 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
13410 case "$gethostbyaddr_r_proto" in
13411 ''|0) d_gethostbyaddr_r=undef
13412 gethostbyaddr_r_proto=0
13413 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
13414 * ) case "$gethostbyaddr_r_proto" in
13415 REENTRANT_PROTO*) ;;
13416 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
13418 echo "Prototype: $try" ;;
13421 *) case "$usethreads" in
13422 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
13424 d_gethostbyaddr_r=undef
13425 gethostbyaddr_r_proto=0
13429 *) gethostbyaddr_r_proto=0
13433 : see if gethostbyname_r exists
13434 set gethostbyname_r d_gethostbyname_r
13436 case "$d_gethostbyname_r" in
13438 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13439 case "$d_gethostbyname_r_proto:$usethreads" in
13440 ":define") d_gethostbyname_r_proto=define
13441 set d_gethostbyname_r_proto gethostbyname_r $hdrs
13445 case "$d_gethostbyname_r_proto" in
13447 case "$gethostbyname_r_proto" in
13448 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
13449 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
13451 case "$gethostbyname_r_proto" in
13452 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
13453 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
13455 case "$gethostbyname_r_proto" in
13456 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
13457 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
13459 case "$gethostbyname_r_proto" in
13460 ''|0) d_gethostbyname_r=undef
13461 gethostbyname_r_proto=0
13462 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
13463 * ) case "$gethostbyname_r_proto" in
13464 REENTRANT_PROTO*) ;;
13465 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
13467 echo "Prototype: $try" ;;
13470 *) case "$usethreads" in
13471 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
13473 d_gethostbyname_r=undef
13474 gethostbyname_r_proto=0
13478 *) gethostbyname_r_proto=0
13482 : see if gethostent_r exists
13483 set gethostent_r d_gethostent_r
13485 case "$d_gethostent_r" in
13487 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13488 case "$d_gethostent_r_proto:$usethreads" in
13489 ":define") d_gethostent_r_proto=define
13490 set d_gethostent_r_proto gethostent_r $hdrs
13494 case "$d_gethostent_r_proto" in
13496 case "$gethostent_r_proto" in
13497 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
13498 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
13500 case "$gethostent_r_proto" in
13501 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
13502 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBIE ;;
13504 case "$gethostent_r_proto" in
13505 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
13506 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBIE ;;
13508 case "$gethostent_r_proto" in
13509 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
13510 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBI ;;
13512 case "$gethostent_r_proto" in
13513 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
13514 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBI ;;
13516 case "$gethostent_r_proto" in
13517 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
13518 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SD ;;
13520 case "$gethostent_r_proto" in
13521 ''|0) d_gethostent_r=undef
13522 gethostent_r_proto=0
13523 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
13524 * ) case "$gethostent_r_proto" in
13525 REENTRANT_PROTO*) ;;
13526 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
13528 echo "Prototype: $try" ;;
13531 *) case "$usethreads" in
13532 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
13534 d_gethostent_r=undef
13535 gethostent_r_proto=0
13539 *) gethostent_r_proto=0
13543 : see if prototypes for various gethostxxx netdb.h functions are available
13545 set d_gethostprotos gethostent $i_netdb netdb.h
13548 : see if getitimer exists
13549 set getitimer d_getitimer
13552 : see if getlogin exists
13553 set getlogin d_getlogin
13556 : see if getlogin_r exists
13557 set getlogin_r d_getlogin_r
13559 case "$d_getlogin_r" in
13561 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
13562 case "$d_getlogin_r_proto:$usethreads" in
13563 ":define") d_getlogin_r_proto=define
13564 set d_getlogin_r_proto getlogin_r $hdrs
13568 case "$d_getlogin_r_proto" in
13570 case "$getlogin_r_proto" in
13571 ''|0) try='int getlogin_r(char*, size_t);'
13572 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BW ;;
13574 case "$getlogin_r_proto" in
13575 ''|0) try='int getlogin_r(char*, int);'
13576 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BI ;;
13578 case "$getlogin_r_proto" in
13579 ''|0) try='char* getlogin_r(char*, size_t);'
13580 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BW ;;
13582 case "$getlogin_r_proto" in
13583 ''|0) try='char* getlogin_r(char*, int);'
13584 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BI ;;
13586 case "$getlogin_r_proto" in
13587 ''|0) d_getlogin_r=undef
13589 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
13590 * ) case "$getlogin_r_proto" in
13591 REENTRANT_PROTO*) ;;
13592 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
13594 echo "Prototype: $try" ;;
13597 *) case "$usethreads" in
13598 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
13605 *) getlogin_r_proto=0
13609 : see if getmnt exists
13610 set getmnt d_getmnt
13613 : see if getmntent exists
13614 set getmntent d_getmntent
13617 : see if getnetbyaddr exists
13618 set getnetbyaddr d_getnbyaddr
13621 : see if getnetbyname exists
13622 set getnetbyname d_getnbyname
13625 : see if getnetent exists
13626 set getnetent d_getnent
13629 : see if getnetbyaddr_r exists
13630 set getnetbyaddr_r d_getnetbyaddr_r
13632 case "$d_getnetbyaddr_r" in
13634 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13635 case "$d_getnetbyaddr_r_proto:$usethreads" in
13636 ":define") d_getnetbyaddr_r_proto=define
13637 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
13641 case "$d_getnetbyaddr_r_proto" in
13643 case "$getnetbyaddr_r_proto" in
13644 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
13645 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
13647 case "$getnetbyaddr_r_proto" in
13648 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
13649 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
13651 case "$getnetbyaddr_r_proto" in
13652 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
13653 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
13655 case "$getnetbyaddr_r_proto" in
13656 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
13657 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
13659 case "$getnetbyaddr_r_proto" in
13660 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
13661 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
13663 case "$getnetbyaddr_r_proto" in
13664 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
13665 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
13667 case "$getnetbyaddr_r_proto" in
13668 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
13669 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
13671 case "$getnetbyaddr_r_proto" in
13672 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
13673 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
13675 case "$getnetbyaddr_r_proto" in
13676 ''|0) d_getnetbyaddr_r=undef
13677 getnetbyaddr_r_proto=0
13678 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
13679 * ) case "$getnetbyaddr_r_proto" in
13680 REENTRANT_PROTO*) ;;
13681 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
13683 echo "Prototype: $try" ;;
13686 *) case "$usethreads" in
13687 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
13689 d_getnetbyaddr_r=undef
13690 getnetbyaddr_r_proto=0
13694 *) getnetbyaddr_r_proto=0
13698 : see if getnetbyname_r exists
13699 set getnetbyname_r d_getnetbyname_r
13701 case "$d_getnetbyname_r" in
13703 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13704 case "$d_getnetbyname_r_proto:$usethreads" in
13705 ":define") d_getnetbyname_r_proto=define
13706 set d_getnetbyname_r_proto getnetbyname_r $hdrs
13710 case "$d_getnetbyname_r_proto" in
13712 case "$getnetbyname_r_proto" in
13713 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
13714 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
13716 case "$getnetbyname_r_proto" in
13717 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
13718 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
13720 case "$getnetbyname_r_proto" in
13721 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
13722 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
13724 case "$getnetbyname_r_proto" in
13725 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
13726 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
13728 case "$getnetbyname_r_proto" in
13729 ''|0) d_getnetbyname_r=undef
13730 getnetbyname_r_proto=0
13731 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
13732 * ) case "$getnetbyname_r_proto" in
13733 REENTRANT_PROTO*) ;;
13734 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
13736 echo "Prototype: $try" ;;
13739 *) case "$usethreads" in
13740 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
13742 d_getnetbyname_r=undef
13743 getnetbyname_r_proto=0
13747 *) getnetbyname_r_proto=0
13751 : see if getnetent_r exists
13752 set getnetent_r d_getnetent_r
13754 case "$d_getnetent_r" in
13756 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13757 case "$d_getnetent_r_proto:$usethreads" in
13758 ":define") d_getnetent_r_proto=define
13759 set d_getnetent_r_proto getnetent_r $hdrs
13763 case "$d_getnetent_r_proto" in
13765 case "$getnetent_r_proto" in
13766 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
13767 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
13769 case "$getnetent_r_proto" in
13770 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
13771 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBIE ;;
13773 case "$getnetent_r_proto" in
13774 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
13775 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBIE ;;
13777 case "$getnetent_r_proto" in
13778 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
13779 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBI ;;
13781 case "$getnetent_r_proto" in
13782 ''|0) try='int getnetent_r(struct netent*, char*, int);'
13783 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBI ;;
13785 case "$getnetent_r_proto" in
13786 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
13787 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SD ;;
13789 case "$getnetent_r_proto" in
13790 ''|0) d_getnetent_r=undef
13791 getnetent_r_proto=0
13792 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
13793 * ) case "$getnetent_r_proto" in
13794 REENTRANT_PROTO*) ;;
13795 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
13797 echo "Prototype: $try" ;;
13800 *) case "$usethreads" in
13801 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
13803 d_getnetent_r=undef
13804 getnetent_r_proto=0
13808 *) getnetent_r_proto=0
13812 : see if prototypes for various getnetxxx netdb.h functions are available
13814 set d_getnetprotos getnetent $i_netdb netdb.h
13817 : see if getpagesize exists
13818 set getpagesize d_getpagsz
13822 : see if getprotobyname exists
13823 set getprotobyname d_getpbyname
13826 : see if getprotobynumber exists
13827 set getprotobynumber d_getpbynumber
13830 : see if getprotoent exists
13831 set getprotoent d_getpent
13834 : see if getpgid exists
13835 set getpgid d_getpgid
13838 : see if getpgrp2 exists
13839 set getpgrp2 d_getpgrp2
13842 : see if getppid exists
13843 set getppid d_getppid
13846 : see if getpriority exists
13847 set getpriority d_getprior
13850 : see if getprotobyname_r exists
13851 set getprotobyname_r d_getprotobyname_r
13853 case "$d_getprotobyname_r" in
13855 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13856 case "$d_getprotobyname_r_proto:$usethreads" in
13857 ":define") d_getprotobyname_r_proto=define
13858 set d_getprotobyname_r_proto getprotobyname_r $hdrs
13862 case "$d_getprotobyname_r_proto" in
13864 case "$getprotobyname_r_proto" in
13865 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
13866 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
13868 case "$getprotobyname_r_proto" in
13869 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
13870 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
13872 case "$getprotobyname_r_proto" in
13873 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
13874 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
13876 case "$getprotobyname_r_proto" in
13877 ''|0) d_getprotobyname_r=undef
13878 getprotobyname_r_proto=0
13879 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
13880 * ) case "$getprotobyname_r_proto" in
13881 REENTRANT_PROTO*) ;;
13882 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
13884 echo "Prototype: $try" ;;
13887 *) case "$usethreads" in
13888 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
13890 d_getprotobyname_r=undef
13891 getprotobyname_r_proto=0
13895 *) getprotobyname_r_proto=0
13899 : see if getprotobynumber_r exists
13900 set getprotobynumber_r d_getprotobynumber_r
13902 case "$d_getprotobynumber_r" in
13904 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13905 case "$d_getprotobynumber_r_proto:$usethreads" in
13906 ":define") d_getprotobynumber_r_proto=define
13907 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
13911 case "$d_getprotobynumber_r_proto" in
13913 case "$getprotobynumber_r_proto" in
13914 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
13915 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
13917 case "$getprotobynumber_r_proto" in
13918 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
13919 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
13921 case "$getprotobynumber_r_proto" in
13922 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
13923 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
13925 case "$getprotobynumber_r_proto" in
13926 ''|0) d_getprotobynumber_r=undef
13927 getprotobynumber_r_proto=0
13928 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
13929 * ) case "$getprotobynumber_r_proto" in
13930 REENTRANT_PROTO*) ;;
13931 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
13933 echo "Prototype: $try" ;;
13936 *) case "$usethreads" in
13937 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
13939 d_getprotobynumber_r=undef
13940 getprotobynumber_r_proto=0
13944 *) getprotobynumber_r_proto=0
13948 : see if getprotoent_r exists
13949 set getprotoent_r d_getprotoent_r
13951 case "$d_getprotoent_r" in
13953 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13954 case "$d_getprotoent_r_proto:$usethreads" in
13955 ":define") d_getprotoent_r_proto=define
13956 set d_getprotoent_r_proto getprotoent_r $hdrs
13960 case "$d_getprotoent_r_proto" in
13962 case "$getprotoent_r_proto" in
13963 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
13964 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
13966 case "$getprotoent_r_proto" in
13967 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
13968 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBI ;;
13970 case "$getprotoent_r_proto" in
13971 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
13972 ./protochk "extern $try" $hdrs && getprotoent_r_proto=S_SBI ;;
13974 case "$getprotoent_r_proto" in
13975 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
13976 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SD ;;
13978 case "$getprotoent_r_proto" in
13979 ''|0) d_getprotoent_r=undef
13980 getprotoent_r_proto=0
13981 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
13982 * ) case "$getprotoent_r_proto" in
13983 REENTRANT_PROTO*) ;;
13984 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
13986 echo "Prototype: $try" ;;
13989 *) case "$usethreads" in
13990 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
13992 d_getprotoent_r=undef
13993 getprotoent_r_proto=0
13997 *) getprotoent_r_proto=0
14001 : see if prototypes for various getprotoxxx netdb.h functions are available
14003 set d_getprotoprotos getprotoent $i_netdb netdb.h
14006 : see if getprpwnam exists
14007 set getprpwnam d_getprpwnam
14010 : see if getpwent exists
14011 set getpwent d_getpwent
14014 : see if getpwent_r exists
14015 set getpwent_r d_getpwent_r
14017 case "$d_getpwent_r" in
14019 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14020 case "$d_getpwent_r_proto:$usethreads" in
14021 ":define") d_getpwent_r_proto=define
14022 set d_getpwent_r_proto getpwent_r $hdrs
14026 case "$d_getpwent_r_proto" in
14028 case "$getpwent_r_proto" in
14029 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
14030 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBWR ;;
14032 case "$getpwent_r_proto" in
14033 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
14034 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIR ;;
14036 case "$getpwent_r_proto" in
14037 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
14038 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBW ;;
14040 case "$getpwent_r_proto" in
14041 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
14042 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBI ;;
14044 case "$getpwent_r_proto" in
14045 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
14046 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBI ;;
14048 case "$getpwent_r_proto" in
14049 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
14050 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIH ;;
14052 case "$getpwent_r_proto" in
14053 ''|0) d_getpwent_r=undef
14055 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
14056 * ) case "$getpwent_r_proto" in
14057 REENTRANT_PROTO*) ;;
14058 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
14060 echo "Prototype: $try" ;;
14063 *) case "$usethreads" in
14064 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
14071 *) getpwent_r_proto=0
14075 : see if getpwnam_r exists
14076 set getpwnam_r d_getpwnam_r
14078 case "$d_getpwnam_r" in
14080 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14081 case "$d_getpwnam_r_proto:$usethreads" in
14082 ":define") d_getpwnam_r_proto=define
14083 set d_getpwnam_r_proto getpwnam_r $hdrs
14087 case "$d_getpwnam_r_proto" in
14089 case "$getpwnam_r_proto" in
14090 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
14091 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
14093 case "$getpwnam_r_proto" in
14094 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
14095 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
14097 case "$getpwnam_r_proto" in
14098 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
14099 ./protochk "extern $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
14101 case "$getpwnam_r_proto" in
14102 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
14103 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
14105 case "$getpwnam_r_proto" in
14106 ''|0) d_getpwnam_r=undef
14108 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
14109 * ) case "$getpwnam_r_proto" in
14110 REENTRANT_PROTO*) ;;
14111 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
14113 echo "Prototype: $try" ;;
14116 *) case "$usethreads" in
14117 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
14124 *) getpwnam_r_proto=0
14128 : see if getpwuid_r exists
14129 set getpwuid_r d_getpwuid_r
14131 case "$d_getpwuid_r" in
14133 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14134 case "$d_getpwuid_r_proto:$usethreads" in
14135 ":define") d_getpwuid_r_proto=define
14136 set d_getpwuid_r_proto getpwuid_r $hdrs
14140 case "$d_getpwuid_r_proto" in
14142 case "$getpwuid_r_proto" in
14143 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
14144 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
14146 case "$getpwuid_r_proto" in
14147 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
14148 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
14150 case "$getpwuid_r_proto" in
14151 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
14152 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
14154 case "$getpwuid_r_proto" in
14155 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
14156 ./protochk "extern $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
14158 case "$getpwuid_r_proto" in
14159 ''|0) d_getpwuid_r=undef
14161 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
14162 * ) case "$getpwuid_r_proto" in
14163 REENTRANT_PROTO*) ;;
14164 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
14166 echo "Prototype: $try" ;;
14169 *) case "$usethreads" in
14170 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
14177 *) getpwuid_r_proto=0
14182 : see if getservbyname exists
14183 set getservbyname d_getsbyname
14186 : see if getservbyport exists
14187 set getservbyport d_getsbyport
14190 : see if getservent exists
14191 set getservent d_getsent
14194 : see if getservbyname_r exists
14195 set getservbyname_r d_getservbyname_r
14197 case "$d_getservbyname_r" in
14199 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14200 case "$d_getservbyname_r_proto:$usethreads" in
14201 ":define") d_getservbyname_r_proto=define
14202 set d_getservbyname_r_proto getservbyname_r $hdrs
14206 case "$d_getservbyname_r_proto" in
14208 case "$getservbyname_r_proto" in
14209 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
14210 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
14212 case "$getservbyname_r_proto" in
14213 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
14214 ./protochk "extern $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
14216 case "$getservbyname_r_proto" in
14217 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
14218 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
14220 case "$getservbyname_r_proto" in
14221 ''|0) d_getservbyname_r=undef
14222 getservbyname_r_proto=0
14223 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
14224 * ) case "$getservbyname_r_proto" in
14225 REENTRANT_PROTO*) ;;
14226 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
14228 echo "Prototype: $try" ;;
14231 *) case "$usethreads" in
14232 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
14234 d_getservbyname_r=undef
14235 getservbyname_r_proto=0
14239 *) getservbyname_r_proto=0
14243 : see if getservbyport_r exists
14244 set getservbyport_r d_getservbyport_r
14246 case "$d_getservbyport_r" in
14248 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14249 case "$d_getservbyport_r_proto:$usethreads" in
14250 ":define") d_getservbyport_r_proto=define
14251 set d_getservbyport_r_proto getservbyport_r $hdrs
14255 case "$d_getservbyport_r_proto" in
14257 case "$getservbyport_r_proto" in
14258 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
14259 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
14261 case "$getservbyport_r_proto" in
14262 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
14263 ./protochk "extern $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
14265 case "$getservbyport_r_proto" in
14266 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
14267 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
14269 case "$getservbyport_r_proto" in
14270 ''|0) d_getservbyport_r=undef
14271 getservbyport_r_proto=0
14272 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
14273 * ) case "$getservbyport_r_proto" in
14274 REENTRANT_PROTO*) ;;
14275 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
14277 echo "Prototype: $try" ;;
14280 *) case "$usethreads" in
14281 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
14283 d_getservbyport_r=undef
14284 getservbyport_r_proto=0
14288 *) getservbyport_r_proto=0
14292 : see if getservent_r exists
14293 set getservent_r d_getservent_r
14295 case "$d_getservent_r" in
14297 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14298 case "$d_getservent_r_proto:$usethreads" in
14299 ":define") d_getservent_r_proto=define
14300 set d_getservent_r_proto getservent_r $hdrs
14304 case "$d_getservent_r_proto" in
14306 case "$getservent_r_proto" in
14307 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
14308 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBWR ;;
14310 case "$getservent_r_proto" in
14311 ''|0) try='int getservent_r(struct servent*, char*, int);'
14312 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBI ;;
14314 case "$getservent_r_proto" in
14315 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
14316 ./protochk "extern $try" $hdrs && getservent_r_proto=S_SBI ;;
14318 case "$getservent_r_proto" in
14319 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
14320 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SD ;;
14322 case "$getservent_r_proto" in
14323 ''|0) d_getservent_r=undef
14324 getservent_r_proto=0
14325 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
14326 * ) case "$getservent_r_proto" in
14327 REENTRANT_PROTO*) ;;
14328 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
14330 echo "Prototype: $try" ;;
14333 *) case "$usethreads" in
14334 define) echo "getservent_r has no prototype, not using it." >&4 ;;
14336 d_getservent_r=undef
14337 getservent_r_proto=0
14341 *) getservent_r_proto=0
14345 : see if prototypes for various getservxxx netdb.h functions are available
14347 set d_getservprotos getservent $i_netdb netdb.h
14350 : see if getspnam exists
14351 set getspnam d_getspnam
14354 : see if this is a shadow.h system
14355 set shadow.h i_shadow
14358 : see if getspnam_r exists
14359 set getspnam_r d_getspnam_r
14361 case "$d_getspnam_r" in
14363 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
14364 case "$d_getspnam_r_proto:$usethreads" in
14365 ":define") d_getspnam_r_proto=define
14366 set d_getspnam_r_proto getspnam_r $hdrs
14370 case "$d_getspnam_r_proto" in
14372 case "$getspnam_r_proto" in
14373 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
14374 ./protochk "extern $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
14376 case "$getspnam_r_proto" in
14377 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
14378 ./protochk "extern $try" $hdrs && getspnam_r_proto=S_CSBI ;;
14380 case "$getspnam_r_proto" in
14381 ''|0) d_getspnam_r=undef
14383 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
14384 * ) case "$getspnam_r_proto" in
14385 REENTRANT_PROTO*) ;;
14386 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
14388 echo "Prototype: $try" ;;
14391 *) case "$usethreads" in
14392 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
14399 *) getspnam_r_proto=0
14403 : see if gettimeofday or ftime exists
14404 set gettimeofday d_gettimeod
14406 case "$d_gettimeod" in
14412 val="$undef"; set d_ftime; eval $setvar
14415 case "$d_gettimeod$d_ftime" in
14418 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
14422 : see if gmtime_r exists
14423 set gmtime_r d_gmtime_r
14425 case "$d_gmtime_r" in
14427 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14428 case "$d_gmtime_r_proto:$usethreads" in
14429 ":define") d_gmtime_r_proto=define
14430 set d_gmtime_r_proto gmtime_r $hdrs
14434 case "$d_gmtime_r_proto" in
14436 case "$gmtime_r_proto" in
14437 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
14438 ./protochk "extern $try" $hdrs && gmtime_r_proto=S_TS ;;
14440 case "$gmtime_r_proto" in
14441 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
14442 ./protochk "extern $try" $hdrs && gmtime_r_proto=I_TS ;;
14444 case "$gmtime_r_proto" in
14445 ''|0) d_gmtime_r=undef
14447 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
14448 * ) case "$gmtime_r_proto" in
14449 REENTRANT_PROTO*) ;;
14450 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
14452 echo "Prototype: $try" ;;
14455 *) case "$usethreads" in
14456 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
14463 *) gmtime_r_proto=0
14467 : see if hasmntopt exists
14468 set hasmntopt d_hasmntopt
14471 : see if this is a netinet/in.h or sys/in.h system
14472 set netinet/in.h i_niin sys/in.h i_sysin
14475 : see if arpa/inet.h has to be included
14476 set arpa/inet.h i_arpainet
14479 : see if htonl --and friends-- exists
14484 : Maybe they are macros.
14487 $cat >htonl.c <<EOM
14489 #include <sys/types.h>
14490 #$i_niin I_NETINET_IN
14492 #$i_arpainet I_ARPA_INET
14493 #ifdef I_NETINET_IN
14494 #include <netinet/in.h>
14497 #include <sys/in.h>
14500 #include <arpa/inet.h>
14503 printf("Defined as a macro.");
14506 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
14507 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
14509 echo "But it seems to be defined as a macro." >&4
14517 : see if ilogbl exists
14518 set ilogbl d_ilogbl
14523 if set index val -f; eval $csym; $val; then
14524 if set strchr val -f d_strchr; eval $csym; $val; then
14525 if $contains strchr "$strings" >/dev/null 2>&1 ; then
14528 echo "strchr() found." >&4
14532 echo "index() found." >&4
14537 echo "index() found." >&4
14540 if set strchr val -f d_strchr; eval $csym; $val; then
14543 echo "strchr() found." >&4
14545 echo "No index() or strchr() found!" >&4
14550 set d_strchr; eval $setvar
14552 set d_index; eval $setvar
14554 : check whether inet_aton exists
14555 set inet_aton d_inetaton
14560 $cat >isascii.c <<EOCP
14563 #$i_stdlib I_STDLIB
14565 #include <stdlib.h>
14576 if eval $compile; then
14577 echo "isascii() found." >&4
14580 echo "isascii() NOT found." >&4
14587 : see if isfinite exists
14588 set isfinite d_isfinite
14591 : see if isinf exists
14595 : see if isnan exists
14599 : see if isnanl exists
14600 set isnanl d_isnanl
14603 : see if killpg exists
14604 set killpg d_killpg
14607 : see if lchown exists
14609 $cat > try.c <<'EOCP'
14610 /* System header to define __stub macros and hopefully few prototypes,
14611 which can conflict with char lchown(); below. */
14612 #include <assert.h>
14613 /* Override any gcc2 internal prototype to avoid an error. */
14614 /* We use char because int might match the return type of a gcc2
14615 builtin and then its argument prototype would still apply. */
14618 /* The GNU C library defines this for functions which it implements
14619 to always fail with ENOSYS. Some functions are actually named
14620 something starting with __ and the normal name is an alias. */
14621 #if defined (__stub_lchown) || defined (__stub___lchown)
14629 if eval $compile; then
14630 $echo "lchown() found." >&4
14633 $echo "lchown() NOT found." >&4
14639 : See if number of significant digits in a double precision number is known
14641 $cat >ldbl_dig.c <<EOM
14642 #$i_limits I_LIMITS
14645 #include <limits.h>
14651 printf("Contains LDBL_DIG");
14654 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
14655 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
14656 echo "LDBL_DIG found." >&4
14659 echo "LDBL_DIG NOT found." >&4
14666 : see if this is a math.h system
14670 d_libm_lib_version="$undef"
14673 : check to see if math.h defines _LIB_VERSION
14675 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
14677 #include <unistd.h>
14679 int main (int argc, char *argv[])
14681 printf ("%d\n", _LIB_VERSION);
14686 if eval $compile; then
14688 echo "Yes, it does ($foo)" >&4
14689 d_libm_lib_version="$define"
14691 echo "No, it does not (probably harmless)" >&4
14698 : see if link exists
14702 : see if localtime_r exists
14703 set localtime_r d_localtime_r
14705 case "$d_localtime_r" in
14707 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14708 case "$d_localtime_r_proto:$usethreads" in
14709 ":define") d_localtime_r_proto=define
14710 set d_localtime_r_proto localtime_r $hdrs
14714 case "$d_localtime_r_proto" in
14716 case "$localtime_r_proto" in
14717 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
14718 ./protochk "extern $try" $hdrs && localtime_r_proto=S_TS ;;
14720 case "$localtime_r_proto" in
14721 ''|0) try='int localtime_r(const time_t*, struct tm*);'
14722 ./protochk "extern $try" $hdrs && localtime_r_proto=I_TS ;;
14724 case "$localtime_r_proto" in
14725 ''|0) d_localtime_r=undef
14726 localtime_r_proto=0
14727 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
14728 * ) case "$localtime_r_proto" in
14729 REENTRANT_PROTO*) ;;
14730 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
14732 echo "Prototype: $try" ;;
14735 *) case "$usethreads" in
14736 define) echo "localtime_r has no prototype, not using it." >&4 ;;
14738 d_localtime_r=undef
14739 localtime_r_proto=0
14743 *) localtime_r_proto=0
14747 : see if localtime_r calls tzset
14748 case "$localtime_r_proto" in
14751 /* Does our libc's localtime_r call tzset ?
14752 * return 0 if so, 1 otherwise.
14754 #include <sys/types.h>
14755 #include <unistd.h>
14757 #include <string.h>
14758 #include <malloc.h>
14761 time_t t = time(0L);
14762 char w_tz[]="TZ" "=GMT+5",
14763 e_tz[]="TZ" "=GMT-5",
14764 *tz_e = (char*)malloc(16),
14765 *tz_w = (char*)malloc(16);
14766 struct tm tm_e, tm_w;
14767 memset(&tm_e,'\0',sizeof(struct tm));
14768 memset(&tm_w,'\0',sizeof(struct tm));
14773 localtime_r(&t, &tm_e);
14776 localtime_r(&t, &tm_w);
14778 if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 )
14784 if eval $compile; then
14785 if $run ./try; then
14786 d_localtime_r_needs_tzset=undef;
14788 d_localtime_r_needs_tzset=define;
14791 d_localtime_r_needs_tzset=undef;
14795 d_localtime_r_needs_tzset=undef;
14800 : see if localeconv exists
14801 set localeconv d_locconv
14804 : see if lockf exists
14808 : see if prototype for lseek is available
14810 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
14813 : see if lstat exists
14817 : see if madvise exists
14818 set madvise d_madvise
14821 : see if malloc_size exists
14822 set malloc_size d_malloc_size
14825 : see if malloc_size_good exists
14826 set malloc_good_size d_malloc_good_size
14829 : see if mblen exists
14833 : see if mbstowcs exists
14834 set mbstowcs d_mbstowcs
14837 : see if mbtowc exists
14838 set mbtowc d_mbtowc
14841 : see if memchr exists
14842 set memchr d_memchr
14845 : see if memcmp exists
14846 set memcmp d_memcmp
14849 : see if memcpy exists
14850 set memcpy d_memcpy
14853 : see if memmove exists
14854 set memmove d_memmove
14857 : see if memset exists
14858 set memset d_memset
14861 : see if mkdir exists
14865 : see if mkdtemp exists
14866 set mkdtemp d_mkdtemp
14869 : see if mkfifo exists
14870 set mkfifo d_mkfifo
14873 : see if mkstemp exists
14874 set mkstemp d_mkstemp
14877 : see if mkstemps exists
14878 set mkstemps d_mkstemps
14881 : see if mktime exists
14882 set mktime d_mktime
14885 : see if this is a sys/mman.h system
14886 set sys/mman.h i_sysmman
14889 : see if mmap exists
14892 : see what shmat returns
14893 : default to something harmless
14895 case "$i_sysmman$d_mmap" in
14897 $cat >mmap.c <<'END'
14898 #include <sys/mman.h>
14901 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
14906 echo "and it returns ($mmaptype)." >&4
14912 : see if sqrtl exists
14916 : see if scalbnl exists
14917 set scalbnl d_scalbnl
14920 : see if modfl exists
14924 : see if prototype for modfl is available
14926 set d_modflproto modfl $i_math math.h
14929 d_modfl_pow32_bug="$undef"
14931 case "$d_longdbl$d_modfl" in
14934 Checking to see whether your modfl() is okay for large values...
14940 if $test "X$d_modflproto" != "X$define"; then
14941 $cat >>try.c <<EOCP
14942 /* Sigh. many current glibcs provide the function, but do not prototype it. */
14943 long double modfl (long double, long double *);
14946 $cat >>try.c <<EOCP
14948 long double nv = 4294967303.15;
14954 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
14958 case "$osname:$gccversion" in
14959 aix:) saveccflags="$ccflags"
14960 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
14963 if eval $compile; then
14966 *" 4294967303.150000 1.150000 4294967302.000000")
14967 echo >&4 "Your modfl() is broken for large values."
14968 d_modfl_pow32_bug="$define"
14970 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
14974 *" 4294967303.150000 0.150000 4294967303.000000")
14975 echo >&4 "Your modfl() seems okay for large values."
14977 *) echo >&4 "I don't understand your modfl() at all."
14983 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
14986 case "$osname:$gccversion" in
14987 aix:) ccflags="$saveccflags" ;; # restore
14992 if $test "$uselongdouble" = "$define"; then
14994 if $test "$d_sqrtl" != "$define"; then
14995 message="$message sqrtl"
14997 if $test "$d_modfl" != "$define"; then
14998 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
14999 echo "You have both aintl and copysignl, so I can emulate modfl."
15001 message="$message modfl"
15004 if $test "$d_frexpl" != "$define"; then
15005 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
15006 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
15008 message="$message frexpl"
15012 if $test "$message" != ""; then
15015 *** You requested the use of long doubles but you do not seem to have
15016 *** the following mathematical functions needed for long double support:
15018 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
15019 *** Cannot continue, aborting.
15027 : see if mprotect exists
15028 set mprotect d_mprotect
15031 : see if msgctl exists
15032 set msgctl d_msgctl
15035 : see if msgget exists
15036 set msgget d_msgget
15039 : see if msgsnd exists
15040 set msgsnd d_msgsnd
15043 : see if msgrcv exists
15044 set msgrcv d_msgrcv
15047 : see how much of the 'msg*(2)' library is present.
15050 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
15051 *"$undef"*) h_msg=false;;
15055 case "`ipcs 2>&1`" in
15056 "SVID messages"*"not configured"*)
15057 echo "Your $osname does not have the msg*(2) configured." >&4
15060 set msgctl d_msgctl
15062 set msgget d_msgget
15064 set msgsnd d_msgsnd
15066 set msgrcv d_msgrcv
15072 : we could also check for sys/ipc.h ...
15073 if $h_msg && $test `./findhdr sys/msg.h`; then
15074 echo "You have the full msg*(2) library." >&4
15077 echo "You don't have the full msg*(2) library." >&4
15085 echo "Checking to see if your system supports struct msghdr..." >&4
15086 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
15088 case "$d_msghdr_s" in
15089 "$define") echo "Yes, it does." ;;
15090 *) echo "No, it doesn't." ;;
15094 : see if msync exists
15098 : see if munmap exists
15099 set munmap d_munmap
15102 : see if nice exists
15106 : see if this is a langinfo.h system
15107 set langinfo.h i_langinfo
15110 : see if nl_langinfo exists
15111 set nl_langinfo d_nl_langinfo
15114 : check for volatile keyword
15116 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
15117 $cat >try.c <<'EOCP'
15120 typedef struct _goo_struct goo_struct;
15121 goo_struct * volatile goo = ((goo_struct *)0);
15122 struct _goo_struct {
15127 typedef unsigned short foo_t;
15128 char *volatile foo;
15130 volatile foo_t blech;
15134 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
15136 echo "Yup, it does."
15139 echo "Nope, it doesn't."
15147 $echo "Choosing the C types to be used for Perl's internal types..." >&4
15149 case "$use64bitint:$d_quad:$quadtype" in
15152 uvtype="$uquadtype"
15157 uvtype="unsigned long"
15163 case "$uselongdouble:$d_longdbl" in
15165 nvtype="long double"
15166 nvsize=$longdblsize
15173 $echo "(IV will be "$ivtype", $ivsize bytes)"
15174 $echo "(UV will be "$uvtype", $uvsize bytes)"
15175 $echo "(NV will be "$nvtype", $nvsize bytes)"
15178 #$i_inttypes I_INTTYPES
15180 #include <inttypes.h>
15185 int8_t i = INT8_MAX;
15186 uint8_t u = UINT8_MAX;
15187 printf("int8_t\n");
15190 int16_t i = INT16_MAX;
15191 uint16_t i = UINT16_MAX;
15192 printf("int16_t\n");
15195 int32_t i = INT32_MAX;
15196 uint32_t u = UINT32_MAX;
15197 printf("int32_t\n");
15202 i8type="signed char"
15203 u8type="unsigned char"
15208 '') case "$shortsize" in
15210 u16type="unsigned short"
15218 '') set try -DINT16
15219 if eval $compile; then
15220 case "`$run ./try`" in
15232 '') if $test $shortsize -ge 2; then
15234 u16type="unsigned short"
15242 '') case "$longsize" in
15244 u32type="unsigned long"
15248 *) case "$intsize" in
15250 u32type="unsigned int"
15260 '') set try -DINT32
15261 if eval $compile; then
15262 case "`$run ./try`" in
15274 '') if $test $intsize -ge 4; then
15276 u32type="unsigned int"
15284 '') case "$d_quad:$quadtype" in
15286 i64type="$quadtype"
15287 u64type="$uquadtype"
15295 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
15296 : volatile so that the compiler has to store it out to memory.
15297 if test X"$d_volatile" = X"$define"; then
15302 #$i_stdlib I_STDLIB
15304 #include <stdlib.h>
15306 #include <sys/types.h>
15307 #include <signal.h>
15309 $volatile int bletched = 0;
15310 $signal_t blech(int s) { bletched = 1; }
15315 int n = 8 * $uvsize;
15318 signal(SIGFPE, blech);
15321 for (i = 0; i < n; i++) {
15322 u = u << 1 | ($uvtype)1;
15324 if (($uvtype)d != u)
15328 d = ($nvtype)(u - 1);
15329 if (($uvtype)d != (u - 1))
15336 printf("%d\n", ((i == n) ? -n : i));
15342 d_nv_preserves_uv="$undef"
15343 if eval $compile; then
15344 nv_preserves_uv_bits="`$run ./try`"
15346 case "$nv_preserves_uv_bits" in
15348 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
15349 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
15350 d_nv_preserves_uv="$define"
15352 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
15353 d_nv_preserves_uv="$undef" ;;
15354 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
15355 nv_preserves_uv_bits="0" ;;
15359 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
15360 : volatile so that the compiler has to store it out to memory.
15361 if test X"$d_volatile" = X"$define"; then
15366 #$i_stdlib I_STDLIB
15368 #include <stdlib.h>
15370 #$i_string I_STRING
15372 # include <string.h>
15374 # include <strings.h>
15376 #include <sys/types.h>
15377 #include <signal.h>
15379 $volatile int bletched = 0;
15380 $signal_t blech(int s) { bletched = 1; }
15383 int checkit($nvtype d, char *where) {
15384 unsigned char *p = (char *)&d;
15385 unsigned char *end = p + sizeof(d);
15395 printf("No - %s: 0x", where);
15397 printf ("%02X", *p++);
15402 int main(int argc, char **argv) {
15405 fail += checkit(d, "0.0");
15407 /* The compiler shouldn't be assuming that bletched is 0 */
15410 fail += checkit(d, "bleched");
15413 signal(SIGFPE, blech);
15416 /* Paranoia - the compiler should have no way of knowing that ANSI says
15417 that argv[argc] will always be NULL. Actually, if it did assume this it
15418 would be buggy, as this is C and main() can be called from elsewhere in
15420 d = argv[argc] ? 1 : 0;
15423 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
15426 fail += checkit(d, "ternary");
15428 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
15431 printf("No - memset doesn't give 0.0\n");
15432 /* This might just blow up: */
15433 printf("(gives %g)\n", d);
15439 printf("No - something bleched\n");
15444 printf("No - %d fail(s)\n", fail);
15453 d_nv_zero_is_allbits_zero="$undef"
15454 if eval $compile; then
15460 0.0 is represented as all bits zero in memory
15462 d_nv_zero_is_allbits_zero="$define"
15465 0.0 is not represented as all bits zero in memory
15467 d_nv_zero_is_allbits_zero="$undef"
15472 0.0 is not represented as all bits zero in memory
15474 d_nv_zero_is_allbits_zero="$undef"
15480 : check for off64_t
15482 echo "Checking to see if you have off64_t..." >&4
15484 #include <sys/types.h>
15485 #include <unistd.h>
15486 int main() { off64_t x = 7; }
15489 if eval $compile; then
15491 echo "You have off64_t."
15494 echo "You do not have off64_t."
15495 case "$lseeksize" in
15496 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
15503 : how to create joinable pthreads
15504 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
15506 echo "Checking what constant to use for creating joinable pthreads..." >&4
15507 $cat >try.c <<'EOCP'
15508 #include <pthread.h>
15510 int detachstate = JOINABLE;
15513 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
15514 if eval $compile; then
15515 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
15516 val="$undef" # Yes, undef.
15517 set d_old_pthread_create_joinable
15520 set old_pthread_create_joinable
15523 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
15524 if eval $compile; then
15525 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
15527 set d_old_pthread_create_joinable
15529 val=PTHREAD_CREATE_UNDETACHED
15530 set old_pthread_create_joinable
15533 set try -DJOINABLE=__UNDETACHED
15534 if eval $compile; then
15535 echo "You seem to use __UNDETACHED." >&4
15537 set d_old_pthread_create_joinable
15540 set old_pthread_create_joinable
15543 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
15545 set d_old_pthread_create_joinable
15548 set old_pthread_create_joinable
15555 d_old_pthread_create_joinable="$undef"
15556 old_pthread_create_joinable=""
15559 : see if pause exists
15563 : see if poll exists
15567 : see if readlink exists
15568 set readlink d_readlink
15574 case "$d_readlink" in
15576 if $issymlink /proc/self/exe ; then
15577 $ls -l /proc/self/exe > reflect
15578 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
15579 echo "You have Linux-like /proc/self/exe."
15580 procselfexe='"/proc/self/exe"'
15584 if $issymlink /proc/curproc/file ; then
15585 $ls -l /proc/curproc/file > reflect
15586 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
15587 echo "You have BSD-like /proc/curproc/file."
15588 procselfexe='"/proc/curproc/file"'
15598 : backward compatibility for d_hvfork
15599 if test X$d_hvfork != X; then
15600 d_vfork="$d_hvfork"
15603 : see if there is a vfork
15608 d_pseudofork=$undef
15610 : Ok, but do we want to use it. vfork is reportedly unreliable in
15611 : perl on Solaris 2.x, and probably elsewhere.
15615 case "$usevfork" in
15621 Perl can only use a vfork() that doesn't suffer from strict
15622 restrictions on calling functions or modifying global data in
15623 the child. For example, glibc-2.1 contains such a vfork()
15624 that is unsuitable. If your system provides a proper fork()
15625 call, chances are that you do NOT want perl to use vfork().
15628 rp="Do you still want to use vfork()?"
15633 echo "Ok, we won't use vfork()."
15642 $define) usevfork='true';;
15643 *) usevfork='false';;
15646 : see whether the pthread_atfork exists
15648 #include <pthread.h>
15651 #ifdef PTHREAD_ATFORK
15652 pthread_atfork(NULL,NULL,NULL);
15657 : see if pthread_atfork exists
15658 set try -DPTHREAD_ATFORK
15659 if eval $compile; then
15664 case "$usethreads" in
15667 $define) echo 'pthread_atfork found.' >&4 ;;
15668 *) echo 'pthread_atfork NOT found.' >&4 ;;
15671 set d_pthread_atfork
15674 : see if pthread_attr_setscope exists
15675 set pthread_attr_setscope d_pthread_attr_setscope
15679 : see whether the various POSIXish _yields exist
15681 #include <pthread.h>
15687 #ifdef PTHREAD_YIELD
15690 #ifdef PTHREAD_YIELD_NULL
15691 pthread_yield(NULL);
15697 : see if sched_yield exists
15698 set try -DSCHED_YIELD
15699 if eval $compile; then
15701 sched_yield='sched_yield()'
15705 case "$usethreads" in
15708 $define) echo 'sched_yield() found.' >&4 ;;
15709 *) echo 'sched_yield() NOT found.' >&4 ;;
15715 : see if pthread_yield exists
15716 set try -DPTHREAD_YIELD
15717 if eval $compile; then
15719 case "$sched_yield" in
15720 '') sched_yield='pthread_yield()' ;;
15723 set try -DPTHREAD_YIELD_NULL
15724 if eval $compile; then
15726 case "$sched_yield" in
15727 '') sched_yield='pthread_yield(NULL)' ;;
15733 case "$usethreads" in
15736 $define) echo 'pthread_yield() found.' >&4 ;;
15737 *) echo 'pthread_yield() NOT found.' >&4 ;;
15741 set d_pthread_yield
15743 case "$sched_yield" in
15744 '') sched_yield=undef ;;
15748 : see if random_r exists
15749 set random_r d_random_r
15751 case "$d_random_r" in
15753 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
15754 case "$d_random_r_proto:$usethreads" in
15755 ":define") d_random_r_proto=define
15756 set d_random_r_proto random_r $hdrs
15760 case "$d_random_r_proto" in
15762 case "$random_r_proto" in
15763 ''|0) try='int random_r(int*, struct random_data*);'
15764 ./protochk "extern $try" $hdrs && random_r_proto=I_iS ;;
15766 case "$random_r_proto" in
15767 ''|0) try='int random_r(long*, struct random_data*);'
15768 ./protochk "extern $try" $hdrs && random_r_proto=I_lS ;;
15770 case "$random_r_proto" in
15771 ''|0) try='int random_r(struct random_data*, int32_t*);'
15772 ./protochk "extern $try" $hdrs && random_r_proto=I_St ;;
15774 case "$random_r_proto" in
15775 ''|0) d_random_r=undef
15777 echo "Disabling random_r, cannot determine prototype." >&4 ;;
15778 * ) case "$random_r_proto" in
15779 REENTRANT_PROTO*) ;;
15780 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
15782 echo "Prototype: $try" ;;
15785 *) case "$usethreads" in
15786 define) echo "random_r has no prototype, not using it." >&4 ;;
15793 *) random_r_proto=0
15797 : see if readdir and friends exist
15798 set readdir d_readdir
15800 set seekdir d_seekdir
15802 set telldir d_telldir
15804 set rewinddir d_rewinddir
15807 : see if readdir64_r exists
15808 set readdir64_r d_readdir64_r
15810 case "$d_readdir64_r" in
15812 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
15813 case "$d_readdir64_r_proto:$usethreads" in
15814 ":define") d_readdir64_r_proto=define
15815 set d_readdir64_r_proto readdir64_r $hdrs
15819 case "$d_readdir64_r_proto" in
15821 case "$readdir64_r_proto" in
15822 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
15823 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TSR ;;
15825 case "$readdir64_r_proto" in
15826 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
15827 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TS ;;
15829 case "$readdir64_r_proto" in
15830 ''|0) d_readdir64_r=undef
15831 readdir64_r_proto=0
15832 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
15833 * ) case "$readdir64_r_proto" in
15834 REENTRANT_PROTO*) ;;
15835 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
15837 echo "Prototype: $try" ;;
15840 *) case "$usethreads" in
15841 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
15843 d_readdir64_r=undef
15844 readdir64_r_proto=0
15848 *) readdir64_r_proto=0
15852 : see if readdir_r exists
15853 set readdir_r d_readdir_r
15855 case "$d_readdir_r" in
15857 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
15858 case "$d_readdir_r_proto:$usethreads" in
15859 ":define") d_readdir_r_proto=define
15860 set d_readdir_r_proto readdir_r $hdrs
15864 case "$d_readdir_r_proto" in
15866 case "$readdir_r_proto" in
15867 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
15868 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TSR ;;
15870 case "$readdir_r_proto" in
15871 ''|0) try='int readdir_r(DIR*, struct dirent*);'
15872 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TS ;;
15874 case "$readdir_r_proto" in
15875 ''|0) d_readdir_r=undef
15877 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
15878 * ) case "$readdir_r_proto" in
15879 REENTRANT_PROTO*) ;;
15880 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
15882 echo "Prototype: $try" ;;
15885 *) case "$usethreads" in
15886 define) echo "readdir_r has no prototype, not using it." >&4 ;;
15893 *) readdir_r_proto=0
15897 : see if readv exists
15901 : see if recvmsg exists
15902 set recvmsg d_recvmsg
15905 : see if rename exists
15906 set rename d_rename
15909 : see if rmdir exists
15913 : see if memory.h is available.
15918 : See if it conflicts with string.h
15924 $cppstdin $cppflags $cppminus < $strings > mem.h
15925 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
15927 echo "We won't be including <memory.h>."
15937 : can bcopy handle overlapping blocks?
15940 case "$d_memmove" in
15941 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
15942 *) case "$d_bcopy" in
15944 echo "Checking to see if bcopy() can do overlapping copies..." >&4
15946 #$i_memory I_MEMORY
15947 #$i_stdlib I_STDLIB
15948 #$i_string I_STRING
15949 #$i_unistd I_UNISTD
15951 $cat >>try.c <<'EOCP'
15954 # include <memory.h>
15957 # include <stdlib.h>
15960 # include <string.h>
15962 # include <strings.h>
15965 # include <unistd.h> /* Needed for NetBSD */
15969 char buf[128], abc[128];
15975 /* Copy "abcde..." string to char abc[] so that gcc doesn't
15976 try to store the string in read-only memory. */
15977 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
15979 for (align = 7; align >= 0; align--) {
15980 for (len = 36; len; len--) {
15982 bcopy(abc, b, len);
15983 for (off = 1; off <= len; off++) {
15984 bcopy(b, b+off, len);
15985 bcopy(b+off, b, len);
15986 if (bcmp(b, abc, len))
15995 if eval $compile_ok; then
15996 if $run ./try 2>/dev/null; then
15997 echo "Yes, it can."
16000 echo "It can't, sorry."
16003 echo "(I can't compile the test program, so we'll assume not...)"
16013 : can memcpy handle overlapping blocks?
16016 case "$d_memmove" in
16017 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
16018 *) case "$d_memcpy" in
16020 echo "Checking to see if memcpy() can do overlapping copies..." >&4
16022 #$i_memory I_MEMORY
16023 #$i_stdlib I_STDLIB
16024 #$i_string I_STRING
16025 #$i_unistd I_UNISTD
16027 $cat >>try.c <<'EOCP'
16030 # include <memory.h>
16033 # include <stdlib.h>
16036 # include <string.h>
16038 # include <strings.h>
16041 # include <unistd.h> /* Needed for NetBSD */
16045 char buf[128], abc[128];
16051 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16052 try to store the string in read-only memory. */
16053 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
16055 for (align = 7; align >= 0; align--) {
16056 for (len = 36; len; len--) {
16058 memcpy(b, abc, len);
16059 for (off = 1; off <= len; off++) {
16060 memcpy(b+off, b, len);
16061 memcpy(b, b+off, len);
16062 if (memcmp(b, abc, len))
16071 if eval $compile_ok; then
16072 if $run ./try 2>/dev/null; then
16073 echo "Yes, it can."
16076 echo "It can't, sorry."
16079 echo "(I can't compile the test program, so we'll assume not...)"
16089 : can memcmp be trusted to compare relative magnitude?
16091 case "$d_memcmp" in
16094 echo "Checking if your memcmp() can compare relative magnitude..." >&4
16096 #$i_memory I_MEMORY
16097 #$i_stdlib I_STDLIB
16098 #$i_string I_STRING
16099 #$i_unistd I_UNISTD
16101 $cat >>try.c <<'EOCP'
16104 # include <memory.h>
16107 # include <stdlib.h>
16110 # include <string.h>
16112 # include <strings.h>
16115 # include <unistd.h> /* Needed for NetBSD */
16121 if ((a < b) && memcmp(&a, &b, 1) < 0)
16127 if eval $compile_ok; then
16128 if $run ./try 2>/dev/null; then
16129 echo "Yes, it can."
16132 echo "No, it can't (it uses signed chars)."
16135 echo "(I can't compile the test program, so we'll assume not...)"
16143 : see if prototype for sbrk is available
16145 set d_sbrkproto sbrk $i_unistd unistd.h
16148 : see if select exists
16149 set select d_select
16152 : see if semctl exists
16153 set semctl d_semctl
16156 : see if semget exists
16157 set semget d_semget
16160 : see if semop exists
16164 : see how much of the 'sem*(2)' library is present.
16167 case "$d_semctl$d_semget$d_semop" in
16168 *"$undef"*) h_sem=false;;
16172 case "`ipcs 2>&1`" in
16173 "SVID messages"*"not configured"*)
16174 echo "Your $osname does not have the sem*(2) configured." >&4
16177 set semctl d_semctl
16179 set semget d_semget
16187 : we could also check for sys/ipc.h ...
16188 if $h_sem && $test `./findhdr sys/sem.h`; then
16189 echo "You have the full sem*(2) library." >&4
16192 echo "You don't have the full sem*(2) library." >&4
16198 : see whether sys/sem.h defines union semun
16200 $cat > try.c <<'END'
16201 #include <sys/types.h>
16202 #include <sys/ipc.h>
16203 #include <sys/sem.h>
16204 int main () { union semun semun; semun.buf = 0; }
16207 if eval $compile; then
16208 echo "You have union semun in <sys/sem.h>." >&4
16211 echo "You do not have union semun in <sys/sem.h>." >&4
16218 : see how to do semctl IPC_STAT
16222 $cat > tryh.h <<END
16225 # define S_IRUSR S_IREAD
16226 # define S_IWUSR S_IWRITE
16227 # define S_IXUSR S_IEXEC
16229 # define S_IRUSR 0400
16230 # define S_IWUSR 0200
16231 # define S_IXUSR 0100
16233 # define S_IRGRP (S_IRUSR>>3)
16234 # define S_IWGRP (S_IWUSR>>3)
16235 # define S_IXGRP (S_IXUSR>>3)
16236 # define S_IROTH (S_IRUSR>>6)
16237 # define S_IWOTH (S_IWUSR>>6)
16238 # define S_IXOTH (S_IXUSR>>6)
16241 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
16242 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
16243 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
16246 : see whether semctl IPC_STAT can use union semun
16247 case "$d_semctl_semun" in
16251 #include <sys/types.h>
16252 #include <sys/ipc.h>
16253 #include <sys/sem.h>
16254 #include <sys/stat.h>
16261 #$d_union_semun HAS_UNION_SEMUN
16264 #ifndef HAS_UNION_SEMUN
16267 struct semid_ds *buf;
16268 unsigned short *array;
16274 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16275 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16277 struct semid_ds argbuf;
16280 st = semctl(sem, 0, IPC_STAT, arg);
16284 # endif /* IPC_STAT */
16285 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16287 if (semctl(sem, 0, IPC_RMID, arg) != 0)
16288 # endif /* IPC_RMID */
16289 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16291 #endif /* IPC_PRIVATE && ... */
16292 printf("semget failed: errno = %d\n", errno);
16297 if eval $compile; then
16300 semun) val="$define" ;;
16308 case "$d_semctl_semun" in
16310 echo "You can use union semun for semctl IPC_STAT." >&4
16313 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
16318 : see whether semctl IPC_STAT can use struct semid_ds pointer
16319 case "$d_semctl_semid_ds" in
16322 $cat > try.c <<'END'
16323 #include <sys/types.h>
16324 #include <sys/ipc.h>
16325 #include <sys/sem.h>
16326 #include <sys/stat.h>
16334 struct semid_ds arg;
16337 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16338 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16341 st = semctl(sem, 0, IPC_STAT, &arg);
16343 printf("semid_ds\n");
16345 # endif /* IPC_STAT */
16346 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16348 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
16349 # endif /* IPC_RMID */
16350 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16352 #endif /* IPC_PRIVATE && ... */
16353 printf("semget failed: errno = %d\n", errno);
16359 if eval $compile; then
16362 semid_ds) val="$define" ;;
16366 set d_semctl_semid_ds
16370 case "$d_semctl_semid_ds" in
16372 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
16374 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
16380 # We do not have the full sem*(2) library, so assume we can not
16386 set d_semctl_semid_ds
16392 : see if sendmsg exists
16393 set sendmsg d_sendmsg
16396 : see if setegid exists
16397 set setegid d_setegid
16400 : see if seteuid exists
16401 set seteuid d_seteuid
16404 : see if setgrent exists
16405 set setgrent d_setgrent
16408 : see if setgrent_r exists
16409 set setgrent_r d_setgrent_r
16411 case "$d_setgrent_r" in
16413 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
16414 case "$d_setgrent_r_proto:$usethreads" in
16415 ":define") d_setgrent_r_proto=define
16416 set d_setgrent_r_proto setgrent_r $hdrs
16420 case "$d_setgrent_r_proto" in
16422 case "$setgrent_r_proto" in
16423 ''|0) try='int setgrent_r(FILE**);'
16424 ./protochk "extern $try" $hdrs && setgrent_r_proto=I_H ;;
16426 case "$setgrent_r_proto" in
16427 ''|0) try='void setgrent_r(FILE**);'
16428 ./protochk "extern $try" $hdrs && setgrent_r_proto=V_H ;;
16430 case "$setgrent_r_proto" in
16431 ''|0) d_setgrent_r=undef
16433 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
16434 * ) case "$setgrent_r_proto" in
16435 REENTRANT_PROTO*) ;;
16436 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
16438 echo "Prototype: $try" ;;
16441 *) case "$usethreads" in
16442 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
16449 *) setgrent_r_proto=0
16453 : see if sethostent exists
16454 set sethostent d_sethent
16457 : see if sethostent_r exists
16458 set sethostent_r d_sethostent_r
16460 case "$d_sethostent_r" in
16462 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16463 case "$d_sethostent_r_proto:$usethreads" in
16464 ":define") d_sethostent_r_proto=define
16465 set d_sethostent_r_proto sethostent_r $hdrs
16469 case "$d_sethostent_r_proto" in
16471 case "$sethostent_r_proto" in
16472 ''|0) try='int sethostent_r(int, struct hostent_data*);'
16473 ./protochk "extern $try" $hdrs && sethostent_r_proto=I_ID ;;
16475 case "$sethostent_r_proto" in
16476 ''|0) try='void sethostent_r(int, struct hostent_data*);'
16477 ./protochk "extern $try" $hdrs && sethostent_r_proto=V_ID ;;
16479 case "$sethostent_r_proto" in
16480 ''|0) d_sethostent_r=undef
16481 sethostent_r_proto=0
16482 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
16483 * ) case "$sethostent_r_proto" in
16484 REENTRANT_PROTO*) ;;
16485 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
16487 echo "Prototype: $try" ;;
16490 *) case "$usethreads" in
16491 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
16493 d_sethostent_r=undef
16494 sethostent_r_proto=0
16498 *) sethostent_r_proto=0
16502 : see if setitimer exists
16503 set setitimer d_setitimer
16506 : see if setlinebuf exists
16507 set setlinebuf d_setlinebuf
16510 : see if setlocale exists
16511 set setlocale d_setlocale
16514 : see if locale.h is available
16515 set locale.h i_locale
16518 : see if setlocale_r exists
16519 set setlocale_r d_setlocale_r
16521 case "$d_setlocale_r" in
16523 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
16524 case "$d_setlocale_r_proto:$usethreads" in
16525 ":define") d_setlocale_r_proto=define
16526 set d_setlocale_r_proto setlocale_r $hdrs
16530 case "$d_setlocale_r_proto" in
16532 case "$setlocale_r_proto" in
16533 ''|0) try='int setlocale_r(int, const char*, char*, int);'
16534 ./protochk "extern $try" $hdrs && setlocale_r_proto=I_ICBI ;;
16536 case "$setlocale_r_proto" in
16537 ''|0) d_setlocale_r=undef
16538 setlocale_r_proto=0
16539 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
16540 * ) case "$setlocale_r_proto" in
16541 REENTRANT_PROTO*) ;;
16542 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
16544 echo "Prototype: $try" ;;
16547 *) case "$usethreads" in
16548 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
16550 d_setlocale_r=undef
16551 setlocale_r_proto=0
16555 *) setlocale_r_proto=0
16559 : see if setnetent exists
16560 set setnetent d_setnent
16563 : see if setnetent_r exists
16564 set setnetent_r d_setnetent_r
16566 case "$d_setnetent_r" in
16568 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16569 case "$d_setnetent_r_proto:$usethreads" in
16570 ":define") d_setnetent_r_proto=define
16571 set d_setnetent_r_proto setnetent_r $hdrs
16575 case "$d_setnetent_r_proto" in
16577 case "$setnetent_r_proto" in
16578 ''|0) try='int setnetent_r(int, struct netent_data*);'
16579 ./protochk "extern $try" $hdrs && setnetent_r_proto=I_ID ;;
16581 case "$setnetent_r_proto" in
16582 ''|0) try='void setnetent_r(int, struct netent_data*);'
16583 ./protochk "extern $try" $hdrs && setnetent_r_proto=V_ID ;;
16585 case "$setnetent_r_proto" in
16586 ''|0) d_setnetent_r=undef
16587 setnetent_r_proto=0
16588 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
16589 * ) case "$setnetent_r_proto" in
16590 REENTRANT_PROTO*) ;;
16591 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
16593 echo "Prototype: $try" ;;
16596 *) case "$usethreads" in
16597 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
16599 d_setnetent_r=undef
16600 setnetent_r_proto=0
16604 *) setnetent_r_proto=0
16608 : see if setprotoent exists
16609 set setprotoent d_setpent
16612 : see if setpgid exists
16613 set setpgid d_setpgid
16616 : see if setpgrp2 exists
16617 set setpgrp2 d_setpgrp2
16620 : see if setpriority exists
16621 set setpriority d_setprior
16624 : see if setproctitle exists
16625 set setproctitle d_setproctitle
16628 : see if setprotoent_r exists
16629 set setprotoent_r d_setprotoent_r
16631 case "$d_setprotoent_r" in
16633 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16634 case "$d_setprotoent_r_proto:$usethreads" in
16635 ":define") d_setprotoent_r_proto=define
16636 set d_setprotoent_r_proto setprotoent_r $hdrs
16640 case "$d_setprotoent_r_proto" in
16642 case "$setprotoent_r_proto" in
16643 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
16644 ./protochk "extern $try" $hdrs && setprotoent_r_proto=I_ID ;;
16646 case "$setprotoent_r_proto" in
16647 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
16648 ./protochk "extern $try" $hdrs && setprotoent_r_proto=V_ID ;;
16650 case "$setprotoent_r_proto" in
16651 ''|0) d_setprotoent_r=undef
16652 setprotoent_r_proto=0
16653 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
16654 * ) case "$setprotoent_r_proto" in
16655 REENTRANT_PROTO*) ;;
16656 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
16658 echo "Prototype: $try" ;;
16661 *) case "$usethreads" in
16662 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
16664 d_setprotoent_r=undef
16665 setprotoent_r_proto=0
16669 *) setprotoent_r_proto=0
16673 : see if setpwent exists
16674 set setpwent d_setpwent
16677 : see if setpwent_r exists
16678 set setpwent_r d_setpwent_r
16680 case "$d_setpwent_r" in
16682 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
16683 case "$d_setpwent_r_proto:$usethreads" in
16684 ":define") d_setpwent_r_proto=define
16685 set d_setpwent_r_proto setpwent_r $hdrs
16689 case "$d_setpwent_r_proto" in
16691 case "$setpwent_r_proto" in
16692 ''|0) try='int setpwent_r(FILE**);'
16693 ./protochk "extern $try" $hdrs && setpwent_r_proto=I_H ;;
16695 case "$setpwent_r_proto" in
16696 ''|0) try='void setpwent_r(FILE**);'
16697 ./protochk "extern $try" $hdrs && setpwent_r_proto=V_H ;;
16699 case "$setpwent_r_proto" in
16700 ''|0) d_setpwent_r=undef
16702 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
16703 * ) case "$setpwent_r_proto" in
16704 REENTRANT_PROTO*) ;;
16705 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
16707 echo "Prototype: $try" ;;
16710 *) case "$usethreads" in
16711 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
16718 *) setpwent_r_proto=0
16722 : see if setregid exists
16723 set setregid d_setregid
16725 set setresgid d_setresgid
16728 : see if setreuid exists
16729 set setreuid d_setreuid
16731 set setresuid d_setresuid
16734 : see if setrgid exists
16735 set setrgid d_setrgid
16738 : see if setruid exists
16739 set setruid d_setruid
16742 : see if setservent exists
16743 set setservent d_setsent
16746 : see if setservent_r exists
16747 set setservent_r d_setservent_r
16749 case "$d_setservent_r" in
16751 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16752 case "$d_setservent_r_proto:$usethreads" in
16753 ":define") d_setservent_r_proto=define
16754 set d_setservent_r_proto setservent_r $hdrs
16758 case "$d_setservent_r_proto" in
16760 case "$setservent_r_proto" in
16761 ''|0) try='int setservent_r(int, struct servent_data*);'
16762 ./protochk "extern $try" $hdrs && setservent_r_proto=I_ID ;;
16764 case "$setservent_r_proto" in
16765 ''|0) try='void setservent_r(int, struct servent_data*);'
16766 ./protochk "extern $try" $hdrs && setservent_r_proto=V_ID ;;
16768 case "$setservent_r_proto" in
16769 ''|0) d_setservent_r=undef
16770 setservent_r_proto=0
16771 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
16772 * ) case "$setservent_r_proto" in
16773 REENTRANT_PROTO*) ;;
16774 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
16776 echo "Prototype: $try" ;;
16779 *) case "$usethreads" in
16780 define) echo "setservent_r has no prototype, not using it." >&4 ;;
16782 d_setservent_r=undef
16783 setservent_r_proto=0
16787 *) setservent_r_proto=0
16791 : see if setsid exists
16792 set setsid d_setsid
16795 : see if setvbuf exists
16796 set setvbuf d_setvbuf
16799 : see if sfio.h is available
16804 : see if sfio library is available
16815 : Ok, but do we want to use it.
16819 true|$define|[yY]*) dflt='y';;
16822 echo "$package can use the sfio library, but it is experimental."
16823 case "$useperlio" in
16825 echo "For sfio also the PerlIO abstraction layer is needed."
16826 echo "Earlier you said you wouldn't want that."
16829 rp="You seem to have sfio available, do you want to try using it?"
16832 y|Y) echo "Ok, turning on both sfio and PerlIO, then."
16833 useperlio="$define"
16836 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
16841 *) case "$usesfio" in
16842 true|$define|[yY]*)
16843 echo "Sorry, cannot find sfio on this machine." >&4
16844 echo "Ignoring your setting of usesfio=$usesfio." >&4
16853 $define) usesfio='true';;
16854 *) usesfio='false';;
16858 *) : Remove sfio from list of libraries to use
16861 echo "Removing unneeded -lsfio from library list" >&4
16862 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
16865 echo "libs = $libs" >&4
16872 : see if shmctl exists
16873 set shmctl d_shmctl
16876 : see if shmget exists
16877 set shmget d_shmget
16880 : see if shmat exists
16883 : see what shmat returns
16886 $cat >shmat.c <<'END'
16887 #include <sys/shm.h>
16890 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
16895 echo "and it returns ($shmattype)." >&4
16896 : see if a prototype for shmat is available
16897 xxx=`./findhdr sys/shm.h`
16898 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
16899 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
16910 set d_shmatprototype
16913 : see if shmdt exists
16917 : see how much of the 'shm*(2)' library is present.
16920 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
16921 *"$undef"*) h_shm=false;;
16925 case "`ipcs 2>&1`" in
16926 "SVID shared memory"*"not configured"*)
16927 echo "Your $osname does not have the shm*(2) configured." >&4
16930 set shmctl d_shmctl
16932 set shmget d_shmget
16942 : we could also check for sys/ipc.h ...
16943 if $h_shm && $test `./findhdr sys/shm.h`; then
16944 echo "You have the full shm*(2) library." >&4
16947 echo "You don't have the full shm*(2) library." >&4
16954 : see if we have sigaction
16955 if set sigaction val -f d_sigaction; eval $csym; $val; then
16956 echo 'sigaction() found.' >&4
16959 #include <sys/types.h>
16960 #include <signal.h>
16961 #$i_stdlib I_STDLIB
16963 #include <stdlib.h>
16967 struct sigaction act, oact;
16969 oact.sa_handler = 0;
16970 /* so that act and oact are used */
16971 exit(act.sa_flags == 0 && oact.sa_handler == 0);
16975 if eval $compile_ok; then
16978 echo "But you don't seem to have a useable struct sigaction." >&4
16982 echo 'sigaction NOT found.' >&4
16985 set d_sigaction; eval $setvar
16988 : see if this is a sunmath.h system
16989 set sunmath.h i_sunmath
16992 : see if signbit exists
16993 $echo $n "Checking to see if you have signbit() available to work on $nvtype... $c" >&4
16996 #$i_sunmath I_SUNMATH
17000 #ifdef I_SUNMATH /* Solaris special math library */
17001 # include <sunmath.h>
17004 int main(int argc, char **argv)
17008 if ((signbit(x) == 0) && (signbit(y) != 0))
17016 if eval $compile; then
17017 if $run ./try; then
17021 $echo "Signbit seems to be available, but doesn't work as I expected."
17022 $echo "I won't use it." >&4
17033 : see if sigprocmask exists
17034 set sigprocmask d_sigprocmask
17037 : see if sigsetjmp exists
17039 case "$d_sigsetjmp" in
17042 #include <setjmp.h>
17043 #$i_stdlib I_STDLIB
17045 #include <stdlib.h>
17051 if (sigsetjmp(env,1))
17054 siglongjmp(env, 1);
17059 if eval $compile; then
17060 if $run ./try >/dev/null 2>&1; then
17061 echo "POSIX sigsetjmp found." >&4
17065 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
17071 echo "sigsetjmp not found." >&4
17075 *) val="$d_sigsetjmp"
17076 case "$d_sigsetjmp" in
17077 $define) echo "POSIX sigsetjmp found." >&4;;
17078 $undef) echo "sigsetjmp not found." >&4;;
17086 : see if snprintf exists
17087 set snprintf d_snprintf
17090 : see if vsnprintf exists
17091 set vsnprintf d_vsnprintf
17094 case "$d_snprintf-$d_vsnprintf" in
17097 Checking whether your snprintf() and vsnprintf() work okay...
17099 $cat >try.c <<'EOCP'
17100 /* v?snprintf testing logic courtesy of Russ Allbery.
17101 * According to C99:
17102 * - if the buffer is too short it still must be \0-terminated
17103 * - if the buffer is too short the potentially required length
17104 * must be returned and not -1
17105 * - if the buffer is NULL the potentially required length
17106 * must be returned and not -1 or core dump
17109 #include <stdarg.h>
17113 int test (char *format, ...)
17118 va_start (args, format);
17119 count = vsnprintf (buf, sizeof buf, format, args);
17126 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
17127 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
17131 if eval $compile; then
17134 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
17136 Your snprintf() and snprintf() don't seem to be working okay.
17138 d_snprintf="$undef"
17139 d_vsnprintf="$undef"
17143 echo "(I can't seem to compile the test program--assuming they don't)"
17144 d_snprintf="$undef"
17145 d_vsnprintf="$undef"
17151 : see if sockatmark exists
17152 set sockatmark d_sockatmark
17155 : see if prototype for sockatmark is available
17157 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
17160 : see if socks5_init exists
17161 set socks5_init d_socks5_init
17164 : see if sprintf returns the length of the string in the buffer as per ANSI
17165 $echo "Checking whether sprintf returns the length of the string..." >&4
17168 #$i_stdlib I_STDLIB
17170 #include <stdlib.h>
17172 #$i_string I_STRING
17174 # include <string.h>
17176 # include <strings.h>
17185 int check (size_t expect, int test) {
17186 size_t got = strlen(buffer);
17190 printf("expected %ld, got %ld in test %d '%s'\n", (long) expect, (long) got,
17195 int main(int argc, char **argv) {
17198 check(sprintf(buffer, ""), ++test);
17199 check(sprintf(buffer, "%s %s", "perl", "rules"), ++test);
17200 check(sprintf(buffer, "I like %g", atan2(0,-1)), ++test);
17207 d_sprintf_returns_strlen="$undef"
17208 if eval $compile; then
17212 sprintf returns the length of the string (as ANSI says it should)
17214 d_sprintf_returns_strlen="$define"
17217 sprintf does not return the length of the string (how old is this system?)
17219 d_sprintf_returns_strlen="$undef"
17225 : see if srand48_r exists
17226 set srand48_r d_srand48_r
17228 case "$d_srand48_r" in
17230 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17231 case "$d_srand48_r_proto:$usethreads" in
17232 ":define") d_srand48_r_proto=define
17233 set d_srand48_r_proto srand48_r $hdrs
17237 case "$d_srand48_r_proto" in
17239 case "$srand48_r_proto" in
17240 ''|0) try='int srand48_r(long, struct drand48_data*);'
17241 ./protochk "extern $try" $hdrs && srand48_r_proto=I_LS ;;
17243 case "$srand48_r_proto" in
17244 ''|0) d_srand48_r=undef
17246 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
17247 * ) case "$srand48_r_proto" in
17248 REENTRANT_PROTO*) ;;
17249 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
17251 echo "Prototype: $try" ;;
17254 *) case "$usethreads" in
17255 define) echo "srand48_r has no prototype, not using it." >&4 ;;
17262 *) srand48_r_proto=0
17266 : see if srandom_r exists
17267 set srandom_r d_srandom_r
17269 case "$d_srandom_r" in
17271 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17272 case "$d_srandom_r_proto:$usethreads" in
17273 ":define") d_srandom_r_proto=define
17274 set d_srandom_r_proto srandom_r $hdrs
17278 case "$d_srandom_r_proto" in
17280 case "$srandom_r_proto" in
17281 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
17282 ./protochk "extern $try" $hdrs && srandom_r_proto=I_TS ;;
17284 case "$srandom_r_proto" in
17285 ''|0) d_srandom_r=undef
17287 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
17288 * ) case "$srandom_r_proto" in
17289 REENTRANT_PROTO*) ;;
17290 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
17292 echo "Prototype: $try" ;;
17295 *) case "$usethreads" in
17296 define) echo "srandom_r has no prototype, not using it." >&4 ;;
17303 *) srandom_r_proto=0
17307 : see if prototype for setresgid is available
17309 set d_sresgproto setresgid $i_unistd unistd.h
17312 : see if prototype for setresuid is available
17314 set d_sresuproto setresuid $i_unistd unistd.h
17317 : see if sys/stat.h is available
17318 set sys/stat.h i_sysstat
17322 : see if stat knows about block sizes
17324 echo "Checking to see if your struct stat has st_blocks field..." >&4
17325 set d_statblks stat st_blocks $i_sysstat sys/stat.h
17329 : see if this is a sys/vfs.h system
17330 set sys/vfs.h i_sysvfs
17334 : see if this is a sys/statfs.h system
17335 set sys/statfs.h i_sysstatfs
17340 echo "Checking to see if your system supports struct statfs..." >&4
17341 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
17343 case "$d_statfs_s" in
17344 "$define") echo "Yes, it does." ;;
17345 *) echo "No, it doesn't." ;;
17350 : see if struct statfs knows about f_flags
17351 case "$d_statfs_s" in
17354 echo "Checking to see if your struct statfs has f_flags field..." >&4
17355 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
17359 set d_statfs_f_flags
17363 case "$d_statfs_f_flags" in
17364 "$define") echo "Yes, it does." ;;
17365 *) echo "No, it doesn't." ;;
17369 Checking how to access stdio streams by file descriptor number...
17371 case "$stdio_stream_array" in
17372 '') $cat >try.c <<EOCP
17375 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
17379 for s in _iob __iob __sF
17381 set try -DSTDIO_STREAM_ARRAY=$s
17382 if eval $compile; then
17383 case "`$run ./try`" in
17384 yes) stdio_stream_array=$s; break ;;
17390 case "$stdio_stream_array" in
17392 I can't figure out how to access stdio streams by file descriptor number.
17394 d_stdio_stream_array="$undef"
17397 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
17399 d_stdio_stream_array="$define"
17403 : see if strcoll exists
17404 set strcoll d_strcoll
17407 : check for structure copying
17409 echo "Checking to see if your C compiler can copy structs..." >&4
17410 $cat >try.c <<'EOCP'
17420 if $cc -c try.c >/dev/null 2>&1 ; then
17422 echo "Yup, it can."
17425 echo "Nope, it can't."
17431 : see if strerror and/or sys_errlist[] exist
17433 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
17434 if set strerror val -f d_strerror; eval $csym; $val; then
17435 echo 'strerror() found.' >&4
17436 d_strerror="$define"
17437 d_strerrm='strerror(e)'
17438 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17439 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
17440 d_syserrlst="$define"
17442 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
17443 d_syserrlst="$undef"
17445 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
17446 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
17447 echo 'strerror() found in string header.' >&4
17448 d_strerror="$define"
17449 d_strerrm='strerror(e)'
17450 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17451 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
17452 d_syserrlst="$define"
17454 echo "(You don't appear to have any sys_errlist[], how can this be?)"
17455 d_syserrlst="$undef"
17457 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17458 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
17459 d_strerror="$undef"
17460 d_syserrlst="$define"
17461 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
17463 echo 'strerror() and sys_errlist[] NOT found.' >&4
17464 d_strerror="$undef"
17465 d_syserrlst="$undef"
17466 d_strerrm='"unknown"'
17470 : see if strerror_r exists
17471 set strerror_r d_strerror_r
17473 case "$d_strerror_r" in
17475 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
17476 case "$d_strerror_r_proto:$usethreads" in
17477 ":define") d_strerror_r_proto=define
17478 set d_strerror_r_proto strerror_r $hdrs
17482 case "$d_strerror_r_proto" in
17484 case "$strerror_r_proto" in
17485 ''|0) try='int strerror_r(int, char*, size_t);'
17486 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBW ;;
17488 case "$strerror_r_proto" in
17489 ''|0) try='int strerror_r(int, char*, int);'
17490 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBI ;;
17492 case "$strerror_r_proto" in
17493 ''|0) try='char* strerror_r(int, char*, size_t);'
17494 ./protochk "extern $try" $hdrs && strerror_r_proto=B_IBW ;;
17496 case "$strerror_r_proto" in
17497 ''|0) d_strerror_r=undef
17499 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
17500 * ) case "$strerror_r_proto" in
17501 REENTRANT_PROTO*) ;;
17502 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
17504 echo "Prototype: $try" ;;
17507 *) case "$usethreads" in
17508 define) echo "strerror_r has no prototype, not using it." >&4 ;;
17515 *) strerror_r_proto=0
17519 : see if strftime exists
17520 set strftime d_strftime
17523 : see if strlcat exists
17524 set strlcat d_strlcat
17527 : see if strlcpy exists
17528 set strlcpy d_strlcpy
17531 : see if strtod exists
17532 set strtod d_strtod
17535 : see if strtol exists
17536 set strtol d_strtol
17539 : see if strtold exists
17540 set strtold d_strtold
17543 : see if strtoll exists
17544 set strtoll d_strtoll
17547 case "$d_longlong-$d_strtoll" in
17550 Checking whether your strtoll() works okay...
17552 $cat >try.c <<'EOCP'
17555 #define strtoll __strtoll
17558 #define strtoll _strtoll
17561 extern long long int strtoll(char *s, char **, int);
17562 static int bad = 0;
17563 int check(char *s, long long ell, int een) {
17566 gll = strtoll(s, 0, 10);
17567 if (!((gll == ell) && (errno == een)))
17571 check(" 1", 1LL, 0);
17572 check(" 0", 0LL, 0);
17573 check("-1", -1LL, 0);
17574 check("-9223372036854775808", -9223372036854775808LL, 0);
17575 check("-9223372036854775808", -9223372036854775808LL, 0);
17576 check(" 9223372036854775807", 9223372036854775807LL, 0);
17577 check("-9223372036854775808", -9223372036854775808LL, 0);
17578 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
17579 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
17585 if eval $compile; then
17588 ok) echo "Your strtoll() seems to be working okay." ;;
17590 Your strtoll() doesn't seem to be working okay.
17596 echo "(I can't seem to compile the test program--assuming it doesn't)"
17602 : see if strtoq exists
17603 set strtoq d_strtoq
17606 : see if strtoul exists
17607 set strtoul d_strtoul
17610 case "$d_strtoul" in
17613 Checking whether your strtoul() works okay...
17615 $cat >try.c <<'EOCP'
17618 extern unsigned long int strtoul(char *s, char **, int);
17619 static int bad = 0;
17620 void check(char *s, unsigned long eul, int een) {
17623 gul = strtoul(s, 0, 10);
17624 if (!((gul == eul) && (errno == een)))
17628 check(" 1", 1L, 0);
17629 check(" 0", 0L, 0);
17631 case "$longsize" in
17633 $cat >>try.c <<'EOCP'
17634 check("18446744073709551615", 18446744073709551615UL, 0);
17635 check("18446744073709551616", 18446744073709551615UL, ERANGE);
17636 #if 0 /* strtoul() for /^-/ strings is undefined. */
17637 check("-1", 18446744073709551615UL, 0);
17638 check("-18446744073709551614", 2, 0);
17639 check("-18446744073709551615", 1, 0);
17640 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
17641 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
17646 $cat >>try.c <<'EOCP'
17647 check("4294967295", 4294967295UL, 0);
17648 check("4294967296", 4294967295UL, ERANGE);
17649 #if 0 /* strtoul() for /^-/ strings is undefined. */
17650 check("-1", 4294967295UL, 0);
17651 check("-4294967294", 2, 0);
17652 check("-4294967295", 1, 0);
17653 check("-4294967296", 4294967295UL, ERANGE);
17654 check("-4294967297", 4294967295UL, ERANGE);
17659 : Should we write these tests to be more portable by sprintf-ing
17660 : ~0 and then manipulating that char string as input for strtol?
17663 $cat >>try.c <<'EOCP'
17670 if eval $compile; then
17671 case "`$run ./try`" in
17672 ok) echo "Your strtoul() seems to be working okay." ;;
17674 Your strtoul() doesn't seem to be working okay.
17680 echo "(I can't seem to compile the test program--assuming it doesn't)"
17686 : see if strtoull exists
17687 set strtoull d_strtoull
17690 case "$d_longlong-$d_strtoull" in
17693 Checking whether your strtoull() works okay...
17695 $cat >try.c <<'EOCP'
17698 #define strtoull __strtoull
17701 extern unsigned long long int strtoull(char *s, char **, int);
17702 static int bad = 0;
17703 int check(char *s, long long eull, int een) {
17706 gull = strtoull(s, 0, 10);
17707 if (!((gull == eull) && (errno == een)))
17711 check(" 1", 1LL, 0);
17712 check(" 0", 0LL, 0);
17713 check("18446744073709551615", 18446744073709551615ULL, 0);
17714 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
17715 #if 0 /* strtoull() for /^-/ strings is undefined. */
17716 check("-1", 18446744073709551615ULL, 0);
17717 check("-18446744073709551614", 2LL, 0);
17718 check("-18446744073709551615", 1LL, 0);
17719 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
17720 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
17727 if eval $compile; then
17728 case "`$run ./try`" in
17729 ok) echo "Your strtoull() seems to be working okay." ;;
17731 Your strtoull() doesn't seem to be working okay.
17733 d_strtoull="$undef"
17737 echo "(I can't seem to compile the test program--assuming it doesn't)"
17738 d_strtoull="$undef"
17743 : see if strtouq exists
17744 set strtouq d_strtouq
17747 case "$d_strtouq" in
17750 Checking whether your strtouq() works okay...
17752 $cat >try.c <<'EOCP'
17755 extern unsigned long long int strtouq(char *s, char **, int);
17756 static int bad = 0;
17757 void check(char *s, unsigned long long eull, int een) {
17758 unsigned long long gull;
17760 gull = strtouq(s, 0, 10);
17761 if (!((gull == eull) && (errno == een)))
17765 check(" 1", 1LL, 0);
17766 check(" 0", 0LL, 0);
17767 check("18446744073709551615", 18446744073709551615ULL, 0);
17768 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
17769 #if 0 /* strtouq() for /^-/ strings is undefined. */
17770 check("-1", 18446744073709551615ULL, 0);
17771 check("-18446744073709551614", 2LL, 0);
17772 check("-18446744073709551615", 1LL, 0);
17773 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
17774 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
17782 if eval $compile; then
17783 case "`$run ./try`" in
17784 ok) echo "Your strtouq() seems to be working okay." ;;
17786 Your strtouq() doesn't seem to be working okay.
17792 echo "(I can't seem to compile the test program--assuming it doesn't)"
17798 : see if strxfrm exists
17799 set strxfrm d_strxfrm
17802 : see if symlink exists
17803 set symlink d_symlink
17806 : see if syscall exists
17807 set syscall d_syscall
17810 : see if prototype for syscall is available
17812 set d_syscallproto syscall $i_unistd unistd.h
17815 : see if sysconf exists
17816 set sysconf d_sysconf
17819 : see if system exists
17820 set system d_system
17823 : see if tcgetpgrp exists
17824 set tcgetpgrp d_tcgetpgrp
17827 : see if tcsetpgrp exists
17828 set tcsetpgrp d_tcsetpgrp
17831 : see if prototype for telldir is available
17833 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
17836 : see if time exists
17838 if test "X$d_time" = X -o X"$timetype" = X; then
17839 if set time val -f d_time; eval $csym; $val; then
17840 echo 'time() found.' >&4
17842 rp="What is the type returned by time() on this system?"
17843 set time_t timetype long stdio.h sys/types.h
17846 echo 'time() not found, hope that will do.' >&4
17854 : see if this is a sys/times.h system
17855 set sys/times.h i_systimes
17858 : see if times exists
17860 if set times val -f d_times; eval $csym; $val; then
17861 echo 'times() found.' >&4
17864 case "$i_systimes" in
17865 "$define") inc='sys/times.h';;
17867 rp="What is the type returned by times() on this system?"
17868 set clock_t clocktype long stdio.h sys/types.h $inc
17871 echo 'times() NOT found, hope that will do.' >&4
17876 : see if tmpnam_r exists
17877 set tmpnam_r d_tmpnam_r
17879 case "$d_tmpnam_r" in
17881 hdrs="$i_systypes sys/types.h define stdio.h "
17882 case "$d_tmpnam_r_proto:$usethreads" in
17883 ":define") d_tmpnam_r_proto=define
17884 set d_tmpnam_r_proto tmpnam_r $hdrs
17888 case "$d_tmpnam_r_proto" in
17890 case "$tmpnam_r_proto" in
17891 ''|0) try='char* tmpnam_r(char*);'
17892 ./protochk "extern $try" $hdrs && tmpnam_r_proto=B_B ;;
17894 case "$tmpnam_r_proto" in
17895 ''|0) d_tmpnam_r=undef
17897 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
17898 * ) case "$tmpnam_r_proto" in
17899 REENTRANT_PROTO*) ;;
17900 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
17902 echo "Prototype: $try" ;;
17905 *) case "$usethreads" in
17906 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
17913 *) tmpnam_r_proto=0
17917 : see if truncate exists
17918 set truncate d_truncate
17921 : see if ttyname_r exists
17922 set ttyname_r d_ttyname_r
17924 case "$d_ttyname_r" in
17926 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
17927 case "$d_ttyname_r_proto:$usethreads" in
17928 ":define") d_ttyname_r_proto=define
17929 set d_ttyname_r_proto ttyname_r $hdrs
17933 case "$d_ttyname_r_proto" in
17935 case "$ttyname_r_proto" in
17936 ''|0) try='int ttyname_r(int, char*, size_t);'
17937 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBW ;;
17939 case "$ttyname_r_proto" in
17940 ''|0) try='int ttyname_r(int, char*, int);'
17941 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBI ;;
17943 case "$ttyname_r_proto" in
17944 ''|0) try='char* ttyname_r(int, char*, int);'
17945 ./protochk "extern $try" $hdrs && ttyname_r_proto=B_IBI ;;
17947 case "$ttyname_r_proto" in
17948 ''|0) d_ttyname_r=undef
17950 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
17951 * ) case "$ttyname_r_proto" in
17952 REENTRANT_PROTO*) ;;
17953 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
17955 echo "Prototype: $try" ;;
17958 *) case "$usethreads" in
17959 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
17966 *) ttyname_r_proto=0
17970 : see if tzname[] exists
17972 if set tzname val -a d_tzname; eval $csym; $val; then
17974 echo 'tzname[] found.' >&4
17977 echo 'tzname[] NOT found.' >&4
17983 next|rhapsody|darwin) multiarch="$define" ;;
17985 case "$multiarch" in
17986 ''|[nN]*) multiarch="$undef" ;;
17989 : check for ordering of bytes in a UV
17991 case "$usecrosscompile$multiarch" in
17994 You seem to be either cross-compiling or doing a multiarchitecture build,
17995 skipping the byteorder check.
18001 case "$byteorder" in
18004 In the following, larger digits indicate more significance. A big-endian
18005 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
18006 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
18007 machines may have weird orders like 3412. A Cray will report 87654321,
18008 an Alpha will report 12345678. If the test program works the default is
18010 I'm now running the test program...
18014 #$i_stdlib I_STDLIB
18016 #include <stdlib.h>
18018 #include <sys/types.h>
18019 typedef $uvtype UV;
18029 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
18031 u.l = (UV)0x04030201;
18032 for (i = 0; i < $uvsize; i++)
18033 printf("%c", u.c[i]+'0');
18040 if eval $compile && $run ./try > /dev/null; then
18043 [1-4][1-4][1-4][1-4]|12345678|87654321)
18044 echo "(The test program ran ok.)"
18045 echo "byteorder=$dflt"
18048 ????|????????) echo "(The test program ran ok.)" ;;
18049 *) echo "(The test program didn't run right for some reason.)" ;;
18054 (I can't seem to compile the test program. Guessing big-endian...)
18057 case "$xxx_prompt" in
18059 rp="What is the order of bytes in $uvtype?"
18074 Checking to see whether you can access character data unalignedly...
18076 case "$d_u32align" in
18077 '') $cat >try.c <<EOCP
18079 #$i_stdlib I_STDLIB
18081 #include <stdlib.h>
18083 #define U32 $u32type
18084 #define BYTEORDER 0x$byteorder
18086 #include <signal.h>
18088 $signal_t bletch(int s) { exit(4); }
18091 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
18096 if (sizeof(U32) != 4) {
18097 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
18104 signal(SIGBUS, bletch);
18116 for (i = 0; i < 4; i++) {
18117 up = (U32*)(buf + i);
18118 if (! ((*up == 1 << (8*i)) || /* big-endian */
18119 (*up == 1 << (8*(3-i))) /* little-endian */
18123 printf("read failed (%x)\n", *up);
18129 for (i = 0; i < 4; i++) {
18130 up = (U32*)(buf + i);
18132 if (*up != 0xBeef) {
18133 printf("write failed (%x)\n", *up);
18147 if eval $compile_ok; then
18148 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
18149 $run ./try 2>&1 >/dev/null
18152 You can access character data pretty unalignedly.
18154 d_u32align="$undef"
18157 It seems that you must access character data in an aligned manner.
18159 d_u32align="$define"
18163 rp='Can you access character data at unaligned addresses?'
18167 [yY]*) d_u32align="$undef" ;;
18168 *) d_u32align="$define" ;;
18175 : see if ualarm exists
18176 set ualarm d_ualarm
18179 : see if umask exists
18183 : see if unordered exists
18184 set unordered d_unordered
18187 : see if unsetenv exists
18188 set unsetenv d_unsetenv
18191 : see if usleep exists
18192 set usleep d_usleep
18195 : see if prototype for usleep is available
18197 set d_usleepproto usleep $i_unistd unistd.h
18200 : see if ustat exists
18204 : see if closedir exists
18205 set closedir d_closedir
18208 case "$d_closedir" in
18211 echo "Checking whether closedir() returns a status..." >&4
18213 #$i_dirent I_DIRENT /**/
18214 #$i_sysdir I_SYS_DIR /**/
18215 #$i_sysndir I_SYS_NDIR /**/
18216 #$i_systypes I_SYS_TYPES /**/
18218 #if defined(I_SYS_TYPES)
18219 #include <sys/types.h>
18221 #if defined(I_DIRENT)
18222 #include <dirent.h>
18223 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
18224 #include <sys/dir.h>
18228 #include <sys/ndir.h>
18232 #include <ndir.h> /* may be wrong in the future */
18234 #include <sys/dir.h>
18239 int main() { return closedir(opendir(".")); }
18242 if eval $compile_ok; then
18243 if $run ./try > /dev/null 2>&1 ; then
18244 echo "Yes, it does."
18247 echo "No, it doesn't."
18251 echo "(I can't seem to compile the test program--assuming it doesn't)"
18259 set d_void_closedir
18263 : see if there is a wait4
18267 : see if waitpid exists
18268 set waitpid d_waitpid
18271 : see if wcstombs exists
18272 set wcstombs d_wcstombs
18275 : see if wctomb exists
18276 set wctomb d_wctomb
18279 : see if writev exists
18280 set writev d_writev
18283 : preserve RCS keywords in files with variable substitution, grrr
18288 Revision='$Revision'
18290 : check for alignment requirements
18292 case "$usecrosscompile$multiarch" in
18295 You seem to be either cross-compiling or doing a multiarchitecture build,
18296 skipping the memory alignment check.
18299 case "$alignbytes" in
18300 '') alignbytes=8 ;;
18304 case "$alignbytes" in
18305 '') echo "Checking alignment constraints..." >&4
18306 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
18307 $cat >try.c <<'EOCP'
18308 typedef long double NV;
18311 $cat >try.c <<'EOCP'
18315 $cat >>try.c <<'EOCP'
18323 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
18328 if eval $compile_ok; then
18332 echo "(I can't seem to compile the test program...)"
18335 *) dflt="$alignbytes"
18338 rp="Doubles must be aligned on a how-many-byte boundary?"
18346 : set the base revision
18349 : how do we concatenate cpp tokens here?
18351 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
18352 $cat >cpp_stuff.c <<'EOCP'
18353 #define RCAT(a,b)a/**/b
18354 #define ACAT(a,b)a ## b
18358 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
18359 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
18360 echo "Oh! Smells like ANSI's been here." >&4
18361 echo "We can catify or stringify, separately or together!"
18363 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
18364 echo "Ah, yes! The good old days!" >&4
18365 echo "However, in the good old days we don't know how to stringify and"
18366 echo "catify at the same time."
18370 Hmm, I don't seem to be able to concatenate tokens with your cpp.
18371 You're going to have to edit the values of CAT[2-5] in config.h...
18373 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
18377 : see if this is a db.h system
18383 : Check db version.
18385 echo "Checking Berkeley DB version ..." >&4
18391 #include <sys/types.h>
18393 #$i_stdlib I_STDLIB
18395 #include <stdlib.h>
18398 int main(int argc, char *argv[])
18400 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
18401 int Major, Minor, Patch ;
18402 unsigned long Version ;
18403 (void)db_version(&Major, &Minor, &Patch) ;
18405 printf("%d %d %d %d %d %d\n",
18406 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
18407 Major, Minor, Patch);
18410 printf("You have Berkeley DB Version 2 or greater.\n");
18412 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
18413 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
18414 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
18415 Major, Minor, Patch) ;
18417 /* check that db.h & libdb are compatible */
18418 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
18419 printf("db.h and libdb are incompatible.\n") ;
18423 printf("db.h and libdb are compatible.\n") ;
18425 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
18426 + DB_VERSION_PATCH ;
18428 /* needs to be >= 2.3.4 */
18429 if (Version < 2003004) {
18430 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
18431 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
18437 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
18442 printf("You have Berkeley DB Version 1.\n");
18443 exit(0); /* DB version < 2: the coast is clear. */
18445 exit(1); /* <db.h> not Berkeley DB? */
18451 if eval $compile_ok && $run ./try; then
18452 echo 'Looks OK.' >&4
18454 db_version_major=$1
18455 db_version_minor=$2
18456 db_version_patch=$3
18458 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
18462 : Remove db from list of libraries to use
18463 echo "Removing unusable -ldb from library list" >&4
18464 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
18467 echo "libs = $libs" >&4
18477 : Check the return type needed for hash
18479 echo "Checking return type needed for hash for Berkeley DB ..." >&4
18485 #include <sys/types.h>
18488 #ifndef DB_VERSION_MAJOR
18489 u_int32_t hash_cb (ptr, size)
18497 info.hash = hash_cb;
18501 if $cc $ccflags -c try.c >try.out 2>&1 ; then
18502 if $contains warning try.out >>/dev/null 2>&1 ; then
18505 db_hashtype='u_int32_t'
18508 : XXX Maybe we should just give up here.
18509 db_hashtype=u_int32_t
18511 echo "Help: I can't seem to compile the db test program." >&4
18512 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
18515 echo "Your version of Berkeley DB uses $db_hashtype for hash."
18517 *) db_hashtype=u_int32_t
18522 : Check the return type needed for prefix
18524 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
18530 #include <sys/types.h>
18533 #ifndef DB_VERSION_MAJOR
18534 size_t prefix_cb (key1, key2)
18542 info.prefix = prefix_cb;
18546 if $cc $ccflags -c try.c >try.out 2>&1 ; then
18547 if $contains warning try.out >>/dev/null 2>&1 ; then
18548 db_prefixtype='int'
18550 db_prefixtype='size_t'
18553 db_prefixtype='size_t'
18554 : XXX Maybe we should just give up here.
18556 echo "Help: I can't seem to compile the db test program." >&4
18557 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
18560 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
18562 *) db_prefixtype='size_t'
18566 : How can we generate normalized random numbers ?
18568 echo "Looking for a random number function..." >&4
18569 case "$randfunc" in
18571 if set drand48 val -f; eval $csym; $val; then
18573 echo "Good, found drand48()." >&4
18574 elif set random val -f; eval $csym; $val; then
18576 echo "OK, found random()." >&4
18579 echo "Yick, looks like I have to use rand()." >&4
18590 *-Dmy_rand=*|*-Dmy_srand=*)
18591 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
18592 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
18593 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
18594 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
18598 while $test "$cont"; do
18599 rp="Use which function to generate random numbers?"
18601 if $test "$ans" = "$dflt"; then
18607 if set $ans val -f; eval $csym; $val; then
18611 rp="I cannot find function $ans. Use that name anyway?"
18620 case "$randfunc" in
18622 drand01="drand48()"
18628 case "$randbits" in
18630 echo "Checking to see how many bits your $randfunc() function produces..." >&4
18632 #$i_unistd I_UNISTD
18633 #$i_stdlib I_STDLIB
18636 # include <unistd.h>
18639 # include <stdlib.h>
18644 register unsigned long tmp;
18645 register unsigned long max = 0L;
18647 for (i = 1000; i; i--) {
18648 tmp = (unsigned long) $randfunc();
18649 if (tmp > max) max = tmp;
18651 for (i = 0; max; i++)
18657 if eval $compile_ok; then
18661 echo "(I can't seem to compile the test program...)"
18668 rp="How many bits does your $randfunc() function produce?"
18672 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
18673 seedfunc="s$randfunc"
18674 randseedtype=unsigned
18678 rp="How many bits does your $randfunc() function produce?"
18681 seedfunc="s$randfunc"
18682 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
18683 if set $seedfunc val -f; eval $csym; $val; then
18684 echo "(Using $seedfunc() to seed random generator)"
18686 echo "(Warning: no $seedfunc() to seed random generator)"
18689 randseedtype=unsigned
18697 echo "Determining whether or not we are on an EBCDIC system..." >&4
18698 $cat >try.c <<'EOM'
18701 if ('M'==0xd4) return 0;
18708 if eval $compile_ok; then
18709 if $run ./try; then
18710 echo "You seem to speak EBCDIC." >&4
18713 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
18716 echo "I'm unable to compile the test program." >&4
18717 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
18725 Checking how to flush all pending stdio output...
18727 # I only know how to find the first 32 possibly open files on SunOS.
18728 # See also hints/sunos_4_1.sh and util.c --AD
18730 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
18732 $cat >>try.c <<EOCP
18734 #$i_stdlib I_STDLIB
18736 #include <stdlib.h>
18738 #$i_unistd I_UNISTD
18740 # include <unistd.h>
18742 #$d_sysconf HAS_SYSCONF
18743 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
18744 #ifdef HAS_STDIO_STREAM_ARRAY
18745 # define STDIO_STREAM_ARRAY $stdio_stream_array
18750 p = fopen("try.out", "w");
18754 # ifdef TRY_FPRINTF
18758 #ifdef TRY_FFLUSH_NULL
18761 #ifdef TRY_FFLUSH_ALL
18763 long open_max = -1;
18764 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
18765 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
18767 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
18768 open_max = sysconf(_SC_OPEN_MAX);
18771 open_max = FOPEN_MAX;
18774 open_max = OPEN_MAX;
18783 # ifdef HAS_STDIO_STREAM_ARRAY
18784 if (open_max > 0) {
18786 for (i = 0; i < open_max; i++)
18787 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
18788 STDIO_STREAM_ARRAY[i]._file < open_max &&
18789 STDIO_STREAM_ARRAY[i]._flag)
18790 fflush(&STDIO_STREAM_ARRAY[i]);
18798 : first we have to find out how _not_ to flush
18800 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
18802 set try -DTRY_FPUTC
18803 if eval $compile; then
18804 $run ./try 2>/dev/null
18807 if $test ! -s try.out -a "X$code" = X42; then
18813 set try -DTRY_FPRINTF
18814 if eval $compile; then
18815 $run ./try 2>/dev/null
18818 if $test ! -s try.out -a "X$code" = X42; then
18819 output=-DTRY_FPRINTF
18825 : check for fflush NULL behaviour
18826 case "$fflushNULL" in
18827 '') set try -DTRY_FFLUSH_NULL $output
18828 if eval $compile; then
18829 $run ./try 2>/dev/null
18832 if $test -s try.out -a "X$code" = X42; then
18833 fflushNULL="`$cat try.out`"
18835 if $test "X$code" != X42; then
18837 (If this test failed, don't worry, we'll try another method shortly.)
18843 case "$fflushNULL" in
18845 Your fflush(NULL) works okay for output streams.
18846 Let's see if it clobbers input pipes...
18848 # As of mid-March 2000 all versions of Solaris appear to have a stdio
18849 # bug that improperly flushes the input end of pipes. So we avoid the
18850 # autoflush on fork/system/exec support for now. :-(
18851 $cat >tryp.c <<EOCP
18854 main(int argc, char **argv)
18860 while ((i = getc(stdin)) != -1
18861 && (*bp++ = i) != '\n'
18862 && bp < &buf[1024])
18865 fprintf(stdout, "%s", buf);
18873 fflushNULL="$define"
18875 if eval $compile; then
18877 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
18878 if cmp tryp.c tryp.out >/dev/null 2>&1; then
18880 fflush(NULL) seems to behave okay with input streams.
18882 fflushNULL="$define"
18885 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
18887 fflushNULL="$undef"
18890 $rm -f core tryp.c tryp.core core.tryp.*
18893 Your fflush(NULL) isn't working (contrary to ANSI C).
18895 fflushNULL="$undef"
18898 Cannot figure out whether your fflush(NULL) works or not.
18899 I'm assuming it doesn't (contrary to ANSI C).
18901 fflushNULL="$undef"
18905 $define|true|[yY]*)
18906 fflushNULL="$define"
18909 fflushNULL="$undef"
18912 : check explicit looping only if NULL did not work, and if the pipe
18913 : bug does not show up on an explicit flush too
18914 case "$fflushNULL" in
18916 $cat >tryp.c <<EOCP
18919 main(int argc, char **argv)
18925 while ((i = getc(stdin)) != -1
18926 && (*bp++ = i) != '\n'
18927 && bp < &buf[1024])
18930 fprintf(stdout, "%s", buf);
18939 if eval $compile; then
18941 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
18942 if cmp tryp.c tryp.out >/dev/null 2>&1; then
18944 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
18946 : now check for fflushall behaviour
18947 case "$fflushall" in
18948 '') set try -DTRY_FFLUSH_ALL $output
18949 if eval $compile; then
18951 (Now testing the other method--but note that this also may fail.)
18953 $run ./try 2>/dev/null
18956 if $test -s try.out -a "X$code" = X42; then
18957 fflushall="`$cat try.out`"
18961 case "$fflushall" in
18963 Whew. Flushing explicitly all the stdio streams works.
18965 fflushall="$define"
18968 Sigh. Flushing explicitly all the stdio streams doesn't work.
18973 Cannot figure out whether flushing stdio streams explicitly works or not.
18974 I'm assuming it doesn't.
18980 "$define"|true|[yY]*)
18981 fflushall="$define"
18989 All is futile. Even fflush(stdin) clobbers input pipes!
18996 $rm -f core tryp.c tryp.core core.tryp.*
18998 *) fflushall="$undef"
19002 case "$fflushNULL$fflushall" in
19005 OK, I give up. I cannot figure out how to flush pending stdio output.
19006 We won't be flushing handles at all before fork/exec/popen.
19012 : Store the full pathname to the ar program for use in the C program
19013 : Respect a hint or command line value for full_ar.
19018 : Store the full pathname to the sed program for use in the C program
19021 : see what type gids are declared as in the kernel
19023 echo "Looking for the type for group ids returned by getgid()."
19024 set gid_t gidtype xxx stdio.h sys/types.h
19028 xxx=`./findhdr sys/user.h`
19029 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
19031 unsigned) dflt="$1 $2" ;;
19035 *) dflt="$gidtype";;
19038 gid_t) echo "gid_t found." ;;
19039 *) rp="What is the type for group ids returned by getgid()?"
19047 *_t) zzz="$gidtype" ;;
19050 echo "Checking the size of $zzz..." >&4
19052 #include <sys/types.h>
19054 #$i_stdlib I_STDLIB
19056 #include <stdlib.h>
19059 printf("%d\n", (int)sizeof($gidtype));
19064 if eval $compile_ok; then
19068 echo "(I can't execute the test program--guessing $gidsize.)" >&4
19071 echo "Your $zzz is $gidsize bytes long."
19076 echo "(I can't compile the test program--guessing $gidsize.)" >&4
19082 *_t) zzz="$gidtype" ;;
19085 echo "Checking the sign of $zzz..." >&4
19087 #include <sys/types.h>
19098 if eval $compile; then
19102 echo "(I can't execute the test program--guessing unsigned.)" >&4
19106 1) echo "Your $zzz is unsigned." ;;
19107 -1) echo "Your $zzz is signed." ;;
19113 echo "(I can't compile the test program--guessing unsigned.)" >&4
19119 if $test X"$quadtype" != X; then
19121 echo "Checking how to print 64-bit integers..." >&4
19123 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
19124 $cat >try.c <<'EOCP'
19125 #include <sys/types.h>
19128 int q = 12345678901;
19129 printf("%ld\n", q);
19133 if eval $compile; then
19137 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
19138 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
19139 echo "We will use %d."
19145 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
19146 $cat >try.c <<'EOCP'
19147 #include <sys/types.h>
19150 long q = 12345678901;
19151 printf("%ld\n", q);
19155 if eval $compile; then
19159 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
19160 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
19161 echo "We will use %ld."
19167 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
19168 $cat >try.c <<'EOCP'
19169 #include <sys/types.h>
19170 #include <inttypes.h>
19173 int64_t q = 12345678901;
19174 printf("%" PRId64 "\n", q);
19178 if eval $compile; then
19182 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
19183 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
19184 echo "We will use the C9X style."
19190 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
19192 #include <sys/types.h>
19195 $quadtype q = 12345678901;
19196 printf("%Ld\n", q);
19200 if eval $compile; then
19204 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
19205 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
19206 echo "We will use %Ld."
19212 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
19213 $cat >try.c <<'EOCP'
19214 #include <sys/types.h>
19217 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
19218 printf("%lld\n", q);
19222 if eval $compile; then
19226 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
19227 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
19228 echo "We will use the %lld style."
19234 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
19236 #include <sys/types.h>
19239 $quadtype q = 12345678901;
19240 printf("%qd\n", q);
19244 if eval $compile; then
19248 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
19249 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
19250 echo "We will use %qd."
19256 if $test X"$sPRId64" = X; then
19257 echo "Cannot figure out how to print 64-bit integers." >&4
19264 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
19265 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
19267 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
19268 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
19274 $echo "Checking the format strings to be used for Perl's internal types..." >&4
19276 if $test X"$ivsize" = X8; then
19277 ivdformat="$sPRId64"
19278 uvuformat="$sPRIu64"
19279 uvoformat="$sPRIo64"
19280 uvxformat="$sPRIx64"
19281 uvXUformat="$sPRIXU64"
19283 if $test X"$ivsize" = X"$longsize"; then
19290 if $test X"$ivsize" = X"$intsize"; then
19298 if $test X"$ivsize" = X"$shortsize"; then
19309 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
19310 nveformat="$sPRIeldbl"
19311 nvfformat="$sPRIfldbl"
19312 nvgformat="$sPRIgldbl"
19313 nvEUformat="$sPRIEUldbl"
19314 nvFUformat="$sPRIFUldbl"
19315 nvGUformat="$sPRIGUldbl"
19325 case "$ivdformat" in
19326 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
19333 $echo "Checking the format string to be used for gids..." >&4
19336 -1) if $test X"$gidsize" = X"$ivsize"; then
19337 gidformat="$ivdformat"
19339 if $test X"$gidsize" = X"$longsize"; then
19342 if $test X"$gidsize" = X"$intsize"; then
19345 if $test X"$gidsize" = X"$shortsize"; then
19352 *) if $test X"$gidsize" = X"$uvsize"; then
19353 gidformat="$uvuformat"
19355 if $test X"$gidsize" = X"$longsize"; then
19358 if $test X"$gidsize" = X"$intsize"; then
19361 if $test X"$gidsize" = X"$shortsize"; then
19370 : see if getgroups exists
19371 set getgroups d_getgrps
19374 : see if setgroups exists
19375 set setgroups d_setgrps
19379 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
19381 case "$d_getgrps$d_setgrps" in
19383 case "$groupstype" in
19384 '') dflt="$gidtype" ;;
19385 *) dflt="$groupstype" ;;
19388 What type of pointer is the second argument to getgroups() and setgroups()?
19389 Usually this is the same as group ids, $gidtype, but not always.
19392 rp='What type pointer is the second argument to getgroups() and setgroups()?'
19396 *) groupstype="$gidtype";;
19400 if $test $patchlevel -lt 9; then
19401 : MAD is not available in 5.8.x or earlier.
19405 $define|true|[yY]*) dflt='y' ;;
19410 Would you like to build with Misc Attribute Decoration? This is development
19411 work leading to a Perl 5 to Perl 6 convertor, which imposes a space and speed
19412 overhead on the interpreter.
19414 If this doesn't make any sense to you, just accept the default '$dflt'.
19416 rp='Build Perl with MAD?'
19421 madlyh='madly.h madly.act madly.tab'
19423 madlyobj="madly$_o" ;;
19433 echo "Checking if your $make program sets \$(MAKE)..." >&4
19434 case "$make_set_make" in
19436 $sed 's/^X //' > testmake.mak << 'EOF'
19438 X @echo 'maketemp="$(MAKE)"'
19440 case "`$make -f testmake.mak 2>/dev/null`" in
19441 *maketemp=*) make_set_make='#' ;;
19442 *) make_set_make="MAKE=$make" ;;
19444 $rm -f testmake.mak
19447 case "$make_set_make" in
19448 '#') echo "Yup, it does.";;
19449 *) echo "Nope, it doesn't.";;
19452 : see what type is used for mode_t
19453 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
19454 set mode_t modetype int stdio.h sys/types.h
19457 : see if we need va_copy
19459 case "$i_stdarg" in
19462 #include <stdarg.h>
19464 #$i_stdlib I_STDLIB
19466 #include <stdlib.h>
19468 #include <signal.h>
19471 ivfprintf(FILE *f, const char *fmt, va_list *valp)
19473 return vfprintf(f, fmt, *valp);
19477 myvfprintf(FILE *f, const char *fmt, va_list val)
19479 return ivfprintf(f, fmt, &val);
19483 myprintf(char *fmt, ...)
19486 va_start(val, fmt);
19487 return myvfprintf(stdout, fmt, val);
19491 main(int ac, char **av)
19493 signal(SIGSEGV, exit);
19495 myprintf("%s%cs all right, then\n", "that", '\'');
19500 if eval $compile && $run ./try 2>&1 >/dev/null; then
19501 case "`$run ./try`" in
19502 "that's all right, then")
19508 yes) echo "It seems that you don't need va_copy()." >&4
19509 need_va_copy="$undef"
19511 *) echo "It seems that va_copy() or similar will be needed." >&4
19512 need_va_copy="$define"
19517 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
19521 : see what type is used for size_t
19522 rp="What is the type used for the length parameter for string functions?"
19523 set size_t sizetype 'unsigned int' stdio.h sys/types.h
19526 : check for type of arguments to gethostbyaddr.
19527 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
19528 case "$d_gethbyaddr" in
19532 Checking to see what type of arguments are accepted by gethostbyaddr().
19534 hdrs="$define sys/types.h
19535 $d_socket sys/socket.h
19536 $i_niin netinet/in.h
19538 $i_unistd unistd.h"
19539 : The first arg can 'char *' or 'void *'
19540 : The second arg is some of integral type
19541 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
19542 for yyy in size_t long int; do
19543 case "$netdb_host_type" in
19544 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
19545 if ./protochk "$try" $hdrs; then
19546 echo "Your system accepts $xxx for the first arg."
19547 echo "...and $yyy for the second arg."
19548 netdb_host_type="$xxx"
19549 netdb_hlen_type="$yyy"
19555 : In case none of those worked, prompt the user.
19556 case "$netdb_host_type" in
19557 '') rp='What is the type for the 1st argument to gethostbyaddr?'
19560 netdb_host_type=$ans
19561 rp='What is the type for the 2nd argument to gethostbyaddr?'
19564 netdb_hlen_type=$ans
19568 *) : no gethostbyaddr, so pick harmless defaults
19569 netdb_host_type='char *'
19570 netdb_hlen_type="$sizetype"
19573 # Remove the "const" if needed. -- but then we'll have a
19575 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
19578 : check for type of argument to gethostbyname.
19579 if test "X$netdb_name_type" = X ; then
19580 case "$d_gethbyname" in
19584 Checking to see what type of argument is accepted by gethostbyname().
19586 hdrs="$define sys/types.h
19587 $d_socket sys/socket.h
19588 $i_niin netinet/in.h
19590 $i_unistd unistd.h"
19591 for xxx in "const char *" "char *"; do
19592 case "$netdb_name_type" in
19593 '') try="extern struct hostent *gethostbyname($xxx);"
19594 if ./protochk "$try" $hdrs; then
19595 echo "Your system accepts $xxx."
19596 netdb_name_type="$xxx"
19601 : In case none of those worked, prompt the user.
19602 case "$netdb_name_type" in
19603 '') rp='What is the type for the 1st argument to gethostbyname?'
19606 netdb_name_type=$ans
19610 *) : no gethostbyname, so pick harmless default
19611 netdb_name_type='char *'
19616 : check for type of 1st argument to getnetbyaddr.
19617 if test "X$netdb_net_type" = X ; then
19618 case "$d_getnbyaddr" in
19622 Checking to see what type of 1st argument is accepted by getnetbyaddr().
19624 hdrs="$define sys/types.h
19625 $d_socket sys/socket.h
19626 $i_niin netinet/in.h
19628 $i_unistd unistd.h"
19629 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
19630 case "$netdb_net_type" in
19631 '') try="extern struct netent *getnetbyaddr($xxx, int);"
19632 if ./protochk "$try" $hdrs; then
19633 echo "Your system accepts $xxx."
19634 netdb_net_type="$xxx"
19639 : In case none of those worked, prompt the user.
19640 case "$netdb_net_type" in
19641 '') rp='What is the type for the 1st argument to getnetbyaddr?'
19644 netdb_net_type=$ans
19648 *) : no getnetbyaddr, so pick harmless default
19649 netdb_net_type='long'
19653 : locate the preferred pager for this system
19660 [a-zA-Z]:/*) dflt=$pg;;
19664 [a-zA-Z]:/*) dflt=$more;;
19668 [a-zA-Z]:/*) dflt=$less;;
19671 '') dflt=/usr/ucb/more;;
19675 : Instruct ./getfile to trust the hinted or previous pager value,
19676 : even if it does not begin with a slash. For example, on os2,
19677 : pager might be cmd /c more. See comments in UU/getfile.
19682 rp='What pager is used on your system?'
19686 : see what type pids are declared as in the kernel
19687 rp="What is the type of process ids on this system?"
19688 set pid_t pidtype int stdio.h sys/types.h
19691 : see if ar generates random libraries by itself
19693 echo "Checking how to generate random libraries on your machine..." >&4
19694 echo 'int bar1() { return bar2(); }' > bar1.c
19695 echo 'int bar2() { return 2; }' > bar2.c
19697 #$i_stdlib I_STDLIB
19699 #include <stdlib.h>
19701 int main() { printf("%d\n", bar1()); exit(0); }
19703 $cc $ccflags -c bar1.c >/dev/null 2>&1
19704 $cc $ccflags -c bar2.c >/dev/null 2>&1
19705 $cc $ccflags -c foo.c >/dev/null 2>&1
19706 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
19707 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19708 $run ./foobar >/dev/null 2>&1; then
19709 echo "$ar appears to generate random libraries itself."
19711 if [ "X$ranlib" = "X" ]; then
19714 elif $ar s bar$_a >/dev/null 2>&1 &&
19715 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19716 $run ./foobar >/dev/null 2>&1; then
19717 echo "a table of contents needs to be added with '$ar s'."
19720 elif $ar ts bar$_a >/dev/null 2>&1 &&
19721 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19722 $run ./foobar >/dev/null 2>&1; then
19723 echo "a table of contents needs to be added with '$ar ts'."
19730 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
19731 $test -f $ranlib || ranlib=''
19734 if $test -n "$ranlib"; then
19735 echo "your system has '$ranlib'; we'll use that."
19738 echo "your system doesn't seem to support random libraries"
19739 echo "so we'll use lorder and tsort to order the libraries."
19746 : check for type of arguments to select.
19747 case "$selecttype" in
19748 '') case "$d_select" in
19752 Checking to see what type of arguments are accepted by select().
19754 hdrs="$define sys/types.h
19755 $i_systime sys/time.h
19756 $i_sysselct sys/select.h
19757 $d_socket sys/socket.h"
19758 : The first arg can be int, unsigned, or size_t
19759 : The last arg may or may not be 'const'
19761 : void pointer has been seen but using that
19762 : breaks the selectminbits test
19763 for xxx in 'fd_set *' 'int *'; do
19764 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
19765 for tmo in 'struct timeval *' 'const struct timeval *'; do
19767 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
19768 if ./protochk "$try" $hdrs; then
19769 echo "Your system accepts $xxx."
19778 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
19779 case "$d_fd_set" in
19780 $define) dflt="fd_set *" ;;
19789 *) : no select, so pick a harmless default
19796 : check for the select 'width'
19797 case "$selectminbits" in
19798 '') safebits=`expr $ptrsize \* 8`
19799 case "$d_select" in
19803 Checking to see on how many bits at a time your select() operates...
19806 #include <sys/types.h>
19808 #$i_systime I_SYS_TIME
19809 #$i_systimek I_SYS_TIME_KERNEL
19814 # ifdef I_SYS_TIME_KERNEL
19817 # include <sys/time.h>
19818 # ifdef I_SYS_TIME_KERNEL
19822 #$i_sysselct I_SYS_SELECT
19823 #ifdef I_SYS_SELECT
19824 #include <sys/select.h>
19826 #$d_socket HAS_SOCKET
19828 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
19831 #$i_stdlib I_STDLIB
19833 #include <stdlib.h>
19836 #define S sizeof(*(b))
19838 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
19839 #define NBITS (NBYTES * 8)
19841 char *s = (char *)malloc(NBYTES);
19850 fp = fopen("try.c", "r");
19856 b = ($selecttype)s;
19857 for (i = 0; i < NBITS; i++)
19861 select(fd + 1, b, 0, 0, &t);
19862 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
19864 printf("%d\n", i + 1);
19869 if eval $compile_ok; then
19870 selectminbits=`$run ./try`
19871 case "$selectminbits" in
19873 Cannot figure out on how many bits at a time your select() operates.
19874 I'll play safe and guess it is $safebits bits.
19876 selectminbits=$safebits
19877 bits="$safebits bits"
19880 *) bits="$selectminbits bits" ;;
19882 echo "Your select() operates on $bits at a time." >&4
19884 rp='What is the minimum number of bits your select() operates on?'
19885 case "$byteorder" in
19886 12345678) dflt=64 ;;
19892 selectminbits="$val"
19896 *) : no select, so pick a harmless default
19897 selectminbits=$safebits
19903 : Trace out the files included by signal.h, then look for SIGxxx names.
19904 : Remove SIGARRAYSIZE used by HPUX.
19905 : Remove SIGSTKSIZE used by Linux.
19906 : Remove SIGSTKSZ used by Posix.
19907 : Remove SIGTYP void lines used by OS2.
19908 : Some cpps, like os390, dont give the file name anywhere
19909 if [ "X$fieldn" = X ]; then
19910 : Just make some guesses. We check them later.
19911 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
19913 xxx=`echo '#include <signal.h>' |
19914 $cppstdin $cppminus $cppflags 2>/dev/null |
19915 $grep '^[ ]*#.*include' |
19916 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
19918 : Check this list of files to be sure we have parsed the cpp output ok.
19919 : This will also avoid potentially non-existent files, such
19922 for xx in $xxx /dev/null ; do
19923 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
19925 : If we have found no files, at least try signal.h
19926 case "$xxxfiles" in
19927 '') xxxfiles=`./findhdr signal.h` ;;
19930 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
19931 print substr($2, 4, 20)
19933 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
19934 print substr($3, 4, 20)
19936 : Append some common names just in case the awk scan failed.
19937 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
19938 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
19939 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
19940 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
19941 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
19943 : generate a few handy files for later
19944 $cat > signal.c <<EOCP
19945 #include <sys/types.h>
19946 #include <signal.h>
19947 #$i_stdlib I_STDLIB
19949 #include <stdlib.h>
19954 /* Strange style to avoid deeply-nested #if/#else/#endif */
19957 # define NSIG (_NSIG)
19963 # define NSIG (SIGMAX+1)
19969 # define NSIG (SIG_MAX+1)
19975 # define NSIG (_SIG_MAX+1)
19981 # define NSIG (MAXSIG+1)
19987 # define NSIG (MAX_SIG+1)
19992 # ifdef SIGARRAYSIZE
19993 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
19999 # define NSIG (_sys_nsig) /* Solaris 2.5 */
20003 /* Default to some arbitrary number that's big enough to get most
20004 of the common signals.
20010 printf("NSIG %d\n", NSIG);
20016 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
20018 printf "#ifdef SIG"; printf $1; printf "\n"
20019 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
20020 printf $1; printf ");\n"
20024 printf "#endif /* JUST_NSIG */\n";
20025 printf "exit(0);\n}\n";
20028 $cat >signal.awk <<'EOP'
20029 BEGIN { ndups = 0 }
20030 $1 ~ /^NSIG$/ { nsig = $2 }
20031 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
20032 if ($2 > maxsig) { maxsig = $2 }
20033 if (sig_name[$2]) {
20034 dup_name[ndups] = $1
20035 dup_num[ndups] = $2
20047 printf("NSIG %d\n", nsig);
20048 for (n = 1; n < nsig; n++) {
20050 printf("%s %d\n", sig_name[n], sig_num[n])
20053 printf("NUM%d %d\n", n, n)
20056 for (n = 0; n < ndups; n++) {
20057 printf("%s %d\n", dup_name[n], dup_num[n])
20061 $cat >signal_cmd <<EOS
20063 if $test -s signal.lst; then
20064 echo "Using your existing signal.lst file"
20069 $cat >>signal_cmd <<'EOS'
20072 if eval $compile_ok; then
20073 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) | $uniq | $awk -f signal.awk >signal.lst
20075 echo "(I can't seem be able to compile the whole test program)" >&4
20076 echo "(I'll try it in little pieces.)" >&4
20077 set signal -DJUST_NSIG
20078 if eval $compile_ok; then
20079 $run ./signal$_exe > signal.nsg
20082 echo "I can't seem to figure out how many signals you have." >&4
20083 echo "Guessing 50." >&4
20084 echo 'NSIG 50' > signal.nsg
20086 : Now look at all the signal names, one at a time.
20087 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
20088 $cat > signal.c <<EOCP
20089 #include <sys/types.h>
20090 #include <signal.h>
20093 printf("$xx %d\n", SIG${xx});
20098 if eval $compile; then
20099 echo "SIG${xx} found."
20100 $run ./signal$_exe >> signal.ls1
20102 echo "SIG${xx} NOT found."
20105 if $test -s signal.ls1; then
20106 $cat signal.nsg signal.ls1 |
20107 $sort -n | $uniq | $awk -f signal.awk >signal.lst
20111 if $test -s signal.lst; then
20114 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
20115 echo 'kill -l' >signal
20116 set X `csh -f <signal`
20120 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
20122 echo $@ | $tr ' ' $trnl | \
20123 $awk '{ printf "%s %d\n", $1, ++s; }
20124 END { printf "NSIG %d\n", ++s }' >signal.lst
20126 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
20128 chmod a+x signal_cmd
20129 $eunicefix signal_cmd
20131 : generate list of signal names
20133 case "$sig_name_init" in
20135 *) case "$sig_num_init" in
20136 ''|*,*) doinit=yes ;;
20141 echo "Generating a list of signal names and numbers..." >&4
20143 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
20144 sig_name=`$awk 'BEGIN { printf "ZERO " }
20145 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
20146 sig_num=`$awk 'BEGIN { printf "0 " }
20147 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
20148 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
20149 !/^NSIG/ { printf "\"%s\", ", $1 }
20150 END { printf "0\n" }' signal.lst`
20151 sig_num_init=`$awk 'BEGIN { printf "0, " }
20152 !/^NSIG/ { printf "%d, ", $2}
20153 END { printf "0\n"}' signal.lst`
20156 echo "The following $sig_count signals are available:"
20158 echo $sig_name | $awk \
20159 'BEGIN { linelen = 0 }
20161 for (i = 1; i <= NF; i++) {
20162 name = "SIG" $i " "
20163 linelen = linelen + length(name)
20164 if (linelen > 70) {
20166 linelen = length(name)
20172 sig_size=`echo $sig_name | awk '{print NF}'`
20173 $rm -f signal signal.c signal.awk signal.lst signal_cmd
20176 case "$sizetype" in
20177 *_t) zzz="$sizetype" ;;
20178 *) zzz="filesize" ;;
20180 echo "Checking the size of $zzz..." >&4
20182 #include <sys/types.h>
20184 #$i_stdlib I_STDLIB
20186 #include <stdlib.h>
20189 printf("%d\n", (int)sizeof($sizetype));
20194 if eval $compile_ok; then
20198 echo "(I can't execute the test program--guessing $sizesize.)" >&4
20201 echo "Your $zzz size is $sizesize bytes."
20206 echo "(I can't compile the test program--guessing $sizesize.)" >&4
20210 : check for socklen_t
20212 echo "Checking to see if you have socklen_t..." >&4
20214 #include <sys/types.h>
20215 #$d_socket HAS_SOCKET
20217 #include <sys/socket.h>
20219 int main() { socklen_t x = 16; }
20222 if eval $compile; then
20224 echo "You have socklen_t."
20227 echo "You do not have socklen_t."
20228 case "$sizetype" in
20229 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
20236 : see if this is a socks.h system
20237 set socks.h i_socks
20240 : check for type of the size argument to socket calls
20241 case "$d_socket" in
20245 Checking to see what type is the last argument of accept().
20248 case "$d_socklen_t" in
20249 "$define") yyy="$yyy socklen_t"
20251 yyy="$yyy $sizetype int long unsigned"
20252 for xxx in $yyy; do
20253 case "$socksizetype" in
20254 '') try="extern int accept(int, struct sockaddr *, $xxx *);"
20255 case "$usesocks" in
20257 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
20258 echo "Your system accepts '$xxx *' for the last argument of accept()."
20259 socksizetype="$xxx"
20262 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
20263 echo "Your system accepts '$xxx *' for the last argument of accept()."
20264 socksizetype="$xxx"
20271 : In case none of those worked, prompt the user.
20272 case "$socksizetype" in
20273 '') rp='What is the type for socket address structure sizes?'
20280 *) : no sockets, so pick relatively harmless default
20285 : see what type is used for signed size_t
20286 set ssize_t ssizetype int stdio.h sys/types.h
20291 #$i_stdlib I_STDLIB
20293 #include <stdlib.h>
20295 #include <sys/types.h>
20296 #define Size_t $sizetype
20297 #define SSize_t $dflt
20300 if (sizeof(Size_t) == sizeof(SSize_t))
20302 else if (sizeof(Size_t) == sizeof(int))
20311 if eval $compile_ok && $run ./try > /dev/null; then
20312 ssizetype=`$run ./try`
20313 echo "I'll be using $ssizetype for functions returning a byte count." >&4
20316 Help! I can't compile and run the ssize_t test program: please enlighten me!
20317 (This is probably a misconfiguration in your system or libraries, and
20318 you really ought to fix it. Still, I'll try anyway.)
20320 I need a type that is the same size as $sizetype, but is guaranteed to
20321 be signed. Common values are ssize_t, int and long.
20324 rp="What signed type is the same size as $sizetype?"
20330 : see what type of char stdio uses.
20332 echo '#include <stdio.h>' > stdio.c
20333 $cppstdin $cppminus < stdio.c > stdioh
20334 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
20335 echo "Your stdio uses unsigned chars." >&4
20336 stdchar="unsigned char"
20338 echo "Your stdio uses signed chars." >&4
20341 $rm -f stdio.* stdioh
20343 : see what type uids are declared as in the kernel
20345 echo "Looking for the type for user ids returned by getuid()."
20346 set uid_t uidtype xxx stdio.h sys/types.h
20350 xxx=`./findhdr sys/user.h`
20351 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
20353 unsigned) dflt="$1 $2" ;;
20357 *) dflt="$uidtype";;
20360 uid_t) echo "uid_t found." ;;
20361 *) rp="What is the type for user ids returned by getuid()?"
20369 *_t) zzz="$uidtype" ;;
20372 echo "Checking the size of $zzz..." >&4
20374 #include <sys/types.h>
20376 #$i_stdlib I_STDLIB
20378 #include <stdlib.h>
20381 printf("%d\n", (int)sizeof($uidtype));
20386 if eval $compile_ok; then
20390 echo "(I can't execute the test program--guessing $uidsize.)" >&4
20393 echo "Your $zzz is $uidsize bytes long."
20398 echo "(I can't compile the test program--guessing $uidsize.)" >&4
20403 *_t) zzz="$uidtype" ;;
20406 echo "Checking the sign of $zzz..." >&4
20408 #include <sys/types.h>
20419 if eval $compile; then
20423 echo "(I can't execute the test program--guessing unsigned.)" >&4
20427 1) echo "Your $zzz is unsigned." ;;
20428 -1) echo "Your $zzz is signed." ;;
20434 echo "(I can't compile the test program--guessing unsigned.)" >&4
20440 $echo "Checking the format string to be used for uids..." >&4
20443 -1) if $test X"$uidsize" = X"$ivsize"; then
20444 uidformat="$ivdformat"
20446 if $test X"$uidsize" = X"$longsize"; then
20449 if $test X"$uidsize" = X"$intsize"; then
20452 if $test X"$uidsize" = X"$shortsize"; then
20459 *) if $test X"$uidsize" = X"$uvsize"; then
20460 uidformat="$uvuformat"
20462 if $test X"$uidsize" = X"$longsize"; then
20465 if $test X"$uidsize" = X"$intsize"; then
20468 if $test X"$uidsize" = X"$shortsize"; then
20478 case "$usesitecustomize" in
20479 $define|true|[Yy]*)
20480 usesitecustomize="$define"
20483 usesitecustomize="$undef"
20487 : determine compiler compiler
20496 if $test -f "$byacc$_exe"; then
20498 comp="byacc or $comp"
20500 if $test -f "$bison$_exe"; then
20501 comp="$comp or bison -y"
20503 rp="Which compiler compiler ($comp) shall I use?"
20512 echo "(Adding -y option to bison to get yacc-compatible behaviour.)"
20518 : see if this is a fp.h system
20522 : see if this is a fp_class.h system
20523 set fp_class.h i_fp_class
20526 : see if gdbm.h is available
20531 : see if gdbm_open exists
20532 set gdbm_open d_gdbm_open
20534 case "$d_gdbm_open" in
20537 echo "We won't be including <gdbm.h>"
20546 : see if this is a ieeefp.h system
20547 case "$i_ieeefp" in
20548 '' ) set ieeefp.h i_ieeefp
20553 : see if this is a libutil.h system
20554 set libutil.h i_libutil
20557 : see if mach cthreads are available
20558 if test "X$usethreads" = "X$define"; then
20559 set mach/cthreads.h i_machcthr
20562 i_machcthr="$undef"
20567 : see if this is a mntent.h system
20568 set mntent.h i_mntent
20571 : see if ndbm.h is available
20577 # Some Linux distributions such as RedHat 7.1 put the
20578 # ndbm.h header in /usr/include/gdbm/ndbm.h.
20579 if $test -f /usr/include/gdbm/ndbm.h; then
20580 echo '<gdbm/ndbm.h> found.'
20581 ccflags="$ccflags -I/usr/include/gdbm"
20582 cppflags="$cppflags -I/usr/include/gdbm"
20590 : see if dbm_open exists
20591 set dbm_open d_dbm_open
20593 case "$d_dbm_open" in
20596 echo "We won't be including <ndbm.h>"
20605 : see if net/errno.h is available
20607 set net/errno.h val
20610 : Unfortunately, it causes problems on some systems. Arrgh.
20613 cat > try.c <<'EOM'
20616 #include <net/errno.h>
20622 if $cc $ccflags -c try.c >/dev/null 2>&1; then
20623 echo "We'll be including <net/errno.h>." >&4
20625 echo "We won't be including <net/errno.h>." >&4
20634 : see if netinet/tcp.h is available
20635 set netinet/tcp.h i_netinettcp
20638 : see if this is a poll.h system
20642 : see if this is a prot.h system
20647 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
20648 $cat <<'EOSH' > Cppsym.know
20649 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
20650 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
20651 alliant alpha am29000 AM29000 AMD64 amd64 amiga AMIGAOS AMIX
20652 ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
20653 BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
20654 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
20655 bull c cadmus clipper CMU COFF COMPILER_VERSION
20656 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
20657 CYGWIN DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
20658 Dynix DynixPTX ELF encore EPI EXTENSIONS FAVOR_BSD
20659 FILE_OFFSET_BITS FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
20661 GNU_SOURCE GNUC GNUC_MINOR GNU_LIBRARY GO32 gould GOULD_PN
20662 H3050R H3050RX hbullx20 hcx host_mips
20663 hp200 hp300 hp700 HP700 hp800 hp9000
20664 hp9000s200 hp9000s300 hp9000s400 hp9000s500
20665 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
20666 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
20667 IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
20668 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
20669 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
20670 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
20671 LIBCATAMOUNT Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
20672 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
20673 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
20674 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
20675 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
20676 MATH_HAS_NO_SIDE_EFFECTS
20677 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
20678 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
20679 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
20680 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
20681 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
20682 NetBSD news1500 news1700 news1800 news1900 news3700
20683 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
20684 ns32016 ns32332 ns32k nsc32000
20685 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
20686 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
20687 pc532 pdp11 PGC PIC plexus PORTAR posix
20688 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
20689 POSIX_C_SOURCE POSIX_SOURCE POWER
20690 PROTOTYPES PWB pyr QNX QK_USER R3000 REENTRANT RES Rhapsody RISC6000
20691 riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
20692 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
20693 sony sony_news sonyrisc sparc sparclite spectrum
20694 stardent stdc STDC_EXT stratos sun sun3 sun386
20695 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
20696 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
20697 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
20698 sysV68 sysV88 Tek4132 Tek4300 titan
20699 TM3200 TM5400 TM5600
20700 tower tower32 tower32_200 tower32_600 tower32_700
20701 tower32_800 tower32_850 tss
20702 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
20703 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
20704 unix UNIX95 UNIX99 unixpc unos
20705 USE_BSD USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE USE_LARGEFILE64
20706 USE_MISC USE_POSIX USE_POSIX199309 USE_POSIX199506 USE_POSIX2
20707 USE_REENTRANT USE_SVID USE_UNIX98 USE_XOPEN USE_XOPEN_EXTENDED
20709 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms x86_64 xenix Xenix286
20710 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
20711 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
20714 # Maybe put other stuff here too.
20715 cat <<EOSH >>Cppsym.know
20718 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
20719 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
20720 $cat Cppsym.know > Cppsym.c
20721 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
20722 $rm -f Cppsym.a Cppsym.b Cppsym.c
20723 cat <<EOSH > Cppsym
20725 if $test \$# -gt 0; then
20726 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
20727 if $test -s Cppsym.got; then
20734 $tr " " "$trnl" | ./Cppsym.try
20740 cat <<EOSH > Cppsym.try
20742 cat <<'EOCP' > try.c
20745 #define STRINGIFY(a) "a"
20747 #if cpp_stuff == 42
20748 #define StGiFy(a) #a
20749 #define STRINGIFY(a) StGiFy(a)
20751 #if $cpp_stuff != 1 && $cpp_stuff != 42
20752 # include "Bletch: How does this C preprocessor stringify macros?"
20758 cat <<'EOSH' >> Cppsym.try
20760 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
20761 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
20762 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
20763 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
20765 echo 'return 0;}' >> try.c
20767 cat <<EOSH >> Cppsym.try
20769 case "$osname-$gccversion" in
20770 irix-) ccflags="\$ccflags -woff 1178" ;;
20771 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
20773 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs && $run ./try | $sed 's/ /\\\\ /g'
20775 chmod +x Cppsym.try
20776 $eunicefix Cppsym.try
20777 ./Cppsym < Cppsym.know > Cppsym.true
20778 : Add in any linux cpp "predefined macros":
20779 case "$osname::$gccversion" in
20782 rm -f $tHdrH'.h' $tHdrH
20784 if cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
20785 sed 's/#define[\ \ ]*//;s/[\ \ ].*$//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
20786 if [ -s $tHdrH'_cppsym.real' ]; then
20787 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
20790 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
20793 : now check the C compiler for additional symbols
20794 postprocess_cc_v=''
20796 aix) postprocess_cc_v="|$tr , ' '" ;;
20803 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
20806 -D*) echo "\$i" | $sed 's/^-D//';;
20807 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
20812 postprocess_cc_v=''
20815 ./ccsym > ccsym1.raw
20816 if $test -s ccsym1.raw; then
20817 $sort ccsym1.raw | $uniq >ccsym.raw
20819 mv ccsym1.raw ccsym.raw
20822 $awk '/\=/ { print $0; next }
20823 { print $0"=1" }' ccsym.raw >ccsym.list
20824 $comm -13 Cppsym.true ccsym.list >ccsym.own
20825 $comm -12 Cppsym.true ccsym.list >ccsym.com
20826 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
20828 if $test -z ccsym.raw; then
20829 echo "Your C compiler doesn't seem to define any symbols!" >&4
20831 echo "However, your C preprocessor defines the following symbols:"
20834 cppsymbols=`$cat Cppsym.true`
20835 cppsymbols=`echo $cppsymbols`
20836 cppccsymbols="$cppsymbols"
20838 if $test -s ccsym.com; then
20839 echo "Your C compiler and pre-processor define these symbols:"
20840 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
20843 cppccsymbols=`$cat ccsym.com`
20844 cppccsymbols=`echo $cppccsymbols`
20845 $test "$silent" || sleep 1
20847 if $test -s ccsym.cpp; then
20848 $test "$also" && echo " "
20849 echo "Your C pre-processor ${also}defines the following symbols:"
20850 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
20852 cppsymbols=`$cat ccsym.cpp`
20853 cppsymbols=`echo $cppsymbols`
20854 $test "$silent" || sleep 1
20856 if $test -s ccsym.own; then
20857 $test "$also" && echo " "
20858 echo "Your C compiler ${also}defines the following cpp symbols:"
20859 $sed -e 's/\(..*\)=1/\1/' ccsym.own
20860 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
20861 ccsymbols=`$cat ccsym.own`
20862 ccsymbols=`echo $ccsymbols`
20863 $test "$silent" || sleep 1
20867 : see if this is a termio system
20871 if $test `./findhdr termios.h`; then
20872 set tcsetattr i_termios
20878 "$define") echo "You have POSIX termios.h... good!" >&4;;
20879 *) if ./Cppsym pyr; then
20880 case "`/bin/universe`" in
20881 ucb) if $test `./findhdr sgtty.h`; then
20883 echo "<sgtty.h> found." >&4
20885 echo "System is pyramid with BSD universe."
20886 echo "<sgtty.h> not found--you could have problems." >&4
20888 *) if $test `./findhdr termio.h`; then
20890 echo "<termio.h> found." >&4
20892 echo "System is pyramid with USG universe."
20893 echo "<termio.h> not found--you could have problems." >&4
20897 if $test `./findhdr termio.h`; then
20898 echo "<termio.h> found." >&4
20900 elif $test `./findhdr sgtty.h`; then
20901 echo "<sgtty.h> found." >&4
20904 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
20907 if $test `./findhdr sgtty.h`; then
20908 echo "<sgtty.h> found." >&4
20910 elif $test `./findhdr termio.h`; then
20911 echo "<termio.h> found." >&4
20914 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
20918 set i_termio; eval $setvar
20919 val=$val2; set i_sgtty; eval $setvar
20920 val=$val3; set i_termios; eval $setvar
20922 : see if stddef is available
20923 set stddef.h i_stddef
20926 : see if sys/access.h is available
20927 set sys/access.h i_sysaccess
20930 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
20931 set sys/filio.h i_sysfilio
20934 if $test `./findhdr sys/ioctl.h`; then
20936 echo '<sys/ioctl.h> found.' >&4
20939 if $test $i_sysfilio = "$define"; then
20940 echo '<sys/ioctl.h> NOT found.' >&4
20942 $test $i_sgtty = "$define" && xxx="sgtty.h"
20943 $test $i_termio = "$define" && xxx="termio.h"
20944 $test $i_termios = "$define" && xxx="termios.h"
20945 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
20951 : see if socket ioctl defs are in sys/sockio.h
20953 xxx=`./findhdr sys/sockio.h`
20954 if $test "$xxx"; then
20955 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
20957 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
20960 echo "No socket ioctls found in <sys/sockio.h>." >&4
20965 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
20972 : see if this is a syslog.h system
20973 set syslog.h i_syslog
20977 : see if this is a sys/mode.h system
20978 set sys/mode.h i_sysmode
20981 : see if sys/resource.h has to be included
20982 set sys/resource.h i_sysresrc
20985 : see if sys/security.h is available
20986 set sys/security.h i_syssecrt
20989 : see if this is a sys/statvfs.h system
20990 set sys/statvfs.h i_sysstatvfs
20993 : see if this is a sys/un.h system
20994 set sys/un.h i_sysun
20998 : see if this is a sys/utsname.h system
20999 set sys/utsname.h i_sysutsname
21002 : see if this is a syswait system
21003 set sys/wait.h i_syswait
21006 : see if this is a ustat.h system
21007 set ustat.h i_ustat
21010 : see if this is an utime system
21011 set utime.h i_utime
21014 : see if this is a values.h system
21015 set values.h i_values
21018 : see if this is a vfork system
21021 set vfork.h i_vfork
21030 echo "Looking for extensions..." >&4
21031 : If we are using the old config.sh, known_extensions may contain
21032 : old or inaccurate or duplicate values.
21033 known_extensions=''
21034 nonxs_extensions=''
21035 : We do not use find because it might not be available.
21036 : We do not just use MANIFEST because the user may have dropped
21037 : some additional extensions into the source tree and expect them
21040 : Function to recursively find available extensions, ignoring DynaLoader
21041 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
21045 DynaLoader|dynaload) ;;
21047 if $test -f $xxx/$xxx.xs -o -f $xxx/$xxx.c; then
21048 known_extensions="$known_extensions $1$xxx";
21049 elif $test -f $xxx/Makefile.PL; then
21050 nonxs_extensions="$nonxs_extensions $1$xxx";
21052 if $test -d $xxx -a $# -lt 10; then
21055 eval $find_extensions;
21067 eval $find_extensions
21068 # Special case: Add in modules that nest beyond the first level.
21069 # Currently threads/shared and Hash/Util/FieldHash, since they are
21070 # not picked up by the recursive find above (and adding in general
21071 # recursive finding breaks SDBM_File/sdbm).
21072 # A.D. 20011025 (SDBM), ajgough 20071008 (FieldHash)
21073 known_extensions="$known_extensions threads/shared Hash/Util/FieldHash"
21074 set X $known_extensions
21076 known_extensions="$*"
21077 set X $nonxs_extensions
21079 nonxs_extensions="$*"
21082 : Now see which are supported on this system.
21084 for xxx in $known_extensions ; do
21088 $define) avail_ext="$avail_ext $xxx" ;;
21091 GDBM_File|gdbm_fil)
21093 $define) avail_ext="$avail_ext $xxx" ;;
21096 I18N/Langinfo|i18n_lan)
21097 case "$i_langinfo$d_nl_langinfo" in
21098 $define$define) avail_ext="$avail_ext $xxx" ;;
21102 : XXX Do we need a useipcsysv variable here
21103 case "${d_msg}${d_sem}${d_shm}" in
21104 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
21107 NDBM_File|ndbm_fil)
21110 case "$osname-$use64bitint" in
21113 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
21116 *) avail_ext="$avail_ext $xxx" ;;
21121 ODBM_File|odbm_fil)
21122 case "${i_dbm}${i_rpcsvcdbm}" in
21124 case "$d_cplusplus" in
21125 define) ;; # delete as a function name will not work
21126 *) case "$osname-$use64bitint" in
21129 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
21132 *) avail_ext="$avail_ext $xxx" ;;
21140 case "$useopcode" in
21141 true|define|y) avail_ext="$avail_ext $xxx" ;;
21145 case "$useposix" in
21146 true|define|y) avail_ext="$avail_ext $xxx" ;;
21150 case "$d_socket" in
21153 beos) ;; # not unless BONE
21154 *) avail_ext="$avail_ext $xxx" ;;
21159 Sys/Syslog|sys/syslog)
21160 : XXX syslog requires socket
21161 case "$d_socket" in
21162 true|$define|y) avail_ext="$avail_ext $xxx" ;;
21166 case "$usethreads" in
21168 case "$use5005threads" in
21169 $define|true|[yY]*) avail_ext="$avail_ext $xxx" ;;
21173 threads|threads/shared)
21174 # threads and threads::shared are special cases.
21175 # To stop people from asking "Perl 5.8.0 was supposed
21176 # to have this new fancy threads implementation but my
21177 # perl doesn't have it" and from people trying to
21178 # (re)install the threads module using CPAN.pm and
21179 # CPAN.pm then offering to reinstall Perl 5.8.0,
21180 # the threads.pm and threads/shared.pm will always be
21181 # there, croaking informatively ("you need to rebuild
21182 # all of Perl with threads, sorry") when threads haven't
21183 # been compiled in.
21185 avail_ext="$avail_ext $xxx"
21189 cygwin) avail_ext="$avail_ext $xxx" ;;
21192 XS/APItest|xs/apitest)
21193 # This is just for testing. Skip it unless we have dynamic loading.
21196 $define) avail_ext="$avail_ext $xxx" ;;
21199 XS/Typemap|xs/typemap)
21200 # This is just for testing. Skip it unless we have dynamic loading.
21202 $define) avail_ext="$avail_ext $xxx" ;;
21205 *) avail_ext="$avail_ext $xxx"
21214 case "$onlyextensions" in
21216 *) keepextensions=''
21217 echo "You have requested that only certains extensions be included..." >&4
21218 for i in $onlyextensions; do
21219 case " $avail_ext " in
21221 echo "Keeping extension $i."
21222 keepextensions="$keepextensions $i"
21224 *) echo "Ignoring extension $i." ;;
21227 avail_ext="$keepextensions"
21231 case "$noextensions" in
21233 *) keepextensions=''
21234 echo "You have requested that certain extensions be ignored..." >&4
21235 for i in $avail_ext; do
21236 case " $noextensions " in
21237 *" $i "*) echo "Ignoring extension $i." ;;
21238 *) echo "Keeping extension $i.";
21239 keepextensions="$keepextensions $i"
21243 avail_ext="$keepextensions"
21247 : Now see which nonxs extensions are supported on this system.
21248 : For now assume all are.
21250 for xxx in $nonxs_extensions ; do
21252 *) nonxs_ext="$nonxs_ext $xxx"
21264 A number of extensions are supplied with $package. You may choose to
21265 compile these extensions for dynamic loading (the default), compile
21266 them into the $package executable (static loading), or not include
21267 them at all. Answer "none" to include no extensions.
21268 Note that DynaLoader is always built and need not be mentioned here.
21271 case "$dynamic_ext" in
21273 : Exclude those listed in static_ext
21275 for xxx in $avail_ext; do
21276 case " $static_ext " in
21278 *) dflt="$dflt $xxx" ;;
21285 *) dflt="$dynamic_ext"
21286 # Perhaps we are reusing an old out-of-date config.sh.
21289 if test X"$dynamic_ext" != X"$avail_ext"; then
21291 NOTICE: Your previous config.sh list may be incorrect.
21292 The extensions now available to you are
21294 but the default list from your previous config.sh is
21306 rp="What extensions do you wish to load dynamically?"
21309 none) dynamic_ext=' ' ;;
21310 *) dynamic_ext="$ans" ;;
21313 case "$static_ext" in
21315 : Exclude those already listed in dynamic linking
21317 for xxx in $avail_ext; do
21318 case " $dynamic_ext " in
21320 *) dflt="$dflt $xxx" ;;
21327 *) dflt="$static_ext"
21334 rp="What extensions do you wish to load statically?"
21337 none) static_ext=' ' ;;
21338 *) static_ext="$ans" ;;
21343 A number of extensions are supplied with $package. Answer "none"
21344 to include no extensions.
21345 Note that DynaLoader is always built and need not be mentioned here.
21348 case "$static_ext" in
21349 '') dflt="$avail_ext" ;;
21350 *) dflt="$static_ext"
21351 # Perhaps we are reusing an old out-of-date config.sh.
21354 if test X"$static_ext" != X"$avail_ext"; then
21356 NOTICE: Your previous config.sh list may be incorrect.
21357 The extensions now available to you are
21359 but the default list from your previous config.sh is
21368 : Exclude those that are not xs extensions
21372 rp="What extensions do you wish to include?"
21375 none) static_ext=' ' ;;
21376 *) static_ext="$ans" ;;
21381 # Encode is a special case. If we are building Encode as a static
21382 # extension, we need to explicitly list its subextensions as well.
21383 # For other nested extensions, this is handled automatically by
21384 # the appropriate Makefile.PL.
21385 case " $static_ext " in
21386 *" Encode "*) # Add the subextensions of Encode
21388 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
21389 static_ext="$static_ext Encode/$xxx"
21395 set X $dynamic_ext $static_ext $nonxs_ext
21399 # Sanity check: We require an extension suitable for use with
21400 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
21401 # should show up as failures in the test suite, but it's helpful to
21402 # catch them now.) The 'extensions' list is normally sorted
21403 # alphabetically, so we need to accept either
21404 # DB_File ... Fcntl ... IO ....
21405 # or something like
21406 # Fcntl ... NDBM_File ... IO ....
21407 case " $extensions" in
21408 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
21409 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
21410 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
21411 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
21412 echo "WARNING: The Perl you are building will be quite crippled." >& 4
21416 : Remove libraries needed only for extensions
21417 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
21418 : The exception is SunOS 4.x, which needs them.
21419 case "${osname}X${osvers}" in
21423 *) case "$usedl" in
21424 $define|true|[yY]*)
21425 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
21429 *) perllibs="$libs"
21435 : Remove build directory name from cppstdin so it can be used from
21436 : either the present location or the final installed location.
21438 : Get out of the UU directory to get correct path name.
21440 case "$cppstdin" in
21442 echo "Stripping down cppstdin path name"
21448 : end of configuration questions
21450 echo "End of configuration questions."
21453 : back to where it started
21454 if test -d ../UU; then
21458 : configuration may be patched via a 'config.arch' file
21459 if $test -f config.arch; then
21460 echo "I see a config.arch file, loading it."
21464 : configuration may be patched via a 'config.over' file
21465 if $test -f config.over; then
21468 rp='I see a config.over file. Do you wish to load it?'
21471 n*) echo "OK, I'll ignore it.";;
21473 echo "Configuration override changes have been loaded."
21478 : in case they want portability, strip down executable paths
21479 case "$d_portable" in
21482 echo "Stripping down executable paths..." >&4
21483 for file in $loclist $trylist; do
21485 eval $file=`basename $temp`
21490 : create config.sh file
21492 echo "Creating config.sh..." >&4
21493 $spitshell <<EOT >config.sh
21496 # This file was produced by running the Configure script. It holds all the
21497 # definitions figured out by Configure. Should you modify one of these values,
21498 # do not forget to propagate your changes by running "Configure -der". You may
21499 # instead choose to run each of the .SH files by yourself, or "Configure -S".
21502 # Package name : $package
21503 # Source directory : $src
21504 # Configuration time: $cf_time
21505 # Configured by : $cf_by
21506 # Target system : $myuname
21516 Revision='$Revision'
21524 alignbytes='$alignbytes'
21525 ansi2knr='$ansi2knr'
21526 aphostname='$aphostname'
21527 api_revision='$api_revision'
21528 api_subversion='$api_subversion'
21529 api_version='$api_version'
21530 api_versionstring='$api_versionstring'
21533 archlibexp='$archlibexp'
21534 archname64='$archname64'
21535 archname='$archname'
21536 archobjs='$archobjs'
21537 asctime_r_proto='$asctime_r_proto'
21545 byteorder='$byteorder'
21547 castflags='$castflags'
21550 cccdlflags='$cccdlflags'
21551 ccdlflags='$ccdlflags'
21553 ccflags_uselargefiles='$ccflags_uselargefiles'
21555 ccsymbols='$ccsymbols'
21556 ccversion='$ccversion'
21558 cf_email='$cf_email'
21563 clocktype='$clocktype'
21565 compress='$compress'
21566 contains='$contains'
21570 cpp_stuff='$cpp_stuff'
21571 cppccsymbols='$cppccsymbols'
21572 cppflags='$cppflags'
21574 cppminus='$cppminus'
21576 cppstdin='$cppstdin'
21577 cppsymbols='$cppsymbols'
21578 crypt_r_proto='$crypt_r_proto'
21579 cryptlib='$cryptlib'
21581 ctermid_r_proto='$ctermid_r_proto'
21582 ctime_r_proto='$ctime_r_proto'
21583 d_Gconvert='$d_Gconvert'
21584 d_PRIEUldbl='$d_PRIEUldbl'
21585 d_PRIFUldbl='$d_PRIFUldbl'
21586 d_PRIGUldbl='$d_PRIGUldbl'
21587 d_PRIXU64='$d_PRIXU64'
21588 d_PRId64='$d_PRId64'
21589 d_PRIeldbl='$d_PRIeldbl'
21590 d_PRIfldbl='$d_PRIfldbl'
21591 d_PRIgldbl='$d_PRIgldbl'
21592 d_PRIi64='$d_PRIi64'
21593 d_PRIo64='$d_PRIo64'
21594 d_PRIu64='$d_PRIu64'
21595 d_PRIx64='$d_PRIx64'
21596 d_SCNfldbl='$d_SCNfldbl'
21597 d__fwalk='$d__fwalk'
21598 d_access='$d_access'
21599 d_accessx='$d_accessx'
21602 d_archlib='$d_archlib'
21603 d_asctime_r='$d_asctime_r'
21606 d_attribute_format='$d_attribute_format'
21607 d_attribute_malloc='$d_attribute_malloc'
21608 d_attribute_nonnull='$d_attribute_nonnull'
21609 d_attribute_noreturn='$d_attribute_noreturn'
21610 d_attribute_pure='$d_attribute_pure'
21611 d_attribute_unused='$d_attribute_unused'
21612 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
21616 d_bsdgetpgrp='$d_bsdgetpgrp'
21617 d_bsdsetpgrp='$d_bsdsetpgrp'
21618 d_builtin_choose_expr='$d_builtin_choose_expr'
21619 d_builtin_expect='$d_builtin_expect'
21621 d_c99_variadic_macros='$d_c99_variadic_macros'
21622 d_casti32='$d_casti32'
21623 d_castneg='$d_castneg'
21624 d_charvspr='$d_charvspr'
21626 d_chroot='$d_chroot'
21627 d_chsize='$d_chsize'
21629 d_clearenv='$d_clearenv'
21630 d_closedir='$d_closedir'
21631 d_cmsghdr_s='$d_cmsghdr_s'
21633 d_copysignl='$d_copysignl'
21634 d_cplusplus='$d_cplusplus'
21636 d_crypt_r='$d_crypt_r'
21638 d_ctermid='$d_ctermid'
21639 d_ctermid_r='$d_ctermid_r'
21640 d_ctime_r='$d_ctime_r'
21641 d_cuserid='$d_cuserid'
21642 d_dbl_dig='$d_dbl_dig'
21643 d_dbminitproto='$d_dbminitproto'
21644 d_difftime='$d_difftime'
21645 d_dir_dd_fd='$d_dir_dd_fd'
21647 d_dirnamlen='$d_dirnamlen'
21648 d_dlerror='$d_dlerror'
21649 d_dlopen='$d_dlopen'
21650 d_dlsymun='$d_dlsymun'
21651 d_dosuid='$d_dosuid'
21652 d_drand48_r='$d_drand48_r'
21653 d_drand48proto='$d_drand48proto'
21655 d_eaccess='$d_eaccess'
21656 d_endgrent='$d_endgrent'
21657 d_endgrent_r='$d_endgrent_r'
21658 d_endhent='$d_endhent'
21659 d_endhostent_r='$d_endhostent_r'
21660 d_endnent='$d_endnent'
21661 d_endnetent_r='$d_endnetent_r'
21662 d_endpent='$d_endpent'
21663 d_endprotoent_r='$d_endprotoent_r'
21664 d_endpwent='$d_endpwent'
21665 d_endpwent_r='$d_endpwent_r'
21666 d_endsent='$d_endsent'
21667 d_endservent_r='$d_endservent_r'
21668 d_eofnblk='$d_eofnblk'
21669 d_eunice='$d_eunice'
21670 d_faststdio='$d_faststdio'
21671 d_fchdir='$d_fchdir'
21672 d_fchmod='$d_fchmod'
21673 d_fchown='$d_fchown'
21675 d_fcntl_can_lock='$d_fcntl_can_lock'
21676 d_fd_macros='$d_fd_macros'
21677 d_fd_set='$d_fd_set'
21678 d_fds_bits='$d_fds_bits'
21679 d_fgetpos='$d_fgetpos'
21680 d_finite='$d_finite'
21681 d_finitel='$d_finitel'
21682 d_flexfnam='$d_flexfnam'
21684 d_flockproto='$d_flockproto'
21686 d_fp_class='$d_fp_class'
21687 d_fpathconf='$d_fpathconf'
21688 d_fpclass='$d_fpclass'
21689 d_fpclassify='$d_fpclassify'
21690 d_fpclassl='$d_fpclassl'
21691 d_fpos64_t='$d_fpos64_t'
21692 d_frexpl='$d_frexpl'
21693 d_fs_data_s='$d_fs_data_s'
21694 d_fseeko='$d_fseeko'
21695 d_fsetpos='$d_fsetpos'
21696 d_fstatfs='$d_fstatfs'
21697 d_fstatvfs='$d_fstatvfs'
21699 d_ftello='$d_ftello'
21701 d_futimes='$d_futimes'
21702 d_getcwd='$d_getcwd'
21703 d_getespwnam='$d_getespwnam'
21704 d_getfsstat='$d_getfsstat'
21705 d_getgrent='$d_getgrent'
21706 d_getgrent_r='$d_getgrent_r'
21707 d_getgrgid_r='$d_getgrgid_r'
21708 d_getgrnam_r='$d_getgrnam_r'
21709 d_getgrps='$d_getgrps'
21710 d_gethbyaddr='$d_gethbyaddr'
21711 d_gethbyname='$d_gethbyname'
21712 d_gethent='$d_gethent'
21713 d_gethname='$d_gethname'
21714 d_gethostbyaddr_r='$d_gethostbyaddr_r'
21715 d_gethostbyname_r='$d_gethostbyname_r'
21716 d_gethostent_r='$d_gethostent_r'
21717 d_gethostprotos='$d_gethostprotos'
21718 d_getitimer='$d_getitimer'
21719 d_getlogin='$d_getlogin'
21720 d_getlogin_r='$d_getlogin_r'
21721 d_getmnt='$d_getmnt'
21722 d_getmntent='$d_getmntent'
21723 d_getnbyaddr='$d_getnbyaddr'
21724 d_getnbyname='$d_getnbyname'
21725 d_getnent='$d_getnent'
21726 d_getnetbyaddr_r='$d_getnetbyaddr_r'
21727 d_getnetbyname_r='$d_getnetbyname_r'
21728 d_getnetent_r='$d_getnetent_r'
21729 d_getnetprotos='$d_getnetprotos'
21730 d_getpagsz='$d_getpagsz'
21731 d_getpbyname='$d_getpbyname'
21732 d_getpbynumber='$d_getpbynumber'
21733 d_getpent='$d_getpent'
21734 d_getpgid='$d_getpgid'
21735 d_getpgrp2='$d_getpgrp2'
21736 d_getpgrp='$d_getpgrp'
21737 d_getppid='$d_getppid'
21738 d_getprior='$d_getprior'
21739 d_getprotobyname_r='$d_getprotobyname_r'
21740 d_getprotobynumber_r='$d_getprotobynumber_r'
21741 d_getprotoent_r='$d_getprotoent_r'
21742 d_getprotoprotos='$d_getprotoprotos'
21743 d_getprpwnam='$d_getprpwnam'
21744 d_getpwent='$d_getpwent'
21745 d_getpwent_r='$d_getpwent_r'
21746 d_getpwnam_r='$d_getpwnam_r'
21747 d_getpwuid_r='$d_getpwuid_r'
21748 d_getsbyname='$d_getsbyname'
21749 d_getsbyport='$d_getsbyport'
21750 d_getsent='$d_getsent'
21751 d_getservbyname_r='$d_getservbyname_r'
21752 d_getservbyport_r='$d_getservbyport_r'
21753 d_getservent_r='$d_getservent_r'
21754 d_getservprotos='$d_getservprotos'
21755 d_getspnam='$d_getspnam'
21756 d_getspnam_r='$d_getspnam_r'
21757 d_gettimeod='$d_gettimeod'
21758 d_gmtime_r='$d_gmtime_r'
21759 d_gnulibc='$d_gnulibc'
21760 d_grpasswd='$d_grpasswd'
21761 d_hasmntopt='$d_hasmntopt'
21763 d_ilogbl='$d_ilogbl'
21764 d_inc_version_list='$d_inc_version_list'
21766 d_inetaton='$d_inetaton'
21767 d_int64_t='$d_int64_t'
21768 d_isascii='$d_isascii'
21769 d_isfinite='$d_isfinite'
21772 d_isnanl='$d_isnanl'
21773 d_killpg='$d_killpg'
21774 d_lchown='$d_lchown'
21775 d_ldbl_dig='$d_ldbl_dig'
21776 d_libm_lib_version='$d_libm_lib_version'
21778 d_localtime_r='$d_localtime_r'
21779 d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset'
21780 d_locconv='$d_locconv'
21782 d_longdbl='$d_longdbl'
21783 d_longlong='$d_longlong'
21784 d_lseekproto='$d_lseekproto'
21786 d_madvise='$d_madvise'
21787 d_malloc_good_size='$d_malloc_good_size'
21788 d_malloc_size='$d_malloc_size'
21790 d_mbstowcs='$d_mbstowcs'
21791 d_mbtowc='$d_mbtowc'
21792 d_memchr='$d_memchr'
21793 d_memcmp='$d_memcmp'
21794 d_memcpy='$d_memcpy'
21795 d_memmove='$d_memmove'
21796 d_memset='$d_memset'
21798 d_mkdtemp='$d_mkdtemp'
21799 d_mkfifo='$d_mkfifo'
21800 d_mkstemp='$d_mkstemp'
21801 d_mkstemps='$d_mkstemps'
21802 d_mktime='$d_mktime'
21805 d_modfl_pow32_bug='$d_modfl_pow32_bug'
21806 d_modflproto='$d_modflproto'
21807 d_mprotect='$d_mprotect'
21809 d_msg_ctrunc='$d_msg_ctrunc'
21810 d_msg_dontroute='$d_msg_dontroute'
21811 d_msg_oob='$d_msg_oob'
21812 d_msg_peek='$d_msg_peek'
21813 d_msg_proxy='$d_msg_proxy'
21814 d_msgctl='$d_msgctl'
21815 d_msgget='$d_msgget'
21816 d_msghdr_s='$d_msghdr_s'
21817 d_msgrcv='$d_msgrcv'
21818 d_msgsnd='$d_msgsnd'
21820 d_munmap='$d_munmap'
21821 d_mymalloc='$d_mymalloc'
21823 d_nl_langinfo='$d_nl_langinfo'
21824 d_nv_preserves_uv='$d_nv_preserves_uv'
21825 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
21826 d_off64_t='$d_off64_t'
21827 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
21828 d_oldpthreads='$d_oldpthreads'
21829 d_oldsock='$d_oldsock'
21831 d_pathconf='$d_pathconf'
21833 d_perl_otherlibdirs='$d_perl_otherlibdirs'
21834 d_phostname='$d_phostname'
21837 d_portable='$d_portable'
21838 d_printf_format_null='$d_printf_format_null'
21839 d_procselfexe='$d_procselfexe'
21840 d_pseudofork='$d_pseudofork'
21841 d_pthread_atfork='$d_pthread_atfork'
21842 d_pthread_attr_setscope='$d_pthread_attr_setscope'
21843 d_pthread_yield='$d_pthread_yield'
21845 d_pwchange='$d_pwchange'
21846 d_pwclass='$d_pwclass'
21847 d_pwcomment='$d_pwcomment'
21848 d_pwexpire='$d_pwexpire'
21849 d_pwgecos='$d_pwgecos'
21850 d_pwpasswd='$d_pwpasswd'
21851 d_pwquota='$d_pwquota'
21854 d_random_r='$d_random_r'
21855 d_readdir64_r='$d_readdir64_r'
21856 d_readdir='$d_readdir'
21857 d_readdir_r='$d_readdir_r'
21858 d_readlink='$d_readlink'
21860 d_recvmsg='$d_recvmsg'
21861 d_rename='$d_rename'
21862 d_rewinddir='$d_rewinddir'
21864 d_safebcpy='$d_safebcpy'
21865 d_safemcpy='$d_safemcpy'
21866 d_sanemcmp='$d_sanemcmp'
21867 d_sbrkproto='$d_sbrkproto'
21868 d_scalbnl='$d_scalbnl'
21869 d_sched_yield='$d_sched_yield'
21870 d_scm_rights='$d_scm_rights'
21871 d_seekdir='$d_seekdir'
21872 d_select='$d_select'
21874 d_semctl='$d_semctl'
21875 d_semctl_semid_ds='$d_semctl_semid_ds'
21876 d_semctl_semun='$d_semctl_semun'
21877 d_semget='$d_semget'
21879 d_sendmsg='$d_sendmsg'
21880 d_setegid='$d_setegid'
21881 d_seteuid='$d_seteuid'
21882 d_setgrent='$d_setgrent'
21883 d_setgrent_r='$d_setgrent_r'
21884 d_setgrps='$d_setgrps'
21885 d_sethent='$d_sethent'
21886 d_sethostent_r='$d_sethostent_r'
21887 d_setitimer='$d_setitimer'
21888 d_setlinebuf='$d_setlinebuf'
21889 d_setlocale='$d_setlocale'
21890 d_setlocale_r='$d_setlocale_r'
21891 d_setnent='$d_setnent'
21892 d_setnetent_r='$d_setnetent_r'
21893 d_setpent='$d_setpent'
21894 d_setpgid='$d_setpgid'
21895 d_setpgrp2='$d_setpgrp2'
21896 d_setpgrp='$d_setpgrp'
21897 d_setprior='$d_setprior'
21898 d_setproctitle='$d_setproctitle'
21899 d_setprotoent_r='$d_setprotoent_r'
21900 d_setpwent='$d_setpwent'
21901 d_setpwent_r='$d_setpwent_r'
21902 d_setregid='$d_setregid'
21903 d_setresgid='$d_setresgid'
21904 d_setresuid='$d_setresuid'
21905 d_setreuid='$d_setreuid'
21906 d_setrgid='$d_setrgid'
21907 d_setruid='$d_setruid'
21908 d_setsent='$d_setsent'
21909 d_setservent_r='$d_setservent_r'
21910 d_setsid='$d_setsid'
21911 d_setvbuf='$d_setvbuf'
21915 d_shmatprototype='$d_shmatprototype'
21916 d_shmctl='$d_shmctl'
21918 d_shmget='$d_shmget'
21919 d_sigaction='$d_sigaction'
21920 d_signbit='$d_signbit'
21921 d_sigprocmask='$d_sigprocmask'
21922 d_sigsetjmp='$d_sigsetjmp'
21923 d_sitearch='$d_sitearch'
21924 d_snprintf='$d_snprintf'
21925 d_sockatmark='$d_sockatmark'
21926 d_sockatmarkproto='$d_sockatmarkproto'
21927 d_socket='$d_socket'
21928 d_socklen_t='$d_socklen_t'
21929 d_sockpair='$d_sockpair'
21930 d_socks5_init='$d_socks5_init'
21931 d_sprintf_returns_strlen='$d_sprintf_returns_strlen'
21933 d_srand48_r='$d_srand48_r'
21934 d_srandom_r='$d_srandom_r'
21935 d_sresgproto='$d_sresgproto'
21936 d_sresuproto='$d_sresuproto'
21937 d_statblks='$d_statblks'
21938 d_statfs_f_flags='$d_statfs_f_flags'
21939 d_statfs_s='$d_statfs_s'
21940 d_statvfs='$d_statvfs'
21941 d_stdio_cnt_lval='$d_stdio_cnt_lval'
21942 d_stdio_ptr_lval='$d_stdio_ptr_lval'
21943 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
21944 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
21945 d_stdio_stream_array='$d_stdio_stream_array'
21946 d_stdiobase='$d_stdiobase'
21947 d_stdstdio='$d_stdstdio'
21948 d_strchr='$d_strchr'
21949 d_strcoll='$d_strcoll'
21950 d_strctcpy='$d_strctcpy'
21951 d_strerrm='$d_strerrm'
21952 d_strerror='$d_strerror'
21953 d_strerror_r='$d_strerror_r'
21954 d_strftime='$d_strftime'
21955 d_strlcat='$d_strlcat'
21956 d_strlcpy='$d_strlcpy'
21957 d_strtod='$d_strtod'
21958 d_strtol='$d_strtol'
21959 d_strtold='$d_strtold'
21960 d_strtoll='$d_strtoll'
21961 d_strtoq='$d_strtoq'
21962 d_strtoul='$d_strtoul'
21963 d_strtoull='$d_strtoull'
21964 d_strtouq='$d_strtouq'
21965 d_strxfrm='$d_strxfrm'
21966 d_suidsafe='$d_suidsafe'
21967 d_symlink='$d_symlink'
21968 d_syscall='$d_syscall'
21969 d_syscallproto='$d_syscallproto'
21970 d_sysconf='$d_sysconf'
21971 d_sysernlst='$d_sysernlst'
21972 d_syserrlst='$d_syserrlst'
21973 d_system='$d_system'
21974 d_tcgetpgrp='$d_tcgetpgrp'
21975 d_tcsetpgrp='$d_tcsetpgrp'
21976 d_telldir='$d_telldir'
21977 d_telldirproto='$d_telldirproto'
21980 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
21981 d_tm_tm_zone='$d_tm_tm_zone'
21982 d_tmpnam_r='$d_tmpnam_r'
21983 d_truncate='$d_truncate'
21984 d_ttyname_r='$d_ttyname_r'
21985 d_tzname='$d_tzname'
21986 d_u32align='$d_u32align'
21987 d_ualarm='$d_ualarm'
21990 d_union_semun='$d_union_semun'
21991 d_unordered='$d_unordered'
21992 d_unsetenv='$d_unsetenv'
21993 d_usleep='$d_usleep'
21994 d_usleepproto='$d_usleepproto'
21996 d_vendorarch='$d_vendorarch'
21997 d_vendorbin='$d_vendorbin'
21998 d_vendorlib='$d_vendorlib'
21999 d_vendorscript='$d_vendorscript'
22001 d_void_closedir='$d_void_closedir'
22002 d_voidsig='$d_voidsig'
22003 d_voidtty='$d_voidtty'
22004 d_volatile='$d_volatile'
22005 d_vprintf='$d_vprintf'
22006 d_vsnprintf='$d_vsnprintf'
22008 d_waitpid='$d_waitpid'
22009 d_wcstombs='$d_wcstombs'
22010 d_wctomb='$d_wctomb'
22011 d_writev='$d_writev'
22014 db_hashtype='$db_hashtype'
22015 db_prefixtype='$db_prefixtype'
22016 db_version_major='$db_version_major'
22017 db_version_minor='$db_version_minor'
22018 db_version_patch='$db_version_patch'
22019 defvoidused='$defvoidused'
22020 direntrytype='$direntrytype'
22023 doublesize='$doublesize'
22025 drand48_r_proto='$drand48_r_proto'
22026 dynamic_ext='$dynamic_ext'
22032 endgrent_r_proto='$endgrent_r_proto'
22033 endhostent_r_proto='$endhostent_r_proto'
22034 endnetent_r_proto='$endnetent_r_proto'
22035 endprotoent_r_proto='$endprotoent_r_proto'
22036 endpwent_r_proto='$endpwent_r_proto'
22037 endservent_r_proto='$endservent_r_proto'
22038 eunicefix='$eunicefix'
22041 extensions='$extensions'
22043 fflushNULL='$fflushNULL'
22044 fflushall='$fflushall'
22046 firstmakefile='$firstmakefile'
22048 fpossize='$fpossize'
22049 fpostype='$fpostype'
22050 freetype='$freetype'
22053 full_csh='$full_csh'
22054 full_sed='$full_sed'
22055 gccansipedantic='$gccansipedantic'
22056 gccosandvers='$gccosandvers'
22057 gccversion='$gccversion'
22058 getgrent_r_proto='$getgrent_r_proto'
22059 getgrgid_r_proto='$getgrgid_r_proto'
22060 getgrnam_r_proto='$getgrnam_r_proto'
22061 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
22062 gethostbyname_r_proto='$gethostbyname_r_proto'
22063 gethostent_r_proto='$gethostent_r_proto'
22064 getlogin_r_proto='$getlogin_r_proto'
22065 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
22066 getnetbyname_r_proto='$getnetbyname_r_proto'
22067 getnetent_r_proto='$getnetent_r_proto'
22068 getprotobyname_r_proto='$getprotobyname_r_proto'
22069 getprotobynumber_r_proto='$getprotobynumber_r_proto'
22070 getprotoent_r_proto='$getprotoent_r_proto'
22071 getpwent_r_proto='$getpwent_r_proto'
22072 getpwnam_r_proto='$getpwnam_r_proto'
22073 getpwuid_r_proto='$getpwuid_r_proto'
22074 getservbyname_r_proto='$getservbyname_r_proto'
22075 getservbyport_r_proto='$getservbyport_r_proto'
22076 getservent_r_proto='$getservent_r_proto'
22077 getspnam_r_proto='$getspnam_r_proto'
22078 gidformat='$gidformat'
22084 gmtime_r_proto='$gmtime_r_proto'
22085 gnulibc_version='$gnulibc_version'
22087 groupcat='$groupcat'
22088 groupstype='$groupstype'
22091 h_sysfile='$h_sysfile'
22094 html1dir='$html1dir'
22095 html1direxp='$html1direxp'
22096 html3dir='$html3dir'
22097 html3direxp='$html3direxp'
22106 i_arpainet='$i_arpainet'
22107 i_bsdioctl='$i_bsdioctl'
22111 i_dirent='$i_dirent'
22117 i_fp_class='$i_fp_class'
22120 i_ieeefp='$i_ieeefp'
22121 i_inttypes='$i_inttypes'
22122 i_langinfo='$i_langinfo'
22123 i_libutil='$i_libutil'
22124 i_limits='$i_limits'
22125 i_locale='$i_locale'
22126 i_machcthr='$i_machcthr'
22127 i_malloc='$i_malloc'
22129 i_memory='$i_memory'
22130 i_mntent='$i_mntent'
22133 i_neterrno='$i_neterrno'
22134 i_netinettcp='$i_netinettcp'
22138 i_pthread='$i_pthread'
22140 i_rpcsvcdbm='$i_rpcsvcdbm'
22143 i_shadow='$i_shadow'
22145 i_stdarg='$i_stdarg'
22146 i_stddef='$i_stddef'
22147 i_stdlib='$i_stdlib'
22148 i_string='$i_string'
22149 i_sunmath='$i_sunmath'
22150 i_sysaccess='$i_sysaccess'
22151 i_sysdir='$i_sysdir'
22152 i_sysfile='$i_sysfile'
22153 i_sysfilio='$i_sysfilio'
22155 i_sysioctl='$i_sysioctl'
22156 i_syslog='$i_syslog'
22157 i_sysmman='$i_sysmman'
22158 i_sysmode='$i_sysmode'
22159 i_sysmount='$i_sysmount'
22160 i_sysndir='$i_sysndir'
22161 i_sysparam='$i_sysparam'
22162 i_sysresrc='$i_sysresrc'
22163 i_syssecrt='$i_syssecrt'
22164 i_sysselct='$i_sysselct'
22165 i_syssockio='$i_syssockio'
22166 i_sysstat='$i_sysstat'
22167 i_sysstatfs='$i_sysstatfs'
22168 i_sysstatvfs='$i_sysstatvfs'
22169 i_systime='$i_systime'
22170 i_systimek='$i_systimek'
22171 i_systimes='$i_systimes'
22172 i_systypes='$i_systypes'
22173 i_sysuio='$i_sysuio'
22175 i_sysutsname='$i_sysutsname'
22176 i_sysvfs='$i_sysvfs'
22177 i_syswait='$i_syswait'
22178 i_termio='$i_termio'
22179 i_termios='$i_termios'
22181 i_unistd='$i_unistd'
22184 i_values='$i_values'
22185 i_varargs='$i_varargs'
22186 i_varhdr='$i_varhdr'
22188 ignore_versioned_solibs='$ignore_versioned_solibs'
22189 inc_version_list='$inc_version_list'
22190 inc_version_list_init='$inc_version_list_init'
22193 initialinstalllocation='$initialinstalllocation'
22194 installarchlib='$installarchlib'
22195 installbin='$installbin'
22196 installhtml1dir='$installhtml1dir'
22197 installhtml3dir='$installhtml3dir'
22198 installman1dir='$installman1dir'
22199 installman3dir='$installman3dir'
22200 installprefix='$installprefix'
22201 installprefixexp='$installprefixexp'
22202 installprivlib='$installprivlib'
22203 installscript='$installscript'
22204 installsitearch='$installsitearch'
22205 installsitebin='$installsitebin'
22206 installsitehtml1dir='$installsitehtml1dir'
22207 installsitehtml3dir='$installsitehtml3dir'
22208 installsitelib='$installsitelib'
22209 installsiteman1dir='$installsiteman1dir'
22210 installsiteman3dir='$installsiteman3dir'
22211 installsitescript='$installsitescript'
22212 installstyle='$installstyle'
22213 installusrbinperl='$installusrbinperl'
22214 installvendorarch='$installvendorarch'
22215 installvendorbin='$installvendorbin'
22216 installvendorhtml1dir='$installvendorhtml1dir'
22217 installvendorhtml3dir='$installvendorhtml3dir'
22218 installvendorlib='$installvendorlib'
22219 installvendorman1dir='$installvendorman1dir'
22220 installvendorman3dir='$installvendorman3dir'
22221 installvendorscript='$installvendorscript'
22223 issymlink='$issymlink'
22224 ivdformat='$ivdformat'
22227 known_extensions='$known_extensions'
22230 lddlflags='$lddlflags'
22232 ldflags_uselargefiles='$ldflags_uselargefiles'
22233 ldlibpthname='$ldlibpthname'
22240 libsdirs='$libsdirs'
22241 libsfiles='$libsfiles'
22242 libsfound='$libsfound'
22243 libspath='$libspath'
22244 libswanted='$libswanted'
22245 libswanted_uselargefiles='$libswanted_uselargefiles'
22251 localtime_r_proto='$localtime_r_proto'
22252 locincpth='$locincpth'
22253 loclibpth='$loclibpth'
22254 longdblsize='$longdblsize'
22255 longlongsize='$longlongsize'
22256 longsize='$longsize'
22260 lseeksize='$lseeksize'
22261 lseektype='$lseektype'
22264 madlyobj='$madlyobj'
22265 madlysrc='$madlysrc'
22269 make_set_make='$make_set_make'
22270 mallocobj='$mallocobj'
22271 mallocsrc='$mallocsrc'
22272 malloctype='$malloctype'
22274 man1direxp='$man1direxp'
22277 man3direxp='$man3direxp'
22279 mips_type='$mips_type'
22280 mistrustnm='$mistrustnm'
22282 mmaptype='$mmaptype'
22283 modetype='$modetype'
22285 multiarch='$multiarch'
22287 myarchname='$myarchname'
22288 mydomain='$mydomain'
22289 myhostname='$myhostname'
22292 need_va_copy='$need_va_copy'
22293 netdb_hlen_type='$netdb_hlen_type'
22294 netdb_host_type='$netdb_host_type'
22295 netdb_name_type='$netdb_name_type'
22296 netdb_net_type='$netdb_net_type'
22299 nm_so_opt='$nm_so_opt'
22300 nonxs_ext='$nonxs_ext'
22302 nvEUformat='$nvEUformat'
22303 nvFUformat='$nvFUformat'
22304 nvGUformat='$nvGUformat'
22305 nv_preserves_uv_bits='$nv_preserves_uv_bits'
22306 nveformat='$nveformat'
22307 nvfformat='$nvfformat'
22308 nvgformat='$nvgformat'
22311 o_nonblock='$o_nonblock'
22313 old_pthread_create_joinable='$old_pthread_create_joinable'
22314 optimize='$optimize'
22315 orderlib='$orderlib'
22318 otherlibdirs='$otherlibdirs'
22322 patchlevel='$patchlevel'
22323 path_sep='$path_sep'
22326 perl_patchlevel='$perl_patchlevel'
22327 perladmin='$perladmin'
22328 perllibs='$perllibs'
22329 perlpath='$perlpath'
22331 phostname='$phostname'
22337 prefixexp='$prefixexp'
22339 privlibexp='$privlibexp'
22340 procselfexe='$procselfexe'
22341 prototype='$prototype'
22343 quadkind='$quadkind'
22344 quadtype='$quadtype'
22345 randbits='$randbits'
22346 randfunc='$randfunc'
22347 random_r_proto='$random_r_proto'
22348 randseedtype='$randseedtype'
22350 rd_nodata='$rd_nodata'
22351 readdir64_r_proto='$readdir64_r_proto'
22352 readdir_r_proto='$readdir_r_proto'
22353 revision='$revision'
22359 sPRIEUldbl='$sPRIEUldbl'
22360 sPRIFUldbl='$sPRIFUldbl'
22361 sPRIGUldbl='$sPRIGUldbl'
22362 sPRIXU64='$sPRIXU64'
22364 sPRIeldbl='$sPRIeldbl'
22365 sPRIfldbl='$sPRIfldbl'
22366 sPRIgldbl='$sPRIgldbl'
22371 sSCNfldbl='$sSCNfldbl'
22372 sched_yield='$sched_yield'
22373 scriptdir='$scriptdir'
22374 scriptdirexp='$scriptdirexp'
22376 seedfunc='$seedfunc'
22377 selectminbits='$selectminbits'
22378 selecttype='$selecttype'
22379 sendmail='$sendmail'
22380 setgrent_r_proto='$setgrent_r_proto'
22381 sethostent_r_proto='$sethostent_r_proto'
22382 setlocale_r_proto='$setlocale_r_proto'
22383 setnetent_r_proto='$setnetent_r_proto'
22384 setprotoent_r_proto='$setprotoent_r_proto'
22385 setpwent_r_proto='$setpwent_r_proto'
22386 setservent_r_proto='$setservent_r_proto'
22389 sharpbang='$sharpbang'
22390 shmattype='$shmattype'
22391 shortsize='$shortsize'
22394 sig_count='$sig_count'
22395 sig_name='$sig_name'
22396 sig_name_init='$sig_name_init'
22398 sig_num_init='$sig_num_init'
22399 sig_size='$sig_size'
22400 signal_t='$signal_t'
22401 sitearch='$sitearch'
22402 sitearchexp='$sitearchexp'
22404 sitebinexp='$sitebinexp'
22405 sitehtml1dir='$sitehtml1dir'
22406 sitehtml1direxp='$sitehtml1direxp'
22407 sitehtml3dir='$sitehtml3dir'
22408 sitehtml3direxp='$sitehtml3direxp'
22410 sitelib_stem='$sitelib_stem'
22411 sitelibexp='$sitelibexp'
22412 siteman1dir='$siteman1dir'
22413 siteman1direxp='$siteman1direxp'
22414 siteman3dir='$siteman3dir'
22415 siteman3direxp='$siteman3direxp'
22416 siteprefix='$siteprefix'
22417 siteprefixexp='$siteprefixexp'
22418 sitescript='$sitescript'
22419 sitescriptexp='$sitescriptexp'
22420 sizesize='$sizesize'
22421 sizetype='$sizetype'
22425 sockethdr='$sockethdr'
22426 socketlib='$socketlib'
22427 socksizetype='$socksizetype'
22429 spackage='$spackage'
22430 spitshell='$spitshell'
22431 srand48_r_proto='$srand48_r_proto'
22432 srandom_r_proto='$srandom_r_proto'
22434 ssizetype='$ssizetype'
22435 startperl='$startperl'
22437 static_ext='$static_ext'
22439 stdio_base='$stdio_base'
22440 stdio_bufsiz='$stdio_bufsiz'
22441 stdio_cnt='$stdio_cnt'
22442 stdio_filbuf='$stdio_filbuf'
22443 stdio_ptr='$stdio_ptr'
22444 stdio_stream_array='$stdio_stream_array'
22445 strerror_r_proto='$strerror_r_proto'
22448 subversion='$subversion'
22452 targetarch='$targetarch'
22456 timeincl='$timeincl'
22457 timetype='$timetype'
22458 tmpnam_r_proto='$tmpnam_r_proto'
22464 ttyname_r_proto='$ttyname_r_proto'
22473 uidformat='$uidformat'
22479 uquadtype='$uquadtype'
22480 use5005threads='$use5005threads'
22481 use64bitall='$use64bitall'
22482 use64bitint='$use64bitint'
22483 usecrosscompile='$usecrosscompile'
22485 usefaststdio='$usefaststdio'
22486 useithreads='$useithreads'
22487 uselargefiles='$uselargefiles'
22488 uselongdouble='$uselongdouble'
22489 usemallocwrap='$usemallocwrap'
22490 usemorebits='$usemorebits'
22491 usemultiplicity='$usemultiplicity'
22492 usemymalloc='$usemymalloc'
22494 useopcode='$useopcode'
22495 useperlio='$useperlio'
22496 useposix='$useposix'
22497 usereentrant='$usereentrant'
22498 userelocatableinc='$userelocatableinc'
22500 useshrplib='$useshrplib'
22501 usesitecustomize='$usesitecustomize'
22502 usesocks='$usesocks'
22503 usethreads='$usethreads'
22504 usevendorprefix='$usevendorprefix'
22505 usevfork='$usevfork'
22508 uvXUformat='$uvXUformat'
22509 uvoformat='$uvoformat'
22512 uvuformat='$uvuformat'
22513 uvxformat='$uvxformat'
22514 vendorarch='$vendorarch'
22515 vendorarchexp='$vendorarchexp'
22516 vendorbin='$vendorbin'
22517 vendorbinexp='$vendorbinexp'
22518 vendorhtml1dir='$vendorhtml1dir'
22519 vendorhtml1direxp='$vendorhtml1direxp'
22520 vendorhtml3dir='$vendorhtml3dir'
22521 vendorhtml3direxp='$vendorhtml3direxp'
22522 vendorlib='$vendorlib'
22523 vendorlib_stem='$vendorlib_stem'
22524 vendorlibexp='$vendorlibexp'
22525 vendorman1dir='$vendorman1dir'
22526 vendorman1direxp='$vendorman1direxp'
22527 vendorman3dir='$vendorman3dir'
22528 vendorman3direxp='$vendorman3direxp'
22529 vendorprefix='$vendorprefix'
22530 vendorprefixexp='$vendorprefixexp'
22531 vendorscript='$vendorscript'
22532 vendorscriptexp='$vendorscriptexp'
22534 version_patchlevel_string='$version_patchlevel_string'
22535 versiononly='$versiononly'
22537 voidflags='$voidflags'
22540 yaccflags='$yaccflags'
22545 : Add in command line options if available
22546 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
22548 : add special variables
22549 $test -f $src/patchlevel.h && \
22550 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
22551 echo "PERL_PATCHLEVEL=$perl_patchlevel" >>config.sh
22552 echo "PERL_CONFIG_SH=true" >>config.sh
22554 : propagate old symbols
22555 if $test -f UU/config.sh; then
22556 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
22557 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
22558 $sort | $uniq -u >UU/oldsyms
22559 set X `cat UU/oldsyms`
22565 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
22567 echo "# Variables propagated from previous config.sh file." >>config.sh
22568 for sym in `cat UU/oldsyms`; do
22569 echo " Propagating $hint variable "'$'"$sym..."
22570 eval 'tmp="$'"${sym}"'"'
22572 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
22578 : Finish up by extracting the .SH files
22582 echo "Extraction done."
22592 If you'd like to make any changes to the config.sh file before I begin
22593 to configure things, do it as a shell escape now (e.g. !vi config.sh).
22596 rp="Press return or use a shell escape to edit config.sh:"
22601 *) : in case they cannot read
22602 sh 1>&4 -c "$ans";;
22607 : if this fails, just run all the .SH files by hand
22616 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
22623 Now you need to generate make dependencies by running "$make depend".
22624 You might prefer to run it in background: "$make depend > makedepend.out &"
22625 It can take a while, so you might not want to run it right now.
22630 rp="Run $make depend now?"
22634 $make depend && echo "Now you must run '$make'."
22637 echo "You must run '$make depend' then '$make'."
22640 elif test -f [Mm]akefile; then
22642 echo "Now you must run a $make."
22644 echo "Configure done."
22647 if $test -f Policy.sh; then
22650 If you compile $package on a different machine or from a different object
22651 directory, copy the Policy.sh file from this object directory to the
22652 new one before you run Configure -- this will help you with most of
22653 the policy defaults.
22657 if $test -f config.msg; then
22658 echo "Hmm. I also noted the following information while running:"
22660 $cat config.msg >&4
22663 $rm -f kit*isdone ark*isdone