3 # If these # comments don't work, trim them. Don't worry about any other
4 # shell scripts, Configure will trim # comments from them for you.
6 # (If you are trying to port this package to a machine without sh,
7 # I would suggest you have a look at the prototypical config_h.SH file
8 # and edit it to reflect your system. Some packages may include samples
9 # of config.h for certain machines, so you might look for one of those.)
11 # Yes, you may rip this off to use in other distribution packages. This
12 # script belongs to the public domain and cannot be copyrighted.
14 # (Note: this Configure script was generated automatically. Rather than
15 # working with this copy of Configure, you may wish to get metaconfig.
16 # The dist-3.0 package (which contains metaconfig) was posted in
17 # comp.sources.misc and is available on CPAN under authors/id/RAM so
18 # you may fetch it yourself from your nearest archive site.)
21 # Though this script was generated by metaconfig, it is OK to send
22 # patches against it. It's up to the Configure pumpkin to backport
23 # the patch to the metaunits if it is accepted.
24 # See Porting/pumpkin.pod for more information on metaconfig.
27 # $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $
29 # Generated on Sat Dec 29 15:53:27 CET 2007 [metaconfig 3.0 PL70]
30 # (with additional metaconfig patches by perlbug@perl.org)
35 SCO csh still thinks true is false. Write to SCO today and tell them that next
36 year Configure ought to "rm /bin/csh" unless they fix their blasted shell. :-)
38 (Actually, Configure ought to just patch csh in place. Hmm. Hmmmmm. All
39 we'd have to do is go in and swap the && and || tokens, wherever they are.)
41 [End of diatribe. We now return you to your regularly scheduled programming...]
45 OOPS! You naughty creature! You didn't run Configure with sh!
46 I will attempt to remedy the situation by running sh for you...
50 true || exec sh $0 $argv:q
52 (exit $?0) || cat c2$$
53 (exit $?0) || exec sh $0 $argv:q
56 if test -f /dev/cputype -a -f /dev/drivers -a -f /dev/osversion; then
59 *** I'm sorry but this system looks like Plan 9 and Plan 9 doesn't do
60 *** Configure that well. (Plan 9 is close to UNIX but not close enough.)
61 *** Please read the README.plan9 for further instructions.
62 *** Cannot continue, aborting.
68 if test ! -c /dev/null ; then
71 *** I'm sorry, but /dev/null appears to be a file rather than a device.
72 *** Please consult your operating sytem's notes for making a device
74 *** Cannot continue, aborting.
80 : compute my invocation name
84 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
89 : Proper separator for the PATH environment variable
91 : On OS/2 this directory should exist if this is not floppy only system :-]
92 if test -d c:/. || ( uname -a | grep -i 'os\(/\|\)2' ) 2>&1 >/dev/null ; then
93 if test -n "$OS2_SHELL"; then
95 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
96 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
98 elif test -n "$DJGPP"; then
99 case "X${MACHTYPE:-nonesuchmach}" in
106 : Proper PATH setting
107 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
108 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
109 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
110 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
111 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
112 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /opt/ansic/bin /usr/ccs/bin"
113 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
114 paths="$paths /sbin /usr/sbin /usr/libexec"
115 paths="$paths /system/gnu_library/bin"
119 case "$p_$PATH$p_" in
121 *) test -d $p && PATH=$PATH$p_$p ;;
128 : shall we be using ksh?
134 if (PATH=.; alias -x) >/dev/null 2>&1; then
137 if test -f /hp-ux -a -f /bin/ksh; then
138 needksh='to avoid sh bug in "here document" expansion'
140 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
141 if test X`/usr/bin/uname -v` = X4; then
142 avoidksh="to avoid AIX 4's /bin/sh"
146 if test -f /osf_boot -a -f /usr/sbin/setld; then
147 if test X`/usr/bin/uname -s` = XOSF1; then
148 avoidksh="to avoid Digital UNIX' ksh"
150 unset BIN_SH # if this is 'xpg4' sh will start up ksh
153 case "$inksh/$needksh" in
160 case "$inksh/$avoidksh" in
166 case "$inksh/$needksh-$avoidksh-" in
169 (I see you are using the Korn shell. Some ksh's blow up on $me,
170 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
177 echo "(Feeding myself to $newsh $reason.)"
179 Configure|*/Configure) exec $newsh $0 "$@";;
180 *) exec $newsh Configure "$@";;
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=''
946 d_inc_version_list=''
948 inc_version_list_init=''
967 ignore_versioned_solibs=''
1031 d_perl_otherlibdirs=''
1039 api_versionstring=''
1045 version_patchlevel_string=''
1049 d_nv_preserves_uv=''
1050 d_nv_zero_is_allbits_zero=''
1061 nv_preserves_uv_bits=''
1133 installsitehtml1dir=''
1136 installsitehtml3dir=''
1143 installsiteman1dir=''
1146 installsiteman3dir=''
1151 installsitescript=''
1166 d_stdio_stream_array=''
1167 stdio_stream_array=''
1178 ccflags_uselargefiles=''
1179 ldflags_uselargefiles=''
1180 libswanted_uselargefiles=''
1200 installvendorarch=''
1207 installvendorhtml1dir=''
1209 vendorhtml1direxp=''
1210 installvendorhtml3dir=''
1212 vendorhtml3direxp=''
1218 installvendorman1dir=''
1221 installvendorman3dir=''
1228 installvendorscript=''
1240 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1243 : We must find out about Eunice early
1245 if test -f /etc/unixtovms; then
1246 eunicefix=/etc/unixtovms
1248 if test -f /etc/unixtovms.exe; then
1249 eunicefix=/etc/unixtovms.exe
1252 : Set executable suffix now -- needed before hints available
1253 if test -f "/libs/version.library"; then
1256 elif test -f "/system/gnu_library/bin/ar.pm"; then
1259 elif test -n "$DJGPP"; then
1262 elif test -d c:/. -o -n "$is_os2" ; then
1268 : Trailing extension. Override this in a hint file, if needed.
1269 : Extra object files, if any, needed on this platform.
1274 : change the next line if compiling for Xenix/286 on Xenix/386
1275 xlibpth='/usr/lib/386 /lib/386'
1276 : Possible local library directories to search.
1277 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1278 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1280 : general looking path for locating libraries
1281 glibpth="/lib /usr/lib $xlibpth"
1282 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1283 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1284 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1285 test -d /usr/lib64 && glibpth="$glibpth /lib64 /usr/lib64 /usr/local/lib64"
1287 : Private path used by Configure to find libraries. Its value
1288 : is prepended to libpth. This variable takes care of special
1289 : machines, like the mips. Usually, it should be empty.
1292 : default library list
1294 : some systems want to use only the non-versioned libso:s
1295 ignore_versioned_solibs=''
1299 : set usethreads on the Configure command line to enable threads.
1300 usereentrant='undef'
1301 : full support for void wanted by default
1304 : Possible local include directories to search.
1305 : Set locincpth to "" in a hint file to defeat local include searches.
1306 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1307 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1309 : no include file wanted by default
1312 : Enable -DEBUGGING and -DDEBUGGING from the command line
1319 : set useposix=false in your hint file to disable the POSIX extension.
1321 : set useopcode=false in your hint file to disable the Opcode extension.
1324 ccflags_uselargefiles=''
1325 ldflags_uselargefiles=''
1326 libswanted_uselargefiles=''
1327 : set usemultiplicity on the Configure command line to enable multiplicity.
1328 : set usesocks on the Configure command line to enable socks.
1329 : List of libraries we want.
1330 : If anyone needs extra -lxxx, put those in a hint file.
1331 libswanted="sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun"
1332 libswanted="$libswanted m crypt sec util c cposix posix ucb bsd BSD"
1333 : We probably want to search /usr/shlib before most other libraries.
1334 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1335 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1336 glibpth="/usr/shlib $glibpth"
1337 : Do not use vfork unless overridden by a hint file.
1340 : Find the basic shell for Bourne shell scripts
1344 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1347 if test -f "$xxx"; then
1350 : Build up a list and do a single loop so we can 'break' out.
1351 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1352 for xxx in sh bash ksh pdksh ash; do
1354 try="$try ${p}/${xxx}"
1358 if test -f "$xxx"; then
1361 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1364 elif test -f "$xxx.exe"; then
1375 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1377 Usually it's in /bin/sh. How did you even get this far?
1378 Please contact me (Perl Maintainers) at perlbug@perl.org and
1379 we'll try to straighten this all out.
1385 : see if sh knows # comments
1386 if `$sh -c '#' >/dev/null 2>&1`; then
1390 test -f $xcat$_exe || xcat=/usr/bin/cat
1391 if test ! -f $xcat$_exe; then
1392 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1393 if test -f $p/cat$_exe; then
1398 if test ! -f $xcat$_exe; then
1399 echo "Can't find cat anywhere!"
1403 echo "#!$xcat" >sharp
1407 if test -s today; then
1410 echo "#! $xcat" > sharp
1414 if test -s today; then
1422 echo "Your $sh doesn't grok # comments--I will strip them later on."
1425 echo "exec grep -v '^[ ]*#'" >spitshell
1427 $eunicefix spitshell
1428 spitshell=`pwd`/spitshell
1430 echo "I presume that if # doesn't work, #! won't work either!"
1435 : figure out how to guarantee sh startup
1437 '') startsh=${sharpbang}${sh} ;;
1449 : echo "Yup, it does."
1451 echo "Hmm... '$startsh' does not guarantee sh startup..."
1452 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1457 : Save command line options in file UU/cmdline.opt for later use in
1458 : generating config.sh.
1459 cat > cmdline.opt <<EOSH
1460 # Configure command line arguments.
1469 cat >>cmdline.opt <<EOSH
1470 config_arg$argn='$arg'
1472 # Extreme backslashitis: replace each ' by '"'"'
1473 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1476 arg_exp=`cat cmdl.opt`
1477 args_exp="$args_exp$args_sep'$arg_exp'"
1478 argn=`expr $argn + 1`
1481 # args_exp is good for restarting self: eval "set X $args_exp"; shift; $0 "$@"
1482 # used by ./hints/os2.sh
1485 : produce awk script to parse command line options
1486 cat >options.awk <<'EOF'
1488 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1490 len = length(optstr);
1491 for (i = 1; i <= len; i++) {
1492 c = substr(optstr, i, 1);
1493 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1504 if (substr(str, 1, 1) != "-") {
1505 printf("'%s'\n", str);
1509 for (i = 2; i <= len; i++) {
1510 c = substr(str, i, 1);
1512 printf("-%s\n", substr(str, i));
1518 printf("'%s'\n", substr(str, i + 1));
1531 : process the command line options
1532 set X `for arg in "$@"; do echo "X$arg"; done |
1533 sed -e s/X// | awk -f options.awk`
1538 : set up default values
1548 rm -f optdef.sh posthint.sh
1549 cat >optdef.sh <<EOS
1555 while test $# -gt 0; do
1557 -d) shift; fastread=yes;;
1558 -e) shift; alldone=cont;;
1562 if test -r "$1"; then
1565 echo "$me: cannot read config file $1." >&2
1571 -h) shift; error=true;;
1572 -r) shift; reuseval=true;;
1573 -s) shift; silent=true; realsilent=true;;
1574 -E) shift; alldone=exit;;
1575 -K) shift; knowitall=true;;
1576 -O) shift; override=true;;
1577 -S) shift; silent=true; extractsh=true;;
1582 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1583 echo "$me: ignoring -D $1" >&2
1586 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1587 *) echo "$1='define'" >> optdef.sh;;
1594 *=) echo "$1" >> optdef.sh;;
1596 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1597 echo "$me: ignoring -U $1" >&2
1599 *) echo "$1='undef'" >> optdef.sh;;
1610 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1614 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1615 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1621 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1622 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1623 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1624 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1625 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1626 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1632 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1634 echo "$yyy=''" >> posthint.sh ;;
1639 echo "$yyy='$zzz'" >> posthint.sh ;;
1641 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1643 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1648 echo "$yyy=$zzz" >> posthint.sh ;;
1649 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1653 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1656 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1664 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1665 [-U symbol] [-U symbol=] [-A command:symbol...]
1666 -d : use defaults for all answers.
1667 -e : go on without questioning past the production of config.sh.
1668 -f : specify an alternate default configuration file.
1669 -h : print this help message and exit (with an error status).
1670 -r : reuse C symbols value if possible (skips costly nm extraction).
1671 -s : silent mode, only echoes questions and essential information.
1672 -D : define symbol to have some value:
1673 -D symbol symbol gets the value 'define'
1674 -D symbol=value symbol gets the value 'value'
1675 common used examples (see INSTALL for more info):
1676 -Duse64bitint use 64bit integers
1677 -Duse64bitall use 64bit integers and pointers
1678 -Dusethreads use thread support
1679 -Dinc_version_list=none do not include older perl trees in @INC
1680 -DEBUGGING=none DEBUGGING options
1681 -Dcc=gcc choose your compiler
1682 -Dprefix=/opt/perl5 choose your destination
1683 -E : stop at the end of questions, after having produced config.sh.
1684 -K : do not use unless you know what you are doing.
1685 -O : let -D and -U override definitions from loaded configuration file.
1686 -S : perform variable substitutions on all .SH files (can mix with -f)
1687 -U : undefine symbol:
1688 -U symbol symbol gets the value 'undef'
1689 -U symbol= symbol gets completely empty
1691 -A : manipulate symbol after the platform specific hints have been applied:
1692 -A append:symbol=value append value to symbol
1693 -A symbol=value like append:, but with a separating space
1694 -A define:symbol=value define symbol to have value
1695 -A clear:symbol define symbol to be ''
1696 -A define:symbol define symbol to be 'define'
1697 -A eval:symbol=value define symbol to be eval of value
1698 -A prepend:symbol=value prepend value to symbol
1699 -A undef:symbol define symbol to be 'undef'
1700 -A undef:symbol= define symbol to be ''
1701 e.g.: -A prepend:libswanted='cl pthread '
1702 -A ccflags=-DSOME_MACRO
1703 -V : print version number and exit (with a zero status).
1710 case "$fastread$alldone" in
1713 case "$extractsh" in
1716 if test ! -t 0; then
1717 echo "Say 'sh Configure', not 'sh <Configure'"
1727 true) exec 1>/dev/null;;
1730 : run the defines and the undefines, if any, but leave the file out there...
1733 : create the posthint manipulation script and leave the file out there...
1738 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1739 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1740 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1741 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1742 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1745 : Some greps do not return status, grrr.
1746 echo "grimblepritz" >grimble
1747 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1749 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1755 : the following should work in any shell
1759 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1760 cat >contains <<'EOSS'
1761 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1766 : Find the path to the source tree
1769 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1773 *) src=`cd ../$src && pwd` ;;
1786 if test -f $rsrc/Configure && \
1787 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1789 : found it, so we are ok.
1792 for src in . .. ../.. ../../.. ../../../..; do
1793 if test -f ../$src/Configure && \
1794 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1805 Sorry, I can't seem to locate the source dir for $package. Please start
1806 Configure with an explicit path -- i.e. /some/path/Configure.
1814 echo "Sources for $package found in \"$src\"." >&4
1818 : script used to extract .SH files with variable substitutions
1819 cat >extract <<'EOS'
1821 echo "Doing variable substitutions on .SH files..."
1822 if test -f MANIFEST; then
1823 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1825 echo "(Looking for .SH files under the source directory.)"
1826 set x `(cd "$src"; find . -name "*.SH" -print)`
1830 0) set x `(cd "$src"; echo *.SH)`; shift;;
1832 if test ! -f "$src/$1"; then
1838 while test $name; do
1839 if test ! -d "$name"; then
1840 create="$name $create";
1841 name=`echo $name | sed -e "s|^[^/]*$||"`;
1842 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1847 for file in $create; do
1856 dir=`expr X$file : 'X\(.*\)/'`
1857 file=`expr X$file : 'X.*/\(.*\)'`
1858 (cd "$dir" && . ./$file)
1868 dir=`expr X$file : 'X\(.*\)/'`
1869 file=`expr X$file : 'X.*/\(.*\)'`
1870 (set x $dir; shift; eval $mkdir_p)
1871 sh <"$src/$dir/$file"
1880 if test -f "$src/config_h.SH"; then
1881 if test ! -f config.h; then
1882 : oops, they left it out of MANIFEST, probably, so do it anyway.
1883 . "$src/config_h.SH"
1888 : extract files and exit if asked to do so
1889 case "$extractsh" in
1891 case "$realsilent" in
1895 case "$config_sh" in
1896 '') config_sh='config.sh';;
1899 echo "Fetching answers from $config_sh..."
1902 test "$override" && . ./optdef.sh
1906 echo "Extraction done."
1911 : Eunice requires " " instead of "", can you believe it
1914 echo "Beginning of configuration questions for $package."
1916 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1918 : first determine how to suppress newline on echo command
1920 echo "Checking echo to see how to suppress newlines..."
1921 (echo "hi there\c" ; echo " ") >.echotmp
1922 if $contains c .echotmp >/dev/null 2>&1 ; then
1933 echo $n "The star should be here-->$c"
1937 : Now test for existence of everything in MANIFEST
1939 if test -f "$rsrc/MANIFEST"; then
1940 echo "First let's make sure your kit is complete. Checking..." >&4
1941 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | (split -l 50 2>/dev/null || split -50)
1944 for filelist in x??; do
1945 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` >/dev/null 2>>"$tmppwd/missing")
1947 if test -s missing; then
1951 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1953 You have the option of continuing the configuration process, despite the
1954 distinct possibility that your kit is damaged, by typing 'y'es. If you
1955 do, don't blame me if something goes wrong. I advise you to type 'n'o
1956 and contact the author (perlbug@perl.org).
1959 echo $n "Continue? [n] $c" >&4
1963 echo "Continuing..." >&4
1967 echo "ABORTING..." >&4
1972 echo "Looks good..."
1975 echo "There is no MANIFEST file. I hope your kit is complete !"
1980 : Find the appropriate value for a newline for tr
1981 if test -n "$DJGPP"; then
1984 if test X"$trnl" = X; then
1985 case "`echo foo|tr '\n' x 2>/dev/null`" in
1989 if test X"$trnl" = X; then
1990 case "`echo foo|tr '\012' x 2>/dev/null`" in
1991 foox) trnl='\012' ;;
1994 if test X"$trnl" = X; then
1995 case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
1996 fooxy) trnl='\n\r' ;;
1999 if test X"$trnl" = X; then
2002 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
2008 : compute the number of columns on the terminal for proper question formatting
2013 : set up the echo used in my read
2014 myecho="case \"\$xxxm\" in
2015 '') echo $n \"\$rp $c\" >&4;;
2017 '') echo $n \"[\$xxxm] $c\";;
2019 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
2021 echo $n \"[\$xxxm] $c\" >&4
2023 echo $n \"\$rp [\$xxxm] $c\" >&4
2029 : now set up to do reads with possible shell escape and default assignment
2035 case "\$fastread" in
2036 yes) case "\$dflt" in
2039 case "\$silent-\$rp" in
2044 *) case "\$silent" in
2045 true) case "\$rp" in
2050 while expr "X\$ans" : "X!" >/dev/null; do
2054 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2062 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2071 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2076 echo "(OK, I'll run with -d after this question.)" >&4
2079 echo "*** Sorry, \$1 not supported yet." >&4
2089 echo "*** Substitution done -- please confirm."
2091 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2096 echo "*** Error -- try again."
2103 case "\$ans\$xxxm\$nostick" in
2115 : create .config dir to save info across Configure sessions
2116 test -d ../.config || mkdir ../.config
2117 cat >../.config/README <<EOF
2118 This directory created by Configure to save information that should
2119 persist across sessions for $package.
2121 You may safely delete it if you wish.
2124 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2126 $define|true|[yY]*) ;;
2127 *) case "$xversion" in
2130 *** WHOA THERE!!! ***
2132 This is an UNSTABLE DEVELOPMENT release.
2133 The version of this $package distribution is $xversion, that is, odd,
2134 (as opposed to even) and that signifies a development release.
2135 If you want a maintenance release, you want an even-numbered version.
2137 Do ***NOT*** install this into production use.
2138 Data corruption and crashes are possible.
2140 It is most seriously suggested that you do not continue any further
2141 unless you want to help in developing and debugging Perl.
2143 If you *still* want to build perl, you can answer 'y' now,
2144 or pass -Dusedevel to Configure.
2147 rp='Do you really want to continue?'
2151 [yY]) echo >&4 "Okay, continuing."
2152 usedevel="$define" ;;
2153 *) echo >&4 "Okay, bye."
2163 case "$versiononly" in
2164 '') versiononly="$define" ;;
2166 case "$installusrbinperl" in
2167 '') installusrbinperl="$undef" ;;
2172 : general instructions
2175 user=`(logname) 2>/dev/null`
2177 '') user=`whoami 2>&1`;;
2179 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2182 rp='Would you like to see the instructions?'
2193 This installation shell script will examine your system and ask you questions
2194 to determine how the perl5 package should be installed. If you get
2195 stuck on a question, you may use a ! shell escape to start a subshell or
2196 execute a command. Many of the questions will have default answers in square
2197 brackets; typing carriage return will give you the default.
2199 On some of the questions which ask for file or directory names you are allowed
2200 to use the ~name construct to specify the login directory belonging to "name",
2201 even if you don't have a shell which knows about that. Questions where this is
2202 allowed will be marked "(~name ok)".
2206 dflt='Type carriage return to continue'
2210 The prompter used in this script allows you to use shell variables and
2211 backticks in your answers. You may use $1, $2, etc... to refer to the words
2212 in the default answer, as if the default line was a set of arguments given to a
2213 script shell. This means you may also use $* to repeat the whole default line,
2214 so you do not have to re-type everything to add something to the default.
2216 Everytime there is a substitution, you will have to confirm. If there is an
2217 error (e.g. an unmatched backtick), the default answer will remain unchanged
2218 and you will be prompted again.
2220 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2221 the questions and use the computed defaults (or the previous answers if there
2222 was already a config.sh file). Type 'Configure -h' for a list of options.
2223 You may also start interactively and then answer '& -d' at any prompt to turn
2224 on the non-interactive behaviour for the remainder of the execution.
2230 Much effort has been expended to ensure that this shell script will run on any
2231 Unix system. If despite that it blows up on yours, your best bet is to edit
2232 Configure and run it again. If you can't run Configure for some reason,
2233 you'll have to generate a config.sh file by hand. Whatever problems you
2234 have, let me (perlbug@perl.org) know how I blew it.
2236 This installation script affects things in two ways:
2238 1) it may do direct variable substitutions on some of the files included
2240 2) it builds a config.h file for inclusion in C programs. You may edit
2241 any of these files as the need arises after running this script.
2243 If you make a mistake on a question, there is no easy way to back up to it
2244 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2245 files. Configure will offer to let you do this before it runs the SH files.
2248 dflt='Type carriage return to continue'
2250 case "$firsttime" in
2251 true) echo $user >>../.config/instruct;;
2255 : find out where common programs are
2257 echo "Locating common programs..." >&4
2270 if test -d \$dir/\$thing; then
2276 for thisthing in \$dir/\$thing; do
2277 : just loop through to pick last item
2279 if test -f \$thisthing; then
2282 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2285 elif test -f \$dir/\$thing.exe; then
2286 if test -n "$DJGPP"; then
2287 echo \$dir/\$thing.exe
2288 elif test "$eunicefix" != ":"; then
2289 : on Eunice apparently
2343 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2344 pth="$pth /lib /usr/lib"
2345 for file in $loclist; do
2349 if test -f "$xxx"; then
2352 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2353 xxx=`./loc $file $file $pth`
2356 '') xxx=`./loc $file $file $pth`;;
2357 *) xxx=`./loc $xxx $xxx $pth`;;
2359 eval $file=$xxx$_exe
2363 echo $file is in $xxx.
2366 echo $file is in $xxx.
2369 echo "I don't know where '$file' is, and my life depends on it." >&4
2370 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2376 echo "Don't worry if any of the following aren't found..."
2378 for file in $trylist; do
2382 if test -f "$xxx"; then
2385 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2386 xxx=`./loc $file $file $pth`
2389 '') xxx=`./loc $file $file $pth`;;
2390 *) xxx=`./loc $xxx $xxx $pth`;;
2392 eval $file=$xxx$_exe
2396 echo $file is in $xxx.
2399 echo $file is in $xxx.
2402 echo "I don't see $file out there, $say."
2409 echo "Substituting grep for egrep."
2416 echo "Substituting cp for ln."
2425 echo "I can't find make or gmake, and my life depends on it." >&4
2426 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2434 *) # We can't have osname yet.
2435 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2436 # Assume that gmake, if found, is definitely GNU make
2437 # and prefer it over the system make.
2438 echo "Substituting gmake for make."
2446 echo "Hopefully test is built into your sh."
2449 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2450 echo "Using the test built into your sh."
2458 echo "Hopefully echo is built into your sh."
2463 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2464 $echo $n "hi there$c" >foo1
2465 echo $n "hi there$c" >foo2
2466 if cmp foo1 foo2 >/dev/null 2>&1; then
2467 echo "They are compatible. In fact, they may be identical."
2474 They are not compatible! You are probably running ksh on a non-USG system.
2475 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2476 have echo built in and we may have to run some Bourne shell scripts. That
2477 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2480 $echo $n "The star should be here-->$c"
2487 # This question was auctioned at YAPC::Europe-2007 in Vienna
2488 # I never promised you could answer it. I only auctioned the question.
2490 The following message is sponsored by
2492 Dresden.pm<--The stars should be here.
2494 Dear Perl user, system administrator or package
2495 maintainer, the Perl community sends greetings to
2496 you. Do you (emblematical) greet back [Y/n]? n
2503 cat <<'EOSC' >>trygcc
2508 int main(int argc, char *argv[]) {
2512 if $cc -o try $ccflags $ldflags try.c; then
2515 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2521 # Skip this test because it gives a false match on output like:
2522 # ./trygcc: line 23: cc: command not found
2523 # case "`$cc -v -c try.c 2>&1`" in
2524 # *gcc*) trygcc=no ;;
2526 if $test X"$trygcc" = Xyes; then
2527 if gcc -o try -c try.c; then
2529 echo "You seem to have a working gcc, though." >&4
2530 # Switching compilers may undo the work of hints files.
2531 # The most common problem is -D_REENTRANT for threads.
2532 # This heuristic catches that case, but gets false positives
2533 # if -Dusethreads was not actually specified. Better to
2534 # bail out here with a useful message than fail
2535 # mysteriously later. Should we perhaps just try to
2536 # re-invoke Configure -Dcc=gcc config_args ?
2537 if $test -f usethreads.cbu; then
2540 *** However, any setting of the C compiler flags (e.g. for thread support)
2541 *** will be lost. It may be necessary for you to restart Configure and
2542 *** add -Dcc=gcc to your Configure command line.
2545 rp="Would you like to go ahead and try gcc anyway?"
2548 rp="Would you like to use it?"
2551 if $test -f myread; then
2554 if $test -f UU/myread; then
2557 echo "Cannot find myread, sorry. Aborting." >&2
2562 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2575 cat <<'EOSC' >>checkcc
2580 int main(int argc, char *argv[]) {
2584 if $cc -o try $ccflags $ldflags try.c; then
2587 if $test X"$despair" = Xyes; then
2588 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2591 You need to find a working C compiler.
2592 Either (purchase and) install the C compiler supplied by your OS vendor,
2593 or for a free C compiler try http://gcc.gnu.org/
2594 I cannot continue any further, aborting.
2603 : determine whether symbolic links are supported
2606 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2607 echo "Symbolic links are supported." >&4
2610 echo "Symbolic links are NOT supported." >&4
2615 : determine whether symbolic links are supported
2619 echo "Checking how to test for symbolic links..." >&4
2621 if $test "X$issymlink" = X; then
2623 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2624 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2626 if test $? = 0; then
2629 echo "Your builtin 'test -h' may be broken." >&4
2632 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2635 if test -f "$p/$test"; then
2644 echo "Trying external '$test -h'." >&4
2645 issymlink="$test -h"
2646 if $test ! -h sym >/dev/null 2>&1; then
2647 echo "External '$test -h' is broken, too." >&4
2655 if $test "X$issymlink" = X; then
2656 if $test -L sym 2>/dev/null; then
2657 issymlink="$test -L"
2658 echo "The builtin '$test -L' worked." >&4
2661 if $test "X$issymlink" != X; then
2662 echo "You can test for symbolic links with '$issymlink'." >&4
2664 echo "I do not know how you can test for symbolic links." >&4
2668 *) echo "No symbolic links, so not testing for their testing..." >&4
2674 case "$mksymlinks" in
2677 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2680 *) case "$lns:$issymlink" in
2681 *"ln"*" -s:"*"test -"?)
2682 echo "Creating the symbolic links..." >&4
2683 echo "(First creating the subdirectories...)" >&4
2685 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2687 test -z "$directory" && break
2691 if test ! -d t/base; then
2692 echo "Failed to create the subdirectories. Aborting." >&4
2695 echo "(Then creating the symlinks...)" >&4
2696 awk '{print $1}' $src/MANIFEST | while true; do
2698 test -z "$filename" && break
2699 if test -f $filename; then
2700 if $issymlink $filename; then
2704 if test -f $filename; then
2705 echo "$filename already exists, not symlinking."
2707 ln -s $src/$filename $filename
2711 if test ! -f t/base/lex.t; then
2712 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2717 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2726 case "$usecrosscompile" in
2728 $echo "Cross-compiling..."
2731 *-*-gcc) # A cross-compiling gcc, probably.
2732 targetarch=`$echo $cc|$sed 's/-gcc$//'`
2734 # leave out ld, choosing it is more complex
2736 ranlib=$targetarch-ranlib
2737 $echo 'extern int foo;' > try.c
2738 set X `$cc -v -E try.c 2>&1 | $awk '/^#include </,/^End of search /'|$grep '/include'`
2740 if $test $# -gt 0; then
2742 incpth="`$echo $incpth|$sed 's/^ //'`"
2743 echo "Guessing incpth '$incpth'." >&4
2745 j="`$echo $i|$sed 's,/include$,/lib,'`"
2746 if $test -d $j; then
2750 libpth="`$echo $libpth|$sed 's/^ //'`"
2751 echo "Guessing libpth '$libpth'." >&4
2756 case "$targetarch" in
2757 '') echo "Targetarch not defined." >&4; croak=y ;;
2758 *) echo "Using targetarch $targetarch." >&4 ;;
2761 '') echo "Incpth not defined." >&4; croak=y ;;
2762 *) echo "Using incpth '$incpth'." >&4 ;;
2765 '') echo "Libpth not defined." >&4; croak=y ;;
2766 *) echo "Using libpth '$libpth'." >&4 ;;
2769 '') for i in $incpth; do
2770 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
2772 echo "Guessing usrinc $usrinc." >&4
2777 '') echo "Usrinc not defined." >&4; croak=y ;;
2780 *) echo "Using usrinc $usrinc." >&4 ;;
2782 case "$targethost" in
2783 '') echo "Targethost not defined." >&4; croak=y ;;
2784 *) echo "Using targethost $targethost." >&4
2789 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2792 /*) run=$src/Cross/run
2793 targetmkdir=$src/Cross/mkdir
2795 from=$src/Cross/from
2797 *) pwd=`$test -f ../Configure & cd ..; pwd`
2799 targetmkdir=$pwd/Cross/mkdir
2801 from=$pwd/Cross/from
2804 case "$targetrun" in
2805 '') targetrun=ssh ;;
2810 case "$targetfrom" in
2811 '') targetfrom=scp ;;
2815 from=$from-$targetfrom
2816 case "$targetdir" in
2818 echo "Guessing targetdir $targetdir." >&4
2821 case "$targetuser" in
2823 echo "Guessing targetuser $targetuser." >&4
2826 case "$targetfrom" in
2830 case "$targetrun" in
2842 '') cwd=$targetdir ;;
2846 if $test ! -f \$exe.xok; then
2850 $targetrun -l $targetuser $targethost "cd \$cwd && ./\$exe \$@"
2853 *) echo "Unknown targetrun '$targetrun'" >&4
2857 case "$targetmkdir" in
2859 cat >$targetmkdir <<EOF
2861 $targetrun -l $targetuser $targethost "mkdir -p \$@"
2863 $chmod a+rx $targetmkdir
2865 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
2877 $targetmkdir \`dirname \$f\`
2878 $targetto $q \$f $targetuser@$targethost:\$f || exit 1
2881 $targetmkdir $targetdir/\`dirname \$f\`
2882 $targetto $q \$f $targetuser@$targethost:$targetdir/\$f || exit 1
2895 $mkdir -p $targetdir/\`dirname \$f\`
2896 $cp \$f $targetdir/\$f || exit 1
2899 $targetmkdir $targetdir/\`dirname \$f\`
2900 $cp \$f $targetdir/\$f || exit 1
2907 *) echo "Unknown targetto '$targetto'" >&4
2911 case "$targetfrom" in
2918 $targetfrom $q $targetuser@$targethost:$targetdir/\$f . || exit 1
2923 cp) cat >$from <<EOF
2928 cp $targetdir/\$f . || exit 1
2933 *) echo "Unknown targetfrom '$targetfrom'" >&4
2937 if $test ! -f $run; then
2938 echo "Target 'run' script '$run' not found." >&4
2942 if $test ! -f $to; then
2943 echo "Target 'to' script '$to' not found." >&4
2947 if $test ! -f $from; then
2948 echo "Target 'from' script '$from' not found." >&4
2952 if $test ! -f $run -o ! -f $to -o ! -f $from; then
2956 Using '$run' for remote execution,
2957 and '$from' and '$to'
2958 for remote file transfer.
2964 usecrosscompile='undef'
2969 : see whether [:lower:] and [:upper:] are supported character classes
2971 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2973 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2977 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
2978 # (0xd9 and 0xe2), therefore that is a nice testing point.
2979 if test "X$up" = X -o "X$low" = X; then
2980 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
2986 if test "X$up" = X -o "X$low" = X; then
2987 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
2993 if test "X$up" = X -o "X$low" = X; then
2994 case "`echo RS | od -x 2>/dev/null`" in
2996 echo "Hey, this might be EBCDIC." >&4
2997 if test "X$up" = X -o "X$low" = X; then
2998 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2999 rs) up='[A-IJ-RS-Z]'
3004 if test "X$up" = X -o "X$low" = X; then
3005 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
3015 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
3017 echo "Using $up and $low to convert case." >&4
3020 echo "I don't know how to translate letters from upper to lower case." >&4
3021 echo "Your tr is not acting any way I know of." >&4
3025 : set up the translation script tr, must be called with ./tr of course
3029 '[A-Z][a-z]') exec $tr '$up' '$low';;
3030 '[a-z][A-Z]') exec $tr '$low' '$up';;
3037 : Try to determine whether config.sh was made on this system
3038 case "$config_sh" in
3040 myuname=`$uname -a 2>/dev/null`
3041 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
3042 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
3043 # because the A-Z/a-z are not consecutive.
3044 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e "s,['/],,g" | \
3045 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
3046 newmyuname="$myuname"
3048 case "$knowitall" in
3050 if test -f ../config.sh; then
3051 if $contains myuname= ../config.sh >/dev/null 2>&1; then
3052 eval "`grep myuname= ../config.sh`"
3054 if test "X$myuname" = "X$newmyuname"; then
3062 : Get old answers from old config file if Configure was run on the
3063 : same system, otherwise use the hints.
3066 if test -f config.sh; then
3068 rp="I see a config.sh file. Shall I use it to set the defaults?"
3071 n*|N*) echo "OK, I'll ignore it."
3072 mv config.sh config.sh.old
3073 myuname="$newmyuname"
3075 *) echo "Fetching default answers from your old config.sh file..." >&4
3083 : Older versions did not always set $sh. Catch re-use of such
3093 if test ! -f config.sh; then
3096 First time through, eh? I have some defaults handy for some systems
3097 that need some extra help getting the Configure answers right:
3100 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3102 : Half the following guesses are probably wrong... If you have better
3103 : tests or hints, please send them to perlbug@perl.org
3104 : The metaconfig authors would also appreciate a copy...
3105 $test -f /irix && osname=irix
3106 $test -f /xenix && osname=sco_xenix
3107 $test -f /dynix && osname=dynix
3108 $test -f /dnix && osname=dnix
3109 $test -f /lynx.os && osname=lynxos
3110 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3111 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3112 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3113 $test -f /bin/mips && /bin/mips && osname=mips
3114 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
3115 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
3116 $test -d /usr/apollo/bin && osname=apollo
3117 $test -f /etc/saf/_sactab && osname=svr4
3118 $test -d /usr/include/minix && osname=minix
3119 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3120 if $test -d /MachTen -o -d /MachTen_Folder; then
3122 if $test -x /sbin/version; then
3123 osvers=`/sbin/version | $awk '{print $2}' |
3124 $sed -e 's/[A-Za-z]$//'`
3125 elif $test -x /usr/etc/version; then
3126 osvers=`/usr/etc/version | $awk '{print $2}' |
3127 $sed -e 's/[A-Za-z]$//'`
3133 $test -f /sys/posix.dll &&
3134 $test -f /usr/bin/what &&
3135 set X `/usr/bin/what /sys/posix.dll` &&
3136 $test "$3" = UWIN &&
3140 if $test -f $uname; then
3148 umips) osname=umips ;;
3151 [23]100) osname=mips ;;
3152 next*) osname=next ;;
3154 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3155 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3158 elif $test -f /etc/kconfig; then
3160 if test "$lns" = "$ln -s"; then
3162 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3164 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3171 if test -n "$DJGPP"; then
3180 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3182 # oslevel can fail with:
3183 # oslevel: Unable to acquire lock.
3184 *not\ found) osvers="$4"."$3" ;;
3185 '<3240'|'<>3240') osvers=3.2.0 ;;
3186 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3187 '=3250'|'>3250') osvers=3.2.5 ;;
3191 bsd386) osname=bsd386
3194 cygwin*) osname=cygwin
3197 *dc.osx) osname=dcosx
3203 domainos) osname=apollo
3209 dragonfly) osname=dragonfly
3212 dynixptx*) osname=dynixptx
3213 osvers=`echo "$4"|sed 's/^v//'`
3215 freebsd) osname=freebsd
3217 genix) osname=genix ;;
3221 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3237 netbsd*) osname=netbsd
3240 news-os) osvers="$3"
3242 4*) osname=newsos4 ;;
3246 next*) osname=next ;;
3247 nonstop-ux) osname=nonstopux ;;
3248 openbsd) osname=openbsd
3254 POSIX-BC | posix-bc ) osname=posix-bc
3257 powerux | power_ux | powermax_os | powermaxos | \
3258 powerunix | power_unix) osname=powerux
3264 solaris) osname=solaris
3266 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3273 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3277 titanos) osname=titanos
3286 ultrix) osname=ultrix
3289 osf1|mls+) case "$5" in
3292 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3295 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3298 hp*) osname=hp_osf1 ;;
3299 mips) osname=mips_osf1 ;;
3302 # UnixWare 7.1.2 is known as Open UNIX 8
3303 openunix|unixware) osname=svr5
3311 $2) case "$osname" in
3315 : svr4.x or possibly later
3325 if test -f /stand/boot ; then
3326 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3327 if test -n "$INITPROG" -a -f "$INITPROG"; then
3328 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3329 if test -n "$isesix"; then
3337 *) if test -f /etc/systemid; then
3339 set `echo $3 | $sed 's/\./ /g'` $4
3340 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3342 elif $test -f $src/hints/sco_$1_$2.sh; then
3344 elif $test -f $src/hints/sco_$1.sh; then
3349 '') : Still unknown. Probably a generic Sys V.
3358 *) case "$osname" in
3359 '') : Still unknown. Probably a generic BSD.
3367 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3368 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3369 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3372 $rm -f UU/kernel.what
3373 elif test -d c:/. -o -n "$is_os2" ; then
3380 case "$targetarch" in
3383 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3388 : Now look for a hint file osname_osvers, unless one has been
3389 : specified already.
3392 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3393 : Also try without trailing minor version numbers.
3394 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3395 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3396 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3397 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3400 *) case "$osvers" in
3403 *) if $test -f $src/hints/$file.sh ; then
3405 elif $test -f $src/hints/$xfile.sh ; then
3407 elif $test -f $src/hints/$xxfile.sh ; then
3409 elif $test -f $src/hints/$xxxfile.sh ; then
3411 elif $test -f $src/hints/$xxxxfile.sh ; then
3413 elif $test -f "$src/hints/${osname}.sh" ; then
3422 if $test -f Policy.sh ; then
3425 none) dflt="Policy" ;;
3426 *) dflt="Policy $dflt" ;;
3431 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3435 if $test -f Policy.sh ; then
3438 There's also a Policy hint file available, which should make the
3439 site-specific (policy) questions easier to answer.
3446 You may give one or more space-separated answers, or "none" if appropriate.
3447 If you have a handcrafted Policy.sh file or a Policy.sh file generated by a
3448 previous run of Configure, you may specify it as well as or instead of
3449 OS-specific hints. If hints are provided for your OS, you should use them:
3450 although Perl can probably be built without hints on many platforms, using
3451 hints often improve performance and may enable features that Configure can't
3452 set up on its own. If there are no hints that match your OS, specify "none";
3453 DO NOT give a wrong version or a wrong OS.
3457 rp="Which of these apply, if any?"
3460 for file in $tans; do
3461 if $test X$file = XPolicy -a -f Policy.sh; then
3463 $cat Policy.sh >> UU/config.sh
3464 elif $test -f $src/hints/$file.sh; then
3465 . $src/hints/$file.sh
3466 $cat $src/hints/$file.sh >> UU/config.sh
3467 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3470 : Give one chance to correct a possible typo.
3471 echo "$file.sh does not exist"
3473 rp="hint to use instead?"
3475 for file in $ans; do
3476 if $test -f "$src/hints/$file.sh"; then
3477 . $src/hints/$file.sh
3478 $cat $src/hints/$file.sh >> UU/config.sh
3479 elif $test X$ans = X -o X$ans = Xnone ; then
3482 echo "$file.sh does not exist -- ignored."
3489 : Remember our hint file for later.
3490 if $test -f "$src/hints/$file.sh" ; then
3500 echo "Fetching default answers from $config_sh..." >&4
3504 cp $config_sh config.sh 2>/dev/null
3514 test "$override" && . ./optdef.sh
3516 : Restore computed paths
3517 for file in $loclist $trylist; do
3518 eval $file="\$_$file"
3523 Configure uses the operating system name and version to set some defaults.
3524 The default value is probably right if the name rings a bell. Otherwise,
3525 since spelling matters for me, either accept the default or answer "none"
3532 ''|' '|none) dflt=none ;;
3533 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3536 *) dflt="$osname" ;;
3538 rp="Operating system name?"
3542 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3548 ''|' '|none) dflt=none ;;
3549 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3550 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3552 ''|' ') dflt=none ;;
3557 *) dflt="$osvers" ;;
3559 rp="Operating system version?"
3569 : who configured the system
3570 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3573 cf_by=`(logname) 2>/dev/null`
3576 cf_by=`(whoami) 2>/dev/null`
3578 "") cf_by=unknown ;;
3583 : decide how portable to be. Allow command line overrides.
3584 case "$d_portable" in
3586 *) d_portable="$define" ;;
3589 : set up shell script to do ~ expansion
3595 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3598 if $test -f /bin/csh; then
3599 /bin/csh -f -c "glob \$1"
3604 name=\`$expr x\$1 : '..\([^/]*\)'\`
3605 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3606 if $test ! -d "\$dir"; then
3608 echo "\$me: can't locate home directory for: \$name" >&2
3613 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3629 : now set up to get a file name
3633 cat <<'EOSC' >>getfile
3649 : getfile will accept an answer from the comma-separated list
3650 : enclosed in parentheses even if it does not meet other criteria.
3651 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3652 fn=`echo $fn | sed 's/(.*)//'`
3658 loc_file=`expr $fn : '.*:\(.*\)'`
3659 fn=`expr $fn : '\(.*\):.*'`
3667 */*) fullpath=true;;
3676 *e*) exp_file=true;;
3679 *p*) nopath_ok=true;;
3684 *d*) type='Directory';;
3685 *l*) type='Locate';;
3690 Locate) what='File';;
3695 case "$d_portable" in
3703 while test "$type"; do
3708 true) rp="$rp (~name ok)";;
3711 if test -f UU/getfile.ok && \
3712 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3731 value=`UU/filexp $ans`
3734 if test "$ans" != "$value"; then
3735 echo "(That expands to $value on this system.)"
3749 /*) value="$ansexp" ;;
3750 [a-zA-Z]:/*) value="$ansexp" ;;
3755 echo "I shall only accept a full path name, as in /bin/ls." >&4
3756 echo "Use a ! shell escape if you wish to check pathnames." >&4
3759 echo "Please give a full path name, starting with slash." >&4
3762 echo "Note that using ~name is ok provided it expands well." >&4
3775 for fp in $gfpth; do
3776 if test "X$fp" = X.; then
3781 if test -f "$pf"; then
3783 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3785 echo "($value is not a plain file, but that's ok.)"
3788 if test X"$type" = X; then
3795 for fp in $gfpth; do
3796 if test "X$fp" = X.; then
3801 direxp="$fp/$ansexp"
3803 if test -d "$direxp"; then
3811 if test -d "$ansexp"; then
3812 echo "(Looking for $loc_file in directory $value.)"
3813 value="$value/$loc_file"
3814 ansexp="$ansexp/$loc_file"
3816 if test -f "$ansexp"; then
3819 case "$nopath_ok" in
3820 true) case "$value" in
3822 *) echo "Assuming $value will be in people's path."
3838 if test "$fastread" = yes; then
3843 rp="$what $value doesn't exist. Use that name anyway?"
3862 test "X$gfpthkeep" != Xy && gfpth=""
3865 : determine root of directory hierarchy where package will be installed.
3868 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
3871 dflt=`echo "$prefix" | sed 's/.$//'`
3879 By default, $package will be installed in $dflt/bin, manual pages
3880 under $dflt/man, etc..., i.e. with $dflt as prefix for all
3881 installation directories. Typically this is something like /usr/local.
3882 If you wish to have binaries under /usr/bin but other parts of the
3883 installation under /usr/local, that's ok: you will be prompted
3884 separately for each of the installation directories, the prefix being
3885 only used to set the defaults.
3889 rp='Installation prefix to use?'
3897 *) oldprefix="$prefix";;
3906 *) afsroot=$afsroot ;;
3912 $define|true) afs=true ;;
3913 $undef|false) afs=false ;;
3914 *) if test -d $afsroot; then
3922 echo "AFS may be running... I'll be extra cautious then..." >&4
3924 echo "AFS does not seem to be running..." >&4
3927 : determine installation prefix for where package is to be installed.
3931 Since you are running AFS, I need to distinguish the directory in which
3932 files will reside from the directory in which they are installed (and from
3933 which they are presumably copied to the former directory by occult means).
3936 case "$installprefix" in
3937 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
3938 *) dflt="$installprefix";;
3943 In some special cases, particularly when building $package for distribution,
3944 it is convenient to distinguish the directory in which files should be
3945 installed from the directory ($prefix) in which they will
3946 eventually reside. For most users, these two directories are the same.
3949 case "$installprefix" in
3951 *) dflt=$installprefix;;
3955 rp='What installation prefix should I use for installing files?'
3957 installprefix="$ans"
3958 installprefixexp="$ansexp"
3960 : Perform the prefixexp/installprefixexp correction if necessary
3961 cat <<EOS >installprefix
3964 cat <<'EOSC' >>installprefix
3965 : Change installation prefix, if necessary.
3966 if $test X"$prefix" != X"$installprefix"; then
3967 eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`"
3969 eval "install${prefixvar}=\"\$${prefixvar}exp\""
3972 chmod +x installprefix
3973 $eunicefix installprefix
3975 : Set variables such as privlib and privlibexp from the output of ./getfile
3976 : performing the prefixexp/installprefixexp correction if necessary.
3977 cat <<EOS >setprefixvar
3980 cat <<'EOSC' >>setprefixvar
3981 eval "${prefixvar}=\"\$ans\""
3982 eval "${prefixvar}exp=\"\$ansexp\""
3985 chmod +x setprefixvar
3986 $eunicefix setprefixvar
3988 : set up the script used to warn in case of inconsistency
3997 '') echo "The $hint value for \$$var on this machine was \"$was\"!" >&4
3999 *) echo "Hmm. Based on the hints in hints/$hintfile.sh, " >&4
4000 echo "the $hint value for \$$var on this machine was \"$was\"!" >&4
4005 echo "*** WHOA THERE!!! ***" >&4
4006 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
4009 rp=" Keep the $hint value?"
4012 y) td=$was; tu=$was;;
4016 : function used to set $1 to $val
4017 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
4019 $define$undef) . ./whoa; eval "$var=\$td";;
4020 $undef$define) . ./whoa; eval "$var=\$tu";;
4021 *) eval "$var=$val";;
4025 $define|true|[yY]*) dflt='y';;
4030 Perl can be built to use the SOCKS proxy protocol library. To do so,
4031 Configure must be run with -Dusesocks. If you use SOCKS you also need
4032 to use the PerlIO abstraction layer, this will be implicitly selected.
4034 If this doesn't make any sense to you, just accept the default '$dflt'.
4036 rp='Build Perl for SOCKS?'
4039 y|Y) val="$define" ;;
4046 $define|true|[yY]*) useperlio="$define";;
4049 case "$useperlio" in
4050 $define|true|[yY]*|'') dflt='y';;
4055 Previous version of $package used the standard IO mechanisms as
4056 defined in <stdio.h>. Versions 5.003_02 and later of $package allow
4057 alternate IO mechanisms via the PerlIO abstraction layer, but the
4058 stdio mechanism is still available if needed. The abstraction layer
4059 can use AT&T's sfio (if you already have sfio installed) or regular stdio.
4060 Using PerlIO with sfio may cause problems with some extension modules.
4062 If this doesn't make any sense to you, just accept the default '$dflt'.
4064 rp='Use the PerlIO abstraction layer?'
4071 echo "Ok, doing things the stdio way."
4080 case "$useperlio" in
4081 $define|true|[yY]*) ;;
4084 You are using the SOCKS proxy protocol library which means that you
4085 should also use the PerlIO layer. You may be headed for trouble.
4094 : get the patchlevel
4096 echo "Getting the current patchlevel..." >&4
4097 if $test -r $rsrc/patchlevel.h;then
4098 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
4099 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
4100 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4101 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
4102 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
4103 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4104 perl_patchlevel=`egrep ',"(MAINT|SMOKE)[0-9][0-9]*"' $rsrc/patchlevel.h|tail -1|sed 's/[^0-9]//g'`
4113 $echo "(You do not have patchlevel.h. Eek.)"
4115 if $test -r $rsrc/.patch ; then
4116 if $test "X$perl_patchlevel" = "X" || $test "`cat $rsrc/.patch`" -gt "$perl_patchlevel" ; then
4117 perl_patchlevel=`cat $rsrc/.patch`
4120 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
4121 version_patchlevel_string="version $patchlevel subversion $subversion"
4122 case "$perl_patchlevel" in
4124 *) version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel" ;;
4127 $echo "(You have $package $version_patchlevel_string.)"
4131 : XXX Should be a Configure test for double-dots in filenames.
4132 version=`echo $revision $patchlevel $subversion | \
4133 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4134 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4135 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4138 version=`echo $revision $patchlevel $subversion | \
4139 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4140 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4141 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4144 : Special case the 5.005_xx maintenance series, which used 5.005
4145 : without any subversion label as a subdirectory in $sitelib
4146 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
4147 api_versionstring='5.005'
4150 case "$usethreads" in
4151 $define|true|[yY]*) dflt='y';;
4152 *) # Catch case where user specified ithreads or 5005threads but
4153 # forgot -Dusethreads (A.D. 4/2002)
4154 case "$useithreads$use5005threads" in
4156 case "$useperlio" in
4157 "$define") dflt='y' ;;
4167 Perl can be built to take advantage of threads on some systems.
4168 To do so, Configure can be run with -Dusethreads.
4170 Note that Perl built with threading support runs slightly slower
4171 and uses more memory than plain Perl. The current implementation
4172 is believed to be stable, but it is fairly new, and so should be
4173 treated with caution.
4175 If this doesn't make any sense to you, just accept the default '$dflt'.
4177 rp='Build a threading Perl?'
4180 y|Y) val="$define" ;;
4186 if $test $patchlevel -lt 9; then
4187 case "$usethreads" in
4191 Since release 5.6, Perl has had two different threading implementations,
4192 the newer interpreter-based version (ithreads) with one interpreter per
4193 thread, and the older 5.005 version (5005threads).
4194 The 5005threads version is effectively unmaintained and will probably be
4195 removed in Perl 5.10, so there should be no need to build a Perl using it
4196 unless needed for backwards compatibility with some existing 5.005threads
4200 : Default to ithreads unless overridden on command line or with
4203 case "$use5005threads" in
4204 $define|true|[yY]*) dflt='n';;
4206 case "$useithreads" in
4207 $undef|false|[nN]*) dflt='n';;
4209 rp='Use the newer interpreter-based ithreads?'
4212 y|Y) val="$define" ;;
4217 : Now set use5005threads to the opposite value.
4218 case "$useithreads" in
4219 $define) val="$undef" ;;
4226 useithreads="$undef"
4227 use5005threads="$undef"
4231 case "$useithreads$use5005threads" in
4235 You cannot have both the ithreads and the 5.005 threads enabled
4236 at the same time. Disabling the 5.005 threads since they are
4237 much less stable than the ithreads.
4240 use5005threads="$undef"
4245 : perl-5.9.x and later
4247 if test X"$usethreads" = "X$define"; then
4248 case "$use5005threads" in
4252 5.005 threads has been removed for 5.10. Perl will be built using ithreads.
4259 use5005threads="$undef"
4260 useithreads="$usethreads"
4263 if test X"$usethreads" = "X$define" -a "X$useperlio" = "Xundef"; then
4266 *** To build with ithreads you must also use the PerlIO layer.
4267 *** Cannot continue, aborting.
4273 case "$d_oldpthreads" in
4274 '') : Configure tests would be welcome here. For now, assume undef.
4276 *) val="$d_oldpthreads" ;;
4282 : Look for a hint-file generated 'call-back-unit'. If the
4283 : user has specified that a threading perl is to be built,
4284 : we may need to set or change some other defaults.
4285 if $test -f usethreads.cbu; then
4286 echo "Your platform has some specific hints regarding threaded builds, using them..."
4289 case "$usethreads" in
4290 "$define"|true|[yY]*)
4292 (Your platform does not have any specific hints for threaded builds.
4293 Assuming POSIX threads, then.)
4301 Perl can be built so that multiple Perl interpreters can coexist
4302 within the same Perl executable.
4305 case "$useithreads" in
4308 This multiple interpreter support is required for interpreter-based threads.
4312 *) case "$usemultiplicity" in
4313 $define|true|[yY]*) dflt='y';;
4317 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
4318 rp='Build Perl for multiplicity?'
4321 y|Y) val="$define" ;;
4330 case "$usemorebits" in
4331 "$define"|true|[yY]*)
4332 use64bitint="$define"
4333 uselongdouble="$define"
4334 usemorebits="$define"
4336 *) usemorebits="$undef"
4340 : make some quick guesses about what we are up against
4342 $echo $n "Hmm... $c"
4352 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
4353 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
4355 echo "Looks kind of like an OSF/1 system, but we'll see..."
4357 elif test `echo abc | $tr a-z A-Z` = Abc ; then
4358 xxx=`./loc addbib blurfl $pth`
4359 if $test -f $xxx; then
4360 echo "Looks kind of like a USG system with BSD features, but we'll see..."
4364 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
4365 echo "Looks kind of like an extended USG system, but we'll see..."
4367 echo "Looks kind of like a USG system, but we'll see..."
4371 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
4372 echo "Looks kind of like a BSD system, but we'll see..."
4376 echo "Looks kind of like a Version 7 system, but we'll see..."
4379 case "$eunicefix" in
4382 There is, however, a strange, musty smell in the air that reminds me of
4383 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
4387 : it so happens the Eunice I know will not run shell scripts in Unix format
4391 echo "Congratulations. You aren't running Eunice."
4395 : Detect OS2. The p_ variable is set above in the Head.U unit.
4396 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
4397 : semicolon as a patch separator
4402 I have the feeling something is not exactly right, however...don't tell me...
4403 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
4404 (Or you may be running DOS with DJGPP.)
4409 if test -f /xenix; then
4410 echo "Actually, this looks more like a XENIX system..."
4415 echo "It's not Xenix..."
4420 if test -f /venix; then
4421 echo "Actually, this looks more like a VENIX system..."
4428 echo "Nor is it Venix..."
4431 chmod +x bsd usg v7 osf1 eunice xenix venix os2
4432 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
4439 rp="Use which C compiler?"
4443 : See if they have not cc but they do have gcc
4445 : Look for a hint-file generated 'call-back-unit'. Now that the
4446 : user has specified the compiler, we may need to set or change some
4448 if $test -f cc.cbu; then
4454 echo "Checking for GNU cc in disguise and/or its version number..." >&4
4458 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
4460 printf("%s\n", __VERSION__);
4462 printf("%s\n", "1");
4468 if $cc -o try $ccflags $ldflags try.c; then
4469 gccversion=`$run ./try`
4470 case "$gccversion" in
4471 '') echo "You are not using GNU cc." ;;
4472 *) echo "You are using GNU cc $gccversion."
4478 echo "*** WHOA THERE!!! ***" >&4
4479 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
4480 case "$knowitall" in
4482 echo " You'd better start hunting for one and let me know about it." >&4
4488 case "$gccversion" in
4489 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
4491 case "$gccversion" in
4492 '') gccosandvers='' ;;
4493 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
4494 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
4496 case "$gccosandvers" in
4497 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
4498 $osname$osvers) ;; # looking good
4499 $osname*) cat <<EOM >&4
4501 *** WHOA THERE!!! ***
4503 Your gcc has not been compiled for the exact release of
4504 your operating system ($gccosandvers versus $osname$osvers).
4506 In general it is a good idea to keep gcc synchronized with
4507 the operating system because otherwise serious problems
4508 may ensue when trying to compile software, like Perl.
4510 I'm trying to be optimistic here, though, and will continue.
4511 If later during the configuration and build icky compilation
4512 problems appear (headerfile conflicts being the most common
4513 manifestation), I suggest reinstalling the gcc to match
4514 your operating system release.
4518 *) gccosandvers='' ;; # failed to parse, better be silent
4526 # gcc 3.* complain about adding -Idirectories that they already know about,
4527 # so we will take those off from locincpth.
4528 case "$gccversion" in
4530 echo "main(){}">try.c
4531 for incdir in $locincpth; do
4532 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
4533 grep '^c[cp]p*[01]: warning: changing search order '`
4534 if test "X$warn" != X; then
4535 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
4541 : What should the include directory be ?
4543 $echo $n "Hmm... $c"
4547 if $test -f /bin/mips && /bin/mips; then
4548 echo "Looks like a MIPS system..."
4549 $cat >usr.c <<'EOCP'
4550 #ifdef SYSTYPE_BSD43
4554 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4555 dflt='/bsd43/usr/include'
4559 mips_type='System V'
4561 $rm -f usr.c usr.out
4562 echo "and you're compiling with the $mips_type compiler and libraries."
4566 echo "Doesn't look like a MIPS system."
4576 case "$xxx_prompt" in
4579 rp='Where are the include files you want to use?'
4587 : see how we invoke the C preprocessor
4589 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4590 cat <<'EOT' >testcpp.c
4596 if test ! -f cppstdin; then
4597 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4598 # AIX cc -E doesn't show the absolute headerfile
4599 # locations but we'll cheat by using the -M flag.
4600 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
4602 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4605 echo "Keeping your $hint cppstdin wrapper."
4608 wrapper=`pwd`/cppstdin
4612 if $test "X$cppstdin" != "X" && \
4613 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4614 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4616 echo "You used to use $cppstdin $cppminus so we'll use that again."
4618 '') echo "But let's see if we can live without a wrapper..." ;;
4620 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4621 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4623 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4626 echo "(However, $cpprun $cpplast does not work, let's see...)"
4634 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4641 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4642 $cc -E <testcpp.c >testcpp.out 2>&1; \
4643 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4644 echo "Yup, it does."
4647 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4648 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4649 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4650 echo "Yup, it does."
4653 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4654 $cc -P <testcpp.c >testcpp.out 2>&1; \
4655 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4656 echo "Yipee, that works!"
4659 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4660 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4661 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4662 echo "At long last!"
4665 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4666 $cpp <testcpp.c >testcpp.out 2>&1; \
4667 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4671 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4672 $cpp - <testcpp.c >testcpp.out 2>&1; \
4673 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4674 echo "Hooray, it works! I was beginning to wonder."
4677 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4678 $wrapper <testcpp.c >testcpp.out 2>&1; \
4679 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4685 rp="No dice. I can't find a C preprocessor. Name one:"
4689 $x_cpp <testcpp.c >testcpp.out 2>&1
4690 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4691 echo "OK, that will do." >&4
4693 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4708 echo "Perhaps can we force $cc -E using a wrapper..."
4709 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4710 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4716 echo "Nope, we'll have to live without it..."
4730 "$wrapper"|'cppstdin') ;;
4731 *) $rm -f $wrapper;;
4733 $rm -f testcpp.c testcpp.out
4735 : Set private lib path
4738 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4743 '') dlist="$loclibpth $plibpth $glibpth";;
4744 *) dlist="$libpth";;
4747 : Now check and see which directories actually exist, avoiding duplicates
4751 if $test -d $xxx; then
4754 *) libpth="$libpth $xxx";;
4760 Some systems have incompatible or broken versions of libraries. Among
4761 the directories listed in the question below, please remove any you
4762 know not to be holding relevant libraries, and add any that are needed.
4763 Say "none" for none.
4774 rp="Directories to use for library searches?"
4781 : compute shared library extension
4784 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4794 On some systems, shared libraries may be available. Answer 'none' if
4795 you want to suppress searching of shared libraries for the remainder
4796 of this configuration.
4799 rp='What is the file extension used for shared libraries?'
4803 : Define several unixisms.
4804 : Hints files or command line option can be used to override them.
4805 : The convoluted testing is in case hints files set either the old
4808 '') case "$exe_ext" in
4810 *) _exe="$exe_ext" ;;
4815 '') case "$lib_ext" in
4822 '') case "$obj_ext" in
4829 '') case "$path_sep" in
4840 rm_try="$rm -f try try$_exe a.out .out try.[cho] try.$_o core core.try* try.core*"
4842 : Which makefile gets called first. This is used by make depend.
4843 case "$firstmakefile" in
4844 '') firstmakefile='makefile';;
4848 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
4851 case "$uselongdouble" in
4852 $define|true|[yY]*) dflt='y';;
4857 Perl can be built to take advantage of long doubles which
4858 (if available) may give more accuracy and range for floating point numbers.
4860 If this doesn't make any sense to you, just accept the default '$dflt'.
4862 rp='Try to use long doubles if available?'
4865 y|Y) val="$define" ;;
4871 case "$uselongdouble" in
4872 true|[yY]*) uselongdouble="$define" ;;
4875 : Look for a hint-file generated 'call-back-unit'. If the
4876 : user has specified that long doubles should be used,
4877 : we may need to set or change some other defaults.
4878 if $test -f uselongdouble.cbu; then
4879 echo "Your platform has some specific hints regarding long doubles, using them..."
4880 . ./uselongdouble.cbu
4882 case "$uselongdouble" in
4885 (Your platform does not have any specific hints for long doubles.)
4891 : Looking for optional libraries
4893 echo "Checking for optional libraries..." >&4
4898 case "$libswanted" in
4899 '') libswanted='c_s';;
4902 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
4908 for thisdir in $libpth $xlibpth; do
4909 test -d $thisdir && libspath="$libspath $thisdir"
4911 for thislib in $libswanted; do
4912 for thisdir in $libspath; do
4914 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4915 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
4916 $test -f "$xxx" && eval $libscheck
4917 $test -f "$xxx" && libstyle=shared
4919 if test ! -f "$xxx"; then
4920 xxx=$thisdir/lib$thislib.$so
4921 $test -f "$xxx" && eval $libscheck
4922 $test -f "$xxx" && libstyle=shared
4924 if test ! -f "$xxx"; then
4925 xxx=$thisdir/lib$thislib$_a
4926 $test -f "$xxx" && eval $libscheck
4927 $test -f "$xxx" && libstyle=static
4929 if test ! -f "$xxx"; then
4930 xxx=$thisdir/$thislib$_a
4931 $test -f "$xxx" && eval $libscheck
4932 $test -f "$xxx" && libstyle=static
4934 if test ! -f "$xxx"; then
4935 xxx=$thisdir/lib${thislib}_s$_a
4936 $test -f "$xxx" && eval $libscheck
4937 $test -f "$xxx" && libstyle=static
4938 $test -f "$xxx" && thislib=${thislib}_s
4940 if test ! -f "$xxx"; then
4941 xxx=$thisdir/Slib$thislib$_a
4942 $test -f "$xxx" && eval $libscheck
4943 $test -f "$xxx" && libstyle=static
4945 if $test -f "$xxx"; then
4947 shared) echo "Found -l$thislib (shared)." ;;
4948 static) echo "Found -l$thislib." ;;
4949 *) echo "Found -l$thislib ($libstyle)." ;;
4953 *) dflt="$dflt -l$thislib"
4954 libsfound="$libsfound $xxx"
4956 libsfiles="$libsfiles $yyy"
4957 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
4958 case " $libsdirs " in
4960 *) libsdirs="$libsdirs $yyy" ;;
4967 if $test ! -f "$xxx"; then
4968 echo "No -l$thislib."
4979 ' '|'') dflt='none';;
4984 In order to compile $package on your machine, a number of libraries
4985 are usually needed. Include any other special libraries here as well.
4986 Say "none" for none. The default list is almost always right.
4990 rp="What libraries to use?"
4997 : determine optimization, if desired, or use for debug flag also
4999 ' '|$undef) dflt='none';;
5001 *) dflt="$optimize";;
5005 By default, $package compiles with the -O flag to use the optimizer.
5006 Alternately, you might want to use the symbolic debugger, which uses
5007 the -g flag (on traditional Unix systems). Either flag can be
5008 specified here. To use neither flag, specify the word "none".
5011 rp="What optimizer/debugger flag should be used?"
5015 'none') optimize=" ";;
5018 : Check what DEBUGGING is required from the command line
5019 : -DEBUGGING or -DDEBUGGING or
5020 : -DEBUGGING=both = -g + -DDEBUGGING
5021 : -DEBUGGING=-g or -Doptimize=-g = -g
5022 : -DEBUGGING=none or -UDEBUGGING =
5023 : -DEBUGGING=old or -DEBUGGING=default = ? $optimize
5026 *) DEBUGGING=$EBUGGING ;;
5029 case "$DEBUGGING" in
5033 *) optimize="$optimize -g" ;;
5037 *-g*) set `echo "X $optimize " | sed 's/ -g / /'`
5045 case "$DEBUGGING" in
5046 both|$define) dflt='-DDEBUGGING'
5049 : argument order is deliberate, as the flag will start with - which set could
5050 : think is an option
5051 checkccflag='check=$1; flag=$2; callback=$3;
5053 echo "Checking if your compiler accepts $flag" 2>&1;
5054 echo "int main(void) { return 0; }" > gcctest.c;
5055 if $cc -O2 $flag -o gcctest gcctest.c && ./gcctest; then
5056 echo "Yes, it does." 2>&1;
5059 echo "Leaving current flags $ccflags alone." 2>&1
5061 *) dflt="$dflt $flag";
5066 echo "Nope, it does not, but that is ok." 2>&1;
5070 : We will not override a previous value, but we might want to
5071 : augment a hint file
5073 default|recommended)
5074 case "$gccversion" in
5075 1*) dflt="$dflt -fpcc-struct-return" ;;
5077 case "$optimize:$DEBUGGING" in
5078 *-g*:old) dflt="$dflt -DDEBUGGING";;
5080 case "$gccversion" in
5081 2*) if test -d /etc/conf/kconfig.d &&
5082 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
5084 # Interactive Systems (ISC) POSIX mode.
5089 case "$gccversion" in
5092 ?*) set strict-aliasing -fno-strict-aliasing
5096 # For gcc, adding -pipe speeds up compilations for some, but apparently
5097 # some assemblers can't read from stdin. (It also slows down compilations
5098 # in other cases, but those are apparently rarer these days.) AD 5/2004.
5099 case "$gccversion" in
5105 # on x86_64 (at least) we require an extra library (libssp) in the
5106 # link command line. This library is not named, so I infer that it is
5107 # an implementation detail that may change. Hence the safest approach
5108 # is to add the flag to the flags passed to the compiler at link time,
5109 # as that way the compiler can do the right implementation dependant
5111 case "$gccversion" in
5112 ?*) set stack-protector -fstack-protector 'ldflags="$ldflags -fstack-protector"'
5119 case "$mips_type" in
5120 *BSD*|'') inclwanted="$locincpth $usrinc";;
5121 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
5123 for thisincl in $inclwanted; do
5124 if $test -d $thisincl; then
5125 if $test x$thisincl != x$usrinc; then
5127 *" -I$thisincl "*);;
5128 *) dflt="$dflt -I$thisincl ";;
5134 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
5136 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
5144 *) dflt="$dflt -D$2";;
5148 set signal.h LANGUAGE_C; eval $inctest
5152 ccflags="$ccflags -DSOCKS"
5157 default|recommended) dflt="$ccflags $dflt" ;;
5158 *) dflt="$ccflags";;
5167 Your C compiler may want other flags. For this question you should include
5168 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
5169 but you should NOT include libraries or ld flags like -lwhatever. If you
5170 want $package to honor its debug switch, you should include -DDEBUGGING here.
5171 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
5173 To use no flags, specify the word "none".
5179 rp="Any additional cc flags?"
5186 : the following weeds options from ccflags that are of no interest to cpp
5188 '') cppflags="$ccflags" ;;
5189 *) cppflags="$cppflags $ccflags" ;;
5191 case "$gccversion" in
5192 1*) cppflags="$cppflags -D__GNUC__"
5194 case "$mips_type" in
5196 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
5202 echo "Let me guess what the preprocessor flags are..." >&4
5216 *) ftry="$previous $flag";;
5218 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
5219 >cpp1.out 2>/dev/null && \
5220 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
5221 >cpp2.out 2>/dev/null && \
5222 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
5223 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
5225 cppflags="$cppflags $ftry"
5235 *-*) echo "They appear to be: $cppflags";;
5237 $rm -f cpp.c cpp?.out
5241 : flags used in final linking phase
5243 '') if ./venix; then
5249 *-posix*) dflt="$dflt -posix" ;;
5252 *) dflt="$ldflags";;
5255 : Try to guess additional flags to pick up local libraries.
5256 for thislibdir in $libpth; do
5257 case " $loclibpth " in
5260 *"-L$thislibdir "*) ;;
5261 *) dflt="$dflt -L$thislibdir" ;;
5273 Your C linker may need flags. For this question you should
5274 include -L/whatever and any other flags used by the C linker, but you
5275 should NOT include libraries like -lwhatever.
5277 Make sure you include the appropriate -L/path flags if your C linker
5278 does not normally search all of the directories you specified above,
5281 To use no flags, specify the word "none".
5285 rp="Any additional ld flags (NOT including libraries)?"
5291 rmlist="$rmlist pdp11"
5295 echo "Checking your choice of C compiler and flags for coherency..." >&4
5296 $cat > try.c <<'EOF'
5298 int main() { printf("Ok\n"); return(0); }
5300 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
5302 $cat >try.msg <<'EOM'
5303 I've tried to compile and run the following simple program:
5306 $cat try.c >> try.msg
5308 $cat >> try.msg <<EOM
5315 and I got the following output:
5319 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5320 if $sh -c "$run ./try" >>try.msg 2>&1; then
5324 *) echo 'The program compiled OK, but produced no output.' >> try.msg
5327 cat >> try.msg <<'EOQS'
5328 If $libs contains -lsfio, and sfio is mis-configured, then it
5329 sometimes (apparently) runs and exits with a 0 status, but with no
5330 output! It may have to do with sfio's use of _exit vs. exit.
5333 rp="You have a big problem. Shall I abort Configure"
5340 echo "The program compiled OK, but exited with status $?." >>try.msg
5341 rp="You have a problem. Shall I abort Configure"
5345 echo "I can't compile the test program." >>try.msg
5346 rp="You have a BIG problem. Shall I abort Configure"
5352 case "$knowitall" in
5354 echo "(The supplied flags or libraries might be incorrect.)"
5362 *) echo "Ok. Stopping Configure." >&4
5367 n) echo "OK, that should do.";;
5371 : define a shorthand compile call
5375 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5376 : define a shorthand compile call for compilations that should be ok.
5380 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5382 : determine filename position in cpp output
5384 echo "Computing filename position in cpp output for #include directives..." >&4
5386 vos) testaccess=-e ;;
5389 echo '#include <stdio.h>' > foo.c
5392 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5393 $grep '^[ ]*#.*stdio\.h' | \
5394 while read cline; do
5397 while $test \$# -gt 0; do
5398 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5403 pos=\`expr \$pos + 1\`
5415 *) pos="${fieldn}th";;
5417 echo "Your cpp writes the filename in the $pos field of the line."
5420 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
5421 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
5424 : locate header file
5429 for usrincdir in $usrinc
5431 if test -f \$usrincdir/\$wanted; then
5432 echo "\$usrincdir/\$wanted"
5436 awkprg='{ print \$$fieldn }'
5437 echo "#include <\$wanted>" > foo\$\$.c
5438 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5439 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5440 while read cline; do
5441 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5443 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5444 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5449 # status = 0: grep returned 0 lines, case statement not executed
5450 # status = 1: headerfile found
5451 # status = 2: while loop executed, no headerfile found
5455 if test \$status -eq 1; then
5462 : define an alternate in-header-list? function
5463 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5464 cont=true; xxf="echo \"<\$1> found.\" >&4";
5465 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5466 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5468 case $# in 4) instead=instead;; *) instead="at last";; esac;
5469 while $test "$cont"; do
5471 var=$2; eval "was=\$$2";
5472 if $test "$xxx" && $test -r "$xxx";
5474 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5477 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5478 set $yyy; shift; shift; yyy=$@;
5479 case $# in 0) cont="";;
5480 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5481 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5482 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5483 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5487 do set $yyy; var=$2; eval "was=\$$2";
5488 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5489 set $yyy; shift; shift; yyy=$@;
5492 : see if stdlib is available
5493 set stdlib.h i_stdlib
5496 : check for lengths of integral types
5500 echo "Checking to see how big your integers are..." >&4
5509 printf("intsize=%d;\n", (int)sizeof(int));
5510 printf("longsize=%d;\n", (int)sizeof(long));
5511 printf("shortsize=%d;\n", (int)sizeof(short));
5516 if eval $compile_ok && $run ./try > /dev/null; then
5518 echo "Your integers are $intsize bytes long."
5519 echo "Your long integers are $longsize bytes long."
5520 echo "Your short integers are $shortsize bytes long."
5524 Help! I can't compile and run the intsize test program: please enlighten me!
5525 (This is probably a misconfiguration in your system or libraries, and
5526 you really ought to fix it. Still, I'll try anyway.)
5530 rp="What is the size of an integer (in bytes)?"
5534 rp="What is the size of a long integer (in bytes)?"
5538 rp="What is the size of a short integer (in bytes)?"
5546 : check for long long
5548 echo "Checking to see if you have long long..." >&4
5549 echo 'int main() { long long x = 7; return 0; }' > try.c
5551 if eval $compile; then
5553 echo "You have long long."
5556 echo "You do not have long long."
5562 : check for length of long long
5563 case "${d_longlong}${longlongsize}" in
5566 echo "Checking to see how big your long longs are..." >&4
5567 $cat >try.c <<'EOCP'
5571 printf("%d\n", (int)sizeof(long long));
5576 if eval $compile_ok; then
5577 longlongsize=`$run ./try`
5578 echo "Your long longs are $longlongsize bytes long."
5582 echo "(I can't seem to compile the test program. Guessing...)"
5583 rp="What is the size of a long long (in bytes)?"
5587 if $test "X$longsize" = "X$longlongsize"; then
5588 echo "(That isn't any different from an ordinary long.)"
5594 : see if inttypes.h is available
5595 : we want a real compile instead of Inhdr because some systems
5596 : have an inttypes.h which includes non-existent headers
5599 #include <inttypes.h>
5601 static int32_t foo32 = 0x12345678;
5605 if eval $compile; then
5606 echo "<inttypes.h> found." >&4
5609 echo "<inttypes.h> NOT found." >&4
5618 echo "Checking to see if you have int64_t..." >&4
5620 #include <sys/types.h>
5621 #$i_inttypes I_INTTYPES
5623 #include <inttypes.h>
5625 int main() { int64_t x = 7; }
5628 if eval $compile; then
5630 echo "You have int64_t."
5633 echo "You do not have int64_t."
5641 echo "Checking which 64-bit integer type we could use..." >&4
5647 val='"unsigned int"'
5652 *) case "$longsize" in
5656 val='"unsigned long"'
5661 *) case "$d_longlong:$longlongsize" in
5666 val='"unsigned long long"'
5671 *) case "$d_int64_t" in
5690 '') echo "Alas, no 64-bit integer types in sight." >&4
5693 *) echo "We could use '$quadtype' for 64-bit integers." >&4
5699 case "$uselonglong" in
5700 "$define"|true|[yY]*)
5703 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
5705 use64bitint="$define"
5708 case "$use64bits" in
5709 "$define"|true|[yY]*)
5712 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
5714 use64bitint="$define"
5717 case "$use64bitints" in
5718 "$define"|true|[yY]*)
5721 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
5723 use64bitint="$define"
5726 case "$use64bitsint" in
5727 "$define"|true|[yY]*)
5730 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
5732 use64bitint="$define"
5735 case "$uselonglongs" in
5736 "$define"|true|[yY]*)
5739 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
5741 use64bitint="$define"
5744 case "$use64bitsall" in
5745 "$define"|true|[yY]*)
5748 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
5750 use64bitall="$define"
5755 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
5757 case "$use64bitall" in
5758 "$define"|true|[yY]*) use64bitint="$define" ;;
5764 You have natively 64-bit long integers.
5768 *) case "$use64bitint" in
5769 "$define"|true|[yY]*) dflt='y';;
5778 Perl can be built to take advantage of 64-bit integer types
5779 on some systems. To do so, Configure can be run with -Duse64bitint.
5780 Choosing this option will most probably introduce binary incompatibilities.
5782 If this doesn't make any sense to you, just accept the default '$dflt'.
5783 (The default has been chosen based on your configuration.)
5785 rp='Try to use 64-bit integers, if available?'
5788 [yY]*) val="$define" ;;
5796 case "$use64bitall" in
5797 "$define"|true|[yY]*) dflt='y' ;;
5798 *) case "$longsize" in
5806 You may also choose to try maximal 64-bitness. It means using as much
5807 64-bitness as possible on the platform. This in turn means even more
5808 binary incompatibilities. On the other hand, your platform may not
5809 have any more 64-bitness available than what you already have chosen.
5811 If this doesn't make any sense to you, just accept the default '$dflt'.
5812 (The default has been chosen based on your configuration.)
5814 rp='Try to use maximal 64-bit support, if available?'
5817 [yY]*) val="$define" ;;
5822 case "$use64bitall" in
5824 case "$use64bitint" in
5828 Since you have chosen a maximally 64-bit build, I'm also turning on
5829 the use of 64-bit integers.
5831 use64bitint="$define" ;;
5836 : Look for a hint-file generated 'call-back-unit'. If the
5837 : user has specified that a 64-bit perl is to be built,
5838 : we may need to set or change some other defaults.
5839 if $test -f use64bitint.cbu; then
5840 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
5843 case "$use64bitint" in
5844 "$define"|true|[yY]*)
5846 4) case "$archname64" in
5847 '') archname64=64int ;;
5854 : Look for a hint-file generated 'call-back-unit'. If the
5855 : user has specified that a maximally 64-bit perl is to be built,
5856 : we may need to set or change some other defaults.
5857 if $test -f use64bitall.cbu; then
5858 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
5861 case "$use64bitall" in
5862 "$define"|true|[yY]*)
5864 4) case "$archname64" in
5865 ''|64int) archname64=64all ;;
5872 case "$d_quad:$use64bitint" in
5876 *** You have chosen to use 64-bit integers,
5877 *** but none can be found.
5878 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
5879 *** Cannot continue, aborting.
5886 : check for length of double
5888 case "$doublesize" in
5890 echo "Checking to see how big your double precision numbers are..." >&4
5899 printf("%d\n", (int)sizeof(double));
5904 if eval $compile_ok; then
5905 doublesize=`$run ./try`
5906 echo "Your double is $doublesize bytes long."
5909 echo "(I can't seem to compile the test program. Guessing...)"
5910 rp="What is the size of a double precision number (in bytes)?"
5918 : check for long doubles
5920 echo "Checking to see if you have long double..." >&4
5921 echo 'int main() { long double x = 7.0; }' > try.c
5923 if eval $compile; then
5925 echo "You have long double."
5928 echo "You do not have long double."
5934 : check for length of long double
5935 case "${d_longdbl}${longdblsize}" in
5938 echo "Checking to see how big your long doubles are..." >&4
5939 $cat >try.c <<'EOCP'
5943 printf("%d\n", sizeof(long double));
5948 if eval $compile; then
5949 longdblsize=`$run ./try`
5950 echo "Your long doubles are $longdblsize bytes long."
5954 echo "(I can't seem to compile the test program. Guessing...)" >&4
5955 rp="What is the size of a long double (in bytes)?"
5959 if $test "X$doublesize" = "X$longdblsize"; then
5960 echo "That isn't any different from an ordinary double."
5961 echo "I'll keep your setting anyway, but you may see some"
5962 echo "harmless compilation warnings."
5968 : determine the architecture name
5970 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
5971 tarch=`arch`"-$osname"
5972 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
5973 if uname -m > tmparch 2>&1 ; then
5974 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
5975 -e 's/$/'"-$osname/" tmparch`
5983 case "$myarchname" in
5986 echo "(Your architecture name used to be $myarchname.)"
5990 case "$targetarch" in
5992 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
5997 *) dflt="$archname";;
5999 rp='What is your architecture name'
6002 case "$usethreads" in
6004 echo "Threads selected." >&4
6006 *-thread*) echo "...and architecture name already has -thread." >&4
6008 *) archname="$archname-thread"
6009 echo "...setting architecture name to $archname." >&4
6014 case "$usemultiplicity" in
6016 echo "Multiplicity selected." >&4
6018 *-multi*) echo "...and architecture name already has -multi." >&4
6020 *) archname="$archname-multi"
6021 echo "...setting architecture name to $archname." >&4
6026 case "$use64bitint$use64bitall" in
6028 case "$archname64" in
6030 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
6033 case "$use64bitint" in
6034 "$define") echo "64 bit integers selected." >&4 ;;
6036 case "$use64bitall" in
6037 "$define") echo "Maximal 64 bitness selected." >&4 ;;
6040 *-$archname64*) echo "...and architecture name already has $archname64." >&4
6042 *) archname="$archname-$archname64"
6043 echo "...setting architecture name to $archname." >&4
6049 case "$uselongdouble" in
6051 echo "Long doubles selected." >&4
6052 case "$longdblsize" in
6054 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
6058 *-ld*) echo "...and architecture name already has -ld." >&4
6060 *) archname="$archname-ld"
6061 echo "...setting architecture name to $archname." >&4
6068 case "$useperlio" in
6070 echo "Perlio selected." >&4
6073 echo "Perlio not selected, using stdio." >&4
6075 *-stdio*) echo "...and architecture name already has -stdio." >&4
6077 *) archname="$archname-stdio"
6078 echo "...setting architecture name to $archname." >&4
6083 if $test -f archname.cbu; then
6084 echo "Your platform has some specific hints for architecture name, using them..."
6088 : set the prefixit variable, to compute a suitable default value
6089 prefixit='case "$3" in
6091 case "$oldprefix" in
6092 "") eval "$1=\"\$$2\"";;
6099 ""|" ") eval "$1=\"\$$2\"";;
6105 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
6107 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
6108 /*-$oldprefix/*|\~*-$oldprefix/*)
6109 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
6110 *) eval "$1=\"\$$2\"";;
6114 : determine installation style
6115 : For now, try to deduce it from prefix unless it is already set.
6116 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
6117 case "$installstyle" in
6118 '') case "$prefix" in
6119 *perl*) dflt='lib';;
6120 *) dflt='lib/perl5' ;;
6123 *) dflt="$installstyle" ;;
6125 : Probably not worth prompting for this since we prompt for all
6126 : the directories individually, and the prompt would be too long and
6130 : determine where public executables go
6135 rp='Pathname where the public executables will reside?'
6137 if $test "X$ansexp" != "X$binexp"; then
6141 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
6142 : XXX If this is fixed, also fix the "start perl" hunk below, which relies on
6143 : this via initialinstalllocation
6146 case "$userelocatableinc" in
6147 $define|true|[yY]*) dflt='y' ;;
6152 Would you like to build Perl so that the installation is relocatable, so that
6153 library paths in @INC are determined relative to the path of the perl binary?
6154 This is not advised for system Perl installs, or if you need to run setid
6155 scripts or scripts under taint mode.
6157 If this doesn't make any sense to you, just accept the default '$dflt'.
6159 rp='Use relocatable @INC?'
6162 y|Y) val="$define" ;;
6165 set userelocatableinc
6168 initialinstalllocation="$binexp"
6169 : Default prefix is now "up one level from where the binaries are"
6170 case "$userelocatableinc" in
6176 installprefixexp=".../.."
6180 : determine where private library files go
6181 : Usual default is /usr/local/lib/perl5/$version.
6182 : Also allow things like /opt/perl/lib/$version, since
6183 : /opt/perl/lib/perl5... would be redundant.
6184 : The default "style" setting is made in installstyle.U
6185 case "$installstyle" in
6186 *lib/perl5*) set dflt privlib lib/$package/$version ;;
6187 *) set dflt privlib lib/$version ;;
6192 There are some auxiliary files for $package that need to be put into a
6193 private library directory that is accessible by everyone.
6198 rp='Pathname where the private library files will reside?'
6203 : set the prefixup variable, to restore leading tilda escape
6204 prefixup='case "$prefixexp" in
6206 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
6209 : determine where public architecture dependent libraries go
6212 : privlib default is /usr/local/lib/$package/$version
6213 : archlib default is /usr/local/lib/$package/$version/$archname
6214 : privlib may have an optional trailing /share.
6215 tdflt=`echo $privlib | $sed 's,/share$,,'`
6216 tdflt=$tdflt/$archname
6225 $spackage contains architecture-dependent library files. If you are
6226 sharing libraries in a heterogeneous environment, you might store
6227 these files in a separate location. Otherwise, you can just include
6228 them with the rest of the public library files.
6233 rp='Where do you want to put the public architecture-dependent libraries?'
6237 if $test X"$archlib" = X"$privlib"; then
6243 : see if setuid scripts can be secure
6246 Some kernels have a bug that prevents setuid #! scripts from being
6247 secure. Some sites have disabled setuid #! scripts because of this.
6249 First let's decide if your kernel supports secure setuid #! scripts.
6250 (If setuid #! scripts would be secure but have been disabled anyway,
6251 don't say that they are secure if asked.)
6256 if $test -d /dev/fd; then
6257 echo "#!$ls" >reflect
6258 chmod +x,u+s reflect
6259 ./reflect >flect 2>&1
6260 if $contains "/dev/fd" flect >/dev/null; then
6261 echo "Congratulations, your kernel has secure setuid scripts!" >&4
6265 If you are not sure if they are secure, I can check but I'll need a
6266 username and password different from the one you are using right now.
6267 If you don't have such a username or don't want me to test, simply
6271 rp='Other username to test security of setuid scripts with?'
6276 case "$d_suidsafe" in
6277 '') echo "I'll assume setuid scripts are *not* secure." >&4
6280 echo "Well, the $hint value is *not* secure." >&4
6282 *) echo "Well, the $hint value *is* secure." >&4
6287 $rm -f reflect flect
6288 echo "#!$ls" >reflect
6289 chmod +x,u+s reflect
6292 echo '"su" will (probably) prompt you for '"$ans's password."
6293 su $ans -c './reflect >flect'
6294 if $contains "/dev/fd" flect >/dev/null; then
6295 echo "Okay, it looks like setuid scripts are secure." >&4
6298 echo "I don't think setuid scripts are secure." >&4
6303 rp='Does your kernel have *secure* setuid scripts?'
6306 [yY]*) val="$define";;
6311 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
6312 echo "(That's for file descriptors, not floppy disks.)"
6318 $rm -f reflect flect
6320 : now see if they want to do setuid emulation
6323 case "$d_suidsafe" in
6326 echo "No need to emulate SUID scripts since they are secure here." >&4
6330 Some systems have disabled setuid scripts, especially systems where
6331 setuid scripts cannot be secure. On systems where setuid scripts have
6332 been disabled, the setuid/setgid bits on scripts are currently
6333 useless. It is possible for $package to detect those bits and emulate
6334 setuid/setgid in a secure fashion. This emulation will only work if
6335 setuid scripts have been disabled in your kernel.
6339 "$define") dflt=y ;;
6342 rp="Do you want to do setuid/setgid emulation?"
6345 [yY]*) val="$define";;
6353 : Find perl5.005 or later.
6354 echo "Looking for a previously installed perl5.005 or later... "
6356 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
6357 : Check if this perl is recent and can load a simple module
6358 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6361 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6371 '') echo "None found. That's ok.";;
6372 *) echo "Using $perl5." ;;
6377 After $package is installed, you may wish to install various
6378 add-on modules and utilities. Typically, these add-ons will
6379 be installed under $prefix with the rest
6380 of this package. However, you may wish to install such add-ons
6381 elsewhere under a different prefix.
6383 If you do not wish to put everything under a single prefix, that's
6384 ok. You will be prompted for the individual locations; this siteprefix
6385 is only used to suggest the defaults.
6387 The default should be fine for most people.
6391 rp='Installation prefix to use for add-on modules and utilities?'
6392 : XXX Here might be another good place for an installstyle setting.
6393 case "$siteprefix" in
6395 *) dflt=$siteprefix ;;
6398 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6400 case "$siteprefix" in
6404 *) oldsiteprefix="$prefix";;
6409 siteprefixexp="$ansexp"
6411 : determine where site specific libraries go.
6412 : Usual default is /usr/local/lib/perl5/site_perl/$version
6413 : The default "style" setting is made in installstyle.U
6414 : XXX No longer works with Prefixit stuff.
6415 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6417 '') case "$installstyle" in
6418 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
6419 *) dflt=$siteprefix/lib/site_$prog/$version ;;
6427 The installation process will create a directory for
6428 site-specific extensions and modules. Most users find it convenient
6429 to place all site-specific files in this directory rather than in the
6430 main distribution directory.
6434 rp='Pathname for the site-specific library files?'
6438 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6440 : Determine list of previous versions to include in @INC
6441 $cat > getverlist <<EOPL
6444 \$api_versionstring = "$api_versionstring";
6445 \$version = "$version";
6446 \$stem = "$sitelib_stem";
6447 \$archname = "$archname";
6449 $cat >> getverlist <<'EOPL'
6450 # The list found is store twice for each entry: the original name, and
6451 # the binary broken down version as pack "sss", so sorting is easy and
6452 # unambiguous. This will work for all versions that have a maximum of
6453 # three digit groups, separate by '.'s or '_'s. Names are extended with
6454 # ".0.0" to ensure at least three elements for the pack.
6455 # -- H.Merijn Brand (m)'06 23-10-2006
6457 # Can't have leading @ because metaconfig interprets it as a command!
6458 ;@inc_version_list=();
6459 # XXX Redo to do opendir/readdir?
6462 ;@candidates = map {
6463 [ $_, pack "sss", split m/[._]/, "$_.0.0" ] } glob("5.*");
6469 ($pversion, $aversion, $vsn5005) = map {
6470 pack "sss", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005";
6471 foreach $d (@candidates) {
6472 if ($d->[1] lt $pversion) {
6473 if ($d->[1] ge $aversion) {
6474 unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]);
6476 elsif ($d->[1] ge $vsn5005) {
6477 unshift(@inc_version_list, grep { -d } $d->[0]);
6481 # Skip newer version. I.e. don't look in
6482 # 5.7.0 if we're installing 5.6.1.
6486 if (@inc_version_list) {
6487 print join(' ', @inc_version_list);
6490 # Blank space to preserve value for next Configure run.
6495 case "$inc_version_list" in
6496 '') if test -x "$perl5$exe_ext"; then
6497 dflt=`$perl5 getverlist`
6502 $undef) dflt='none' ;;
6503 *) eval dflt=\"$inc_version_list\" ;;
6506 ''|' ') dflt=none ;;
6513 In order to ease the process of upgrading, this version of perl
6514 can be configured to use modules built and installed with earlier
6515 versions of perl that were installed under $prefix. Specify here
6516 the list of earlier versions that this version of perl should check.
6517 If Configure detected no earlier versions of perl installed under
6518 $prefix, then the list will be empty. Answer 'none' to tell perl
6519 to not search earlier versions.
6521 The default should almost always be sensible, so if you're not sure,
6522 just accept the default.
6525 rp='List of earlier versions to include in @INC?'
6528 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
6529 *) inc_version_list="$ans" ;;
6531 case "$inc_version_list" in
6533 inc_version_list_init='0'
6534 d_inc_version_list="$undef"
6536 *) inc_version_list_init=`echo $inc_version_list |
6537 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
6538 d_inc_version_list="$define"
6543 : see if this is a malloc.h system
6544 : we want a real compile instead of Inhdr because some systems have a
6545 : malloc.h that just gives a compile error saying to use stdlib.h instead
6550 int main () { return 0; }
6553 if eval $compile; then
6554 echo "<malloc.h> found." >&4
6557 echo "<malloc.h> NOT found." >&4
6564 : check for void type
6566 echo "Checking to see how well your C compiler groks the void type..." >&4
6567 case "$voidflags" in
6579 extern void moo(); /* function returning void */
6580 void (*goo)(); /* ptr to func returning void */
6582 void *hue; /* generic ptr */
6595 int main() { sub(); }
6597 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
6598 voidflags=$defvoidused
6599 echo "Good. It appears to support void to the level $package wants.">&4
6600 if $contains warning .out >/dev/null 2>&1; then
6601 echo "However, you might get some warnings that look like this:"
6605 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
6606 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
6607 echo "It supports 1..."
6608 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
6609 echo "It also supports 2..."
6610 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
6612 echo "And it supports 4 but not 8 definitely."
6614 echo "It doesn't support 4..."
6615 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
6617 echo "But it supports 8."
6620 echo "Neither does it support 8."
6624 echo "It does not support 2..."
6625 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
6627 echo "But it supports 4 and 8."
6629 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
6631 echo "And it supports 4 but has not heard about 8."
6633 echo "However it supports 8 but not 4."
6638 echo "There is no support at all for void."
6643 case "$voidflags" in
6646 Support flag bits are:
6647 1: basic void declarations.
6648 2: arrays of pointers to functions returning void.
6649 4: operations between pointers to and addresses of void functions.
6650 8: generic void pointers.
6653 rp="Your void support flags add up to what?"
6660 : check for length of pointer
6664 echo "Checking to see how big your pointers are..." >&4
6665 if test "$voidflags" -gt 7; then
6666 echo '#define VOID_PTR char *' > try.c
6668 echo '#define VOID_PTR void *' > try.c
6678 printf("%d\n", (int)sizeof(VOID_PTR));
6683 if eval $compile_ok; then
6684 ptrsize=`$run ./try`
6685 echo "Your pointers are $ptrsize bytes long."
6688 echo "(I can't seem to compile the test program. Guessing...)" >&4
6689 rp="What is the size of a pointer (in bytes)?"
6696 case "$use64bitall" in
6697 "$define"|true|[yY]*)
6701 *** You have chosen a maximally 64-bit build,
6702 *** but your pointers are only 4 bytes wide.
6703 *** Please rerun Configure without -Duse64bitall.
6708 *** Since you have quads, you could possibly try with -Duse64bitint.
6713 *** Cannot continue, aborting.
6724 : determine whether to use malloc wrapping
6726 case "$usemallocwrap" in
6727 [yY]*|true|$define) dflt='y' ;;
6728 [nN]*|false|$undef) dflt='n' ;;
6729 *) case "$usedevel" in
6730 [yY]*|true|$define) dflt='y' ;;
6735 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
6737 usemallocwrap="$ans"
6740 usemallocwrap="$define" ;;
6742 usemallocwrap="$undef" ;;
6745 : determine which malloc to compile in
6747 case "$usemymalloc" in
6748 [yY]*|true|$define) dflt='y' ;;
6749 [nN]*|false|$undef) dflt='n' ;;
6750 *) case "$ptrsize" in
6756 rp="Do you wish to attempt to use the malloc that comes with $package?"
6762 mallocsrc='malloc.c'
6763 mallocobj="malloc$_o"
6764 d_mymalloc="$define"
6767 : Remove malloc from list of libraries to use
6768 echo "Removing unneeded -lmalloc from library list" >&4
6769 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
6772 echo "libs = $libs" >&4
6784 : compute the return types of malloc and free
6786 $cat >malloc.c <<END
6790 #include <sys/types.h>
6804 case "$malloctype" in
6806 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
6813 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
6817 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
6824 echo "Your system uses $freetype free(), it would seem." >&4
6826 : determine where site specific architecture-dependent libraries go.
6827 : sitelib default is /usr/local/lib/perl5/site_perl/$version
6828 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6829 : sitelib may have an optional trailing /share.
6831 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
6832 dflt="$dflt/$archname"
6837 set sitearch sitearch none
6841 The installation process will also create a directory for
6842 architecture-dependent site-specific extensions and modules.
6846 rp='Pathname for the site-specific architecture-dependent library files?'
6850 if $test X"$sitearch" = X"$sitelib"; then
6853 d_sitearch="$define"
6858 The installation process will also create a directory for
6859 vendor-supplied add-ons. Vendors who supply perl with their system
6860 may find it convenient to place all vendor-supplied files in this
6861 directory rather than in the main distribution directory. This will
6862 ease upgrades between binary-compatible maintenance versions of perl.
6864 Of course you may also use these directories in whatever way you see
6865 fit. For example, you might use them to access modules shared over a
6866 company-wide network.
6868 The default answer should be fine for most people.
6869 This causes further questions about vendor add-ons to be skipped
6870 and no vendor-specific directories will be configured for perl.
6873 rp='Do you want to configure vendor-specific add-on directories?'
6874 case "$usevendorprefix" in
6875 define|true|[yY]*) dflt=y ;;
6876 *) : User may have set vendorprefix directly on Configure command line.
6877 case "$vendorprefix" in
6886 rp='Installation prefix to use for vendor-supplied add-ons?'
6887 case "$vendorprefix" in
6889 *) dflt=$vendorprefix ;;
6892 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6894 case "$vendorprefix" in
6898 *) oldvendorprefix="$prefix";;
6902 usevendorprefix="$define"
6904 vendorprefixexp="$ansexp"
6906 *) usevendorprefix="$undef"
6912 case "$vendorprefix" in
6913 '') d_vendorlib="$undef"
6917 *) d_vendorlib="$define"
6918 : determine where vendor-supplied modules go.
6919 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
6920 case "$vendorlib" in
6922 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6923 case "$installstyle" in
6924 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
6925 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
6928 *) dflt="$vendorlib"
6932 rp='Pathname for the vendor-supplied library files?'
6935 vendorlibexp="$ansexp"
6938 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
6942 case "$vendorprefix" in
6943 '') d_vendorarch="$undef"
6947 *) d_vendorarch="$define"
6948 : determine where vendor-supplied architecture-dependent libraries go.
6949 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
6950 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
6951 : vendorlib may have an optional trailing /share.
6952 case "$vendorarch" in
6953 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
6954 dflt="$dflt/$archname"
6956 *) dflt="$vendorarch" ;;
6959 rp='Pathname for vendor-supplied architecture-dependent files?'
6962 vendorarchexp="$ansexp"
6965 prefixvar=vendorarch
6968 : Final catch-all directories to search
6971 Lastly, you can have perl look in other directories for extensions and
6972 modules in addition to those already specified.
6973 These directories will be searched after
6977 test X"$vendorlib" != "X" && echo ' ' $vendorlib
6978 test X"$vendorarch" != "X" && echo ' ' $vendorarch
6980 case "$otherlibdirs" in
6981 ''|' ') dflt='none' ;;
6982 *) dflt="$otherlibdirs" ;;
6985 Enter a colon-separated set of extra paths to include in perl's @INC
6986 search path, or enter 'none' for no extra paths.
6990 rp='Colon-separated list of additional directories for perl to search?'
6993 ' '|''|none) otherlibdirs=' ' ;;
6994 *) otherlibdirs="$ans" ;;
6996 case "$otherlibdirs" in
7000 set d_perl_otherlibdirs
7003 : Cruising for prototypes
7005 echo "Checking out function prototypes..." >&4
7006 $cat >prototype.c <<EOCP
7011 int main(int argc, char *argv[]) {
7014 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
7015 echo "Your C compiler appears to support function prototypes."
7018 echo "Your C compiler doesn't seem to understand function prototypes."
7025 case "$prototype" in
7027 *) ansi2knr='ansi2knr'
7032 This version of $package can only be compiled by a compiler that
7033 understands function prototypes. Unfortunately, your C compiler
7035 doesn't seem to understand them. Sorry about that.
7037 If GNU cc is available for your system, perhaps you could try that instead.
7039 Eventually, we hope to support building Perl with pre-ANSI compilers.
7040 If you would like to help in that effort, please contact <perlbug@perl.org>.
7042 Aborting Configure now.
7054 Perl can be built with extra modules or bundles of modules which
7055 will be fetched from the CPAN and installed alongside Perl.
7057 Notice that you will need access to the CPAN; either via the Internet,
7058 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
7059 be asked later to configure the CPAN.pm module which will in turn do
7060 the installation of the rest of the extra modules or bundles.)
7062 Notice also that if the modules require any external software such as
7063 libraries and headers (the libz library and the zlib.h header for the
7064 Compress::Zlib module, for example) you MUST have any such software
7065 already installed, this configuration process will NOT install such
7068 If this doesn't make any sense to you, just accept the default '$dflt'.
7070 rp='Install any extra modules (y or n)?'
7076 Please list any extra modules or bundles to be installed from CPAN,
7077 with spaces between the names. The names can be in any format the
7078 'install' command of CPAN.pm will understand. (Answer 'none',
7079 without the quotes, to install no extra modules or bundles.)
7089 $rm -f ../extras.lst
7091 *) echo "(Saving the list of extras for later...)"
7092 echo "$extras" > ../extras.lst
7100 : determine where html pages for programs go
7101 set html1dir html1dir none
7105 If you wish to install html files for programs in $spackage, indicate
7106 the appropriate directory here. To skip installing html files,
7110 ''|none|$undef|' ') dflt=none ;;
7111 *) dflt=$html1dir ;;
7114 rp="Directory for the main $spackage html pages?"
7118 : Use ' ' for none so value is preserved next time through Configure
7119 $test X"$html1dir" = "X" && html1dir=' '
7121 : determine where html pages for libraries and modules go
7122 set html3dir html3dir none
7126 If you wish to install html files for modules associated with $spackage,
7127 indicate the appropriate directory here. To skip installing html files,
7130 : There is no obvious default. If they have specified html1dir, then
7131 : try to key off that, possibly changing .../html1 into .../html3.
7133 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
7134 *) dflt=$html3dir ;;
7137 rp="Directory for the $spackage module html pages?"
7141 : Use ' ' for none so value is preserved next time through Configure
7142 $test X"$html3dir" = "X" && html3dir=' '
7144 : determine whether to install perl also as /usr/bin/perl
7147 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
7149 Many scripts expect perl to be installed as /usr/bin/perl.
7151 If you want to, I can install the perl you are about to compile
7152 as /usr/bin/perl (in addition to $bin/perl).
7154 if test -f /usr/bin/perl; then
7157 However, please note that because you already have a /usr/bin/perl,
7158 overwriting that with a new Perl would very probably cause problems.
7159 Therefore I'm assuming you don't want to do that (unless you insist).
7162 case "$installusrbinperl" in
7163 "$define"|[yY]*) dflt='y';;
7169 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
7172 case "$installusrbinperl" in
7173 "$undef"|[nN]*) dflt='n';;
7177 rp="Do you want to install perl as /usr/bin/perl?"
7180 [yY]*) val="$define";;
7186 set installusrbinperl
7190 echo "Checking for GNU C Library..." >&4
7192 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
7193 alone are insufficient to distinguish different versions, such as
7194 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
7195 libc version 2.1.0. A. Dougherty, June 3, 2002.
7201 # ifdef __GLIBC_MINOR__
7202 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus)
7203 # include <gnu/libc-version.h>
7204 printf("%s\n", gnu_get_libc_version());
7206 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
7209 printf("%d\n", __GLIBC__);
7218 if eval $compile_ok && $run ./try > glibc.ver; then
7220 gnulibc_version=`$cat glibc.ver`
7221 echo "You are using the GNU C Library version $gnulibc_version"
7225 echo "You are not using the GNU C Library"
7231 : see if nm is to be used to determine whether a symbol is defined or not
7235 case "$d_gnulibc" in
7238 echo "nm probably won't work on the GNU C Library." >&4
7244 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
7246 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
7247 echo "'nm' won't be sufficient on this sytem." >&4
7253 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
7254 if $test $dflt -gt 20; then
7264 true|$define) dflt=y;;
7271 I can use $nm to extract the symbols from your C libraries. This
7272 is a time consuming task which may generate huge output on the disk (up
7273 to 3 megabytes) but that should make the symbols extraction faster. The
7274 alternative is to skip the 'nm' extraction part and to compile a small
7275 test program instead to determine whether each symbol is present. If
7276 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
7277 this may be the best solution.
7279 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
7282 rp="Shall I use $nm to extract C symbols from the libraries?"
7285 [Nn]*) usenm=false;;
7294 : nm options which may be necessary
7296 '') if $test -f /mach_boot; then
7298 elif $test -d /usr/ccs/lib; then
7299 nm_opt='-p' # Solaris (and SunOS?)
7300 elif $test -f /dgux; then
7302 elif $test -f /lib64/rld; then
7303 nm_opt='-p' # 64-bit Irix
7309 : nm options which may be necessary for shared libraries but illegal
7310 : for archive libraries. Thank you, Linux.
7311 case "$nm_so_opt" in
7312 '') case "$myuname" in
7314 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
7315 nm_so_opt='--dynamic'
7324 : get list of predefined functions in a handy place
7329 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
7335 *) for thislib in $libs; do
7338 : Handle C library specially below.
7341 thislib=`echo $thislib | $sed -e 's/^-l//'`
7342 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
7344 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
7346 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
7348 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
7350 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
7352 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
7354 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
7359 libnames="$libnames $try"
7361 *) libnames="$libnames $thislib" ;;
7370 for xxx in $libpth; do
7371 $test -r $1 || set $xxx/libc.$so
7372 : The messy sed command sorts on library version numbers.
7374 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
7375 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
7377 s/[0-9][0-9]*/0000&/g
7378 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
7381 $sort | $sed -e 's/^.* //'`
7384 $test -r $1 || set /usr/ccs/lib/libc.$so
7385 $test -r $1 || set /lib/libsys_s$_a
7391 if $test -r "$1"; then
7392 echo "Your (shared) C library seems to be in $1."
7394 elif $test -r /lib/libc && $test -r /lib/clib; then
7395 echo "Your C library seems to be in both /lib/clib and /lib/libc."
7397 libc='/lib/clib /lib/libc'
7398 if $test -r /lib/syslib; then
7399 echo "(Your math library is in /lib/syslib.)"
7400 libc="$libc /lib/syslib"
7402 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7403 echo "Your C library seems to be in $libc, as you said before."
7404 elif $test -r $incpath/usr/lib/libc$_a; then
7405 libc=$incpath/usr/lib/libc$_a;
7406 echo "Your C library seems to be in $libc. That's fine."
7407 elif $test -r /lib/libc$_a; then
7409 echo "Your C library seems to be in $libc. You're normal."
7411 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
7413 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
7414 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
7415 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
7417 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7419 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7422 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
7424 if $test -r "$tans"; then
7425 echo "Your C library seems to be in $tans, of all places."
7431 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7435 If the guess above is wrong (which it might be if you're using a strange
7436 compiler, or your machine supports multiple models), you can override it here.
7441 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
7443 I can't seem to find your C library. I've looked in the following places:
7446 $sed 's/^/ /' libpath
7449 None of these seems to contain your C library. I need to get its name...
7454 rp='Where is your C library?'
7459 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
7460 set X `cat libnames`
7463 case $# in 1) xxx=file; esac
7464 echo "Extracting names from the following $xxx for later perusal:" >&4
7466 $sed 's/^/ /' libnames >&4
7468 $echo $n "This may take a while...$c" >&4
7472 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
7473 *) $nm $nm_opt $file 2>/dev/null;;
7478 $grep fprintf libc.tmp > libc.ptf
7479 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
7480 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
7482 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
7484 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7486 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
7488 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7490 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
7492 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7494 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
7496 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7498 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
7500 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7502 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
7504 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7506 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
7507 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
7509 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7511 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
7513 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7515 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
7517 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7519 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
7521 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7523 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
7525 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7527 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
7529 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7531 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
7533 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7535 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
7537 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7540 $nm -p $* 2>/dev/null >libc.tmp
7541 $grep fprintf libc.tmp > libc.ptf
7542 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
7543 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
7549 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
7551 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
7552 for thisname in $libnames $libc; do
7553 $ar t $thisname >>libc.tmp
7555 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
7557 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
7558 # Repeat libc to extract forwarders to DLL entries too
7559 for thisname in $libnames $libc; do
7560 $ar tv $thisname >>libc.tmp
7561 # Revision 50 of EMX has bug in $ar.
7562 # it will not extract forwarders to DLL entries
7563 # Use emximp which will extract exactly them.
7564 emximp -o tmp.imp $thisname \
7566 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
7567 < tmp.imp >>libc.tmp
7570 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
7573 echo "$ar didn't seem to work right." >&4
7574 echo "Maybe this is a Cray...trying bld instead..." >&4
7575 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
7577 for thisname in $libnames; do
7579 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
7580 $ar t $thisname >>libc.tmp
7584 echo "That didn't work either. Giving up." >&4
7594 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
7595 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
7597 *) if $test -f /lib/syscalls.exp; then
7599 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
7600 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' /lib/syscalls.exp >>libc.list
7606 $rm -f libnames libpath
7608 : see if dld is available
7614 echo "Checking for C++..." >&4
7615 $cat >try.c <<'EOCP'
7627 if eval $compile_ok && $run ./try; then
7629 echo "You are using a C++ compiler."
7632 echo "You are not using a C++ compiler."
7638 : is a C symbol defined?
7641 -v) tf=libc.tmp; tdc="";;
7642 -a) tf=libc.tmp; tdc="[]";;
7643 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
7646 case "$reuseval-$4" in
7648 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
7653 case "$d_cplusplus" in
7654 $define) extern_C=\"C\";;
7656 if $test "$runnm" = true; then
7657 if $contains $tlook $tf >/dev/null 2>&1; then
7659 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
7660 echo "extern $extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7661 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
7662 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
7666 echo "extern $extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7667 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
7673 $define) tval=true;;
7680 : define an is-in-libc? function
7681 inlibc='echo " "; td=$define; tu=$undef;
7682 sym=$1; var=$2; eval "was=\$$2";
7684 case "$reuseval$was" in
7694 echo "$sym() found." >&4;
7695 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
7697 echo "$sym() NOT found." >&4;
7698 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
7702 $define) echo "$sym() found." >&4;;
7703 *) echo "$sym() NOT found." >&4;;
7707 : see if dlopen exists
7709 xxx_ccflags="$ccflags"
7711 : with g++ one needs -shared to get is-in-libc to work for dlopen
7712 case "$gccversion" in
7714 *) case "$d_cplusplus" in
7715 "$define") ccflags="$ccflags -shared" ;;
7722 ccflags="$xxx_ccflags"
7724 : see if this is a unistd.h system
7725 set unistd.h i_unistd
7728 : determine which dynamic loading, if any, to compile in
7730 dldir="ext/DynaLoader"
7743 $define) dflt='y' ;;
7746 $define) dflt='y' ;;
7748 : Does a dl_xxx.xs file exist for this operating system
7749 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
7752 rp="Do you wish to use dynamic loading?"
7759 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
7760 dflt="$dldir/dl_${osname}.xs"
7761 elif $test "$d_dlopen" = "$define" ; then
7762 dflt="$dldir/dl_dlopen.xs"
7763 elif $test "$i_dld" = "$define" ; then
7764 dflt="$dldir/dl_dld.xs"
7769 *) dflt="$dldir/$dlsrc"
7772 echo "The following dynamic loading files are available:"
7773 : Can not go over to $dldir because getfile has path hard-coded in.
7774 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
7775 rp="Source file to use for dynamic loading"
7781 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
7785 Some systems may require passing special flags to $cc -c to
7786 compile modules that will be used to create a shared library.
7787 To use no flags, say "none".
7790 case "$cccdlflags" in
7791 '') case "$gccversion" in
7792 '') case "$osname" in
7794 next) dflt='none' ;;
7795 irix*) dflt='-KPIC' ;;
7796 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
7797 sunos) dflt='-pic' ;;
7801 *) case "$osname" in
7802 darwin) dflt='none' ;;
7803 linux*|svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
7808 *) dflt="$cccdlflags" ;;
7810 rp="Any special flags to pass to $cc -c to compile shared library modules?"
7813 none) cccdlflags=' ' ;;
7814 *) cccdlflags="$ans" ;;
7819 Some systems use ld to create libraries that can be dynamically loaded,
7820 while other systems (such as those using ELF) use $cc.
7824 '') $cat >try.c <<EOM
7825 /* Test for whether ELF binaries are produced */
7837 int i = open("a.out",O_RDONLY);
7840 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
7841 exit(0); /* succeed (yes, it's ELF) */
7846 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
7848 You appear to have ELF support. I'll use $cc to build dynamic libraries.
7852 echo "I'll use ld to build dynamic libraries."
7861 rp="What command should be used to create dynamic libraries?"
7867 Some systems may require passing special flags to $ld to create a
7868 library that can be dynamically loaded. If your ld flags include
7869 -L/other/path options to locate libraries outside your loader's normal
7870 search path, you may need to specify those -L options here as well. To
7871 use no flags, say "none".
7874 case "$lddlflags" in
7875 '') case "$osname" in
7876 beos) dflt='-nostart' ;;
7878 case "$gccversion" in
7879 '') dflt="$dflt +vnocompatwarnings" ;;
7882 linux|irix*|gnu*) dflt="-shared $optimize" ;;
7883 next) dflt='none' ;;
7884 solaris) dflt='-G' ;;
7885 sunos) dflt='-assert nodefinitions' ;;
7886 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
7890 *) dflt="$lddlflags" ;;
7893 : Try to guess additional flags to pick up local libraries.
7894 : Be careful not to append to a plain 'none'
7898 for thisflag in $ldflags; do
7903 *) dflt="$dflt $thisflag" ;;
7910 ''|' ') dflt='none' ;;
7913 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
7916 none) lddlflags=' ' ;;
7917 *) lddlflags="$ans" ;;
7922 Some systems may require passing special flags to $cc to indicate that
7923 the resulting executable will use dynamic linking. To use no flags,
7927 case "$ccdlflags" in
7928 '') case "$osname" in
7929 linux|hpux|gnu*) dflt='-Wl,-E' ;;
7930 next|sunos) dflt='none' ;;
7934 *) dflt="$ccdlflags" ;;
7936 rp="Any special flags to pass to $cc to use dynamic linking?"
7939 none) ccdlflags=' ' ;;
7940 *) ccdlflags="$ans" ;;
7954 # No dynamic loading being used, so don't bother even to prompt.
7957 *) case "$useshrplib" in
7958 '') case "$osname" in
7959 svr4*|nonstopux|dgux|dynixptx|esix|powerux|beos|cygwin*)
7961 also='Building a shared libperl is required for dynamic loading to work on your system.'
7966 also='Building a shared libperl is needed for MAB support.'
7984 The perl executable is normally obtained by linking perlmain.c with
7985 libperl${_a}, any static extensions (usually just DynaLoader), and
7986 any other libraries needed on this system (such as -lm, etc.). Since
7987 your system supports dynamic loading, it is probably possible to build
7988 a shared libperl.$so. If you will have more than one executable linked
7989 to libperl.$so, this will significantly reduce the size of each
7990 executable, but it may have a noticeable effect on performance. The
7991 default is probably sensible for your system.
7995 rp="Build a shared libperl.$so (y/n)"
7999 useshrplib='true' ;;
8000 *) useshrplib='false' ;;
8005 case "$useshrplib" in
8009 # Figure out a good name for libperl.so. Since it gets stored in
8010 # a version-specific architecture-dependent library, the version
8011 # number isn't really that important, except for making cc/ld happy.
8013 # A name such as libperl.so.3.1
8014 majmin="libperl.$so.$patchlevel.$subversion"
8015 # A name such as libperl.so.301
8016 majonly=`echo $patchlevel $subversion |
8017 $awk '{printf "%d%02d", $1, $2}'`
8018 majonly=libperl.$so.$majonly
8019 # I'd prefer to keep the os-specific stuff here to a minimum, and
8020 # rely on figuring it out from the naming of libc.
8021 case "${osname}${osvers}" in
8024 # XXX How handle the --version stuff for MAB?
8026 linux*|gnu*) # ld won't link with a bare -lperl otherwise.
8029 cygwin*) # ld links against an importlib
8030 dflt=libperl$lib_ext
8032 *) # Try to guess based on whether libc has major.minor.
8034 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
8035 *libc.$so.[0-9]*) dflt=$majonly ;;
8036 *) dflt=libperl.$so ;;
8046 I need to select a good name for the shared libperl. If your system uses
8047 library names with major and minor numbers, then you might want something
8048 like $majmin. Alternatively, if your system uses a single version
8049 number for shared libraries, then you might want to use $majonly.
8050 Or, your system might be quite happy with a simple libperl.$so.
8052 Since the shared libperl will get installed into a version-specific
8053 architecture-dependent directory, the version number of the shared perl
8054 library probably isn't important, so the default should be o.k.
8057 rp='What name do you want to give to the shared libperl?'
8060 echo "Ok, I'll use $libperl"
8063 libperl="libperl${_a}"
8067 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
8071 WARNING: Use of the shrpdir variable for the installation location of
8072 the shared $libperl is not supported. It was never documented and
8073 will not work in this version. Let me (perlbug@perl.org)
8074 know of any problems this may cause.
8080 But your current setting of $shrpdir is
8081 the default anyway, so it's harmless.
8086 Further, your current attempted setting of $shrpdir
8087 conflicts with the value of $archlibexp/CORE
8088 that installperl will use.
8095 # How will the perl executable find the installed shared $libperl?
8096 # Add $xxx to ccdlflags.
8097 # If we can't figure out a command-line option, use $shrpenv to
8098 # set env LD_RUN_PATH. The main perl makefile uses this.
8099 shrpdir=$archlibexp/CORE
8102 if "$useshrplib"; then
8105 # We'll set it in Makefile.SH...
8110 freebsd|netbsd|openbsd|interix|dragonfly)
8111 xxx="-Wl,-R$shrpdir"
8113 bsdos|linux|irix*|dec_osf|gnu*)
8114 xxx="-Wl,-rpath,$shrpdir"
8117 # next doesn't like the default...
8120 # beos doesn't like the default, either.
8123 # hpux doesn't like the default, either.
8124 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
8127 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
8133 # Only add $xxx if it isn't already in ccdlflags.
8134 case " $ccdlflags " in
8136 *) ccdlflags="$ccdlflags $xxx"
8139 Adding $xxx to the flags
8140 passed to $ld so that the perl executable will find the
8141 installed shared $libperl.
8149 # Fix ccdlflags in AIX for building external extensions.
8150 # (For building Perl itself bare -bE:perl.exp is needed,
8151 # Makefile.SH takes care of this.)
8153 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8155 # Respect a hint or command-line value.
8157 '') shrpenv="$tmp_shrpenv" ;;
8159 case "$ldlibpthname" in
8160 '') ldlibpthname=LD_LIBRARY_PATH ;;
8161 none) ldlibpthname='' ;;
8164 : determine where manual pages are on this system
8168 syspath='/usr/share/man/man1 /usr/man/man1'
8169 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8170 syspath="$syspath /usr/man/u_man/man1"
8171 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8172 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8173 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8174 sysman=`./loc . /usr/man/man1 $syspath`
8177 if $test -d "$sysman"; then
8178 echo "System manual is in $sysman." >&4
8180 echo "Could not find manual pages in source form." >&4
8183 : determine where manual pages go
8184 set man1dir man1dir none
8188 $spackage has manual pages available in source form.
8192 echo "However, you don't have nroff, so they're probably useless to you."
8194 '') man1dir="none";;
8197 echo "If you don't want the manual sources installed, answer 'none'."
8202 lookpath="$prefixexp/share/man/man1"
8203 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8204 lookpath="$lookpath $prefixexp/man/p_man/man1"
8205 lookpath="$lookpath $prefixexp/man/u_man/man1"
8206 lookpath="$lookpath $prefixexp/man/man.1"
8208 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8209 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8219 rp="Where do the main $spackage manual pages (source) go?"
8221 if $test "X$man1direxp" != "X$ansexp"; then
8232 : What suffix to use on installed man pages
8239 rp="What suffix should be used for the main $spackage man pages?"
8241 '') case "$man1dir" in
8255 *) dflt="$man1ext";;
8262 : see if we can have long filenames
8264 first=123456789abcdef
8266 if (echo hi >$first) 2>/dev/null; then
8267 if $test -f 123456789abcde; then
8268 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8271 echo 'You can have filenames longer than 14 characters.'>&4
8276 You can't have filenames longer than 14 chars.
8277 You can't even think about them!
8283 $rm -rf 123456789abcde*
8285 : determine where library module manual pages go
8286 set man3dir man3dir none
8290 $spackage has manual pages for many of the library modules.
8296 However, you don't have nroff, so they're probably useless to you.
8299 '') man3dir="none";;
8303 case "$d_flexfnam" in
8306 However, your system can't handle the long file names like File::Basename.3.
8309 '') man3dir="none";;
8313 echo "If you don't want the manual sources installed, answer 'none'."
8314 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8316 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
8317 if $test -d "$privlib/man/man3"; then
8320 WARNING: Previous versions of perl installed man3 pages into
8321 $privlib/man/man3. This version will suggest a
8322 new default of $dflt.
8326 rp='Do you wish to preserve the old behavior?(y/n)'
8329 y*) dflt="$privlib/man/man3" ;;
8334 *) dflt="$man3dir" ;;
8341 rp="Where do the $package library man pages (source) go?"
8351 : What suffix to use on installed man pages
8357 rp="What suffix should be used for the $package library man pages?"
8359 '') case "$man3dir" in
8373 *) dflt="$man3ext";;
8380 : see if we have to deal with yellow pages, now NIS.
8381 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
8382 if $test -f /usr/etc/nibindd; then
8384 echo "I'm fairly confident you're on a NeXT."
8386 rp='Do you get the hosts file via NetInfo?'
8395 y*) hostcat='nidump hosts .';;
8396 *) case "$hostcat" in
8397 nidump*) hostcat='';;
8407 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
8415 rp='Are you getting the hosts file via yellow pages?'
8418 y*) hostcat='ypcat hosts';;
8419 *) hostcat='cat /etc/hosts';;
8425 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
8428 '') test -f /etc/group && groupcat='cat /etc/group';;
8431 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
8434 : now get the host name
8436 echo "Figuring out host name..." >&4
8437 case "$myhostname" in
8439 echo 'Maybe "hostname" will work...'
8440 if tans=`sh -c hostname 2>&1` ; then
8448 if $test "$cont"; then
8450 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
8451 if tans=`cat /etc/systemid 2>&1` ; then
8453 phostname='cat /etc/systemid'
8454 echo "Whadyaknow. Xenix always was a bit strange..."
8457 elif $test -r /etc/systemid; then
8458 echo "(What is a non-Xenix system doing with /etc/systemid?)"
8461 if $test "$cont"; then
8462 echo 'No, maybe "uuname -l" will work...'
8463 if tans=`sh -c 'uuname -l' 2>&1` ; then
8465 phostname='uuname -l'
8467 echo 'Strange. Maybe "uname -n" will work...'
8468 if tans=`sh -c 'uname -n' 2>&1` ; then
8470 phostname='uname -n'
8472 echo 'Oh well, maybe I can mine it out of whoami.h...'
8473 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
8474 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
8475 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
8477 case "$myhostname" in
8478 '') echo "Does this machine have an identity crisis or something?"
8481 echo "Well, you said $myhostname before..."
8482 phostname='echo $myhostname';;
8488 case "$myhostname" in
8489 '') myhostname=noname ;;
8491 : you do not want to know about this
8496 if $test "$myhostname" ; then
8498 rp='Your host name appears to be "'$myhostname'".'" Right?"
8506 : bad guess or no guess
8507 while $test "X$myhostname" = X ; do
8509 rp="Please type the (one word) name of your host:"
8514 : translate upper to lower if necessary
8515 case "$myhostname" in
8517 echo "(Normalizing case in your host name)"
8518 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
8522 case "$myhostname" in
8524 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
8525 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
8526 echo "(Trimming domain name from host name--host name is now $myhostname)"
8528 *) case "$mydomain" in
8531 test "X$hostcat" = "Xypcat hosts" &&
8532 ypmatch "$myhostname" hosts 2>/dev/null |\
8533 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
8536 test "X$hostcat" != "X" &&
8537 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
8538 /[ ]$myhostname[ . ]/p" > hosts
8541 if $test -f hosts; then
8542 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
8543 END { print sum }" hosts` = x1 || tmp_re="[ ]"
8544 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
8545 hosts | $sort | $uniq | \
8546 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
8547 case `$echo X$dflt` in
8548 X*\ *) echo "(Several hosts in the database matched hostname)"
8551 X.) echo "(You do not have fully-qualified names in the hosts database)"
8555 echo "(I cannot locate a hosts database anywhere)"
8560 tans=`./loc resolv.conf X /etc /usr/etc`
8561 if $test -f "$tans"; then
8562 echo "(Attempting domain name extraction from $tans)"
8563 dflt=.`$sed -n -e 's/ / /g' \
8564 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
8565 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8567 .) dflt=.`$sed -n -e 's/ / /g' \
8568 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
8569 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8576 .) echo "(No help from resolv.conf either -- attempting clever guess)"
8577 dflt=.`sh -c domainname 2>/dev/null`
8580 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
8584 case "$dflt$osname" in
8585 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
8586 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
8590 .) echo "(Lost all hope -- silly guess then)"
8596 *) dflt="$mydomain";;
8600 rp="What is your domain name?"
8610 : translate upper to lower if necessary
8613 echo "(Normalizing case in your domain name)"
8614 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
8618 : a little sanity check here
8619 case "$phostname" in
8622 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
8623 $myhostname$mydomain|$myhostname) ;;
8625 case "$phostname" in
8627 echo "(That doesn't agree with your whoami.h file, by the way.)"
8630 echo "(That doesn't agree with your $phostname command, by the way.)"
8640 I need to get your e-mail address in Internet format if possible, i.e.
8641 something like user@host.domain. Please answer accurately since I have
8642 no easy means to double check it. The default value provided below
8643 is most probably close to reality but may not be valid from outside
8644 your organization...
8648 while test "$cont"; do
8650 '') dflt="$cf_by@$myhostname$mydomain";;
8651 *) dflt="$cf_email";;
8653 rp='What is your e-mail address?'
8659 rp='Address does not look like an Internet one. Use it anyway?'
8675 If you or somebody else will be maintaining perl at your site, please
8676 fill in the correct e-mail address here so that they may be contacted
8677 if necessary. Currently, the "perlbug" program included with perl
8678 will send mail to this address in addition to perlbug@perl.org. You may
8679 enter "none" for no administrator.
8682 case "$perladmin" in
8683 '') dflt="$cf_email";;
8684 *) dflt="$perladmin";;
8686 rp='Perl administrator e-mail address'
8690 : determine whether to only install version-specific parts.
8693 Do you want to install only the version-specific parts of the perl
8694 distribution? Usually you do *not* want to do this.
8696 case "$versiononly" in
8697 "$define"|[Yy]*|true) dflt='y' ;;
8700 rp="Do you want to install only the version-specific parts of perl?"
8703 [yY]*) val="$define";;
8709 case "$versiononly" in
8710 "$define") inc_version_list=''
8711 inc_version_list_init=0
8715 : figure out how to guarantee perl startup
8716 : XXX Note that this currently takes advantage of the bug that binexp ignores
8717 : the Configure -Dinstallprefix setting, which in turn means that under
8718 : relocatable @INC, initialinstalllocation is what binexp started as.
8719 case "$startperl" in
8721 case "$sharpbang" in
8725 I can use the #! construct to start perl on your system. This will
8726 make startup of perl scripts faster, but may cause problems if you
8727 want to share those scripts and perl is not in a standard place
8728 ($initialinstalllocation/perl) on all your platforms. The alternative
8729 is to force a shell by starting the script with a single ':' character.
8732 case "$versiononly" in
8733 "$define") dflt="$initialinstalllocation/perl$version";;
8734 *) dflt="$initialinstalllocation/perl";;
8736 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
8739 none) startperl=": # use perl";;
8740 *) startperl="#!$ans"
8741 if $test 30 -lt `echo "$ans" | wc -c`; then
8744 WARNING: Some systems limit the #! command to 32 characters.
8745 If you experience difficulty running Perl scripts with #!, try
8746 installing Perl in a directory with a shorter pathname.
8752 *) startperl=": # use perl"
8757 echo "I'll use $startperl to start perl scripts."
8759 : figure best path for perl in scripts
8762 case "$versiononly" in
8763 "$define") perlpath="$initialinstalllocation/perl$version";;
8764 *) perlpath="$initialinstalllocation/perl";;
8766 case "$startperl" in
8771 I will use the "eval 'exec'" idiom to start Perl on your system.
8772 I can use the full path of your Perl binary for this purpose, but
8773 doing so may cause problems if you want to share those scripts and
8774 Perl is not always in a standard place ($initialinstalllocation/perl).
8777 dflt="$initialinstalllocation/perl"
8778 rp="What path shall I use in \"eval 'exec'\"?"
8785 case "$startperl" in
8787 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
8790 : determine where public executable scripts go
8791 set scriptdir scriptdir
8793 case "$scriptdir" in
8796 : guess some guesses
8797 $test -d /usr/share/scripts && dflt=/usr/share/scripts
8798 $test -d /usr/share/bin && dflt=/usr/share/bin
8799 $test -d /usr/local/script && dflt=/usr/local/script
8800 $test -d /usr/local/scripts && dflt=/usr/local/scripts
8801 $test -d $prefixexp/script && dflt=$prefixexp/script
8805 *) dflt="$scriptdir"
8810 Some installations have a separate directory just for executable scripts so
8811 that they can mount it across multiple architectures but keep the scripts in
8812 one spot. You might, for example, have a subdirectory of /usr/share for this.
8813 Or you might just lump your scripts in with all your other executables.
8817 rp='Where do you keep publicly executable scripts?'
8819 if $test "X$ansexp" != "X$scriptdirexp"; then
8825 : A little fix up for an irregularly named variable.
8826 installscript="$installscriptdir"
8828 : determine where add-on public executables go
8830 '') dflt=$siteprefix/bin ;;
8834 rp='Pathname where the add-on public executables should be installed?'
8839 : determine where add-on html pages go
8840 : There is no standard location, so try to copy the previously-selected
8841 : directory structure for the core html pages.
8842 case "$sitehtml1dir" in
8843 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
8844 *) dflt=$sitehtml1dir ;;
8847 ''|' ') dflt=none ;;
8850 rp='Pathname where the site-specific html pages should be installed?'
8852 prefixvar=sitehtml1dir
8855 : determine where add-on library html pages go
8856 : There is no standard location, so try to copy the previously-selected
8857 : directory structure for the core html pages.
8858 case "$sitehtml3dir" in
8859 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
8860 *) dflt=$sitehtml3dir ;;
8863 ''|' ') dflt=none ;;
8866 rp='Pathname where the site-specific library html pages should be installed?'
8868 prefixvar=sitehtml3dir
8871 : determine where add-on manual pages go
8872 case "$siteman1dir" in
8873 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
8874 *) dflt=$siteman1dir ;;
8877 ''|' ') dflt=none ;;
8880 rp='Pathname where the site-specific manual pages should be installed?'
8882 prefixvar=siteman1dir
8885 : determine where add-on library man pages go
8886 case "$siteman3dir" in
8887 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
8888 *) dflt=$siteman3dir ;;
8891 ''|' ') dflt=none ;;
8894 rp='Pathname where the site-specific library manual pages should be installed?'
8896 prefixvar=siteman3dir
8899 : determine where add-on public executable scripts go
8900 case "$sitescript" in
8901 '') dflt=$siteprefix/script
8902 $test -d $dflt || dflt=$sitebin ;;
8903 *) dflt="$sitescript" ;;
8906 rp='Pathname where add-on public executable scripts should be installed?'
8908 prefixvar=sitescript
8911 case "$usefaststdio" in
8912 $define|true|[yY]*|'')
8913 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
8923 Perl can be built to use 'fast stdio', which means using the stdio
8924 library but also directly manipulating the stdio buffers to enable
8925 faster I/O. Using stdio is better for backward compatibility (especially
8926 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
8927 interface has been preferred instead of stdio.
8929 If this doesn't make any sense to you, just accept the default '$dflt'.
8931 rp='Use the "fast stdio" if available?'
8934 y|Y) val="$define" ;;
8941 : define an is-a-typedef? function
8942 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8944 "") inclist="sys/types.h";;
8946 eval "varval=\$$var";
8950 for inc in $inclist; do
8951 echo "#include <$inc>" >>temp.c;
8953 echo "#ifdef $type" >> temp.c;
8954 echo "printf(\"We have $type\");" >> temp.c;
8955 echo "#endif" >> temp.c;
8956 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8957 if $contains $type temp.E >/dev/null 2>&1; then
8963 *) eval "$var=\$varval";;
8966 : define an is-a-typedef? function that prompts if the type is not available.
8967 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8969 "") inclist="sys/types.h";;
8971 eval "varval=\$$var";
8975 for inc in $inclist; do
8976 echo "#include <$inc>" >>temp.c;
8978 echo "#ifdef $type" >> temp.c;
8979 echo "printf(\"We have $type\");" >> temp.c;
8980 echo "#endif" >> temp.c;
8981 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8983 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
8984 if $contains $type temp.E >/dev/null 2>&1; then
8985 echo "$type found." >&4;
8988 echo "$type NOT found." >&4;
8994 *) eval "$var=\$varval";;
8997 : see what type lseek is declared as in the kernel
8998 rp="What is the type used for lseek's offset on this system?"
8999 set off_t lseektype long stdio.h sys/types.h
9003 echo "Checking to see how big your file offsets are..." >&4
9005 #include <sys/types.h>
9009 printf("%d\n", (int)sizeof($lseektype));
9014 if eval $compile_ok; then
9015 lseeksize=`$run ./try`
9016 echo "Your file offsets are $lseeksize bytes long."
9020 echo "(I can't seem to compile the test program. Guessing...)"
9021 rp="What is the size of your file offsets (in bytes)?"
9027 : see what type file positions are declared as in the library
9028 rp="What is the type for file position used by fsetpos()?"
9029 set fpos_t fpostype long stdio.h sys/types.h
9034 *_t) zzz="$fpostype" ;;
9037 echo "Checking the size of $zzz..." >&4
9039 #include <sys/types.h>
9046 printf("%d\n", (int)sizeof($fpostype));
9051 if eval $compile_ok; then
9055 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9058 echo "Your $zzz is $fpossize bytes long."
9064 echo "(I can't compile the test program. Guessing...)" >&4
9065 rp="What is the size of your file positions (in bytes)?"
9070 # Backward compatibility (uselfs is deprecated).
9072 "$define"|true|[yY]*)
9075 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
9077 uselargefiles="$define"
9081 case "$lseeksize:$fpossize" in
9084 You can have files larger than 2 gigabytes.
9087 *) case "$uselargefiles" in
9088 "$undef"|false|[nN]*) dflt='n' ;;
9093 Perl can be built to understand large files (files larger than 2 gigabytes)
9094 on some systems. To do so, Configure can be run with -Duselargefiles.
9096 If this doesn't make any sense to you, just accept the default '$dflt'.
9098 rp='Try to understand large files, if available?'
9101 y|Y) val="$define" ;;
9108 : Look for a hint-file generated 'call-back-unit'. If the
9109 : user has specified that a large files perl is to be built,
9110 : we may need to set or change some other defaults.
9111 if $test -f uselargefiles.cbu; then
9112 echo "Your platform has some specific hints regarding large file builds, using them..."
9113 . ./uselargefiles.cbu
9115 case "$uselargefiles" in
9117 if $test -f uselargefiles.cbu; then
9119 echo "Rechecking to see how big your file offsets are..." >&4
9121 #include <sys/types.h>
9125 printf("%d\n", (int)sizeof($lseektype));
9130 if eval $compile_ok; then
9131 lseeksize=`$run ./try`
9132 $echo "Your file offsets are now $lseeksize bytes long."
9136 echo "(I can't seem to compile the test program. Guessing...)"
9137 rp="What is the size of your file offsets (in bytes)?"
9142 *_t) zzz="$fpostype" ;;
9145 $echo $n "Rechecking the size of $zzz...$c" >&4
9147 #include <sys/types.h>
9154 printf("%d\n", (int)sizeof($fpostype));
9159 if eval $compile_ok; then
9164 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9167 echo " $fpossize bytes." >&4
9173 echo "(I can't compile the test program. Guessing...)" >&4
9174 rp="What is the size of your file positions (in bytes)?"
9183 case "$vendorprefix" in
9184 '') d_vendorbin="$undef"
9188 *) d_vendorbin="$define"
9189 : determine where vendor-supplied executables go.
9190 case "$vendorbin" in
9191 '') dflt=$vendorprefix/bin ;;
9192 *) dflt="$vendorbin" ;;
9195 rp='Pathname for the vendor-supplied executables directory?'
9198 vendorbinexp="$ansexp"
9204 case "$vendorprefix" in
9205 '') vendorhtml1dir=''
9206 vendorhtml1direxp=''
9208 *) : determine where vendor-supplied html pages go.
9209 : There is no standard location, so try to copy the previously-selected
9210 : directory structure for the core html pages.
9211 : XXX Better default suggestions would be welcome.
9212 case "$vendorhtml1dir" in
9213 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9214 *) dflt=$vendorhtml1dir ;;
9217 ''|' ') dflt=none ;;
9220 rp='Pathname for the vendor-supplied html pages?'
9222 vendorhtml1dir="$ans"
9223 vendorhtml1direxp="$ansexp"
9226 : Use ' ' for none so value is preserved next time through Configure
9227 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9228 prefixvar=vendorhtml1dir
9231 case "$vendorprefix" in
9232 '') vendorhtml3dir=''
9233 vendorhtml3direxp=''
9235 *) : determine where vendor-supplied module html pages go.
9236 : There is no standard location, so try to copy the previously-selected
9237 : directory structure for the core html pages.
9238 : XXX Better default suggestions would be welcome.
9239 case "$vendorhtml3dir" in
9240 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9241 *) dflt=$vendorhtml3dir ;;
9244 ''|' ') dflt=none ;;
9247 rp='Pathname for the vendor-supplied html pages?'
9249 vendorhtml3dir="$ans"
9250 vendorhtml3direxp="$ansexp"
9253 : Use ' ' for none so value is preserved next time through Configure
9254 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9255 prefixvar=vendorhtml3dir
9258 case "$vendorprefix" in
9259 '') vendorman1dir=''
9262 *) : determine where vendor-supplied manual pages go.
9263 case "$vendorman1dir" in
9264 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9265 *) dflt=$vendorman1dir ;;
9268 ''|' ') dflt=none ;;
9271 rp='Pathname for the vendor-supplied manual section 1 pages?'
9273 vendorman1dir="$ans"
9274 vendorman1direxp="$ansexp"
9277 : Use ' ' for none so value is preserved next time through Configure
9278 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
9279 prefixvar=vendorman1dir
9282 case "$vendorprefix" in
9283 '') vendorman3dir=''
9286 *) : determine where vendor-supplied module manual pages go.
9287 case "$vendorman3dir" in
9288 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9289 *) dflt=$vendorman3dir ;;
9292 ''|' ') dflt=none ;;
9295 rp='Pathname for the vendor-supplied manual section 3 pages?'
9297 vendorman3dir="$ans"
9298 vendorman3direxp="$ansexp"
9301 : Use ' ' for none so value is preserved next time through Configure
9302 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
9303 prefixvar=vendorman3dir
9306 case "$vendorprefix" in
9307 '') d_vendorscript="$undef"
9311 *) d_vendorscript="$define"
9312 : determine where vendor-supplied scripts go.
9313 case "$vendorscript" in
9314 '') dflt=$vendorprefix/script
9315 $test -d $dflt || dflt=$vendorbin ;;
9316 *) dflt="$vendorscript" ;;
9320 The installation process will create a directory for
9321 vendor-supplied scripts.
9325 rp='Pathname for the vendor-supplied scripts directory?'
9328 vendorscriptexp="$ansexp"
9331 prefixvar=vendorscript
9334 : see if qgcvt exists
9340 if $test X"$d_longdbl" = X"$define"; then
9342 echo "Checking how to print long doubles..." >&4
9344 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
9345 $cat >try.c <<'EOCP'
9346 #include <sys/types.h>
9350 printf("%.3f\n", d);
9354 if eval $compile; then
9358 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
9359 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
9360 echo "We will use %f."
9366 if $test X"$sPRIfldbl" = X; then
9367 $cat >try.c <<'EOCP'
9368 #include <sys/types.h>
9371 long double d = 123.456;
9372 printf("%.3Lf\n", d);
9376 if eval $compile; then
9380 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
9381 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
9382 echo "We will use %Lf."
9388 if $test X"$sPRIfldbl" = X; then
9389 $cat >try.c <<'EOCP'
9390 #include <sys/types.h>
9393 long double d = 123.456;
9394 printf("%.3llf\n", d);
9398 if eval $compile; then
9402 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
9403 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
9404 echo "We will use %llf."
9410 if $test X"$sPRIfldbl" = X; then
9411 $cat >try.c <<'EOCP'
9412 #include <sys/types.h>
9415 long double d = 123.456;
9416 printf("%.3lf\n", d);
9420 if eval $compile; then
9424 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
9425 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
9426 echo "We will use %lf."
9432 if $test X"$sPRIfldbl" = X; then
9433 echo "Cannot figure out how to print long doubles." >&4
9435 sSCNfldbl=$sPRIfldbl # expect consistency
9442 case "$sPRIfldbl" in
9443 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
9444 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
9445 d_SCNfldbl="$undef";
9447 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
9448 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
9449 d_SCNfldbl="$define";
9453 : Check how to convert floats to strings.
9455 if test "X$d_Gconvert" = X; then
9458 echo "Checking for an efficient way to convert floats to strings."
9460 case "$uselongdouble" in
9461 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
9463 case "$d_longdbl" in
9464 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
9466 case "$d_PRIgldbl" in
9467 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
9471 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
9472 char *myname = "gconvert";
9475 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
9476 char *myname = "gcvt";
9479 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
9480 char *myname = "qgcvt";
9481 #define DOUBLETYPE long double
9484 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9486 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
9488 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
9491 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
9493 char *myname = "sprintf";
9497 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9498 #define DOUBLETYPE long double
9500 #define DOUBLETYPE double
9506 #define I_STDLIB $i_stdlib
9512 checkit(expect, got)
9516 if (strcmp(expect, got)) {
9517 printf("%s oddity: Expected %s, got %s\n",
9518 myname, expect, got);
9528 /* This must be 1st test on (which?) platform */
9529 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
9530 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
9531 checkit("0.1", buf);
9533 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
9534 checkit("0.01", buf);
9536 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
9537 checkit("0.001", buf);
9539 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
9540 checkit("0.0001", buf);
9542 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
9543 if (strlen(buf) > 5)
9544 checkit("9e-005", buf); /* for Microsoft ?? */
9546 checkit("9e-05", buf);
9548 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
9551 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
9552 checkit("1.1", buf);
9554 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
9555 checkit("1.01", buf);
9557 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
9558 checkit("1.001", buf);
9560 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
9561 checkit("1.0001", buf);
9563 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
9564 checkit("1.00001", buf);
9566 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
9567 checkit("1.000001", buf);
9569 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
9572 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
9575 /* Some Linux gcvt's give 1.e+5 here. */
9576 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
9577 checkit("100000", buf);
9579 /* Some Linux gcvt's give -1.e+5 here. */
9580 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
9581 checkit("-100000", buf);
9583 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
9584 checkit("123.456", buf);
9586 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
9587 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
9588 /* 34 should be enough to scare even long double
9589 * places into using the e notation. */
9590 if (strlen(buf) > 5)
9591 checkit("1e+034", buf); /* for Microsoft */
9593 checkit("1e+34", buf);
9595 /* For Perl, if you add additional tests here, also add them to
9596 * t/base/num.t for benefit of platforms not using Configure or
9597 * overriding d_Gconvert */
9602 : first add preferred functions to our list
9604 for xxx_convert in $gconvert_preference; do
9605 case $xxx_convert in
9606 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
9607 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
9610 : then add any others
9611 for xxx_convert in gconvert gcvt sprintf; do
9614 *) xxx_list="$xxx_list $xxx_convert" ;;
9618 case "$d_longdbl$uselongdouble" in
9620 : again, add prefered functions to our list first
9622 for xxx_convert in $gconvert_ld_preference; do
9623 case $xxx_convert in
9624 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9625 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
9628 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
9629 for xxx_convert in qgcvt sprintf $xxx_list; do
9630 case "$xxx_ld_list" in
9631 $xxx_convert*|*" $xxx_convert"*) ;;
9632 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9635 : if sprintf cannot do long doubles, move it to the end
9636 if test "$d_PRIgldbl" != "$define"; then
9637 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
9639 : if no qgcvt, remove it
9640 if test "$d_qgcvt" != "$define"; then
9641 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
9644 xxx_list="$xxx_ld_list"
9648 for xxx_convert in $xxx_list; do
9649 echo "Trying $xxx_convert..."
9650 $rm -f try try$_o core
9651 set try -DTRY_$xxx_convert
9652 if eval $compile; then
9653 echo "$xxx_convert() found." >&4
9655 echo "I'll use $xxx_convert to convert floats into a string." >&4
9658 echo "...But $xxx_convert didn't work as I expected."
9662 echo "$xxx_convert NOT found." >&4
9666 if test X$xxx_convert = X; then
9667 echo "*** WHOA THERE!!! ***" >&4
9668 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
9672 case "$xxx_convert" in
9673 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
9674 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
9675 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
9676 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
9677 "$define$define$define")
9678 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
9679 "$define$define$undef")
9680 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
9681 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
9689 : see if _fwalk exists
9693 : Initialize h_fcntl
9696 : Initialize h_sysfile
9699 : access call always available on UNIX
9703 : locate the flags for 'access()'
9707 $cat >access.c <<EOCP
9708 #include <sys/types.h>
9713 #include <sys/file.h>
9726 : check sys/file.h first, no particular reason here
9727 if $test `./findhdr sys/file.h` && \
9728 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
9730 echo "<sys/file.h> defines the *_OK access constants." >&4
9731 elif $test `./findhdr fcntl.h` && \
9732 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
9734 echo "<fcntl.h> defines the *_OK access constants." >&4
9735 elif $test `./findhdr unistd.h` && \
9736 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
9737 echo "<unistd.h> defines the *_OK access constants." >&4
9739 echo "I can't find the four *_OK access constants--I'll use mine." >&4
9745 : see if accessx exists
9746 set accessx d_accessx
9749 : see if aintl exists
9753 : see if alarm exists
9757 : see if POSIX threads are available
9758 set pthread.h i_pthread
9761 : define a fucntion to check prototypes
9762 $cat > protochk <<EOSH
9765 optimize="$optimize"
9767 prototype="$prototype"
9770 usethreads=$usethreads
9771 i_pthread=$i_pthread
9772 pthread_h_first=$pthread_h_first
9775 $cat >> protochk <<'EOSH'
9780 while test $# -ge 2; do
9782 $define) echo "#include <$2>" >> try.c ;;
9783 literal) echo "$2" >> try.c ;;
9785 # Extra magic for the benefit of systems that need pthread.h
9786 # to be included early to correctly detect threadsafe functions.
9787 # Such functions must guarantee themselves, though, that the usethreads
9788 # and i_pthread have been defined, before calling protochk.
9789 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
9790 echo "#include <pthread.h>" >> try.c
9795 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
9796 cat >> try.c <<'EOCP'
9797 #ifdef CAN_PROTOTYPE
9798 #define _(args) args
9803 echo "$foo" >> try.c
9804 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
9805 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
9813 hasproto='varname=$1; func=$2; shift; shift;
9814 while $test $# -ge 2; do
9816 $define) echo "#include <$2>";;
9820 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
9821 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
9822 echo "$func() prototype found.";
9825 echo "$func() prototype NOT found.";
9832 : see if sys/types.h has to be included
9833 set sys/types.h i_systypes
9836 : see if sys/select.h has to be included
9837 set sys/select.h i_sysselct
9840 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
9841 while $test $# -ge 2; do
9843 $define) echo "#include <$2>";;
9847 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
9849 if eval $compile; then
9858 : see if we should include time.h, sys/time.h, or both
9860 if test "X$timeincl" = X; then
9861 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
9862 $echo $n "I'm now running the test program...$c"
9864 #include <sys/types.h>
9869 #ifdef SYSTIMEKERNEL
9872 #include <sys/time.h>
9875 #include <sys/select.h>
9888 struct timezone tzp;
9890 if (foo.tm_sec == foo.tm_sec)
9893 if (bar.tv_sec == bar.tv_sec)
9900 for s_timezone in '-DS_TIMEZONE' ''; do
9902 for s_timeval in '-DS_TIMEVAL' ''; do
9903 for i_systimek in '' '-DSYSTIMEKERNEL'; do
9904 for i_time in '' '-DI_TIME'; do
9905 for i_systime in '-DI_SYSTIME' ''; do
9908 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
9909 if eval $compile; then
9910 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
9914 $echo $n "Succeeded with $flags$c"
9926 *SYSTIMEKERNEL*) i_systimek="$define"
9927 timeincl=`./findhdr sys/time.h`
9928 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
9929 *) i_systimek="$undef";;
9932 *I_TIME*) i_time="$define"
9933 timeincl=`./findhdr time.h`" $timeincl"
9934 echo "We'll include <time.h>." >&4;;
9935 *) i_time="$undef";;
9938 *I_SYSTIME*) i_systime="$define"
9939 timeincl=`./findhdr sys/time.h`" $timeincl"
9940 echo "We'll include <sys/time.h>." >&4;;
9941 *) i_systime="$undef";;
9945 : see if struct tm knows about tm_zone
9946 case "$i_systime$i_time" in
9949 echo "Checking to see if your struct tm has tm_zone field..." >&4
9950 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
9958 case "$d_tm_tm_zone" in
9959 "$define") echo "Yes, it does." ;;
9960 *) echo "No, it doesn't." ;;
9962 : see if struct tm knows about tm_gmtoff
9963 case "$i_systime$i_time" in
9966 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
9967 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
9975 case "$d_tm_tm_gmtoff" in
9976 "$define") echo "Yes, it does." ;;
9977 *) echo "No, it doesn't." ;;
9980 : see if asctime_r exists
9981 set asctime_r d_asctime_r
9983 case "$d_asctime_r" in
9985 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
9986 case "$d_asctime_r_proto:$usethreads" in
9987 ":define") d_asctime_r_proto=define
9988 set d_asctime_r_proto asctime_r $hdrs
9992 case "$d_asctime_r_proto" in
9994 case "$asctime_r_proto" in
9995 ''|0) try='char* asctime_r(const struct tm*, char*);'
9996 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SB ;;
9998 case "$asctime_r_proto" in
9999 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
10000 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SBI ;;
10002 case "$asctime_r_proto" in
10003 ''|0) try='int asctime_r(const struct tm*, char*);'
10004 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SB ;;
10006 case "$asctime_r_proto" in
10007 ''|0) try='int asctime_r(const struct tm*, char*, int);'
10008 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SBI ;;
10010 case "$asctime_r_proto" in
10011 ''|0) d_asctime_r=undef
10013 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
10014 * ) case "$asctime_r_proto" in
10015 REENTRANT_PROTO*) ;;
10016 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
10018 echo "Prototype: $try" ;;
10021 *) case "$usethreads" in
10022 define) echo "asctime_r has no prototype, not using it." >&4 ;;
10029 *) asctime_r_proto=0
10033 : see if atolf exists
10037 : see if atoll exists
10041 : Look for GCC-style attribute format
10042 case "$d_attribute_format" in
10045 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
10046 $cat >attrib.c <<'EOCP'
10048 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
10050 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10051 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10052 echo "Your C compiler doesn't support __attribute__((format))."
10055 echo "Your C compiler supports __attribute__((format))."
10059 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10063 *) val="$d_attribute_format" ;;
10065 set d_attribute_format
10069 : Look for GCC-style attribute format with null format allowed
10070 case "$d_printf_format_null" in
10071 '') case "$d_attribute_format" in
10074 echo "Checking whether your compiler allows __printf__ format to be null ..." >&4
10075 $cat >attrib.c <<EOCP
10077 #$i_stdlib I_STDLIB
10079 #include <stdlib.h>
10081 int null_printf (char* pat,...) __attribute__((__format__(__printf__,1,2)));
10082 int null_printf (char* pat,...) { return (int)pat; }
10083 int main () { exit(null_printf(NULL)); }
10085 if $cc $ccflags -o attrib attrib.c >attrib.out 2>&1 ; then
10086 : run the executable in case it produces a run-time warning
10087 if $run ./attrib >>attrib.out 2>&1; then
10088 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10089 echo "Your C compiler doesn't allow __printf__ format to be null."
10092 echo "Your C compiler allows __printf__ format to be null."
10096 echo "Your C compiler executable failed with __printf__ format null."
10100 echo "Your C compiler fails with __printf__ format null."
10107 *) val="$d_printf_format_null" ;;
10109 set d_printf_format_null
10113 : Look for GCC-style attribute malloc
10114 case "$d_attribute_malloc" in
10117 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
10118 $cat >attrib.c <<'EOCP'
10120 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
10122 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10123 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10124 echo "Your C compiler doesn't support __attribute__((malloc))."
10127 echo "Your C compiler supports __attribute__((malloc))."
10131 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10135 *) val="$d_attribute_malloc" ;;
10137 set d_attribute_malloc
10141 : Look for GCC-style attribute nonnull
10142 case "$d_attribute_nonnull" in
10145 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
10146 $cat >attrib.c <<'EOCP'
10148 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
10150 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10151 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10152 echo "Your C compiler doesn't support __attribute__((nonnull))."
10155 echo "Your C compiler supports __attribute__((nonnull))."
10159 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10163 *) val="$d_attribute_nonnull" ;;
10165 set d_attribute_nonnull
10169 : Look for GCC-style attribute noreturn
10170 case "$d_attribute_noreturn" in
10173 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
10174 $cat >attrib.c <<'EOCP'
10176 void fall_over_dead( void ) __attribute__((noreturn));
10178 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10179 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10180 echo "Your C compiler doesn't support __attribute__((noreturn))."
10183 echo "Your C compiler supports __attribute__((noreturn))."
10187 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10191 *) val="$d_attribute_noreturn" ;;
10193 set d_attribute_noreturn
10197 : Look for GCC-style attribute pure
10198 case "$d_attribute_pure" in
10201 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
10202 $cat >attrib.c <<'EOCP'
10204 int square( int n ) __attribute__((pure));
10206 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10207 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10208 echo "Your C compiler doesn't support __attribute__((pure))."
10211 echo "Your C compiler supports __attribute__((pure))."
10215 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10219 *) val="$d_attribute_pure" ;;
10221 set d_attribute_pure
10225 : Look for GCC-style attribute unused
10226 case "$d_attribute_unused" in
10229 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
10230 $cat >attrib.c <<'EOCP'
10232 int do_something( int dummy __attribute__((unused)), int n );
10234 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10235 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10236 echo "Your C compiler doesn't support __attribute__((unused))."
10239 echo "Your C compiler supports __attribute__((unused))."
10243 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10247 *) val="$d_attribute_unused" ;;
10249 set d_attribute_unused
10253 : Look for GCC-style attribute warn_unused_result
10254 case "$d_attribute_warn_unused_result" in
10257 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
10258 $cat >attrib.c <<'EOCP'
10260 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
10262 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10263 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10264 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
10267 echo "Your C compiler supports __attribute__((warn_unused_result))."
10271 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10275 *) val="$d_attribute_warn_unused_result" ;;
10277 set d_attribute_warn_unused_result
10281 : see if bcmp exists
10285 : see if bcopy exists
10289 : see if getpgrp exists
10290 set getpgrp d_getpgrp
10293 case "$d_getpgrp" in
10296 echo "Checking to see which flavor of getpgrp is in use..."
10298 #$i_unistd I_UNISTD
10299 #include <sys/types.h>
10301 # include <unistd.h>
10303 #$i_stdlib I_STDLIB
10305 #include <stdlib.h>
10309 if (getuid() == 0) {
10310 printf("(I see you are running Configure as super-user...)\n");
10313 #ifdef TRY_BSD_PGRP
10314 if (getpgrp(1) == 0)
10323 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10324 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
10326 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10327 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
10330 echo "I can't seem to compile and run the test program."
10332 xxx="a USG one, i.e. you use getpgrp()."
10334 # SVR4 systems can appear rather BSD-ish.
10335 case "$i_unistd" in
10337 xxx="a BSD one, i.e. you use getpgrp(pid)."
10341 xxx="probably a USG one, i.e. you use getpgrp()."
10346 echo "Assuming your getpgrp is $xxx" >&4
10355 : see if setpgrp exists
10356 set setpgrp d_setpgrp
10359 case "$d_setpgrp" in
10362 echo "Checking to see which flavor of setpgrp is in use..."
10364 #$i_unistd I_UNISTD
10365 #include <sys/types.h>
10367 # include <unistd.h>
10369 #$i_stdlib I_STDLIB
10371 #include <stdlib.h>
10375 if (getuid() == 0) {
10376 printf("(I see you are running Configure as super-user...)\n");
10379 #ifdef TRY_BSD_PGRP
10380 if (-1 == setpgrp(1, 1))
10383 if (setpgrp() != -1)
10389 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10390 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
10392 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10393 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
10396 echo "(I can't seem to compile and run the test program.)"
10398 xxx="a USG one, i.e. you use setpgrp()."
10400 # SVR4 systems can appear rather BSD-ish.
10401 case "$i_unistd" in
10403 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
10407 xxx="probably a USG one, i.e. you use setpgrp()."
10412 echo "Assuming your setpgrp is $xxx" >&4
10421 : Look for GCC-style __builtin_choose_expr
10422 case "$d_builtin_choose_expr" in
10425 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
10426 $cat >try.c <<'EOCP'
10427 #include <assert.h>
10428 #include <stdlib.h>
10431 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
10434 assert( SYRINX(1) == 2112 );
10435 assert( SYRINX(1) != 5150 );
10436 assert( SYRINX(0) == 5150 );
10437 assert( SYRINX(0) != 2112 );
10438 puts( "All good!" );
10444 if eval $compile; then
10445 echo "Your C compiler supports __builtin_choose_expr."
10448 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
10452 *) val="$d_builtin_choose_expr" ;;
10455 set d_builtin_choose_expr
10459 : Look for GCC-style __builtin_expect
10460 case "$d_builtin_expect" in
10463 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
10464 $cat >builtin.c <<'EOCP'
10467 if ( __builtin_expect(n, 0) ) n = 1;
10471 if eval $compile; then
10472 echo "Your C compiler supports __builtin_choose_expr."
10475 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
10479 *) val="$d_builtin_expect" ;;
10482 set d_builtin_expect
10486 : see if bzero exists
10490 : see if stdarg is available
10492 if $test `./findhdr stdarg.h`; then
10493 echo "<stdarg.h> found." >&4
10496 echo "<stdarg.h> NOT found." >&4
10500 : see if varags is available
10502 if $test `./findhdr varargs.h`; then
10503 echo "<varargs.h> found." >&4
10505 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
10508 : set up the varargs testing programs
10509 $cat > varargs.c <<EOP
10511 #include <stdarg.h>
10514 #include <varargs.h>
10518 int f(char *p, ...)
10532 p = va_arg(ap, char *);
10538 $cat > varargs <<EOP
10540 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
10549 : now check which varargs header should be included
10554 if `./varargs I_STDARG`; then
10556 elif `./varargs I_VARARGS`; then
10561 if `./varargs I_VARARGS`; then
10568 echo "I could not find the definition for va_dcl... You have problems..." >&4
10569 val="$undef"; set i_stdarg; eval $setvar
10570 val="$undef"; set i_varargs; eval $setvar
10575 case "$i_varhdr" in
10577 val="$define"; set i_stdarg; eval $setvar
10578 val="$undef"; set i_varargs; eval $setvar
10581 val="$undef"; set i_stdarg; eval $setvar
10582 val="$define"; set i_varargs; eval $setvar
10585 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
10589 : see if the Compiler supports C99 variadic macros
10590 case "$i_stdarg$i_stdlib" in
10592 echo "You have <stdarg.h> and <stdlib.h>, so checking for C99 variadic macros." >&4
10595 #include <stdarg.h>
10597 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
10601 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
10607 if eval $compile && $run ./try 2>&1 >/dev/null; then
10608 case "`$run ./try`" in
10610 echo "You have C99 variadic macros." >&4
10611 d_c99_variadic_macros="$define"
10614 echo "You don't have functional C99 variadic macros." >&4
10615 d_c99_variadic_macros="$undef"
10619 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
10620 d_c99_variadic_macros="$undef"
10625 echo "You don't have <stdarg.h> and <stdlib.h>, so not checking for C99 variadic macros." >&4
10626 d_c99_variadic_macros="$undef"
10630 : see if signal is declared as pointer to function returning int or void
10632 xxx=`./findhdr signal.h`
10633 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
10634 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10635 echo "You have int (*signal())() instead of void." >&4
10637 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10638 echo "You have void (*signal())()." >&4
10640 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
10641 echo "You have int (*signal())() instead of void." >&4
10643 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
10644 echo "You have void (*signal())()." >&4
10647 case "$d_voidsig" in
10649 echo "I can't determine whether signal handler returns void or int..." >&4
10651 rp="What type does your signal handler return?"
10654 v*) val="$define";;
10658 echo "As you already told me, signal handler returns void." >&4
10661 *) echo "As you already told me, signal handler returns int." >&4
10668 case "$d_voidsig" in
10669 "$define") signal_t="void";;
10670 *) signal_t="int";;
10674 : check for ability to cast large floats to 32-bit ints.
10676 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
10677 if $test "$intsize" -ge 4; then
10684 #$i_stdlib I_STDLIB
10686 #include <stdlib.h>
10688 #include <sys/types.h>
10689 #include <signal.h>
10690 $signal_t blech(int s) { exit(3); }
10697 signal(SIGFPE, blech);
10699 /* Don't let compiler optimize the test away. Store the number
10700 in a writable string for gcc to pass to sscanf under HP/UX.
10702 sprintf(str, "2147483647");
10703 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
10707 /* x86 processors will probably give 0x8000 0000, which is a
10708 sign change. We don't want that. We want to mimic SPARC
10709 behavior here, which is to preserve the sign and give
10712 if (i32 != ($xxx) f)
10718 if eval $compile_ok; then
10722 echo "(I can't seem to compile the test program--assuming it can't)"
10727 echo "Yup, it can."
10730 echo "Nope, it can't."
10737 : check for ability to cast negative floats to unsigned
10739 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
10742 #$i_stdlib I_STDLIB
10744 #include <stdlib.h>
10746 #include <sys/types.h>
10747 #include <signal.h>
10748 $signal_t blech(int s) { exit(7); }
10749 $signal_t blech_in_list(int s) { exit(4); }
10750 unsigned long dummy_long(unsigned long p) { return p; }
10751 unsigned int dummy_int(unsigned int p) { return p; }
10752 unsigned short dummy_short(unsigned short p) { return p; }
10756 unsigned long along;
10758 unsigned short ashort;
10762 /* Frustrate gcc-2.7.2's optimizer which failed this test with
10763 a direct f = -123. assignment. gcc-2.8.0 reportedly
10764 optimized the whole file away
10766 /* Store the number in a writable string for gcc to pass to
10767 sscanf under HP/UX.
10769 sprintf(str, "-123");
10770 sscanf(str, "%lf", &f); /* f = -123.; */
10772 signal(SIGFPE, blech);
10773 along = (unsigned long)f;
10774 aint = (unsigned int)f;
10775 ashort = (unsigned short)f;
10776 if (along != (unsigned long)-123)
10778 if (aint != (unsigned int)-123)
10780 if (ashort != (unsigned short)-123)
10782 sprintf(str, "1073741824.");
10783 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
10786 along = (unsigned long)f;
10787 if (along != 0x80000000)
10791 along = (unsigned long)f;
10792 if (along != 0x7fffffff)
10796 along = (unsigned long)f;
10797 if (along != 0x80000001)
10801 signal(SIGFPE, blech_in_list);
10802 sprintf(str, "123.");
10803 sscanf(str, "%lf", &f); /* f = 123.; */
10804 along = dummy_long((unsigned long)f);
10805 aint = dummy_int((unsigned int)f);
10806 ashort = dummy_short((unsigned short)f);
10807 if (along != (unsigned long)123)
10809 if (aint != (unsigned int)123)
10811 if (ashort != (unsigned short)123)
10818 if eval $compile_ok; then
10822 echo "(I can't seem to compile the test program--assuming it can't)"
10825 case "$castflags" in
10827 echo "Yup, it can."
10830 echo "Nope, it can't."
10837 : see if vprintf exists
10839 if set vprintf val -f d_vprintf; eval $csym; $val; then
10840 echo 'vprintf() found.' >&4
10843 #$i_stdarg I_STDARG /* Only one of these can be defined by i_varhrd */
10844 #$i_varargs I_VARARGS
10846 #$i_stdlib I_STDLIB
10847 #$i_unistd I_UNISTD
10850 # include <stdarg.h>
10851 #else /* I_VARARGS */
10852 # include <varargs.h>
10856 # include <unistd.h>
10860 # include <stdlib.h>
10863 #include <stdio.h> /* vsprintf prototype */
10866 void xxx(int n, ...)
10871 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
10873 int main() { xxx(1, "foo"); }
10875 #else /* I_VARARGS */
10883 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
10885 int main() { xxx("foo"); }
10891 if eval $compile_ok; then
10892 if $run ./try; then
10893 echo "Your vsprintf() returns (int)." >&4
10896 echo "Your vsprintf() returns (char*)." >&4
10900 echo 'I am unable to compile the vsprintf() test program.' >&4
10901 # We shouldn't get here. If we do, assume the standard signature,
10902 # not the old BSD one.
10903 echo 'Guessing that vsprintf() returns (int).' >&4
10907 echo 'vprintf() NOT found.' >&4
10918 : see if chown exists
10922 : see if chroot exists
10923 set chroot d_chroot
10926 : see if chsize exists
10927 set chsize d_chsize
10930 : see if class exists
10934 : see if clearenv exists
10935 set clearenv d_clearenv
10938 hasstruct='varname=$1; struct=$2; shift; shift;
10939 while $test $# -ge 2; do
10941 $define) echo "#include <$2>";;
10945 echo "int main () { struct $struct foo; }" >> try.c;
10947 if eval $compile; then
10958 : see whether socket exists
10960 $echo $n "Hmm... $c" >&4
10961 if set socket val -f d_socket; eval $csym; $val; then
10962 echo "Looks like you have Berkeley networking support." >&4
10964 if set setsockopt val -f; eval $csym; $val; then
10967 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
10968 d_oldsock="$define"
10971 if $contains socklib libc.list >/dev/null 2>&1; then
10972 echo "Looks like you have Berkeley networking support." >&4
10974 : we will have to assume that it supports the 4.2 BSD interface
10977 echo "You don't have Berkeley networking in libc$_a..." >&4
10978 if test "X$d_socket" = "X$define"; then
10979 echo "...but you seem to believe that you have sockets." >&4
10981 for net in net socket
10983 if test -f /usr/lib/lib$net$_a; then
10984 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
10985 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
10986 if $contains socket libc.list >/dev/null 2>&1; then
10991 echo "...but the Wollongong group seems to have hacked it in." >&4
10992 sockethdr="-I/usr/netinclude"
10995 echo "Found Berkeley sockets interface in lib$net." >&4
10996 if $contains setsockopt libc.list >/dev/null 2>&1; then
10999 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
11000 d_oldsock="$define"
11006 if test "X$d_socket" != "X$define"; then
11007 echo "or anywhere else I see." >&4
11015 : see if socketpair exists
11016 set socketpair d_sockpair
11021 echo "Checking the availability of certain socket constants..." >&4
11022 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
11023 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
11025 #include <sys/types.h>
11026 #include <sys/socket.h>
11032 set try; if eval $compile; then
11035 set d_${enum}; eval $setvar
11039 : see if this is a sys/uio.h system
11040 set sys/uio.h i_sysuio
11045 echo "Checking to see if your system supports struct cmsghdr..." >&4
11046 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
11048 case "$d_cmsghdr_s" in
11049 "$define") echo "Yes, it does." ;;
11050 *) echo "No, it doesn't." ;;
11054 : check for const keyword
11056 echo 'Checking to see if your C compiler knows about "const"...' >&4
11057 $cat >const.c <<'EOCP'
11058 typedef struct spug { int drokk; } spug;
11062 const spug y = { 0 };
11065 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
11067 echo "Yup, it does."
11070 echo "Nope, it doesn't."
11075 : see if copysignl exists
11076 set copysignl d_copysignl
11079 : see if crypt exists
11084 $define) cryptlib='' ;;
11085 *) if set crypt val -f d_crypt; eval $csym; $val; then
11086 echo 'crypt() found.' >&4
11090 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
11091 if $test -z "$cryptlib"; then
11092 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
11096 if $test -z "$cryptlib"; then
11097 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
11101 if $test -z "$cryptlib"; then
11102 cryptlib=`./loc libcrypt$_a "" $libpth`
11106 if $test -z "$cryptlib"; then
11107 echo 'crypt() NOT found.' >&4
11118 : see if this is a crypt.h system
11119 set crypt.h i_crypt
11122 : see if crypt_r exists
11123 set crypt_r d_crypt_r
11125 case "$d_crypt_r" in
11127 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
11128 case "$d_crypt_r_proto:$usethreads" in
11129 ":define") d_crypt_r_proto=define
11130 set d_crypt_r_proto crypt_r $hdrs
11134 case "$d_crypt_r_proto" in
11136 case "$crypt_r_proto" in
11137 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
11138 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCS ;;
11140 case "$crypt_r_proto" in
11141 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
11142 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCD ;;
11144 case "$crypt_r_proto" in
11145 ''|0) d_crypt_r=undef
11147 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
11148 * ) case "$crypt_r_proto" in
11149 REENTRANT_PROTO*) ;;
11150 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
11152 echo "Prototype: $try" ;;
11155 *) case "$usethreads" in
11156 define) echo "crypt_r has no prototype, not using it." >&4 ;;
11167 : get csh whereabouts
11169 'csh') val="$undef" ;;
11170 *) val="$define" ;;
11174 : Respect a hint or command line value for full_csh.
11175 case "$full_csh" in
11176 '') full_csh=$csh ;;
11179 : see if ctermid exists
11180 set ctermid d_ctermid
11183 : see if ctermid_r exists
11184 set ctermid_r d_ctermid_r
11186 case "$d_ctermid_r" in
11188 hdrs="$i_systypes sys/types.h define stdio.h "
11189 case "$d_ctermid_r_proto:$usethreads" in
11190 ":define") d_ctermid_r_proto=define
11191 set d_ctermid_r_proto ctermid_r $hdrs
11195 case "$d_ctermid_r_proto" in
11197 case "$ctermid_r_proto" in
11198 ''|0) try='char* ctermid_r(char*);'
11199 ./protochk "extern $try" $hdrs && ctermid_r_proto=B_B ;;
11201 case "$ctermid_r_proto" in
11202 ''|0) d_ctermid_r=undef
11204 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
11205 * ) case "$ctermid_r_proto" in
11206 REENTRANT_PROTO*) ;;
11207 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
11209 echo "Prototype: $try" ;;
11212 *) case "$usethreads" in
11213 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
11220 *) ctermid_r_proto=0
11224 : see if ctime_r exists
11225 set ctime_r d_ctime_r
11227 case "$d_ctime_r" in
11229 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
11230 case "$d_ctime_r_proto:$usethreads" in
11231 ":define") d_ctime_r_proto=define
11232 set d_ctime_r_proto ctime_r $hdrs
11236 case "$d_ctime_r_proto" in
11238 case "$ctime_r_proto" in
11239 ''|0) try='char* ctime_r(const time_t*, char*);'
11240 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SB ;;
11242 case "$ctime_r_proto" in
11243 ''|0) try='char* ctime_r(const time_t*, char*, int);'
11244 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SBI ;;
11246 case "$ctime_r_proto" in
11247 ''|0) try='int ctime_r(const time_t*, char*);'
11248 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SB ;;
11250 case "$ctime_r_proto" in
11251 ''|0) try='int ctime_r(const time_t*, char*, int);'
11252 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SBI ;;
11254 case "$ctime_r_proto" in
11255 ''|0) d_ctime_r=undef
11257 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
11258 * ) case "$ctime_r_proto" in
11259 REENTRANT_PROTO*) ;;
11260 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
11262 echo "Prototype: $try" ;;
11265 *) case "$usethreads" in
11266 define) echo "ctime_r has no prototype, not using it." >&4 ;;
11277 : see if cuserid exists
11278 set cuserid d_cuserid
11281 : see if this is a limits.h system
11282 set limits.h i_limits
11285 : see if this is a float.h system
11286 set float.h i_float
11289 : See if number of significant digits in a double precision number is known
11291 $cat >dbl_dig.c <<EOM
11292 #$i_limits I_LIMITS
11295 #include <limits.h>
11301 printf("Contains DBL_DIG");
11304 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
11305 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
11306 echo "DBL_DIG found." >&4
11309 echo "DBL_DIG NOT found." >&4
11316 : see if dbm.h is available
11317 : see if dbmclose exists
11318 set dbmclose d_dbmclose
11321 case "$d_dbmclose" in
11331 *) set rpcsvc/dbm.h i_rpcsvcdbm
11336 *) echo "We won't be including <dbm.h>"
11346 : see if prototype for dbminit is available
11348 set d_dbminitproto dbminit $i_dbm dbm.h
11351 : see if difftime exists
11352 set difftime d_difftime
11355 : see if this is a dirent system
11357 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
11359 echo "<dirent.h> found." >&4
11362 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
11363 echo "<sys/dir.h> found." >&4
11366 xinc=`./findhdr sys/ndir.h`
11368 echo "<dirent.h> NOT found." >&4
11373 : Look for type of directory structure.
11375 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11377 case "$direntrytype" in
11379 case "$i_dirent" in
11380 $define) guess1='struct dirent' ;;
11381 *) guess1='struct direct' ;;
11384 *) guess1="$direntrytype"
11389 'struct dirent') guess2='struct direct' ;;
11390 *) guess2='struct dirent' ;;
11393 if $contains "$guess1" try.c >/dev/null 2>&1; then
11394 direntrytype="$guess1"
11395 echo "Your directory entries are $direntrytype." >&4
11396 elif $contains "$guess2" try.c >/dev/null 2>&1; then
11397 direntrytype="$guess2"
11398 echo "Your directory entries seem to be $direntrytype." >&4
11400 echo "I don't recognize your system's directory entries." >&4
11401 rp="What type is used for directory entries on this system?"
11404 direntrytype="$ans"
11408 : see if the directory entry stores field length
11410 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11411 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
11412 echo "Good, your directory entry keeps length information in d_namlen." >&4
11415 echo "Your directory entry does not know about the d_namlen field." >&4
11422 : Look for DIR.dd_fd
11423 case "$i_dirent" in
11425 echo "Checking to see if DIR has a dd_fd member variable" >&4
11427 #$i_stdlib I_STDLIB
11429 #include <stdlib.h>
11431 #include <dirent.h>
11441 if eval $compile; then
11442 echo "Yes, it does."
11445 echo "No, it does not."
11450 echo "You don't have a <dirent.h>, so not checking for dd_fd." >&4
11458 : see if this is an sysdir system
11459 set sys/dir.h i_sysdir
11462 : see if this is an sysndir system
11463 set sys/ndir.h i_sysndir
11468 $cat >dirfd.c <<EOM
11470 #$i_stdlib I_STDLIB
11472 #include <stdlib.h>
11474 #$i_dirent I_DIRENT /**/
11475 #$i_sysdir I_SYS_DIR /**/
11476 #$i_sysndir I_SYS_NDIR /**/
11477 #$i_systypes I_SYS_TYPES /**/
11478 #if defined(I_SYS_TYPES)
11479 #include <sys/types.h>
11481 #if defined(I_DIRENT)
11482 #include <dirent.h>
11483 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
11484 #include <sys/dir.h>
11488 #include <sys/ndir.h>
11492 #include <ndir.h> /* may be wrong in the future */
11494 #include <sys/dir.h>
11500 DIR *dirp = opendir(".");
11501 if (dirfd(dirp) >= 0)
11509 if eval $compile; then
11513 $define) echo "dirfd() found." >&4 ;;
11514 *) echo "dirfd() NOT found." >&4 ;;
11520 : see if dlerror exists
11523 set dlerror d_dlerror
11527 : see if dlfcn is available
11528 set dlfcn.h i_dlfcn
11535 On a few systems, the dynamically loaded modules that perl generates and uses
11536 will need a different extension than shared libs. The default will probably
11542 *) dflt="$dlext" ;;
11544 rp='What is the extension of dynamically loaded modules'
11553 : Check if dlsym need a leading underscore
11559 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
11560 $cat >dyna.c <<'EOM'
11567 #$i_stdlib I_STDLIB
11569 #include <stdlib.h>
11573 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
11575 #include <sys/types.h>
11580 extern int fred() ;
11589 int mode = RTLD_LAZY ;
11591 handle = dlopen("./dyna.$dlext", mode) ;
11592 if (handle == NULL) {
11597 symbol = dlsym(handle, "fred") ;
11598 if (symbol == NULL) {
11599 /* try putting a leading underscore */
11600 symbol = dlsym(handle, "_fred") ;
11601 if (symbol == NULL) {
11614 : Call the object file tmp-dyna.o in case dlext=o.
11615 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
11616 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
11617 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
11618 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
11621 1) echo "Test program failed using dlopen." >&4
11622 echo "Perhaps you should not use dynamic loading." >&4;;
11623 2) echo "Test program failed using dlsym." >&4
11624 echo "Perhaps you should not use dynamic loading." >&4;;
11625 3) echo "dlsym needs a leading underscore" >&4
11627 4) echo "dlsym doesn't need a leading underscore." >&4;;
11630 echo "I can't compile and run the test program." >&4
11631 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
11636 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
11641 : see if drand48_r exists
11642 set drand48_r d_drand48_r
11644 case "$d_drand48_r" in
11646 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
11647 case "$d_drand48_r_proto:$usethreads" in
11648 ":define") d_drand48_r_proto=define
11649 set d_drand48_r_proto drand48_r $hdrs
11653 case "$d_drand48_r_proto" in
11655 case "$drand48_r_proto" in
11656 ''|0) try='int drand48_r(struct drand48_data*, double*);'
11657 ./protochk "extern $try" $hdrs && drand48_r_proto=I_ST ;;
11659 case "$drand48_r_proto" in
11660 ''|0) d_drand48_r=undef
11662 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
11663 * ) case "$drand48_r_proto" in
11664 REENTRANT_PROTO*) ;;
11665 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
11667 echo "Prototype: $try" ;;
11670 *) case "$usethreads" in
11671 define) echo "drand48_r has no prototype, not using it." >&4 ;;
11678 *) drand48_r_proto=0
11682 : see if prototype for drand48 is available
11684 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
11687 : see if dup2 exists
11691 : see if eaccess exists
11692 set eaccess d_eaccess
11695 : see if endgrent exists
11696 set endgrent d_endgrent
11699 : see if this is an grp system
11705 xxx=`./findhdr grp.h`
11706 $cppstdin $cppflags $cppminus < $xxx >$$.h
11708 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
11720 set d_grpasswd; eval $setvar
11724 : see if endgrent_r exists
11725 set endgrent_r d_endgrent_r
11727 case "$d_endgrent_r" in
11729 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
11730 case "$d_endgrent_r_proto:$usethreads" in
11731 ":define") d_endgrent_r_proto=define
11732 set d_endgrent_r_proto endgrent_r $hdrs
11736 case "$d_endgrent_r_proto" in
11738 case "$endgrent_r_proto" in
11739 ''|0) try='int endgrent_r(FILE**);'
11740 ./protochk "extern $try" $hdrs && endgrent_r_proto=I_H ;;
11742 case "$endgrent_r_proto" in
11743 ''|0) try='void endgrent_r(FILE**);'
11744 ./protochk "extern $try" $hdrs && endgrent_r_proto=V_H ;;
11746 case "$endgrent_r_proto" in
11747 ''|0) d_endgrent_r=undef
11749 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
11750 * ) case "$endgrent_r_proto" in
11751 REENTRANT_PROTO*) ;;
11752 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
11754 echo "Prototype: $try" ;;
11757 *) case "$usethreads" in
11758 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
11765 *) endgrent_r_proto=0
11769 : see if endhostent exists
11770 set endhostent d_endhent
11773 : see if this is a netdb.h system
11774 set netdb.h i_netdb
11777 : see if endhostent_r exists
11778 set endhostent_r d_endhostent_r
11780 case "$d_endhostent_r" in
11782 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11783 case "$d_endhostent_r_proto:$usethreads" in
11784 ":define") d_endhostent_r_proto=define
11785 set d_endhostent_r_proto endhostent_r $hdrs
11789 case "$d_endhostent_r_proto" in
11791 case "$endhostent_r_proto" in
11792 ''|0) try='int endhostent_r(struct hostent_data*);'
11793 ./protochk "extern $try" $hdrs && endhostent_r_proto=I_D ;;
11795 case "$endhostent_r_proto" in
11796 ''|0) try='void endhostent_r(struct hostent_data*);'
11797 ./protochk "extern $try" $hdrs && endhostent_r_proto=V_D ;;
11799 case "$endhostent_r_proto" in
11800 ''|0) d_endhostent_r=undef
11801 endhostent_r_proto=0
11802 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
11803 * ) case "$endhostent_r_proto" in
11804 REENTRANT_PROTO*) ;;
11805 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
11807 echo "Prototype: $try" ;;
11810 *) case "$usethreads" in
11811 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
11813 d_endhostent_r=undef
11814 endhostent_r_proto=0
11818 *) endhostent_r_proto=0
11822 : see if endnetent exists
11823 set endnetent d_endnent
11826 : see if endnetent_r exists
11827 set endnetent_r d_endnetent_r
11829 case "$d_endnetent_r" in
11831 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11832 case "$d_endnetent_r_proto:$usethreads" in
11833 ":define") d_endnetent_r_proto=define
11834 set d_endnetent_r_proto endnetent_r $hdrs
11838 case "$d_endnetent_r_proto" in
11840 case "$endnetent_r_proto" in
11841 ''|0) try='int endnetent_r(struct netent_data*);'
11842 ./protochk "extern $try" $hdrs && endnetent_r_proto=I_D ;;
11844 case "$endnetent_r_proto" in
11845 ''|0) try='void endnetent_r(struct netent_data*);'
11846 ./protochk "extern $try" $hdrs && endnetent_r_proto=V_D ;;
11848 case "$endnetent_r_proto" in
11849 ''|0) d_endnetent_r=undef
11850 endnetent_r_proto=0
11851 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
11852 * ) case "$endnetent_r_proto" in
11853 REENTRANT_PROTO*) ;;
11854 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
11856 echo "Prototype: $try" ;;
11859 *) case "$usethreads" in
11860 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
11862 d_endnetent_r=undef
11863 endnetent_r_proto=0
11867 *) endnetent_r_proto=0
11871 : see if endprotoent exists
11872 set endprotoent d_endpent
11875 : see if endprotoent_r exists
11876 set endprotoent_r d_endprotoent_r
11878 case "$d_endprotoent_r" in
11880 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11881 case "$d_endprotoent_r_proto:$usethreads" in
11882 ":define") d_endprotoent_r_proto=define
11883 set d_endprotoent_r_proto endprotoent_r $hdrs
11887 case "$d_endprotoent_r_proto" in
11889 case "$endprotoent_r_proto" in
11890 ''|0) try='int endprotoent_r(struct protoent_data*);'
11891 ./protochk "extern $try" $hdrs && endprotoent_r_proto=I_D ;;
11893 case "$endprotoent_r_proto" in
11894 ''|0) try='void endprotoent_r(struct protoent_data*);'
11895 ./protochk "extern $try" $hdrs && endprotoent_r_proto=V_D ;;
11897 case "$endprotoent_r_proto" in
11898 ''|0) d_endprotoent_r=undef
11899 endprotoent_r_proto=0
11900 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
11901 * ) case "$endprotoent_r_proto" in
11902 REENTRANT_PROTO*) ;;
11903 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
11905 echo "Prototype: $try" ;;
11908 *) case "$usethreads" in
11909 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
11911 d_endprotoent_r=undef
11912 endprotoent_r_proto=0
11916 *) endprotoent_r_proto=0
11920 : see if endpwent exists
11921 set endpwent d_endpwent
11924 : see if this is a pwd.h system
11930 xxx=`./findhdr pwd.h`
11931 $cppstdin $cppflags $cppminus < $xxx >$$.h
11933 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
11941 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
11949 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
11957 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
11965 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
11973 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
11981 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
11989 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
12001 set d_pwquota; eval $setvar
12002 set d_pwage; eval $setvar
12003 set d_pwchange; eval $setvar
12004 set d_pwclass; eval $setvar
12005 set d_pwexpire; eval $setvar
12006 set d_pwcomment; eval $setvar
12007 set d_pwgecos; eval $setvar
12008 set d_pwpasswd; eval $setvar
12012 : see if endpwent_r exists
12013 set endpwent_r d_endpwent_r
12015 case "$d_endpwent_r" in
12017 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
12018 case "$d_endpwent_r_proto:$usethreads" in
12019 ":define") d_endpwent_r_proto=define
12020 set d_endpwent_r_proto endpwent_r $hdrs
12024 case "$d_endpwent_r_proto" in
12026 case "$endpwent_r_proto" in
12027 ''|0) try='int endpwent_r(FILE**);'
12028 ./protochk "extern $try" $hdrs && endpwent_r_proto=I_H ;;
12030 case "$endpwent_r_proto" in
12031 ''|0) try='void endpwent_r(FILE**);'
12032 ./protochk "extern $try" $hdrs && endpwent_r_proto=V_H ;;
12034 case "$endpwent_r_proto" in
12035 ''|0) d_endpwent_r=undef
12037 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
12038 * ) case "$endpwent_r_proto" in
12039 REENTRANT_PROTO*) ;;
12040 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
12042 echo "Prototype: $try" ;;
12045 *) case "$usethreads" in
12046 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
12053 *) endpwent_r_proto=0
12057 : see if endservent exists
12058 set endservent d_endsent
12061 : see if endservent_r exists
12062 set endservent_r d_endservent_r
12064 case "$d_endservent_r" in
12066 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12067 case "$d_endservent_r_proto:$usethreads" in
12068 ":define") d_endservent_r_proto=define
12069 set d_endservent_r_proto endservent_r $hdrs
12073 case "$d_endservent_r_proto" in
12075 case "$endservent_r_proto" in
12076 ''|0) try='int endservent_r(struct servent_data*);'
12077 ./protochk "extern $try" $hdrs && endservent_r_proto=I_D ;;
12079 case "$endservent_r_proto" in
12080 ''|0) try='void endservent_r(struct servent_data*);'
12081 ./protochk "extern $try" $hdrs && endservent_r_proto=V_D ;;
12083 case "$endservent_r_proto" in
12084 ''|0) d_endservent_r=undef
12085 endservent_r_proto=0
12086 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
12087 * ) case "$endservent_r_proto" in
12088 REENTRANT_PROTO*) ;;
12089 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
12091 echo "Prototype: $try" ;;
12094 *) case "$usethreads" in
12095 define) echo "endservent_r has no prototype, not using it." >&4 ;;
12097 d_endservent_r=undef
12098 endservent_r_proto=0
12102 *) endservent_r_proto=0
12106 : Locate the flags for 'open()'
12109 #include <sys/types.h>
12114 #include <sys/file.h>
12116 #$i_stdlib I_STDLIB
12118 #include <stdlib.h>
12129 : check sys/file.h first to get FREAD on Sun
12130 if $test `./findhdr sys/file.h` && \
12131 set try -DI_SYS_FILE && eval $compile; then
12133 echo "<sys/file.h> defines the O_* constants..." >&4
12134 if $run ./try; then
12135 echo "and you have the 3 argument form of open()." >&4
12138 echo "but not the 3 argument form of open(). Oh, well." >&4
12141 elif $test `./findhdr fcntl.h` && \
12142 set try -DI_FCNTL && eval $compile; then
12144 echo "<fcntl.h> defines the O_* constants..." >&4
12145 if $run ./try; then
12146 echo "and you have the 3 argument form of open()." >&4
12149 echo "but not the 3 argument form of open(). Oh, well." >&4
12154 echo "I can't find the O_* constant definitions! You got problems." >&4
12160 : see which of string.h or strings.h is needed
12162 strings=`./findhdr string.h`
12163 if $test "$strings" && $test -r "$strings"; then
12164 echo "Using <string.h> instead of <strings.h>." >&4
12168 strings=`./findhdr strings.h`
12169 if $test "$strings" && $test -r "$strings"; then
12170 echo "Using <strings.h> instead of <string.h>." >&4
12172 echo "No string header found -- You'll surely have problems." >&4
12177 case "$i_string" in
12178 "$undef") strings=`./findhdr strings.h`;;
12179 *) strings=`./findhdr string.h`;;
12182 : see if this is a sys/file.h system
12187 : do we need to include sys/file.h ?
12191 if $h_sysfile; then
12193 echo "We'll be including <sys/file.h>." >&4
12196 echo "We won't be including <sys/file.h>." >&4
12206 : see if fcntl.h is there
12211 : see if we can include fcntl.h
12217 echo "We'll be including <fcntl.h>." >&4
12220 if $h_sysfile; then
12221 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
12223 echo "We won't be including <fcntl.h>." >&4
12235 : see if fork exists
12239 : see if pipe exists
12243 : check for non-blocking I/O stuff
12244 case "$h_sysfile" in
12245 true) echo "#include <sys/file.h>" > head.c;;
12248 true) echo "#include <fcntl.h>" > head.c;;
12249 *) echo "#include <sys/fcntl.h>" > head.c;;
12254 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
12255 case "$o_nonblock" in
12257 $cat head.c > try.c
12258 $cat >>try.c <<EOCP
12260 #$i_stdlib I_STDLIB
12262 #include <stdlib.h>
12270 printf("O_NONBLOCK\n");
12274 printf("O_NDELAY\n");
12278 printf("FNDELAY\n");
12285 if eval $compile_ok; then
12286 o_nonblock=`$run ./try`
12287 case "$o_nonblock" in
12288 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
12289 *) echo "Seems like we can use $o_nonblock.";;
12292 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
12295 *) echo "Using $hint value $o_nonblock.";;
12300 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
12303 case "$d_fork:$d_pipe" in
12305 $cat head.c > try.c
12306 $cat >>try.c <<EOCP
12308 #include <sys/types.h>
12309 #include <signal.h>
12311 #$i_stdlib I_STDLIB
12313 #include <stdlib.h>
12319 #define MY_O_NONBLOCK $o_nonblock
12320 #ifndef errno /* XXX need better Configure test */
12323 #$i_unistd I_UNISTD
12325 #include <unistd.h>
12327 #$i_string I_STRING
12329 #include <string.h>
12331 #include <strings.h>
12333 $signal_t blech(int x) { exit(3); }
12335 $cat >> try.c <<'EOCP'
12343 pipe(pd); /* Down: child -> parent */
12344 pipe(pu); /* Up: parent -> child */
12347 close(pd[1]); /* Parent reads from pd[0] */
12348 close(pu[0]); /* Parent writes (blocking) to pu[1] */
12350 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
12355 signal(SIGALRM, blech);
12357 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
12359 sprintf(string, "%d\n", ret);
12360 write(2, string, strlen(string));
12363 if (errno == EAGAIN) {
12364 printf("EAGAIN\n");
12369 if (errno == EWOULDBLOCK)
12370 printf("EWOULDBLOCK\n");
12373 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
12374 sleep(2); /* Give it time to close our pipe */
12376 ret = read(pd[0], buf, 1); /* Should read EOF */
12378 sprintf(string, "%d\n", ret);
12379 write(4, string, strlen(string));
12383 close(pd[0]); /* We write to pd[1] */
12384 close(pu[1]); /* We read from pu[0] */
12385 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
12386 close(pd[1]); /* Pipe pd is now fully closed! */
12387 exit(0); /* Bye bye, thank you for playing! */
12391 if eval $compile_ok; then
12392 echo "$startsh" >mtry
12393 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
12395 ./mtry >/dev/null 2>&1
12397 0) eagain=`$cat try.out`;;
12398 1) echo "Could not perform non-blocking setting!";;
12399 2) echo "I did a successful read() for something that was not there!";;
12400 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
12401 4) echo "Could not find F_SETFL!";;
12402 *) echo "Something terribly wrong happened during testing.";;
12404 rd_nodata=`$cat try.ret`
12405 echo "A read() system call with no data present returns $rd_nodata."
12406 case "$rd_nodata" in
12409 echo "(That's peculiar, fixing that to be -1.)"
12415 echo "Forcing errno EAGAIN on read() with no data available."
12419 echo "Your read() sets errno to $eagain when no data is available."
12422 status=`$cat try.err`
12424 0) echo "And it correctly returns 0 to signal EOF.";;
12425 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
12426 *) echo "However, your read() returns '$status' on EOF??";;
12429 if test "$status" = "$rd_nodata"; then
12430 echo "WARNING: you can't distinguish between EOF and no data!"
12434 echo "I can't compile the test program--assuming errno EAGAIN will do."
12438 *) echo "Can't figure out how to test this--assuming errno EAGAIN will do."
12447 echo "Using $hint value $eagain."
12448 echo "Your read() returns $rd_nodata when no data is present."
12449 case "$d_eofnblk" in
12450 "$define") echo "And you can see EOF because read() returns 0.";;
12451 "$undef") echo "But you can't see EOF status from read() returned value.";;
12453 echo "(Assuming you can't see EOF status from read anyway.)"
12459 $rm_try head.c mtry
12461 : see if _ptr and _cnt from stdio act std
12464 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
12465 echo "(Looks like you have stdio.h from BSD.)"
12466 case "$stdio_ptr" in
12467 '') stdio_ptr='((fp)->_p)'
12470 *) ptr_lval=$d_stdio_ptr_lval;;
12472 case "$stdio_cnt" in
12473 '') stdio_cnt='((fp)->_r)'
12476 *) cnt_lval=$d_stdio_cnt_lval;;
12478 case "$stdio_base" in
12479 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
12481 case "$stdio_bufsiz" in
12482 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
12484 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
12485 echo "(Looks like you have stdio.h from Linux.)"
12486 case "$stdio_ptr" in
12487 '') stdio_ptr='((fp)->_IO_read_ptr)'
12490 *) ptr_lval=$d_stdio_ptr_lval;;
12492 case "$stdio_cnt" in
12493 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
12496 *) cnt_lval=$d_stdio_cnt_lval;;
12498 case "$stdio_base" in
12499 '') stdio_base='((fp)->_IO_read_base)';;
12501 case "$stdio_bufsiz" in
12502 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
12505 case "$stdio_ptr" in
12506 '') stdio_ptr='((fp)->_ptr)'
12509 *) ptr_lval=$d_stdio_ptr_lval;;
12511 case "$stdio_cnt" in
12512 '') stdio_cnt='((fp)->_cnt)'
12515 *) cnt_lval=$d_stdio_cnt_lval;;
12517 case "$stdio_base" in
12518 '') stdio_base='((fp)->_base)';;
12520 case "$stdio_bufsiz" in
12521 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
12525 : test whether _ptr and _cnt really work
12526 echo "Checking how std your stdio is..." >&4
12529 #$i_stdlib I_STDLIB
12531 #include <stdlib.h>
12533 #define FILE_ptr(fp) $stdio_ptr
12534 #define FILE_cnt(fp) $stdio_cnt
12536 FILE *fp = fopen("try.c", "r");
12539 18 <= FILE_cnt(fp) &&
12540 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12548 if eval $compile && $to try.c; then
12549 if $run ./try; then
12550 echo "Your stdio acts pretty std."
12553 echo "Your stdio isn't very std."
12556 echo "Your stdio doesn't appear very std."
12560 # glibc 2.2.90 and above apparently change stdio streams so Perl's
12561 # direct buffer manipulation no longer works. The Configure tests
12562 # should be changed to correctly detect this, but until then,
12563 # the following check should at least let perl compile and run.
12564 # (This quick fix should be updated before 5.8.1.)
12565 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
12566 # A. Dougherty, June 3, 2002.
12567 case "$d_gnulibc" in
12569 case "$gnulibc_version" in
12573 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
12582 : Can _ptr be used as an lvalue?
12583 case "$d_stdstdio$ptr_lval" in
12584 $define$define) val=$define ;;
12587 set d_stdio_ptr_lval
12590 : Can _cnt be used as an lvalue?
12591 case "$d_stdstdio$cnt_lval" in
12592 $define$define) val=$define ;;
12595 set d_stdio_cnt_lval
12599 : test whether setting _ptr sets _cnt as a side effect
12600 d_stdio_ptr_lval_sets_cnt="$undef"
12601 d_stdio_ptr_lval_nochange_cnt="$undef"
12602 case "$d_stdio_ptr_lval$d_stdstdio" in
12604 echo "Checking to see what happens if we set the stdio ptr..." >&4
12607 /* Can we scream? */
12608 /* Eat dust sed :-) */
12609 /* In the buffer space, no one can hear you scream. */
12610 #$i_stdlib I_STDLIB
12612 #include <stdlib.h>
12614 #define FILE_ptr(fp) $stdio_ptr
12615 #define FILE_cnt(fp) $stdio_cnt
12616 #include <sys/types.h>
12618 FILE *fp = fopen("try.c", "r");
12623 puts("Fail even to read");
12626 c = getc(fp); /* Read away the first # */
12628 puts("Fail even to read");
12632 18 <= FILE_cnt(fp) &&
12633 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12635 puts("Fail even to read");
12638 ptr = (char*) FILE_ptr(fp);
12639 cnt = (size_t)FILE_cnt(fp);
12641 FILE_ptr(fp) += 42;
12643 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
12644 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
12647 if (FILE_cnt(fp) <= 20) {
12648 printf ("Fail (<20 chars to test)");
12651 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
12652 puts("Fail compare");
12655 if (cnt == FILE_cnt(fp)) {
12656 puts("Pass_unchanged");
12659 if (FILE_cnt(fp) == (cnt - 42)) {
12660 puts("Pass_changed");
12663 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
12669 if eval $compile && $to try.c; then
12670 case `$run ./try` in
12672 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
12673 d_stdio_ptr_lval_sets_cnt="$define" ;;
12675 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
12676 d_stdio_ptr_lval_nochange_cnt="$define" ;;
12678 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
12680 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
12683 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
12689 : see if _base is also standard
12691 case "$d_stdstdio" in
12695 #$i_stdlib I_STDLIB
12697 #include <stdlib.h>
12699 #define FILE_base(fp) $stdio_base
12700 #define FILE_bufsiz(fp) $stdio_bufsiz
12702 FILE *fp = fopen("try.c", "r");
12705 19 <= FILE_bufsiz(fp) &&
12706 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
12713 if eval $compile && $to try.c; then
12714 if $run ./try; then
12715 echo "And its _base field acts std."
12718 echo "But its _base field isn't std."
12721 echo "However, it seems to be lacking the _base field."
12729 : see if fast_stdio exists
12731 case "$d_stdstdio:$d_stdio_ptr_lval" in
12733 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
12735 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
12746 : see if fchdir exists
12747 set fchdir d_fchdir
12750 : see if fchmod exists
12751 set fchmod d_fchmod
12754 : see if fchown exists
12755 set fchown d_fchown
12758 : see if this is an fcntl system
12763 : See if fcntl-based locking works.
12765 #$i_stdlib I_STDLIB
12767 #include <stdlib.h>
12769 #include <unistd.h>
12771 #include <signal.h>
12772 $signal_t blech(int x) { exit(3); }
12774 #if defined(F_SETLK) && defined(F_SETLKW)
12775 struct flock flock;
12777 fd = open("try.c", O_RDONLY);
12778 flock.l_type = F_RDLCK;
12779 flock.l_whence = SEEK_SET;
12780 flock.l_start = flock.l_len = 0;
12781 signal(SIGALRM, blech);
12783 retval = fcntl(fd, F_SETLK, &flock);
12785 (retval < 0 ? exit(2) : exit(0));
12791 echo "Checking if fcntl-based file locking works... "
12795 if eval $compile_ok; then
12796 if $run ./try; then
12797 echo "Yes, it seems to work."
12800 echo "Nope, it didn't work."
12805 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
12806 *** This is (almost) impossible.
12807 *** If your NFS lock daemons are not feeling well, something like
12808 *** this may happen, please investigate. Cannot continue, aborting.
12816 echo "I'm unable to compile the test program, so I'll assume not."
12821 echo "Nope, since you don't even have fcntl()."
12824 set d_fcntl_can_lock
12828 : check for fd_set items
12831 Checking to see how well your C compiler handles fd_set and friends ...
12834 #$i_stdlib I_STDLIB
12836 #include <stdlib.h>
12838 #$i_systime I_SYS_TIME
12839 #$i_sysselct I_SYS_SELECT
12840 #$d_socket HAS_SOCKET
12841 #include <sys/types.h>
12843 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
12846 #include <sys/time.h>
12848 #ifdef I_SYS_SELECT
12849 #include <sys/select.h>
12858 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
12866 if eval $compile; then
12867 d_fds_bits="$define"
12869 echo "Well, your system knows about the normal fd_set typedef..." >&4
12870 if $run ./try; then
12871 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
12872 d_fd_macros="$define"
12875 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
12877 d_fd_macros="$undef"
12881 Hmm, your compiler has some difficulty with fd_set. Checking further...
12884 if eval $compile; then
12885 d_fds_bits="$undef"
12887 echo "Well, your system has some sort of fd_set available..." >&4
12888 if $run ./try; then
12889 echo "and you have the normal fd_set macros." >&4
12890 d_fd_macros="$define"
12893 but not the normal fd_set macros! Gross! More work for me...
12895 d_fd_macros="$undef"
12898 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
12900 d_fds_bits="$undef"
12901 d_fd_macros="$undef"
12906 : see if fgetpos exists
12907 set fgetpos d_fgetpos
12910 : see if finite exists
12911 set finite d_finite
12914 : see if finitel exists
12915 set finitel d_finitel
12918 : see if flock exists
12922 : see if prototype for flock is available
12924 set d_flockproto flock $i_sysfile sys/file.h
12927 : see if fp_class exists
12928 set fp_class d_fp_class
12931 : see if pathconf exists
12932 set pathconf d_pathconf
12935 : see if fpathconf exists
12936 set fpathconf d_fpathconf
12939 : see if fpclass exists
12940 set fpclass d_fpclass
12943 : see if fpclassify exists
12944 set fpclassify d_fpclassify
12947 : see if fpclassl exists
12948 set fpclassl d_fpclassl
12952 : check for fpos64_t
12954 echo "Checking to see if you have fpos64_t..." >&4
12957 int main() { fpos64_t x = 7; }
12960 if eval $compile; then
12962 echo "You have fpos64_t."
12965 echo "You do not have fpos64_t."
12966 case "$fpossize" in
12967 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
12974 : see if frexpl exists
12975 set frexpl d_frexpl
12978 : see if this is a sys/param system
12979 set sys/param.h i_sysparam
12982 : see if this is a sys/mount.h system
12983 set sys/mount.h i_sysmount
12988 echo "Checking to see if your system supports struct fs_data..." >&4
12989 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
12991 case "$d_fs_data_s" in
12992 "$define") echo "Yes, it does." ;;
12993 *) echo "No, it doesn't." ;;
12996 : see if fseeko exists
12997 set fseeko d_fseeko
12999 case "$longsize" in
13000 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
13003 : see if fsetpos exists
13004 set fsetpos d_fsetpos
13008 : see if fstatfs exists
13009 set fstatfs d_fstatfs
13013 : see if statvfs exists
13014 set statvfs d_statvfs
13017 : see if fstatvfs exists
13018 set fstatvfs d_fstatvfs
13022 : see if fsync exists
13026 : see if ftello exists
13027 set ftello d_ftello
13029 case "$longsize" in
13030 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
13034 : check for a working futimes
13036 echo "Checking if you have a working futimes()" >&4
13039 #include <sys/time.h>
13046 fd = open ("try.c", O_RDWR);
13047 if (-1 == fd) exit (1);
13048 rv = futimes (fd, NULL);
13049 exit (rv == -1 ? errno : 0);
13053 if eval $compile; then
13057 0) echo "Yes, you have" >&4
13058 d_futimes="$define"
13060 *) echo "No, you have futimes, but it isn't working ($rc) (probably harmless)" >&4
13064 echo "No, it does not (probably harmless)" >&4
13068 : see if getcwd exists
13069 set getcwd d_getcwd
13072 : see if getespwnam exists
13073 set getespwnam d_getespwnam
13077 : see if getfsstat exists
13078 set getfsstat d_getfsstat
13081 : see if getgrent exists
13082 set getgrent d_getgrent
13085 : see if getgrent_r exists
13086 set getgrent_r d_getgrent_r
13088 case "$d_getgrent_r" in
13090 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13091 case "$d_getgrent_r_proto:$usethreads" in
13092 ":define") d_getgrent_r_proto=define
13093 set d_getgrent_r_proto getgrent_r $hdrs
13097 case "$d_getgrent_r_proto" in
13099 case "$getgrent_r_proto" in
13100 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
13101 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBWR ;;
13103 case "$getgrent_r_proto" in
13104 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
13105 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIR ;;
13107 case "$getgrent_r_proto" in
13108 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
13109 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBW ;;
13111 case "$getgrent_r_proto" in
13112 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
13113 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBI ;;
13115 case "$getgrent_r_proto" in
13116 ''|0) try='int getgrent_r(struct group*, char*, int);'
13117 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBI ;;
13119 case "$getgrent_r_proto" in
13120 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
13121 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIH ;;
13123 case "$getgrent_r_proto" in
13124 ''|0) d_getgrent_r=undef
13126 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
13127 * ) case "$getgrent_r_proto" in
13128 REENTRANT_PROTO*) ;;
13129 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
13131 echo "Prototype: $try" ;;
13134 *) case "$usethreads" in
13135 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
13142 *) getgrent_r_proto=0
13146 : see if getgrgid_r exists
13147 set getgrgid_r d_getgrgid_r
13149 case "$d_getgrgid_r" in
13151 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13152 case "$d_getgrgid_r_proto:$usethreads" in
13153 ":define") d_getgrgid_r_proto=define
13154 set d_getgrgid_r_proto getgrgid_r $hdrs
13158 case "$d_getgrgid_r_proto" in
13160 case "$getgrgid_r_proto" in
13161 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
13162 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
13164 case "$getgrgid_r_proto" in
13165 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
13166 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
13168 case "$getgrgid_r_proto" in
13169 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
13170 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
13172 case "$getgrgid_r_proto" in
13173 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
13174 ./protochk "extern $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
13176 case "$getgrgid_r_proto" in
13177 ''|0) d_getgrgid_r=undef
13179 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
13180 * ) case "$getgrgid_r_proto" in
13181 REENTRANT_PROTO*) ;;
13182 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
13184 echo "Prototype: $try" ;;
13187 *) case "$usethreads" in
13188 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
13195 *) getgrgid_r_proto=0
13199 : see if getgrnam_r exists
13200 set getgrnam_r d_getgrnam_r
13202 case "$d_getgrnam_r" in
13204 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13205 case "$d_getgrnam_r_proto:$usethreads" in
13206 ":define") d_getgrnam_r_proto=define
13207 set d_getgrnam_r_proto getgrnam_r $hdrs
13211 case "$d_getgrnam_r_proto" in
13213 case "$getgrnam_r_proto" in
13214 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
13215 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
13217 case "$getgrnam_r_proto" in
13218 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
13219 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
13221 case "$getgrnam_r_proto" in
13222 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
13223 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CBI ;;
13225 case "$getgrnam_r_proto" in
13226 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
13227 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
13229 case "$getgrnam_r_proto" in
13230 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
13231 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
13233 case "$getgrnam_r_proto" in
13234 ''|0) d_getgrnam_r=undef
13236 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
13237 * ) case "$getgrnam_r_proto" in
13238 REENTRANT_PROTO*) ;;
13239 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
13241 echo "Prototype: $try" ;;
13244 *) case "$usethreads" in
13245 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
13252 *) getgrnam_r_proto=0
13256 : see if gethostbyaddr exists
13257 set gethostbyaddr d_gethbyaddr
13260 : see if gethostbyname exists
13261 set gethostbyname d_gethbyname
13264 : see if gethostent exists
13265 set gethostent d_gethent
13268 : see how we will look up host name
13271 if set gethostname val -f d_gethname; eval $csym; $val; then
13272 echo 'gethostname() found.' >&4
13273 d_gethname="$define"
13276 if set uname val -f d_uname; eval $csym; $val; then
13279 uname() was found, but you're running xenix, and older versions of xenix
13280 have a broken uname(). If you don't really know whether your xenix is old
13281 enough to have a broken system call, use the default answer.
13286 "$define") dflt=n;;
13288 rp='Is your uname() broken?'
13291 n*) d_uname="$define"; call=uname;;
13294 echo 'uname() found.' >&4
13301 case "$d_gethname" in
13302 '') d_gethname="$undef";;
13305 '') d_uname="$undef";;
13307 case "$d_uname$d_gethname" in
13312 Every now and then someone has a $call() that lies about the hostname
13313 but can't be fixed for political or economic reasons. If you wish, I can
13314 pretend $call() isn't there and maybe compute hostname at run-time
13315 thanks to the '$phostname' command.
13318 rp="Shall I ignore $call() from now on?"
13321 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
13324 case "$phostname" in
13325 '') aphostname='';;
13326 *) case "$aphostname" in
13328 *) set X $phostname
13332 file=`./loc $file $file $pth`
13333 aphostname=`echo $file $*`
13338 case "$d_uname$d_gethname" in
13341 case "$phostname" in
13343 echo "There will be no way for $package to get your hostname." >&4;;
13345 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
13349 case "$d_phostname" in
13350 '') d_phostname="$undef";;
13353 : see if gethostbyaddr_r exists
13354 set gethostbyaddr_r d_gethostbyaddr_r
13356 case "$d_gethostbyaddr_r" in
13358 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13359 case "$d_gethostbyaddr_r_proto:$usethreads" in
13360 ":define") d_gethostbyaddr_r_proto=define
13361 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
13365 case "$d_gethostbyaddr_r_proto" in
13367 case "$gethostbyaddr_r_proto" in
13368 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13369 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
13371 case "$gethostbyaddr_r_proto" in
13372 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
13373 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
13375 case "$gethostbyaddr_r_proto" in
13376 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
13377 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
13379 case "$gethostbyaddr_r_proto" in
13380 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
13381 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
13383 case "$gethostbyaddr_r_proto" in
13384 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
13385 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
13387 case "$gethostbyaddr_r_proto" in
13388 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
13389 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
13391 case "$gethostbyaddr_r_proto" in
13392 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
13393 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
13395 case "$gethostbyaddr_r_proto" in
13396 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
13397 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
13399 case "$gethostbyaddr_r_proto" in
13400 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
13401 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
13403 case "$gethostbyaddr_r_proto" in
13404 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
13405 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
13407 case "$gethostbyaddr_r_proto" in
13408 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13409 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
13411 case "$gethostbyaddr_r_proto" in
13412 ''|0) d_gethostbyaddr_r=undef
13413 gethostbyaddr_r_proto=0
13414 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
13415 * ) case "$gethostbyaddr_r_proto" in
13416 REENTRANT_PROTO*) ;;
13417 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
13419 echo "Prototype: $try" ;;
13422 *) case "$usethreads" in
13423 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
13425 d_gethostbyaddr_r=undef
13426 gethostbyaddr_r_proto=0
13430 *) gethostbyaddr_r_proto=0
13434 : see if gethostbyname_r exists
13435 set gethostbyname_r d_gethostbyname_r
13437 case "$d_gethostbyname_r" in
13439 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13440 case "$d_gethostbyname_r_proto:$usethreads" in
13441 ":define") d_gethostbyname_r_proto=define
13442 set d_gethostbyname_r_proto gethostbyname_r $hdrs
13446 case "$d_gethostbyname_r_proto" in
13448 case "$gethostbyname_r_proto" in
13449 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
13450 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
13452 case "$gethostbyname_r_proto" in
13453 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
13454 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
13456 case "$gethostbyname_r_proto" in
13457 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
13458 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
13460 case "$gethostbyname_r_proto" in
13461 ''|0) d_gethostbyname_r=undef
13462 gethostbyname_r_proto=0
13463 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
13464 * ) case "$gethostbyname_r_proto" in
13465 REENTRANT_PROTO*) ;;
13466 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
13468 echo "Prototype: $try" ;;
13471 *) case "$usethreads" in
13472 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
13474 d_gethostbyname_r=undef
13475 gethostbyname_r_proto=0
13479 *) gethostbyname_r_proto=0
13483 : see if gethostent_r exists
13484 set gethostent_r d_gethostent_r
13486 case "$d_gethostent_r" in
13488 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13489 case "$d_gethostent_r_proto:$usethreads" in
13490 ":define") d_gethostent_r_proto=define
13491 set d_gethostent_r_proto gethostent_r $hdrs
13495 case "$d_gethostent_r_proto" in
13497 case "$gethostent_r_proto" in
13498 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
13499 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
13501 case "$gethostent_r_proto" in
13502 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
13503 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBIE ;;
13505 case "$gethostent_r_proto" in
13506 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
13507 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBIE ;;
13509 case "$gethostent_r_proto" in
13510 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
13511 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBI ;;
13513 case "$gethostent_r_proto" in
13514 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
13515 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBI ;;
13517 case "$gethostent_r_proto" in
13518 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
13519 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SD ;;
13521 case "$gethostent_r_proto" in
13522 ''|0) d_gethostent_r=undef
13523 gethostent_r_proto=0
13524 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
13525 * ) case "$gethostent_r_proto" in
13526 REENTRANT_PROTO*) ;;
13527 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
13529 echo "Prototype: $try" ;;
13532 *) case "$usethreads" in
13533 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
13535 d_gethostent_r=undef
13536 gethostent_r_proto=0
13540 *) gethostent_r_proto=0
13544 : see if prototypes for various gethostxxx netdb.h functions are available
13546 set d_gethostprotos gethostent $i_netdb netdb.h
13549 : see if getitimer exists
13550 set getitimer d_getitimer
13553 : see if getlogin exists
13554 set getlogin d_getlogin
13557 : see if getlogin_r exists
13558 set getlogin_r d_getlogin_r
13560 case "$d_getlogin_r" in
13562 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
13563 case "$d_getlogin_r_proto:$usethreads" in
13564 ":define") d_getlogin_r_proto=define
13565 set d_getlogin_r_proto getlogin_r $hdrs
13569 case "$d_getlogin_r_proto" in
13571 case "$getlogin_r_proto" in
13572 ''|0) try='int getlogin_r(char*, size_t);'
13573 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BW ;;
13575 case "$getlogin_r_proto" in
13576 ''|0) try='int getlogin_r(char*, int);'
13577 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BI ;;
13579 case "$getlogin_r_proto" in
13580 ''|0) try='char* getlogin_r(char*, size_t);'
13581 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BW ;;
13583 case "$getlogin_r_proto" in
13584 ''|0) try='char* getlogin_r(char*, int);'
13585 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BI ;;
13587 case "$getlogin_r_proto" in
13588 ''|0) d_getlogin_r=undef
13590 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
13591 * ) case "$getlogin_r_proto" in
13592 REENTRANT_PROTO*) ;;
13593 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
13595 echo "Prototype: $try" ;;
13598 *) case "$usethreads" in
13599 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
13606 *) getlogin_r_proto=0
13610 : see if getmnt exists
13611 set getmnt d_getmnt
13614 : see if getmntent exists
13615 set getmntent d_getmntent
13618 : see if getnetbyaddr exists
13619 set getnetbyaddr d_getnbyaddr
13622 : see if getnetbyname exists
13623 set getnetbyname d_getnbyname
13626 : see if getnetent exists
13627 set getnetent d_getnent
13630 : see if getnetbyaddr_r exists
13631 set getnetbyaddr_r d_getnetbyaddr_r
13633 case "$d_getnetbyaddr_r" in
13635 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13636 case "$d_getnetbyaddr_r_proto:$usethreads" in
13637 ":define") d_getnetbyaddr_r_proto=define
13638 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
13642 case "$d_getnetbyaddr_r_proto" in
13644 case "$getnetbyaddr_r_proto" in
13645 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
13646 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
13648 case "$getnetbyaddr_r_proto" in
13649 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
13650 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
13652 case "$getnetbyaddr_r_proto" in
13653 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
13654 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
13656 case "$getnetbyaddr_r_proto" in
13657 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
13658 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
13660 case "$getnetbyaddr_r_proto" in
13661 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
13662 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
13664 case "$getnetbyaddr_r_proto" in
13665 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
13666 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
13668 case "$getnetbyaddr_r_proto" in
13669 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
13670 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
13672 case "$getnetbyaddr_r_proto" in
13673 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
13674 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
13676 case "$getnetbyaddr_r_proto" in
13677 ''|0) d_getnetbyaddr_r=undef
13678 getnetbyaddr_r_proto=0
13679 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
13680 * ) case "$getnetbyaddr_r_proto" in
13681 REENTRANT_PROTO*) ;;
13682 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
13684 echo "Prototype: $try" ;;
13687 *) case "$usethreads" in
13688 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
13690 d_getnetbyaddr_r=undef
13691 getnetbyaddr_r_proto=0
13695 *) getnetbyaddr_r_proto=0
13699 : see if getnetbyname_r exists
13700 set getnetbyname_r d_getnetbyname_r
13702 case "$d_getnetbyname_r" in
13704 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13705 case "$d_getnetbyname_r_proto:$usethreads" in
13706 ":define") d_getnetbyname_r_proto=define
13707 set d_getnetbyname_r_proto getnetbyname_r $hdrs
13711 case "$d_getnetbyname_r_proto" in
13713 case "$getnetbyname_r_proto" in
13714 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
13715 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
13717 case "$getnetbyname_r_proto" in
13718 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
13719 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
13721 case "$getnetbyname_r_proto" in
13722 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
13723 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
13725 case "$getnetbyname_r_proto" in
13726 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
13727 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
13729 case "$getnetbyname_r_proto" in
13730 ''|0) d_getnetbyname_r=undef
13731 getnetbyname_r_proto=0
13732 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
13733 * ) case "$getnetbyname_r_proto" in
13734 REENTRANT_PROTO*) ;;
13735 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
13737 echo "Prototype: $try" ;;
13740 *) case "$usethreads" in
13741 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
13743 d_getnetbyname_r=undef
13744 getnetbyname_r_proto=0
13748 *) getnetbyname_r_proto=0
13752 : see if getnetent_r exists
13753 set getnetent_r d_getnetent_r
13755 case "$d_getnetent_r" in
13757 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13758 case "$d_getnetent_r_proto:$usethreads" in
13759 ":define") d_getnetent_r_proto=define
13760 set d_getnetent_r_proto getnetent_r $hdrs
13764 case "$d_getnetent_r_proto" in
13766 case "$getnetent_r_proto" in
13767 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
13768 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
13770 case "$getnetent_r_proto" in
13771 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
13772 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBIE ;;
13774 case "$getnetent_r_proto" in
13775 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
13776 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBIE ;;
13778 case "$getnetent_r_proto" in
13779 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
13780 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBI ;;
13782 case "$getnetent_r_proto" in
13783 ''|0) try='int getnetent_r(struct netent*, char*, int);'
13784 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBI ;;
13786 case "$getnetent_r_proto" in
13787 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
13788 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SD ;;
13790 case "$getnetent_r_proto" in
13791 ''|0) d_getnetent_r=undef
13792 getnetent_r_proto=0
13793 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
13794 * ) case "$getnetent_r_proto" in
13795 REENTRANT_PROTO*) ;;
13796 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
13798 echo "Prototype: $try" ;;
13801 *) case "$usethreads" in
13802 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
13804 d_getnetent_r=undef
13805 getnetent_r_proto=0
13809 *) getnetent_r_proto=0
13813 : see if prototypes for various getnetxxx netdb.h functions are available
13815 set d_getnetprotos getnetent $i_netdb netdb.h
13818 : see if getpagesize exists
13819 set getpagesize d_getpagsz
13823 : see if getprotobyname exists
13824 set getprotobyname d_getpbyname
13827 : see if getprotobynumber exists
13828 set getprotobynumber d_getpbynumber
13831 : see if getprotoent exists
13832 set getprotoent d_getpent
13835 : see if getpgid exists
13836 set getpgid d_getpgid
13839 : see if getpgrp2 exists
13840 set getpgrp2 d_getpgrp2
13843 : see if getppid exists
13844 set getppid d_getppid
13847 : see if getpriority exists
13848 set getpriority d_getprior
13851 : see if getprotobyname_r exists
13852 set getprotobyname_r d_getprotobyname_r
13854 case "$d_getprotobyname_r" in
13856 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13857 case "$d_getprotobyname_r_proto:$usethreads" in
13858 ":define") d_getprotobyname_r_proto=define
13859 set d_getprotobyname_r_proto getprotobyname_r $hdrs
13863 case "$d_getprotobyname_r_proto" in
13865 case "$getprotobyname_r_proto" in
13866 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
13867 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
13869 case "$getprotobyname_r_proto" in
13870 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
13871 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
13873 case "$getprotobyname_r_proto" in
13874 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
13875 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
13877 case "$getprotobyname_r_proto" in
13878 ''|0) d_getprotobyname_r=undef
13879 getprotobyname_r_proto=0
13880 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
13881 * ) case "$getprotobyname_r_proto" in
13882 REENTRANT_PROTO*) ;;
13883 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
13885 echo "Prototype: $try" ;;
13888 *) case "$usethreads" in
13889 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
13891 d_getprotobyname_r=undef
13892 getprotobyname_r_proto=0
13896 *) getprotobyname_r_proto=0
13900 : see if getprotobynumber_r exists
13901 set getprotobynumber_r d_getprotobynumber_r
13903 case "$d_getprotobynumber_r" in
13905 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13906 case "$d_getprotobynumber_r_proto:$usethreads" in
13907 ":define") d_getprotobynumber_r_proto=define
13908 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
13912 case "$d_getprotobynumber_r_proto" in
13914 case "$getprotobynumber_r_proto" in
13915 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
13916 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
13918 case "$getprotobynumber_r_proto" in
13919 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
13920 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
13922 case "$getprotobynumber_r_proto" in
13923 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
13924 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
13926 case "$getprotobynumber_r_proto" in
13927 ''|0) d_getprotobynumber_r=undef
13928 getprotobynumber_r_proto=0
13929 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
13930 * ) case "$getprotobynumber_r_proto" in
13931 REENTRANT_PROTO*) ;;
13932 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
13934 echo "Prototype: $try" ;;
13937 *) case "$usethreads" in
13938 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
13940 d_getprotobynumber_r=undef
13941 getprotobynumber_r_proto=0
13945 *) getprotobynumber_r_proto=0
13949 : see if getprotoent_r exists
13950 set getprotoent_r d_getprotoent_r
13952 case "$d_getprotoent_r" in
13954 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13955 case "$d_getprotoent_r_proto:$usethreads" in
13956 ":define") d_getprotoent_r_proto=define
13957 set d_getprotoent_r_proto getprotoent_r $hdrs
13961 case "$d_getprotoent_r_proto" in
13963 case "$getprotoent_r_proto" in
13964 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
13965 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
13967 case "$getprotoent_r_proto" in
13968 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
13969 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBI ;;
13971 case "$getprotoent_r_proto" in
13972 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
13973 ./protochk "extern $try" $hdrs && getprotoent_r_proto=S_SBI ;;
13975 case "$getprotoent_r_proto" in
13976 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
13977 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SD ;;
13979 case "$getprotoent_r_proto" in
13980 ''|0) d_getprotoent_r=undef
13981 getprotoent_r_proto=0
13982 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
13983 * ) case "$getprotoent_r_proto" in
13984 REENTRANT_PROTO*) ;;
13985 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
13987 echo "Prototype: $try" ;;
13990 *) case "$usethreads" in
13991 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
13993 d_getprotoent_r=undef
13994 getprotoent_r_proto=0
13998 *) getprotoent_r_proto=0
14002 : see if prototypes for various getprotoxxx netdb.h functions are available
14004 set d_getprotoprotos getprotoent $i_netdb netdb.h
14007 : see if getprpwnam exists
14008 set getprpwnam d_getprpwnam
14011 : see if getpwent exists
14012 set getpwent d_getpwent
14015 : see if getpwent_r exists
14016 set getpwent_r d_getpwent_r
14018 case "$d_getpwent_r" in
14020 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14021 case "$d_getpwent_r_proto:$usethreads" in
14022 ":define") d_getpwent_r_proto=define
14023 set d_getpwent_r_proto getpwent_r $hdrs
14027 case "$d_getpwent_r_proto" in
14029 case "$getpwent_r_proto" in
14030 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
14031 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBWR ;;
14033 case "$getpwent_r_proto" in
14034 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
14035 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIR ;;
14037 case "$getpwent_r_proto" in
14038 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
14039 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBW ;;
14041 case "$getpwent_r_proto" in
14042 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
14043 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBI ;;
14045 case "$getpwent_r_proto" in
14046 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
14047 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBI ;;
14049 case "$getpwent_r_proto" in
14050 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
14051 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIH ;;
14053 case "$getpwent_r_proto" in
14054 ''|0) d_getpwent_r=undef
14056 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
14057 * ) case "$getpwent_r_proto" in
14058 REENTRANT_PROTO*) ;;
14059 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
14061 echo "Prototype: $try" ;;
14064 *) case "$usethreads" in
14065 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
14072 *) getpwent_r_proto=0
14076 : see if getpwnam_r exists
14077 set getpwnam_r d_getpwnam_r
14079 case "$d_getpwnam_r" in
14081 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14082 case "$d_getpwnam_r_proto:$usethreads" in
14083 ":define") d_getpwnam_r_proto=define
14084 set d_getpwnam_r_proto getpwnam_r $hdrs
14088 case "$d_getpwnam_r_proto" in
14090 case "$getpwnam_r_proto" in
14091 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
14092 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
14094 case "$getpwnam_r_proto" in
14095 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
14096 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
14098 case "$getpwnam_r_proto" in
14099 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
14100 ./protochk "extern $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
14102 case "$getpwnam_r_proto" in
14103 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
14104 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
14106 case "$getpwnam_r_proto" in
14107 ''|0) d_getpwnam_r=undef
14109 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
14110 * ) case "$getpwnam_r_proto" in
14111 REENTRANT_PROTO*) ;;
14112 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
14114 echo "Prototype: $try" ;;
14117 *) case "$usethreads" in
14118 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
14125 *) getpwnam_r_proto=0
14129 : see if getpwuid_r exists
14130 set getpwuid_r d_getpwuid_r
14132 case "$d_getpwuid_r" in
14134 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14135 case "$d_getpwuid_r_proto:$usethreads" in
14136 ":define") d_getpwuid_r_proto=define
14137 set d_getpwuid_r_proto getpwuid_r $hdrs
14141 case "$d_getpwuid_r_proto" in
14143 case "$getpwuid_r_proto" in
14144 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
14145 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
14147 case "$getpwuid_r_proto" in
14148 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
14149 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
14151 case "$getpwuid_r_proto" in
14152 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
14153 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
14155 case "$getpwuid_r_proto" in
14156 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
14157 ./protochk "extern $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
14159 case "$getpwuid_r_proto" in
14160 ''|0) d_getpwuid_r=undef
14162 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
14163 * ) case "$getpwuid_r_proto" in
14164 REENTRANT_PROTO*) ;;
14165 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
14167 echo "Prototype: $try" ;;
14170 *) case "$usethreads" in
14171 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
14178 *) getpwuid_r_proto=0
14183 : see if getservbyname exists
14184 set getservbyname d_getsbyname
14187 : see if getservbyport exists
14188 set getservbyport d_getsbyport
14191 : see if getservent exists
14192 set getservent d_getsent
14195 : see if getservbyname_r exists
14196 set getservbyname_r d_getservbyname_r
14198 case "$d_getservbyname_r" in
14200 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14201 case "$d_getservbyname_r_proto:$usethreads" in
14202 ":define") d_getservbyname_r_proto=define
14203 set d_getservbyname_r_proto getservbyname_r $hdrs
14207 case "$d_getservbyname_r_proto" in
14209 case "$getservbyname_r_proto" in
14210 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
14211 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
14213 case "$getservbyname_r_proto" in
14214 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
14215 ./protochk "extern $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
14217 case "$getservbyname_r_proto" in
14218 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
14219 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
14221 case "$getservbyname_r_proto" in
14222 ''|0) d_getservbyname_r=undef
14223 getservbyname_r_proto=0
14224 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
14225 * ) case "$getservbyname_r_proto" in
14226 REENTRANT_PROTO*) ;;
14227 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
14229 echo "Prototype: $try" ;;
14232 *) case "$usethreads" in
14233 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
14235 d_getservbyname_r=undef
14236 getservbyname_r_proto=0
14240 *) getservbyname_r_proto=0
14244 : see if getservbyport_r exists
14245 set getservbyport_r d_getservbyport_r
14247 case "$d_getservbyport_r" in
14249 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14250 case "$d_getservbyport_r_proto:$usethreads" in
14251 ":define") d_getservbyport_r_proto=define
14252 set d_getservbyport_r_proto getservbyport_r $hdrs
14256 case "$d_getservbyport_r_proto" in
14258 case "$getservbyport_r_proto" in
14259 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
14260 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
14262 case "$getservbyport_r_proto" in
14263 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
14264 ./protochk "extern $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
14266 case "$getservbyport_r_proto" in
14267 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
14268 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
14270 case "$getservbyport_r_proto" in
14271 ''|0) d_getservbyport_r=undef
14272 getservbyport_r_proto=0
14273 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
14274 * ) case "$getservbyport_r_proto" in
14275 REENTRANT_PROTO*) ;;
14276 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
14278 echo "Prototype: $try" ;;
14281 *) case "$usethreads" in
14282 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
14284 d_getservbyport_r=undef
14285 getservbyport_r_proto=0
14289 *) getservbyport_r_proto=0
14293 : see if getservent_r exists
14294 set getservent_r d_getservent_r
14296 case "$d_getservent_r" in
14298 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14299 case "$d_getservent_r_proto:$usethreads" in
14300 ":define") d_getservent_r_proto=define
14301 set d_getservent_r_proto getservent_r $hdrs
14305 case "$d_getservent_r_proto" in
14307 case "$getservent_r_proto" in
14308 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
14309 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBWR ;;
14311 case "$getservent_r_proto" in
14312 ''|0) try='int getservent_r(struct servent*, char*, int);'
14313 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBI ;;
14315 case "$getservent_r_proto" in
14316 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
14317 ./protochk "extern $try" $hdrs && getservent_r_proto=S_SBI ;;
14319 case "$getservent_r_proto" in
14320 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
14321 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SD ;;
14323 case "$getservent_r_proto" in
14324 ''|0) d_getservent_r=undef
14325 getservent_r_proto=0
14326 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
14327 * ) case "$getservent_r_proto" in
14328 REENTRANT_PROTO*) ;;
14329 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
14331 echo "Prototype: $try" ;;
14334 *) case "$usethreads" in
14335 define) echo "getservent_r has no prototype, not using it." >&4 ;;
14337 d_getservent_r=undef
14338 getservent_r_proto=0
14342 *) getservent_r_proto=0
14346 : see if prototypes for various getservxxx netdb.h functions are available
14348 set d_getservprotos getservent $i_netdb netdb.h
14351 : see if getspnam exists
14352 set getspnam d_getspnam
14355 : see if this is a shadow.h system
14356 set shadow.h i_shadow
14359 : see if getspnam_r exists
14360 set getspnam_r d_getspnam_r
14362 case "$d_getspnam_r" in
14364 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
14365 case "$d_getspnam_r_proto:$usethreads" in
14366 ":define") d_getspnam_r_proto=define
14367 set d_getspnam_r_proto getspnam_r $hdrs
14371 case "$d_getspnam_r_proto" in
14373 case "$getspnam_r_proto" in
14374 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
14375 ./protochk "extern $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
14377 case "$getspnam_r_proto" in
14378 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
14379 ./protochk "extern $try" $hdrs && getspnam_r_proto=S_CSBI ;;
14381 case "$getspnam_r_proto" in
14382 ''|0) d_getspnam_r=undef
14384 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
14385 * ) case "$getspnam_r_proto" in
14386 REENTRANT_PROTO*) ;;
14387 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
14389 echo "Prototype: $try" ;;
14392 *) case "$usethreads" in
14393 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
14400 *) getspnam_r_proto=0
14404 : see if gettimeofday or ftime exists
14405 set gettimeofday d_gettimeod
14407 case "$d_gettimeod" in
14413 val="$undef"; set d_ftime; eval $setvar
14416 case "$d_gettimeod$d_ftime" in
14419 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
14423 : see if gmtime_r exists
14424 set gmtime_r d_gmtime_r
14426 case "$d_gmtime_r" in
14428 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14429 case "$d_gmtime_r_proto:$usethreads" in
14430 ":define") d_gmtime_r_proto=define
14431 set d_gmtime_r_proto gmtime_r $hdrs
14435 case "$d_gmtime_r_proto" in
14437 case "$gmtime_r_proto" in
14438 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
14439 ./protochk "extern $try" $hdrs && gmtime_r_proto=S_TS ;;
14441 case "$gmtime_r_proto" in
14442 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
14443 ./protochk "extern $try" $hdrs && gmtime_r_proto=I_TS ;;
14445 case "$gmtime_r_proto" in
14446 ''|0) d_gmtime_r=undef
14448 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
14449 * ) case "$gmtime_r_proto" in
14450 REENTRANT_PROTO*) ;;
14451 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
14453 echo "Prototype: $try" ;;
14456 *) case "$usethreads" in
14457 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
14464 *) gmtime_r_proto=0
14468 : see if hasmntopt exists
14469 set hasmntopt d_hasmntopt
14472 : see if this is a netinet/in.h or sys/in.h system
14473 set netinet/in.h i_niin sys/in.h i_sysin
14476 : see if arpa/inet.h has to be included
14477 set arpa/inet.h i_arpainet
14480 : see if htonl --and friends-- exists
14485 : Maybe they are macros.
14488 $cat >htonl.c <<EOM
14490 #include <sys/types.h>
14491 #$i_niin I_NETINET_IN
14493 #$i_arpainet I_ARPA_INET
14494 #ifdef I_NETINET_IN
14495 #include <netinet/in.h>
14498 #include <sys/in.h>
14501 #include <arpa/inet.h>
14504 printf("Defined as a macro.");
14507 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
14508 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
14510 echo "But it seems to be defined as a macro." >&4
14518 : see if ilogbl exists
14519 set ilogbl d_ilogbl
14524 if set index val -f; eval $csym; $val; then
14525 if set strchr val -f d_strchr; eval $csym; $val; then
14526 if $contains strchr "$strings" >/dev/null 2>&1 ; then
14529 echo "strchr() found." >&4
14533 echo "index() found." >&4
14538 echo "index() found." >&4
14541 if set strchr val -f d_strchr; eval $csym; $val; then
14544 echo "strchr() found." >&4
14546 echo "No index() or strchr() found!" >&4
14551 set d_strchr; eval $setvar
14553 set d_index; eval $setvar
14555 : check whether inet_aton exists
14556 set inet_aton d_inetaton
14561 $cat >isascii.c <<EOCP
14564 #$i_stdlib I_STDLIB
14566 #include <stdlib.h>
14577 if eval $compile; then
14578 echo "isascii() found." >&4
14581 echo "isascii() NOT found." >&4
14588 : see if isfinite exists
14589 set isfinite d_isfinite
14592 : see if isinf exists
14596 : see if isnan exists
14600 : see if isnanl exists
14601 set isnanl d_isnanl
14604 : see if killpg exists
14605 set killpg d_killpg
14608 : see if lchown exists
14610 $cat > try.c <<'EOCP'
14611 /* System header to define __stub macros and hopefully few prototypes,
14612 which can conflict with char lchown(); below. */
14613 #include <assert.h>
14614 /* Override any gcc2 internal prototype to avoid an error. */
14615 /* We use char because int might match the return type of a gcc2
14616 builtin and then its argument prototype would still apply. */
14619 /* The GNU C library defines this for functions which it implements
14620 to always fail with ENOSYS. Some functions are actually named
14621 something starting with __ and the normal name is an alias. */
14622 #if defined (__stub_lchown) || defined (__stub___lchown)
14630 if eval $compile; then
14631 $echo "lchown() found." >&4
14634 $echo "lchown() NOT found." >&4
14640 : See if number of significant digits in a double precision number is known
14642 $cat >ldbl_dig.c <<EOM
14643 #$i_limits I_LIMITS
14646 #include <limits.h>
14652 printf("Contains LDBL_DIG");
14655 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
14656 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
14657 echo "LDBL_DIG found." >&4
14660 echo "LDBL_DIG NOT found." >&4
14667 : see if this is a math.h system
14671 d_libm_lib_version="$undef"
14674 : check to see if math.h defines _LIB_VERSION
14676 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
14678 #include <unistd.h>
14680 int main (int argc, char *argv[])
14682 printf ("%d\n", _LIB_VERSION);
14687 if eval $compile; then
14689 echo "Yes, it does ($foo)" >&4
14690 d_libm_lib_version="$define"
14692 echo "No, it does not (probably harmless)" >&4
14699 : see if link exists
14703 : see if localtime_r exists
14704 set localtime_r d_localtime_r
14706 case "$d_localtime_r" in
14708 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14709 case "$d_localtime_r_proto:$usethreads" in
14710 ":define") d_localtime_r_proto=define
14711 set d_localtime_r_proto localtime_r $hdrs
14715 case "$d_localtime_r_proto" in
14717 case "$localtime_r_proto" in
14718 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
14719 ./protochk "extern $try" $hdrs && localtime_r_proto=S_TS ;;
14721 case "$localtime_r_proto" in
14722 ''|0) try='int localtime_r(const time_t*, struct tm*);'
14723 ./protochk "extern $try" $hdrs && localtime_r_proto=I_TS ;;
14725 case "$localtime_r_proto" in
14726 ''|0) d_localtime_r=undef
14727 localtime_r_proto=0
14728 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
14729 * ) case "$localtime_r_proto" in
14730 REENTRANT_PROTO*) ;;
14731 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
14733 echo "Prototype: $try" ;;
14736 *) case "$usethreads" in
14737 define) echo "localtime_r has no prototype, not using it." >&4 ;;
14739 d_localtime_r=undef
14740 localtime_r_proto=0
14744 *) localtime_r_proto=0
14748 : see if localtime_r calls tzset
14749 case "$localtime_r_proto" in
14752 /* Does our libc's localtime_r call tzset ?
14753 * return 0 if so, 1 otherwise.
14755 #include <sys/types.h>
14756 #include <unistd.h>
14758 #include <string.h>
14759 #include <malloc.h>
14762 time_t t = time(0L);
14763 char w_tz[]="TZ" "=GMT+5",
14764 e_tz[]="TZ" "=GMT-5",
14765 *tz_e = (char*)malloc(16),
14766 *tz_w = (char*)malloc(16);
14767 struct tm tm_e, tm_w;
14768 memset(&tm_e,'\0',sizeof(struct tm));
14769 memset(&tm_w,'\0',sizeof(struct tm));
14774 localtime_r(&t, &tm_e);
14777 localtime_r(&t, &tm_w);
14779 if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 )
14785 if eval $compile; then
14786 if $run ./try; then
14787 d_localtime_r_needs_tzset=undef;
14789 d_localtime_r_needs_tzset=define;
14792 d_localtime_r_needs_tzset=undef;
14796 d_localtime_r_needs_tzset=undef;
14801 : see if localeconv exists
14802 set localeconv d_locconv
14805 : see if lockf exists
14809 : see if prototype for lseek is available
14811 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
14814 : see if lstat exists
14818 : see if madvise exists
14819 set madvise d_madvise
14822 : see if malloc_size exists
14823 set malloc_size d_malloc_size
14826 : see if malloc_size_good exists
14827 set malloc_good_size d_malloc_good_size
14830 : see if mblen exists
14834 : see if mbstowcs exists
14835 set mbstowcs d_mbstowcs
14838 : see if mbtowc exists
14839 set mbtowc d_mbtowc
14842 : see if memchr exists
14843 set memchr d_memchr
14846 : see if memcmp exists
14847 set memcmp d_memcmp
14850 : see if memcpy exists
14851 set memcpy d_memcpy
14854 : see if memmove exists
14855 set memmove d_memmove
14858 : see if memset exists
14859 set memset d_memset
14862 : see if mkdir exists
14866 : see if mkdtemp exists
14867 set mkdtemp d_mkdtemp
14870 : see if mkfifo exists
14871 set mkfifo d_mkfifo
14874 : see if mkstemp exists
14875 set mkstemp d_mkstemp
14878 : see if mkstemps exists
14879 set mkstemps d_mkstemps
14882 : see if mktime exists
14883 set mktime d_mktime
14886 : see if this is a sys/mman.h system
14887 set sys/mman.h i_sysmman
14890 : see if mmap exists
14893 : see what shmat returns
14894 : default to something harmless
14896 case "$i_sysmman$d_mmap" in
14898 $cat >mmap.c <<'END'
14899 #include <sys/mman.h>
14902 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
14907 echo "and it returns ($mmaptype)." >&4
14913 : see if sqrtl exists
14917 : see if scalbnl exists
14918 set scalbnl d_scalbnl
14921 : see if modfl exists
14925 : see if prototype for modfl is available
14927 set d_modflproto modfl $i_math math.h
14930 d_modfl_pow32_bug="$undef"
14932 case "$d_longdbl$d_modfl" in
14935 Checking to see whether your modfl() is okay for large values...
14941 if $test "X$d_modflproto" != "X$define"; then
14942 $cat >>try.c <<EOCP
14943 /* Sigh. many current glibcs provide the function, but do not prototype it. */
14944 long double modfl (long double, long double *);
14947 $cat >>try.c <<EOCP
14949 long double nv = 4294967303.15;
14955 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
14959 case "$osname:$gccversion" in
14960 aix:) saveccflags="$ccflags"
14961 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
14964 if eval $compile; then
14967 *" 4294967303.150000 1.150000 4294967302.000000")
14968 echo >&4 "Your modfl() is broken for large values."
14969 d_modfl_pow32_bug="$define"
14971 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
14975 *" 4294967303.150000 0.150000 4294967303.000000")
14976 echo >&4 "Your modfl() seems okay for large values."
14978 *) echo >&4 "I don't understand your modfl() at all."
14984 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
14987 case "$osname:$gccversion" in
14988 aix:) ccflags="$saveccflags" ;; # restore
14993 if $test "$uselongdouble" = "$define"; then
14995 if $test "$d_sqrtl" != "$define"; then
14996 message="$message sqrtl"
14998 if $test "$d_modfl" != "$define"; then
14999 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
15000 echo "You have both aintl and copysignl, so I can emulate modfl."
15002 message="$message modfl"
15005 if $test "$d_frexpl" != "$define"; then
15006 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
15007 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
15009 message="$message frexpl"
15013 if $test "$message" != ""; then
15016 *** You requested the use of long doubles but you do not seem to have
15017 *** the following mathematical functions needed for long double support:
15019 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
15020 *** Cannot continue, aborting.
15028 : see if mprotect exists
15029 set mprotect d_mprotect
15032 : see if msgctl exists
15033 set msgctl d_msgctl
15036 : see if msgget exists
15037 set msgget d_msgget
15040 : see if msgsnd exists
15041 set msgsnd d_msgsnd
15044 : see if msgrcv exists
15045 set msgrcv d_msgrcv
15048 : see how much of the 'msg*(2)' library is present.
15051 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
15052 *"$undef"*) h_msg=false;;
15056 case "`ipcs 2>&1`" in
15057 "SVID messages"*"not configured"*)
15058 echo "Your $osname does not have the msg*(2) configured." >&4
15061 set msgctl d_msgctl
15063 set msgget d_msgget
15065 set msgsnd d_msgsnd
15067 set msgrcv d_msgrcv
15073 : we could also check for sys/ipc.h ...
15074 if $h_msg && $test `./findhdr sys/msg.h`; then
15075 echo "You have the full msg*(2) library." >&4
15078 echo "You don't have the full msg*(2) library." >&4
15086 echo "Checking to see if your system supports struct msghdr..." >&4
15087 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
15089 case "$d_msghdr_s" in
15090 "$define") echo "Yes, it does." ;;
15091 *) echo "No, it doesn't." ;;
15095 : see if msync exists
15099 : see if munmap exists
15100 set munmap d_munmap
15103 : see if nice exists
15107 : see if this is a langinfo.h system
15108 set langinfo.h i_langinfo
15111 : see if nl_langinfo exists
15112 set nl_langinfo d_nl_langinfo
15115 : check for volatile keyword
15117 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
15118 $cat >try.c <<'EOCP'
15121 typedef struct _goo_struct goo_struct;
15122 goo_struct * volatile goo = ((goo_struct *)0);
15123 struct _goo_struct {
15128 typedef unsigned short foo_t;
15129 char *volatile foo;
15131 volatile foo_t blech;
15135 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
15137 echo "Yup, it does."
15140 echo "Nope, it doesn't."
15148 $echo "Choosing the C types to be used for Perl's internal types..." >&4
15150 case "$use64bitint:$d_quad:$quadtype" in
15153 uvtype="$uquadtype"
15158 uvtype="unsigned long"
15164 case "$uselongdouble:$d_longdbl" in
15166 nvtype="long double"
15167 nvsize=$longdblsize
15174 $echo "(IV will be "$ivtype", $ivsize bytes)"
15175 $echo "(UV will be "$uvtype", $uvsize bytes)"
15176 $echo "(NV will be "$nvtype", $nvsize bytes)"
15179 #$i_inttypes I_INTTYPES
15181 #include <inttypes.h>
15186 int8_t i = INT8_MAX;
15187 uint8_t u = UINT8_MAX;
15188 printf("int8_t\n");
15191 int16_t i = INT16_MAX;
15192 uint16_t i = UINT16_MAX;
15193 printf("int16_t\n");
15196 int32_t i = INT32_MAX;
15197 uint32_t u = UINT32_MAX;
15198 printf("int32_t\n");
15203 i8type="signed char"
15204 u8type="unsigned char"
15209 '') case "$shortsize" in
15211 u16type="unsigned short"
15219 '') set try -DINT16
15220 if eval $compile; then
15221 case "`$run ./try`" in
15233 '') if $test $shortsize -ge 2; then
15235 u16type="unsigned short"
15243 '') case "$longsize" in
15245 u32type="unsigned long"
15249 *) case "$intsize" in
15251 u32type="unsigned int"
15261 '') set try -DINT32
15262 if eval $compile; then
15263 case "`$run ./try`" in
15275 '') if $test $intsize -ge 4; then
15277 u32type="unsigned int"
15285 '') case "$d_quad:$quadtype" in
15287 i64type="$quadtype"
15288 u64type="$uquadtype"
15296 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
15297 : volatile so that the compiler has to store it out to memory.
15298 if test X"$d_volatile" = X"$define"; then
15303 #$i_stdlib I_STDLIB
15305 #include <stdlib.h>
15307 #include <sys/types.h>
15308 #include <signal.h>
15310 $volatile int bletched = 0;
15311 $signal_t blech(int s) { bletched = 1; }
15316 int n = 8 * $uvsize;
15319 signal(SIGFPE, blech);
15322 for (i = 0; i < n; i++) {
15323 u = u << 1 | ($uvtype)1;
15325 if (($uvtype)d != u)
15329 d = ($nvtype)(u - 1);
15330 if (($uvtype)d != (u - 1))
15337 printf("%d\n", ((i == n) ? -n : i));
15343 d_nv_preserves_uv="$undef"
15344 if eval $compile; then
15345 nv_preserves_uv_bits="`$run ./try`"
15347 case "$nv_preserves_uv_bits" in
15349 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
15350 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
15351 d_nv_preserves_uv="$define"
15353 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
15354 d_nv_preserves_uv="$undef" ;;
15355 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
15356 nv_preserves_uv_bits="0" ;;
15360 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
15361 : volatile so that the compiler has to store it out to memory.
15362 if test X"$d_volatile" = X"$define"; then
15367 #$i_stdlib I_STDLIB
15369 #include <stdlib.h>
15371 #$i_string I_STRING
15373 # include <string.h>
15375 # include <strings.h>
15377 #include <sys/types.h>
15378 #include <signal.h>
15380 $volatile int bletched = 0;
15381 $signal_t blech(int s) { bletched = 1; }
15384 int checkit($nvtype d, char *where) {
15385 unsigned char *p = (char *)&d;
15386 unsigned char *end = p + sizeof(d);
15396 printf("No - %s: 0x", where);
15398 printf ("%02X", *p++);
15403 int main(int argc, char **argv) {
15406 fail += checkit(d, "0.0");
15408 /* The compiler shouldn't be assuming that bletched is 0 */
15411 fail += checkit(d, "bleched");
15414 signal(SIGFPE, blech);
15417 /* Paranoia - the compiler should have no way of knowing that ANSI says
15418 that argv[argc] will always be NULL. Actually, if it did assume this it
15419 would be buggy, as this is C and main() can be called from elsewhere in
15421 d = argv[argc] ? 1 : 0;
15424 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
15427 fail += checkit(d, "ternary");
15429 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
15432 printf("No - memset doesn't give 0.0\n");
15433 /* This might just blow up: */
15434 printf("(gives %g)\n", d);
15440 printf("No - something bleched\n");
15445 printf("No - %d fail(s)\n", fail);
15454 d_nv_zero_is_allbits_zero="$undef"
15455 if eval $compile; then
15461 0.0 is represented as all bits zero in memory
15463 d_nv_zero_is_allbits_zero="$define"
15466 0.0 is not represented as all bits zero in memory
15468 d_nv_zero_is_allbits_zero="$undef"
15473 0.0 is not represented as all bits zero in memory
15475 d_nv_zero_is_allbits_zero="$undef"
15481 : check for off64_t
15483 echo "Checking to see if you have off64_t..." >&4
15485 #include <sys/types.h>
15486 #include <unistd.h>
15487 int main() { off64_t x = 7; }
15490 if eval $compile; then
15492 echo "You have off64_t."
15495 echo "You do not have off64_t."
15496 case "$lseeksize" in
15497 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
15504 : how to create joinable pthreads
15505 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
15507 echo "Checking what constant to use for creating joinable pthreads..." >&4
15508 $cat >try.c <<'EOCP'
15509 #include <pthread.h>
15511 int detachstate = JOINABLE;
15514 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
15515 if eval $compile; then
15516 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
15517 val="$undef" # Yes, undef.
15518 set d_old_pthread_create_joinable
15521 set old_pthread_create_joinable
15524 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
15525 if eval $compile; then
15526 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
15528 set d_old_pthread_create_joinable
15530 val=PTHREAD_CREATE_UNDETACHED
15531 set old_pthread_create_joinable
15534 set try -DJOINABLE=__UNDETACHED
15535 if eval $compile; then
15536 echo "You seem to use __UNDETACHED." >&4
15538 set d_old_pthread_create_joinable
15541 set old_pthread_create_joinable
15544 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
15546 set d_old_pthread_create_joinable
15549 set old_pthread_create_joinable
15556 d_old_pthread_create_joinable="$undef"
15557 old_pthread_create_joinable=""
15560 : see if pause exists
15564 : see if poll exists
15568 : see if readlink exists
15569 set readlink d_readlink
15575 case "$d_readlink" in
15577 if $issymlink /proc/self/exe ; then
15578 $ls -l /proc/self/exe > reflect
15579 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
15580 echo "You have Linux-like /proc/self/exe."
15581 procselfexe='"/proc/self/exe"'
15585 if $issymlink /proc/curproc/file ; then
15586 $ls -l /proc/curproc/file > reflect
15587 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
15588 echo "You have BSD-like /proc/curproc/file."
15589 procselfexe='"/proc/curproc/file"'
15599 : backward compatibility for d_hvfork
15600 if test X$d_hvfork != X; then
15601 d_vfork="$d_hvfork"
15604 : see if there is a vfork
15609 d_pseudofork=$undef
15611 : Ok, but do we want to use it. vfork is reportedly unreliable in
15612 : perl on Solaris 2.x, and probably elsewhere.
15616 case "$usevfork" in
15622 Perl can only use a vfork() that doesn't suffer from strict
15623 restrictions on calling functions or modifying global data in
15624 the child. For example, glibc-2.1 contains such a vfork()
15625 that is unsuitable. If your system provides a proper fork()
15626 call, chances are that you do NOT want perl to use vfork().
15629 rp="Do you still want to use vfork()?"
15634 echo "Ok, we won't use vfork()."
15643 $define) usevfork='true';;
15644 *) usevfork='false';;
15647 : see whether the pthread_atfork exists
15649 #include <pthread.h>
15652 #ifdef PTHREAD_ATFORK
15653 pthread_atfork(NULL,NULL,NULL);
15658 : see if pthread_atfork exists
15659 set try -DPTHREAD_ATFORK
15660 if eval $compile; then
15665 case "$usethreads" in
15668 $define) echo 'pthread_atfork found.' >&4 ;;
15669 *) echo 'pthread_atfork NOT found.' >&4 ;;
15672 set d_pthread_atfork
15675 : see if pthread_attr_setscope exists
15676 set pthread_attr_setscope d_pthread_attr_setscope
15680 : see whether the various POSIXish _yields exist
15682 #include <pthread.h>
15688 #ifdef PTHREAD_YIELD
15691 #ifdef PTHREAD_YIELD_NULL
15692 pthread_yield(NULL);
15698 : see if sched_yield exists
15699 set try -DSCHED_YIELD
15700 if eval $compile; then
15702 sched_yield='sched_yield()'
15706 case "$usethreads" in
15709 $define) echo 'sched_yield() found.' >&4 ;;
15710 *) echo 'sched_yield() NOT found.' >&4 ;;
15716 : see if pthread_yield exists
15717 set try -DPTHREAD_YIELD
15718 if eval $compile; then
15720 case "$sched_yield" in
15721 '') sched_yield='pthread_yield()' ;;
15724 set try -DPTHREAD_YIELD_NULL
15725 if eval $compile; then
15727 case "$sched_yield" in
15728 '') sched_yield='pthread_yield(NULL)' ;;
15734 case "$usethreads" in
15737 $define) echo 'pthread_yield() found.' >&4 ;;
15738 *) echo 'pthread_yield() NOT found.' >&4 ;;
15742 set d_pthread_yield
15744 case "$sched_yield" in
15745 '') sched_yield=undef ;;
15749 : see if random_r exists
15750 set random_r d_random_r
15752 case "$d_random_r" in
15754 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
15755 case "$d_random_r_proto:$usethreads" in
15756 ":define") d_random_r_proto=define
15757 set d_random_r_proto random_r $hdrs
15761 case "$d_random_r_proto" in
15763 case "$random_r_proto" in
15764 ''|0) try='int random_r(int*, struct random_data*);'
15765 ./protochk "extern $try" $hdrs && random_r_proto=I_iS ;;
15767 case "$random_r_proto" in
15768 ''|0) try='int random_r(long*, struct random_data*);'
15769 ./protochk "extern $try" $hdrs && random_r_proto=I_lS ;;
15771 case "$random_r_proto" in
15772 ''|0) try='int random_r(struct random_data*, int32_t*);'
15773 ./protochk "extern $try" $hdrs && random_r_proto=I_St ;;
15775 case "$random_r_proto" in
15776 ''|0) d_random_r=undef
15778 echo "Disabling random_r, cannot determine prototype." >&4 ;;
15779 * ) case "$random_r_proto" in
15780 REENTRANT_PROTO*) ;;
15781 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
15783 echo "Prototype: $try" ;;
15786 *) case "$usethreads" in
15787 define) echo "random_r has no prototype, not using it." >&4 ;;
15794 *) random_r_proto=0
15798 : see if readdir and friends exist
15799 set readdir d_readdir
15801 set seekdir d_seekdir
15803 set telldir d_telldir
15805 set rewinddir d_rewinddir
15808 : see if readdir64_r exists
15809 set readdir64_r d_readdir64_r
15811 case "$d_readdir64_r" in
15813 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
15814 case "$d_readdir64_r_proto:$usethreads" in
15815 ":define") d_readdir64_r_proto=define
15816 set d_readdir64_r_proto readdir64_r $hdrs
15820 case "$d_readdir64_r_proto" in
15822 case "$readdir64_r_proto" in
15823 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
15824 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TSR ;;
15826 case "$readdir64_r_proto" in
15827 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
15828 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TS ;;
15830 case "$readdir64_r_proto" in
15831 ''|0) d_readdir64_r=undef
15832 readdir64_r_proto=0
15833 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
15834 * ) case "$readdir64_r_proto" in
15835 REENTRANT_PROTO*) ;;
15836 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
15838 echo "Prototype: $try" ;;
15841 *) case "$usethreads" in
15842 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
15844 d_readdir64_r=undef
15845 readdir64_r_proto=0
15849 *) readdir64_r_proto=0
15853 : see if readdir_r exists
15854 set readdir_r d_readdir_r
15856 case "$d_readdir_r" in
15858 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
15859 case "$d_readdir_r_proto:$usethreads" in
15860 ":define") d_readdir_r_proto=define
15861 set d_readdir_r_proto readdir_r $hdrs
15865 case "$d_readdir_r_proto" in
15867 case "$readdir_r_proto" in
15868 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
15869 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TSR ;;
15871 case "$readdir_r_proto" in
15872 ''|0) try='int readdir_r(DIR*, struct dirent*);'
15873 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TS ;;
15875 case "$readdir_r_proto" in
15876 ''|0) d_readdir_r=undef
15878 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
15879 * ) case "$readdir_r_proto" in
15880 REENTRANT_PROTO*) ;;
15881 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
15883 echo "Prototype: $try" ;;
15886 *) case "$usethreads" in
15887 define) echo "readdir_r has no prototype, not using it." >&4 ;;
15894 *) readdir_r_proto=0
15898 : see if readv exists
15902 : see if recvmsg exists
15903 set recvmsg d_recvmsg
15906 : see if rename exists
15907 set rename d_rename
15910 : see if rmdir exists
15914 : see if memory.h is available.
15919 : See if it conflicts with string.h
15925 $cppstdin $cppflags $cppminus < $strings > mem.h
15926 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
15928 echo "We won't be including <memory.h>."
15938 : can bcopy handle overlapping blocks?
15941 case "$d_memmove" in
15942 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
15943 *) case "$d_bcopy" in
15945 echo "Checking to see if bcopy() can do overlapping copies..." >&4
15947 #$i_memory I_MEMORY
15948 #$i_stdlib I_STDLIB
15949 #$i_string I_STRING
15950 #$i_unistd I_UNISTD
15952 $cat >>try.c <<'EOCP'
15955 # include <memory.h>
15958 # include <stdlib.h>
15961 # include <string.h>
15963 # include <strings.h>
15966 # include <unistd.h> /* Needed for NetBSD */
15970 char buf[128], abc[128];
15976 /* Copy "abcde..." string to char abc[] so that gcc doesn't
15977 try to store the string in read-only memory. */
15978 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
15980 for (align = 7; align >= 0; align--) {
15981 for (len = 36; len; len--) {
15983 bcopy(abc, b, len);
15984 for (off = 1; off <= len; off++) {
15985 bcopy(b, b+off, len);
15986 bcopy(b+off, b, len);
15987 if (bcmp(b, abc, len))
15996 if eval $compile_ok; then
15997 if $run ./try 2>/dev/null; then
15998 echo "Yes, it can."
16001 echo "It can't, sorry."
16004 echo "(I can't compile the test program, so we'll assume not...)"
16014 : can memcpy handle overlapping blocks?
16017 case "$d_memmove" in
16018 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
16019 *) case "$d_memcpy" in
16021 echo "Checking to see if memcpy() can do overlapping copies..." >&4
16023 #$i_memory I_MEMORY
16024 #$i_stdlib I_STDLIB
16025 #$i_string I_STRING
16026 #$i_unistd I_UNISTD
16028 $cat >>try.c <<'EOCP'
16031 # include <memory.h>
16034 # include <stdlib.h>
16037 # include <string.h>
16039 # include <strings.h>
16042 # include <unistd.h> /* Needed for NetBSD */
16046 char buf[128], abc[128];
16052 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16053 try to store the string in read-only memory. */
16054 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
16056 for (align = 7; align >= 0; align--) {
16057 for (len = 36; len; len--) {
16059 memcpy(b, abc, len);
16060 for (off = 1; off <= len; off++) {
16061 memcpy(b+off, b, len);
16062 memcpy(b, b+off, len);
16063 if (memcmp(b, abc, len))
16072 if eval $compile_ok; then
16073 if $run ./try 2>/dev/null; then
16074 echo "Yes, it can."
16077 echo "It can't, sorry."
16080 echo "(I can't compile the test program, so we'll assume not...)"
16090 : can memcmp be trusted to compare relative magnitude?
16092 case "$d_memcmp" in
16095 echo "Checking if your memcmp() can compare relative magnitude..." >&4
16097 #$i_memory I_MEMORY
16098 #$i_stdlib I_STDLIB
16099 #$i_string I_STRING
16100 #$i_unistd I_UNISTD
16102 $cat >>try.c <<'EOCP'
16105 # include <memory.h>
16108 # include <stdlib.h>
16111 # include <string.h>
16113 # include <strings.h>
16116 # include <unistd.h> /* Needed for NetBSD */
16122 if ((a < b) && memcmp(&a, &b, 1) < 0)
16128 if eval $compile_ok; then
16129 if $run ./try 2>/dev/null; then
16130 echo "Yes, it can."
16133 echo "No, it can't (it uses signed chars)."
16136 echo "(I can't compile the test program, so we'll assume not...)"
16144 : see if prototype for sbrk is available
16146 set d_sbrkproto sbrk $i_unistd unistd.h
16149 : see if select exists
16150 set select d_select
16153 : see if semctl exists
16154 set semctl d_semctl
16157 : see if semget exists
16158 set semget d_semget
16161 : see if semop exists
16165 : see how much of the 'sem*(2)' library is present.
16168 case "$d_semctl$d_semget$d_semop" in
16169 *"$undef"*) h_sem=false;;
16173 case "`ipcs 2>&1`" in
16174 "SVID messages"*"not configured"*)
16175 echo "Your $osname does not have the sem*(2) configured." >&4
16178 set semctl d_semctl
16180 set semget d_semget
16188 : we could also check for sys/ipc.h ...
16189 if $h_sem && $test `./findhdr sys/sem.h`; then
16190 echo "You have the full sem*(2) library." >&4
16193 echo "You don't have the full sem*(2) library." >&4
16199 : see whether sys/sem.h defines union semun
16201 $cat > try.c <<'END'
16202 #include <sys/types.h>
16203 #include <sys/ipc.h>
16204 #include <sys/sem.h>
16205 int main () { union semun semun; semun.buf = 0; }
16208 if eval $compile; then
16209 echo "You have union semun in <sys/sem.h>." >&4
16212 echo "You do not have union semun in <sys/sem.h>." >&4
16219 : see how to do semctl IPC_STAT
16223 $cat > tryh.h <<END
16226 # define S_IRUSR S_IREAD
16227 # define S_IWUSR S_IWRITE
16228 # define S_IXUSR S_IEXEC
16230 # define S_IRUSR 0400
16231 # define S_IWUSR 0200
16232 # define S_IXUSR 0100
16234 # define S_IRGRP (S_IRUSR>>3)
16235 # define S_IWGRP (S_IWUSR>>3)
16236 # define S_IXGRP (S_IXUSR>>3)
16237 # define S_IROTH (S_IRUSR>>6)
16238 # define S_IWOTH (S_IWUSR>>6)
16239 # define S_IXOTH (S_IXUSR>>6)
16242 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
16243 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
16244 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
16247 : see whether semctl IPC_STAT can use union semun
16248 case "$d_semctl_semun" in
16252 #include <sys/types.h>
16253 #include <sys/ipc.h>
16254 #include <sys/sem.h>
16255 #include <sys/stat.h>
16262 #$d_union_semun HAS_UNION_SEMUN
16265 #ifndef HAS_UNION_SEMUN
16268 struct semid_ds *buf;
16269 unsigned short *array;
16275 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16276 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16278 struct semid_ds argbuf;
16281 st = semctl(sem, 0, IPC_STAT, arg);
16285 # endif /* IPC_STAT */
16286 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16288 if (semctl(sem, 0, IPC_RMID, arg) != 0)
16289 # endif /* IPC_RMID */
16290 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16292 #endif /* IPC_PRIVATE && ... */
16293 printf("semget failed: errno = %d\n", errno);
16298 if eval $compile; then
16301 semun) val="$define" ;;
16309 case "$d_semctl_semun" in
16311 echo "You can use union semun for semctl IPC_STAT." >&4
16314 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
16319 : see whether semctl IPC_STAT can use struct semid_ds pointer
16320 case "$d_semctl_semid_ds" in
16323 $cat > try.c <<'END'
16324 #include <sys/types.h>
16325 #include <sys/ipc.h>
16326 #include <sys/sem.h>
16327 #include <sys/stat.h>
16335 struct semid_ds arg;
16338 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16339 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16342 st = semctl(sem, 0, IPC_STAT, &arg);
16344 printf("semid_ds\n");
16346 # endif /* IPC_STAT */
16347 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16349 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
16350 # endif /* IPC_RMID */
16351 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16353 #endif /* IPC_PRIVATE && ... */
16354 printf("semget failed: errno = %d\n", errno);
16360 if eval $compile; then
16363 semid_ds) val="$define" ;;
16367 set d_semctl_semid_ds
16371 case "$d_semctl_semid_ds" in
16373 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
16375 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
16381 # We do not have the full sem*(2) library, so assume we can not
16387 set d_semctl_semid_ds
16393 : see if sendmsg exists
16394 set sendmsg d_sendmsg
16397 : see if setegid exists
16398 set setegid d_setegid
16401 : see if seteuid exists
16402 set seteuid d_seteuid
16405 : see if setgrent exists
16406 set setgrent d_setgrent
16409 : see if setgrent_r exists
16410 set setgrent_r d_setgrent_r
16412 case "$d_setgrent_r" in
16414 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
16415 case "$d_setgrent_r_proto:$usethreads" in
16416 ":define") d_setgrent_r_proto=define
16417 set d_setgrent_r_proto setgrent_r $hdrs
16421 case "$d_setgrent_r_proto" in
16423 case "$setgrent_r_proto" in
16424 ''|0) try='int setgrent_r(FILE**);'
16425 ./protochk "extern $try" $hdrs && setgrent_r_proto=I_H ;;
16427 case "$setgrent_r_proto" in
16428 ''|0) try='void setgrent_r(FILE**);'
16429 ./protochk "extern $try" $hdrs && setgrent_r_proto=V_H ;;
16431 case "$setgrent_r_proto" in
16432 ''|0) d_setgrent_r=undef
16434 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
16435 * ) case "$setgrent_r_proto" in
16436 REENTRANT_PROTO*) ;;
16437 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
16439 echo "Prototype: $try" ;;
16442 *) case "$usethreads" in
16443 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
16450 *) setgrent_r_proto=0
16454 : see if sethostent exists
16455 set sethostent d_sethent
16458 : see if sethostent_r exists
16459 set sethostent_r d_sethostent_r
16461 case "$d_sethostent_r" in
16463 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16464 case "$d_sethostent_r_proto:$usethreads" in
16465 ":define") d_sethostent_r_proto=define
16466 set d_sethostent_r_proto sethostent_r $hdrs
16470 case "$d_sethostent_r_proto" in
16472 case "$sethostent_r_proto" in
16473 ''|0) try='int sethostent_r(int, struct hostent_data*);'
16474 ./protochk "extern $try" $hdrs && sethostent_r_proto=I_ID ;;
16476 case "$sethostent_r_proto" in
16477 ''|0) try='void sethostent_r(int, struct hostent_data*);'
16478 ./protochk "extern $try" $hdrs && sethostent_r_proto=V_ID ;;
16480 case "$sethostent_r_proto" in
16481 ''|0) d_sethostent_r=undef
16482 sethostent_r_proto=0
16483 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
16484 * ) case "$sethostent_r_proto" in
16485 REENTRANT_PROTO*) ;;
16486 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
16488 echo "Prototype: $try" ;;
16491 *) case "$usethreads" in
16492 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
16494 d_sethostent_r=undef
16495 sethostent_r_proto=0
16499 *) sethostent_r_proto=0
16503 : see if setitimer exists
16504 set setitimer d_setitimer
16507 : see if setlinebuf exists
16508 set setlinebuf d_setlinebuf
16511 : see if setlocale exists
16512 set setlocale d_setlocale
16515 : see if locale.h is available
16516 set locale.h i_locale
16519 : see if setlocale_r exists
16520 set setlocale_r d_setlocale_r
16522 case "$d_setlocale_r" in
16524 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
16525 case "$d_setlocale_r_proto:$usethreads" in
16526 ":define") d_setlocale_r_proto=define
16527 set d_setlocale_r_proto setlocale_r $hdrs
16531 case "$d_setlocale_r_proto" in
16533 case "$setlocale_r_proto" in
16534 ''|0) try='int setlocale_r(int, const char*, char*, int);'
16535 ./protochk "extern $try" $hdrs && setlocale_r_proto=I_ICBI ;;
16537 case "$setlocale_r_proto" in
16538 ''|0) d_setlocale_r=undef
16539 setlocale_r_proto=0
16540 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
16541 * ) case "$setlocale_r_proto" in
16542 REENTRANT_PROTO*) ;;
16543 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
16545 echo "Prototype: $try" ;;
16548 *) case "$usethreads" in
16549 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
16551 d_setlocale_r=undef
16552 setlocale_r_proto=0
16556 *) setlocale_r_proto=0
16560 : see if setnetent exists
16561 set setnetent d_setnent
16564 : see if setnetent_r exists
16565 set setnetent_r d_setnetent_r
16567 case "$d_setnetent_r" in
16569 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16570 case "$d_setnetent_r_proto:$usethreads" in
16571 ":define") d_setnetent_r_proto=define
16572 set d_setnetent_r_proto setnetent_r $hdrs
16576 case "$d_setnetent_r_proto" in
16578 case "$setnetent_r_proto" in
16579 ''|0) try='int setnetent_r(int, struct netent_data*);'
16580 ./protochk "extern $try" $hdrs && setnetent_r_proto=I_ID ;;
16582 case "$setnetent_r_proto" in
16583 ''|0) try='void setnetent_r(int, struct netent_data*);'
16584 ./protochk "extern $try" $hdrs && setnetent_r_proto=V_ID ;;
16586 case "$setnetent_r_proto" in
16587 ''|0) d_setnetent_r=undef
16588 setnetent_r_proto=0
16589 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
16590 * ) case "$setnetent_r_proto" in
16591 REENTRANT_PROTO*) ;;
16592 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
16594 echo "Prototype: $try" ;;
16597 *) case "$usethreads" in
16598 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
16600 d_setnetent_r=undef
16601 setnetent_r_proto=0
16605 *) setnetent_r_proto=0
16609 : see if setprotoent exists
16610 set setprotoent d_setpent
16613 : see if setpgid exists
16614 set setpgid d_setpgid
16617 : see if setpgrp2 exists
16618 set setpgrp2 d_setpgrp2
16621 : see if setpriority exists
16622 set setpriority d_setprior
16625 : see if setproctitle exists
16626 set setproctitle d_setproctitle
16629 : see if setprotoent_r exists
16630 set setprotoent_r d_setprotoent_r
16632 case "$d_setprotoent_r" in
16634 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16635 case "$d_setprotoent_r_proto:$usethreads" in
16636 ":define") d_setprotoent_r_proto=define
16637 set d_setprotoent_r_proto setprotoent_r $hdrs
16641 case "$d_setprotoent_r_proto" in
16643 case "$setprotoent_r_proto" in
16644 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
16645 ./protochk "extern $try" $hdrs && setprotoent_r_proto=I_ID ;;
16647 case "$setprotoent_r_proto" in
16648 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
16649 ./protochk "extern $try" $hdrs && setprotoent_r_proto=V_ID ;;
16651 case "$setprotoent_r_proto" in
16652 ''|0) d_setprotoent_r=undef
16653 setprotoent_r_proto=0
16654 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
16655 * ) case "$setprotoent_r_proto" in
16656 REENTRANT_PROTO*) ;;
16657 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
16659 echo "Prototype: $try" ;;
16662 *) case "$usethreads" in
16663 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
16665 d_setprotoent_r=undef
16666 setprotoent_r_proto=0
16670 *) setprotoent_r_proto=0
16674 : see if setpwent exists
16675 set setpwent d_setpwent
16678 : see if setpwent_r exists
16679 set setpwent_r d_setpwent_r
16681 case "$d_setpwent_r" in
16683 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
16684 case "$d_setpwent_r_proto:$usethreads" in
16685 ":define") d_setpwent_r_proto=define
16686 set d_setpwent_r_proto setpwent_r $hdrs
16690 case "$d_setpwent_r_proto" in
16692 case "$setpwent_r_proto" in
16693 ''|0) try='int setpwent_r(FILE**);'
16694 ./protochk "extern $try" $hdrs && setpwent_r_proto=I_H ;;
16696 case "$setpwent_r_proto" in
16697 ''|0) try='void setpwent_r(FILE**);'
16698 ./protochk "extern $try" $hdrs && setpwent_r_proto=V_H ;;
16700 case "$setpwent_r_proto" in
16701 ''|0) d_setpwent_r=undef
16703 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
16704 * ) case "$setpwent_r_proto" in
16705 REENTRANT_PROTO*) ;;
16706 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
16708 echo "Prototype: $try" ;;
16711 *) case "$usethreads" in
16712 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
16719 *) setpwent_r_proto=0
16723 : see if setregid exists
16724 set setregid d_setregid
16726 set setresgid d_setresgid
16729 : see if setreuid exists
16730 set setreuid d_setreuid
16732 set setresuid d_setresuid
16735 : see if setrgid exists
16736 set setrgid d_setrgid
16739 : see if setruid exists
16740 set setruid d_setruid
16743 : see if setservent exists
16744 set setservent d_setsent
16747 : see if setservent_r exists
16748 set setservent_r d_setservent_r
16750 case "$d_setservent_r" in
16752 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16753 case "$d_setservent_r_proto:$usethreads" in
16754 ":define") d_setservent_r_proto=define
16755 set d_setservent_r_proto setservent_r $hdrs
16759 case "$d_setservent_r_proto" in
16761 case "$setservent_r_proto" in
16762 ''|0) try='int setservent_r(int, struct servent_data*);'
16763 ./protochk "extern $try" $hdrs && setservent_r_proto=I_ID ;;
16765 case "$setservent_r_proto" in
16766 ''|0) try='void setservent_r(int, struct servent_data*);'
16767 ./protochk "extern $try" $hdrs && setservent_r_proto=V_ID ;;
16769 case "$setservent_r_proto" in
16770 ''|0) d_setservent_r=undef
16771 setservent_r_proto=0
16772 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
16773 * ) case "$setservent_r_proto" in
16774 REENTRANT_PROTO*) ;;
16775 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
16777 echo "Prototype: $try" ;;
16780 *) case "$usethreads" in
16781 define) echo "setservent_r has no prototype, not using it." >&4 ;;
16783 d_setservent_r=undef
16784 setservent_r_proto=0
16788 *) setservent_r_proto=0
16792 : see if setsid exists
16793 set setsid d_setsid
16796 : see if setvbuf exists
16797 set setvbuf d_setvbuf
16800 : see if sfio.h is available
16805 : see if sfio library is available
16816 : Ok, but do we want to use it.
16820 true|$define|[yY]*) dflt='y';;
16823 echo "$package can use the sfio library, but it is experimental."
16824 case "$useperlio" in
16826 echo "For sfio also the PerlIO abstraction layer is needed."
16827 echo "Earlier you said you wouldn't want that."
16830 rp="You seem to have sfio available, do you want to try using it?"
16833 y|Y) echo "Ok, turning on both sfio and PerlIO, then."
16834 useperlio="$define"
16837 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
16842 *) case "$usesfio" in
16843 true|$define|[yY]*)
16844 echo "Sorry, cannot find sfio on this machine." >&4
16845 echo "Ignoring your setting of usesfio=$usesfio." >&4
16854 $define) usesfio='true';;
16855 *) usesfio='false';;
16859 *) : Remove sfio from list of libraries to use
16862 echo "Removing unneeded -lsfio from library list" >&4
16863 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
16866 echo "libs = $libs" >&4
16873 : see if shmctl exists
16874 set shmctl d_shmctl
16877 : see if shmget exists
16878 set shmget d_shmget
16881 : see if shmat exists
16884 : see what shmat returns
16887 $cat >shmat.c <<'END'
16888 #include <sys/shm.h>
16891 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
16896 echo "and it returns ($shmattype)." >&4
16897 : see if a prototype for shmat is available
16898 xxx=`./findhdr sys/shm.h`
16899 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
16900 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
16911 set d_shmatprototype
16914 : see if shmdt exists
16918 : see how much of the 'shm*(2)' library is present.
16921 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
16922 *"$undef"*) h_shm=false;;
16926 case "`ipcs 2>&1`" in
16927 "SVID shared memory"*"not configured"*)
16928 echo "Your $osname does not have the shm*(2) configured." >&4
16931 set shmctl d_shmctl
16933 set shmget d_shmget
16943 : we could also check for sys/ipc.h ...
16944 if $h_shm && $test `./findhdr sys/shm.h`; then
16945 echo "You have the full shm*(2) library." >&4
16948 echo "You don't have the full shm*(2) library." >&4
16955 : see if we have sigaction
16956 if set sigaction val -f d_sigaction; eval $csym; $val; then
16957 echo 'sigaction() found.' >&4
16960 #include <sys/types.h>
16961 #include <signal.h>
16962 #$i_stdlib I_STDLIB
16964 #include <stdlib.h>
16968 struct sigaction act, oact;
16970 oact.sa_handler = 0;
16971 /* so that act and oact are used */
16972 exit(act.sa_flags == 0 && oact.sa_handler == 0);
16976 if eval $compile_ok; then
16979 echo "But you don't seem to have a useable struct sigaction." >&4
16983 echo 'sigaction NOT found.' >&4
16986 set d_sigaction; eval $setvar
16989 : see if this is a sunmath.h system
16990 set sunmath.h i_sunmath
16993 : see if signbit exists
16994 $echo $n "Checking to see if you have signbit() available to work on $nvtype... $c" >&4
16997 #$i_sunmath I_SUNMATH
17001 #ifdef I_SUNMATH /* Solaris special math library */
17002 # include <sunmath.h>
17005 int main(int argc, char **argv)
17009 if ((signbit(x) == 0) && (signbit(y) != 0))
17017 if eval $compile; then
17018 if $run ./try; then
17022 $echo "Signbit seems to be available, but doesn't work as I expected."
17023 $echo "I won't use it." >&4
17034 : see if sigprocmask exists
17035 set sigprocmask d_sigprocmask
17038 : see if sigsetjmp exists
17040 case "$d_sigsetjmp" in
17043 #include <setjmp.h>
17044 #$i_stdlib I_STDLIB
17046 #include <stdlib.h>
17052 if (sigsetjmp(env,1))
17055 siglongjmp(env, 1);
17060 if eval $compile; then
17061 if $run ./try >/dev/null 2>&1; then
17062 echo "POSIX sigsetjmp found." >&4
17066 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
17072 echo "sigsetjmp not found." >&4
17076 *) val="$d_sigsetjmp"
17077 case "$d_sigsetjmp" in
17078 $define) echo "POSIX sigsetjmp found." >&4;;
17079 $undef) echo "sigsetjmp not found." >&4;;
17087 : see if snprintf exists
17088 set snprintf d_snprintf
17091 : see if vsnprintf exists
17092 set vsnprintf d_vsnprintf
17095 case "$d_snprintf-$d_vsnprintf" in
17098 Checking whether your snprintf() and vsnprintf() work okay...
17100 $cat >try.c <<'EOCP'
17101 /* v?snprintf testing logic courtesy of Russ Allbery.
17102 * According to C99:
17103 * - if the buffer is too short it still must be \0-terminated
17104 * - if the buffer is too short the potentially required length
17105 * must be returned and not -1
17106 * - if the buffer is NULL the potentially required length
17107 * must be returned and not -1 or core dump
17110 #include <stdarg.h>
17114 int test (char *format, ...)
17119 va_start (args, format);
17120 count = vsnprintf (buf, sizeof buf, format, args);
17127 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
17128 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
17132 if eval $compile; then
17135 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
17137 Your snprintf() and snprintf() don't seem to be working okay.
17139 d_snprintf="$undef"
17140 d_vsnprintf="$undef"
17144 echo "(I can't seem to compile the test program--assuming they don't)"
17145 d_snprintf="$undef"
17146 d_vsnprintf="$undef"
17152 : see if sockatmark exists
17153 set sockatmark d_sockatmark
17156 : see if prototype for sockatmark is available
17158 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
17161 : see if socks5_init exists
17162 set socks5_init d_socks5_init
17165 : see if sprintf returns the length of the string in the buffer as per ANSI
17166 $echo "Checking whether sprintf returns the length of the string..." >&4
17169 #$i_stdlib I_STDLIB
17171 #include <stdlib.h>
17173 #$i_string I_STRING
17175 # include <string.h>
17177 # include <strings.h>
17186 int check (size_t expect, int test) {
17187 size_t got = strlen(buffer);
17191 printf("expected %ld, got %ld in test %d '%s'\n", (long) expect, (long) got,
17196 int main(int argc, char **argv) {
17199 check(sprintf(buffer, ""), ++test);
17200 check(sprintf(buffer, "%s %s", "perl", "rules"), ++test);
17201 check(sprintf(buffer, "I like %g", atan2(0,-1)), ++test);
17208 d_sprintf_returns_strlen="$undef"
17209 if eval $compile; then
17213 sprintf returns the length of the string (as ANSI says it should)
17215 d_sprintf_returns_strlen="$define"
17218 sprintf does not return the length of the string (how old is this system?)
17220 d_sprintf_returns_strlen="$undef"
17226 : see if srand48_r exists
17227 set srand48_r d_srand48_r
17229 case "$d_srand48_r" in
17231 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17232 case "$d_srand48_r_proto:$usethreads" in
17233 ":define") d_srand48_r_proto=define
17234 set d_srand48_r_proto srand48_r $hdrs
17238 case "$d_srand48_r_proto" in
17240 case "$srand48_r_proto" in
17241 ''|0) try='int srand48_r(long, struct drand48_data*);'
17242 ./protochk "extern $try" $hdrs && srand48_r_proto=I_LS ;;
17244 case "$srand48_r_proto" in
17245 ''|0) d_srand48_r=undef
17247 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
17248 * ) case "$srand48_r_proto" in
17249 REENTRANT_PROTO*) ;;
17250 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
17252 echo "Prototype: $try" ;;
17255 *) case "$usethreads" in
17256 define) echo "srand48_r has no prototype, not using it." >&4 ;;
17263 *) srand48_r_proto=0
17267 : see if srandom_r exists
17268 set srandom_r d_srandom_r
17270 case "$d_srandom_r" in
17272 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17273 case "$d_srandom_r_proto:$usethreads" in
17274 ":define") d_srandom_r_proto=define
17275 set d_srandom_r_proto srandom_r $hdrs
17279 case "$d_srandom_r_proto" in
17281 case "$srandom_r_proto" in
17282 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
17283 ./protochk "extern $try" $hdrs && srandom_r_proto=I_TS ;;
17285 case "$srandom_r_proto" in
17286 ''|0) d_srandom_r=undef
17288 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
17289 * ) case "$srandom_r_proto" in
17290 REENTRANT_PROTO*) ;;
17291 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
17293 echo "Prototype: $try" ;;
17296 *) case "$usethreads" in
17297 define) echo "srandom_r has no prototype, not using it." >&4 ;;
17304 *) srandom_r_proto=0
17308 : see if prototype for setresgid is available
17310 set d_sresgproto setresgid $i_unistd unistd.h
17313 : see if prototype for setresuid is available
17315 set d_sresuproto setresuid $i_unistd unistd.h
17318 : see if sys/stat.h is available
17319 set sys/stat.h i_sysstat
17323 : see if stat knows about block sizes
17325 echo "Checking to see if your struct stat has st_blocks field..." >&4
17326 set d_statblks stat st_blocks $i_sysstat sys/stat.h
17330 : see if this is a sys/vfs.h system
17331 set sys/vfs.h i_sysvfs
17335 : see if this is a sys/statfs.h system
17336 set sys/statfs.h i_sysstatfs
17341 echo "Checking to see if your system supports struct statfs..." >&4
17342 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
17344 case "$d_statfs_s" in
17345 "$define") echo "Yes, it does." ;;
17346 *) echo "No, it doesn't." ;;
17351 : see if struct statfs knows about f_flags
17352 case "$d_statfs_s" in
17355 echo "Checking to see if your struct statfs has f_flags field..." >&4
17356 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
17360 set d_statfs_f_flags
17364 case "$d_statfs_f_flags" in
17365 "$define") echo "Yes, it does." ;;
17366 *) echo "No, it doesn't." ;;
17370 Checking how to access stdio streams by file descriptor number...
17372 case "$stdio_stream_array" in
17373 '') $cat >try.c <<EOCP
17376 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
17380 for s in _iob __iob __sF
17382 set try -DSTDIO_STREAM_ARRAY=$s
17383 if eval $compile; then
17384 case "`$run ./try`" in
17385 yes) stdio_stream_array=$s; break ;;
17391 case "$stdio_stream_array" in
17393 I can't figure out how to access stdio streams by file descriptor number.
17395 d_stdio_stream_array="$undef"
17398 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
17400 d_stdio_stream_array="$define"
17404 : see if strcoll exists
17405 set strcoll d_strcoll
17408 : check for structure copying
17410 echo "Checking to see if your C compiler can copy structs..." >&4
17411 $cat >try.c <<'EOCP'
17421 if $cc -c try.c >/dev/null 2>&1 ; then
17423 echo "Yup, it can."
17426 echo "Nope, it can't."
17432 : see if strerror and/or sys_errlist[] exist
17434 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
17435 if set strerror val -f d_strerror; eval $csym; $val; then
17436 echo 'strerror() found.' >&4
17437 d_strerror="$define"
17438 d_strerrm='strerror(e)'
17439 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17440 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
17441 d_syserrlst="$define"
17443 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
17444 d_syserrlst="$undef"
17446 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
17447 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
17448 echo 'strerror() found in string header.' >&4
17449 d_strerror="$define"
17450 d_strerrm='strerror(e)'
17451 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17452 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
17453 d_syserrlst="$define"
17455 echo "(You don't appear to have any sys_errlist[], how can this be?)"
17456 d_syserrlst="$undef"
17458 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17459 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
17460 d_strerror="$undef"
17461 d_syserrlst="$define"
17462 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
17464 echo 'strerror() and sys_errlist[] NOT found.' >&4
17465 d_strerror="$undef"
17466 d_syserrlst="$undef"
17467 d_strerrm='"unknown"'
17471 : see if strerror_r exists
17472 set strerror_r d_strerror_r
17474 case "$d_strerror_r" in
17476 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
17477 case "$d_strerror_r_proto:$usethreads" in
17478 ":define") d_strerror_r_proto=define
17479 set d_strerror_r_proto strerror_r $hdrs
17483 case "$d_strerror_r_proto" in
17485 case "$strerror_r_proto" in
17486 ''|0) try='int strerror_r(int, char*, size_t);'
17487 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBW ;;
17489 case "$strerror_r_proto" in
17490 ''|0) try='int strerror_r(int, char*, int);'
17491 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBI ;;
17493 case "$strerror_r_proto" in
17494 ''|0) try='char* strerror_r(int, char*, size_t);'
17495 ./protochk "extern $try" $hdrs && strerror_r_proto=B_IBW ;;
17497 case "$strerror_r_proto" in
17498 ''|0) d_strerror_r=undef
17500 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
17501 * ) case "$strerror_r_proto" in
17502 REENTRANT_PROTO*) ;;
17503 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
17505 echo "Prototype: $try" ;;
17508 *) case "$usethreads" in
17509 define) echo "strerror_r has no prototype, not using it." >&4 ;;
17516 *) strerror_r_proto=0
17520 : see if strftime exists
17521 set strftime d_strftime
17524 : see if strlcat exists
17525 set strlcat d_strlcat
17528 : see if strlcpy exists
17529 set strlcpy d_strlcpy
17532 : see if strtod exists
17533 set strtod d_strtod
17536 : see if strtol exists
17537 set strtol d_strtol
17540 : see if strtold exists
17541 set strtold d_strtold
17544 : see if strtoll exists
17545 set strtoll d_strtoll
17548 case "$d_longlong-$d_strtoll" in
17551 Checking whether your strtoll() works okay...
17553 $cat >try.c <<'EOCP'
17556 #define strtoll __strtoll
17559 #define strtoll _strtoll
17562 extern long long int strtoll(char *s, char **, int);
17563 static int bad = 0;
17564 int check(char *s, long long ell, int een) {
17567 gll = strtoll(s, 0, 10);
17568 if (!((gll == ell) && (errno == een)))
17572 check(" 1", 1LL, 0);
17573 check(" 0", 0LL, 0);
17574 check("-1", -1LL, 0);
17575 check("-9223372036854775808", -9223372036854775808LL, 0);
17576 check("-9223372036854775808", -9223372036854775808LL, 0);
17577 check(" 9223372036854775807", 9223372036854775807LL, 0);
17578 check("-9223372036854775808", -9223372036854775808LL, 0);
17579 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
17580 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
17586 if eval $compile; then
17589 ok) echo "Your strtoll() seems to be working okay." ;;
17591 Your strtoll() doesn't seem to be working okay.
17597 echo "(I can't seem to compile the test program--assuming it doesn't)"
17603 : see if strtoq exists
17604 set strtoq d_strtoq
17607 : see if strtoul exists
17608 set strtoul d_strtoul
17611 case "$d_strtoul" in
17614 Checking whether your strtoul() works okay...
17616 $cat >try.c <<'EOCP'
17619 extern unsigned long int strtoul(char *s, char **, int);
17620 static int bad = 0;
17621 void check(char *s, unsigned long eul, int een) {
17624 gul = strtoul(s, 0, 10);
17625 if (!((gul == eul) && (errno == een)))
17629 check(" 1", 1L, 0);
17630 check(" 0", 0L, 0);
17632 case "$longsize" in
17634 $cat >>try.c <<'EOCP'
17635 check("18446744073709551615", 18446744073709551615UL, 0);
17636 check("18446744073709551616", 18446744073709551615UL, ERANGE);
17637 #if 0 /* strtoul() for /^-/ strings is undefined. */
17638 check("-1", 18446744073709551615UL, 0);
17639 check("-18446744073709551614", 2, 0);
17640 check("-18446744073709551615", 1, 0);
17641 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
17642 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
17647 $cat >>try.c <<'EOCP'
17648 check("4294967295", 4294967295UL, 0);
17649 check("4294967296", 4294967295UL, ERANGE);
17650 #if 0 /* strtoul() for /^-/ strings is undefined. */
17651 check("-1", 4294967295UL, 0);
17652 check("-4294967294", 2, 0);
17653 check("-4294967295", 1, 0);
17654 check("-4294967296", 4294967295UL, ERANGE);
17655 check("-4294967297", 4294967295UL, ERANGE);
17660 : Should we write these tests to be more portable by sprintf-ing
17661 : ~0 and then manipulating that char string as input for strtol?
17664 $cat >>try.c <<'EOCP'
17671 if eval $compile; then
17672 case "`$run ./try`" in
17673 ok) echo "Your strtoul() seems to be working okay." ;;
17675 Your strtoul() doesn't seem to be working okay.
17681 echo "(I can't seem to compile the test program--assuming it doesn't)"
17687 : see if strtoull exists
17688 set strtoull d_strtoull
17691 case "$d_longlong-$d_strtoull" in
17694 Checking whether your strtoull() works okay...
17696 $cat >try.c <<'EOCP'
17699 #define strtoull __strtoull
17702 extern unsigned long long int strtoull(char *s, char **, int);
17703 static int bad = 0;
17704 int check(char *s, long long eull, int een) {
17707 gull = strtoull(s, 0, 10);
17708 if (!((gull == eull) && (errno == een)))
17712 check(" 1", 1LL, 0);
17713 check(" 0", 0LL, 0);
17714 check("18446744073709551615", 18446744073709551615ULL, 0);
17715 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
17716 #if 0 /* strtoull() for /^-/ strings is undefined. */
17717 check("-1", 18446744073709551615ULL, 0);
17718 check("-18446744073709551614", 2LL, 0);
17719 check("-18446744073709551615", 1LL, 0);
17720 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
17721 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
17728 if eval $compile; then
17729 case "`$run ./try`" in
17730 ok) echo "Your strtoull() seems to be working okay." ;;
17732 Your strtoull() doesn't seem to be working okay.
17734 d_strtoull="$undef"
17738 echo "(I can't seem to compile the test program--assuming it doesn't)"
17739 d_strtoull="$undef"
17744 : see if strtouq exists
17745 set strtouq d_strtouq
17748 case "$d_strtouq" in
17751 Checking whether your strtouq() works okay...
17753 $cat >try.c <<'EOCP'
17756 extern unsigned long long int strtouq(char *s, char **, int);
17757 static int bad = 0;
17758 void check(char *s, unsigned long long eull, int een) {
17759 unsigned long long gull;
17761 gull = strtouq(s, 0, 10);
17762 if (!((gull == eull) && (errno == een)))
17766 check(" 1", 1LL, 0);
17767 check(" 0", 0LL, 0);
17768 check("18446744073709551615", 18446744073709551615ULL, 0);
17769 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
17770 #if 0 /* strtouq() for /^-/ strings is undefined. */
17771 check("-1", 18446744073709551615ULL, 0);
17772 check("-18446744073709551614", 2LL, 0);
17773 check("-18446744073709551615", 1LL, 0);
17774 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
17775 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
17783 if eval $compile; then
17784 case "`$run ./try`" in
17785 ok) echo "Your strtouq() seems to be working okay." ;;
17787 Your strtouq() doesn't seem to be working okay.
17793 echo "(I can't seem to compile the test program--assuming it doesn't)"
17799 : see if strxfrm exists
17800 set strxfrm d_strxfrm
17803 : see if symlink exists
17804 set symlink d_symlink
17807 : see if syscall exists
17808 set syscall d_syscall
17811 : see if prototype for syscall is available
17813 set d_syscallproto syscall $i_unistd unistd.h
17816 : see if sysconf exists
17817 set sysconf d_sysconf
17820 : see if system exists
17821 set system d_system
17824 : see if tcgetpgrp exists
17825 set tcgetpgrp d_tcgetpgrp
17828 : see if tcsetpgrp exists
17829 set tcsetpgrp d_tcsetpgrp
17832 : see if prototype for telldir is available
17834 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
17837 : see if time exists
17839 if test "X$d_time" = X -o X"$timetype" = X; then
17840 if set time val -f d_time; eval $csym; $val; then
17841 echo 'time() found.' >&4
17843 rp="What is the type returned by time() on this system?"
17844 set time_t timetype long stdio.h sys/types.h
17847 echo 'time() not found, hope that will do.' >&4
17855 : see if this is a sys/times.h system
17856 set sys/times.h i_systimes
17859 : see if times exists
17861 if set times val -f d_times; eval $csym; $val; then
17862 echo 'times() found.' >&4
17865 case "$i_systimes" in
17866 "$define") inc='sys/times.h';;
17868 rp="What is the type returned by times() on this system?"
17869 set clock_t clocktype long stdio.h sys/types.h $inc
17872 echo 'times() NOT found, hope that will do.' >&4
17877 : see if tmpnam_r exists
17878 set tmpnam_r d_tmpnam_r
17880 case "$d_tmpnam_r" in
17882 hdrs="$i_systypes sys/types.h define stdio.h "
17883 case "$d_tmpnam_r_proto:$usethreads" in
17884 ":define") d_tmpnam_r_proto=define
17885 set d_tmpnam_r_proto tmpnam_r $hdrs
17889 case "$d_tmpnam_r_proto" in
17891 case "$tmpnam_r_proto" in
17892 ''|0) try='char* tmpnam_r(char*);'
17893 ./protochk "extern $try" $hdrs && tmpnam_r_proto=B_B ;;
17895 case "$tmpnam_r_proto" in
17896 ''|0) d_tmpnam_r=undef
17898 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
17899 * ) case "$tmpnam_r_proto" in
17900 REENTRANT_PROTO*) ;;
17901 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
17903 echo "Prototype: $try" ;;
17906 *) case "$usethreads" in
17907 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
17914 *) tmpnam_r_proto=0
17918 : see if truncate exists
17919 set truncate d_truncate
17922 : see if ttyname_r exists
17923 set ttyname_r d_ttyname_r
17925 case "$d_ttyname_r" in
17927 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
17928 case "$d_ttyname_r_proto:$usethreads" in
17929 ":define") d_ttyname_r_proto=define
17930 set d_ttyname_r_proto ttyname_r $hdrs
17934 case "$d_ttyname_r_proto" in
17936 case "$ttyname_r_proto" in
17937 ''|0) try='int ttyname_r(int, char*, size_t);'
17938 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBW ;;
17940 case "$ttyname_r_proto" in
17941 ''|0) try='int ttyname_r(int, char*, int);'
17942 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBI ;;
17944 case "$ttyname_r_proto" in
17945 ''|0) try='char* ttyname_r(int, char*, int);'
17946 ./protochk "extern $try" $hdrs && ttyname_r_proto=B_IBI ;;
17948 case "$ttyname_r_proto" in
17949 ''|0) d_ttyname_r=undef
17951 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
17952 * ) case "$ttyname_r_proto" in
17953 REENTRANT_PROTO*) ;;
17954 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
17956 echo "Prototype: $try" ;;
17959 *) case "$usethreads" in
17960 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
17967 *) ttyname_r_proto=0
17971 : see if tzname[] exists
17973 if set tzname val -a d_tzname; eval $csym; $val; then
17975 echo 'tzname[] found.' >&4
17978 echo 'tzname[] NOT found.' >&4
17984 next|rhapsody|darwin) multiarch="$define" ;;
17986 case "$multiarch" in
17987 ''|[nN]*) multiarch="$undef" ;;
17990 : check for ordering of bytes in a UV
17992 case "$usecrosscompile$multiarch" in
17995 You seem to be either cross-compiling or doing a multiarchitecture build,
17996 skipping the byteorder check.
18002 case "$byteorder" in
18005 In the following, larger digits indicate more significance. A big-endian
18006 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
18007 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
18008 machines may have weird orders like 3412. A Cray will report 87654321,
18009 an Alpha will report 12345678. If the test program works the default is
18011 I'm now running the test program...
18015 #$i_stdlib I_STDLIB
18017 #include <stdlib.h>
18019 #include <sys/types.h>
18020 typedef $uvtype UV;
18030 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
18032 u.l = (UV)0x04030201;
18033 for (i = 0; i < $uvsize; i++)
18034 printf("%c", u.c[i]+'0');
18041 if eval $compile && $run ./try > /dev/null; then
18044 [1-4][1-4][1-4][1-4]|12345678|87654321)
18045 echo "(The test program ran ok.)"
18046 echo "byteorder=$dflt"
18049 ????|????????) echo "(The test program ran ok.)" ;;
18050 *) echo "(The test program didn't run right for some reason.)" ;;
18055 (I can't seem to compile the test program. Guessing big-endian...)
18058 case "$xxx_prompt" in
18060 rp="What is the order of bytes in $uvtype?"
18075 Checking to see whether you can access character data unalignedly...
18077 case "$d_u32align" in
18078 '') $cat >try.c <<EOCP
18080 #$i_stdlib I_STDLIB
18082 #include <stdlib.h>
18084 #define U32 $u32type
18085 #define BYTEORDER 0x$byteorder
18087 #include <signal.h>
18089 $signal_t bletch(int s) { exit(4); }
18092 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
18097 if (sizeof(U32) != 4) {
18098 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
18105 signal(SIGBUS, bletch);
18117 for (i = 0; i < 4; i++) {
18118 up = (U32*)(buf + i);
18119 if (! ((*up == 1 << (8*i)) || /* big-endian */
18120 (*up == 1 << (8*(3-i))) /* little-endian */
18124 printf("read failed (%x)\n", *up);
18130 for (i = 0; i < 4; i++) {
18131 up = (U32*)(buf + i);
18133 if (*up != 0xBeef) {
18134 printf("write failed (%x)\n", *up);
18148 if eval $compile_ok; then
18149 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
18150 $run ./try 2>&1 >/dev/null
18153 You can access character data pretty unalignedly.
18155 d_u32align="$undef"
18158 It seems that you must access character data in an aligned manner.
18160 d_u32align="$define"
18164 rp='Can you access character data at unaligned addresses?'
18168 [yY]*) d_u32align="$undef" ;;
18169 *) d_u32align="$define" ;;
18176 : see if ualarm exists
18177 set ualarm d_ualarm
18180 : see if umask exists
18184 : see if unordered exists
18185 set unordered d_unordered
18188 : see if unsetenv exists
18189 set unsetenv d_unsetenv
18192 : see if usleep exists
18193 set usleep d_usleep
18196 : see if prototype for usleep is available
18198 set d_usleepproto usleep $i_unistd unistd.h
18201 : see if ustat exists
18205 : see if closedir exists
18206 set closedir d_closedir
18209 case "$d_closedir" in
18212 echo "Checking whether closedir() returns a status..." >&4
18214 #$i_dirent I_DIRENT /**/
18215 #$i_sysdir I_SYS_DIR /**/
18216 #$i_sysndir I_SYS_NDIR /**/
18217 #$i_systypes I_SYS_TYPES /**/
18219 #if defined(I_SYS_TYPES)
18220 #include <sys/types.h>
18222 #if defined(I_DIRENT)
18223 #include <dirent.h>
18224 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
18225 #include <sys/dir.h>
18229 #include <sys/ndir.h>
18233 #include <ndir.h> /* may be wrong in the future */
18235 #include <sys/dir.h>
18240 int main() { return closedir(opendir(".")); }
18243 if eval $compile_ok; then
18244 if $run ./try > /dev/null 2>&1 ; then
18245 echo "Yes, it does."
18248 echo "No, it doesn't."
18252 echo "(I can't seem to compile the test program--assuming it doesn't)"
18260 set d_void_closedir
18264 : see if there is a wait4
18268 : see if waitpid exists
18269 set waitpid d_waitpid
18272 : see if wcstombs exists
18273 set wcstombs d_wcstombs
18276 : see if wctomb exists
18277 set wctomb d_wctomb
18280 : see if writev exists
18281 set writev d_writev
18284 : preserve RCS keywords in files with variable substitution, grrr
18289 Revision='$Revision'
18291 : check for alignment requirements
18293 case "$usecrosscompile$multiarch" in
18296 You seem to be either cross-compiling or doing a multiarchitecture build,
18297 skipping the memory alignment check.
18300 case "$alignbytes" in
18301 '') alignbytes=8 ;;
18305 case "$alignbytes" in
18306 '') echo "Checking alignment constraints..." >&4
18307 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
18308 $cat >try.c <<'EOCP'
18309 typedef long double NV;
18312 $cat >try.c <<'EOCP'
18316 $cat >>try.c <<'EOCP'
18324 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
18329 if eval $compile_ok; then
18333 echo "(I can't seem to compile the test program...)"
18336 *) dflt="$alignbytes"
18339 rp="Doubles must be aligned on a how-many-byte boundary?"
18347 : set the base revision
18350 : how do we concatenate cpp tokens here?
18352 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
18353 $cat >cpp_stuff.c <<'EOCP'
18354 #define RCAT(a,b)a/**/b
18355 #define ACAT(a,b)a ## b
18359 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
18360 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
18361 echo "Oh! Smells like ANSI's been here." >&4
18362 echo "We can catify or stringify, separately or together!"
18364 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
18365 echo "Ah, yes! The good old days!" >&4
18366 echo "However, in the good old days we don't know how to stringify and"
18367 echo "catify at the same time."
18371 Hmm, I don't seem to be able to concatenate tokens with your cpp.
18372 You're going to have to edit the values of CAT[2-5] in config.h...
18374 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
18378 : see if this is a db.h system
18384 : Check db version.
18386 echo "Checking Berkeley DB version ..." >&4
18392 #include <sys/types.h>
18394 #$i_stdlib I_STDLIB
18396 #include <stdlib.h>
18399 int main(int argc, char *argv[])
18401 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
18402 int Major, Minor, Patch ;
18403 unsigned long Version ;
18404 (void)db_version(&Major, &Minor, &Patch) ;
18406 printf("%d %d %d %d %d %d\n",
18407 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
18408 Major, Minor, Patch);
18411 printf("You have Berkeley DB Version 2 or greater.\n");
18413 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
18414 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
18415 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
18416 Major, Minor, Patch) ;
18418 /* check that db.h & libdb are compatible */
18419 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
18420 printf("db.h and libdb are incompatible.\n") ;
18424 printf("db.h and libdb are compatible.\n") ;
18426 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
18427 + DB_VERSION_PATCH ;
18429 /* needs to be >= 2.3.4 */
18430 if (Version < 2003004) {
18431 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
18432 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
18438 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
18443 printf("You have Berkeley DB Version 1.\n");
18444 exit(0); /* DB version < 2: the coast is clear. */
18446 exit(1); /* <db.h> not Berkeley DB? */
18452 if eval $compile_ok && $run ./try; then
18453 echo 'Looks OK.' >&4
18455 db_version_major=$1
18456 db_version_minor=$2
18457 db_version_patch=$3
18459 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
18463 : Remove db from list of libraries to use
18464 echo "Removing unusable -ldb from library list" >&4
18465 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
18468 echo "libs = $libs" >&4
18478 : Check the return type needed for hash
18480 echo "Checking return type needed for hash for Berkeley DB ..." >&4
18486 #include <sys/types.h>
18489 #ifndef DB_VERSION_MAJOR
18490 u_int32_t hash_cb (ptr, size)
18498 info.hash = hash_cb;
18502 if $cc $ccflags -c try.c >try.out 2>&1 ; then
18503 if $contains warning try.out >>/dev/null 2>&1 ; then
18506 db_hashtype='u_int32_t'
18509 : XXX Maybe we should just give up here.
18510 db_hashtype=u_int32_t
18512 echo "Help: I can't seem to compile the db test program." >&4
18513 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
18516 echo "Your version of Berkeley DB uses $db_hashtype for hash."
18518 *) db_hashtype=u_int32_t
18523 : Check the return type needed for prefix
18525 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
18531 #include <sys/types.h>
18534 #ifndef DB_VERSION_MAJOR
18535 size_t prefix_cb (key1, key2)
18543 info.prefix = prefix_cb;
18547 if $cc $ccflags -c try.c >try.out 2>&1 ; then
18548 if $contains warning try.out >>/dev/null 2>&1 ; then
18549 db_prefixtype='int'
18551 db_prefixtype='size_t'
18554 db_prefixtype='size_t'
18555 : XXX Maybe we should just give up here.
18557 echo "Help: I can't seem to compile the db test program." >&4
18558 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
18561 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
18563 *) db_prefixtype='size_t'
18567 : How can we generate normalized random numbers ?
18569 echo "Looking for a random number function..." >&4
18570 case "$randfunc" in
18572 if set drand48 val -f; eval $csym; $val; then
18574 echo "Good, found drand48()." >&4
18575 elif set random val -f; eval $csym; $val; then
18577 echo "OK, found random()." >&4
18580 echo "Yick, looks like I have to use rand()." >&4
18591 *-Dmy_rand=*|*-Dmy_srand=*)
18592 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
18593 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
18594 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
18595 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
18599 while $test "$cont"; do
18600 rp="Use which function to generate random numbers?"
18602 if $test "$ans" = "$dflt"; then
18608 if set $ans val -f; eval $csym; $val; then
18612 rp="I cannot find function $ans. Use that name anyway?"
18621 case "$randfunc" in
18623 drand01="drand48()"
18629 case "$randbits" in
18631 echo "Checking to see how many bits your $randfunc() function produces..." >&4
18633 #$i_unistd I_UNISTD
18634 #$i_stdlib I_STDLIB
18637 # include <unistd.h>
18640 # include <stdlib.h>
18645 register unsigned long tmp;
18646 register unsigned long max = 0L;
18648 for (i = 1000; i; i--) {
18649 tmp = (unsigned long) $randfunc();
18650 if (tmp > max) max = tmp;
18652 for (i = 0; max; i++)
18658 if eval $compile_ok; then
18662 echo "(I can't seem to compile the test program...)"
18669 rp="How many bits does your $randfunc() function produce?"
18673 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
18674 seedfunc="s$randfunc"
18675 randseedtype=unsigned
18679 rp="How many bits does your $randfunc() function produce?"
18682 seedfunc="s$randfunc"
18683 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
18684 if set $seedfunc val -f; eval $csym; $val; then
18685 echo "(Using $seedfunc() to seed random generator)"
18687 echo "(Warning: no $seedfunc() to seed random generator)"
18690 randseedtype=unsigned
18698 echo "Determining whether or not we are on an EBCDIC system..." >&4
18699 $cat >try.c <<'EOM'
18702 if ('M'==0xd4) return 0;
18709 if eval $compile_ok; then
18710 if $run ./try; then
18711 echo "You seem to speak EBCDIC." >&4
18714 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
18717 echo "I'm unable to compile the test program." >&4
18718 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
18726 Checking how to flush all pending stdio output...
18728 # I only know how to find the first 32 possibly open files on SunOS.
18729 # See also hints/sunos_4_1.sh and util.c --AD
18731 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
18733 $cat >>try.c <<EOCP
18735 #$i_stdlib I_STDLIB
18737 #include <stdlib.h>
18739 #$i_unistd I_UNISTD
18741 # include <unistd.h>
18743 #$d_sysconf HAS_SYSCONF
18744 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
18745 #ifdef HAS_STDIO_STREAM_ARRAY
18746 # define STDIO_STREAM_ARRAY $stdio_stream_array
18751 p = fopen("try.out", "w");
18755 # ifdef TRY_FPRINTF
18759 #ifdef TRY_FFLUSH_NULL
18762 #ifdef TRY_FFLUSH_ALL
18764 long open_max = -1;
18765 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
18766 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
18768 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
18769 open_max = sysconf(_SC_OPEN_MAX);
18772 open_max = FOPEN_MAX;
18775 open_max = OPEN_MAX;
18784 # ifdef HAS_STDIO_STREAM_ARRAY
18785 if (open_max > 0) {
18787 for (i = 0; i < open_max; i++)
18788 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
18789 STDIO_STREAM_ARRAY[i]._file < open_max &&
18790 STDIO_STREAM_ARRAY[i]._flag)
18791 fflush(&STDIO_STREAM_ARRAY[i]);
18799 : first we have to find out how _not_ to flush
18801 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
18803 set try -DTRY_FPUTC
18804 if eval $compile; then
18805 $run ./try 2>/dev/null
18808 if $test ! -s try.out -a "X$code" = X42; then
18814 set try -DTRY_FPRINTF
18815 if eval $compile; then
18816 $run ./try 2>/dev/null
18819 if $test ! -s try.out -a "X$code" = X42; then
18820 output=-DTRY_FPRINTF
18826 : check for fflush NULL behaviour
18827 case "$fflushNULL" in
18828 '') set try -DTRY_FFLUSH_NULL $output
18829 if eval $compile; then
18830 $run ./try 2>/dev/null
18833 if $test -s try.out -a "X$code" = X42; then
18834 fflushNULL="`$cat try.out`"
18836 if $test "X$code" != X42; then
18838 (If this test failed, don't worry, we'll try another method shortly.)
18844 case "$fflushNULL" in
18846 Your fflush(NULL) works okay for output streams.
18847 Let's see if it clobbers input pipes...
18849 # As of mid-March 2000 all versions of Solaris appear to have a stdio
18850 # bug that improperly flushes the input end of pipes. So we avoid the
18851 # autoflush on fork/system/exec support for now. :-(
18852 $cat >tryp.c <<EOCP
18855 main(int argc, char **argv)
18861 while ((i = getc(stdin)) != -1
18862 && (*bp++ = i) != '\n'
18863 && bp < &buf[1024])
18866 fprintf(stdout, "%s", buf);
18874 fflushNULL="$define"
18876 if eval $compile; then
18878 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
18879 if cmp tryp.c tryp.out >/dev/null 2>&1; then
18881 fflush(NULL) seems to behave okay with input streams.
18883 fflushNULL="$define"
18886 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
18888 fflushNULL="$undef"
18891 $rm -f core tryp.c tryp.core core.tryp.*
18894 Your fflush(NULL) isn't working (contrary to ANSI C).
18896 fflushNULL="$undef"
18899 Cannot figure out whether your fflush(NULL) works or not.
18900 I'm assuming it doesn't (contrary to ANSI C).
18902 fflushNULL="$undef"
18906 $define|true|[yY]*)
18907 fflushNULL="$define"
18910 fflushNULL="$undef"
18913 : check explicit looping only if NULL did not work, and if the pipe
18914 : bug does not show up on an explicit flush too
18915 case "$fflushNULL" in
18917 $cat >tryp.c <<EOCP
18920 main(int argc, char **argv)
18926 while ((i = getc(stdin)) != -1
18927 && (*bp++ = i) != '\n'
18928 && bp < &buf[1024])
18931 fprintf(stdout, "%s", buf);
18940 if eval $compile; then
18942 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
18943 if cmp tryp.c tryp.out >/dev/null 2>&1; then
18945 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
18947 : now check for fflushall behaviour
18948 case "$fflushall" in
18949 '') set try -DTRY_FFLUSH_ALL $output
18950 if eval $compile; then
18952 (Now testing the other method--but note that this also may fail.)
18954 $run ./try 2>/dev/null
18957 if $test -s try.out -a "X$code" = X42; then
18958 fflushall="`$cat try.out`"
18962 case "$fflushall" in
18964 Whew. Flushing explicitly all the stdio streams works.
18966 fflushall="$define"
18969 Sigh. Flushing explicitly all the stdio streams doesn't work.
18974 Cannot figure out whether flushing stdio streams explicitly works or not.
18975 I'm assuming it doesn't.
18981 "$define"|true|[yY]*)
18982 fflushall="$define"
18990 All is futile. Even fflush(stdin) clobbers input pipes!
18997 $rm -f core tryp.c tryp.core core.tryp.*
18999 *) fflushall="$undef"
19003 case "$fflushNULL$fflushall" in
19006 OK, I give up. I cannot figure out how to flush pending stdio output.
19007 We won't be flushing handles at all before fork/exec/popen.
19013 : Store the full pathname to the ar program for use in the C program
19014 : Respect a hint or command line value for full_ar.
19019 : Store the full pathname to the sed program for use in the C program
19022 : see what type gids are declared as in the kernel
19024 echo "Looking for the type for group ids returned by getgid()."
19025 set gid_t gidtype xxx stdio.h sys/types.h
19029 xxx=`./findhdr sys/user.h`
19030 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
19032 unsigned) dflt="$1 $2" ;;
19036 *) dflt="$gidtype";;
19039 gid_t) echo "gid_t found." ;;
19040 *) rp="What is the type for group ids returned by getgid()?"
19048 *_t) zzz="$gidtype" ;;
19051 echo "Checking the size of $zzz..." >&4
19053 #include <sys/types.h>
19055 #$i_stdlib I_STDLIB
19057 #include <stdlib.h>
19060 printf("%d\n", (int)sizeof($gidtype));
19065 if eval $compile_ok; then
19069 echo "(I can't execute the test program--guessing $gidsize.)" >&4
19072 echo "Your $zzz is $gidsize bytes long."
19077 echo "(I can't compile the test program--guessing $gidsize.)" >&4
19083 *_t) zzz="$gidtype" ;;
19086 echo "Checking the sign of $zzz..." >&4
19088 #include <sys/types.h>
19099 if eval $compile; then
19103 echo "(I can't execute the test program--guessing unsigned.)" >&4
19107 1) echo "Your $zzz is unsigned." ;;
19108 -1) echo "Your $zzz is signed." ;;
19114 echo "(I can't compile the test program--guessing unsigned.)" >&4
19120 if $test X"$quadtype" != X; then
19122 echo "Checking how to print 64-bit integers..." >&4
19124 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
19125 $cat >try.c <<'EOCP'
19126 #include <sys/types.h>
19129 int q = 12345678901;
19130 printf("%ld\n", q);
19134 if eval $compile; then
19138 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
19139 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
19140 echo "We will use %d."
19146 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
19147 $cat >try.c <<'EOCP'
19148 #include <sys/types.h>
19151 long q = 12345678901;
19152 printf("%ld\n", q);
19156 if eval $compile; then
19160 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
19161 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
19162 echo "We will use %ld."
19168 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
19169 $cat >try.c <<'EOCP'
19170 #include <sys/types.h>
19171 #include <inttypes.h>
19174 int64_t q = 12345678901;
19175 printf("%" PRId64 "\n", q);
19179 if eval $compile; then
19183 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
19184 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
19185 echo "We will use the C9X style."
19191 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
19193 #include <sys/types.h>
19196 $quadtype q = 12345678901;
19197 printf("%Ld\n", q);
19201 if eval $compile; then
19205 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
19206 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
19207 echo "We will use %Ld."
19213 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
19214 $cat >try.c <<'EOCP'
19215 #include <sys/types.h>
19218 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
19219 printf("%lld\n", q);
19223 if eval $compile; then
19227 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
19228 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
19229 echo "We will use the %lld style."
19235 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
19237 #include <sys/types.h>
19240 $quadtype q = 12345678901;
19241 printf("%qd\n", q);
19245 if eval $compile; then
19249 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
19250 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
19251 echo "We will use %qd."
19257 if $test X"$sPRId64" = X; then
19258 echo "Cannot figure out how to print 64-bit integers." >&4
19265 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
19266 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
19268 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
19269 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
19275 $echo "Checking the format strings to be used for Perl's internal types..." >&4
19277 if $test X"$ivsize" = X8; then
19278 ivdformat="$sPRId64"
19279 uvuformat="$sPRIu64"
19280 uvoformat="$sPRIo64"
19281 uvxformat="$sPRIx64"
19282 uvXUformat="$sPRIXU64"
19284 if $test X"$ivsize" = X"$longsize"; then
19291 if $test X"$ivsize" = X"$intsize"; then
19299 if $test X"$ivsize" = X"$shortsize"; then
19310 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
19311 nveformat="$sPRIeldbl"
19312 nvfformat="$sPRIfldbl"
19313 nvgformat="$sPRIgldbl"
19314 nvEUformat="$sPRIEUldbl"
19315 nvFUformat="$sPRIFUldbl"
19316 nvGUformat="$sPRIGUldbl"
19326 case "$ivdformat" in
19327 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
19334 $echo "Checking the format string to be used for gids..." >&4
19337 -1) if $test X"$gidsize" = X"$ivsize"; then
19338 gidformat="$ivdformat"
19340 if $test X"$gidsize" = X"$longsize"; then
19343 if $test X"$gidsize" = X"$intsize"; then
19346 if $test X"$gidsize" = X"$shortsize"; then
19353 *) if $test X"$gidsize" = X"$uvsize"; then
19354 gidformat="$uvuformat"
19356 if $test X"$gidsize" = X"$longsize"; then
19359 if $test X"$gidsize" = X"$intsize"; then
19362 if $test X"$gidsize" = X"$shortsize"; then
19371 : see if getgroups exists
19372 set getgroups d_getgrps
19375 : see if setgroups exists
19376 set setgroups d_setgrps
19380 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
19382 case "$d_getgrps$d_setgrps" in
19384 case "$groupstype" in
19385 '') dflt="$gidtype" ;;
19386 *) dflt="$groupstype" ;;
19389 What type of pointer is the second argument to getgroups() and setgroups()?
19390 Usually this is the same as group ids, $gidtype, but not always.
19393 rp='What type pointer is the second argument to getgroups() and setgroups()?'
19397 *) groupstype="$gidtype";;
19401 if $test $patchlevel -lt 9; then
19402 : MAD is not available in 5.8.x or earlier.
19406 $define|true|[yY]*) dflt='y' ;;
19411 Would you like to build with Misc Attribute Decoration? This is development
19412 work leading to a Perl 5 to Perl 6 convertor, which imposes a space and speed
19413 overhead on the interpreter.
19415 If this doesn't make any sense to you, just accept the default '$dflt'.
19417 rp='Build Perl with MAD?'
19422 madlyh='madly.h madly.act madly.tab'
19424 madlyobj="madly$_o" ;;
19434 echo "Checking if your $make program sets \$(MAKE)..." >&4
19435 case "$make_set_make" in
19437 $sed 's/^X //' > testmake.mak << 'EOF'
19439 X @echo 'maketemp="$(MAKE)"'
19441 case "`$make -f testmake.mak 2>/dev/null`" in
19442 *maketemp=*) make_set_make='#' ;;
19443 *) make_set_make="MAKE=$make" ;;
19445 $rm -f testmake.mak
19448 case "$make_set_make" in
19449 '#') echo "Yup, it does.";;
19450 *) echo "Nope, it doesn't.";;
19453 : see what type is used for mode_t
19454 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
19455 set mode_t modetype int stdio.h sys/types.h
19458 : see if we need va_copy
19460 case "$i_stdarg" in
19463 #include <stdarg.h>
19465 #$i_stdlib I_STDLIB
19467 #include <stdlib.h>
19469 #include <signal.h>
19472 ivfprintf(FILE *f, const char *fmt, va_list *valp)
19474 return vfprintf(f, fmt, *valp);
19478 myvfprintf(FILE *f, const char *fmt, va_list val)
19480 return ivfprintf(f, fmt, &val);
19484 myprintf(char *fmt, ...)
19487 va_start(val, fmt);
19488 return myvfprintf(stdout, fmt, val);
19492 main(int ac, char **av)
19494 signal(SIGSEGV, exit);
19496 myprintf("%s%cs all right, then\n", "that", '\'');
19501 if eval $compile && $run ./try 2>&1 >/dev/null; then
19502 case "`$run ./try`" in
19503 "that's all right, then")
19509 yes) echo "It seems that you don't need va_copy()." >&4
19510 need_va_copy="$undef"
19512 *) echo "It seems that va_copy() or similar will be needed." >&4
19513 need_va_copy="$define"
19518 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
19522 : see what type is used for size_t
19523 rp="What is the type used for the length parameter for string functions?"
19524 set size_t sizetype 'unsigned int' stdio.h sys/types.h
19527 : check for type of arguments to gethostbyaddr.
19528 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
19529 case "$d_gethbyaddr" in
19533 Checking to see what type of arguments are accepted by gethostbyaddr().
19535 hdrs="$define sys/types.h
19536 $d_socket sys/socket.h
19537 $i_niin netinet/in.h
19539 $i_unistd unistd.h"
19540 : The first arg can 'char *' or 'void *'
19541 : The second arg is some of integral type
19542 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
19543 for yyy in size_t long int; do
19544 case "$netdb_host_type" in
19545 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
19546 if ./protochk "$try" $hdrs; then
19547 echo "Your system accepts $xxx for the first arg."
19548 echo "...and $yyy for the second arg."
19549 netdb_host_type="$xxx"
19550 netdb_hlen_type="$yyy"
19556 : In case none of those worked, prompt the user.
19557 case "$netdb_host_type" in
19558 '') rp='What is the type for the 1st argument to gethostbyaddr?'
19561 netdb_host_type=$ans
19562 rp='What is the type for the 2nd argument to gethostbyaddr?'
19565 netdb_hlen_type=$ans
19569 *) : no gethostbyaddr, so pick harmless defaults
19570 netdb_host_type='char *'
19571 netdb_hlen_type="$sizetype"
19574 # Remove the "const" if needed. -- but then we'll have a
19576 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
19579 : check for type of argument to gethostbyname.
19580 if test "X$netdb_name_type" = X ; then
19581 case "$d_gethbyname" in
19585 Checking to see what type of argument is accepted by gethostbyname().
19587 hdrs="$define sys/types.h
19588 $d_socket sys/socket.h
19589 $i_niin netinet/in.h
19591 $i_unistd unistd.h"
19592 for xxx in "const char *" "char *"; do
19593 case "$netdb_name_type" in
19594 '') try="extern struct hostent *gethostbyname($xxx);"
19595 if ./protochk "$try" $hdrs; then
19596 echo "Your system accepts $xxx."
19597 netdb_name_type="$xxx"
19602 : In case none of those worked, prompt the user.
19603 case "$netdb_name_type" in
19604 '') rp='What is the type for the 1st argument to gethostbyname?'
19607 netdb_name_type=$ans
19611 *) : no gethostbyname, so pick harmless default
19612 netdb_name_type='char *'
19617 : check for type of 1st argument to getnetbyaddr.
19618 if test "X$netdb_net_type" = X ; then
19619 case "$d_getnbyaddr" in
19623 Checking to see what type of 1st argument is accepted by getnetbyaddr().
19625 hdrs="$define sys/types.h
19626 $d_socket sys/socket.h
19627 $i_niin netinet/in.h
19629 $i_unistd unistd.h"
19630 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
19631 case "$netdb_net_type" in
19632 '') try="extern struct netent *getnetbyaddr($xxx, int);"
19633 if ./protochk "$try" $hdrs; then
19634 echo "Your system accepts $xxx."
19635 netdb_net_type="$xxx"
19640 : In case none of those worked, prompt the user.
19641 case "$netdb_net_type" in
19642 '') rp='What is the type for the 1st argument to getnetbyaddr?'
19645 netdb_net_type=$ans
19649 *) : no getnetbyaddr, so pick harmless default
19650 netdb_net_type='long'
19654 : locate the preferred pager for this system
19661 [a-zA-Z]:/*) dflt=$pg;;
19665 [a-zA-Z]:/*) dflt=$more;;
19669 [a-zA-Z]:/*) dflt=$less;;
19672 '') dflt=/usr/ucb/more;;
19676 : Instruct ./getfile to trust the hinted or previous pager value,
19677 : even if it does not begin with a slash. For example, on os2,
19678 : pager might be cmd /c more. See comments in UU/getfile.
19683 rp='What pager is used on your system?'
19687 : see what type pids are declared as in the kernel
19688 rp="What is the type of process ids on this system?"
19689 set pid_t pidtype int stdio.h sys/types.h
19692 : see if ar generates random libraries by itself
19694 echo "Checking how to generate random libraries on your machine..." >&4
19695 echo 'int bar1() { return bar2(); }' > bar1.c
19696 echo 'int bar2() { return 2; }' > bar2.c
19698 #$i_stdlib I_STDLIB
19700 #include <stdlib.h>
19702 int main() { printf("%d\n", bar1()); exit(0); }
19704 $cc $ccflags -c bar1.c >/dev/null 2>&1
19705 $cc $ccflags -c bar2.c >/dev/null 2>&1
19706 $cc $ccflags -c foo.c >/dev/null 2>&1
19707 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
19708 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19709 $run ./foobar >/dev/null 2>&1; then
19710 echo "$ar appears to generate random libraries itself."
19712 if [ "X$ranlib" = "X" ]; then
19715 elif $ar s bar$_a >/dev/null 2>&1 &&
19716 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19717 $run ./foobar >/dev/null 2>&1; then
19718 echo "a table of contents needs to be added with '$ar s'."
19721 elif $ar ts bar$_a >/dev/null 2>&1 &&
19722 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19723 $run ./foobar >/dev/null 2>&1; then
19724 echo "a table of contents needs to be added with '$ar ts'."
19731 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
19732 $test -f $ranlib || ranlib=''
19735 if $test -n "$ranlib"; then
19736 echo "your system has '$ranlib'; we'll use that."
19739 echo "your system doesn't seem to support random libraries"
19740 echo "so we'll use lorder and tsort to order the libraries."
19747 : check for type of arguments to select.
19748 case "$selecttype" in
19749 '') case "$d_select" in
19753 Checking to see what type of arguments are accepted by select().
19755 hdrs="$define sys/types.h
19756 $i_systime sys/time.h
19757 $i_sysselct sys/select.h
19758 $d_socket sys/socket.h"
19759 : The first arg can be int, unsigned, or size_t
19760 : The last arg may or may not be 'const'
19762 : void pointer has been seen but using that
19763 : breaks the selectminbits test
19764 for xxx in 'fd_set *' 'int *'; do
19765 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
19766 for tmo in 'struct timeval *' 'const struct timeval *'; do
19768 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
19769 if ./protochk "$try" $hdrs; then
19770 echo "Your system accepts $xxx."
19779 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
19780 case "$d_fd_set" in
19781 $define) dflt="fd_set *" ;;
19790 *) : no select, so pick a harmless default
19797 : check for the select 'width'
19798 case "$selectminbits" in
19799 '') safebits=`expr $ptrsize \* 8`
19800 case "$d_select" in
19804 Checking to see on how many bits at a time your select() operates...
19807 #include <sys/types.h>
19809 #$i_systime I_SYS_TIME
19810 #$i_systimek I_SYS_TIME_KERNEL
19815 # ifdef I_SYS_TIME_KERNEL
19818 # include <sys/time.h>
19819 # ifdef I_SYS_TIME_KERNEL
19823 #$i_sysselct I_SYS_SELECT
19824 #ifdef I_SYS_SELECT
19825 #include <sys/select.h>
19827 #$d_socket HAS_SOCKET
19829 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
19832 #$i_stdlib I_STDLIB
19834 #include <stdlib.h>
19837 #define S sizeof(*(b))
19839 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
19840 #define NBITS (NBYTES * 8)
19842 char *s = (char *)malloc(NBYTES);
19851 fp = fopen("try.c", "r");
19857 b = ($selecttype)s;
19858 for (i = 0; i < NBITS; i++)
19862 select(fd + 1, b, 0, 0, &t);
19863 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
19865 printf("%d\n", i + 1);
19870 if eval $compile_ok; then
19871 selectminbits=`$run ./try`
19872 case "$selectminbits" in
19874 Cannot figure out on how many bits at a time your select() operates.
19875 I'll play safe and guess it is $safebits bits.
19877 selectminbits=$safebits
19878 bits="$safebits bits"
19881 *) bits="$selectminbits bits" ;;
19883 echo "Your select() operates on $bits at a time." >&4
19885 rp='What is the minimum number of bits your select() operates on?'
19886 case "$byteorder" in
19887 12345678) dflt=64 ;;
19893 selectminbits="$val"
19897 *) : no select, so pick a harmless default
19898 selectminbits=$safebits
19904 : Trace out the files included by signal.h, then look for SIGxxx names.
19905 : Remove SIGARRAYSIZE used by HPUX.
19906 : Remove SIGSTKSIZE used by Linux.
19907 : Remove SIGSTKSZ used by Posix.
19908 : Remove SIGTYP void lines used by OS2.
19909 : Some cpps, like os390, dont give the file name anywhere
19910 if [ "X$fieldn" = X ]; then
19911 : Just make some guesses. We check them later.
19912 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
19914 xxx=`echo '#include <signal.h>' |
19915 $cppstdin $cppminus $cppflags 2>/dev/null |
19916 $grep '^[ ]*#.*include' |
19917 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
19919 : Check this list of files to be sure we have parsed the cpp output ok.
19920 : This will also avoid potentially non-existent files, such
19923 for xx in $xxx /dev/null ; do
19924 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
19926 : If we have found no files, at least try signal.h
19927 case "$xxxfiles" in
19928 '') xxxfiles=`./findhdr signal.h` ;;
19931 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
19932 print substr($2, 4, 20)
19934 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
19935 print substr($3, 4, 20)
19937 : Append some common names just in case the awk scan failed.
19938 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
19939 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
19940 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
19941 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
19942 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
19944 : generate a few handy files for later
19945 $cat > signal.c <<EOCP
19946 #include <sys/types.h>
19947 #include <signal.h>
19948 #$i_stdlib I_STDLIB
19950 #include <stdlib.h>
19955 /* Strange style to avoid deeply-nested #if/#else/#endif */
19958 # define NSIG (_NSIG)
19964 # define NSIG (SIGMAX+1)
19970 # define NSIG (SIG_MAX+1)
19976 # define NSIG (_SIG_MAX+1)
19982 # define NSIG (MAXSIG+1)
19988 # define NSIG (MAX_SIG+1)
19993 # ifdef SIGARRAYSIZE
19994 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
20000 # define NSIG (_sys_nsig) /* Solaris 2.5 */
20004 /* Default to some arbitrary number that's big enough to get most
20005 of the common signals.
20011 printf("NSIG %d\n", NSIG);
20017 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
20019 printf "#ifdef SIG"; printf $1; printf "\n"
20020 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
20021 printf $1; printf ");\n"
20025 printf "#endif /* JUST_NSIG */\n";
20026 printf "exit(0);\n}\n";
20029 $cat >signal.awk <<'EOP'
20030 BEGIN { ndups = 0 }
20031 $1 ~ /^NSIG$/ { nsig = $2 }
20032 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
20033 if ($2 > maxsig) { maxsig = $2 }
20034 if (sig_name[$2]) {
20035 dup_name[ndups] = $1
20036 dup_num[ndups] = $2
20048 printf("NSIG %d\n", nsig);
20049 for (n = 1; n < nsig; n++) {
20051 printf("%s %d\n", sig_name[n], sig_num[n])
20054 printf("NUM%d %d\n", n, n)
20057 for (n = 0; n < ndups; n++) {
20058 printf("%s %d\n", dup_name[n], dup_num[n])
20062 $cat >signal_cmd <<EOS
20064 if $test -s signal.lst; then
20065 echo "Using your existing signal.lst file"
20070 $cat >>signal_cmd <<'EOS'
20073 if eval $compile_ok; then
20074 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) | $uniq | $awk -f signal.awk >signal.lst
20076 echo "(I can't seem be able to compile the whole test program)" >&4
20077 echo "(I'll try it in little pieces.)" >&4
20078 set signal -DJUST_NSIG
20079 if eval $compile_ok; then
20080 $run ./signal$_exe > signal.nsg
20083 echo "I can't seem to figure out how many signals you have." >&4
20084 echo "Guessing 50." >&4
20085 echo 'NSIG 50' > signal.nsg
20087 : Now look at all the signal names, one at a time.
20088 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
20089 $cat > signal.c <<EOCP
20090 #include <sys/types.h>
20091 #include <signal.h>
20094 printf("$xx %d\n", SIG${xx});
20099 if eval $compile; then
20100 echo "SIG${xx} found."
20101 $run ./signal$_exe >> signal.ls1
20103 echo "SIG${xx} NOT found."
20106 if $test -s signal.ls1; then
20107 $cat signal.nsg signal.ls1 |
20108 $sort -n | $uniq | $awk -f signal.awk >signal.lst
20112 if $test -s signal.lst; then
20115 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
20116 echo 'kill -l' >signal
20117 set X `csh -f <signal`
20121 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
20123 echo $@ | $tr ' ' $trnl | \
20124 $awk '{ printf "%s %d\n", $1, ++s; }
20125 END { printf "NSIG %d\n", ++s }' >signal.lst
20127 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
20129 chmod a+x signal_cmd
20130 $eunicefix signal_cmd
20132 : generate list of signal names
20134 case "$sig_name_init" in
20136 *) case "$sig_num_init" in
20137 ''|*,*) doinit=yes ;;
20142 echo "Generating a list of signal names and numbers..." >&4
20144 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
20145 sig_name=`$awk 'BEGIN { printf "ZERO " }
20146 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
20147 sig_num=`$awk 'BEGIN { printf "0 " }
20148 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
20149 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
20150 !/^NSIG/ { printf "\"%s\", ", $1 }
20151 END { printf "0\n" }' signal.lst`
20152 sig_num_init=`$awk 'BEGIN { printf "0, " }
20153 !/^NSIG/ { printf "%d, ", $2}
20154 END { printf "0\n"}' signal.lst`
20157 echo "The following $sig_count signals are available:"
20159 echo $sig_name | $awk \
20160 'BEGIN { linelen = 0 }
20162 for (i = 1; i <= NF; i++) {
20163 name = "SIG" $i " "
20164 linelen = linelen + length(name)
20165 if (linelen > 70) {
20167 linelen = length(name)
20173 sig_size=`echo $sig_name | awk '{print NF}'`
20174 $rm -f signal signal.c signal.awk signal.lst signal_cmd
20177 case "$sizetype" in
20178 *_t) zzz="$sizetype" ;;
20179 *) zzz="filesize" ;;
20181 echo "Checking the size of $zzz..." >&4
20183 #include <sys/types.h>
20185 #$i_stdlib I_STDLIB
20187 #include <stdlib.h>
20190 printf("%d\n", (int)sizeof($sizetype));
20195 if eval $compile_ok; then
20199 echo "(I can't execute the test program--guessing $sizesize.)" >&4
20202 echo "Your $zzz size is $sizesize bytes."
20207 echo "(I can't compile the test program--guessing $sizesize.)" >&4
20211 : check for socklen_t
20213 echo "Checking to see if you have socklen_t..." >&4
20215 #include <sys/types.h>
20216 #$d_socket HAS_SOCKET
20218 #include <sys/socket.h>
20220 int main() { socklen_t x = 16; }
20223 if eval $compile; then
20225 echo "You have socklen_t."
20228 echo "You do not have socklen_t."
20229 case "$sizetype" in
20230 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
20237 : see if this is a socks.h system
20238 set socks.h i_socks
20241 : check for type of the size argument to socket calls
20242 case "$d_socket" in
20246 Checking to see what type is the last argument of accept().
20249 case "$d_socklen_t" in
20250 "$define") yyy="$yyy socklen_t"
20252 yyy="$yyy $sizetype int long unsigned"
20253 for xxx in $yyy; do
20254 case "$socksizetype" in
20255 '') try="extern int accept(int, struct sockaddr *, $xxx *);"
20256 case "$usesocks" in
20258 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
20259 echo "Your system accepts '$xxx *' for the last argument of accept()."
20260 socksizetype="$xxx"
20263 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
20264 echo "Your system accepts '$xxx *' for the last argument of accept()."
20265 socksizetype="$xxx"
20272 : In case none of those worked, prompt the user.
20273 case "$socksizetype" in
20274 '') rp='What is the type for socket address structure sizes?'
20281 *) : no sockets, so pick relatively harmless default
20286 : see what type is used for signed size_t
20287 set ssize_t ssizetype int stdio.h sys/types.h
20292 #$i_stdlib I_STDLIB
20294 #include <stdlib.h>
20296 #include <sys/types.h>
20297 #define Size_t $sizetype
20298 #define SSize_t $dflt
20301 if (sizeof(Size_t) == sizeof(SSize_t))
20303 else if (sizeof(Size_t) == sizeof(int))
20312 if eval $compile_ok && $run ./try > /dev/null; then
20313 ssizetype=`$run ./try`
20314 echo "I'll be using $ssizetype for functions returning a byte count." >&4
20317 Help! I can't compile and run the ssize_t test program: please enlighten me!
20318 (This is probably a misconfiguration in your system or libraries, and
20319 you really ought to fix it. Still, I'll try anyway.)
20321 I need a type that is the same size as $sizetype, but is guaranteed to
20322 be signed. Common values are ssize_t, int and long.
20325 rp="What signed type is the same size as $sizetype?"
20331 : see what type of char stdio uses.
20333 echo '#include <stdio.h>' > stdio.c
20334 $cppstdin $cppminus < stdio.c > stdioh
20335 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
20336 echo "Your stdio uses unsigned chars." >&4
20337 stdchar="unsigned char"
20339 echo "Your stdio uses signed chars." >&4
20342 $rm -f stdio.* stdioh
20344 : see what type uids are declared as in the kernel
20346 echo "Looking for the type for user ids returned by getuid()."
20347 set uid_t uidtype xxx stdio.h sys/types.h
20351 xxx=`./findhdr sys/user.h`
20352 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
20354 unsigned) dflt="$1 $2" ;;
20358 *) dflt="$uidtype";;
20361 uid_t) echo "uid_t found." ;;
20362 *) rp="What is the type for user ids returned by getuid()?"
20370 *_t) zzz="$uidtype" ;;
20373 echo "Checking the size of $zzz..." >&4
20375 #include <sys/types.h>
20377 #$i_stdlib I_STDLIB
20379 #include <stdlib.h>
20382 printf("%d\n", (int)sizeof($uidtype));
20387 if eval $compile_ok; then
20391 echo "(I can't execute the test program--guessing $uidsize.)" >&4
20394 echo "Your $zzz is $uidsize bytes long."
20399 echo "(I can't compile the test program--guessing $uidsize.)" >&4
20404 *_t) zzz="$uidtype" ;;
20407 echo "Checking the sign of $zzz..." >&4
20409 #include <sys/types.h>
20420 if eval $compile; then
20424 echo "(I can't execute the test program--guessing unsigned.)" >&4
20428 1) echo "Your $zzz is unsigned." ;;
20429 -1) echo "Your $zzz is signed." ;;
20435 echo "(I can't compile the test program--guessing unsigned.)" >&4
20441 $echo "Checking the format string to be used for uids..." >&4
20444 -1) if $test X"$uidsize" = X"$ivsize"; then
20445 uidformat="$ivdformat"
20447 if $test X"$uidsize" = X"$longsize"; then
20450 if $test X"$uidsize" = X"$intsize"; then
20453 if $test X"$uidsize" = X"$shortsize"; then
20460 *) if $test X"$uidsize" = X"$uvsize"; then
20461 uidformat="$uvuformat"
20463 if $test X"$uidsize" = X"$longsize"; then
20466 if $test X"$uidsize" = X"$intsize"; then
20469 if $test X"$uidsize" = X"$shortsize"; then
20479 case "$usesitecustomize" in
20480 $define|true|[Yy]*)
20481 usesitecustomize="$define"
20484 usesitecustomize="$undef"
20488 : determine compiler compiler
20497 if $test -f "$byacc$_exe"; then
20499 comp="byacc or $comp"
20501 if $test -f "$bison$_exe"; then
20502 comp="$comp or bison -y"
20504 rp="Which compiler compiler ($comp) shall I use?"
20513 echo "(Adding -y option to bison to get yacc-compatible behaviour.)"
20520 : see if this is a assert.h system
20521 set assert.h i_assert
20524 : see if this is a fp.h system
20528 : see if this is a fp_class.h system
20529 set fp_class.h i_fp_class
20532 : see if gdbm.h is available
20537 : see if gdbm_open exists
20538 set gdbm_open d_gdbm_open
20540 case "$d_gdbm_open" in
20543 echo "We won't be including <gdbm.h>"
20552 : see if this is a ieeefp.h system
20553 case "$i_ieeefp" in
20554 '' ) set ieeefp.h i_ieeefp
20559 : see if this is a libutil.h system
20560 set libutil.h i_libutil
20563 : see if mach cthreads are available
20564 if test "X$usethreads" = "X$define"; then
20565 set mach/cthreads.h i_machcthr
20568 i_machcthr="$undef"
20573 : see if this is a mntent.h system
20574 set mntent.h i_mntent
20577 : see if ndbm.h is available
20583 # Some Linux distributions such as RedHat 7.1 put the
20584 # ndbm.h header in /usr/include/gdbm/ndbm.h.
20585 if $test -f /usr/include/gdbm/ndbm.h; then
20586 echo '<gdbm/ndbm.h> found.'
20587 ccflags="$ccflags -I/usr/include/gdbm"
20588 cppflags="$cppflags -I/usr/include/gdbm"
20596 : see if dbm_open exists
20597 set dbm_open d_dbm_open
20599 case "$d_dbm_open" in
20602 echo "We won't be including <ndbm.h>"
20611 : see if net/errno.h is available
20613 set net/errno.h val
20616 : Unfortunately, it causes problems on some systems. Arrgh.
20619 cat > try.c <<'EOM'
20622 #include <net/errno.h>
20628 if $cc $ccflags -c try.c >/dev/null 2>&1; then
20629 echo "We'll be including <net/errno.h>." >&4
20631 echo "We won't be including <net/errno.h>." >&4
20640 : see if netinet/tcp.h is available
20641 set netinet/tcp.h i_netinettcp
20644 : see if this is a poll.h system
20648 : see if this is a prot.h system
20653 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
20654 $cat <<'EOSH' > Cppsym.know
20655 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
20656 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
20657 alliant alpha am29000 AM29000 AMD64 amd64 amiga AMIGAOS AMIX
20658 ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
20659 BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
20660 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
20661 bull c cadmus clipper CMU COFF COMPILER_VERSION
20662 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
20663 CYGWIN DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
20664 Dynix DynixPTX ELF encore EPI EXTENSIONS FAVOR_BSD
20665 FILE_OFFSET_BITS FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
20667 GNU_SOURCE GNUC GNUC_MINOR GNU_LIBRARY GO32 gould GOULD_PN
20668 H3050R H3050RX hbullx20 hcx host_mips
20669 hp200 hp300 hp700 HP700 hp800 hp9000
20670 hp9000s200 hp9000s300 hp9000s400 hp9000s500
20671 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
20672 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
20673 IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
20674 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
20675 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
20676 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
20677 LIBCATAMOUNT Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
20678 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
20679 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
20680 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
20681 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
20682 MATH_HAS_NO_SIDE_EFFECTS
20683 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
20684 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
20685 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
20686 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
20687 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
20688 NetBSD news1500 news1700 news1800 news1900 news3700
20689 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
20690 ns32016 ns32332 ns32k nsc32000
20691 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
20692 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
20693 pc532 pdp11 PGC PIC plexus PORTAR posix
20694 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
20695 POSIX_C_SOURCE POSIX_SOURCE POWER
20696 PROTOTYPES PWB pyr QNX QK_USER R3000 REENTRANT RES Rhapsody RISC6000
20697 riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
20698 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
20699 sony sony_news sonyrisc sparc sparclite spectrum
20700 stardent stdc STDC_EXT stratos sun sun3 sun386
20701 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
20702 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
20703 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
20704 sysV68 sysV88 Tek4132 Tek4300 titan
20705 TM3200 TM5400 TM5600
20706 tower tower32 tower32_200 tower32_600 tower32_700
20707 tower32_800 tower32_850 tss
20708 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
20709 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
20710 unix UNIX95 UNIX99 unixpc unos
20711 USE_BSD USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE USE_LARGEFILE64
20712 USE_MISC USE_POSIX USE_POSIX199309 USE_POSIX199506 USE_POSIX2
20713 USE_REENTRANT USE_SVID USE_UNIX98 USE_XOPEN USE_XOPEN_EXTENDED
20715 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms x86_64 xenix Xenix286
20716 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
20717 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
20720 # Maybe put other stuff here too.
20721 cat <<EOSH >>Cppsym.know
20724 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
20725 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
20726 $cat Cppsym.know > Cppsym.c
20727 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
20728 $rm -f Cppsym.a Cppsym.b Cppsym.c
20729 cat <<EOSH > Cppsym
20731 if $test \$# -gt 0; then
20732 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
20733 if $test -s Cppsym.got; then
20740 $tr " " "$trnl" | ./Cppsym.try
20746 cat <<EOSH > Cppsym.try
20748 cat <<'EOCP' > try.c
20751 #define STRINGIFY(a) "a"
20753 #if cpp_stuff == 42
20754 #define StGiFy(a) #a
20755 #define STRINGIFY(a) StGiFy(a)
20757 #if $cpp_stuff != 1 && $cpp_stuff != 42
20758 # include "Bletch: How does this C preprocessor stringify macros?"
20764 cat <<'EOSH' >> Cppsym.try
20766 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
20767 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
20768 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
20769 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
20771 echo 'return 0;}' >> try.c
20773 cat <<EOSH >> Cppsym.try
20775 case "$osname-$gccversion" in
20776 irix-) ccflags="\$ccflags -woff 1178" ;;
20777 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
20779 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs && $run ./try | $sed 's/ /\\\\ /g'
20781 chmod +x Cppsym.try
20782 $eunicefix Cppsym.try
20783 ./Cppsym < Cppsym.know > Cppsym.true
20784 : Add in any linux cpp "predefined macros":
20785 case "$osname::$gccversion" in
20788 rm -f $tHdrH'.h' $tHdrH
20790 if cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
20791 sed 's/#define[\ \ ]*//;s/[\ \ ].*$//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
20792 if [ -s $tHdrH'_cppsym.real' ]; then
20793 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
20796 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
20799 : now check the C compiler for additional symbols
20800 postprocess_cc_v=''
20802 aix) postprocess_cc_v="|$tr , ' '" ;;
20809 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
20812 -D*) echo "\$i" | $sed 's/^-D//';;
20813 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
20818 postprocess_cc_v=''
20821 ./ccsym > ccsym1.raw
20822 if $test -s ccsym1.raw; then
20823 $sort ccsym1.raw | $uniq >ccsym.raw
20825 mv ccsym1.raw ccsym.raw
20828 $awk '/\=/ { print $0; next }
20829 { print $0"=1" }' ccsym.raw >ccsym.list
20830 $comm -13 Cppsym.true ccsym.list >ccsym.own
20831 $comm -12 Cppsym.true ccsym.list >ccsym.com
20832 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
20834 if $test -z ccsym.raw; then
20835 echo "Your C compiler doesn't seem to define any symbols!" >&4
20837 echo "However, your C preprocessor defines the following symbols:"
20840 cppsymbols=`$cat Cppsym.true`
20841 cppsymbols=`echo $cppsymbols`
20842 cppccsymbols="$cppsymbols"
20844 if $test -s ccsym.com; then
20845 echo "Your C compiler and pre-processor define these symbols:"
20846 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
20849 cppccsymbols=`$cat ccsym.com`
20850 cppccsymbols=`echo $cppccsymbols`
20851 $test "$silent" || sleep 1
20853 if $test -s ccsym.cpp; then
20854 $test "$also" && echo " "
20855 echo "Your C pre-processor ${also}defines the following symbols:"
20856 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
20858 cppsymbols=`$cat ccsym.cpp`
20859 cppsymbols=`echo $cppsymbols`
20860 $test "$silent" || sleep 1
20862 if $test -s ccsym.own; then
20863 $test "$also" && echo " "
20864 echo "Your C compiler ${also}defines the following cpp symbols:"
20865 $sed -e 's/\(..*\)=1/\1/' ccsym.own
20866 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
20867 ccsymbols=`$cat ccsym.own`
20868 ccsymbols=`echo $ccsymbols`
20869 $test "$silent" || sleep 1
20873 : see if this is a termio system
20877 if $test `./findhdr termios.h`; then
20878 set tcsetattr i_termios
20884 "$define") echo "You have POSIX termios.h... good!" >&4;;
20885 *) if ./Cppsym pyr; then
20886 case "`/bin/universe`" in
20887 ucb) if $test `./findhdr sgtty.h`; then
20889 echo "<sgtty.h> found." >&4
20891 echo "System is pyramid with BSD universe."
20892 echo "<sgtty.h> not found--you could have problems." >&4
20894 *) if $test `./findhdr termio.h`; then
20896 echo "<termio.h> found." >&4
20898 echo "System is pyramid with USG universe."
20899 echo "<termio.h> not found--you could have problems." >&4
20903 if $test `./findhdr termio.h`; then
20904 echo "<termio.h> found." >&4
20906 elif $test `./findhdr sgtty.h`; then
20907 echo "<sgtty.h> found." >&4
20910 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
20913 if $test `./findhdr sgtty.h`; then
20914 echo "<sgtty.h> found." >&4
20916 elif $test `./findhdr termio.h`; then
20917 echo "<termio.h> found." >&4
20920 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
20924 set i_termio; eval $setvar
20925 val=$val2; set i_sgtty; eval $setvar
20926 val=$val3; set i_termios; eval $setvar
20928 : see if stddef is available
20929 set stddef.h i_stddef
20932 : see if sys/access.h is available
20933 set sys/access.h i_sysaccess
20936 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
20937 set sys/filio.h i_sysfilio
20940 if $test `./findhdr sys/ioctl.h`; then
20942 echo '<sys/ioctl.h> found.' >&4
20945 if $test $i_sysfilio = "$define"; then
20946 echo '<sys/ioctl.h> NOT found.' >&4
20948 $test $i_sgtty = "$define" && xxx="sgtty.h"
20949 $test $i_termio = "$define" && xxx="termio.h"
20950 $test $i_termios = "$define" && xxx="termios.h"
20951 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
20957 : see if socket ioctl defs are in sys/sockio.h
20959 xxx=`./findhdr sys/sockio.h`
20960 if $test "$xxx"; then
20961 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
20963 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
20966 echo "No socket ioctls found in <sys/sockio.h>." >&4
20971 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
20978 : see if this is a syslog.h system
20979 set syslog.h i_syslog
20983 : see if this is a sys/mode.h system
20984 set sys/mode.h i_sysmode
20987 : see if sys/resource.h has to be included
20988 set sys/resource.h i_sysresrc
20991 : see if sys/security.h is available
20992 set sys/security.h i_syssecrt
20995 : see if this is a sys/statvfs.h system
20996 set sys/statvfs.h i_sysstatvfs
20999 : see if this is a sys/un.h system
21000 set sys/un.h i_sysun
21004 : see if this is a sys/utsname.h system
21005 set sys/utsname.h i_sysutsname
21008 : see if this is a syswait system
21009 set sys/wait.h i_syswait
21012 : see if this is a ustat.h system
21013 set ustat.h i_ustat
21016 : see if this is an utime system
21017 set utime.h i_utime
21020 : see if this is a values.h system
21021 set values.h i_values
21024 : see if this is a vfork system
21027 set vfork.h i_vfork
21036 echo "Looking for extensions..." >&4
21037 : If we are using the old config.sh, known_extensions may contain
21038 : old or inaccurate or duplicate values.
21039 known_extensions=''
21040 nonxs_extensions=''
21041 : We do not use find because it might not be available.
21042 : We do not just use MANIFEST because the user may have dropped
21043 : some additional extensions into the source tree and expect them
21046 : Function to recursively find available extensions, ignoring DynaLoader
21047 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
21051 DynaLoader|dynaload) ;;
21053 if $test -f $xxx/$xxx.xs -o -f $xxx/$xxx.c; then
21054 known_extensions="$known_extensions $1$xxx";
21055 elif $test -f $xxx/Makefile.PL; then
21056 nonxs_extensions="$nonxs_extensions $1$xxx";
21058 if $test -d $xxx -a $# -lt 10; then
21061 eval $find_extensions;
21073 eval $find_extensions
21074 # Special case: Add in modules that nest beyond the first level.
21075 # Currently threads/shared and Hash/Util/FieldHash, since they are
21076 # not picked up by the recursive find above (and adding in general
21077 # recursive finding breaks SDBM_File/sdbm).
21078 # A.D. 20011025 (SDBM), ajgough 20071008 (FieldHash)
21079 known_extensions="$known_extensions threads/shared Hash/Util/FieldHash"
21080 set X $known_extensions
21082 known_extensions="$*"
21083 set X $nonxs_extensions
21085 nonxs_extensions="$*"
21088 : Now see which are supported on this system.
21090 for xxx in $known_extensions ; do
21094 $define) avail_ext="$avail_ext $xxx" ;;
21097 GDBM_File|gdbm_fil)
21099 $define) avail_ext="$avail_ext $xxx" ;;
21102 I18N/Langinfo|i18n_lan)
21103 case "$i_langinfo$d_nl_langinfo" in
21104 $define$define) avail_ext="$avail_ext $xxx" ;;
21108 : XXX Do we need a useipcsysv variable here
21109 case "${d_msg}${d_sem}${d_shm}" in
21110 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
21113 NDBM_File|ndbm_fil)
21116 case "$osname-$use64bitint" in
21119 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
21122 *) avail_ext="$avail_ext $xxx" ;;
21127 ODBM_File|odbm_fil)
21128 case "${i_dbm}${i_rpcsvcdbm}" in
21130 case "$d_cplusplus" in
21131 define) ;; # delete as a function name will not work
21132 *) case "$osname-$use64bitint" in
21135 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
21138 *) avail_ext="$avail_ext $xxx" ;;
21146 case "$useopcode" in
21147 true|define|y) avail_ext="$avail_ext $xxx" ;;
21151 case "$useposix" in
21152 true|define|y) avail_ext="$avail_ext $xxx" ;;
21156 case "$d_socket" in
21159 beos) ;; # not unless BONE
21160 *) avail_ext="$avail_ext $xxx" ;;
21165 Sys/Syslog|sys/syslog)
21166 : XXX syslog requires socket
21167 case "$d_socket" in
21168 true|$define|y) avail_ext="$avail_ext $xxx" ;;
21172 case "$usethreads" in
21174 case "$use5005threads" in
21175 $define|true|[yY]*) avail_ext="$avail_ext $xxx" ;;
21179 threads|threads/shared)
21180 # threads and threads::shared are special cases.
21181 # To stop people from asking "Perl 5.8.0 was supposed
21182 # to have this new fancy threads implementation but my
21183 # perl doesn't have it" and from people trying to
21184 # (re)install the threads module using CPAN.pm and
21185 # CPAN.pm then offering to reinstall Perl 5.8.0,
21186 # the threads.pm and threads/shared.pm will always be
21187 # there, croaking informatively ("you need to rebuild
21188 # all of Perl with threads, sorry") when threads haven't
21189 # been compiled in.
21191 avail_ext="$avail_ext $xxx"
21195 cygwin) avail_ext="$avail_ext $xxx" ;;
21198 XS/APItest|xs/apitest)
21199 # This is just for testing. Skip it unless we have dynamic loading.
21202 $define) avail_ext="$avail_ext $xxx" ;;
21205 XS/Typemap|xs/typemap)
21206 # This is just for testing. Skip it unless we have dynamic loading.
21208 $define) avail_ext="$avail_ext $xxx" ;;
21211 *) avail_ext="$avail_ext $xxx"
21220 case "$onlyextensions" in
21222 *) keepextensions=''
21223 echo "You have requested that only certains extensions be included..." >&4
21224 for i in $onlyextensions; do
21225 case " $avail_ext " in
21227 echo "Keeping extension $i."
21228 keepextensions="$keepextensions $i"
21230 *) echo "Ignoring extension $i." ;;
21233 avail_ext="$keepextensions"
21237 case "$noextensions" in
21239 *) keepextensions=''
21240 echo "You have requested that certain extensions be ignored..." >&4
21241 for i in $avail_ext; do
21242 case " $noextensions " in
21243 *" $i "*) echo "Ignoring extension $i." ;;
21244 *) echo "Keeping extension $i.";
21245 keepextensions="$keepextensions $i"
21249 avail_ext="$keepextensions"
21253 : Now see which nonxs extensions are supported on this system.
21254 : For now assume all are.
21256 for xxx in $nonxs_extensions ; do
21258 *) nonxs_ext="$nonxs_ext $xxx"
21270 A number of extensions are supplied with $package. You may choose to
21271 compile these extensions for dynamic loading (the default), compile
21272 them into the $package executable (static loading), or not include
21273 them at all. Answer "none" to include no extensions.
21274 Note that DynaLoader is always built and need not be mentioned here.
21277 case "$dynamic_ext" in
21279 : Exclude those listed in static_ext
21281 for xxx in $avail_ext; do
21282 case " $static_ext " in
21284 *) dflt="$dflt $xxx" ;;
21291 *) dflt="$dynamic_ext"
21292 # Perhaps we are reusing an old out-of-date config.sh.
21295 if test X"$dynamic_ext" != X"$avail_ext"; then
21297 NOTICE: Your previous config.sh list may be incorrect.
21298 The extensions now available to you are
21300 but the default list from your previous config.sh is
21312 rp="What extensions do you wish to load dynamically?"
21315 none) dynamic_ext=' ' ;;
21316 *) dynamic_ext="$ans" ;;
21319 case "$static_ext" in
21321 : Exclude those already listed in dynamic linking
21323 for xxx in $avail_ext; do
21324 case " $dynamic_ext " in
21326 *) dflt="$dflt $xxx" ;;
21333 *) dflt="$static_ext"
21340 rp="What extensions do you wish to load statically?"
21343 none) static_ext=' ' ;;
21344 *) static_ext="$ans" ;;
21349 A number of extensions are supplied with $package. Answer "none"
21350 to include no extensions.
21351 Note that DynaLoader is always built and need not be mentioned here.
21354 case "$static_ext" in
21355 '') dflt="$avail_ext" ;;
21356 *) dflt="$static_ext"
21357 # Perhaps we are reusing an old out-of-date config.sh.
21360 if test X"$static_ext" != X"$avail_ext"; then
21362 NOTICE: Your previous config.sh list may be incorrect.
21363 The extensions now available to you are
21365 but the default list from your previous config.sh is
21374 : Exclude those that are not xs extensions
21378 rp="What extensions do you wish to include?"
21381 none) static_ext=' ' ;;
21382 *) static_ext="$ans" ;;
21387 # Encode is a special case. If we are building Encode as a static
21388 # extension, we need to explicitly list its subextensions as well.
21389 # For other nested extensions, this is handled automatically by
21390 # the appropriate Makefile.PL.
21391 case " $static_ext " in
21392 *" Encode "*) # Add the subextensions of Encode
21394 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
21395 static_ext="$static_ext Encode/$xxx"
21401 set X $dynamic_ext $static_ext $nonxs_ext
21405 # Sanity check: We require an extension suitable for use with
21406 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
21407 # should show up as failures in the test suite, but it's helpful to
21408 # catch them now.) The 'extensions' list is normally sorted
21409 # alphabetically, so we need to accept either
21410 # DB_File ... Fcntl ... IO ....
21411 # or something like
21412 # Fcntl ... NDBM_File ... IO ....
21413 case " $extensions" in
21414 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
21415 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
21416 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
21417 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
21418 echo "WARNING: The Perl you are building will be quite crippled." >& 4
21422 : Remove libraries needed only for extensions
21423 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
21424 : The exception is SunOS 4.x, which needs them.
21425 case "${osname}X${osvers}" in
21429 *) case "$usedl" in
21430 $define|true|[yY]*)
21431 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
21435 *) perllibs="$libs"
21441 : Remove build directory name from cppstdin so it can be used from
21442 : either the present location or the final installed location.
21444 : Get out of the UU directory to get correct path name.
21446 case "$cppstdin" in
21448 echo "Stripping down cppstdin path name"
21454 : end of configuration questions
21456 echo "End of configuration questions."
21459 : back to where it started
21460 if test -d ../UU; then
21464 : configuration may be patched via a 'config.arch' file
21465 if $test -f config.arch; then
21466 echo "I see a config.arch file, loading it."
21470 : configuration may be patched via a 'config.over' file
21471 if $test -f config.over; then
21474 rp='I see a config.over file. Do you wish to load it?'
21477 n*) echo "OK, I'll ignore it.";;
21479 echo "Configuration override changes have been loaded."
21484 : in case they want portability, strip down executable paths
21485 case "$d_portable" in
21488 echo "Stripping down executable paths..." >&4
21489 for file in $loclist $trylist; do
21491 eval $file=`basename $temp`
21496 : create config.sh file
21498 echo "Creating config.sh..." >&4
21499 $spitshell <<EOT >config.sh
21502 # This file was produced by running the Configure script. It holds all the
21503 # definitions figured out by Configure. Should you modify one of these values,
21504 # do not forget to propagate your changes by running "Configure -der". You may
21505 # instead choose to run each of the .SH files by yourself, or "Configure -S".
21508 # Package name : $package
21509 # Source directory : $src
21510 # Configuration time: $cf_time
21511 # Configured by : $cf_by
21512 # Target system : $myuname
21522 Revision='$Revision'
21530 alignbytes='$alignbytes'
21531 ansi2knr='$ansi2knr'
21532 aphostname='$aphostname'
21533 api_revision='$api_revision'
21534 api_subversion='$api_subversion'
21535 api_version='$api_version'
21536 api_versionstring='$api_versionstring'
21539 archlibexp='$archlibexp'
21540 archname64='$archname64'
21541 archname='$archname'
21542 archobjs='$archobjs'
21543 asctime_r_proto='$asctime_r_proto'
21551 byteorder='$byteorder'
21553 castflags='$castflags'
21556 cccdlflags='$cccdlflags'
21557 ccdlflags='$ccdlflags'
21559 ccflags_uselargefiles='$ccflags_uselargefiles'
21561 ccsymbols='$ccsymbols'
21562 ccversion='$ccversion'
21564 cf_email='$cf_email'
21569 clocktype='$clocktype'
21571 compress='$compress'
21572 contains='$contains'
21576 cpp_stuff='$cpp_stuff'
21577 cppccsymbols='$cppccsymbols'
21578 cppflags='$cppflags'
21580 cppminus='$cppminus'
21582 cppstdin='$cppstdin'
21583 cppsymbols='$cppsymbols'
21584 crypt_r_proto='$crypt_r_proto'
21585 cryptlib='$cryptlib'
21587 ctermid_r_proto='$ctermid_r_proto'
21588 ctime_r_proto='$ctime_r_proto'
21589 d_Gconvert='$d_Gconvert'
21590 d_PRIEUldbl='$d_PRIEUldbl'
21591 d_PRIFUldbl='$d_PRIFUldbl'
21592 d_PRIGUldbl='$d_PRIGUldbl'
21593 d_PRIXU64='$d_PRIXU64'
21594 d_PRId64='$d_PRId64'
21595 d_PRIeldbl='$d_PRIeldbl'
21596 d_PRIfldbl='$d_PRIfldbl'
21597 d_PRIgldbl='$d_PRIgldbl'
21598 d_PRIi64='$d_PRIi64'
21599 d_PRIo64='$d_PRIo64'
21600 d_PRIu64='$d_PRIu64'
21601 d_PRIx64='$d_PRIx64'
21602 d_SCNfldbl='$d_SCNfldbl'
21603 d__fwalk='$d__fwalk'
21604 d_access='$d_access'
21605 d_accessx='$d_accessx'
21608 d_archlib='$d_archlib'
21609 d_asctime_r='$d_asctime_r'
21612 d_attribute_format='$d_attribute_format'
21613 d_attribute_malloc='$d_attribute_malloc'
21614 d_attribute_nonnull='$d_attribute_nonnull'
21615 d_attribute_noreturn='$d_attribute_noreturn'
21616 d_attribute_pure='$d_attribute_pure'
21617 d_attribute_unused='$d_attribute_unused'
21618 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
21622 d_bsdgetpgrp='$d_bsdgetpgrp'
21623 d_bsdsetpgrp='$d_bsdsetpgrp'
21624 d_builtin_choose_expr='$d_builtin_choose_expr'
21625 d_builtin_expect='$d_builtin_expect'
21627 d_c99_variadic_macros='$d_c99_variadic_macros'
21628 d_casti32='$d_casti32'
21629 d_castneg='$d_castneg'
21630 d_charvspr='$d_charvspr'
21632 d_chroot='$d_chroot'
21633 d_chsize='$d_chsize'
21635 d_clearenv='$d_clearenv'
21636 d_closedir='$d_closedir'
21637 d_cmsghdr_s='$d_cmsghdr_s'
21639 d_copysignl='$d_copysignl'
21640 d_cplusplus='$d_cplusplus'
21642 d_crypt_r='$d_crypt_r'
21644 d_ctermid='$d_ctermid'
21645 d_ctermid_r='$d_ctermid_r'
21646 d_ctime_r='$d_ctime_r'
21647 d_cuserid='$d_cuserid'
21648 d_dbl_dig='$d_dbl_dig'
21649 d_dbminitproto='$d_dbminitproto'
21650 d_difftime='$d_difftime'
21651 d_dir_dd_fd='$d_dir_dd_fd'
21653 d_dirnamlen='$d_dirnamlen'
21654 d_dlerror='$d_dlerror'
21655 d_dlopen='$d_dlopen'
21656 d_dlsymun='$d_dlsymun'
21657 d_dosuid='$d_dosuid'
21658 d_drand48_r='$d_drand48_r'
21659 d_drand48proto='$d_drand48proto'
21661 d_eaccess='$d_eaccess'
21662 d_endgrent='$d_endgrent'
21663 d_endgrent_r='$d_endgrent_r'
21664 d_endhent='$d_endhent'
21665 d_endhostent_r='$d_endhostent_r'
21666 d_endnent='$d_endnent'
21667 d_endnetent_r='$d_endnetent_r'
21668 d_endpent='$d_endpent'
21669 d_endprotoent_r='$d_endprotoent_r'
21670 d_endpwent='$d_endpwent'
21671 d_endpwent_r='$d_endpwent_r'
21672 d_endsent='$d_endsent'
21673 d_endservent_r='$d_endservent_r'
21674 d_eofnblk='$d_eofnblk'
21675 d_eunice='$d_eunice'
21676 d_faststdio='$d_faststdio'
21677 d_fchdir='$d_fchdir'
21678 d_fchmod='$d_fchmod'
21679 d_fchown='$d_fchown'
21681 d_fcntl_can_lock='$d_fcntl_can_lock'
21682 d_fd_macros='$d_fd_macros'
21683 d_fd_set='$d_fd_set'
21684 d_fds_bits='$d_fds_bits'
21685 d_fgetpos='$d_fgetpos'
21686 d_finite='$d_finite'
21687 d_finitel='$d_finitel'
21688 d_flexfnam='$d_flexfnam'
21690 d_flockproto='$d_flockproto'
21692 d_fp_class='$d_fp_class'
21693 d_fpathconf='$d_fpathconf'
21694 d_fpclass='$d_fpclass'
21695 d_fpclassify='$d_fpclassify'
21696 d_fpclassl='$d_fpclassl'
21697 d_fpos64_t='$d_fpos64_t'
21698 d_frexpl='$d_frexpl'
21699 d_fs_data_s='$d_fs_data_s'
21700 d_fseeko='$d_fseeko'
21701 d_fsetpos='$d_fsetpos'
21702 d_fstatfs='$d_fstatfs'
21703 d_fstatvfs='$d_fstatvfs'
21705 d_ftello='$d_ftello'
21707 d_futimes='$d_futimes'
21708 d_getcwd='$d_getcwd'
21709 d_getespwnam='$d_getespwnam'
21710 d_getfsstat='$d_getfsstat'
21711 d_getgrent='$d_getgrent'
21712 d_getgrent_r='$d_getgrent_r'
21713 d_getgrgid_r='$d_getgrgid_r'
21714 d_getgrnam_r='$d_getgrnam_r'
21715 d_getgrps='$d_getgrps'
21716 d_gethbyaddr='$d_gethbyaddr'
21717 d_gethbyname='$d_gethbyname'
21718 d_gethent='$d_gethent'
21719 d_gethname='$d_gethname'
21720 d_gethostbyaddr_r='$d_gethostbyaddr_r'
21721 d_gethostbyname_r='$d_gethostbyname_r'
21722 d_gethostent_r='$d_gethostent_r'
21723 d_gethostprotos='$d_gethostprotos'
21724 d_getitimer='$d_getitimer'
21725 d_getlogin='$d_getlogin'
21726 d_getlogin_r='$d_getlogin_r'
21727 d_getmnt='$d_getmnt'
21728 d_getmntent='$d_getmntent'
21729 d_getnbyaddr='$d_getnbyaddr'
21730 d_getnbyname='$d_getnbyname'
21731 d_getnent='$d_getnent'
21732 d_getnetbyaddr_r='$d_getnetbyaddr_r'
21733 d_getnetbyname_r='$d_getnetbyname_r'
21734 d_getnetent_r='$d_getnetent_r'
21735 d_getnetprotos='$d_getnetprotos'
21736 d_getpagsz='$d_getpagsz'
21737 d_getpbyname='$d_getpbyname'
21738 d_getpbynumber='$d_getpbynumber'
21739 d_getpent='$d_getpent'
21740 d_getpgid='$d_getpgid'
21741 d_getpgrp2='$d_getpgrp2'
21742 d_getpgrp='$d_getpgrp'
21743 d_getppid='$d_getppid'
21744 d_getprior='$d_getprior'
21745 d_getprotobyname_r='$d_getprotobyname_r'
21746 d_getprotobynumber_r='$d_getprotobynumber_r'
21747 d_getprotoent_r='$d_getprotoent_r'
21748 d_getprotoprotos='$d_getprotoprotos'
21749 d_getprpwnam='$d_getprpwnam'
21750 d_getpwent='$d_getpwent'
21751 d_getpwent_r='$d_getpwent_r'
21752 d_getpwnam_r='$d_getpwnam_r'
21753 d_getpwuid_r='$d_getpwuid_r'
21754 d_getsbyname='$d_getsbyname'
21755 d_getsbyport='$d_getsbyport'
21756 d_getsent='$d_getsent'
21757 d_getservbyname_r='$d_getservbyname_r'
21758 d_getservbyport_r='$d_getservbyport_r'
21759 d_getservent_r='$d_getservent_r'
21760 d_getservprotos='$d_getservprotos'
21761 d_getspnam='$d_getspnam'
21762 d_getspnam_r='$d_getspnam_r'
21763 d_gettimeod='$d_gettimeod'
21764 d_gmtime_r='$d_gmtime_r'
21765 d_gnulibc='$d_gnulibc'
21766 d_grpasswd='$d_grpasswd'
21767 d_hasmntopt='$d_hasmntopt'
21769 d_ilogbl='$d_ilogbl'
21770 d_inc_version_list='$d_inc_version_list'
21772 d_inetaton='$d_inetaton'
21773 d_int64_t='$d_int64_t'
21774 d_isascii='$d_isascii'
21775 d_isfinite='$d_isfinite'
21778 d_isnanl='$d_isnanl'
21779 d_killpg='$d_killpg'
21780 d_lchown='$d_lchown'
21781 d_ldbl_dig='$d_ldbl_dig'
21782 d_libm_lib_version='$d_libm_lib_version'
21784 d_localtime_r='$d_localtime_r'
21785 d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset'
21786 d_locconv='$d_locconv'
21788 d_longdbl='$d_longdbl'
21789 d_longlong='$d_longlong'
21790 d_lseekproto='$d_lseekproto'
21792 d_madvise='$d_madvise'
21793 d_malloc_good_size='$d_malloc_good_size'
21794 d_malloc_size='$d_malloc_size'
21796 d_mbstowcs='$d_mbstowcs'
21797 d_mbtowc='$d_mbtowc'
21798 d_memchr='$d_memchr'
21799 d_memcmp='$d_memcmp'
21800 d_memcpy='$d_memcpy'
21801 d_memmove='$d_memmove'
21802 d_memset='$d_memset'
21804 d_mkdtemp='$d_mkdtemp'
21805 d_mkfifo='$d_mkfifo'
21806 d_mkstemp='$d_mkstemp'
21807 d_mkstemps='$d_mkstemps'
21808 d_mktime='$d_mktime'
21811 d_modfl_pow32_bug='$d_modfl_pow32_bug'
21812 d_modflproto='$d_modflproto'
21813 d_mprotect='$d_mprotect'
21815 d_msg_ctrunc='$d_msg_ctrunc'
21816 d_msg_dontroute='$d_msg_dontroute'
21817 d_msg_oob='$d_msg_oob'
21818 d_msg_peek='$d_msg_peek'
21819 d_msg_proxy='$d_msg_proxy'
21820 d_msgctl='$d_msgctl'
21821 d_msgget='$d_msgget'
21822 d_msghdr_s='$d_msghdr_s'
21823 d_msgrcv='$d_msgrcv'
21824 d_msgsnd='$d_msgsnd'
21826 d_munmap='$d_munmap'
21827 d_mymalloc='$d_mymalloc'
21829 d_nl_langinfo='$d_nl_langinfo'
21830 d_nv_preserves_uv='$d_nv_preserves_uv'
21831 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
21832 d_off64_t='$d_off64_t'
21833 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
21834 d_oldpthreads='$d_oldpthreads'
21835 d_oldsock='$d_oldsock'
21837 d_pathconf='$d_pathconf'
21839 d_perl_otherlibdirs='$d_perl_otherlibdirs'
21840 d_phostname='$d_phostname'
21843 d_portable='$d_portable'
21844 d_printf_format_null='$d_printf_format_null'
21845 d_procselfexe='$d_procselfexe'
21846 d_pseudofork='$d_pseudofork'
21847 d_pthread_atfork='$d_pthread_atfork'
21848 d_pthread_attr_setscope='$d_pthread_attr_setscope'
21849 d_pthread_yield='$d_pthread_yield'
21851 d_pwchange='$d_pwchange'
21852 d_pwclass='$d_pwclass'
21853 d_pwcomment='$d_pwcomment'
21854 d_pwexpire='$d_pwexpire'
21855 d_pwgecos='$d_pwgecos'
21856 d_pwpasswd='$d_pwpasswd'
21857 d_pwquota='$d_pwquota'
21860 d_random_r='$d_random_r'
21861 d_readdir64_r='$d_readdir64_r'
21862 d_readdir='$d_readdir'
21863 d_readdir_r='$d_readdir_r'
21864 d_readlink='$d_readlink'
21866 d_recvmsg='$d_recvmsg'
21867 d_rename='$d_rename'
21868 d_rewinddir='$d_rewinddir'
21870 d_safebcpy='$d_safebcpy'
21871 d_safemcpy='$d_safemcpy'
21872 d_sanemcmp='$d_sanemcmp'
21873 d_sbrkproto='$d_sbrkproto'
21874 d_scalbnl='$d_scalbnl'
21875 d_sched_yield='$d_sched_yield'
21876 d_scm_rights='$d_scm_rights'
21877 d_seekdir='$d_seekdir'
21878 d_select='$d_select'
21880 d_semctl='$d_semctl'
21881 d_semctl_semid_ds='$d_semctl_semid_ds'
21882 d_semctl_semun='$d_semctl_semun'
21883 d_semget='$d_semget'
21885 d_sendmsg='$d_sendmsg'
21886 d_setegid='$d_setegid'
21887 d_seteuid='$d_seteuid'
21888 d_setgrent='$d_setgrent'
21889 d_setgrent_r='$d_setgrent_r'
21890 d_setgrps='$d_setgrps'
21891 d_sethent='$d_sethent'
21892 d_sethostent_r='$d_sethostent_r'
21893 d_setitimer='$d_setitimer'
21894 d_setlinebuf='$d_setlinebuf'
21895 d_setlocale='$d_setlocale'
21896 d_setlocale_r='$d_setlocale_r'
21897 d_setnent='$d_setnent'
21898 d_setnetent_r='$d_setnetent_r'
21899 d_setpent='$d_setpent'
21900 d_setpgid='$d_setpgid'
21901 d_setpgrp2='$d_setpgrp2'
21902 d_setpgrp='$d_setpgrp'
21903 d_setprior='$d_setprior'
21904 d_setproctitle='$d_setproctitle'
21905 d_setprotoent_r='$d_setprotoent_r'
21906 d_setpwent='$d_setpwent'
21907 d_setpwent_r='$d_setpwent_r'
21908 d_setregid='$d_setregid'
21909 d_setresgid='$d_setresgid'
21910 d_setresuid='$d_setresuid'
21911 d_setreuid='$d_setreuid'
21912 d_setrgid='$d_setrgid'
21913 d_setruid='$d_setruid'
21914 d_setsent='$d_setsent'
21915 d_setservent_r='$d_setservent_r'
21916 d_setsid='$d_setsid'
21917 d_setvbuf='$d_setvbuf'
21921 d_shmatprototype='$d_shmatprototype'
21922 d_shmctl='$d_shmctl'
21924 d_shmget='$d_shmget'
21925 d_sigaction='$d_sigaction'
21926 d_signbit='$d_signbit'
21927 d_sigprocmask='$d_sigprocmask'
21928 d_sigsetjmp='$d_sigsetjmp'
21929 d_sitearch='$d_sitearch'
21930 d_snprintf='$d_snprintf'
21931 d_sockatmark='$d_sockatmark'
21932 d_sockatmarkproto='$d_sockatmarkproto'
21933 d_socket='$d_socket'
21934 d_socklen_t='$d_socklen_t'
21935 d_sockpair='$d_sockpair'
21936 d_socks5_init='$d_socks5_init'
21937 d_sprintf_returns_strlen='$d_sprintf_returns_strlen'
21939 d_srand48_r='$d_srand48_r'
21940 d_srandom_r='$d_srandom_r'
21941 d_sresgproto='$d_sresgproto'
21942 d_sresuproto='$d_sresuproto'
21943 d_statblks='$d_statblks'
21944 d_statfs_f_flags='$d_statfs_f_flags'
21945 d_statfs_s='$d_statfs_s'
21946 d_statvfs='$d_statvfs'
21947 d_stdio_cnt_lval='$d_stdio_cnt_lval'
21948 d_stdio_ptr_lval='$d_stdio_ptr_lval'
21949 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
21950 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
21951 d_stdio_stream_array='$d_stdio_stream_array'
21952 d_stdiobase='$d_stdiobase'
21953 d_stdstdio='$d_stdstdio'
21954 d_strchr='$d_strchr'
21955 d_strcoll='$d_strcoll'
21956 d_strctcpy='$d_strctcpy'
21957 d_strerrm='$d_strerrm'
21958 d_strerror='$d_strerror'
21959 d_strerror_r='$d_strerror_r'
21960 d_strftime='$d_strftime'
21961 d_strlcat='$d_strlcat'
21962 d_strlcpy='$d_strlcpy'
21963 d_strtod='$d_strtod'
21964 d_strtol='$d_strtol'
21965 d_strtold='$d_strtold'
21966 d_strtoll='$d_strtoll'
21967 d_strtoq='$d_strtoq'
21968 d_strtoul='$d_strtoul'
21969 d_strtoull='$d_strtoull'
21970 d_strtouq='$d_strtouq'
21971 d_strxfrm='$d_strxfrm'
21972 d_suidsafe='$d_suidsafe'
21973 d_symlink='$d_symlink'
21974 d_syscall='$d_syscall'
21975 d_syscallproto='$d_syscallproto'
21976 d_sysconf='$d_sysconf'
21977 d_sysernlst='$d_sysernlst'
21978 d_syserrlst='$d_syserrlst'
21979 d_system='$d_system'
21980 d_tcgetpgrp='$d_tcgetpgrp'
21981 d_tcsetpgrp='$d_tcsetpgrp'
21982 d_telldir='$d_telldir'
21983 d_telldirproto='$d_telldirproto'
21986 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
21987 d_tm_tm_zone='$d_tm_tm_zone'
21988 d_tmpnam_r='$d_tmpnam_r'
21989 d_truncate='$d_truncate'
21990 d_ttyname_r='$d_ttyname_r'
21991 d_tzname='$d_tzname'
21992 d_u32align='$d_u32align'
21993 d_ualarm='$d_ualarm'
21996 d_union_semun='$d_union_semun'
21997 d_unordered='$d_unordered'
21998 d_unsetenv='$d_unsetenv'
21999 d_usleep='$d_usleep'
22000 d_usleepproto='$d_usleepproto'
22002 d_vendorarch='$d_vendorarch'
22003 d_vendorbin='$d_vendorbin'
22004 d_vendorlib='$d_vendorlib'
22005 d_vendorscript='$d_vendorscript'
22007 d_void_closedir='$d_void_closedir'
22008 d_voidsig='$d_voidsig'
22009 d_voidtty='$d_voidtty'
22010 d_volatile='$d_volatile'
22011 d_vprintf='$d_vprintf'
22012 d_vsnprintf='$d_vsnprintf'
22014 d_waitpid='$d_waitpid'
22015 d_wcstombs='$d_wcstombs'
22016 d_wctomb='$d_wctomb'
22017 d_writev='$d_writev'
22020 db_hashtype='$db_hashtype'
22021 db_prefixtype='$db_prefixtype'
22022 db_version_major='$db_version_major'
22023 db_version_minor='$db_version_minor'
22024 db_version_patch='$db_version_patch'
22025 defvoidused='$defvoidused'
22026 direntrytype='$direntrytype'
22029 doublesize='$doublesize'
22031 drand48_r_proto='$drand48_r_proto'
22032 dynamic_ext='$dynamic_ext'
22038 endgrent_r_proto='$endgrent_r_proto'
22039 endhostent_r_proto='$endhostent_r_proto'
22040 endnetent_r_proto='$endnetent_r_proto'
22041 endprotoent_r_proto='$endprotoent_r_proto'
22042 endpwent_r_proto='$endpwent_r_proto'
22043 endservent_r_proto='$endservent_r_proto'
22044 eunicefix='$eunicefix'
22047 extensions='$extensions'
22049 fflushNULL='$fflushNULL'
22050 fflushall='$fflushall'
22052 firstmakefile='$firstmakefile'
22054 fpossize='$fpossize'
22055 fpostype='$fpostype'
22056 freetype='$freetype'
22059 full_csh='$full_csh'
22060 full_sed='$full_sed'
22061 gccansipedantic='$gccansipedantic'
22062 gccosandvers='$gccosandvers'
22063 gccversion='$gccversion'
22064 getgrent_r_proto='$getgrent_r_proto'
22065 getgrgid_r_proto='$getgrgid_r_proto'
22066 getgrnam_r_proto='$getgrnam_r_proto'
22067 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
22068 gethostbyname_r_proto='$gethostbyname_r_proto'
22069 gethostent_r_proto='$gethostent_r_proto'
22070 getlogin_r_proto='$getlogin_r_proto'
22071 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
22072 getnetbyname_r_proto='$getnetbyname_r_proto'
22073 getnetent_r_proto='$getnetent_r_proto'
22074 getprotobyname_r_proto='$getprotobyname_r_proto'
22075 getprotobynumber_r_proto='$getprotobynumber_r_proto'
22076 getprotoent_r_proto='$getprotoent_r_proto'
22077 getpwent_r_proto='$getpwent_r_proto'
22078 getpwnam_r_proto='$getpwnam_r_proto'
22079 getpwuid_r_proto='$getpwuid_r_proto'
22080 getservbyname_r_proto='$getservbyname_r_proto'
22081 getservbyport_r_proto='$getservbyport_r_proto'
22082 getservent_r_proto='$getservent_r_proto'
22083 getspnam_r_proto='$getspnam_r_proto'
22084 gidformat='$gidformat'
22090 gmtime_r_proto='$gmtime_r_proto'
22091 gnulibc_version='$gnulibc_version'
22093 groupcat='$groupcat'
22094 groupstype='$groupstype'
22097 h_sysfile='$h_sysfile'
22100 html1dir='$html1dir'
22101 html1direxp='$html1direxp'
22102 html3dir='$html3dir'
22103 html3direxp='$html3direxp'
22112 i_arpainet='$i_arpainet'
22113 i_assert='$i_assert'
22114 i_bsdioctl='$i_bsdioctl'
22118 i_dirent='$i_dirent'
22124 i_fp_class='$i_fp_class'
22127 i_ieeefp='$i_ieeefp'
22128 i_inttypes='$i_inttypes'
22129 i_langinfo='$i_langinfo'
22130 i_libutil='$i_libutil'
22131 i_limits='$i_limits'
22132 i_locale='$i_locale'
22133 i_machcthr='$i_machcthr'
22134 i_malloc='$i_malloc'
22136 i_memory='$i_memory'
22137 i_mntent='$i_mntent'
22140 i_neterrno='$i_neterrno'
22141 i_netinettcp='$i_netinettcp'
22145 i_pthread='$i_pthread'
22147 i_rpcsvcdbm='$i_rpcsvcdbm'
22150 i_shadow='$i_shadow'
22152 i_stdarg='$i_stdarg'
22153 i_stddef='$i_stddef'
22154 i_stdlib='$i_stdlib'
22155 i_string='$i_string'
22156 i_sunmath='$i_sunmath'
22157 i_sysaccess='$i_sysaccess'
22158 i_sysdir='$i_sysdir'
22159 i_sysfile='$i_sysfile'
22160 i_sysfilio='$i_sysfilio'
22162 i_sysioctl='$i_sysioctl'
22163 i_syslog='$i_syslog'
22164 i_sysmman='$i_sysmman'
22165 i_sysmode='$i_sysmode'
22166 i_sysmount='$i_sysmount'
22167 i_sysndir='$i_sysndir'
22168 i_sysparam='$i_sysparam'
22169 i_sysresrc='$i_sysresrc'
22170 i_syssecrt='$i_syssecrt'
22171 i_sysselct='$i_sysselct'
22172 i_syssockio='$i_syssockio'
22173 i_sysstat='$i_sysstat'
22174 i_sysstatfs='$i_sysstatfs'
22175 i_sysstatvfs='$i_sysstatvfs'
22176 i_systime='$i_systime'
22177 i_systimek='$i_systimek'
22178 i_systimes='$i_systimes'
22179 i_systypes='$i_systypes'
22180 i_sysuio='$i_sysuio'
22182 i_sysutsname='$i_sysutsname'
22183 i_sysvfs='$i_sysvfs'
22184 i_syswait='$i_syswait'
22185 i_termio='$i_termio'
22186 i_termios='$i_termios'
22188 i_unistd='$i_unistd'
22191 i_values='$i_values'
22192 i_varargs='$i_varargs'
22193 i_varhdr='$i_varhdr'
22195 ignore_versioned_solibs='$ignore_versioned_solibs'
22196 inc_version_list='$inc_version_list'
22197 inc_version_list_init='$inc_version_list_init'
22200 initialinstalllocation='$initialinstalllocation'
22201 installarchlib='$installarchlib'
22202 installbin='$installbin'
22203 installhtml1dir='$installhtml1dir'
22204 installhtml3dir='$installhtml3dir'
22205 installman1dir='$installman1dir'
22206 installman3dir='$installman3dir'
22207 installprefix='$installprefix'
22208 installprefixexp='$installprefixexp'
22209 installprivlib='$installprivlib'
22210 installscript='$installscript'
22211 installsitearch='$installsitearch'
22212 installsitebin='$installsitebin'
22213 installsitehtml1dir='$installsitehtml1dir'
22214 installsitehtml3dir='$installsitehtml3dir'
22215 installsitelib='$installsitelib'
22216 installsiteman1dir='$installsiteman1dir'
22217 installsiteman3dir='$installsiteman3dir'
22218 installsitescript='$installsitescript'
22219 installstyle='$installstyle'
22220 installusrbinperl='$installusrbinperl'
22221 installvendorarch='$installvendorarch'
22222 installvendorbin='$installvendorbin'
22223 installvendorhtml1dir='$installvendorhtml1dir'
22224 installvendorhtml3dir='$installvendorhtml3dir'
22225 installvendorlib='$installvendorlib'
22226 installvendorman1dir='$installvendorman1dir'
22227 installvendorman3dir='$installvendorman3dir'
22228 installvendorscript='$installvendorscript'
22230 issymlink='$issymlink'
22231 ivdformat='$ivdformat'
22234 known_extensions='$known_extensions'
22237 lddlflags='$lddlflags'
22239 ldflags_uselargefiles='$ldflags_uselargefiles'
22240 ldlibpthname='$ldlibpthname'
22247 libsdirs='$libsdirs'
22248 libsfiles='$libsfiles'
22249 libsfound='$libsfound'
22250 libspath='$libspath'
22251 libswanted='$libswanted'
22252 libswanted_uselargefiles='$libswanted_uselargefiles'
22258 localtime_r_proto='$localtime_r_proto'
22259 locincpth='$locincpth'
22260 loclibpth='$loclibpth'
22261 longdblsize='$longdblsize'
22262 longlongsize='$longlongsize'
22263 longsize='$longsize'
22267 lseeksize='$lseeksize'
22268 lseektype='$lseektype'
22271 madlyobj='$madlyobj'
22272 madlysrc='$madlysrc'
22276 make_set_make='$make_set_make'
22277 mallocobj='$mallocobj'
22278 mallocsrc='$mallocsrc'
22279 malloctype='$malloctype'
22281 man1direxp='$man1direxp'
22284 man3direxp='$man3direxp'
22286 mips_type='$mips_type'
22287 mistrustnm='$mistrustnm'
22289 mmaptype='$mmaptype'
22290 modetype='$modetype'
22292 multiarch='$multiarch'
22294 myarchname='$myarchname'
22295 mydomain='$mydomain'
22296 myhostname='$myhostname'
22299 need_va_copy='$need_va_copy'
22300 netdb_hlen_type='$netdb_hlen_type'
22301 netdb_host_type='$netdb_host_type'
22302 netdb_name_type='$netdb_name_type'
22303 netdb_net_type='$netdb_net_type'
22306 nm_so_opt='$nm_so_opt'
22307 nonxs_ext='$nonxs_ext'
22309 nvEUformat='$nvEUformat'
22310 nvFUformat='$nvFUformat'
22311 nvGUformat='$nvGUformat'
22312 nv_preserves_uv_bits='$nv_preserves_uv_bits'
22313 nveformat='$nveformat'
22314 nvfformat='$nvfformat'
22315 nvgformat='$nvgformat'
22318 o_nonblock='$o_nonblock'
22320 old_pthread_create_joinable='$old_pthread_create_joinable'
22321 optimize='$optimize'
22322 orderlib='$orderlib'
22325 otherlibdirs='$otherlibdirs'
22329 patchlevel='$patchlevel'
22330 path_sep='$path_sep'
22333 perl_patchlevel='$perl_patchlevel'
22334 perladmin='$perladmin'
22335 perllibs='$perllibs'
22336 perlpath='$perlpath'
22338 phostname='$phostname'
22344 prefixexp='$prefixexp'
22346 privlibexp='$privlibexp'
22347 procselfexe='$procselfexe'
22348 prototype='$prototype'
22350 quadkind='$quadkind'
22351 quadtype='$quadtype'
22352 randbits='$randbits'
22353 randfunc='$randfunc'
22354 random_r_proto='$random_r_proto'
22355 randseedtype='$randseedtype'
22357 rd_nodata='$rd_nodata'
22358 readdir64_r_proto='$readdir64_r_proto'
22359 readdir_r_proto='$readdir_r_proto'
22360 revision='$revision'
22366 sPRIEUldbl='$sPRIEUldbl'
22367 sPRIFUldbl='$sPRIFUldbl'
22368 sPRIGUldbl='$sPRIGUldbl'
22369 sPRIXU64='$sPRIXU64'
22371 sPRIeldbl='$sPRIeldbl'
22372 sPRIfldbl='$sPRIfldbl'
22373 sPRIgldbl='$sPRIgldbl'
22378 sSCNfldbl='$sSCNfldbl'
22379 sched_yield='$sched_yield'
22380 scriptdir='$scriptdir'
22381 scriptdirexp='$scriptdirexp'
22383 seedfunc='$seedfunc'
22384 selectminbits='$selectminbits'
22385 selecttype='$selecttype'
22386 sendmail='$sendmail'
22387 setgrent_r_proto='$setgrent_r_proto'
22388 sethostent_r_proto='$sethostent_r_proto'
22389 setlocale_r_proto='$setlocale_r_proto'
22390 setnetent_r_proto='$setnetent_r_proto'
22391 setprotoent_r_proto='$setprotoent_r_proto'
22392 setpwent_r_proto='$setpwent_r_proto'
22393 setservent_r_proto='$setservent_r_proto'
22396 sharpbang='$sharpbang'
22397 shmattype='$shmattype'
22398 shortsize='$shortsize'
22401 sig_count='$sig_count'
22402 sig_name='$sig_name'
22403 sig_name_init='$sig_name_init'
22405 sig_num_init='$sig_num_init'
22406 sig_size='$sig_size'
22407 signal_t='$signal_t'
22408 sitearch='$sitearch'
22409 sitearchexp='$sitearchexp'
22411 sitebinexp='$sitebinexp'
22412 sitehtml1dir='$sitehtml1dir'
22413 sitehtml1direxp='$sitehtml1direxp'
22414 sitehtml3dir='$sitehtml3dir'
22415 sitehtml3direxp='$sitehtml3direxp'
22417 sitelib_stem='$sitelib_stem'
22418 sitelibexp='$sitelibexp'
22419 siteman1dir='$siteman1dir'
22420 siteman1direxp='$siteman1direxp'
22421 siteman3dir='$siteman3dir'
22422 siteman3direxp='$siteman3direxp'
22423 siteprefix='$siteprefix'
22424 siteprefixexp='$siteprefixexp'
22425 sitescript='$sitescript'
22426 sitescriptexp='$sitescriptexp'
22427 sizesize='$sizesize'
22428 sizetype='$sizetype'
22432 sockethdr='$sockethdr'
22433 socketlib='$socketlib'
22434 socksizetype='$socksizetype'
22436 spackage='$spackage'
22437 spitshell='$spitshell'
22438 srand48_r_proto='$srand48_r_proto'
22439 srandom_r_proto='$srandom_r_proto'
22441 ssizetype='$ssizetype'
22442 startperl='$startperl'
22444 static_ext='$static_ext'
22446 stdio_base='$stdio_base'
22447 stdio_bufsiz='$stdio_bufsiz'
22448 stdio_cnt='$stdio_cnt'
22449 stdio_filbuf='$stdio_filbuf'
22450 stdio_ptr='$stdio_ptr'
22451 stdio_stream_array='$stdio_stream_array'
22452 strerror_r_proto='$strerror_r_proto'
22455 subversion='$subversion'
22459 targetarch='$targetarch'
22463 timeincl='$timeincl'
22464 timetype='$timetype'
22465 tmpnam_r_proto='$tmpnam_r_proto'
22471 ttyname_r_proto='$ttyname_r_proto'
22480 uidformat='$uidformat'
22486 uquadtype='$uquadtype'
22487 use5005threads='$use5005threads'
22488 use64bitall='$use64bitall'
22489 use64bitint='$use64bitint'
22490 usecrosscompile='$usecrosscompile'
22492 usefaststdio='$usefaststdio'
22493 useithreads='$useithreads'
22494 uselargefiles='$uselargefiles'
22495 uselongdouble='$uselongdouble'
22496 usemallocwrap='$usemallocwrap'
22497 usemorebits='$usemorebits'
22498 usemultiplicity='$usemultiplicity'
22499 usemymalloc='$usemymalloc'
22501 useopcode='$useopcode'
22502 useperlio='$useperlio'
22503 useposix='$useposix'
22504 usereentrant='$usereentrant'
22505 userelocatableinc='$userelocatableinc'
22507 useshrplib='$useshrplib'
22508 usesitecustomize='$usesitecustomize'
22509 usesocks='$usesocks'
22510 usethreads='$usethreads'
22511 usevendorprefix='$usevendorprefix'
22512 usevfork='$usevfork'
22515 uvXUformat='$uvXUformat'
22516 uvoformat='$uvoformat'
22519 uvuformat='$uvuformat'
22520 uvxformat='$uvxformat'
22521 vendorarch='$vendorarch'
22522 vendorarchexp='$vendorarchexp'
22523 vendorbin='$vendorbin'
22524 vendorbinexp='$vendorbinexp'
22525 vendorhtml1dir='$vendorhtml1dir'
22526 vendorhtml1direxp='$vendorhtml1direxp'
22527 vendorhtml3dir='$vendorhtml3dir'
22528 vendorhtml3direxp='$vendorhtml3direxp'
22529 vendorlib='$vendorlib'
22530 vendorlib_stem='$vendorlib_stem'
22531 vendorlibexp='$vendorlibexp'
22532 vendorman1dir='$vendorman1dir'
22533 vendorman1direxp='$vendorman1direxp'
22534 vendorman3dir='$vendorman3dir'
22535 vendorman3direxp='$vendorman3direxp'
22536 vendorprefix='$vendorprefix'
22537 vendorprefixexp='$vendorprefixexp'
22538 vendorscript='$vendorscript'
22539 vendorscriptexp='$vendorscriptexp'
22541 version_patchlevel_string='$version_patchlevel_string'
22542 versiononly='$versiononly'
22544 voidflags='$voidflags'
22547 yaccflags='$yaccflags'
22552 : Add in command line options if available
22553 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
22555 : add special variables
22556 $test -f $src/patchlevel.h && \
22557 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
22558 echo "PERL_PATCHLEVEL=$perl_patchlevel" >>config.sh
22559 echo "PERL_CONFIG_SH=true" >>config.sh
22561 : propagate old symbols
22562 if $test -f UU/config.sh; then
22563 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
22564 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
22565 $sort | $uniq -u >UU/oldsyms
22566 set X `cat UU/oldsyms`
22572 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
22574 echo "# Variables propagated from previous config.sh file." >>config.sh
22575 for sym in `cat UU/oldsyms`; do
22576 echo " Propagating $hint variable "'$'"$sym..."
22577 eval 'tmp="$'"${sym}"'"'
22579 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
22585 : Finish up by extracting the .SH files
22589 echo "Extraction done."
22599 If you'd like to make any changes to the config.sh file before I begin
22600 to configure things, do it as a shell escape now (e.g. !vi config.sh).
22603 rp="Press return or use a shell escape to edit config.sh:"
22608 *) : in case they cannot read
22609 sh 1>&4 -c "$ans";;
22614 : if this fails, just run all the .SH files by hand
22623 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
22630 Now you need to generate make dependencies by running "$make depend".
22631 You might prefer to run it in background: "$make depend > makedepend.out &"
22632 It can take a while, so you might not want to run it right now.
22637 rp="Run $make depend now?"
22641 $make depend && echo "Now you must run '$make'."
22644 echo "You must run '$make depend' then '$make'."
22647 elif test -f [Mm]akefile; then
22649 echo "Now you must run a $make."
22651 echo "Configure done."
22654 if $test -f Policy.sh; then
22657 If you compile $package on a different machine or from a different object
22658 directory, copy the Policy.sh file from this object directory to the
22659 new one before you run Configure -- this will help you with most of
22660 the policy defaults.
22664 if $test -f config.msg; then
22665 echo "Hmm. I also noted the following information while running:"
22667 $cat config.msg >&4
22670 $rm -f kit*isdone ark*isdone