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 package (which contains metaconfig) is available via SVN:
17 # svn co https://svn.sourceforge.net/svnroot/dist/trunk/dist
20 # Though this script was generated by metaconfig, it is OK to send
21 # patches against it. It's up to the Configure pumpkin to backport
22 # the patch to the metaunits if it is accepted.
23 # See Porting/pumpkin.pod for more information on metaconfig.
26 # $Id: Head.U 6 2006-08-25 22:21:46Z rmanfredi $
28 # Generated on Fri Mar 21 11:25:23 CET 2008 [metaconfig 3.5 PL0]
29 # (with additional metaconfig patches by perlbug@perl.org)
34 SCO csh still thinks true is false. Write to SCO today and tell them that next
35 year Configure ought to "rm /bin/csh" unless they fix their blasted shell. :-)
37 (Actually, Configure ought to just patch csh in place. Hmm. Hmmmmm. All
38 we'd have to do is go in and swap the && and || tokens, wherever they are.)
40 [End of diatribe. We now return you to your regularly scheduled programming...]
44 OOPS! You naughty creature! You didn't run Configure with sh!
45 I will attempt to remedy the situation by running sh for you...
49 true || exec sh $0 $argv:q
51 (exit $?0) || cat c2$$
52 (exit $?0) || exec sh $0 $argv:q
55 if test -f /dev/cputype -a -f /dev/drivers -a -f /dev/osversion; then
58 *** I'm sorry but this system looks like Plan 9 and Plan 9 doesn't do
59 *** Configure that well. (Plan 9 is close to UNIX but not close enough.)
60 *** Please read the README.plan9 for further instructions.
61 *** Cannot continue, aborting.
67 if test ! -c /dev/null ; then
70 *** I'm sorry, but /dev/null appears to be a file rather than a device.
71 *** Please consult your operating sytem's notes for making a device
73 *** Cannot continue, aborting.
79 : compute my invocation name
83 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
88 : Proper separator for the PATH environment variable
90 : On OS/2 this directory should exist if this is not floppy only system ":-]"
91 if test -d c:/. || ( uname -a | grep -i 'os\(/\|\)2' ) 2>&1 >/dev/null ; then
92 if test -n "$OS2_SHELL"; then
94 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
95 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
97 elif test -n "$DJGPP"; then
98 case "X${MACHTYPE:-nonesuchmach}" in
105 : Proper PATH setting
106 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
107 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
108 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
109 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
110 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
111 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /opt/ansic/bin /usr/ccs/bin"
112 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
113 paths="$paths /sbin /usr/sbin /usr/libexec"
114 paths="$paths /system/gnu_library/bin"
118 case "$p_$PATH$p_" in
120 *) test -d $p && PATH=$PATH$p_$p ;;
127 : shall we be using ksh?
133 if (PATH=.; alias -x) >/dev/null 2>&1; then
136 if test -f /hp-ux -a -f /bin/ksh; then
137 needksh='to avoid sh bug in "here document" expansion'
139 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
140 if test X`/usr/bin/uname -v` = X4; then
141 avoidksh="to avoid AIX 4's /bin/sh"
145 if test -f /osf_boot -a -f /usr/sbin/setld; then
146 if test X`/usr/bin/uname -s` = XOSF1; then
147 avoidksh="to avoid Digital UNIX' ksh"
152 case "$inksh/$needksh" in
159 case "$inksh/$avoidksh" in
165 case "$inksh/$needksh-$avoidksh-" in
168 (I see you are using the Korn shell. Some ksh's blow up on $me,
169 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
176 echo "(Feeding myself to $newsh $reason.)"
178 Configure|*/Configure) exec $newsh $0 "$@";;
179 *) exec $newsh Configure "$@";;
183 test -x "${newsh}" || unset newsh
185 : if needed, set CDPATH to a harmless value that is not chatty
186 : avoid bash 2.02 problems with empty CDPATH.
190 *bash*) CDPATH='.' ;;
196 : Configure runs within the UU subdirectory
197 test -d UU || mkdir UU
335 initialinstalllocation=''
362 d_attribute_format=''
363 d_attribute_malloc=''
364 d_attribute_nonnull=''
365 d_attribute_noreturn=''
367 d_attribute_unused=''
368 d_attribute_warn_unused_result=''
369 d_printf_format_null=''
372 d_builtin_choose_expr=''
375 d_c99_variadic_macros=''
422 endhostent_r_proto=''
428 endprotoent_r_proto=''
434 endservent_r_proto=''
486 gethostbyaddr_r_proto=''
488 gethostbyname_r_proto=''
490 gethostent_r_proto=''
502 getnetbyaddr_r_proto=''
504 getnetbyname_r_proto=''
518 d_getprotobyname_r=''
519 getprotobyname_r_proto=''
520 d_getprotobynumber_r=''
521 getprotobynumber_r_proto=''
523 getprotoent_r_proto=''
535 getservbyname_r_proto=''
537 getservbyport_r_proto=''
539 getservent_r_proto=''
563 d_libm_lib_version=''
566 d_localtime_r_needs_tzset=''
577 d_malloc_good_size=''
619 d_old_pthread_create_joinable=''
620 old_pthread_create_joinable=''
622 d_pthread_attr_setscope=''
661 sethostent_r_proto=''
678 setprotoent_r_proto=''
690 setservent_r_proto=''
724 d_sprintf_returns_strlen=''
739 d_stdio_ptr_lval_nochange_cnt=''
740 d_stdio_ptr_lval_sets_cnt=''
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_overflows_integers_at=''
1062 nv_preserves_uv_bits=''
1134 installsitehtml1dir=''
1137 installsitehtml3dir=''
1144 installsiteman1dir=''
1147 installsiteman3dir=''
1152 installsitescript=''
1167 d_stdio_stream_array=''
1168 stdio_stream_array=''
1181 ccflags_uselargefiles=''
1182 ldflags_uselargefiles=''
1183 libswanted_uselargefiles=''
1203 installvendorarch=''
1210 installvendorhtml1dir=''
1212 vendorhtml1direxp=''
1213 installvendorhtml3dir=''
1215 vendorhtml3direxp=''
1221 installvendorman1dir=''
1224 installvendorman3dir=''
1231 installvendorscript=''
1244 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1247 : We must find out about Eunice early
1249 if test -f /etc/unixtovms; then
1250 eunicefix=/etc/unixtovms
1252 if test -f /etc/unixtovms.exe; then
1253 eunicefix=/etc/unixtovms.exe
1256 : Set executable suffix now -- needed before hints available
1257 if test -f "/libs/version.library"; then
1260 elif test -f "/system/gnu_library/bin/ar.pm"; then
1263 elif test -n "$DJGPP"; then
1266 elif test -d c:/. -o -n "$is_os2" ; then
1272 : Trailing extension. Override this in a hint file, if needed.
1273 : Extra object files, if any, needed on this platform.
1278 : change the next line if compiling for Xenix/286 on Xenix/386
1279 xlibpth='/usr/lib/386 /lib/386'
1280 : Possible local library directories to search.
1281 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1282 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1284 : general looking path for locating libraries
1285 glibpth="/lib /usr/lib $xlibpth"
1286 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1287 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1288 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1289 test -d /usr/lib64 && glibpth="$glibpth /lib64 /usr/lib64 /usr/local/lib64"
1291 : Private path used by Configure to find libraries. Its value
1292 : is prepended to libpth. This variable takes care of special
1293 : machines, like the mips. Usually, it should be empty.
1296 : default library list
1298 : some systems want to use only the non-versioned libso:s
1299 ignore_versioned_solibs=''
1300 : set usethreads on the Configure command line to enable threads.
1301 usereentrant='undef'
1302 : full support for void wanted by default
1305 : Possible local include directories to search.
1306 : Set locincpth to "" in a hint file to defeat local include searches.
1307 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1308 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1310 : no include file wanted by default
1313 : Enable -DEBUGGING and -DDEBUGGING from the command line
1320 : set useposix=false in your hint file to disable the POSIX extension.
1322 : set useopcode=false in your hint file to disable the Opcode extension.
1325 ccflags_uselargefiles=''
1326 ldflags_uselargefiles=''
1327 libswanted_uselargefiles=''
1328 : set usemultiplicity on the Configure command line to enable multiplicity.
1329 : set usesocks on the Configure command line to enable socks.
1330 : List of libraries we want.
1331 : If anyone needs extra -lxxx, put those in a hint file.
1332 libswanted="sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun"
1333 libswanted="$libswanted m crypt sec util c cposix posix ucb bsd BSD"
1334 : We probably want to search /usr/shlib before most other libraries.
1335 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1336 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1337 glibpth="/usr/shlib $glibpth"
1338 : Do not use vfork unless overridden by a hint file.
1341 : Find the basic shell for Bourne shell scripts
1345 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1348 if test -f "$xxx"; then
1351 : Build up a list and do a single loop so we can 'break' out.
1352 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1353 for xxx in sh bash ksh pdksh ash; do
1355 try="$try ${p}/${xxx}"
1359 if test -f "$xxx"; then
1362 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1365 elif test -f "$xxx.exe"; then
1376 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1378 Usually it's in /bin/sh. How did you even get this far?
1379 Please contact me (Perl Maintainers) at perlbug@perl.org and
1380 we'll try to straighten this all out.
1386 : see if sh knows # comments
1387 if `$sh -c '#' >/dev/null 2>&1`; then
1391 test -f $xcat$_exe || xcat=/usr/bin/cat
1392 if test ! -f $xcat$_exe; then
1393 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1394 if test -f $p/cat$_exe; then
1399 if test ! -f $xcat$_exe; then
1400 echo "Can't find cat anywhere!"
1404 echo "#!$xcat" >sharp
1408 if test -s today; then
1411 echo "#! $xcat" > sharp
1415 if test -s today; then
1423 echo "Your $sh doesn't grok # comments--I will strip them later on."
1426 echo "exec grep -v '^[ ]*#'" >spitshell
1428 $eunicefix spitshell
1429 spitshell=`pwd`/spitshell
1431 echo "I presume that if # doesn't work, #! won't work either!"
1436 : figure out how to guarantee sh startup
1438 '') startsh=${sharpbang}${sh} ;;
1450 : echo "Yup, it does."
1452 echo "Hmm... '$startsh' does not guarantee sh startup..."
1453 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 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1475 arg_exp=`cat cmdl.opt`
1476 args_exp="$args_exp$args_sep'$arg_exp'"
1477 argn=`expr $argn + 1`
1482 : produce awk script to parse command line options
1483 cat >options.awk <<'EOF'
1485 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1487 len = length(optstr);
1488 for (i = 1; i <= len; i++) {
1489 c = substr(optstr, i, 1);
1490 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1501 if (substr(str, 1, 1) != "-") {
1502 printf("'%s'\n", str);
1506 for (i = 2; i <= len; i++) {
1507 c = substr(str, i, 1);
1509 printf("-%s\n", substr(str, i));
1515 printf("'%s'\n", substr(str, i + 1));
1528 : process the command line options
1529 set X `for arg in "$@"; do echo "X$arg"; done |
1530 sed -e s/X// | awk -f options.awk`
1535 : set up default values
1545 rm -f optdef.sh posthint.sh
1546 cat >optdef.sh <<EOS
1552 while test $# -gt 0; do
1554 -d) shift; fastread=yes;;
1555 -e) shift; alldone=cont;;
1559 if test -r "$1"; then
1562 echo "$me: cannot read config file $1." >&2
1568 -h) shift; error=true;;
1569 -r) shift; reuseval=true;;
1570 -s) shift; silent=true; realsilent=true;;
1571 -E) shift; alldone=exit;;
1572 -K) shift; knowitall=true;;
1573 -O) shift; override=true;;
1574 -S) shift; silent=true; extractsh=true;;
1579 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1580 echo "$me: ignoring -D $1" >&2
1583 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1584 *) echo "$1='define'" >> optdef.sh;;
1591 *=) echo "$1" >> optdef.sh;;
1593 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1594 echo "$me: ignoring -U $1" >&2
1596 *) echo "$1='undef'" >> optdef.sh;;
1607 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1611 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1612 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1618 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1619 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1620 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1621 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1622 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1623 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1629 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1631 echo "$yyy=''" >> posthint.sh ;;
1636 echo "$yyy='$zzz'" >> posthint.sh ;;
1638 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1640 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1645 echo "$yyy=$zzz" >> posthint.sh ;;
1646 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1650 -V) echo "$me generated by metaconfig 3.5 PL0." >&2
1653 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1661 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1662 [-U symbol] [-U symbol=] [-A command:symbol...]
1663 -d : use defaults for all answers.
1664 -e : go on without questioning past the production of config.sh.
1665 -f : specify an alternate default configuration file.
1666 -h : print this help message and exit (with an error status).
1667 -r : reuse C symbols value if possible (skips costly nm extraction).
1668 -s : silent mode, only echoes questions and essential information.
1669 -D : define symbol to have some value:
1670 -D symbol symbol gets the value 'define'
1671 -D symbol=value symbol gets the value 'value'
1672 common used examples (see INSTALL for more info):
1673 -Duse64bitint use 64bit integers
1674 -Duse64bitall use 64bit integers and pointers
1675 -Dusethreads use thread support
1676 -Dinc_version_list=none do not include older perl trees in @INC
1677 -DEBUGGING=none DEBUGGING options
1678 -Dcc=gcc choose your compiler
1679 -Dprefix=/opt/perl5 choose your destination
1680 -E : stop at the end of questions, after having produced config.sh.
1681 -K : do not use unless you know what you are doing.
1682 -O : let -D and -U override definitions from loaded configuration file.
1683 -S : perform variable substitutions on all .SH files (can mix with -f)
1684 -U : undefine symbol:
1685 -U symbol symbol gets the value 'undef'
1686 -U symbol= symbol gets completely empty
1688 -A : manipulate symbol after the platform specific hints have been applied:
1689 -A append:symbol=value append value to symbol
1690 -A symbol=value like append:, but with a separating space
1691 -A define:symbol=value define symbol to have value
1692 -A clear:symbol define symbol to be ''
1693 -A define:symbol define symbol to be 'define'
1694 -A eval:symbol=value define symbol to be eval of value
1695 -A prepend:symbol=value prepend value to symbol
1696 -A undef:symbol define symbol to be 'undef'
1697 -A undef:symbol= define symbol to be ''
1698 e.g.: -A prepend:libswanted='cl pthread '
1699 -A ccflags=-DSOME_MACRO
1700 -V : print version number and exit (with a zero status).
1707 case "$fastread$alldone" in
1710 case "$extractsh" in
1713 if test ! -t 0; then
1714 echo "Say 'sh Configure', not 'sh <Configure'"
1724 true) exec 1>/dev/null;;
1727 : run the defines and the undefines, if any, but leave the file out there...
1730 : create the posthint manipulation script and leave the file out there...
1735 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1736 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1737 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1738 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1739 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1742 : Some greps do not return status, grrr.
1743 echo "grimblepritz" >grimble
1744 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1746 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1752 : the following should work in any shell
1756 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1757 cat >contains <<'EOSS'
1758 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1763 : Find the path to the source tree
1766 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1770 *) src=`cd ../$src && pwd` ;;
1783 if test -f $rsrc/Configure && \
1784 $contains "^package='$package'\$" $rsrc/Configure >/dev/null 2>&1
1786 : found it, so we are ok.
1789 for src in . .. ../.. ../../.. ../../../..; do
1790 if test -f ../$src/Configure && \
1791 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1802 Sorry, I can't seem to locate the source dir for $package. Please start
1803 Configure with an explicit path -- i.e. /some/path/Configure.
1811 echo "Sources for $package found in \"$src\"." >&4
1815 : script used to extract .SH files with variable substitutions
1816 cat >extract <<'EOS'
1818 echo "Doing variable substitutions on .SH files..."
1819 if test -f MANIFEST; then
1820 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1822 echo "(Looking for .SH files under the source directory.)"
1823 set x `(cd "$src"; find . -name "*.SH" -print)`
1827 0) set x `(cd "$src"; echo *.SH)`; shift;;
1829 if test ! -f "$src/$1"; then
1835 while test $name; do
1836 if test ! -d "$name"; then
1837 create="$name $create";
1838 name=`echo $name | sed -e "s|^[^/]*$||"`;
1839 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1844 for file in $create; do
1853 dir=`expr X$file : 'X\(.*\)/'`
1854 file=`expr X$file : 'X.*/\(.*\)'`
1855 (cd "$dir" && . ./$file)
1865 dir=`expr X$file : 'X\(.*\)/'`
1866 file=`expr X$file : 'X.*/\(.*\)'`
1867 (set x $dir; shift; eval $mkdir_p)
1868 sh <"$src/$dir/$file"
1877 if test -f "$src/config_h.SH"; then
1878 if test ! -f config.h; then
1879 : oops, they left it out of MANIFEST, probably, so do it anyway.
1880 . "$src/config_h.SH"
1885 : extract files and exit if asked to do so
1886 case "$extractsh" in
1888 case "$realsilent" in
1892 case "$config_sh" in
1893 '') config_sh='config.sh';;
1896 echo "Fetching answers from $config_sh..."
1899 test "$override" && . ./optdef.sh
1903 echo "Extraction done."
1908 : Eunice requires " " instead of "", can you believe it
1911 echo "Beginning of configuration questions for $package."
1913 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1915 : first determine how to suppress newline on echo command
1917 echo "Checking echo to see how to suppress newlines..."
1918 (echo "hi there\c" ; echo " ") >.echotmp
1919 if $contains c .echotmp >/dev/null 2>&1 ; then
1930 echo $n "The star should be here-->$c"
1934 : Now test for existence of everything in MANIFEST
1936 if test -f "$rsrc/MANIFEST"; then
1937 echo "First let's make sure your kit is complete. Checking..." >&4
1938 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" |\
1939 (split -l 50 2>/dev/null || split -50)
1942 for filelist in x??; do
1943 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` \
1944 >/dev/null 2>>"$tmppwd/missing")
1946 if test -s missing; then
1950 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1952 You have the option of continuing the configuration process, despite the
1953 distinct possibility that your kit is damaged, by typing 'y'es. If you
1954 do, don't blame me if something goes wrong. I advise you to type 'n'o
1955 and contact the author (perlbug@perl.org).
1958 echo $n "Continue? [n] $c" >&4
1962 echo "Continuing..." >&4
1966 echo "ABORTING..." >&4
1971 echo "Looks good..."
1974 echo "There is no MANIFEST file. I hope your kit is complete !"
1978 : Find the appropriate value for a newline for tr
1980 if test -n "$DJGPP"; then
1983 if test X"$trnl" = X; then
1984 case "`echo foo|tr '\n' x 2>/dev/null`" in
1988 if test X"$trnl" = X; then
1989 case "`echo foo|tr '\012' x 2>/dev/null`" in
1990 foox) trnl='\012' ;;
1993 if test X"$trnl" = X; then
1994 case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
1995 fooxy) trnl='\n\r' ;;
1998 if test X"$trnl" = X; then
2001 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
2007 : compute the number of columns on the terminal for proper question formatting
2012 : set up the echo used in my read
2013 myecho="case \"\$xxxm\" in
2014 '') echo $n \"\$rp $c\" >&4;;
2016 '') echo $n \"[\$xxxm] $c\";;
2018 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
2020 echo $n \"[\$xxxm] $c\" >&4
2022 echo $n \"\$rp [\$xxxm] $c\" >&4
2028 : now set up to do reads with possible shell escape and default assignment
2034 case "\$fastread" in
2035 yes) case "\$dflt" in
2038 case "\$silent-\$rp" in
2043 *) case "\$silent" in
2044 true) case "\$rp" in
2049 while expr "X\$ans" : "X!" >/dev/null; do
2053 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2061 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2070 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2075 echo "(OK, I'll run with -d after this question.)" >&4
2078 echo "*** Sorry, \$1 not supported yet." >&4
2088 echo "*** Substitution done -- please confirm."
2090 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2095 echo "*** Error -- try again."
2102 case "\$ans\$xxxm\$nostick" in
2114 : create .config dir to save info across Configure sessions
2115 test -d ../.config || mkdir ../.config
2116 cat >../.config/README <<EOF
2117 This directory created by Configure to save information that should
2118 persist across sessions for $package.
2120 You may safely delete it if you wish.
2123 : See if we are using a devel version and want that
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
2341 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2342 pth="$pth /lib /usr/lib"
2343 for file in $loclist; do
2347 if test -f "$xxx"; then
2350 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2351 xxx=`./loc $file $file $pth`
2354 '') xxx=`./loc $file $file $pth`;;
2355 *) xxx=`./loc $xxx $xxx $pth`;;
2357 eval $file=$xxx$_exe
2361 echo $file is in $xxx.
2364 echo $file is in $xxx.
2367 echo "I don't know where '$file' is, and my life depends on it." >&4
2368 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2374 echo "Don't worry if any of the following aren't found..."
2376 for file in $trylist; do
2380 if test -f "$xxx"; then
2383 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2384 xxx=`./loc $file $file $pth`
2387 '') xxx=`./loc $file $file $pth`;;
2388 *) xxx=`./loc $xxx $xxx $pth`;;
2390 eval $file=$xxx$_exe
2394 echo $file is in $xxx.
2397 echo $file is in $xxx.
2400 echo "I don't see $file out there, $say."
2407 echo "Substituting grep for egrep."
2414 echo "Substituting cp for ln."
2423 echo "I can't find make or gmake, and my life depends on it." >&4
2424 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2432 *) # We can't have osname yet.
2433 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2434 # Assume that gmake, if found, is definitely GNU make
2435 # and prefer it over the system make.
2436 echo "Substituting gmake for make."
2444 echo "Hopefully test is built into your sh."
2447 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2448 echo "Using the test built into your sh."
2456 echo "Hopefully echo is built into your sh."
2461 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2462 $echo $n "hi there$c" >foo1
2463 echo $n "hi there$c" >foo2
2464 if cmp foo1 foo2 >/dev/null 2>&1; then
2465 echo "They are compatible. In fact, they may be identical."
2472 They are not compatible! You are probably running ksh on a non-USG system.
2473 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2474 have echo built in and we may have to run some Bourne shell scripts. That
2475 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2478 $echo $n "The star should be here-->$c"
2485 # This question was auctioned at YAPC::Europe-2007 in Vienna
2486 # I never promised you could answer it. I only auctioned the question.
2488 The following message is sponsored by
2490 Dresden.pm<--The stars should be here.
2492 Dear Perl user, system administrator or package
2493 maintainer, the Perl community sends greetings to
2494 you. Do you (emblematical) greet back [Y/n]? n
2498 : Check what type of C compiler we use
2502 cat <<'EOSC' >>trygcc
2507 int main(int argc, char *argv[]) {
2511 if $cc -o try $ccflags $ldflags try.c; then
2514 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2520 # Skip this test because it gives a false match on output like:
2521 # ./trygcc: line 23: cc: command not found
2522 # case "`$cc -v -c try.c 2>&1`" in
2523 # *gcc*) trygcc=no ;;
2525 if $test X"$trygcc" = Xyes; then
2526 if gcc -o try -c try.c; then
2528 echo "You seem to have a working gcc, though." >&4
2529 # Switching compilers may undo the work of hints files.
2530 # The most common problem is -D_REENTRANT for threads.
2531 # This heuristic catches that case, but gets false positives
2532 # if -Dusethreads was not actually specified. Better to
2533 # bail out here with a useful message than fail
2534 # mysteriously later. Should we perhaps just try to
2535 # re-invoke Configure -Dcc=gcc config_args ?
2536 if $test -f usethreads.cbu; then
2539 *** However, any setting of the C compiler flags (e.g. for thread support)
2540 *** will be lost. It may be necessary for you to restart Configure and
2541 *** add -Dcc=gcc to your Configure command line.
2544 rp="Would you like to go ahead and try gcc anyway?"
2547 rp="Would you like to use it?"
2550 if $test -f myread; then
2553 if $test -f UU/myread; then
2556 echo "Cannot find myread, sorry. Aborting." >&2
2561 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2574 cat <<'EOSC' >>checkcc
2579 int main(int argc, char *argv[]) {
2583 if $cc -o try $ccflags $ldflags try.c; then
2586 if $test X"$despair" = Xyes; then
2587 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2590 You need to find a working C compiler.
2591 Either (purchase and) install the C compiler supplied by your OS vendor,
2592 or for a free C compiler try http://gcc.gnu.org/
2593 I cannot continue any further, aborting.
2602 : determine whether symbolic links are supported
2605 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2606 echo "Symbolic links are supported." >&4
2609 echo "Symbolic links are NOT supported." >&4
2614 : determine whether symbolic links are supported
2618 echo "Checking how to test for symbolic links..." >&4
2620 if $test "X$issymlink" = X; then
2622 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2623 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2625 if test $? = 0; then
2628 echo "Your builtin 'test -h' may be broken." >&4
2631 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2634 if test -f "$p/$test"; then
2643 echo "Trying external '$test -h'." >&4
2644 issymlink="$test -h"
2645 if $test ! -h sym >/dev/null 2>&1; then
2646 echo "External '$test -h' is broken, too." >&4
2654 if $test "X$issymlink" = X; then
2655 if $test -L sym 2>/dev/null; then
2656 issymlink="$test -L"
2657 echo "The builtin '$test -L' worked." >&4
2660 if $test "X$issymlink" != X; then
2661 echo "You can test for symbolic links with '$issymlink'." >&4
2663 echo "I do not know how you can test for symbolic links." >&4
2667 *) echo "No symbolic links, so not testing for their testing..." >&4
2672 : Make symlinks util
2673 case "$mksymlinks" in
2676 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2679 *) case "$lns:$issymlink" in
2680 *"ln"*" -s:"*"test -"?)
2681 echo "Creating the symbolic links..." >&4
2682 echo "(First creating the subdirectories...)" >&4
2684 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2686 test -z "$directory" && break
2690 if test ! -d t/base; then
2691 echo "Failed to create the subdirectories. Aborting." >&4
2694 echo "(Then creating the symlinks...)" >&4
2695 awk '{print $1}' $src/MANIFEST | while true; do
2697 test -z "$filename" && break
2698 if test -f $filename; then
2699 if $issymlink $filename; then
2703 if test -f $filename; then
2704 echo "$filename already exists, not symlinking."
2706 ln -s $src/$filename $filename
2710 if test ! -f t/base/lex.t; then
2711 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2716 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2724 : Check for Cross-Compilation
2725 case "$usecrosscompile" in
2727 $echo "Cross-compiling..."
2730 *-*-gcc) # A cross-compiling gcc, probably.
2731 targetarch=`$echo $cc|$sed 's/-gcc$//'`
2733 # leave out ld, choosing it is more complex
2735 ranlib=$targetarch-ranlib
2736 $echo 'extern int foo;' > try.c
2737 set X `$cc -v -E try.c 2>&1 | $awk '/^#include </,/^End of search /'|$grep '/include'`
2739 if $test $# -gt 0; then
2741 incpth="`$echo $incpth|$sed 's/^ //'`"
2742 echo "Guessing incpth '$incpth'." >&4
2744 j="`$echo $i|$sed 's,/include$,/lib,'`"
2745 if $test -d $j; then
2749 libpth="`$echo $libpth|$sed 's/^ //'`"
2750 echo "Guessing libpth '$libpth'." >&4
2755 case "$targetarch" in
2756 '') echo "Targetarch not defined." >&4; croak=y ;;
2757 *) echo "Using targetarch $targetarch." >&4 ;;
2760 '') echo "Incpth not defined." >&4; croak=y ;;
2761 *) echo "Using incpth '$incpth'." >&4 ;;
2764 '') echo "Libpth not defined." >&4; croak=y ;;
2765 *) echo "Using libpth '$libpth'." >&4 ;;
2768 '') for i in $incpth; do
2769 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
2771 echo "Guessing usrinc $usrinc." >&4
2776 '') echo "Usrinc not defined." >&4; croak=y ;;
2779 *) echo "Using usrinc $usrinc." >&4 ;;
2781 case "$targethost" in
2782 '') echo "Targethost not defined." >&4; croak=y ;;
2783 *) echo "Using targethost $targethost." >&4
2788 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2791 /*) run=$src/Cross/run
2792 targetmkdir=$src/Cross/mkdir
2794 from=$src/Cross/from
2796 *) pwd=`$test -f ../Configure & cd ..; pwd`
2798 targetmkdir=$pwd/Cross/mkdir
2800 from=$pwd/Cross/from
2803 case "$targetrun" in
2804 '') targetrun=ssh ;;
2809 case "$targetfrom" in
2810 '') targetfrom=scp ;;
2814 from=$from-$targetfrom
2815 case "$targetdir" in
2817 echo "Guessing targetdir $targetdir." >&4
2820 case "$targetuser" in
2822 echo "Guessing targetuser $targetuser." >&4
2825 case "$targetfrom" in
2829 case "$targetrun" in
2841 '') cwd=$targetdir ;;
2845 if $test ! -f \$exe.xok; then
2849 $targetrun -l $targetuser $targethost "cd \$cwd && ./\$exe \$@"
2852 *) echo "Unknown targetrun '$targetrun'" >&4
2856 case "$targetmkdir" in
2858 cat >$targetmkdir <<EOF
2860 $targetrun -l $targetuser $targethost "mkdir -p \$@"
2862 $chmod a+rx $targetmkdir
2864 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
2876 $targetmkdir \`dirname \$f\`
2877 $targetto $q \$f $targetuser@$targethost:\$f || exit 1
2880 $targetmkdir $targetdir/\`dirname \$f\`
2881 $targetto $q \$f $targetuser@$targethost:$targetdir/\$f || exit 1
2894 $mkdir -p $targetdir/\`dirname \$f\`
2895 $cp \$f $targetdir/\$f || exit 1
2898 $targetmkdir $targetdir/\`dirname \$f\`
2899 $cp \$f $targetdir/\$f || exit 1
2906 *) echo "Unknown targetto '$targetto'" >&4
2910 case "$targetfrom" in
2917 $targetfrom $q $targetuser@$targethost:$targetdir/\$f . || exit 1
2922 cp) cat >$from <<EOF
2927 cp $targetdir/\$f . || exit 1
2932 *) echo "Unknown targetfrom '$targetfrom'" >&4
2936 if $test ! -f $run; then
2937 echo "Target 'run' script '$run' not found." >&4
2941 if $test ! -f $to; then
2942 echo "Target 'to' script '$to' not found." >&4
2946 if $test ! -f $from; then
2947 echo "Target 'from' script '$from' not found." >&4
2951 if $test ! -f $run -o ! -f $to -o ! -f $from; then
2955 Using '$run' for remote execution,
2956 and '$from' and '$to'
2957 for remote file transfer.
2963 usecrosscompile='undef'
2968 : see whether [:lower:] and [:upper:] are supported character classes
2970 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2972 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2976 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
2977 # (0xd9 and 0xe2), therefore that is a nice testing point.
2978 if test "X$up" = X -o "X$low" = X; then
2979 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
2985 if test "X$up" = X -o "X$low" = X; then
2986 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
2992 if test "X$up" = X -o "X$low" = X; then
2993 case "`echo RS | od -x 2>/dev/null`" in
2995 echo "Hey, this might be EBCDIC." >&4
2996 if test "X$up" = X -o "X$low" = X; then
2997 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2998 rs) up='[A-IJ-RS-Z]'
3003 if test "X$up" = X -o "X$low" = X; then
3004 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
3014 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
3016 echo "Using $up and $low to convert case." >&4
3019 echo "I don't know how to translate letters from upper to lower case." >&4
3020 echo "Your tr is not acting any way I know of." >&4
3024 : set up the translation script tr, must be called with ./tr of course
3028 '[A-Z][a-z]') exec $tr '$up' '$low';;
3029 '[a-z][A-Z]') exec $tr '$low' '$up';;
3036 : Try to determine whether config.sh was made on this system
3037 case "$config_sh" in
3039 myuname=`$uname -a 2>/dev/null`
3040 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
3041 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
3042 # because the A-Z/a-z are not consecutive.
3043 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e "s,['/],,g" | \
3044 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
3045 newmyuname="$myuname"
3047 case "$knowitall" in
3049 if test -f ../config.sh; then
3050 if $contains myuname= ../config.sh >/dev/null 2>&1; then
3051 eval "`grep myuname= ../config.sh`"
3053 if test "X$myuname" = "X$newmyuname"; then
3061 : Get old answers from old config file if Configure was run on the
3062 : same system, otherwise use the hints.
3065 if test -f config.sh; then
3067 rp="I see a config.sh file. Shall I use it to set the defaults?"
3070 n*|N*) echo "OK, I'll ignore it."
3071 mv config.sh config.sh.old
3072 myuname="$newmyuname"
3074 *) echo "Fetching default answers from your old config.sh file..." >&4
3082 : Older versions did not always set $sh. Catch re-use of such
3092 if test ! -f config.sh; then
3095 First time through, eh? I have some defaults handy for some systems
3096 that need some extra help getting the Configure answers right:
3099 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3101 : Half the following guesses are probably wrong... If you have better
3102 : tests or hints, please send them to perlbug@perl.org
3103 : The metaconfig authors would also appreciate a copy...
3104 $test -f /irix && osname=irix
3105 $test -f /xenix && osname=sco_xenix
3106 $test -f /dynix && osname=dynix
3107 $test -f /dnix && osname=dnix
3108 $test -f /lynx.os && osname=lynxos
3109 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3110 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3111 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3112 $test -f /bin/mips && /bin/mips && osname=mips
3113 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
3114 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
3115 $test -d /usr/apollo/bin && osname=apollo
3116 $test -f /etc/saf/_sactab && osname=svr4
3117 $test -d /usr/include/minix && osname=minix
3118 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3119 if $test -d /MachTen -o -d /MachTen_Folder; then
3121 if $test -x /sbin/version; then
3122 osvers=`/sbin/version | $awk '{print $2}' |
3123 $sed -e 's/[A-Za-z]$//'`
3124 elif $test -x /usr/etc/version; then
3125 osvers=`/usr/etc/version | $awk '{print $2}' |
3126 $sed -e 's/[A-Za-z]$//'`
3132 $test -f /sys/posix.dll &&
3133 $test -f /usr/bin/what &&
3134 set X `/usr/bin/what /sys/posix.dll` &&
3135 $test "$3" = UWIN &&
3139 if $test -f $uname; then
3147 umips) osname=umips ;;
3150 [23]100) osname=mips ;;
3151 next*) osname=next ;;
3153 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3154 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3157 elif $test -f /etc/kconfig; then
3159 if test "$lns" = "$ln -s"; then
3161 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3163 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3170 if test -n "$DJGPP"; then
3179 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3181 # oslevel can fail with:
3182 # oslevel: Unable to acquire lock.
3183 *not\ found) osvers="$4"."$3" ;;
3184 '<3240'|'<>3240') osvers=3.2.0 ;;
3185 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3186 '=3250'|'>3250') osvers=3.2.5 ;;
3190 bsd386) osname=bsd386
3193 cygwin*) osname=cygwin
3196 *dc.osx) osname=dcosx
3202 domainos) osname=apollo
3208 dragonfly) osname=dragonfly
3211 dynixptx*) osname=dynixptx
3212 osvers=`echo "$4"|sed 's/^v//'`
3214 freebsd) osname=freebsd
3216 genix) osname=genix ;;
3220 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3236 netbsd*) osname=netbsd
3239 news-os) osvers="$3"
3241 4*) osname=newsos4 ;;
3245 next*) osname=next ;;
3246 nonstop-ux) osname=nonstopux ;;
3247 openbsd) osname=openbsd
3253 POSIX-BC | posix-bc ) osname=posix-bc
3256 powerux | power_ux | powermax_os | powermaxos | \
3257 powerunix | power_unix) osname=powerux
3263 solaris) osname=solaris
3265 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3272 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3276 titanos) osname=titanos
3285 ultrix) osname=ultrix
3288 osf1|mls+) case "$5" in
3291 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3294 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3297 hp*) osname=hp_osf1 ;;
3298 mips) osname=mips_osf1 ;;
3301 # UnixWare 7.1.2 is known as Open UNIX 8
3302 openunix|unixware) osname=svr5
3310 $2) case "$osname" in
3314 : svr4.x or possibly later
3324 if test -f /stand/boot ; then
3325 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3326 if test -n "$INITPROG" -a -f "$INITPROG"; then
3327 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3328 if test -n "$isesix"; then
3336 *) if test -f /etc/systemid; then
3338 set `echo $3 | $sed 's/\./ /g'` $4
3339 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3341 elif $test -f $src/hints/sco_$1_$2.sh; then
3343 elif $test -f $src/hints/sco_$1.sh; then
3348 '') : Still unknown. Probably a generic Sys V.
3357 *) case "$osname" in
3358 '') : Still unknown. Probably a generic BSD.
3366 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3367 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3368 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3371 $rm -f UU/kernel.what
3372 elif test -d c:/. -o -n "$is_os2" ; then
3379 case "$targetarch" in
3382 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3387 : Now look for a hint file osname_osvers, unless one has been
3388 : specified already.
3391 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3392 : Also try without trailing minor version numbers.
3393 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3394 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3395 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3396 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3399 *) case "$osvers" in
3402 *) if $test -f $src/hints/$file.sh ; then
3404 elif $test -f $src/hints/$xfile.sh ; then
3406 elif $test -f $src/hints/$xxfile.sh ; then
3408 elif $test -f $src/hints/$xxxfile.sh ; then
3410 elif $test -f $src/hints/$xxxxfile.sh ; then
3412 elif $test -f "$src/hints/${osname}.sh" ; then
3421 if $test -f Policy.sh ; then
3424 none) dflt="Policy" ;;
3425 *) dflt="Policy $dflt" ;;
3430 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3434 if $test -f Policy.sh ; then
3437 There's also a Policy hint file available, which should make the
3438 site-specific (policy) questions easier to answer.
3445 You may give one or more space-separated answers, or "none" if appropriate.
3446 If you have a handcrafted Policy.sh file or a Policy.sh file generated by a
3447 previous run of Configure, you may specify it as well as or instead of
3448 OS-specific hints. If hints are provided for your OS, you should use them:
3449 although Perl can probably be built without hints on many platforms, using
3450 hints often improve performance and may enable features that Configure can't
3451 set up on its own. If there are no hints that match your OS, specify "none";
3452 DO NOT give a wrong version or a wrong OS.
3456 rp="Which of these apply, if any?"
3459 for file in $tans; do
3460 if $test X$file = XPolicy -a -f Policy.sh; then
3462 $cat Policy.sh >> UU/config.sh
3463 elif $test -f $src/hints/$file.sh; then
3464 . $src/hints/$file.sh
3465 $cat $src/hints/$file.sh >> UU/config.sh
3466 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3469 : Give one chance to correct a possible typo.
3470 echo "$file.sh does not exist"
3472 rp="hint to use instead?"
3474 for file in $ans; do
3475 if $test -f "$src/hints/$file.sh"; then
3476 . $src/hints/$file.sh
3477 $cat $src/hints/$file.sh >> UU/config.sh
3478 elif $test X$ans = X -o X$ans = Xnone ; then
3481 echo "$file.sh does not exist -- ignored."
3488 : Remember our hint file for later.
3489 if $test -f "$src/hints/$file.sh" ; then
3499 echo "Fetching default answers from $config_sh..." >&4
3503 cp $config_sh config.sh 2>/dev/null
3513 test "$override" && . ./optdef.sh
3515 : Restore computed paths
3516 for file in $loclist $trylist; do
3517 eval $file="\$_$file"
3522 Configure uses the operating system name and version to set some defaults.
3523 The default value is probably right if the name rings a bell. Otherwise,
3524 since spelling matters for me, either accept the default or answer "none"
3531 ''|' '|none) dflt=none ;;
3532 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3535 *) dflt="$osname" ;;
3537 rp="Operating system name?"
3541 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3547 ''|' '|none) dflt=none ;;
3548 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3549 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3551 ''|' ') dflt=none ;;
3556 *) dflt="$osvers" ;;
3558 rp="Operating system version?"
3568 : who configured the system
3569 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3572 cf_by=`(logname) 2>/dev/null`
3575 cf_by=`(whoami) 2>/dev/null`
3577 "") cf_by=unknown ;;
3582 : decide how portable to be. Allow command line overrides.
3583 case "$d_portable" in
3585 *) d_portable="$define" ;;
3588 : set up shell script to do ~ expansion
3594 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3597 if $test -f /bin/csh; then
3598 /bin/csh -f -c "glob \$1"
3603 name=\`$expr x\$1 : '..\([^/]*\)'\`
3604 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3605 if $test ! -d "\$dir"; then
3607 echo "\$me: can't locate home directory for: \$name" >&2
3612 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3628 : now set up to get a file name
3632 cat <<'EOSC' >>getfile
3648 : getfile will accept an answer from the comma-separated list
3649 : enclosed in parentheses even if it does not meet other criteria.
3650 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3651 fn=`echo $fn | sed 's/(.*)//'`
3657 loc_file=`expr $fn : '.*:\(.*\)'`
3658 fn=`expr $fn : '\(.*\):.*'`
3666 */*) fullpath=true;;
3675 *e*) exp_file=true;;
3678 *p*) nopath_ok=true;;
3683 *d*) type='Directory';;
3684 *l*) type='Locate';;
3689 Locate) what='File';;
3694 case "$d_portable" in
3702 while test "$type"; do
3707 true) rp="$rp (~name ok)";;
3710 if test -f UU/getfile.ok && \
3711 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3730 value=`UU/filexp $ans`
3733 if test "$ans" != "$value"; then
3734 echo "(That expands to $value on this system.)"
3748 /*) value="$ansexp" ;;
3749 [a-zA-Z]:/*) value="$ansexp" ;;
3754 echo "I shall only accept a full path name, as in /bin/ls." >&4
3755 echo "Use a ! shell escape if you wish to check pathnames." >&4
3758 echo "Please give a full path name, starting with slash." >&4
3761 echo "Note that using ~name is ok provided it expands well." >&4
3774 for fp in $gfpth; do
3775 if test "X$fp" = X.; then
3780 if test -f "$pf"; then
3782 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3784 echo "($value is not a plain file, but that's ok.)"
3787 if test X"$type" = X; then
3794 for fp in $gfpth; do
3795 if test "X$fp" = X.; then
3800 direxp="$fp/$ansexp"
3802 if test -d "$direxp"; then
3810 if test -d "$ansexp"; then
3811 echo "(Looking for $loc_file in directory $value.)"
3812 value="$value/$loc_file"
3813 ansexp="$ansexp/$loc_file"
3815 if test -f "$ansexp"; then
3818 case "$nopath_ok" in
3819 true) case "$value" in
3821 *) echo "Assuming $value will be in people's path."
3837 if test "$fastread" = yes; then
3842 rp="$what $value doesn't exist. Use that name anyway?"
3861 test "X$gfpthkeep" != Xy && gfpth=""
3864 : determine root of directory hierarchy where package will be installed.
3867 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
3870 dflt=`echo "$prefix" | sed 's/.$//'`
3878 By default, $package will be installed in $dflt/bin, manual pages
3879 under $dflt/man, etc..., i.e. with $dflt as prefix for all
3880 installation directories. Typically this is something like /usr/local.
3881 If you wish to have binaries under /usr/bin but other parts of the
3882 installation under /usr/local, that's ok: you will be prompted
3883 separately for each of the installation directories, the prefix being
3884 only used to set the defaults.
3888 rp='Installation prefix to use?'
3896 *) oldprefix="$prefix";;
3903 : allow them to override the AFS root
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";;
4024 : Check is we will use socks
4026 $define|true|[yY]*) dflt='y';;
4031 Perl can be built to use the SOCKS proxy protocol library. To do so,
4032 Configure must be run with -Dusesocks. If you use SOCKS you also need
4033 to use the PerlIO abstraction layer, this will be implicitly selected.
4035 If this doesn't make any sense to you, just accept the default '$dflt'.
4037 rp='Build Perl for SOCKS?'
4040 y|Y) val="$define" ;;
4047 $define|true|[yY]*) useperlio="$define";;
4050 : Check if we want perlio
4051 case "$useperlio" in
4052 $define|true|[yY]*|'') dflt='y';;
4057 Previous version of $package used the standard IO mechanisms as
4058 defined in <stdio.h>. Versions 5.003_02 and later of $package allow
4059 alternate IO mechanisms via the PerlIO abstraction layer, but the
4060 stdio mechanism is still available if needed. The abstraction layer
4061 can use AT&T's sfio (if you already have sfio installed) or regular stdio.
4062 Using PerlIO with sfio may cause problems with some extension modules.
4064 If this doesn't make any sense to you, just accept the default '$dflt'.
4066 rp='Use the PerlIO abstraction layer?'
4073 echo "Ok, doing things the stdio way."
4082 case "$useperlio" in
4083 $define|true|[yY]*) ;;
4086 You are using the SOCKS proxy protocol library which means that you
4087 should also use the PerlIO layer. You may be headed for trouble.
4095 : get the patchlevel
4097 echo "Getting the current patchlevel..." >&4
4098 if $test -r $rsrc/patchlevel.h;then
4099 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
4100 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
4101 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4102 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
4103 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
4104 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4105 perl_patchlevel=`egrep ',"(MAINT|SMOKE)[0-9][0-9]*"' $rsrc/patchlevel.h|tail -1|sed 's/[^0-9]//g'`
4114 $echo "(You do not have patchlevel.h. Eek.)"
4116 if $test -r $rsrc/.patch ; then
4117 if $test "X$perl_patchlevel" = "X" || $test "`cat $rsrc/.patch`" -gt "$perl_patchlevel" ; then
4118 perl_patchlevel=`cat $rsrc/.patch`
4121 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
4122 version_patchlevel_string="version $patchlevel subversion $subversion"
4123 case "$perl_patchlevel" in
4125 *) version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel" ;;
4128 $echo "(You have $package $version_patchlevel_string.)"
4132 : XXX Should be a Configure test for double-dots in filenames.
4133 version=`echo $revision $patchlevel $subversion | \
4134 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4135 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4136 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4139 version=`echo $revision $patchlevel $subversion | \
4140 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4141 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4142 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4145 : Special case the 5.005_xx maintenance series, which used 5.005
4146 : without any subversion label as a subdirectory in $sitelib
4147 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
4148 api_versionstring='5.005'
4151 : Do we want threads support and if so, what type
4152 case "$usethreads" in
4153 $define|true|[yY]*) dflt='y';;
4154 *) # Catch case where user specified ithreads or 5005threads but
4155 # forgot -Dusethreads (A.D. 4/2002)
4156 case "$useithreads$use5005threads" in
4158 case "$useperlio" in
4159 "$define") dflt='y' ;;
4169 Perl can be built to take advantage of threads on some systems.
4170 To do so, Configure can be run with -Dusethreads.
4172 Note that Perl built with threading support runs slightly slower
4173 and uses more memory than plain Perl. The current implementation
4174 is believed to be stable, but it is fairly new, and so should be
4175 treated with caution.
4177 If this doesn't make any sense to you, just accept the default '$dflt'.
4179 rp='Build a threading Perl?'
4182 y|Y) val="$define" ;;
4188 if $test $patchlevel -lt 9; then
4189 case "$usethreads" in
4193 Since release 5.6, Perl has had two different threading implementations,
4194 the newer interpreter-based version (ithreads) with one interpreter per
4195 thread, and the older 5.005 version (5005threads).
4196 The 5005threads version is effectively unmaintained and will probably be
4197 removed in Perl 5.10, so there should be no need to build a Perl using it
4198 unless needed for backwards compatibility with some existing 5.005threads
4202 : Default to ithreads unless overridden on command line or with
4205 case "$use5005threads" in
4206 $define|true|[yY]*) dflt='n';;
4208 case "$useithreads" in
4209 $undef|false|[nN]*) dflt='n';;
4211 rp='Use the newer interpreter-based ithreads?'
4214 y|Y) val="$define" ;;
4219 : Now set use5005threads to the opposite value.
4220 case "$useithreads" in
4221 $define) val="$undef" ;;
4228 useithreads="$undef"
4229 use5005threads="$undef"
4233 case "$useithreads$use5005threads" in
4237 You cannot have both the ithreads and the 5.005 threads enabled
4238 at the same time. Disabling the 5.005 threads since they are
4239 much less stable than the ithreads.
4242 use5005threads="$undef"
4247 : perl-5.9.x and later
4249 if test X"$usethreads" = "X$define"; then
4250 case "$use5005threads" in
4254 5.005 threads has been removed for 5.10. Perl will be built using ithreads.
4261 use5005threads="$undef"
4262 useithreads="$usethreads"
4265 if test X"$usethreads" = "X$define" -a "X$useperlio" = "Xundef"; then
4268 *** To build with ithreads you must also use the PerlIO layer.
4269 *** Cannot continue, aborting.
4275 case "$d_oldpthreads" in
4276 '') : Configure tests would be welcome here. For now, assume undef.
4278 *) val="$d_oldpthreads" ;;
4284 : Look for a hint-file generated 'call-back-unit'. If the
4285 : user has specified that a threading perl is to be built,
4286 : we may need to set or change some other defaults.
4287 if $test -f usethreads.cbu; then
4288 echo "Your platform has some specific hints regarding threaded builds, using them..."
4291 case "$usethreads" in
4292 "$define"|true|[yY]*)
4294 (Your platform does not have any specific hints for threaded builds.
4295 Assuming POSIX threads, then.)
4301 : Check if multiplicity is required
4304 Perl can be built so that multiple Perl interpreters can coexist
4305 within the same Perl executable.
4308 case "$useithreads" in
4311 This multiple interpreter support is required for interpreter-based threads.
4315 *) case "$usemultiplicity" in
4316 $define|true|[yY]*) dflt='y';;
4320 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
4321 rp='Build Perl for multiplicity?'
4324 y|Y) val="$define" ;;
4332 : Check if morebits is requested
4333 case "$usemorebits" in
4334 "$define"|true|[yY]*)
4335 use64bitint="$define"
4336 uselongdouble="$define"
4337 usemorebits="$define"
4339 *) usemorebits="$undef"
4343 : Determine the C compiler to be used
4349 rp="Use which C compiler?"
4353 : See whether they have no cc but they do have gcc
4355 if $test -f cc.cbu; then
4360 : make some quick guesses about what we are up against
4362 $echo $n "Hmm... $c"
4372 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
4373 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
4375 echo "Looks kind of like an OSF/1 system, but we'll see..."
4377 elif test `echo abc | $tr a-z A-Z` = Abc ; then
4378 xxx=`./loc addbib blurfl $pth`
4379 if $test -f $xxx; then
4380 echo "Looks kind of like a USG system with BSD features, but we'll see..."
4384 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
4385 echo "Looks kind of like an extended USG system, but we'll see..."
4387 echo "Looks kind of like a USG system, but we'll see..."
4391 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
4392 echo "Looks kind of like a BSD system, but we'll see..."
4396 echo "Looks kind of like a Version 7 system, but we'll see..."
4399 case "$eunicefix" in
4402 There is, however, a strange, musty smell in the air that reminds me of
4403 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
4407 : it so happens the Eunice I know will not run shell scripts in Unix format
4411 echo "Congratulations. You aren't running Eunice."
4415 : Detect OS2. The p_ variable is set above in the Head.U unit.
4416 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
4417 : semicolon as a patch separator
4422 I have the feeling something is not exactly right, however...don't tell me...
4423 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
4424 (Or you may be running DOS with DJGPP.)
4429 if test -f /xenix; then
4430 echo "Actually, this looks more like a XENIX system..."
4435 echo "It's not Xenix..."
4440 if test -f /venix; then
4441 echo "Actually, this looks more like a VENIX system..."
4448 echo "Nor is it Venix..."
4451 chmod +x bsd usg v7 osf1 eunice xenix venix os2
4452 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
4455 : Check if we are using GNU gcc and what its version is
4457 echo "Checking for GNU cc in disguise and/or its version number..." >&4
4461 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
4463 printf("%s\n", __VERSION__);
4465 printf("%s\n", "1");
4471 if $cc -o try $ccflags $ldflags try.c; then
4472 gccversion=`$run ./try`
4473 case "$gccversion" in
4474 '') echo "You are not using GNU cc." ;;
4475 *) echo "You are using GNU cc $gccversion."
4481 echo "*** WHOA THERE!!! ***" >&4
4482 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
4483 case "$knowitall" in
4485 echo " You'd better start hunting for one and let me know about it." >&4
4491 case "$gccversion" in
4492 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
4494 case "$gccversion" in
4495 '') gccosandvers='' ;;
4496 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
4497 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
4499 case "$gccosandvers" in
4500 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
4501 $osname$osvers) ;; # looking good
4502 $osname*) cat <<EOM >&4
4504 *** WHOA THERE!!! ***
4506 Your gcc has not been compiled for the exact release of
4507 your operating system ($gccosandvers versus $osname$osvers).
4509 In general it is a good idea to keep gcc synchronized with
4510 the operating system because otherwise serious problems
4511 may ensue when trying to compile software, like Perl.
4513 I'm trying to be optimistic here, though, and will continue.
4514 If later during the configuration and build icky compilation
4515 problems appear (headerfile conflicts being the most common
4516 manifestation), I suggest reinstalling the gcc to match
4517 your operating system release.
4521 *) gccosandvers='' ;; # failed to parse, better be silent
4529 # gcc 3.* complain about adding -Idirectories that they already know about,
4530 # so we will take those off from locincpth.
4531 case "$gccversion" in
4533 echo "main(){}">try.c
4534 for incdir in $locincpth; do
4535 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
4536 grep '^c[cp]p*[01]: warning: changing search order '`
4537 if test "X$warn" != X; then
4538 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
4544 : What should the include directory be ?
4546 $echo $n "Hmm... $c"
4550 if $test -f /bin/mips && /bin/mips; then
4551 echo "Looks like a MIPS system..."
4552 $cat >usr.c <<'EOCP'
4553 #ifdef SYSTYPE_BSD43
4557 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4558 dflt='/bsd43/usr/include'
4562 mips_type='System V'
4564 $rm -f usr.c usr.out
4565 echo "and you're compiling with the $mips_type compiler and libraries."
4569 echo "Doesn't look like a MIPS system."
4579 case "$xxx_prompt" in
4582 rp='Where are the include files you want to use?'
4590 : see how we invoke the C preprocessor
4592 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4593 cat <<'EOT' >testcpp.c
4599 if test ! -f cppstdin; then
4600 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4601 # AIX cc -E doesn't show the absolute headerfile
4602 # locations but we'll cheat by using the -M flag.
4603 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
4605 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4608 echo "Keeping your $hint cppstdin wrapper."
4611 wrapper=`pwd`/cppstdin
4615 if $test "X$cppstdin" != "X" && \
4616 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4617 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4619 echo "You used to use $cppstdin $cppminus so we'll use that again."
4621 '') echo "But let's see if we can live without a wrapper..." ;;
4623 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4624 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4626 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4629 echo "(However, $cpprun $cpplast does not work, let's see...)"
4637 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4644 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4645 $cc -E <testcpp.c >testcpp.out 2>&1; \
4646 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4647 echo "Yup, it does."
4650 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4651 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4652 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4653 echo "Yup, it does."
4656 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4657 $cc -P <testcpp.c >testcpp.out 2>&1; \
4658 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4659 echo "Yipee, that works!"
4662 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4663 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4664 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4665 echo "At long last!"
4668 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4669 $cpp <testcpp.c >testcpp.out 2>&1; \
4670 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4674 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4675 $cpp - <testcpp.c >testcpp.out 2>&1; \
4676 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4677 echo "Hooray, it works! I was beginning to wonder."
4680 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4681 $wrapper <testcpp.c >testcpp.out 2>&1; \
4682 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4688 rp="No dice. I can't find a C preprocessor. Name one:"
4692 $x_cpp <testcpp.c >testcpp.out 2>&1
4693 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4694 echo "OK, that will do." >&4
4696 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4711 echo "Perhaps can we force $cc -E using a wrapper..."
4712 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4713 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4719 echo "Nope, we'll have to live without it..."
4733 "$wrapper"|'cppstdin') ;;
4734 *) $rm -f $wrapper;;
4736 $rm -f testcpp.c testcpp.out
4738 : Set private lib path
4741 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4746 '') dlist="$loclibpth $plibpth $glibpth";;
4747 *) dlist="$libpth";;
4750 : Now check and see which directories actually exist, avoiding duplicates
4754 if $test -d $xxx; then
4757 *) libpth="$libpth $xxx";;
4763 Some systems have incompatible or broken versions of libraries. Among
4764 the directories listed in the question below, please remove any you
4765 know not to be holding relevant libraries, and add any that are needed.
4766 Say "none" for none.
4777 rp="Directories to use for library searches?"
4784 : compute shared library extension
4787 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4797 On some systems, shared libraries may be available. Answer 'none' if
4798 you want to suppress searching of shared libraries for the remainder
4799 of this configuration.
4802 rp='What is the file extension used for shared libraries?'
4806 : Define several unixisms.
4807 : Hints files or command line option can be used to override them.
4808 : The convoluted testing is in case hints files set either the old
4811 '') case "$exe_ext" in
4813 *) _exe="$exe_ext" ;;
4818 '') case "$lib_ext" in
4825 '') case "$obj_ext" in
4832 '') case "$path_sep" in
4843 rm_try="$rm -f try try$_exe a.out .out try.[cho] try.$_o core core.try* try.core*"
4845 : Which makefile gets called first. This is used by make depend.
4846 case "$firstmakefile" in
4847 '') firstmakefile='makefile';;
4850 : Check for uselongdouble support
4852 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
4855 case "$uselongdouble" in
4856 $define|true|[yY]*) dflt='y';;
4861 Perl can be built to take advantage of long doubles which
4862 (if available) may give more accuracy and range for floating point numbers.
4864 If this doesn't make any sense to you, just accept the default '$dflt'.
4866 rp='Try to use long doubles if available?'
4869 y|Y) val="$define" ;;
4875 case "$uselongdouble" in
4876 true|[yY]*) uselongdouble="$define" ;;
4879 : Look for a hint-file generated 'call-back-unit'. If the
4880 : user has specified that long doubles should be used,
4881 : we may need to set or change some other defaults.
4882 if $test -f uselongdouble.cbu; then
4883 echo "Your platform has some specific hints regarding long doubles, using them..."
4884 . ./uselongdouble.cbu
4886 case "$uselongdouble" in
4889 (Your platform does not have any specific hints for long doubles.)
4895 : Looking for optional libraries
4897 echo "Checking for optional libraries..." >&4
4902 case "$libswanted" in
4903 '') libswanted='c_s';;
4906 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
4912 for thisdir in $libpth $xlibpth; do
4913 test -d $thisdir && libspath="$libspath $thisdir"
4915 for thislib in $libswanted; do
4916 for thisdir in $libspath; do
4918 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4919 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
4920 $test -f "$xxx" && eval $libscheck
4921 $test -f "$xxx" && libstyle=shared
4923 if test ! -f "$xxx"; then
4924 xxx=$thisdir/lib$thislib.$so
4925 $test -f "$xxx" && eval $libscheck
4926 $test -f "$xxx" && libstyle=shared
4928 if test ! -f "$xxx"; then
4929 xxx=$thisdir/lib$thislib$_a
4930 $test -f "$xxx" && eval $libscheck
4931 $test -f "$xxx" && libstyle=static
4933 if test ! -f "$xxx"; then
4934 xxx=$thisdir/$thislib$_a
4935 $test -f "$xxx" && eval $libscheck
4936 $test -f "$xxx" && libstyle=static
4938 if test ! -f "$xxx"; then
4939 xxx=$thisdir/lib${thislib}_s$_a
4940 $test -f "$xxx" && eval $libscheck
4941 $test -f "$xxx" && libstyle=static
4942 $test -f "$xxx" && thislib=${thislib}_s
4944 if test ! -f "$xxx"; then
4945 xxx=$thisdir/Slib$thislib$_a
4946 $test -f "$xxx" && eval $libscheck
4947 $test -f "$xxx" && libstyle=static
4949 if $test -f "$xxx"; then
4951 shared) echo "Found -l$thislib (shared)." ;;
4952 static) echo "Found -l$thislib." ;;
4953 *) echo "Found -l$thislib ($libstyle)." ;;
4957 *) dflt="$dflt -l$thislib"
4958 libsfound="$libsfound $xxx"
4960 libsfiles="$libsfiles $yyy"
4961 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
4962 case " $libsdirs " in
4964 *) libsdirs="$libsdirs $yyy" ;;
4971 if $test ! -f "$xxx"; then
4972 echo "No -l$thislib."
4983 ' '|'') dflt='none';;
4988 In order to compile $package on your machine, a number of libraries
4989 are usually needed. Include any other special libraries here as well.
4990 Say "none" for none. The default list is almost always right.
4994 rp="What libraries to use?"
5001 : determine optimization, if desired, or use for debug flag also
5003 ' '|$undef) dflt='none';;
5005 *) dflt="$optimize";;
5009 By default, $package compiles with the -O flag to use the optimizer.
5010 Alternately, you might want to use the symbolic debugger, which uses
5011 the -g flag (on traditional Unix systems). Either flag can be
5012 specified here. To use neither flag, specify the word "none".
5015 rp="What optimizer/debugger flag should be used?"
5019 'none') optimize=" ";;
5022 : Check what DEBUGGING is required from the command line
5023 : -DEBUGGING or -DDEBUGGING or
5024 : -DEBUGGING=both = -g + -DDEBUGGING
5025 : -DEBUGGING=-g or -Doptimize=-g = -g
5026 : -DEBUGGING=none or -UDEBUGGING =
5027 : -DEBUGGING=old or -DEBUGGING=default = ? $optimize
5030 *) DEBUGGING=$EBUGGING ;;
5033 case "$DEBUGGING" in
5037 *) optimize="$optimize -g" ;;
5041 *-g*) set `echo "X $optimize " | sed 's/ -g / /'`
5049 case "$DEBUGGING" in
5050 both|$define) dflt='-DDEBUGGING'
5053 : argument order is deliberate, as the flag will start with - which set could
5054 : think is an option
5055 checkccflag='check=$1; flag=$2; callback=$3;
5057 echo "Checking if your compiler accepts $flag" 2>&1;
5058 echo "int main(void) { return 0; }" > gcctest.c;
5059 if $cc -O2 $flag -o gcctest gcctest.c 2>gcctest.out && ./gcctest; then
5060 echo "Yes, it does." 2>&1;
5061 if $test -s gcctest.out ; then
5062 echo "But your platform does not like it:";
5067 echo "Leaving current flags $ccflags alone." 2>&1
5069 *) dflt="$dflt $flag";
5075 echo "Nope, it does not, but that is ok." 2>&1;
5079 : We will not override a previous value, but we might want to
5080 : augment a hint file
5082 default|recommended)
5083 case "$gccversion" in
5084 1*) dflt="$dflt -fpcc-struct-return" ;;
5086 case "$optimize:$DEBUGGING" in
5087 *-g*:old) dflt="$dflt -DDEBUGGING";;
5089 case "$gccversion" in
5090 2*) if $test -d /etc/conf/kconfig.d &&
5091 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
5093 # Interactive Systems (ISC) POSIX mode.
5098 case "$gccversion" in
5101 ?*) set strict-aliasing -fno-strict-aliasing
5105 # For gcc, adding -pipe speeds up compilations for some, but apparently
5106 # some assemblers can't read from stdin. (It also slows down compilations
5107 # in other cases, but those are apparently rarer these days.) AD 5/2004.
5108 case "$gccversion" in
5114 # on x86_64 (at least) we require an extra library (libssp) in the
5115 # link command line. This library is not named, so I infer that it is
5116 # an implementation detail that may change. Hence the safest approach
5117 # is to add the flag to the flags passed to the compiler at link time,
5118 # as that way the compiler can do the right implementation dependant
5120 case "$gccversion" in
5121 ?*) set stack-protector -fstack-protector 'ldflags="$ldflags -fstack-protector"'
5128 case "$mips_type" in
5129 *BSD*|'') inclwanted="$locincpth $usrinc";;
5130 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
5132 for thisincl in $inclwanted; do
5133 if $test -d $thisincl; then
5134 if $test x$thisincl != x$usrinc; then
5136 *" -I$thisincl "*);;
5137 *) dflt="$dflt -I$thisincl ";;
5143 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
5145 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
5153 *) dflt="$dflt -D$2";;
5157 set signal.h LANGUAGE_C; eval $inctest
5161 ccflags="$ccflags -DSOCKS"
5166 default|recommended) dflt="$ccflags $dflt" ;;
5167 *) dflt="$ccflags";;
5176 Your C compiler may want other flags. For this question you should include
5177 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
5178 but you should NOT include libraries or ld flags like -lwhatever. If you
5179 want $package to honor its debug switch, you should include -DDEBUGGING here.
5180 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
5182 To use no flags, specify the word "none".
5188 rp="Any additional cc flags?"
5195 : the following weeds options from ccflags that are of no interest to cpp
5197 '') cppflags="$ccflags" ;;
5198 *) cppflags="$cppflags $ccflags" ;;
5200 case "$gccversion" in
5201 1*) cppflags="$cppflags -D__GNUC__"
5203 case "$mips_type" in
5205 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
5211 echo "Let me guess what the preprocessor flags are..." >&4
5225 *) ftry="$previous $flag";;
5227 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
5228 >cpp1.out 2>/dev/null && \
5229 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
5230 >cpp2.out 2>/dev/null && \
5231 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
5232 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
5234 cppflags="$cppflags $ftry"
5244 *-*) echo "They appear to be: $cppflags";;
5246 $rm -f cpp.c cpp?.out
5250 : flags used in final linking phase
5252 '') if ./venix; then
5258 *-posix*) dflt="$dflt -posix" ;;
5261 *) dflt="$ldflags";;
5264 : Try to guess additional flags to pick up local libraries.
5265 for thislibdir in $libpth; do
5266 case " $loclibpth " in
5269 *"-L$thislibdir "*) ;;
5270 *) dflt="$dflt -L$thislibdir" ;;
5282 Your C linker may need flags. For this question you should
5283 include -L/whatever and any other flags used by the C linker, but you
5284 should NOT include libraries like -lwhatever.
5286 Make sure you include the appropriate -L/path flags if your C linker
5287 does not normally search all of the directories you specified above,
5290 To use no flags, specify the word "none".
5294 rp="Any additional ld flags (NOT including libraries)?"
5300 rmlist="$rmlist pdp11"
5304 echo "Checking your choice of C compiler and flags for coherency..." >&4
5305 $cat > try.c <<'EOF'
5307 int main() { printf("Ok\n"); return(0); }
5309 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
5311 $cat >try.msg <<'EOM'
5312 I've tried to compile and run the following simple program:
5315 $cat try.c >> try.msg
5317 $cat >> try.msg <<EOM
5324 and I got the following output:
5328 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5329 if $sh -c "$run ./try " >>try.msg 2>&1; then
5333 *) echo 'The program compiled OK, but produced no output.' >> try.msg
5336 cat >> try.msg <<'EOQS'
5337 If $libs contains -lsfio, and sfio is mis-configured, then it
5338 sometimes (apparently) runs and exits with a 0 status, but with no
5339 output! It may have to do with sfio's use of _exit vs. exit.
5342 rp="You have a big problem. Shall I abort Configure"
5349 echo "The program compiled OK, but exited with status $?." >>try.msg
5350 rp="You have a problem. Shall I abort Configure"
5354 echo "I can't compile the test program." >>try.msg
5355 rp="You have a BIG problem. Shall I abort Configure"
5361 case "$knowitall" in
5363 echo "(The supplied flags or libraries might be incorrect.)"
5371 *) echo "Ok. Stopping Configure." >&4
5376 n) echo "OK, that should do.";;
5378 $rm_try gcctest gcctest.out
5380 : define a shorthand compile call
5384 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5385 : define a shorthand compile call for compilations that should be ok.
5389 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5391 : determine filename position in cpp output
5393 echo "Computing filename position in cpp output for #include directives..." >&4
5395 vos) testaccess=-e ;;
5398 echo '#include <stdio.h>' > foo.c
5401 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5402 $grep '^[ ]*#.*stdio\.h' | \
5403 while read cline; do
5406 while $test \$# -gt 0; do
5407 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5412 pos=\`expr \$pos + 1\`
5424 *) pos="${fieldn}th";;
5426 echo "Your cpp writes the filename in the $pos field of the line."
5429 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
5430 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
5433 : locate header file
5438 for usrincdir in $usrinc
5440 if test -f \$usrincdir/\$wanted; then
5441 echo "\$usrincdir/\$wanted"
5445 awkprg='{ print \$$fieldn }'
5446 echo "#include <\$wanted>" > foo\$\$.c
5447 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5448 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5449 while read cline; do
5450 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5452 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5453 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5458 # status = 0: grep returned 0 lines, case statement not executed
5459 # status = 1: headerfile found
5460 # status = 2: while loop executed, no headerfile found
5464 if test \$status -eq 1; then
5471 : define an alternate in-header-list? function
5472 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5473 cont=true; xxf="echo \"<\$1> found.\" >&4";
5474 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5475 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5477 case $# in 4) instead=instead;; *) instead="at last";; esac;
5478 while $test "$cont"; do
5480 var=$2; eval "was=\$$2";
5481 if $test "$xxx" && $test -r "$xxx";
5483 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5486 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5487 set $yyy; shift; shift; yyy=$@;
5488 case $# in 0) cont="";;
5489 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5490 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5491 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5492 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5496 do set $yyy; var=$2; eval "was=\$$2";
5497 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5498 set $yyy; shift; shift; yyy=$@;
5501 : see if stdlib is available
5502 set stdlib.h i_stdlib
5505 : check for lengths of integral types
5509 echo "Checking to see how big your integers are..." >&4
5518 printf("intsize=%d;\n", (int)sizeof(int));
5519 printf("longsize=%d;\n", (int)sizeof(long));
5520 printf("shortsize=%d;\n", (int)sizeof(short));
5525 if eval $compile_ok && $run ./try > /dev/null; then
5527 echo "Your integers are $intsize bytes long."
5528 echo "Your long integers are $longsize bytes long."
5529 echo "Your short integers are $shortsize bytes long."
5533 Help! I can't compile and run the intsize test program: please enlighten me!
5534 (This is probably a misconfiguration in your system or libraries, and
5535 you really ought to fix it. Still, I'll try anyway.)
5539 rp="What is the size of an integer (in bytes)?"
5543 rp="What is the size of a long integer (in bytes)?"
5547 rp="What is the size of a short integer (in bytes)?"
5555 : check for long long
5557 echo "Checking to see if you have long long..." >&4
5558 echo 'int main() { long long x = 7; return 0; }' > try.c
5560 if eval $compile; then
5562 echo "You have long long."
5565 echo "You do not have long long."
5571 : check for length of long long
5572 case "${d_longlong}${longlongsize}" in
5575 echo "Checking to see how big your long longs are..." >&4
5576 $cat >try.c <<'EOCP'
5580 printf("%d\n", (int)sizeof(long long));
5585 if eval $compile_ok; then
5586 longlongsize=`$run ./try`
5587 echo "Your long longs are $longlongsize bytes long."
5591 echo "(I can't seem to compile the test program. Guessing...)"
5592 rp="What is the size of a long long (in bytes)?"
5596 if $test "X$longsize" = "X$longlongsize"; then
5597 echo "(That isn't any different from an ordinary long.)"
5603 : see if inttypes.h is available
5604 : we want a real compile instead of Inhdr because some systems
5605 : have an inttypes.h which includes non-existent headers
5608 #include <inttypes.h>
5610 static int32_t foo32 = 0x12345678;
5614 if eval $compile; then
5615 echo "<inttypes.h> found." >&4
5618 echo "<inttypes.h> NOT found." >&4
5627 echo "Checking to see if you have int64_t..." >&4
5629 #include <sys/types.h>
5630 #$i_inttypes I_INTTYPES
5632 #include <inttypes.h>
5634 int main() { int64_t x = 7; }
5637 if eval $compile; then
5639 echo "You have int64_t."
5642 echo "You do not have int64_t."
5648 : Check if 64bit ints have a quad type
5650 echo "Checking which 64-bit integer type we could use..." >&4
5656 val='"unsigned int"'
5661 *) case "$longsize" in
5665 val='"unsigned long"'
5670 *) case "$d_longlong:$longlongsize" in
5675 val='"unsigned long long"'
5680 *) case "$d_int64_t" in
5699 '') echo "Alas, no 64-bit integer types in sight." >&4
5702 *) echo "We could use '$quadtype' for 64-bit integers." >&4
5707 : Do we want 64bit support
5708 case "$uselonglong" in
5709 "$define"|true|[yY]*)
5712 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
5714 use64bitint="$define"
5717 case "$use64bits" in
5718 "$define"|true|[yY]*)
5721 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
5723 use64bitint="$define"
5726 case "$use64bitints" in
5727 "$define"|true|[yY]*)
5730 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
5732 use64bitint="$define"
5735 case "$use64bitsint" in
5736 "$define"|true|[yY]*)
5739 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
5741 use64bitint="$define"
5744 case "$uselonglongs" in
5745 "$define"|true|[yY]*)
5748 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
5750 use64bitint="$define"
5753 case "$use64bitsall" in
5754 "$define"|true|[yY]*)
5757 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
5759 use64bitall="$define"
5764 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
5766 case "$use64bitall" in
5767 "$define"|true|[yY]*) use64bitint="$define" ;;
5773 You have natively 64-bit long integers.
5777 *) case "$use64bitint" in
5778 "$define"|true|[yY]*) dflt='y';;
5787 Perl can be built to take advantage of 64-bit integer types
5788 on some systems. To do so, Configure can be run with -Duse64bitint.
5789 Choosing this option will most probably introduce binary incompatibilities.
5791 If this doesn't make any sense to you, just accept the default '$dflt'.
5792 (The default has been chosen based on your configuration.)
5794 rp='Try to use 64-bit integers, if available?'
5797 [yY]*) val="$define" ;;
5805 case "$use64bitall" in
5806 "$define"|true|[yY]*) dflt='y' ;;
5807 *) case "$longsize" in
5815 You may also choose to try maximal 64-bitness. It means using as much
5816 64-bitness as possible on the platform. This in turn means even more
5817 binary incompatibilities. On the other hand, your platform may not
5818 have any more 64-bitness available than what you already have chosen.
5820 If this doesn't make any sense to you, just accept the default '$dflt'.
5821 (The default has been chosen based on your configuration.)
5823 rp='Try to use maximal 64-bit support, if available?'
5826 [yY]*) val="$define" ;;
5831 case "$use64bitall" in
5833 case "$use64bitint" in
5837 Since you have chosen a maximally 64-bit build, I'm also turning on
5838 the use of 64-bit integers.
5840 use64bitint="$define" ;;
5845 : Look for a hint-file generated 'call-back-unit'. If the
5846 : user has specified that a 64-bit perl is to be built,
5847 : we may need to set or change some other defaults.
5848 if $test -f use64bitint.cbu; then
5849 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
5852 case "$use64bitint" in
5853 "$define"|true|[yY]*)
5855 4) case "$archname64" in
5856 '') archname64=64int ;;
5863 : Look for a hint-file generated 'call-back-unit'. If the
5864 : user has specified that a maximally 64-bit perl is to be built,
5865 : we may need to set or change some other defaults.
5866 if $test -f use64bitall.cbu; then
5867 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
5870 case "$use64bitall" in
5871 "$define"|true|[yY]*)
5873 4) case "$archname64" in
5874 ''|64int) archname64=64all ;;
5881 case "$d_quad:$use64bitint" in
5885 *** You have chosen to use 64-bit integers,
5886 *** but none can be found.
5887 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
5888 *** Cannot continue, aborting.
5895 : check for length of double
5897 case "$doublesize" in
5899 echo "Checking to see how big your double precision numbers are..." >&4
5908 printf("%d\n", (int)sizeof(double));
5913 if eval $compile_ok; then
5914 doublesize=`$run ./try`
5915 echo "Your double is $doublesize bytes long."
5918 echo "(I can't seem to compile the test program. Guessing...)"
5919 rp="What is the size of a double precision number (in bytes)?"
5927 : check for long doubles
5929 echo "Checking to see if you have long double..." >&4
5930 echo 'int main() { long double x = 7.0; }' > try.c
5932 if eval $compile; then
5934 echo "You have long double."
5937 echo "You do not have long double."
5943 : check for length of long double
5944 case "${d_longdbl}${longdblsize}" in
5947 echo "Checking to see how big your long doubles are..." >&4
5948 $cat >try.c <<'EOCP'
5952 printf("%d\n", sizeof(long double));
5957 if eval $compile; then
5958 longdblsize=`$run ./try`
5959 echo "Your long doubles are $longdblsize bytes long."
5963 echo "(I can't seem to compile the test program. Guessing...)" >&4
5964 rp="What is the size of a long double (in bytes)?"
5968 if $test "X$doublesize" = "X$longdblsize"; then
5969 echo "That isn't any different from an ordinary double."
5970 echo "I'll keep your setting anyway, but you may see some"
5971 echo "harmless compilation warnings."
5977 : determine the architecture name
5979 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
5980 tarch=`arch`"-$osname"
5981 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
5982 if uname -m > tmparch 2>&1 ; then
5983 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
5984 -e 's/$/'"-$osname/" tmparch`
5992 case "$myarchname" in
5995 echo "(Your architecture name used to be $myarchname.)"
5999 case "$targetarch" in
6001 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
6006 *) dflt="$archname";;
6008 rp='What is your architecture name'
6011 case "$usethreads" in
6013 echo "Threads selected." >&4
6015 *-thread*) echo "...and architecture name already has -thread." >&4
6017 *) archname="$archname-thread"
6018 echo "...setting architecture name to $archname." >&4
6023 case "$usemultiplicity" in
6025 echo "Multiplicity selected." >&4
6027 *-multi*) echo "...and architecture name already has -multi." >&4
6029 *) archname="$archname-multi"
6030 echo "...setting architecture name to $archname." >&4
6035 case "$use64bitint$use64bitall" in
6037 case "$archname64" in
6039 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
6042 case "$use64bitint" in
6043 "$define") echo "64 bit integers selected." >&4 ;;
6045 case "$use64bitall" in
6046 "$define") echo "Maximal 64 bitness selected." >&4 ;;
6049 *-$archname64*) echo "...and architecture name already has $archname64." >&4
6051 *) archname="$archname-$archname64"
6052 echo "...setting architecture name to $archname." >&4
6058 case "$uselongdouble" in
6060 echo "Long doubles selected." >&4
6061 case "$longdblsize" in
6063 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
6067 *-ld*) echo "...and architecture name already has -ld." >&4
6069 *) archname="$archname-ld"
6070 echo "...setting architecture name to $archname." >&4
6077 case "$useperlio" in
6079 echo "Perlio selected." >&4
6082 echo "Perlio not selected, using stdio." >&4
6084 *-stdio*) echo "...and architecture name already has -stdio." >&4
6086 *) archname="$archname-stdio"
6087 echo "...setting architecture name to $archname." >&4
6092 if $test -f archname.cbu; then
6093 echo "Your platform has some specific hints for architecture name, using them..."
6097 : set the prefixit variable, to compute a suitable default value
6098 prefixit='case "$3" in
6100 case "$oldprefix" in
6101 "") eval "$1=\"\$$2\"";;
6108 ""|" ") eval "$1=\"\$$2\"";;
6114 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
6116 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
6117 /*-$oldprefix/*|\~*-$oldprefix/*)
6118 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
6119 *) eval "$1=\"\$$2\"";;
6123 : determine installation style
6124 : For now, try to deduce it from prefix unless it is already set.
6125 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
6126 case "$installstyle" in
6127 '') case "$prefix" in
6128 *perl*) dflt='lib';;
6129 *) dflt='lib/perl5' ;;
6132 *) dflt="$installstyle" ;;
6134 : Probably not worth prompting for this since we prompt for all
6135 : the directories individually, and the prompt would be too long and
6139 : determine where public executables go
6144 rp='Pathname where the public executables will reside?'
6146 if $test "X$ansexp" != "X$binexp"; then
6150 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
6151 : XXX If this is fixed, also fix the "start perl" hunk below, which relies on
6152 : this via initialinstalllocation
6155 case "$userelocatableinc" in
6156 $define|true|[yY]*) dflt='y' ;;
6161 Would you like to build Perl so that the installation is relocatable, so that
6162 library paths in @INC are determined relative to the path of the perl binary?
6163 This is not advised for system Perl installs, or if you need to run setid
6164 scripts or scripts under taint mode.
6166 If this doesn't make any sense to you, just accept the default '$dflt'.
6168 rp='Use relocatable @INC?'
6171 y|Y) val="$define" ;;
6174 set userelocatableinc
6177 initialinstalllocation="$binexp"
6178 : Default prefix is now "up one level from where the binaries are"
6179 case "$userelocatableinc" in
6185 installprefixexp=".../.."
6189 : determine where private library files go
6190 : Usual default is /usr/local/lib/perl5/$version.
6191 : Also allow things like /opt/perl/lib/$version, since
6192 : /opt/perl/lib/perl5... would be redundant.
6193 : The default "style" setting is made in installstyle.U
6194 case "$installstyle" in
6195 *lib/perl5*) set dflt privlib lib/$package/$version ;;
6196 *) set dflt privlib lib/$version ;;
6201 There are some auxiliary files for $package that need to be put into a
6202 private library directory that is accessible by everyone.
6207 rp='Pathname where the private library files will reside?'
6212 : set the prefixup variable, to restore leading tilda escape
6213 prefixup='case "$prefixexp" in
6215 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
6218 : determine where public architecture dependent libraries go
6221 : privlib default is /usr/local/lib/$package/$version
6222 : archlib default is /usr/local/lib/$package/$version/$archname
6223 : privlib may have an optional trailing /share.
6224 tdflt=`echo $privlib | $sed 's,/share$,,'`
6225 tdflt=$tdflt/$archname
6234 $spackage contains architecture-dependent library files. If you are
6235 sharing libraries in a heterogeneous environment, you might store
6236 these files in a separate location. Otherwise, you can just include
6237 them with the rest of the public library files.
6242 rp='Where do you want to put the public architecture-dependent libraries?'
6246 if $test X"$archlib" = X"$privlib"; then
6252 : see if setuid scripts can be secure
6255 Some kernels have a bug that prevents setuid #! scripts from being
6256 secure. Some sites have disabled setuid #! scripts because of this.
6258 First let's decide if your kernel supports secure setuid #! scripts.
6259 (If setuid #! scripts would be secure but have been disabled anyway,
6260 don't say that they are secure if asked.)
6265 if $test -d /dev/fd; then
6266 echo "#!$ls" >reflect
6267 chmod +x,u+s reflect
6268 ./reflect >flect 2>&1
6269 if $contains "/dev/fd" flect >/dev/null; then
6270 echo "Congratulations, your kernel has secure setuid scripts!" >&4
6274 If you are not sure if they are secure, I can check but I'll need a
6275 username and password different from the one you are using right now.
6276 If you don't have such a username or don't want me to test, simply
6280 rp='Other username to test security of setuid scripts with?'
6285 case "$d_suidsafe" in
6286 '') echo "I'll assume setuid scripts are *not* secure." >&4
6289 echo "Well, the $hint value is *not* secure." >&4
6291 *) echo "Well, the $hint value *is* secure." >&4
6296 $rm -f reflect flect
6297 echo "#!$ls" >reflect
6298 chmod +x,u+s reflect
6301 echo '"su" will (probably) prompt you for '"$ans's password."
6302 su $ans -c './reflect >flect'
6303 if $contains "/dev/fd" flect >/dev/null; then
6304 echo "Okay, it looks like setuid scripts are secure." >&4
6307 echo "I don't think setuid scripts are secure." >&4
6312 rp='Does your kernel have *secure* setuid scripts?'
6315 [yY]*) val="$define";;
6320 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
6321 echo "(That's for file descriptors, not floppy disks.)"
6327 $rm -f reflect flect
6329 : now see if they want to do setuid emulation
6332 case "$d_suidsafe" in
6335 echo "No need to emulate SUID scripts since they are secure here." >&4
6339 Some systems have disabled setuid scripts, especially systems where
6340 setuid scripts cannot be secure. On systems where setuid scripts have
6341 been disabled, the setuid/setgid bits on scripts are currently
6342 useless. It is possible for $package to detect those bits and emulate
6343 setuid/setgid in a secure fashion. This emulation will only work if
6344 setuid scripts have been disabled in your kernel.
6348 "$define") dflt=y ;;
6351 rp="Do you want to do setuid/setgid emulation?"
6354 [yY]*) val="$define";;
6362 : Find perl5.005 or later.
6363 echo "Looking for a previously installed perl5.005 or later... "
6365 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
6366 : Check if this perl is recent and can load a simple module
6367 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6370 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6380 '') echo "None found. That's ok.";;
6381 *) echo "Using $perl5." ;;
6384 : Set the siteprefix variables
6387 After $package is installed, you may wish to install various
6388 add-on modules and utilities. Typically, these add-ons will
6389 be installed under $prefix with the rest
6390 of this package. However, you may wish to install such add-ons
6391 elsewhere under a different prefix.
6393 If you do not wish to put everything under a single prefix, that's
6394 ok. You will be prompted for the individual locations; this siteprefix
6395 is only used to suggest the defaults.
6397 The default should be fine for most people.
6401 rp='Installation prefix to use for add-on modules and utilities?'
6402 : XXX Here might be another good place for an installstyle setting.
6403 case "$siteprefix" in
6405 *) dflt=$siteprefix ;;
6408 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6410 case "$siteprefix" in
6414 *) oldsiteprefix="$prefix";;
6419 siteprefixexp="$ansexp"
6421 : determine where site specific libraries go.
6422 : Usual default is /usr/local/lib/perl5/site_perl/$version
6423 : The default "style" setting is made in installstyle.U
6424 : XXX No longer works with Prefixit stuff.
6425 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6427 '') case "$installstyle" in
6428 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
6429 *) dflt=$siteprefix/lib/site_$prog/$version ;;
6437 The installation process will create a directory for
6438 site-specific extensions and modules. Most users find it convenient
6439 to place all site-specific files in this directory rather than in the
6440 main distribution directory.
6444 rp='Pathname for the site-specific library files?'
6448 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6450 : Determine list of previous versions to include in @INC
6451 $cat > getverlist <<EOPL
6454 \$api_versionstring = "$api_versionstring";
6455 \$version = "$version";
6456 \$stem = "$sitelib_stem";
6457 \$archname = "$archname";
6459 $cat >> getverlist <<'EOPL'
6460 # The list found is store twice for each entry: the original name, and
6461 # the binary broken down version as pack "sss", so sorting is easy and
6462 # unambiguous. This will work for all versions that have a maximum of
6463 # three digit groups, separate by '.'s or '_'s. Names are extended with
6464 # ".0.0" to ensure at least three elements for the pack.
6465 # -- H.Merijn Brand (m)'06 23-10-2006
6467 # Can't have leading @ because metaconfig interprets it as a command!
6468 ;@inc_version_list=();
6469 # XXX Redo to do opendir/readdir?
6472 ;@candidates = map {
6473 [ $_, pack "sss", split m/[._]/, "$_.0.0" ] } glob("5.*");
6479 ($pversion, $aversion, $vsn5005) = map {
6480 pack "sss", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005";
6481 foreach $d (@candidates) {
6482 if ($d->[1] lt $pversion) {
6483 if ($d->[1] ge $aversion) {
6484 unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]);
6486 elsif ($d->[1] ge $vsn5005) {
6487 unshift(@inc_version_list, grep { -d } $d->[0]);
6491 # Skip newer version. I.e. don't look in
6492 # 5.7.0 if we're installing 5.6.1.
6496 if (@inc_version_list) {
6497 print join(' ', @inc_version_list);
6500 # Blank space to preserve value for next Configure run.
6505 case "$inc_version_list" in
6506 '') if test -x "$perl5$exe_ext"; then
6507 dflt=`$perl5 getverlist`
6512 $undef) dflt='none' ;;
6513 *) eval dflt=\"$inc_version_list\" ;;
6516 ''|' ') dflt=none ;;
6523 In order to ease the process of upgrading, this version of perl
6524 can be configured to use modules built and installed with earlier
6525 versions of perl that were installed under $prefix. Specify here
6526 the list of earlier versions that this version of perl should check.
6527 If Configure detected no earlier versions of perl installed under
6528 $prefix, then the list will be empty. Answer 'none' to tell perl
6529 to not search earlier versions.
6531 The default should almost always be sensible, so if you're not sure,
6532 just accept the default.
6535 rp='List of earlier versions to include in @INC?'
6538 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
6539 *) inc_version_list="$ans" ;;
6541 case "$inc_version_list" in
6543 inc_version_list_init='0'
6544 d_inc_version_list="$undef"
6546 *) inc_version_list_init=`echo $inc_version_list |
6547 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
6548 d_inc_version_list="$define"
6553 : see if this is a malloc.h system
6554 : we want a real compile instead of Inhdr because some systems have a
6555 : malloc.h that just gives a compile error saying to use stdlib.h instead
6560 int main () { return 0; }
6563 if eval $compile; then
6564 echo "<malloc.h> found." >&4
6567 echo "<malloc.h> NOT found." >&4
6574 : check for void type
6576 echo "Checking to see how well your C compiler groks the void type..." >&4
6577 case "$voidflags" in
6589 extern void moo(); /* function returning void */
6590 void (*goo)(); /* ptr to func returning void */
6592 void *hue; /* generic ptr */
6605 int main() { sub(); }
6607 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
6608 voidflags=$defvoidused
6609 echo "Good. It appears to support void to the level $package wants.">&4
6610 if $contains warning .out >/dev/null 2>&1; then
6611 echo "However, you might get some warnings that look like this:"
6615 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
6616 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
6617 echo "It supports 1..."
6618 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
6619 echo "It also supports 2..."
6620 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
6622 echo "And it supports 4 but not 8 definitely."
6624 echo "It doesn't support 4..."
6625 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
6627 echo "But it supports 8."
6630 echo "Neither does it support 8."
6634 echo "It does not support 2..."
6635 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
6637 echo "But it supports 4 and 8."
6639 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
6641 echo "And it supports 4 but has not heard about 8."
6643 echo "However it supports 8 but not 4."
6648 echo "There is no support at all for void."
6653 case "$voidflags" in
6656 Support flag bits are:
6657 1: basic void declarations.
6658 2: arrays of pointers to functions returning void.
6659 4: operations between pointers to and addresses of void functions.
6660 8: generic void pointers.
6663 rp="Your void support flags add up to what?"
6670 : check for length of pointer
6674 echo "Checking to see how big your pointers are..." >&4
6675 if test "$voidflags" -gt 7; then
6676 echo '#define VOID_PTR char *' > try.c
6678 echo '#define VOID_PTR void *' > try.c
6688 printf("%d\n", (int)sizeof(VOID_PTR));
6693 if eval $compile_ok; then
6694 ptrsize=`$run ./try`
6695 echo "Your pointers are $ptrsize bytes long."
6698 echo "(I can't seem to compile the test program. Guessing...)" >&4
6699 rp="What is the size of a pointer (in bytes)?"
6706 case "$use64bitall" in
6707 "$define"|true|[yY]*)
6711 *** You have chosen a maximally 64-bit build,
6712 *** but your pointers are only 4 bytes wide.
6713 *** Please rerun Configure without -Duse64bitall.
6718 *** Since you have quads, you could possibly try with -Duse64bitint.
6723 *** Cannot continue, aborting.
6734 : determine whether to use malloc wrapping
6736 case "$usemallocwrap" in
6737 [yY]*|true|$define) dflt='y' ;;
6738 [nN]*|false|$undef) dflt='n' ;;
6739 *) case "$usedevel" in
6740 [yY]*|true|$define) dflt='y' ;;
6745 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
6747 usemallocwrap="$ans"
6750 usemallocwrap="$define" ;;
6752 usemallocwrap="$undef" ;;
6755 : determine which malloc to compile in
6757 case "$usemymalloc" in
6758 [yY]*|true|$define) dflt='y' ;;
6759 [nN]*|false|$undef) dflt='n' ;;
6760 *) case "$ptrsize" in
6766 rp="Do you wish to attempt to use the malloc that comes with $package?"
6772 mallocsrc='malloc.c'
6773 mallocobj="malloc$_o"
6774 d_mymalloc="$define"
6777 : Remove malloc from list of libraries to use
6778 echo "Removing unneeded -lmalloc from library list" >&4
6779 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
6782 echo "libs = $libs" >&4
6794 : compute the return types of malloc and free
6796 $cat >malloc.c <<END
6800 #include <sys/types.h>
6814 case "$malloctype" in
6816 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
6823 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
6827 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
6834 echo "Your system uses $freetype free(), it would seem." >&4
6836 : determine where site specific architecture-dependent libraries go.
6837 : sitelib default is /usr/local/lib/perl5/site_perl/$version
6838 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6839 : sitelib may have an optional trailing /share.
6841 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
6842 dflt="$dflt/$archname"
6847 set sitearch sitearch none
6851 The installation process will also create a directory for
6852 architecture-dependent site-specific extensions and modules.
6856 rp='Pathname for the site-specific architecture-dependent library files?'
6860 if $test X"$sitearch" = X"$sitelib"; then
6863 d_sitearch="$define"
6866 : Set the vendorprefix variables
6869 The installation process will also create a directory for
6870 vendor-supplied add-ons. Vendors who supply perl with their system
6871 may find it convenient to place all vendor-supplied files in this
6872 directory rather than in the main distribution directory. This will
6873 ease upgrades between binary-compatible maintenance versions of perl.
6875 Of course you may also use these directories in whatever way you see
6876 fit. For example, you might use them to access modules shared over a
6877 company-wide network.
6879 The default answer should be fine for most people.
6880 This causes further questions about vendor add-ons to be skipped
6881 and no vendor-specific directories will be configured for perl.
6884 rp='Do you want to configure vendor-specific add-on directories?'
6885 case "$usevendorprefix" in
6886 define|true|[yY]*) dflt=y ;;
6887 *) : User may have set vendorprefix directly on Configure command line.
6888 case "$vendorprefix" in
6897 rp='Installation prefix to use for vendor-supplied add-ons?'
6898 case "$vendorprefix" in
6900 *) dflt=$vendorprefix ;;
6903 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6905 case "$vendorprefix" in
6909 *) oldvendorprefix="$prefix";;
6913 usevendorprefix="$define"
6915 vendorprefixexp="$ansexp"
6917 *) usevendorprefix="$undef"
6923 : Set the vendorlib variables
6924 case "$vendorprefix" in
6925 '') d_vendorlib="$undef"
6929 *) d_vendorlib="$define"
6930 : determine where vendor-supplied modules go.
6931 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
6932 case "$vendorlib" in
6934 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6935 case "$installstyle" in
6936 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
6937 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
6940 *) dflt="$vendorlib"
6944 rp='Pathname for the vendor-supplied library files?'
6947 vendorlibexp="$ansexp"
6950 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
6954 : Set the vendorarch variables
6955 case "$vendorprefix" in
6956 '') d_vendorarch="$undef"
6960 *) d_vendorarch="$define"
6961 : determine where vendor-supplied architecture-dependent libraries go.
6962 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
6963 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
6964 : vendorlib may have an optional trailing /share.
6965 case "$vendorarch" in
6966 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
6967 dflt="$dflt/$archname"
6969 *) dflt="$vendorarch" ;;
6972 rp='Pathname for vendor-supplied architecture-dependent files?'
6975 vendorarchexp="$ansexp"
6978 prefixvar=vendorarch
6981 : Final catch-all directories to search
6984 Lastly, you can have perl look in other directories for extensions and
6985 modules in addition to those already specified.
6986 These directories will be searched after
6990 test X"$vendorlib" != "X" && echo ' ' $vendorlib
6991 test X"$vendorarch" != "X" && echo ' ' $vendorarch
6993 case "$otherlibdirs" in
6994 ''|' ') dflt='none' ;;
6995 *) dflt="$otherlibdirs" ;;
6998 Enter a colon-separated set of extra paths to include in perl's @INC
6999 search path, or enter 'none' for no extra paths.
7003 rp='Colon-separated list of additional directories for perl to search?'
7006 ' '|''|none) otherlibdirs=' ' ;;
7007 *) otherlibdirs="$ans" ;;
7009 case "$otherlibdirs" in
7013 set d_perl_otherlibdirs
7016 : Cruising for prototypes
7018 echo "Checking out function prototypes..." >&4
7019 $cat >prototype.c <<EOCP
7024 int main(int argc, char *argv[]) {
7027 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
7028 echo "Your C compiler appears to support function prototypes."
7031 echo "Your C compiler doesn't seem to understand function prototypes."
7038 : Check if ansi2knr is required
7039 case "$prototype" in
7041 *) ansi2knr='ansi2knr'
7046 This version of $package can only be compiled by a compiler that
7047 understands function prototypes. Unfortunately, your C compiler
7049 doesn't seem to understand them. Sorry about that.
7051 If GNU cc is available for your system, perhaps you could try that instead.
7053 Eventually, we hope to support building Perl with pre-ANSI compilers.
7054 If you would like to help in that effort, please contact <perlbug@perl.org>.
7056 Aborting Configure now.
7063 dflt_dtrace='/usr/sbin/dtrace'
7066 Perl can be built to support DTrace on platforms that support it.
7067 DTrace is a diagnosis and performance analysis tool from Sun.
7069 If this doesn't make any sense to you, just accept the default '$dflt'.
7073 case "$usedtrace" in
7079 dflt_dtrace=$usedtrace
7086 rp='Support DTrace if available?'
7089 y|Y) val="$define" ;;
7095 test "X$usedtrace" != "X$define" && break
7098 rp='Where is the dtrace executable?'
7107 if $dtrace -h -s ../perldtrace.d \
7108 -o perldtrace.tmp >/dev/null 2>&1 \
7109 && rm -f perldtrace.tmp
7112 echo "Good: your $dtrace knows about the -h flag."
7116 *** $me: Fatal Error: $dtrace doesn't support -h flag
7118 *** Your installed dtrace doesn't support the -h switch to compile a D
7119 *** program into a C header. Can't continue.
7131 *** $me: Fatal Error: $dtrace not found.
7138 echo "*** $dtrace was not found."
7144 : See if we want extra modules installed
7151 Perl can be built with extra modules or bundles of modules which
7152 will be fetched from the CPAN and installed alongside Perl.
7154 Notice that you will need access to the CPAN; either via the Internet,
7155 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
7156 be asked later to configure the CPAN.pm module which will in turn do
7157 the installation of the rest of the extra modules or bundles.)
7159 Notice also that if the modules require any external software such as
7160 libraries and headers (the libz library and the zlib.h header for the
7161 Compress::Zlib module, for example) you MUST have any such software
7162 already installed, this configuration process will NOT install such
7165 If this doesn't make any sense to you, just accept the default '$dflt'.
7167 rp='Install any extra modules (y or n)?'
7173 Please list any extra modules or bundles to be installed from CPAN,
7174 with spaces between the names. The names can be in any format the
7175 'install' command of CPAN.pm will understand. (Answer 'none',
7176 without the quotes, to install no extra modules or bundles.)
7186 $rm -f ../extras.lst
7188 *) echo "(Saving the list of extras for later...)"
7189 echo "$extras" > ../extras.lst
7197 : determine where html pages for programs go
7198 set html1dir html1dir none
7202 If you wish to install html files for programs in $spackage, indicate
7203 the appropriate directory here. To skip installing html files,
7207 ''|none|$undef|' ') dflt=none ;;
7208 *) dflt=$html1dir ;;
7211 rp="Directory for the main $spackage html pages?"
7215 : Use ' ' for none so value is preserved next time through Configure
7216 $test X"$html1dir" = "X" && html1dir=' '
7218 : determine where html pages for libraries and modules go
7219 set html3dir html3dir none
7223 If you wish to install html files for modules associated with $spackage,
7224 indicate the appropriate directory here. To skip installing html files,
7227 : There is no obvious default. If they have specified html1dir, then
7228 : try to key off that, possibly changing .../html1 into .../html3.
7230 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
7231 *) dflt=$html3dir ;;
7234 rp="Directory for the $spackage module html pages?"
7238 : Use ' ' for none so value is preserved next time through Configure
7239 $test X"$html3dir" = "X" && html3dir=' '
7241 : determine whether to install perl also as /usr/bin/perl
7244 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
7246 Many scripts expect perl to be installed as /usr/bin/perl.
7248 If you want to, I can install the perl you are about to compile
7249 as /usr/bin/perl (in addition to $bin/perl).
7251 if test -f /usr/bin/perl; then
7254 However, please note that because you already have a /usr/bin/perl,
7255 overwriting that with a new Perl would very probably cause problems.
7256 Therefore I'm assuming you don't want to do that (unless you insist).
7259 case "$installusrbinperl" in
7260 "$define"|[yY]*) dflt='y';;
7266 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
7269 case "$installusrbinperl" in
7270 "$undef"|[nN]*) dflt='n';;
7274 rp="Do you want to install perl as /usr/bin/perl?"
7277 [yY]*) val="$define";;
7283 set installusrbinperl
7286 : Check if we are using the GNU C library
7288 echo "Checking for GNU C Library..." >&4
7290 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
7291 alone are insufficient to distinguish different versions, such as
7292 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
7293 libc version 2.1.0. A. Dougherty, June 3, 2002.
7299 # ifdef __GLIBC_MINOR__
7300 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus)
7301 # include <gnu/libc-version.h>
7302 printf("%s\n", gnu_get_libc_version());
7304 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
7307 printf("%d\n", __GLIBC__);
7316 if eval $compile_ok && $run ./try > glibc.ver; then
7318 gnulibc_version=`$cat glibc.ver`
7319 echo "You are using the GNU C Library version $gnulibc_version"
7323 echo "You are not using the GNU C Library"
7329 : see if nm is to be used to determine whether a symbol is defined or not
7333 case "$d_gnulibc" in
7336 echo "nm probably won't work on the GNU C Library." >&4
7342 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
7344 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
7345 echo "'nm' won't be sufficient on this sytem." >&4
7351 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
7352 if $test $dflt -gt 20; then
7362 true|$define) dflt=y;;
7369 I can use $nm to extract the symbols from your C libraries. This
7370 is a time consuming task which may generate huge output on the disk (up
7371 to 3 megabytes) but that should make the symbols extraction faster. The
7372 alternative is to skip the 'nm' extraction part and to compile a small
7373 test program instead to determine whether each symbol is present. If
7374 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
7375 this may be the best solution.
7377 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
7380 rp="Shall I use $nm to extract C symbols from the libraries?"
7383 [Nn]*) usenm=false;;
7392 : nm options which may be necessary
7394 '') if $test -f /mach_boot; then
7396 elif $test -d /usr/ccs/lib; then
7397 nm_opt='-p' # Solaris (and SunOS?)
7398 elif $test -f /dgux; then
7400 elif $test -f /lib64/rld; then
7401 nm_opt='-p' # 64-bit Irix
7407 : nm options which may be necessary for shared libraries but illegal
7408 : for archive libraries. Thank you, Linux.
7409 case "$nm_so_opt" in
7410 '') case "$myuname" in
7412 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
7413 nm_so_opt='--dynamic'
7420 : get list of predefined functions in a handy place
7427 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
7433 *) for thislib in $libs; do
7436 : Handle C library specially below.
7439 thislib=`echo $thislib | $sed -e 's/^-l//'`
7440 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
7442 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
7444 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
7446 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
7448 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
7450 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
7452 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
7457 libnames="$libnames $try"
7459 *) libnames="$libnames $thislib" ;;
7468 for xxx in $libpth; do
7469 $test -r $1 || set $xxx/libc.$so
7470 : The messy sed command sorts on library version numbers.
7472 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
7473 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
7475 s/[0-9][0-9]*/0000&/g
7476 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
7479 $sort | $sed -e 's/^.* //'`
7482 $test -r $1 || set /usr/ccs/lib/libc.$so
7483 $test -r $1 || set /lib/libsys_s$_a
7489 if $test -r "$1"; then
7490 echo "Your (shared) C library seems to be in $1."
7492 elif $test -r /lib/libc && $test -r /lib/clib; then
7493 echo "Your C library seems to be in both /lib/clib and /lib/libc."
7495 libc='/lib/clib /lib/libc'
7496 if $test -r /lib/syslib; then
7497 echo "(Your math library is in /lib/syslib.)"
7498 libc="$libc /lib/syslib"
7500 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7501 echo "Your C library seems to be in $libc, as you said before."
7502 elif $test -r $incpath/usr/lib/libc$_a; then
7503 libc=$incpath/usr/lib/libc$_a;
7504 echo "Your C library seems to be in $libc. That's fine."
7505 elif $test -r /lib/libc$_a; then
7507 echo "Your C library seems to be in $libc. You're normal."
7509 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
7511 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
7512 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
7513 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
7515 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7517 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7520 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
7522 if $test -r "$tans"; then
7523 echo "Your C library seems to be in $tans, of all places."
7529 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7533 If the guess above is wrong (which it might be if you're using a strange
7534 compiler, or your machine supports multiple models), you can override it here.
7539 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
7541 I can't seem to find your C library. I've looked in the following places:
7544 $sed 's/^/ /' libpath
7547 None of these seems to contain your C library. I need to get its name...
7552 rp='Where is your C library?'
7557 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
7558 set X `cat libnames`
7561 case $# in 1) xxx=file; esac
7562 echo "Extracting names from the following $xxx for later perusal:" >&4
7564 $sed 's/^/ /' libnames >&4
7566 $echo $n "This may take a while...$c" >&4
7570 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
7571 *) $nm $nm_opt $file 2>/dev/null;;
7576 $grep fprintf libc.tmp > libc.ptf
7577 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
7578 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
7580 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
7582 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7584 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
7586 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7588 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
7590 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7592 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
7594 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7596 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
7598 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7600 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
7602 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7604 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
7605 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
7607 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7609 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
7611 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7613 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
7615 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7617 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
7619 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7621 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
7623 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7625 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
7627 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7629 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
7631 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7633 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
7635 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7638 $nm -p $* 2>/dev/null >libc.tmp
7639 $grep fprintf libc.tmp > libc.ptf
7640 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
7641 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
7647 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
7649 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
7650 for thisname in $libnames $libc; do
7651 $ar t $thisname >>libc.tmp
7653 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
7655 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
7656 # Repeat libc to extract forwarders to DLL entries too
7657 for thisname in $libnames $libc; do
7658 $ar tv $thisname >>libc.tmp
7659 # Revision 50 of EMX has bug in $ar.
7660 # it will not extract forwarders to DLL entries
7661 # Use emximp which will extract exactly them.
7662 emximp -o tmp.imp $thisname \
7664 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
7665 < tmp.imp >>libc.tmp
7668 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
7671 echo "$ar didn't seem to work right." >&4
7672 echo "Maybe this is a Cray...trying bld instead..." >&4
7673 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
7675 for thisname in $libnames; do
7677 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
7678 $ar t $thisname >>libc.tmp
7682 echo "That didn't work either. Giving up." >&4
7692 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
7693 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
7695 *) if $test -f /lib/syscalls.exp; then
7697 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
7698 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' /lib/syscalls.exp >>libc.list
7704 $rm -f libnames libpath
7706 : see if dld is available
7710 : Check if we are using C++
7712 echo "Checking for C++..." >&4
7713 $cat >try.c <<'EOCP'
7725 if eval $compile_ok && $run ./try; then
7727 echo "You are using a C++ compiler."
7730 echo "You are not using a C++ compiler."
7736 : is a C symbol defined?
7739 -v) tf=libc.tmp; tdc="";;
7740 -a) tf=libc.tmp; tdc="[]";;
7741 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
7744 case "$reuseval-$4" in
7746 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
7751 case "$d_cplusplus" in
7752 $define) extern_C=\"C\";;
7754 if $test "$runnm" = true; then
7755 if $contains $tlook $tf >/dev/null 2>&1; then
7757 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
7758 echo "extern $extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7759 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
7760 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
7764 echo "extern $extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7765 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
7771 $define) tval=true;;
7778 : define an is-in-libc? function
7779 inlibc='echo " "; td=$define; tu=$undef;
7780 sym=$1; var=$2; eval "was=\$$2";
7782 case "$reuseval$was" in
7792 echo "$sym() found." >&4;
7793 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
7795 echo "$sym() NOT found." >&4;
7796 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
7800 $define) echo "$sym() found." >&4;;
7801 *) echo "$sym() NOT found." >&4;;
7805 : see if dlopen exists
7807 xxx_ccflags="$ccflags"
7809 : with g++ one needs -shared to get is-in-libc to work for dlopen
7810 case "$gccversion" in
7812 *) case "$d_cplusplus" in
7813 "$define") ccflags="$ccflags -shared" ;;
7820 ccflags="$xxx_ccflags"
7822 : see if this is a unistd.h system
7823 set unistd.h i_unistd
7826 : determine which dynamic loading, if any, to compile in
7828 dldir="ext/DynaLoader"
7841 $define) dflt='y' ;;
7844 $define) dflt='y' ;;
7846 : Does a dl_xxx.xs file exist for this operating system
7847 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
7850 rp="Do you wish to use dynamic loading?"
7857 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
7858 dflt="$dldir/dl_${osname}.xs"
7859 elif $test "$d_dlopen" = "$define" ; then
7860 dflt="$dldir/dl_dlopen.xs"
7861 elif $test "$i_dld" = "$define" ; then
7862 dflt="$dldir/dl_dld.xs"
7867 *) dflt="$dldir/$dlsrc"
7870 echo "The following dynamic loading files are available:"
7871 : Can not go over to $dldir because getfile has path hard-coded in.
7872 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
7873 rp="Source file to use for dynamic loading"
7879 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
7883 Some systems may require passing special flags to $cc -c to
7884 compile modules that will be used to create a shared library.
7885 To use no flags, say "none".
7888 case "$cccdlflags" in
7889 '') case "$gccversion" in
7890 '') case "$osname" in
7892 next) dflt='none' ;;
7893 irix*) dflt='-KPIC' ;;
7894 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
7895 sunos) dflt='-pic' ;;
7899 *) case "$osname" in
7900 darwin) dflt='none' ;;
7901 linux*|svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
7906 *) dflt="$cccdlflags" ;;
7908 rp="Any special flags to pass to $cc -c to compile shared library modules?"
7911 none) cccdlflags=' ' ;;
7912 *) cccdlflags="$ans" ;;
7917 Some systems use ld to create libraries that can be dynamically loaded,
7918 while other systems (such as those using ELF) use $cc.
7922 '') $cat >try.c <<EOM
7923 /* Test for whether ELF binaries are produced */
7935 int i = open("a.out",O_RDONLY);
7938 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
7939 exit(0); /* succeed (yes, it's ELF) */
7944 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
7946 You appear to have ELF support. I'll use $cc to build dynamic libraries.
7950 echo "I'll use ld to build dynamic libraries."
7959 rp="What command should be used to create dynamic libraries?"
7965 Some systems may require passing special flags to $ld to create a
7966 library that can be dynamically loaded. If your ld flags include
7967 -L/other/path options to locate libraries outside your loader's normal
7968 search path, you may need to specify those -L options here as well. To
7969 use no flags, say "none".
7972 case "$lddlflags" in
7973 '') case "$osname" in
7974 beos) dflt='-nostart' ;;
7976 case "$gccversion" in
7977 '') dflt="$dflt +vnocompatwarnings" ;;
7980 linux|irix*|gnu*) dflt="-shared $optimize" ;;
7981 next) dflt='none' ;;
7982 solaris) dflt='-G' ;;
7983 sunos) dflt='-assert nodefinitions' ;;
7984 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
7988 *) dflt="$lddlflags" ;;
7991 : Try to guess additional flags to pick up local libraries.
7992 : Be careful not to append to a plain 'none'
7996 for thisflag in $ldflags; do
8001 *) dflt="$dflt $thisflag" ;;
8008 ''|' ') dflt='none' ;;
8011 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
8014 none) lddlflags=' ' ;;
8015 *) lddlflags="$ans" ;;
8020 Some systems may require passing special flags to $cc to indicate that
8021 the resulting executable will use dynamic linking. To use no flags,
8025 case "$ccdlflags" in
8026 '') case "$osname" in
8027 linux|hpux|gnu*) dflt='-Wl,-E' ;;
8028 next|sunos) dflt='none' ;;
8032 *) dflt="$ccdlflags" ;;
8034 rp="Any special flags to pass to $cc to use dynamic linking?"
8037 none) ccdlflags=' ' ;;
8038 *) ccdlflags="$ans" ;;
8049 : Do we want a shared libperl?
8053 # No dynamic loading being used, so don't bother even to prompt.
8056 *) case "$useshrplib" in
8057 '') case "$osname" in
8058 svr4*|nonstopux|dgux|dynixptx|esix|powerux|beos|cygwin*)
8060 also='Building a shared libperl is required for dynamic loading to work on your system.'
8065 also='Building a shared libperl is needed for MAB support.'
8083 The perl executable is normally obtained by linking perlmain.c with
8084 libperl${_a}, any static extensions (usually just DynaLoader), and
8085 any other libraries needed on this system (such as -lm, etc.). Since
8086 your system supports dynamic loading, it is probably possible to build
8087 a shared libperl.$so. If you will have more than one executable linked
8088 to libperl.$so, this will significantly reduce the size of each
8089 executable, but it may have a noticeable effect on performance. The
8090 default is probably sensible for your system.
8094 rp="Build a shared libperl.$so (y/n)"
8098 useshrplib='true' ;;
8099 *) useshrplib='false' ;;
8104 case "$useshrplib" in
8108 # Figure out a good name for libperl.so. Since it gets stored in
8109 # a version-specific architecture-dependent library, the version
8110 # number isn't really that important, except for making cc/ld happy.
8112 # A name such as libperl.so.3.1
8113 majmin="libperl.$so.$patchlevel.$subversion"
8114 # A name such as libperl.so.301
8115 majonly=`echo $patchlevel $subversion |
8116 $awk '{printf "%d%02d", $1, $2}'`
8117 majonly=libperl.$so.$majonly
8118 # I'd prefer to keep the os-specific stuff here to a minimum, and
8119 # rely on figuring it out from the naming of libc.
8120 case "${osname}${osvers}" in
8123 # XXX How handle the --version stuff for MAB?
8125 linux*|gnu*) # ld won't link with a bare -lperl otherwise.
8128 cygwin*) # ld links against an importlib
8129 dflt=libperl$lib_ext
8131 *) # Try to guess based on whether libc has major.minor.
8133 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
8134 *libc.$so.[0-9]*) dflt=$majonly ;;
8135 *) dflt=libperl.$so ;;
8145 I need to select a good name for the shared libperl. If your system uses
8146 library names with major and minor numbers, then you might want something
8147 like $majmin. Alternatively, if your system uses a single version
8148 number for shared libraries, then you might want to use $majonly.
8149 Or, your system might be quite happy with a simple libperl.$so.
8151 Since the shared libperl will get installed into a version-specific
8152 architecture-dependent directory, the version number of the shared perl
8153 library probably isn't important, so the default should be o.k.
8156 rp='What name do you want to give to the shared libperl?'
8159 echo "Ok, I'll use $libperl"
8162 libperl="libperl${_a}"
8166 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
8170 WARNING: Use of the shrpdir variable for the installation location of
8171 the shared $libperl is not supported. It was never documented and
8172 will not work in this version. Let me (perlbug@perl.org)
8173 know of any problems this may cause.
8179 But your current setting of $shrpdir is
8180 the default anyway, so it's harmless.
8185 Further, your current attempted setting of $shrpdir
8186 conflicts with the value of $archlibexp/CORE
8187 that installperl will use.
8194 # How will the perl executable find the installed shared $libperl?
8195 # Add $xxx to ccdlflags.
8196 # If we can't figure out a command-line option, use $shrpenv to
8197 # set env LD_RUN_PATH. The main perl makefile uses this.
8198 shrpdir=$archlibexp/CORE
8201 if "$useshrplib"; then
8204 # We'll set it in Makefile.SH...
8209 freebsd|netbsd|openbsd|interix|dragonfly)
8210 xxx="-Wl,-R$shrpdir"
8212 bsdos|linux|irix*|dec_osf|gnu*)
8213 xxx="-Wl,-rpath,$shrpdir"
8216 # next doesn't like the default...
8219 # beos doesn't like the default, either.
8222 # hpux doesn't like the default, either.
8223 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
8226 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
8232 # Only add $xxx if it isn't already in ccdlflags.
8233 case " $ccdlflags " in
8235 *) ccdlflags="$ccdlflags $xxx"
8238 Adding $xxx to the flags
8239 passed to $ld so that the perl executable will find the
8240 installed shared $libperl.
8248 # Fix ccdlflags in AIX for building external extensions.
8249 # (For building Perl itself bare -bE:perl.exp is needed,
8250 # Makefile.SH takes care of this.)
8252 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8254 # Respect a hint or command-line value.
8256 '') shrpenv="$tmp_shrpenv" ;;
8258 case "$ldlibpthname" in
8259 '') ldlibpthname=LD_LIBRARY_PATH ;;
8260 none) ldlibpthname='' ;;
8263 : determine where manual pages are on this system
8267 syspath='/usr/share/man/man1 /usr/man/man1'
8268 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8269 syspath="$syspath /usr/man/u_man/man1"
8270 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8271 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8272 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8273 sysman=`./loc . /usr/man/man1 $syspath`
8276 if $test -d "$sysman"; then
8277 echo "System manual is in $sysman." >&4
8279 echo "Could not find manual pages in source form." >&4
8282 : determine where manual pages go
8283 set man1dir man1dir none
8287 $spackage has manual pages available in source form.
8291 echo "However, you don't have nroff, so they're probably useless to you."
8293 '') man1dir="none";;
8296 echo "If you don't want the manual sources installed, answer 'none'."
8301 lookpath="$prefixexp/share/man/man1"
8302 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8303 lookpath="$lookpath $prefixexp/man/p_man/man1"
8304 lookpath="$lookpath $prefixexp/man/u_man/man1"
8305 lookpath="$lookpath $prefixexp/man/man.1"
8307 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8308 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8318 rp="Where do the main $spackage manual pages (source) go?"
8320 if $test "X$man1direxp" != "X$ansexp"; then
8331 : What suffix to use on installed man pages
8338 rp="What suffix should be used for the main $spackage man pages?"
8340 '') case "$man1dir" in
8354 *) dflt="$man1ext";;
8361 : see if we can have long filenames
8363 first=123456789abcdef
8365 if (echo hi >$first) 2>/dev/null; then
8366 if $test -f 123456789abcde; then
8367 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8370 echo 'You can have filenames longer than 14 characters.'>&4
8375 You can't have filenames longer than 14 chars.
8376 You can't even think about them!
8382 $rm -rf 123456789abcde*
8384 : determine where library module manual pages go
8385 set man3dir man3dir none
8389 $spackage has manual pages for many of the library modules.
8395 However, you don't have nroff, so they're probably useless to you.
8398 '') man3dir="none";;
8402 case "$d_flexfnam" in
8405 However, your system can't handle the long file names like File::Basename.3.
8408 '') man3dir="none";;
8412 echo "If you don't want the manual sources installed, answer 'none'."
8413 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8415 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
8416 if $test -d "$privlib/man/man3"; then
8419 WARNING: Previous versions of perl installed man3 pages into
8420 $privlib/man/man3. This version will suggest a
8421 new default of $dflt.
8425 rp='Do you wish to preserve the old behavior?(y/n)'
8428 y*) dflt="$privlib/man/man3" ;;
8433 *) dflt="$man3dir" ;;
8440 rp="Where do the $package library man pages (source) go?"
8450 : What suffix to use on installed man pages
8456 rp="What suffix should be used for the $package library man pages?"
8458 '') case "$man3dir" in
8472 *) dflt="$man3ext";;
8479 : see if we have to deal with yellow pages, now NIS.
8480 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
8481 if $test -f /usr/etc/nibindd; then
8483 echo "I'm fairly confident you're on a NeXT."
8485 rp='Do you get the hosts file via NetInfo?'
8494 y*) hostcat='nidump hosts .';;
8495 *) case "$hostcat" in
8496 nidump*) hostcat='';;
8506 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
8514 rp='Are you getting the hosts file via yellow pages?'
8517 y*) hostcat='ypcat hosts';;
8518 *) hostcat='cat /etc/hosts';;
8524 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
8527 '') test -f /etc/group && groupcat='cat /etc/group';;
8530 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
8533 : now get the host name
8535 echo "Figuring out host name..." >&4
8536 case "$myhostname" in
8538 echo 'Maybe "hostname" will work...'
8539 if tans=`sh -c hostname 2>&1` ; then
8547 if $test "$cont"; then
8549 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
8550 if tans=`cat /etc/systemid 2>&1` ; then
8552 phostname='cat /etc/systemid'
8553 echo "Whadyaknow. Xenix always was a bit strange..."
8556 elif $test -r /etc/systemid; then
8557 echo "(What is a non-Xenix system doing with /etc/systemid?)"
8560 if $test "$cont"; then
8561 echo 'No, maybe "uuname -l" will work...'
8562 if tans=`sh -c 'uuname -l' 2>&1` ; then
8564 phostname='uuname -l'
8566 echo 'Strange. Maybe "uname -n" will work...'
8567 if tans=`sh -c 'uname -n' 2>&1` ; then
8569 phostname='uname -n'
8571 echo 'Oh well, maybe I can mine it out of whoami.h...'
8572 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
8573 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
8574 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
8576 case "$myhostname" in
8577 '') echo "Does this machine have an identity crisis or something?"
8580 echo "Well, you said $myhostname before..."
8581 phostname='echo $myhostname';;
8587 case "$myhostname" in
8588 '') myhostname=noname ;;
8590 : you do not want to know about this
8595 if $test "$myhostname" ; then
8597 rp='Your host name appears to be "'$myhostname'".'" Right?"
8605 : bad guess or no guess
8606 while $test "X$myhostname" = X ; do
8608 rp="Please type the (one word) name of your host:"
8613 : translate upper to lower if necessary
8614 case "$myhostname" in
8616 echo "(Normalizing case in your host name)"
8617 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
8621 case "$myhostname" in
8623 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
8624 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
8625 echo "(Trimming domain name from host name--host name is now $myhostname)"
8627 *) case "$mydomain" in
8630 test "X$hostcat" = "Xypcat hosts" &&
8631 ypmatch "$myhostname" hosts 2>/dev/null |\
8632 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
8635 test "X$hostcat" != "X" &&
8636 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
8637 /[ ]$myhostname[ . ]/p" > hosts
8640 if $test -f hosts; then
8641 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
8642 END { print sum }" hosts` = x1 || tmp_re="[ ]"
8643 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
8644 hosts | $sort | $uniq | \
8645 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
8646 case `$echo X$dflt` in
8647 X*\ *) echo "(Several hosts in the database matched hostname)"
8650 X.) echo "(You do not have fully-qualified names in the hosts database)"
8654 echo "(I cannot locate a hosts database anywhere)"
8659 tans=`./loc resolv.conf X /etc /usr/etc`
8660 if $test -f "$tans"; then
8661 echo "(Attempting domain name extraction from $tans)"
8662 dflt=.`$sed -n -e 's/ / /g' \
8663 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
8664 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8666 .) dflt=.`$sed -n -e 's/ / /g' \
8667 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
8668 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8675 .) echo "(No help from resolv.conf either -- attempting clever guess)"
8676 dflt=.`sh -c domainname 2>/dev/null`
8679 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
8683 case "$dflt$osname" in
8684 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
8685 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
8689 .) echo "(Lost all hope -- silly guess then)"
8695 *) dflt="$mydomain";;
8699 rp="What is your domain name?"
8709 : translate upper to lower if necessary
8712 echo "(Normalizing case in your domain name)"
8713 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
8717 : a little sanity check here
8718 case "$phostname" in
8721 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
8722 $myhostname$mydomain|$myhostname) ;;
8724 case "$phostname" in
8726 echo "(That doesn't agree with your whoami.h file, by the way.)"
8729 echo "(That doesn't agree with your $phostname command, by the way.)"
8737 : determine the e-mail address of the user who is running us
8740 I need to get your e-mail address in Internet format if possible, i.e.
8741 something like user@host.domain. Please answer accurately since I have
8742 no easy means to double check it. The default value provided below
8743 is most probably close to reality but may not be valid from outside
8744 your organization...
8748 while test "$cont"; do
8750 '') dflt="$cf_by@$myhostname$mydomain";;
8751 *) dflt="$cf_email";;
8753 rp='What is your e-mail address?'
8759 rp='Address does not look like an Internet one. Use it anyway?'
8773 : Ask e-mail of administrator
8776 If you or somebody else will be maintaining perl at your site, please
8777 fill in the correct e-mail address here so that they may be contacted
8778 if necessary. Currently, the "perlbug" program included with perl
8779 will send mail to this address in addition to perlbug@perl.org. You may
8780 enter "none" for no administrator.
8783 case "$perladmin" in
8784 '') dflt="$cf_email";;
8785 *) dflt="$perladmin";;
8787 rp='Perl administrator e-mail address'
8791 : determine whether to only install version-specific parts.
8794 Do you want to install only the version-specific parts of the perl
8795 distribution? Usually you do *not* want to do this.
8797 case "$versiononly" in
8798 "$define"|[Yy]*|true) dflt='y' ;;
8801 rp="Do you want to install only the version-specific parts of perl?"
8804 [yY]*) val="$define";;
8810 case "$versiononly" in
8811 "$define") inc_version_list=''
8812 inc_version_list_init=0
8816 : figure out how to guarantee perl startup
8817 : XXX Note that this currently takes advantage of the bug that binexp ignores
8818 : the Configure -Dinstallprefix setting, which in turn means that under
8819 : relocatable @INC, initialinstalllocation is what binexp started as.
8820 case "$startperl" in
8822 case "$sharpbang" in
8826 I can use the #! construct to start perl on your system. This will
8827 make startup of perl scripts faster, but may cause problems if you
8828 want to share those scripts and perl is not in a standard place
8829 ($initialinstalllocation/perl) on all your platforms. The alternative
8830 is to force a shell by starting the script with a single ':' character.
8833 case "$versiononly" in
8834 "$define") dflt="$initialinstalllocation/perl$version";;
8835 *) dflt="$initialinstalllocation/perl";;
8837 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
8840 none) startperl=": # use perl";;
8841 *) startperl="#!$ans"
8842 if $test 30 -lt `echo "$ans" | wc -c`; then
8845 WARNING: Some systems limit the #! command to 32 characters.
8846 If you experience difficulty running Perl scripts with #!, try
8847 installing Perl in a directory with a shorter pathname.
8853 *) startperl=": # use perl"
8858 echo "I'll use $startperl to start perl scripts."
8860 : figure best path for perl in scripts
8863 case "$versiononly" in
8864 "$define") perlpath="$initialinstalllocation/perl$version";;
8865 *) perlpath="$initialinstalllocation/perl";;
8867 case "$startperl" in
8872 I will use the "eval 'exec'" idiom to start Perl on your system.
8873 I can use the full path of your Perl binary for this purpose, but
8874 doing so may cause problems if you want to share those scripts and
8875 Perl is not always in a standard place ($initialinstalllocation/perl).
8878 dflt="$initialinstalllocation/perl"
8879 rp="What path shall I use in \"eval 'exec'\"?"
8886 case "$startperl" in
8888 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
8891 : determine where public executable scripts go
8892 set scriptdir scriptdir
8894 case "$scriptdir" in
8897 : guess some guesses
8898 $test -d /usr/share/scripts && dflt=/usr/share/scripts
8899 $test -d /usr/share/bin && dflt=/usr/share/bin
8900 $test -d /usr/local/script && dflt=/usr/local/script
8901 $test -d /usr/local/scripts && dflt=/usr/local/scripts
8902 $test -d $prefixexp/script && dflt=$prefixexp/script
8906 *) dflt="$scriptdir"
8911 Some installations have a separate directory just for executable scripts so
8912 that they can mount it across multiple architectures but keep the scripts in
8913 one spot. You might, for example, have a subdirectory of /usr/share for this.
8914 Or you might just lump your scripts in with all your other executables.
8918 rp='Where do you keep publicly executable scripts?'
8920 if $test "X$ansexp" != "X$scriptdirexp"; then
8926 : A little fix up for an irregularly named variable.
8927 installscript="$installscriptdir"
8929 : determine where add-on public executables go
8931 '') dflt=$siteprefix/bin ;;
8935 rp='Pathname where the add-on public executables should be installed?'
8940 : determine where add-on html pages go
8941 : There is no standard location, so try to copy the previously-selected
8942 : directory structure for the core html pages.
8943 case "$sitehtml1dir" in
8944 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
8945 *) dflt=$sitehtml1dir ;;
8948 ''|' ') dflt=none ;;
8951 rp='Pathname where the site-specific html pages should be installed?'
8953 prefixvar=sitehtml1dir
8956 : determine where add-on library html pages go
8957 : There is no standard location, so try to copy the previously-selected
8958 : directory structure for the core html pages.
8959 case "$sitehtml3dir" in
8960 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
8961 *) dflt=$sitehtml3dir ;;
8964 ''|' ') dflt=none ;;
8967 rp='Pathname where the site-specific library html pages should be installed?'
8969 prefixvar=sitehtml3dir
8972 : determine where add-on manual pages go
8973 case "$siteman1dir" in
8974 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
8975 *) dflt=$siteman1dir ;;
8978 ''|' ') dflt=none ;;
8981 rp='Pathname where the site-specific manual pages should be installed?'
8983 prefixvar=siteman1dir
8986 : determine where add-on library man pages go
8987 case "$siteman3dir" in
8988 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
8989 *) dflt=$siteman3dir ;;
8992 ''|' ') dflt=none ;;
8995 rp='Pathname where the site-specific library manual pages should be installed?'
8997 prefixvar=siteman3dir
9000 : determine where add-on public executable scripts go
9001 case "$sitescript" in
9002 '') dflt=$siteprefix/script
9003 $test -d $dflt || dflt=$sitebin ;;
9004 *) dflt="$sitescript" ;;
9007 rp='Pathname where add-on public executable scripts should be installed?'
9009 prefixvar=sitescript
9012 : Check if faststdio is requested and available
9013 case "$usefaststdio" in
9014 $define|true|[yY]*|'')
9015 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
9025 Perl can be built to use 'fast stdio', which means using the stdio
9026 library but also directly manipulating the stdio buffers to enable
9027 faster I/O. Using stdio is better for backward compatibility (especially
9028 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
9029 interface has been preferred instead of stdio.
9031 If this doesn't make any sense to you, just accept the default '$dflt'.
9033 rp='Use the "fast stdio" if available?'
9036 y|Y) val="$define" ;;
9043 : define an is-a-typedef? function
9044 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9046 "") inclist="sys/types.h";;
9048 eval "varval=\$$var";
9052 for inc in $inclist; do
9053 echo "#include <$inc>" >>temp.c;
9055 echo "#ifdef $type" >> temp.c;
9056 echo "printf(\"We have $type\");" >> temp.c;
9057 echo "#endif" >> temp.c;
9058 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9059 if $contains $type temp.E >/dev/null 2>&1; then
9065 *) eval "$var=\$varval";;
9068 : define an is-a-typedef? function that prompts if the type is not available.
9069 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9071 "") inclist="sys/types.h";;
9073 eval "varval=\$$var";
9077 for inc in $inclist; do
9078 echo "#include <$inc>" >>temp.c;
9080 echo "#ifdef $type" >> temp.c;
9081 echo "printf(\"We have $type\");" >> temp.c;
9082 echo "#endif" >> temp.c;
9083 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9085 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
9086 if $contains $type temp.E >/dev/null 2>&1; then
9087 echo "$type found." >&4;
9090 echo "$type NOT found." >&4;
9096 *) eval "$var=\$varval";;
9099 : see what type lseek is declared as in the kernel
9100 rp="What is the type used for lseek's offset on this system?"
9101 set off_t lseektype long stdio.h sys/types.h
9105 echo "Checking to see how big your file offsets are..." >&4
9107 #include <sys/types.h>
9111 printf("%d\n", (int)sizeof($lseektype));
9116 if eval $compile_ok; then
9117 lseeksize=`$run ./try`
9118 echo "Your file offsets are $lseeksize bytes long."
9122 echo "(I can't seem to compile the test program. Guessing...)"
9123 rp="What is the size of your file offsets (in bytes)?"
9129 : see what type file positions are declared as in the library
9130 rp="What is the type for file position used by fsetpos()?"
9131 set fpos_t fpostype long stdio.h sys/types.h
9134 : Check size for Fpos_t
9137 *_t) zzz="$fpostype" ;;
9140 echo "Checking the size of $zzz..." >&4
9142 #include <sys/types.h>
9149 printf("%d\n", (int)sizeof($fpostype));
9154 if eval $compile_ok; then
9158 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9161 echo "Your $zzz is $fpossize bytes long."
9167 echo "(I can't compile the test program. Guessing...)" >&4
9168 rp="What is the size of your file positions (in bytes)?"
9173 : Check for large file support
9174 # Backward compatibility (uselfs is deprecated).
9176 "$define"|true|[yY]*)
9179 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
9181 uselargefiles="$define"
9185 case "$lseeksize:$fpossize" in
9188 You can have files larger than 2 gigabytes.
9191 *) case "$uselargefiles" in
9192 "$undef"|false|[nN]*) dflt='n' ;;
9197 Perl can be built to understand large files (files larger than 2 gigabytes)
9198 on some systems. To do so, Configure can be run with -Duselargefiles.
9200 If this doesn't make any sense to you, just accept the default '$dflt'.
9202 rp='Try to understand large files, if available?'
9205 y|Y) val="$define" ;;
9212 : Look for a hint-file generated 'call-back-unit'. If the
9213 : user has specified that a large files perl is to be built,
9214 : we may need to set or change some other defaults.
9215 if $test -f uselargefiles.cbu; then
9216 echo "Your platform has some specific hints regarding large file builds, using them..."
9217 . ./uselargefiles.cbu
9219 case "$uselargefiles" in
9221 if $test -f uselargefiles.cbu; then
9223 echo "Rechecking to see how big your file offsets are..." >&4
9225 #include <sys/types.h>
9229 printf("%d\n", (int)sizeof($lseektype));
9234 if eval $compile_ok; then
9235 lseeksize=`$run ./try`
9236 $echo "Your file offsets are now $lseeksize bytes long."
9240 echo "(I can't seem to compile the test program. Guessing...)"
9241 rp="What is the size of your file offsets (in bytes)?"
9246 *_t) zzz="$fpostype" ;;
9249 $echo $n "Rechecking the size of $zzz...$c" >&4
9251 #include <sys/types.h>
9258 printf("%d\n", (int)sizeof($fpostype));
9263 if eval $compile_ok; then
9268 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9271 echo " $fpossize bytes." >&4
9277 echo "(I can't compile the test program. Guessing...)" >&4
9278 rp="What is the size of your file positions (in bytes)?"
9287 : Set the vendorbin variables
9288 case "$vendorprefix" in
9289 '') d_vendorbin="$undef"
9293 *) d_vendorbin="$define"
9294 : determine where vendor-supplied executables go.
9295 case "$vendorbin" in
9296 '') dflt=$vendorprefix/bin ;;
9297 *) dflt="$vendorbin" ;;
9300 rp='Pathname for the vendor-supplied executables directory?'
9303 vendorbinexp="$ansexp"
9309 : Set the vendorhtml1dir variables
9310 case "$vendorprefix" in
9311 '') vendorhtml1dir=''
9312 vendorhtml1direxp=''
9314 *) : determine where vendor-supplied html pages go.
9315 : There is no standard location, so try to copy the previously-selected
9316 : directory structure for the core html pages.
9317 : XXX Better default suggestions would be welcome.
9318 case "$vendorhtml1dir" in
9319 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9320 *) dflt=$vendorhtml1dir ;;
9323 ''|' ') dflt=none ;;
9326 rp='Pathname for the vendor-supplied html pages?'
9328 vendorhtml1dir="$ans"
9329 vendorhtml1direxp="$ansexp"
9332 : Use ' ' for none so value is preserved next time through Configure
9333 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9334 prefixvar=vendorhtml1dir
9337 : Set the vendorhtml3dir variables
9338 case "$vendorprefix" in
9339 '') vendorhtml3dir=''
9340 vendorhtml3direxp=''
9342 *) : determine where vendor-supplied module html pages go.
9343 : There is no standard location, so try to copy the previously-selected
9344 : directory structure for the core html pages.
9345 : XXX Better default suggestions would be welcome.
9346 case "$vendorhtml3dir" in
9347 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9348 *) dflt=$vendorhtml3dir ;;
9351 ''|' ') dflt=none ;;
9354 rp='Pathname for the vendor-supplied html pages?'
9356 vendorhtml3dir="$ans"
9357 vendorhtml3direxp="$ansexp"
9360 : Use ' ' for none so value is preserved next time through Configure
9361 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9362 prefixvar=vendorhtml3dir
9365 : Set the vendorman1dir variables
9366 case "$vendorprefix" in
9367 '') vendorman1dir=''
9370 *) : determine where vendor-supplied manual pages go.
9371 case "$vendorman1dir" in
9372 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9373 *) dflt=$vendorman1dir ;;
9376 ''|' ') dflt=none ;;
9379 rp='Pathname for the vendor-supplied manual section 1 pages?'
9381 vendorman1dir="$ans"
9382 vendorman1direxp="$ansexp"
9385 : Use ' ' for none so value is preserved next time through Configure
9386 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
9387 prefixvar=vendorman1dir
9390 : Set the vendorman3dir variables
9391 case "$vendorprefix" in
9392 '') vendorman3dir=''
9395 *) : determine where vendor-supplied module manual pages go.
9396 case "$vendorman3dir" in
9397 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9398 *) dflt=$vendorman3dir ;;
9401 ''|' ') dflt=none ;;
9404 rp='Pathname for the vendor-supplied manual section 3 pages?'
9406 vendorman3dir="$ans"
9407 vendorman3direxp="$ansexp"
9410 : Use ' ' for none so value is preserved next time through Configure
9411 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
9412 prefixvar=vendorman3dir
9415 : Set the vendorscript variables
9416 case "$vendorprefix" in
9417 '') d_vendorscript="$undef"
9421 *) d_vendorscript="$define"
9422 : determine where vendor-supplied scripts go.
9423 case "$vendorscript" in
9424 '') dflt=$vendorprefix/script
9425 $test -d $dflt || dflt=$vendorbin ;;
9426 *) dflt="$vendorscript" ;;
9430 The installation process will create a directory for
9431 vendor-supplied scripts.
9435 rp='Pathname for the vendor-supplied scripts directory?'
9438 vendorscriptexp="$ansexp"
9441 prefixvar=vendorscript
9444 : see if qgcvt exists
9448 : Check print/scan long double stuff
9451 if $test X"$d_longdbl" = X"$define"; then
9453 echo "Checking how to print long doubles..." >&4
9455 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
9456 $cat >try.c <<'EOCP'
9457 #include <sys/types.h>
9461 printf("%.3f\n", d);
9465 if eval $compile; then
9469 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
9470 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
9471 echo "We will use %f."
9477 if $test X"$sPRIfldbl" = X; then
9478 $cat >try.c <<'EOCP'
9479 #include <sys/types.h>
9482 long double d = 123.456;
9483 printf("%.3Lf\n", d);
9487 if eval $compile; then
9491 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
9492 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
9493 echo "We will use %Lf."
9499 if $test X"$sPRIfldbl" = X; then
9500 $cat >try.c <<'EOCP'
9501 #include <sys/types.h>
9504 long double d = 123.456;
9505 printf("%.3llf\n", d);
9509 if eval $compile; then
9513 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
9514 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
9515 echo "We will use %llf."
9521 if $test X"$sPRIfldbl" = X; then
9522 $cat >try.c <<'EOCP'
9523 #include <sys/types.h>
9526 long double d = 123.456;
9527 printf("%.3lf\n", d);
9531 if eval $compile; then
9535 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
9536 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
9537 echo "We will use %lf."
9543 if $test X"$sPRIfldbl" = X; then
9544 echo "Cannot figure out how to print long doubles." >&4
9546 sSCNfldbl=$sPRIfldbl # expect consistency
9553 case "$sPRIfldbl" in
9554 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
9555 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
9556 d_SCNfldbl="$undef";
9558 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
9559 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
9560 d_SCNfldbl="$define";
9564 : Check how to convert floats to strings.
9566 if test "X$d_Gconvert" = X; then
9569 echo "Checking for an efficient way to convert floats to strings."
9571 case "$uselongdouble" in
9572 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
9574 case "$d_longdbl" in
9575 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
9577 case "$d_PRIgldbl" in
9578 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
9582 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
9583 char *myname = "gconvert";
9586 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
9587 char *myname = "gcvt";
9590 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
9591 char *myname = "qgcvt";
9592 #define DOUBLETYPE long double
9595 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9597 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
9599 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
9602 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
9604 char *myname = "sprintf";
9608 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9609 #define DOUBLETYPE long double
9611 #define DOUBLETYPE double
9617 #define I_STDLIB $i_stdlib
9623 checkit(expect, got)
9627 if (strcmp(expect, got)) {
9628 printf("%s oddity: Expected %s, got %s\n",
9629 myname, expect, got);
9639 /* This must be 1st test on (which?) platform */
9640 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
9641 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
9642 checkit("0.1", buf);
9644 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
9645 checkit("0.01", buf);
9647 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
9648 checkit("0.001", buf);
9650 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
9651 checkit("0.0001", buf);
9653 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
9654 if (strlen(buf) > 5)
9655 checkit("9e-005", buf); /* for Microsoft ?? */
9657 checkit("9e-05", buf);
9659 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
9662 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
9663 checkit("1.1", buf);
9665 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
9666 checkit("1.01", buf);
9668 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
9669 checkit("1.001", buf);
9671 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
9672 checkit("1.0001", buf);
9674 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
9675 checkit("1.00001", buf);
9677 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
9678 checkit("1.000001", buf);
9680 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
9683 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
9686 /* Some Linux gcvt's give 1.e+5 here. */
9687 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
9688 checkit("100000", buf);
9690 /* Some Linux gcvt's give -1.e+5 here. */
9691 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
9692 checkit("-100000", buf);
9694 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
9695 checkit("123.456", buf);
9697 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
9698 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
9699 /* 34 should be enough to scare even long double
9700 * places into using the e notation. */
9701 if (strlen(buf) > 5)
9702 checkit("1e+034", buf); /* for Microsoft */
9704 checkit("1e+34", buf);
9706 /* For Perl, if you add additional tests here, also add them to
9707 * t/base/num.t for benefit of platforms not using Configure or
9708 * overriding d_Gconvert */
9713 : first add preferred functions to our list
9715 for xxx_convert in $gconvert_preference; do
9716 case $xxx_convert in
9717 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
9718 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
9721 : then add any others
9722 for xxx_convert in gconvert gcvt sprintf; do
9725 *) xxx_list="$xxx_list $xxx_convert" ;;
9729 case "$d_longdbl$uselongdouble" in
9731 : again, add prefered functions to our list first
9733 for xxx_convert in $gconvert_ld_preference; do
9734 case $xxx_convert in
9735 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9736 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
9739 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
9740 for xxx_convert in qgcvt sprintf $xxx_list; do
9741 case "$xxx_ld_list" in
9742 $xxx_convert*|*" $xxx_convert"*) ;;
9743 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9746 : if sprintf cannot do long doubles, move it to the end
9747 if test "$d_PRIgldbl" != "$define"; then
9748 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
9750 : if no qgcvt, remove it
9751 if test "$d_qgcvt" != "$define"; then
9752 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
9755 xxx_list="$xxx_ld_list"
9759 for xxx_convert in $xxx_list; do
9760 echo "Trying $xxx_convert..."
9761 $rm -f try try$_o core
9762 set try -DTRY_$xxx_convert
9763 if eval $compile; then
9764 echo "$xxx_convert() found." >&4
9766 echo "I'll use $xxx_convert to convert floats into a string." >&4
9769 echo "...But $xxx_convert didn't work as I expected."
9773 echo "$xxx_convert NOT found." >&4
9777 if test X$xxx_convert = X; then
9778 echo "*** WHOA THERE!!! ***" >&4
9779 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
9783 case "$xxx_convert" in
9784 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
9785 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
9786 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
9787 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
9788 "$define$define$define")
9789 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
9790 "$define$define$undef")
9791 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
9792 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
9800 : see if _fwalk exists
9804 : Initialize h_fcntl
9807 : Initialize h_sysfile
9810 : access call always available on UNIX
9814 : locate the flags for 'access()'
9818 $cat >access.c <<EOCP
9819 #include <sys/types.h>
9824 #include <sys/file.h>
9837 : check sys/file.h first, no particular reason here
9838 if $test `./findhdr sys/file.h` && \
9839 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
9841 echo "<sys/file.h> defines the *_OK access constants." >&4
9842 elif $test `./findhdr fcntl.h` && \
9843 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
9845 echo "<fcntl.h> defines the *_OK access constants." >&4
9846 elif $test `./findhdr unistd.h` && \
9847 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
9848 echo "<unistd.h> defines the *_OK access constants." >&4
9850 echo "I can't find the four *_OK access constants--I'll use mine." >&4
9856 : see if accessx exists
9857 set accessx d_accessx
9860 : see if aintl exists
9864 : see if alarm exists
9868 : see if POSIX threads are available
9869 set pthread.h i_pthread
9872 : define a fucntion to check prototypes
9873 $cat > protochk <<EOSH
9876 optimize="$optimize"
9878 prototype="$prototype"
9881 usethreads=$usethreads
9882 i_pthread=$i_pthread
9883 pthread_h_first=$pthread_h_first
9886 $cat >> protochk <<'EOSH'
9891 while test $# -ge 2; do
9893 $define) echo "#include <$2>" >> try.c ;;
9894 literal) echo "$2" >> try.c ;;
9896 # Extra magic for the benefit of systems that need pthread.h
9897 # to be included early to correctly detect threadsafe functions.
9898 # Such functions must guarantee themselves, though, that the usethreads
9899 # and i_pthread have been defined, before calling protochk.
9900 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
9901 echo "#include <pthread.h>" >> try.c
9906 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
9907 cat >> try.c <<'EOCP'
9908 #ifdef CAN_PROTOTYPE
9909 #define _(args) args
9914 echo "$foo" >> try.c
9915 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
9916 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
9924 : Define hasproto macro for Configure internal use
9925 hasproto='varname=$1; func=$2; shift; shift;
9926 while $test $# -ge 2; do
9928 $define) echo "#include <$2>";;
9932 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
9933 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
9934 echo "$func() prototype found.";
9937 echo "$func() prototype NOT found.";
9944 : see if sys/types.h has to be included
9945 set sys/types.h i_systypes
9948 : see if sys/select.h has to be included
9949 set sys/select.h i_sysselct
9952 : Define hasfield macro for Configure internal use
9953 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
9954 while $test $# -ge 2; do
9956 $define) echo "#include <$2>";;
9960 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
9962 if eval $compile; then
9971 : see if we should include time.h, sys/time.h, or both
9973 if test "X$timeincl" = X; then
9974 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
9975 $echo $n "I'm now running the test program...$c"
9977 #include <sys/types.h>
9982 #ifdef SYSTIMEKERNEL
9985 #include <sys/time.h>
9988 #include <sys/select.h>
10001 struct timezone tzp;
10003 if (foo.tm_sec == foo.tm_sec)
10006 if (bar.tv_sec == bar.tv_sec)
10013 for s_timezone in '-DS_TIMEZONE' ''; do
10015 for s_timeval in '-DS_TIMEVAL' ''; do
10016 for i_systimek in '' '-DSYSTIMEKERNEL'; do
10017 for i_time in '' '-DI_TIME'; do
10018 for i_systime in '-DI_SYSTIME' ''; do
10021 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
10022 if eval $compile; then
10023 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
10027 $echo $n "Succeeded with $flags$c"
10039 *SYSTIMEKERNEL*) i_systimek="$define"
10040 timeincl=`./findhdr sys/time.h`
10041 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
10042 *) i_systimek="$undef";;
10045 *I_TIME*) i_time="$define"
10046 timeincl=`./findhdr time.h`" $timeincl"
10047 echo "We'll include <time.h>." >&4;;
10048 *) i_time="$undef";;
10051 *I_SYSTIME*) i_systime="$define"
10052 timeincl=`./findhdr sys/time.h`" $timeincl"
10053 echo "We'll include <sys/time.h>." >&4;;
10054 *) i_systime="$undef";;
10058 : see if struct tm knows about tm_zone
10059 case "$i_systime$i_time" in
10062 echo "Checking to see if your struct tm has tm_zone field..." >&4
10063 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
10071 case "$d_tm_tm_zone" in
10072 "$define") echo "Yes, it does." ;;
10073 *) echo "No, it doesn't." ;;
10075 : see if struct tm knows about tm_gmtoff
10076 case "$i_systime$i_time" in
10079 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
10080 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
10088 case "$d_tm_tm_gmtoff" in
10089 "$define") echo "Yes, it does." ;;
10090 *) echo "No, it doesn't." ;;
10093 : see if asctime_r exists
10094 set asctime_r d_asctime_r
10096 case "$d_asctime_r" in
10098 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10099 case "$d_asctime_r_proto:$usethreads" in
10100 ":define") d_asctime_r_proto=define
10101 set d_asctime_r_proto asctime_r $hdrs
10105 case "$d_asctime_r_proto" in
10107 case "$asctime_r_proto" in
10108 ''|0) try='char* asctime_r(const struct tm*, char*);'
10109 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SB ;;
10111 case "$asctime_r_proto" in
10112 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
10113 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SBI ;;
10115 case "$asctime_r_proto" in
10116 ''|0) try='int asctime_r(const struct tm*, char*);'
10117 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SB ;;
10119 case "$asctime_r_proto" in
10120 ''|0) try='int asctime_r(const struct tm*, char*, int);'
10121 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SBI ;;
10123 case "$asctime_r_proto" in
10124 ''|0) d_asctime_r=undef
10126 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
10127 * ) case "$asctime_r_proto" in
10128 REENTRANT_PROTO*) ;;
10129 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
10131 echo "Prototype: $try" ;;
10134 *) case "$usethreads" in
10135 define) echo "asctime_r has no prototype, not using it." >&4 ;;
10142 *) asctime_r_proto=0
10146 : see if atolf exists
10150 : see if atoll exists
10154 : Look for GCC-style attribute format
10155 case "$d_attribute_format" in
10158 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
10159 $cat >attrib.c <<'EOCP'
10161 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
10163 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10164 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10165 echo "Your C compiler doesn't support __attribute__((format))."
10168 echo "Your C compiler supports __attribute__((format))."
10172 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10176 *) val="$d_attribute_format" ;;
10178 set d_attribute_format
10182 : Look for GCC-style attribute format with null format allowed
10183 case "$d_printf_format_null" in
10184 '') case "$d_attribute_format" in
10187 echo "Checking whether your compiler allows __printf__ format to be null ..." >&4
10188 $cat >attrib.c <<EOCP
10190 #$i_stdlib I_STDLIB
10192 #include <stdlib.h>
10194 int null_printf (char* pat,...) __attribute__((__format__(__printf__,1,2)));
10195 int null_printf (char* pat,...) { return (int)pat; }
10196 int main () { exit(null_printf(NULL)); }
10198 if $cc $ccflags -o attrib attrib.c >attrib.out 2>&1 ; then
10199 : run the executable in case it produces a run-time warning
10200 if $run ./attrib >>attrib.out 2>&1; then
10201 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10202 echo "Your C compiler doesn't allow __printf__ format to be null."
10205 echo "Your C compiler allows __printf__ format to be null."
10209 echo "Your C compiler executable failed with __printf__ format null."
10213 echo "Your C compiler fails with __printf__ format null."
10220 *) val="$d_printf_format_null" ;;
10222 set d_printf_format_null
10226 : Look for GCC-style attribute malloc
10227 case "$d_attribute_malloc" in
10230 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
10231 $cat >attrib.c <<'EOCP'
10233 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
10235 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10236 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10237 echo "Your C compiler doesn't support __attribute__((malloc))."
10240 echo "Your C compiler supports __attribute__((malloc))."
10244 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10248 *) val="$d_attribute_malloc" ;;
10250 set d_attribute_malloc
10254 : Look for GCC-style attribute nonnull
10255 case "$d_attribute_nonnull" in
10258 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
10259 $cat >attrib.c <<'EOCP'
10261 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
10263 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10264 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10265 echo "Your C compiler doesn't support __attribute__((nonnull))."
10268 echo "Your C compiler supports __attribute__((nonnull))."
10272 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10276 *) val="$d_attribute_nonnull" ;;
10278 set d_attribute_nonnull
10282 : Look for GCC-style attribute noreturn
10283 case "$d_attribute_noreturn" in
10286 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
10287 $cat >attrib.c <<'EOCP'
10289 void fall_over_dead( void ) __attribute__((noreturn));
10291 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10292 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10293 echo "Your C compiler doesn't support __attribute__((noreturn))."
10296 echo "Your C compiler supports __attribute__((noreturn))."
10300 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10304 *) val="$d_attribute_noreturn" ;;
10306 set d_attribute_noreturn
10310 : Look for GCC-style attribute pure
10311 case "$d_attribute_pure" in
10314 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
10315 $cat >attrib.c <<'EOCP'
10317 int square( int n ) __attribute__((pure));
10319 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10320 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10321 echo "Your C compiler doesn't support __attribute__((pure))."
10324 echo "Your C compiler supports __attribute__((pure))."
10328 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10332 *) val="$d_attribute_pure" ;;
10334 set d_attribute_pure
10338 : Look for GCC-style attribute unused
10339 case "$d_attribute_unused" in
10342 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
10343 $cat >attrib.c <<'EOCP'
10345 int do_something( int dummy __attribute__((unused)), int n );
10347 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10348 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10349 echo "Your C compiler doesn't support __attribute__((unused))."
10352 echo "Your C compiler supports __attribute__((unused))."
10356 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10360 *) val="$d_attribute_unused" ;;
10362 set d_attribute_unused
10366 : Look for GCC-style attribute warn_unused_result
10367 case "$d_attribute_warn_unused_result" in
10370 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
10371 $cat >attrib.c <<'EOCP'
10373 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
10375 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10376 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10377 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
10380 echo "Your C compiler supports __attribute__((warn_unused_result))."
10384 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10388 *) val="$d_attribute_warn_unused_result" ;;
10390 set d_attribute_warn_unused_result
10394 : see if bcmp exists
10398 : see if bcopy exists
10402 : see if getpgrp exists
10403 set getpgrp d_getpgrp
10406 case "$d_getpgrp" in
10409 echo "Checking to see which flavor of getpgrp is in use..."
10411 #$i_unistd I_UNISTD
10412 #include <sys/types.h>
10414 # include <unistd.h>
10416 #$i_stdlib I_STDLIB
10418 #include <stdlib.h>
10422 if (getuid() == 0) {
10423 printf("(I see you are running Configure as super-user...)\n");
10426 #ifdef TRY_BSD_PGRP
10427 if (getpgrp(1) == 0)
10436 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10437 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
10439 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10440 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
10443 echo "I can't seem to compile and run the test program."
10445 xxx="a USG one, i.e. you use getpgrp()."
10447 # SVR4 systems can appear rather BSD-ish.
10448 case "$i_unistd" in
10450 xxx="a BSD one, i.e. you use getpgrp(pid)."
10454 xxx="probably a USG one, i.e. you use getpgrp()."
10459 echo "Assuming your getpgrp is $xxx" >&4
10468 : see if setpgrp exists
10469 set setpgrp d_setpgrp
10472 case "$d_setpgrp" in
10475 echo "Checking to see which flavor of setpgrp is in use..."
10477 #$i_unistd I_UNISTD
10478 #include <sys/types.h>
10480 # include <unistd.h>
10482 #$i_stdlib I_STDLIB
10484 #include <stdlib.h>
10488 if (getuid() == 0) {
10489 printf("(I see you are running Configure as super-user...)\n");
10492 #ifdef TRY_BSD_PGRP
10493 if (-1 == setpgrp(1, 1))
10496 if (setpgrp() != -1)
10502 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10503 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
10505 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10506 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
10509 echo "(I can't seem to compile and run the test program.)"
10511 xxx="a USG one, i.e. you use setpgrp()."
10513 # SVR4 systems can appear rather BSD-ish.
10514 case "$i_unistd" in
10516 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
10520 xxx="probably a USG one, i.e. you use setpgrp()."
10525 echo "Assuming your setpgrp is $xxx" >&4
10534 : Look for GCC-style __builtin_choose_expr
10535 case "$d_builtin_choose_expr" in
10538 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
10539 $cat >try.c <<'EOCP'
10540 #include <assert.h>
10541 #include <stdlib.h>
10544 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
10547 assert( SYRINX(1) == 2112 );
10548 assert( SYRINX(1) != 5150 );
10549 assert( SYRINX(0) == 5150 );
10550 assert( SYRINX(0) != 2112 );
10551 puts( "All good!" );
10557 if eval $compile; then
10558 echo "Your C compiler supports __builtin_choose_expr."
10561 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
10565 *) val="$d_builtin_choose_expr" ;;
10568 set d_builtin_choose_expr
10572 : Look for GCC-style __builtin_expect
10573 case "$d_builtin_expect" in
10576 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
10577 $cat >builtin.c <<'EOCP'
10580 if ( __builtin_expect(n, 0) ) n = 1;
10584 if eval $compile; then
10585 echo "Your C compiler supports __builtin_choose_expr."
10588 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
10592 *) val="$d_builtin_expect" ;;
10595 set d_builtin_expect
10599 : see if bzero exists
10603 : see if stdarg is available
10605 if $test `./findhdr stdarg.h`; then
10606 echo "<stdarg.h> found." >&4
10609 echo "<stdarg.h> NOT found." >&4
10613 : see if varags is available
10615 if $test `./findhdr varargs.h`; then
10616 echo "<varargs.h> found." >&4
10618 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
10621 : set up the varargs testing programs
10622 $cat > varargs.c <<EOP
10624 #include <stdarg.h>
10627 #include <varargs.h>
10631 int f(char *p, ...)
10645 p = va_arg(ap, char *);
10651 $cat > varargs <<EOP
10653 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
10662 : now check which varargs header should be included
10667 if `./varargs I_STDARG`; then
10669 elif `./varargs I_VARARGS`; then
10674 if `./varargs I_VARARGS`; then
10681 echo "I could not find the definition for va_dcl... You have problems..." >&4
10682 val="$undef"; set i_stdarg; eval $setvar
10683 val="$undef"; set i_varargs; eval $setvar
10688 case "$i_varhdr" in
10690 val="$define"; set i_stdarg; eval $setvar
10691 val="$undef"; set i_varargs; eval $setvar
10694 val="$undef"; set i_stdarg; eval $setvar
10695 val="$define"; set i_varargs; eval $setvar
10698 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
10702 : see if the Compiler supports C99 variadic macros
10703 case "$i_stdarg$i_stdlib" in
10705 echo "You have <stdarg.h> and <stdlib.h>, so checking for C99 variadic macros." >&4
10708 #include <stdarg.h>
10710 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
10714 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
10720 if eval $compile && $run ./try 2>&1 >/dev/null; then
10721 case "`$run ./try`" in
10723 echo "You have C99 variadic macros." >&4
10724 d_c99_variadic_macros="$define"
10727 echo "You don't have functional C99 variadic macros." >&4
10728 d_c99_variadic_macros="$undef"
10732 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
10733 d_c99_variadic_macros="$undef"
10738 echo "You don't have <stdarg.h> and <stdlib.h>, so not checking for C99 variadic macros." >&4
10739 d_c99_variadic_macros="$undef"
10743 : see if signal is declared as pointer to function returning int or void
10745 xxx=`./findhdr signal.h`
10746 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
10747 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10748 echo "You have int (*signal())() instead of void." >&4
10750 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10751 echo "You have void (*signal())()." >&4
10753 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
10754 echo "You have int (*signal())() instead of void." >&4
10756 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
10757 echo "You have void (*signal())()." >&4
10760 case "$d_voidsig" in
10762 echo "I can't determine whether signal handler returns void or int..." >&4
10764 rp="What type does your signal handler return?"
10767 v*) val="$define";;
10771 echo "As you already told me, signal handler returns void." >&4
10774 *) echo "As you already told me, signal handler returns int." >&4
10781 case "$d_voidsig" in
10782 "$define") signal_t="void";;
10783 *) signal_t="int";;
10787 : check for ability to cast large floats to 32-bit ints.
10789 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
10790 if $test "$intsize" -ge 4; then
10797 #$i_stdlib I_STDLIB
10799 #include <stdlib.h>
10801 #include <sys/types.h>
10802 #include <signal.h>
10803 $signal_t blech(int s) { exit(3); }
10810 signal(SIGFPE, blech);
10812 /* Don't let compiler optimize the test away. Store the number
10813 in a writable string for gcc to pass to sscanf under HP/UX.
10815 sprintf(str, "2147483647");
10816 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
10820 /* x86 processors will probably give 0x8000 0000, which is a
10821 sign change. We don't want that. We want to mimic SPARC
10822 behavior here, which is to preserve the sign and give
10825 if (i32 != ($xxx) f)
10831 if eval $compile_ok; then
10835 echo "(I can't seem to compile the test program--assuming it can't)"
10840 echo "Yup, it can."
10843 echo "Nope, it can't."
10850 : check for ability to cast negative floats to unsigned
10852 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
10855 #$i_stdlib I_STDLIB
10857 #include <stdlib.h>
10859 #include <sys/types.h>
10860 #include <signal.h>
10861 $signal_t blech(int s) { exit(7); }
10862 $signal_t blech_in_list(int s) { exit(4); }
10863 unsigned long dummy_long(unsigned long p) { return p; }
10864 unsigned int dummy_int(unsigned int p) { return p; }
10865 unsigned short dummy_short(unsigned short p) { return p; }
10869 unsigned long along;
10871 unsigned short ashort;
10875 /* Frustrate gcc-2.7.2's optimizer which failed this test with
10876 a direct f = -123. assignment. gcc-2.8.0 reportedly
10877 optimized the whole file away
10879 /* Store the number in a writable string for gcc to pass to
10880 sscanf under HP/UX.
10882 sprintf(str, "-123");
10883 sscanf(str, "%lf", &f); /* f = -123.; */
10885 signal(SIGFPE, blech);
10886 along = (unsigned long)f;
10887 aint = (unsigned int)f;
10888 ashort = (unsigned short)f;
10889 if (along != (unsigned long)-123)
10891 if (aint != (unsigned int)-123)
10893 if (ashort != (unsigned short)-123)
10895 sprintf(str, "1073741824.");
10896 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
10899 along = (unsigned long)f;
10900 if (along != 0x80000000)
10904 along = (unsigned long)f;
10905 if (along != 0x7fffffff)
10909 along = (unsigned long)f;
10910 if (along != 0x80000001)
10914 signal(SIGFPE, blech_in_list);
10915 sprintf(str, "123.");
10916 sscanf(str, "%lf", &f); /* f = 123.; */
10917 along = dummy_long((unsigned long)f);
10918 aint = dummy_int((unsigned int)f);
10919 ashort = dummy_short((unsigned short)f);
10920 if (along != (unsigned long)123)
10922 if (aint != (unsigned int)123)
10924 if (ashort != (unsigned short)123)
10931 if eval $compile_ok; then
10935 echo "(I can't seem to compile the test program--assuming it can't)"
10938 case "$castflags" in
10940 echo "Yup, it can."
10943 echo "Nope, it can't."
10950 : see if vprintf exists
10952 if set vprintf val -f d_vprintf; eval $csym; $val; then
10953 echo 'vprintf() found.' >&4
10956 #$i_stdarg I_STDARG /* Only one of these can be defined by i_varhrd */
10957 #$i_varargs I_VARARGS
10959 #$i_stdlib I_STDLIB
10960 #$i_unistd I_UNISTD
10963 # include <stdarg.h>
10964 #else /* I_VARARGS */
10965 # include <varargs.h>
10969 # include <unistd.h>
10973 # include <stdlib.h>
10976 #include <stdio.h> /* vsprintf prototype */
10979 void xxx(int n, ...)
10984 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
10986 int main() { xxx(1, "foo"); }
10988 #else /* I_VARARGS */
10996 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
10998 int main() { xxx("foo"); }
11004 if eval $compile_ok; then
11005 if $run ./try; then
11006 echo "Your vsprintf() returns (int)." >&4
11009 echo "Your vsprintf() returns (char*)." >&4
11013 echo 'I am unable to compile the vsprintf() test program.' >&4
11014 # We shouldn't get here. If we do, assume the standard signature,
11015 # not the old BSD one.
11016 echo 'Guessing that vsprintf() returns (int).' >&4
11020 echo 'vprintf() NOT found.' >&4
11031 : see if chown exists
11035 : see if chroot exists
11036 set chroot d_chroot
11039 : see if chsize exists
11040 set chsize d_chsize
11043 : see if class exists
11047 : see if clearenv exists
11048 set clearenv d_clearenv
11051 : Define hasstruct macro for Configure internal use
11052 hasstruct='varname=$1; struct=$2; shift; shift;
11053 while $test $# -ge 2; do
11055 $define) echo "#include <$2>";;
11059 echo "int main () { struct $struct foo; }" >> try.c;
11061 if eval $compile; then
11070 : see whether socket exists
11074 $echo $n "Hmm... $c" >&4
11075 if set socket val -f d_socket; eval $csym; $val; then
11076 echo "Looks like you have Berkeley networking support." >&4
11078 if set setsockopt val -f; eval $csym; $val; then
11081 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
11082 d_oldsock="$define"
11085 if $contains socklib libc.list >/dev/null 2>&1; then
11086 echo "Looks like you have Berkeley networking support." >&4
11088 : we will have to assume that it supports the 4.2 BSD interface
11091 echo "You don't have Berkeley networking in libc$_a..." >&4
11092 if test "X$d_socket" = "X$define"; then
11093 echo "...but you seem to believe that you have sockets." >&4
11095 for net in net socket
11097 if test -f /usr/lib/lib$net$_a; then
11098 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
11099 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
11100 if $contains socket libc.list >/dev/null 2>&1; then
11105 echo "...but the Wollongong group seems to have hacked it in." >&4
11106 sockethdr="-I/usr/netinclude"
11109 echo "Found Berkeley sockets interface in lib$net." >&4
11110 if $contains setsockopt libc.list >/dev/null 2>&1; then
11113 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
11114 d_oldsock="$define"
11120 if test "X$d_socket" != "X$define"; then
11121 echo "or anywhere else I see." >&4
11129 : see if socketpair exists
11130 set socketpair d_sockpair
11135 echo "Checking the availability of certain socket constants..." >&4
11136 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
11137 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
11139 #include <sys/types.h>
11140 #include <sys/socket.h>
11146 set try; if eval $compile; then
11149 set d_${enum}; eval $setvar
11153 : see if this is a sys/uio.h system
11154 set sys/uio.h i_sysuio
11157 : Check for cmsghdr support
11159 echo "Checking to see if your system supports struct cmsghdr..." >&4
11160 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
11162 case "$d_cmsghdr_s" in
11163 "$define") echo "Yes, it does." ;;
11164 *) echo "No, it doesn't." ;;
11168 : check for const keyword
11170 echo 'Checking to see if your C compiler knows about "const"...' >&4
11171 $cat >const.c <<'EOCP'
11172 typedef struct spug { int drokk; } spug;
11176 const spug y = { 0 };
11179 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
11181 echo "Yup, it does."
11184 echo "Nope, it doesn't."
11189 : see if copysignl exists
11190 set copysignl d_copysignl
11193 : see if crypt exists
11198 $define) cryptlib='' ;;
11199 *) if set crypt val -f d_crypt; eval $csym; $val; then
11200 echo 'crypt() found.' >&4
11204 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
11205 if $test -z "$cryptlib"; then
11206 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
11210 if $test -z "$cryptlib"; then
11211 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
11215 if $test -z "$cryptlib"; then
11216 cryptlib=`./loc libcrypt$_a "" $libpth`
11220 if $test -z "$cryptlib"; then
11221 echo 'crypt() NOT found.' >&4
11232 : see if this is a crypt.h system
11233 set crypt.h i_crypt
11236 : see if crypt_r exists
11237 set crypt_r d_crypt_r
11239 case "$d_crypt_r" in
11241 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
11242 case "$d_crypt_r_proto:$usethreads" in
11243 ":define") d_crypt_r_proto=define
11244 set d_crypt_r_proto crypt_r $hdrs
11248 case "$d_crypt_r_proto" in
11250 case "$crypt_r_proto" in
11251 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
11252 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCS ;;
11254 case "$crypt_r_proto" in
11255 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
11256 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCD ;;
11258 case "$crypt_r_proto" in
11259 ''|0) d_crypt_r=undef
11261 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
11262 * ) case "$crypt_r_proto" in
11263 REENTRANT_PROTO*) ;;
11264 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
11266 echo "Prototype: $try" ;;
11269 *) case "$usethreads" in
11270 define) echo "crypt_r has no prototype, not using it." >&4 ;;
11281 : get csh whereabouts
11283 'csh') val="$undef" ;;
11284 *) val="$define" ;;
11288 : Respect a hint or command line value for full_csh.
11289 case "$full_csh" in
11290 '') full_csh=$csh ;;
11293 : see if ctermid exists
11294 set ctermid d_ctermid
11297 : see if ctermid_r exists
11298 set ctermid_r d_ctermid_r
11300 case "$d_ctermid_r" in
11302 hdrs="$i_systypes sys/types.h define stdio.h "
11303 case "$d_ctermid_r_proto:$usethreads" in
11304 ":define") d_ctermid_r_proto=define
11305 set d_ctermid_r_proto ctermid_r $hdrs
11309 case "$d_ctermid_r_proto" in
11311 case "$ctermid_r_proto" in
11312 ''|0) try='char* ctermid_r(char*);'
11313 ./protochk "extern $try" $hdrs && ctermid_r_proto=B_B ;;
11315 case "$ctermid_r_proto" in
11316 ''|0) d_ctermid_r=undef
11318 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
11319 * ) case "$ctermid_r_proto" in
11320 REENTRANT_PROTO*) ;;
11321 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
11323 echo "Prototype: $try" ;;
11326 *) case "$usethreads" in
11327 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
11334 *) ctermid_r_proto=0
11338 : see if ctime_r exists
11339 set ctime_r d_ctime_r
11341 case "$d_ctime_r" in
11343 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
11344 case "$d_ctime_r_proto:$usethreads" in
11345 ":define") d_ctime_r_proto=define
11346 set d_ctime_r_proto ctime_r $hdrs
11350 case "$d_ctime_r_proto" in
11352 case "$ctime_r_proto" in
11353 ''|0) try='char* ctime_r(const time_t*, char*);'
11354 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SB ;;
11356 case "$ctime_r_proto" in
11357 ''|0) try='char* ctime_r(const time_t*, char*, int);'
11358 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SBI ;;
11360 case "$ctime_r_proto" in
11361 ''|0) try='int ctime_r(const time_t*, char*);'
11362 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SB ;;
11364 case "$ctime_r_proto" in
11365 ''|0) try='int ctime_r(const time_t*, char*, int);'
11366 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SBI ;;
11368 case "$ctime_r_proto" in
11369 ''|0) d_ctime_r=undef
11371 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
11372 * ) case "$ctime_r_proto" in
11373 REENTRANT_PROTO*) ;;
11374 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
11376 echo "Prototype: $try" ;;
11379 *) case "$usethreads" in
11380 define) echo "ctime_r has no prototype, not using it." >&4 ;;
11391 : see if cuserid exists
11392 set cuserid d_cuserid
11395 : see if this is a limits.h system
11396 set limits.h i_limits
11399 : see if this is a float.h system
11400 set float.h i_float
11403 : See if number of significant digits in a double precision number is known
11405 $cat >dbl_dig.c <<EOM
11406 #$i_limits I_LIMITS
11409 #include <limits.h>
11415 printf("Contains DBL_DIG");
11418 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
11419 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
11420 echo "DBL_DIG found." >&4
11423 echo "DBL_DIG NOT found." >&4
11430 : see if dbm.h is available
11431 : see if dbmclose exists
11432 set dbmclose d_dbmclose
11435 case "$d_dbmclose" in
11445 *) set rpcsvc/dbm.h i_rpcsvcdbm
11450 *) echo "We won't be including <dbm.h>"
11460 : see if prototype for dbminit is available
11462 set d_dbminitproto dbminit $i_dbm dbm.h
11465 : see if difftime exists
11466 set difftime d_difftime
11469 : see if this is a dirent system
11471 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
11473 echo "<dirent.h> found." >&4
11476 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
11477 echo "<sys/dir.h> found." >&4
11480 xinc=`./findhdr sys/ndir.h`
11482 echo "<dirent.h> NOT found." >&4
11487 : Look for type of directory structure.
11489 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11491 case "$direntrytype" in
11493 case "$i_dirent" in
11494 $define) guess1='struct dirent' ;;
11495 *) guess1='struct direct' ;;
11498 *) guess1="$direntrytype"
11503 'struct dirent') guess2='struct direct' ;;
11504 *) guess2='struct dirent' ;;
11507 if $contains "$guess1" try.c >/dev/null 2>&1; then
11508 direntrytype="$guess1"
11509 echo "Your directory entries are $direntrytype." >&4
11510 elif $contains "$guess2" try.c >/dev/null 2>&1; then
11511 direntrytype="$guess2"
11512 echo "Your directory entries seem to be $direntrytype." >&4
11514 echo "I don't recognize your system's directory entries." >&4
11515 rp="What type is used for directory entries on this system?"
11518 direntrytype="$ans"
11522 : see if the directory entry stores field length
11524 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11525 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
11526 echo "Good, your directory entry keeps length information in d_namlen." >&4
11529 echo "Your directory entry does not know about the d_namlen field." >&4
11536 : Look for DIR.dd_fd
11537 case "$i_dirent" in
11539 echo "Checking to see if DIR has a dd_fd member variable" >&4
11541 #$i_stdlib I_STDLIB
11543 #include <stdlib.h>
11545 #include <dirent.h>
11555 if eval $compile; then
11556 echo "Yes, it does."
11559 echo "No, it does not."
11564 echo "You don't have a <dirent.h>, so not checking for dd_fd." >&4
11572 : see if this is an sysdir system
11573 set sys/dir.h i_sysdir
11576 : see if this is an sysndir system
11577 set sys/ndir.h i_sysndir
11582 $cat >dirfd.c <<EOM
11584 #$i_stdlib I_STDLIB
11586 #include <stdlib.h>
11588 #$i_dirent I_DIRENT /**/
11589 #$i_sysdir I_SYS_DIR /**/
11590 #$i_sysndir I_SYS_NDIR /**/
11591 #$i_systypes I_SYS_TYPES /**/
11592 #if defined(I_SYS_TYPES)
11593 #include <sys/types.h>
11595 #if defined(I_DIRENT)
11596 #include <dirent.h>
11597 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
11598 #include <sys/dir.h>
11602 #include <sys/ndir.h>
11606 #include <ndir.h> /* may be wrong in the future */
11608 #include <sys/dir.h>
11614 DIR *dirp = opendir(".");
11615 if (dirfd(dirp) >= 0)
11623 if eval $compile; then
11627 $define) echo "dirfd() found." >&4 ;;
11628 *) echo "dirfd() NOT found." >&4 ;;
11634 : see if dlerror exists
11637 set dlerror d_dlerror
11641 : see if dlfcn is available
11642 set dlfcn.h i_dlfcn
11645 : Check what extension to use for shared libs
11650 On a few systems, the dynamically loaded modules that perl generates and uses
11651 will need a different extension than shared libs. The default will probably
11657 *) dflt="$dlext" ;;
11659 rp='What is the extension of dynamically loaded modules'
11668 : Check if dlsym need a leading underscore
11674 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
11675 $cat >dyna.c <<'EOM'
11682 #$i_stdlib I_STDLIB
11684 #include <stdlib.h>
11688 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
11690 #include <sys/types.h>
11695 extern int fred() ;
11704 int mode = RTLD_LAZY ;
11706 handle = dlopen("./dyna.$dlext", mode) ;
11707 if (handle == NULL) {
11712 symbol = dlsym(handle, "fred") ;
11713 if (symbol == NULL) {
11714 /* try putting a leading underscore */
11715 symbol = dlsym(handle, "_fred") ;
11716 if (symbol == NULL) {
11729 : Call the object file tmp-dyna.o in case dlext=o.
11730 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
11731 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
11732 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
11733 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
11736 1) echo "Test program failed using dlopen." >&4
11737 echo "Perhaps you should not use dynamic loading." >&4;;
11738 2) echo "Test program failed using dlsym." >&4
11739 echo "Perhaps you should not use dynamic loading." >&4;;
11740 3) echo "dlsym needs a leading underscore" >&4
11742 4) echo "dlsym doesn't need a leading underscore." >&4;;
11745 echo "I can't compile and run the test program." >&4
11746 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
11751 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
11756 : see if drand48_r exists
11757 set drand48_r d_drand48_r
11759 case "$d_drand48_r" in
11761 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
11762 case "$d_drand48_r_proto:$usethreads" in
11763 ":define") d_drand48_r_proto=define
11764 set d_drand48_r_proto drand48_r $hdrs
11768 case "$d_drand48_r_proto" in
11770 case "$drand48_r_proto" in
11771 ''|0) try='int drand48_r(struct drand48_data*, double*);'
11772 ./protochk "extern $try" $hdrs && drand48_r_proto=I_ST ;;
11774 case "$drand48_r_proto" in
11775 ''|0) d_drand48_r=undef
11777 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
11778 * ) case "$drand48_r_proto" in
11779 REENTRANT_PROTO*) ;;
11780 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
11782 echo "Prototype: $try" ;;
11785 *) case "$usethreads" in
11786 define) echo "drand48_r has no prototype, not using it." >&4 ;;
11793 *) drand48_r_proto=0
11797 : see if prototype for drand48 is available
11799 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
11802 : see if dup2 exists
11806 : see if eaccess exists
11807 set eaccess d_eaccess
11810 : see if endgrent exists
11811 set endgrent d_endgrent
11814 : see if this is an grp system
11820 xxx=`./findhdr grp.h`
11821 $cppstdin $cppflags $cppminus < $xxx >$$.h
11823 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
11835 set d_grpasswd; eval $setvar
11839 : see if endgrent_r exists
11840 set endgrent_r d_endgrent_r
11842 case "$d_endgrent_r" in
11844 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
11845 case "$d_endgrent_r_proto:$usethreads" in
11846 ":define") d_endgrent_r_proto=define
11847 set d_endgrent_r_proto endgrent_r $hdrs
11851 case "$d_endgrent_r_proto" in
11853 case "$endgrent_r_proto" in
11854 ''|0) try='int endgrent_r(FILE**);'
11855 ./protochk "extern $try" $hdrs && endgrent_r_proto=I_H ;;
11857 case "$endgrent_r_proto" in
11858 ''|0) try='void endgrent_r(FILE**);'
11859 ./protochk "extern $try" $hdrs && endgrent_r_proto=V_H ;;
11861 case "$endgrent_r_proto" in
11862 ''|0) d_endgrent_r=undef
11864 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
11865 * ) case "$endgrent_r_proto" in
11866 REENTRANT_PROTO*) ;;
11867 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
11869 echo "Prototype: $try" ;;
11872 *) case "$usethreads" in
11873 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
11880 *) endgrent_r_proto=0
11884 : see if endhostent exists
11885 set endhostent d_endhent
11888 : see if this is a netdb.h system
11889 set netdb.h i_netdb
11892 : see if endhostent_r exists
11893 set endhostent_r d_endhostent_r
11895 case "$d_endhostent_r" in
11897 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11898 case "$d_endhostent_r_proto:$usethreads" in
11899 ":define") d_endhostent_r_proto=define
11900 set d_endhostent_r_proto endhostent_r $hdrs
11904 case "$d_endhostent_r_proto" in
11906 case "$endhostent_r_proto" in
11907 ''|0) try='int endhostent_r(struct hostent_data*);'
11908 ./protochk "extern $try" $hdrs && endhostent_r_proto=I_D ;;
11910 case "$endhostent_r_proto" in
11911 ''|0) try='void endhostent_r(struct hostent_data*);'
11912 ./protochk "extern $try" $hdrs && endhostent_r_proto=V_D ;;
11914 case "$endhostent_r_proto" in
11915 ''|0) d_endhostent_r=undef
11916 endhostent_r_proto=0
11917 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
11918 * ) case "$endhostent_r_proto" in
11919 REENTRANT_PROTO*) ;;
11920 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
11922 echo "Prototype: $try" ;;
11925 *) case "$usethreads" in
11926 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
11928 d_endhostent_r=undef
11929 endhostent_r_proto=0
11933 *) endhostent_r_proto=0
11937 : see if endnetent exists
11938 set endnetent d_endnent
11941 : see if endnetent_r exists
11942 set endnetent_r d_endnetent_r
11944 case "$d_endnetent_r" in
11946 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11947 case "$d_endnetent_r_proto:$usethreads" in
11948 ":define") d_endnetent_r_proto=define
11949 set d_endnetent_r_proto endnetent_r $hdrs
11953 case "$d_endnetent_r_proto" in
11955 case "$endnetent_r_proto" in
11956 ''|0) try='int endnetent_r(struct netent_data*);'
11957 ./protochk "extern $try" $hdrs && endnetent_r_proto=I_D ;;
11959 case "$endnetent_r_proto" in
11960 ''|0) try='void endnetent_r(struct netent_data*);'
11961 ./protochk "extern $try" $hdrs && endnetent_r_proto=V_D ;;
11963 case "$endnetent_r_proto" in
11964 ''|0) d_endnetent_r=undef
11965 endnetent_r_proto=0
11966 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
11967 * ) case "$endnetent_r_proto" in
11968 REENTRANT_PROTO*) ;;
11969 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
11971 echo "Prototype: $try" ;;
11974 *) case "$usethreads" in
11975 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
11977 d_endnetent_r=undef
11978 endnetent_r_proto=0
11982 *) endnetent_r_proto=0
11986 : see if endprotoent exists
11987 set endprotoent d_endpent
11990 : see if endprotoent_r exists
11991 set endprotoent_r d_endprotoent_r
11993 case "$d_endprotoent_r" in
11995 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11996 case "$d_endprotoent_r_proto:$usethreads" in
11997 ":define") d_endprotoent_r_proto=define
11998 set d_endprotoent_r_proto endprotoent_r $hdrs
12002 case "$d_endprotoent_r_proto" in
12004 case "$endprotoent_r_proto" in
12005 ''|0) try='int endprotoent_r(struct protoent_data*);'
12006 ./protochk "extern $try" $hdrs && endprotoent_r_proto=I_D ;;
12008 case "$endprotoent_r_proto" in
12009 ''|0) try='void endprotoent_r(struct protoent_data*);'
12010 ./protochk "extern $try" $hdrs && endprotoent_r_proto=V_D ;;
12012 case "$endprotoent_r_proto" in
12013 ''|0) d_endprotoent_r=undef
12014 endprotoent_r_proto=0
12015 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
12016 * ) case "$endprotoent_r_proto" in
12017 REENTRANT_PROTO*) ;;
12018 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
12020 echo "Prototype: $try" ;;
12023 *) case "$usethreads" in
12024 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
12026 d_endprotoent_r=undef
12027 endprotoent_r_proto=0
12031 *) endprotoent_r_proto=0
12035 : see if endpwent exists
12036 set endpwent d_endpwent
12039 : see if this is a pwd.h system
12045 xxx=`./findhdr pwd.h`
12046 $cppstdin $cppflags $cppminus < $xxx >$$.h
12048 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
12056 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
12064 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
12072 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
12080 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
12088 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
12096 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
12104 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
12116 set d_pwquota; eval $setvar
12117 set d_pwage; eval $setvar
12118 set d_pwchange; eval $setvar
12119 set d_pwclass; eval $setvar
12120 set d_pwexpire; eval $setvar
12121 set d_pwcomment; eval $setvar
12122 set d_pwgecos; eval $setvar
12123 set d_pwpasswd; eval $setvar
12127 : see if endpwent_r exists
12128 set endpwent_r d_endpwent_r
12130 case "$d_endpwent_r" in
12132 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
12133 case "$d_endpwent_r_proto:$usethreads" in
12134 ":define") d_endpwent_r_proto=define
12135 set d_endpwent_r_proto endpwent_r $hdrs
12139 case "$d_endpwent_r_proto" in
12141 case "$endpwent_r_proto" in
12142 ''|0) try='int endpwent_r(FILE**);'
12143 ./protochk "extern $try" $hdrs && endpwent_r_proto=I_H ;;
12145 case "$endpwent_r_proto" in
12146 ''|0) try='void endpwent_r(FILE**);'
12147 ./protochk "extern $try" $hdrs && endpwent_r_proto=V_H ;;
12149 case "$endpwent_r_proto" in
12150 ''|0) d_endpwent_r=undef
12152 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
12153 * ) case "$endpwent_r_proto" in
12154 REENTRANT_PROTO*) ;;
12155 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
12157 echo "Prototype: $try" ;;
12160 *) case "$usethreads" in
12161 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
12168 *) endpwent_r_proto=0
12172 : see if endservent exists
12173 set endservent d_endsent
12176 : see if endservent_r exists
12177 set endservent_r d_endservent_r
12179 case "$d_endservent_r" in
12181 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12182 case "$d_endservent_r_proto:$usethreads" in
12183 ":define") d_endservent_r_proto=define
12184 set d_endservent_r_proto endservent_r $hdrs
12188 case "$d_endservent_r_proto" in
12190 case "$endservent_r_proto" in
12191 ''|0) try='int endservent_r(struct servent_data*);'
12192 ./protochk "extern $try" $hdrs && endservent_r_proto=I_D ;;
12194 case "$endservent_r_proto" in
12195 ''|0) try='void endservent_r(struct servent_data*);'
12196 ./protochk "extern $try" $hdrs && endservent_r_proto=V_D ;;
12198 case "$endservent_r_proto" in
12199 ''|0) d_endservent_r=undef
12200 endservent_r_proto=0
12201 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
12202 * ) case "$endservent_r_proto" in
12203 REENTRANT_PROTO*) ;;
12204 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
12206 echo "Prototype: $try" ;;
12209 *) case "$usethreads" in
12210 define) echo "endservent_r has no prototype, not using it." >&4 ;;
12212 d_endservent_r=undef
12213 endservent_r_proto=0
12217 *) endservent_r_proto=0
12221 : Locate the flags for 'open()'
12224 #include <sys/types.h>
12229 #include <sys/file.h>
12231 #$i_stdlib I_STDLIB
12233 #include <stdlib.h>
12244 : check sys/file.h first to get FREAD on Sun
12245 if $test `./findhdr sys/file.h` && \
12246 set try -DI_SYS_FILE && eval $compile; then
12248 echo "<sys/file.h> defines the O_* constants..." >&4
12249 if $run ./try; then
12250 echo "and you have the 3 argument form of open()." >&4
12253 echo "but not the 3 argument form of open(). Oh, well." >&4
12256 elif $test `./findhdr fcntl.h` && \
12257 set try -DI_FCNTL && eval $compile; then
12259 echo "<fcntl.h> defines the O_* constants..." >&4
12260 if $run ./try; then
12261 echo "and you have the 3 argument form of open()." >&4
12264 echo "but not the 3 argument form of open(). Oh, well." >&4
12269 echo "I can't find the O_* constant definitions! You got problems." >&4
12275 : script used to emit important warnings
12278 if test \$# -gt 0; then
12283 echo "*** WARNING:" >&4
12284 sed -e 's/^/*** /' <msg >&4
12286 cat msg >>config.msg
12287 echo " " >>config.msg
12293 : see which of string.h or strings.h is needed
12295 strings=`./findhdr string.h`
12296 if $test "$strings" && $test -r "$strings"; then
12297 echo "Using <string.h> instead of <strings.h>." >&4
12301 strings=`./findhdr strings.h`
12302 if $test "$strings" && $test -r "$strings"; then
12303 echo "Using <strings.h> instead of <string.h>." >&4
12305 ./warn "No string header found -- You'll surely have problems."
12310 case "$i_string" in
12311 "$undef") strings=`./findhdr strings.h`;;
12312 *) strings=`./findhdr string.h`;;
12315 : see if this is a sys/file.h system
12320 : do we need to include sys/file.h ?
12324 if $h_sysfile; then
12326 echo "We'll be including <sys/file.h>." >&4
12329 echo "We won't be including <sys/file.h>." >&4
12339 : see if fcntl.h is there
12344 : see if we can include fcntl.h
12350 echo "We'll be including <fcntl.h>." >&4
12353 if $h_sysfile; then
12354 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
12356 echo "We won't be including <fcntl.h>." >&4
12368 : see if fork exists
12372 : see if pipe exists
12376 : check for non-blocking I/O stuff
12377 case "$h_sysfile" in
12378 true) echo "#include <sys/file.h>" > head.c;;
12381 true) echo "#include <fcntl.h>" > head.c;;
12382 *) echo "#include <sys/fcntl.h>" > head.c;;
12387 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
12388 case "$o_nonblock" in
12390 $cat head.c > try.c
12391 $cat >>try.c <<EOCP
12393 #$i_stdlib I_STDLIB
12395 #include <stdlib.h>
12403 printf("O_NONBLOCK\n");
12407 printf("O_NDELAY\n");
12411 printf("FNDELAY\n");
12418 if eval $compile_ok; then
12419 o_nonblock=`$run ./try`
12420 case "$o_nonblock" in
12421 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
12422 *) echo "Seems like we can use $o_nonblock.";;
12425 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
12428 *) echo "Using $hint value $o_nonblock.";;
12433 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
12436 case "$d_fork:$d_pipe" in
12438 $cat head.c > try.c
12439 $cat >>try.c <<EOCP
12441 #include <sys/types.h>
12442 #include <signal.h>
12444 #$i_stdlib I_STDLIB
12446 #include <stdlib.h>
12452 #define MY_O_NONBLOCK $o_nonblock
12453 #ifndef errno /* XXX need better Configure test */
12456 #$i_unistd I_UNISTD
12458 #include <unistd.h>
12460 #$i_string I_STRING
12462 #include <string.h>
12464 #include <strings.h>
12466 $signal_t blech(int x) { exit(3); }
12468 $cat >> try.c <<'EOCP'
12476 pipe(pd); /* Down: child -> parent */
12477 pipe(pu); /* Up: parent -> child */
12480 close(pd[1]); /* Parent reads from pd[0] */
12481 close(pu[0]); /* Parent writes (blocking) to pu[1] */
12483 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
12488 signal(SIGALRM, blech);
12490 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
12492 sprintf(string, "%d\n", ret);
12493 write(2, string, strlen(string));
12496 if (errno == EAGAIN) {
12497 printf("EAGAIN\n");
12502 if (errno == EWOULDBLOCK)
12503 printf("EWOULDBLOCK\n");
12506 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
12507 sleep(2); /* Give it time to close our pipe */
12509 ret = read(pd[0], buf, 1); /* Should read EOF */
12511 sprintf(string, "%d\n", ret);
12512 write(4, string, strlen(string));
12516 close(pd[0]); /* We write to pd[1] */
12517 close(pu[1]); /* We read from pu[0] */
12518 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
12519 close(pd[1]); /* Pipe pd is now fully closed! */
12520 exit(0); /* Bye bye, thank you for playing! */
12524 if eval $compile_ok; then
12525 echo "$startsh" >mtry
12526 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
12528 ./mtry >/dev/null 2>&1
12530 0) eagain=`$cat try.out`;;
12531 1) echo "Could not perform non-blocking setting!";;
12532 2) echo "I did a successful read() for something that was not there!";;
12533 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
12534 4) echo "Could not find F_SETFL!";;
12535 *) echo "Something terribly wrong happened during testing.";;
12537 rd_nodata=`$cat try.ret`
12538 echo "A read() system call with no data present returns $rd_nodata."
12539 case "$rd_nodata" in
12542 echo "(That's peculiar, fixing that to be -1.)"
12548 echo "Forcing errno EAGAIN on read() with no data available."
12552 echo "Your read() sets errno to $eagain when no data is available."
12555 status=`$cat try.err`
12557 0) echo "And it correctly returns 0 to signal EOF.";;
12558 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
12559 *) echo "However, your read() returns '$status' on EOF??";;
12562 if test "$status" = "$rd_nodata"; then
12563 echo "WARNING: you can't distinguish between EOF and no data!"
12567 echo "I can't compile the test program--assuming errno EAGAIN will do."
12571 *) echo "Can't figure out how to test this--assuming errno EAGAIN will do."
12580 echo "Using $hint value $eagain."
12581 echo "Your read() returns $rd_nodata when no data is present."
12582 case "$d_eofnblk" in
12583 "$define") echo "And you can see EOF because read() returns 0.";;
12584 "$undef") echo "But you can't see EOF status from read() returned value.";;
12586 echo "(Assuming you can't see EOF status from read anyway.)"
12592 $rm_try head.c mtry
12594 : see if _ptr and _cnt from stdio act std
12597 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
12598 echo "(Looks like you have stdio.h from BSD.)"
12599 case "$stdio_ptr" in
12600 '') stdio_ptr='((fp)->_p)'
12603 *) ptr_lval=$d_stdio_ptr_lval;;
12605 case "$stdio_cnt" in
12606 '') stdio_cnt='((fp)->_r)'
12609 *) cnt_lval=$d_stdio_cnt_lval;;
12611 case "$stdio_base" in
12612 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
12614 case "$stdio_bufsiz" in
12615 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
12617 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
12618 echo "(Looks like you have stdio.h from Linux.)"
12619 case "$stdio_ptr" in
12620 '') stdio_ptr='((fp)->_IO_read_ptr)'
12623 *) ptr_lval=$d_stdio_ptr_lval;;
12625 case "$stdio_cnt" in
12626 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
12629 *) cnt_lval=$d_stdio_cnt_lval;;
12631 case "$stdio_base" in
12632 '') stdio_base='((fp)->_IO_read_base)';;
12634 case "$stdio_bufsiz" in
12635 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
12638 case "$stdio_ptr" in
12639 '') stdio_ptr='((fp)->_ptr)'
12642 *) ptr_lval=$d_stdio_ptr_lval;;
12644 case "$stdio_cnt" in
12645 '') stdio_cnt='((fp)->_cnt)'
12648 *) cnt_lval=$d_stdio_cnt_lval;;
12650 case "$stdio_base" in
12651 '') stdio_base='((fp)->_base)';;
12653 case "$stdio_bufsiz" in
12654 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
12658 : test whether _ptr and _cnt really work
12659 echo "Checking how std your stdio is..." >&4
12662 #$i_stdlib I_STDLIB
12664 #include <stdlib.h>
12666 #define FILE_ptr(fp) $stdio_ptr
12667 #define FILE_cnt(fp) $stdio_cnt
12669 FILE *fp = fopen("try.c", "r");
12672 18 <= FILE_cnt(fp) &&
12673 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12681 if eval $compile && $to try.c; then
12682 if $run ./try; then
12683 echo "Your stdio acts pretty std."
12686 echo "Your stdio isn't very std."
12689 echo "Your stdio doesn't appear very std."
12693 # glibc 2.2.90 and above apparently change stdio streams so Perl's
12694 # direct buffer manipulation no longer works. The Configure tests
12695 # should be changed to correctly detect this, but until then,
12696 # the following check should at least let perl compile and run.
12697 # (This quick fix should be updated before 5.8.1.)
12698 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
12699 # A. Dougherty, June 3, 2002.
12700 case "$d_gnulibc" in
12702 case "$gnulibc_version" in
12706 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
12715 : Can _ptr be used as an lvalue?
12716 case "$d_stdstdio$ptr_lval" in
12717 $define$define) val=$define ;;
12720 set d_stdio_ptr_lval
12723 : Can _cnt be used as an lvalue?
12724 case "$d_stdstdio$cnt_lval" in
12725 $define$define) val=$define ;;
12728 set d_stdio_cnt_lval
12732 : test whether setting _ptr sets _cnt as a side effect
12733 d_stdio_ptr_lval_sets_cnt="$undef"
12734 d_stdio_ptr_lval_nochange_cnt="$undef"
12735 case "$d_stdio_ptr_lval$d_stdstdio" in
12737 echo "Checking to see what happens if we set the stdio ptr..." >&4
12740 /* Can we scream? */
12741 /* Eat dust sed :-) */
12742 /* In the buffer space, no one can hear you scream. */
12743 #$i_stdlib I_STDLIB
12745 #include <stdlib.h>
12747 #define FILE_ptr(fp) $stdio_ptr
12748 #define FILE_cnt(fp) $stdio_cnt
12749 #include <sys/types.h>
12751 FILE *fp = fopen("try.c", "r");
12756 puts("Fail even to read");
12759 c = getc(fp); /* Read away the first # */
12761 puts("Fail even to read");
12765 18 <= FILE_cnt(fp) &&
12766 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12768 puts("Fail even to read");
12771 ptr = (char*) FILE_ptr(fp);
12772 cnt = (size_t)FILE_cnt(fp);
12774 FILE_ptr(fp) += 42;
12776 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
12777 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
12780 if (FILE_cnt(fp) <= 20) {
12781 printf ("Fail (<20 chars to test)");
12784 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
12785 puts("Fail compare");
12788 if (cnt == FILE_cnt(fp)) {
12789 puts("Pass_unchanged");
12792 if (FILE_cnt(fp) == (cnt - 42)) {
12793 puts("Pass_changed");
12796 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
12802 if eval $compile && $to try.c; then
12803 case `$run ./try` in
12805 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
12806 d_stdio_ptr_lval_sets_cnt="$define" ;;
12808 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
12809 d_stdio_ptr_lval_nochange_cnt="$define" ;;
12811 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
12813 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
12816 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
12822 : see if _base is also standard
12824 case "$d_stdstdio" in
12828 #$i_stdlib I_STDLIB
12830 #include <stdlib.h>
12832 #define FILE_base(fp) $stdio_base
12833 #define FILE_bufsiz(fp) $stdio_bufsiz
12835 FILE *fp = fopen("try.c", "r");
12838 19 <= FILE_bufsiz(fp) &&
12839 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
12846 if eval $compile && $to try.c; then
12847 if $run ./try; then
12848 echo "And its _base field acts std."
12851 echo "But its _base field isn't std."
12854 echo "However, it seems to be lacking the _base field."
12862 : see if fast_stdio exists
12864 case "$d_stdstdio:$d_stdio_ptr_lval" in
12866 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
12868 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
12879 : see if fchdir exists
12880 set fchdir d_fchdir
12883 : see if fchmod exists
12884 set fchmod d_fchmod
12887 : see if fchown exists
12888 set fchown d_fchown
12891 : see if this is an fcntl system
12895 : See if fcntl-based locking works.
12898 #$i_stdlib I_STDLIB
12900 #include <stdlib.h>
12902 #include <unistd.h>
12904 #include <signal.h>
12905 $signal_t blech(int x) { exit(3); }
12907 #if defined(F_SETLK) && defined(F_SETLKW)
12908 struct flock flock;
12910 fd = open("try.c", O_RDONLY);
12911 flock.l_type = F_RDLCK;
12912 flock.l_whence = SEEK_SET;
12913 flock.l_start = flock.l_len = 0;
12914 signal(SIGALRM, blech);
12916 retval = fcntl(fd, F_SETLK, &flock);
12918 (retval < 0 ? exit(2) : exit(0));
12924 echo "Checking if fcntl-based file locking works... "
12928 if eval $compile_ok; then
12929 if $run ./try; then
12930 echo "Yes, it seems to work."
12933 echo "Nope, it didn't work."
12938 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
12939 *** This is (almost) impossible.
12940 *** If your NFS lock daemons are not feeling well, something like
12941 *** this may happen, please investigate. Cannot continue, aborting.
12949 echo "I'm unable to compile the test program, so I'll assume not."
12954 echo "Nope, since you don't even have fcntl()."
12957 set d_fcntl_can_lock
12961 : check for fd_set items
12964 Checking to see how well your C compiler handles fd_set and friends ...
12967 #$i_stdlib I_STDLIB
12969 #include <stdlib.h>
12971 #$i_systime I_SYS_TIME
12972 #$i_sysselct I_SYS_SELECT
12973 #$d_socket HAS_SOCKET
12974 #include <sys/types.h>
12976 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
12979 #include <sys/time.h>
12981 #ifdef I_SYS_SELECT
12982 #include <sys/select.h>
12991 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
12999 if eval $compile; then
13000 d_fds_bits="$define"
13002 echo "Well, your system knows about the normal fd_set typedef..." >&4
13003 if $run ./try; then
13004 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
13005 d_fd_macros="$define"
13008 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
13010 d_fd_macros="$undef"
13014 Hmm, your compiler has some difficulty with fd_set. Checking further...
13017 if eval $compile; then
13018 d_fds_bits="$undef"
13020 echo "Well, your system has some sort of fd_set available..." >&4
13021 if $run ./try; then
13022 echo "and you have the normal fd_set macros." >&4
13023 d_fd_macros="$define"
13026 but not the normal fd_set macros! Gross! More work for me...
13028 d_fd_macros="$undef"
13031 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
13033 d_fds_bits="$undef"
13034 d_fd_macros="$undef"
13039 : see if fgetpos exists
13040 set fgetpos d_fgetpos
13043 : see if finite exists
13044 set finite d_finite
13047 : see if finitel exists
13048 set finitel d_finitel
13051 : see if flock exists
13055 : see if prototype for flock is available
13057 set d_flockproto flock $i_sysfile sys/file.h
13060 : see if fp_class exists
13061 set fp_class d_fp_class
13064 : see if pathconf exists
13065 set pathconf d_pathconf
13068 : see if fpathconf exists
13069 set fpathconf d_fpathconf
13072 : see if fpclass exists
13073 set fpclass d_fpclass
13076 : see if fpclassify exists
13077 set fpclassify d_fpclassify
13080 : see if fpclassl exists
13081 set fpclassl d_fpclassl
13084 : check for fpos64_t
13086 echo "Checking to see if you have fpos64_t..." >&4
13089 int main() { fpos64_t x = 7; }
13092 if eval $compile; then
13094 echo "You have fpos64_t."
13097 echo "You do not have fpos64_t."
13098 case "$fpossize" in
13099 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
13106 : see if frexpl exists
13107 set frexpl d_frexpl
13110 : see if this is a sys/param system
13111 set sys/param.h i_sysparam
13114 : see if this is a sys/mount.h system
13115 set sys/mount.h i_sysmount
13118 : Check for fs_data_s
13120 echo "Checking to see if your system supports struct fs_data..." >&4
13121 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
13123 case "$d_fs_data_s" in
13124 "$define") echo "Yes, it does." ;;
13125 *) echo "No, it doesn't." ;;
13128 : see if fseeko exists
13129 set fseeko d_fseeko
13131 case "$longsize" in
13132 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
13135 : see if fsetpos exists
13136 set fsetpos d_fsetpos
13139 : see if fstatfs exists
13140 set fstatfs d_fstatfs
13143 : see if statvfs exists
13144 set statvfs d_statvfs
13147 : see if fstatvfs exists
13148 set fstatvfs d_fstatvfs
13152 : see if fsync exists
13156 : see if ftello exists
13157 set ftello d_ftello
13159 case "$longsize" in
13160 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
13163 : check for a working futimes
13166 echo "Checking if you have a working futimes()" >&4
13169 #include <sys/time.h>
13176 fd = open ("try.c", O_RDWR);
13177 if (-1 == fd) exit (1);
13178 rv = futimes (fd, NULL);
13179 exit (rv == -1 ? errno : 0);
13183 if eval $compile; then
13187 0) echo "Yes, you have" >&4
13188 d_futimes="$define"
13190 *) echo "No, you have futimes, but it isn't working ($rc) (probably harmless)" >&4
13194 echo "No, it does not (probably harmless)" >&4
13198 : see if getcwd exists
13199 set getcwd d_getcwd
13202 : see if getespwnam exists
13203 set getespwnam d_getespwnam
13206 : see if getfsstat exists
13207 set getfsstat d_getfsstat
13210 : see if getgrent exists
13211 set getgrent d_getgrent
13214 : see if getgrent_r exists
13215 set getgrent_r d_getgrent_r
13217 case "$d_getgrent_r" in
13219 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13220 case "$d_getgrent_r_proto:$usethreads" in
13221 ":define") d_getgrent_r_proto=define
13222 set d_getgrent_r_proto getgrent_r $hdrs
13226 case "$d_getgrent_r_proto" in
13228 case "$getgrent_r_proto" in
13229 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
13230 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBWR ;;
13232 case "$getgrent_r_proto" in
13233 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
13234 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIR ;;
13236 case "$getgrent_r_proto" in
13237 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
13238 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBW ;;
13240 case "$getgrent_r_proto" in
13241 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
13242 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBI ;;
13244 case "$getgrent_r_proto" in
13245 ''|0) try='int getgrent_r(struct group*, char*, int);'
13246 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBI ;;
13248 case "$getgrent_r_proto" in
13249 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
13250 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIH ;;
13252 case "$getgrent_r_proto" in
13253 ''|0) d_getgrent_r=undef
13255 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
13256 * ) case "$getgrent_r_proto" in
13257 REENTRANT_PROTO*) ;;
13258 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
13260 echo "Prototype: $try" ;;
13263 *) case "$usethreads" in
13264 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
13271 *) getgrent_r_proto=0
13275 : see if getgrgid_r exists
13276 set getgrgid_r d_getgrgid_r
13278 case "$d_getgrgid_r" in
13280 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13281 case "$d_getgrgid_r_proto:$usethreads" in
13282 ":define") d_getgrgid_r_proto=define
13283 set d_getgrgid_r_proto getgrgid_r $hdrs
13287 case "$d_getgrgid_r_proto" in
13289 case "$getgrgid_r_proto" in
13290 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
13291 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
13293 case "$getgrgid_r_proto" in
13294 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
13295 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
13297 case "$getgrgid_r_proto" in
13298 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
13299 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
13301 case "$getgrgid_r_proto" in
13302 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
13303 ./protochk "extern $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
13305 case "$getgrgid_r_proto" in
13306 ''|0) d_getgrgid_r=undef
13308 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
13309 * ) case "$getgrgid_r_proto" in
13310 REENTRANT_PROTO*) ;;
13311 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
13313 echo "Prototype: $try" ;;
13316 *) case "$usethreads" in
13317 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
13324 *) getgrgid_r_proto=0
13328 : see if getgrnam_r exists
13329 set getgrnam_r d_getgrnam_r
13331 case "$d_getgrnam_r" in
13333 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13334 case "$d_getgrnam_r_proto:$usethreads" in
13335 ":define") d_getgrnam_r_proto=define
13336 set d_getgrnam_r_proto getgrnam_r $hdrs
13340 case "$d_getgrnam_r_proto" in
13342 case "$getgrnam_r_proto" in
13343 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
13344 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
13346 case "$getgrnam_r_proto" in
13347 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
13348 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
13350 case "$getgrnam_r_proto" in
13351 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
13352 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CBI ;;
13354 case "$getgrnam_r_proto" in
13355 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
13356 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
13358 case "$getgrnam_r_proto" in
13359 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
13360 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
13362 case "$getgrnam_r_proto" in
13363 ''|0) d_getgrnam_r=undef
13365 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
13366 * ) case "$getgrnam_r_proto" in
13367 REENTRANT_PROTO*) ;;
13368 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
13370 echo "Prototype: $try" ;;
13373 *) case "$usethreads" in
13374 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
13381 *) getgrnam_r_proto=0
13385 : see if gethostbyaddr exists
13386 set gethostbyaddr d_gethbyaddr
13389 : see if gethostbyname exists
13390 set gethostbyname d_gethbyname
13393 : see if gethostent exists
13394 set gethostent d_gethent
13397 : see how we will look up host name
13400 if set gethostname val -f d_gethname; eval $csym; $val; then
13401 echo 'gethostname() found.' >&4
13402 d_gethname="$define"
13405 if set uname val -f d_uname; eval $csym; $val; then
13408 uname() was found, but you're running xenix, and older versions of xenix
13409 have a broken uname(). If you don't really know whether your xenix is old
13410 enough to have a broken system call, use the default answer.
13415 "$define") dflt=n;;
13417 rp='Is your uname() broken?'
13420 n*) d_uname="$define"; call=uname;;
13423 echo 'uname() found.' >&4
13430 case "$d_gethname" in
13431 '') d_gethname="$undef";;
13434 '') d_uname="$undef";;
13436 case "$d_uname$d_gethname" in
13441 Every now and then someone has a $call() that lies about the hostname
13442 but can't be fixed for political or economic reasons. If you wish, I can
13443 pretend $call() isn't there and maybe compute hostname at run-time
13444 thanks to the '$phostname' command.
13447 rp="Shall I ignore $call() from now on?"
13450 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
13453 case "$phostname" in
13454 '') aphostname='';;
13455 *) case "$aphostname" in
13457 *) set X $phostname
13461 file=`./loc $file $file $pth`
13462 aphostname=`echo $file $*`
13467 case "$d_uname$d_gethname" in
13470 case "$phostname" in
13472 echo "There will be no way for $package to get your hostname." >&4;;
13474 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
13478 case "$d_phostname" in
13479 '') d_phostname="$undef";;
13482 : see if gethostbyaddr_r exists
13483 set gethostbyaddr_r d_gethostbyaddr_r
13485 case "$d_gethostbyaddr_r" in
13487 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13488 case "$d_gethostbyaddr_r_proto:$usethreads" in
13489 ":define") d_gethostbyaddr_r_proto=define
13490 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
13494 case "$d_gethostbyaddr_r_proto" in
13496 case "$gethostbyaddr_r_proto" in
13497 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13498 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
13500 case "$gethostbyaddr_r_proto" in
13501 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
13502 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
13504 case "$gethostbyaddr_r_proto" in
13505 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
13506 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
13508 case "$gethostbyaddr_r_proto" in
13509 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
13510 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
13512 case "$gethostbyaddr_r_proto" in
13513 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
13514 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
13516 case "$gethostbyaddr_r_proto" in
13517 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
13518 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
13520 case "$gethostbyaddr_r_proto" in
13521 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
13522 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
13524 case "$gethostbyaddr_r_proto" in
13525 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
13526 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
13528 case "$gethostbyaddr_r_proto" in
13529 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
13530 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
13532 case "$gethostbyaddr_r_proto" in
13533 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
13534 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
13536 case "$gethostbyaddr_r_proto" in
13537 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13538 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
13540 case "$gethostbyaddr_r_proto" in
13541 ''|0) d_gethostbyaddr_r=undef
13542 gethostbyaddr_r_proto=0
13543 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
13544 * ) case "$gethostbyaddr_r_proto" in
13545 REENTRANT_PROTO*) ;;
13546 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
13548 echo "Prototype: $try" ;;
13551 *) case "$usethreads" in
13552 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
13554 d_gethostbyaddr_r=undef
13555 gethostbyaddr_r_proto=0
13559 *) gethostbyaddr_r_proto=0
13563 : see if gethostbyname_r exists
13564 set gethostbyname_r d_gethostbyname_r
13566 case "$d_gethostbyname_r" in
13568 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13569 case "$d_gethostbyname_r_proto:$usethreads" in
13570 ":define") d_gethostbyname_r_proto=define
13571 set d_gethostbyname_r_proto gethostbyname_r $hdrs
13575 case "$d_gethostbyname_r_proto" in
13577 case "$gethostbyname_r_proto" in
13578 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
13579 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
13581 case "$gethostbyname_r_proto" in
13582 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
13583 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
13585 case "$gethostbyname_r_proto" in
13586 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
13587 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
13589 case "$gethostbyname_r_proto" in
13590 ''|0) d_gethostbyname_r=undef
13591 gethostbyname_r_proto=0
13592 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
13593 * ) case "$gethostbyname_r_proto" in
13594 REENTRANT_PROTO*) ;;
13595 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
13597 echo "Prototype: $try" ;;
13600 *) case "$usethreads" in
13601 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
13603 d_gethostbyname_r=undef
13604 gethostbyname_r_proto=0
13608 *) gethostbyname_r_proto=0
13612 : see if gethostent_r exists
13613 set gethostent_r d_gethostent_r
13615 case "$d_gethostent_r" in
13617 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13618 case "$d_gethostent_r_proto:$usethreads" in
13619 ":define") d_gethostent_r_proto=define
13620 set d_gethostent_r_proto gethostent_r $hdrs
13624 case "$d_gethostent_r_proto" in
13626 case "$gethostent_r_proto" in
13627 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
13628 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
13630 case "$gethostent_r_proto" in
13631 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
13632 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBIE ;;
13634 case "$gethostent_r_proto" in
13635 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
13636 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBIE ;;
13638 case "$gethostent_r_proto" in
13639 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
13640 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBI ;;
13642 case "$gethostent_r_proto" in
13643 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
13644 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBI ;;
13646 case "$gethostent_r_proto" in
13647 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
13648 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SD ;;
13650 case "$gethostent_r_proto" in
13651 ''|0) d_gethostent_r=undef
13652 gethostent_r_proto=0
13653 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
13654 * ) case "$gethostent_r_proto" in
13655 REENTRANT_PROTO*) ;;
13656 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
13658 echo "Prototype: $try" ;;
13661 *) case "$usethreads" in
13662 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
13664 d_gethostent_r=undef
13665 gethostent_r_proto=0
13669 *) gethostent_r_proto=0
13673 : see if prototypes for various gethostxxx netdb.h functions are available
13675 set d_gethostprotos gethostent $i_netdb netdb.h
13678 : see if getitimer exists
13679 set getitimer d_getitimer
13682 : see if getlogin exists
13683 set getlogin d_getlogin
13686 : see if getlogin_r exists
13687 set getlogin_r d_getlogin_r
13689 case "$d_getlogin_r" in
13691 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
13692 case "$d_getlogin_r_proto:$usethreads" in
13693 ":define") d_getlogin_r_proto=define
13694 set d_getlogin_r_proto getlogin_r $hdrs
13698 case "$d_getlogin_r_proto" in
13700 case "$getlogin_r_proto" in
13701 ''|0) try='int getlogin_r(char*, size_t);'
13702 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BW ;;
13704 case "$getlogin_r_proto" in
13705 ''|0) try='int getlogin_r(char*, int);'
13706 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BI ;;
13708 case "$getlogin_r_proto" in
13709 ''|0) try='char* getlogin_r(char*, size_t);'
13710 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BW ;;
13712 case "$getlogin_r_proto" in
13713 ''|0) try='char* getlogin_r(char*, int);'
13714 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BI ;;
13716 case "$getlogin_r_proto" in
13717 ''|0) d_getlogin_r=undef
13719 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
13720 * ) case "$getlogin_r_proto" in
13721 REENTRANT_PROTO*) ;;
13722 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
13724 echo "Prototype: $try" ;;
13727 *) case "$usethreads" in
13728 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
13735 *) getlogin_r_proto=0
13739 : see if getmnt exists
13740 set getmnt d_getmnt
13743 : see if getmntent exists
13744 set getmntent d_getmntent
13747 : see if getnetbyaddr exists
13748 set getnetbyaddr d_getnbyaddr
13751 : see if getnetbyname exists
13752 set getnetbyname d_getnbyname
13755 : see if getnetent exists
13756 set getnetent d_getnent
13759 : see if getnetbyaddr_r exists
13760 set getnetbyaddr_r d_getnetbyaddr_r
13762 case "$d_getnetbyaddr_r" in
13764 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13765 case "$d_getnetbyaddr_r_proto:$usethreads" in
13766 ":define") d_getnetbyaddr_r_proto=define
13767 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
13771 case "$d_getnetbyaddr_r_proto" in
13773 case "$getnetbyaddr_r_proto" in
13774 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
13775 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
13777 case "$getnetbyaddr_r_proto" in
13778 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
13779 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
13781 case "$getnetbyaddr_r_proto" in
13782 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
13783 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
13785 case "$getnetbyaddr_r_proto" in
13786 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
13787 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
13789 case "$getnetbyaddr_r_proto" in
13790 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
13791 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
13793 case "$getnetbyaddr_r_proto" in
13794 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
13795 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
13797 case "$getnetbyaddr_r_proto" in
13798 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
13799 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
13801 case "$getnetbyaddr_r_proto" in
13802 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
13803 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
13805 case "$getnetbyaddr_r_proto" in
13806 ''|0) d_getnetbyaddr_r=undef
13807 getnetbyaddr_r_proto=0
13808 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
13809 * ) case "$getnetbyaddr_r_proto" in
13810 REENTRANT_PROTO*) ;;
13811 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
13813 echo "Prototype: $try" ;;
13816 *) case "$usethreads" in
13817 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
13819 d_getnetbyaddr_r=undef
13820 getnetbyaddr_r_proto=0
13824 *) getnetbyaddr_r_proto=0
13828 : see if getnetbyname_r exists
13829 set getnetbyname_r d_getnetbyname_r
13831 case "$d_getnetbyname_r" in
13833 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13834 case "$d_getnetbyname_r_proto:$usethreads" in
13835 ":define") d_getnetbyname_r_proto=define
13836 set d_getnetbyname_r_proto getnetbyname_r $hdrs
13840 case "$d_getnetbyname_r_proto" in
13842 case "$getnetbyname_r_proto" in
13843 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
13844 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
13846 case "$getnetbyname_r_proto" in
13847 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
13848 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
13850 case "$getnetbyname_r_proto" in
13851 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
13852 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
13854 case "$getnetbyname_r_proto" in
13855 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
13856 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
13858 case "$getnetbyname_r_proto" in
13859 ''|0) d_getnetbyname_r=undef
13860 getnetbyname_r_proto=0
13861 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
13862 * ) case "$getnetbyname_r_proto" in
13863 REENTRANT_PROTO*) ;;
13864 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
13866 echo "Prototype: $try" ;;
13869 *) case "$usethreads" in
13870 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
13872 d_getnetbyname_r=undef
13873 getnetbyname_r_proto=0
13877 *) getnetbyname_r_proto=0
13881 : see if getnetent_r exists
13882 set getnetent_r d_getnetent_r
13884 case "$d_getnetent_r" in
13886 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13887 case "$d_getnetent_r_proto:$usethreads" in
13888 ":define") d_getnetent_r_proto=define
13889 set d_getnetent_r_proto getnetent_r $hdrs
13893 case "$d_getnetent_r_proto" in
13895 case "$getnetent_r_proto" in
13896 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
13897 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
13899 case "$getnetent_r_proto" in
13900 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
13901 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBIE ;;
13903 case "$getnetent_r_proto" in
13904 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
13905 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBIE ;;
13907 case "$getnetent_r_proto" in
13908 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
13909 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBI ;;
13911 case "$getnetent_r_proto" in
13912 ''|0) try='int getnetent_r(struct netent*, char*, int);'
13913 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBI ;;
13915 case "$getnetent_r_proto" in
13916 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
13917 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SD ;;
13919 case "$getnetent_r_proto" in
13920 ''|0) d_getnetent_r=undef
13921 getnetent_r_proto=0
13922 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
13923 * ) case "$getnetent_r_proto" in
13924 REENTRANT_PROTO*) ;;
13925 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
13927 echo "Prototype: $try" ;;
13930 *) case "$usethreads" in
13931 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
13933 d_getnetent_r=undef
13934 getnetent_r_proto=0
13938 *) getnetent_r_proto=0
13942 : see if prototypes for various getnetxxx netdb.h functions are available
13944 set d_getnetprotos getnetent $i_netdb netdb.h
13947 : see if getpagesize exists
13948 set getpagesize d_getpagsz
13951 : Optional checks for getprotobyname and getprotobynumber
13953 : see if getprotobyname exists
13954 set getprotobyname d_getpbyname
13957 : see if getprotobynumber exists
13958 set getprotobynumber d_getpbynumber
13961 : see if getprotoent exists
13962 set getprotoent d_getpent
13965 : see if getpgid exists
13966 set getpgid d_getpgid
13969 : see if getpgrp2 exists
13970 set getpgrp2 d_getpgrp2
13973 : see if getppid exists
13974 set getppid d_getppid
13977 : see if getpriority exists
13978 set getpriority d_getprior
13981 : see if getprotobyname_r exists
13982 set getprotobyname_r d_getprotobyname_r
13984 case "$d_getprotobyname_r" in
13986 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13987 case "$d_getprotobyname_r_proto:$usethreads" in
13988 ":define") d_getprotobyname_r_proto=define
13989 set d_getprotobyname_r_proto getprotobyname_r $hdrs
13993 case "$d_getprotobyname_r_proto" in
13995 case "$getprotobyname_r_proto" in
13996 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
13997 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
13999 case "$getprotobyname_r_proto" in
14000 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
14001 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
14003 case "$getprotobyname_r_proto" in
14004 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
14005 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
14007 case "$getprotobyname_r_proto" in
14008 ''|0) d_getprotobyname_r=undef
14009 getprotobyname_r_proto=0
14010 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
14011 * ) case "$getprotobyname_r_proto" in
14012 REENTRANT_PROTO*) ;;
14013 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
14015 echo "Prototype: $try" ;;
14018 *) case "$usethreads" in
14019 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
14021 d_getprotobyname_r=undef
14022 getprotobyname_r_proto=0
14026 *) getprotobyname_r_proto=0
14030 : see if getprotobynumber_r exists
14031 set getprotobynumber_r d_getprotobynumber_r
14033 case "$d_getprotobynumber_r" in
14035 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14036 case "$d_getprotobynumber_r_proto:$usethreads" in
14037 ":define") d_getprotobynumber_r_proto=define
14038 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
14042 case "$d_getprotobynumber_r_proto" in
14044 case "$getprotobynumber_r_proto" in
14045 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
14046 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
14048 case "$getprotobynumber_r_proto" in
14049 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
14050 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
14052 case "$getprotobynumber_r_proto" in
14053 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
14054 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
14056 case "$getprotobynumber_r_proto" in
14057 ''|0) d_getprotobynumber_r=undef
14058 getprotobynumber_r_proto=0
14059 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
14060 * ) case "$getprotobynumber_r_proto" in
14061 REENTRANT_PROTO*) ;;
14062 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
14064 echo "Prototype: $try" ;;
14067 *) case "$usethreads" in
14068 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
14070 d_getprotobynumber_r=undef
14071 getprotobynumber_r_proto=0
14075 *) getprotobynumber_r_proto=0
14079 : see if getprotoent_r exists
14080 set getprotoent_r d_getprotoent_r
14082 case "$d_getprotoent_r" in
14084 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14085 case "$d_getprotoent_r_proto:$usethreads" in
14086 ":define") d_getprotoent_r_proto=define
14087 set d_getprotoent_r_proto getprotoent_r $hdrs
14091 case "$d_getprotoent_r_proto" in
14093 case "$getprotoent_r_proto" in
14094 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
14095 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
14097 case "$getprotoent_r_proto" in
14098 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
14099 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBI ;;
14101 case "$getprotoent_r_proto" in
14102 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
14103 ./protochk "extern $try" $hdrs && getprotoent_r_proto=S_SBI ;;
14105 case "$getprotoent_r_proto" in
14106 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
14107 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SD ;;
14109 case "$getprotoent_r_proto" in
14110 ''|0) d_getprotoent_r=undef
14111 getprotoent_r_proto=0
14112 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
14113 * ) case "$getprotoent_r_proto" in
14114 REENTRANT_PROTO*) ;;
14115 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
14117 echo "Prototype: $try" ;;
14120 *) case "$usethreads" in
14121 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
14123 d_getprotoent_r=undef
14124 getprotoent_r_proto=0
14128 *) getprotoent_r_proto=0
14132 : see if prototypes for various getprotoxxx netdb.h functions are available
14134 set d_getprotoprotos getprotoent $i_netdb netdb.h
14137 : see if getprpwnam exists
14138 set getprpwnam d_getprpwnam
14141 : see if getpwent exists
14142 set getpwent d_getpwent
14145 : see if getpwent_r exists
14146 set getpwent_r d_getpwent_r
14148 case "$d_getpwent_r" in
14150 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14151 case "$d_getpwent_r_proto:$usethreads" in
14152 ":define") d_getpwent_r_proto=define
14153 set d_getpwent_r_proto getpwent_r $hdrs
14157 case "$d_getpwent_r_proto" in
14159 case "$getpwent_r_proto" in
14160 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
14161 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBWR ;;
14163 case "$getpwent_r_proto" in
14164 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
14165 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIR ;;
14167 case "$getpwent_r_proto" in
14168 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
14169 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBW ;;
14171 case "$getpwent_r_proto" in
14172 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
14173 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBI ;;
14175 case "$getpwent_r_proto" in
14176 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
14177 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBI ;;
14179 case "$getpwent_r_proto" in
14180 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
14181 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIH ;;
14183 case "$getpwent_r_proto" in
14184 ''|0) d_getpwent_r=undef
14186 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
14187 * ) case "$getpwent_r_proto" in
14188 REENTRANT_PROTO*) ;;
14189 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
14191 echo "Prototype: $try" ;;
14194 *) case "$usethreads" in
14195 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
14202 *) getpwent_r_proto=0
14206 : see if getpwnam_r exists
14207 set getpwnam_r d_getpwnam_r
14209 case "$d_getpwnam_r" in
14211 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14212 case "$d_getpwnam_r_proto:$usethreads" in
14213 ":define") d_getpwnam_r_proto=define
14214 set d_getpwnam_r_proto getpwnam_r $hdrs
14218 case "$d_getpwnam_r_proto" in
14220 case "$getpwnam_r_proto" in
14221 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
14222 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
14224 case "$getpwnam_r_proto" in
14225 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
14226 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
14228 case "$getpwnam_r_proto" in
14229 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
14230 ./protochk "extern $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
14232 case "$getpwnam_r_proto" in
14233 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
14234 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
14236 case "$getpwnam_r_proto" in
14237 ''|0) d_getpwnam_r=undef
14239 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
14240 * ) case "$getpwnam_r_proto" in
14241 REENTRANT_PROTO*) ;;
14242 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
14244 echo "Prototype: $try" ;;
14247 *) case "$usethreads" in
14248 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
14255 *) getpwnam_r_proto=0
14259 : see if getpwuid_r exists
14260 set getpwuid_r d_getpwuid_r
14262 case "$d_getpwuid_r" in
14264 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14265 case "$d_getpwuid_r_proto:$usethreads" in
14266 ":define") d_getpwuid_r_proto=define
14267 set d_getpwuid_r_proto getpwuid_r $hdrs
14271 case "$d_getpwuid_r_proto" in
14273 case "$getpwuid_r_proto" in
14274 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
14275 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
14277 case "$getpwuid_r_proto" in
14278 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
14279 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
14281 case "$getpwuid_r_proto" in
14282 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
14283 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
14285 case "$getpwuid_r_proto" in
14286 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
14287 ./protochk "extern $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
14289 case "$getpwuid_r_proto" in
14290 ''|0) d_getpwuid_r=undef
14292 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
14293 * ) case "$getpwuid_r_proto" in
14294 REENTRANT_PROTO*) ;;
14295 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
14297 echo "Prototype: $try" ;;
14300 *) case "$usethreads" in
14301 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
14308 *) getpwuid_r_proto=0
14312 : Optional checks for getsbyname and getsbyport
14314 : see if getservbyname exists
14315 set getservbyname d_getsbyname
14318 : see if getservbyport exists
14319 set getservbyport d_getsbyport
14322 : see if getservent exists
14323 set getservent d_getsent
14326 : see if getservbyname_r exists
14327 set getservbyname_r d_getservbyname_r
14329 case "$d_getservbyname_r" in
14331 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14332 case "$d_getservbyname_r_proto:$usethreads" in
14333 ":define") d_getservbyname_r_proto=define
14334 set d_getservbyname_r_proto getservbyname_r $hdrs
14338 case "$d_getservbyname_r_proto" in
14340 case "$getservbyname_r_proto" in
14341 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
14342 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
14344 case "$getservbyname_r_proto" in
14345 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
14346 ./protochk "extern $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
14348 case "$getservbyname_r_proto" in
14349 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
14350 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
14352 case "$getservbyname_r_proto" in
14353 ''|0) d_getservbyname_r=undef
14354 getservbyname_r_proto=0
14355 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
14356 * ) case "$getservbyname_r_proto" in
14357 REENTRANT_PROTO*) ;;
14358 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
14360 echo "Prototype: $try" ;;
14363 *) case "$usethreads" in
14364 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
14366 d_getservbyname_r=undef
14367 getservbyname_r_proto=0
14371 *) getservbyname_r_proto=0
14375 : see if getservbyport_r exists
14376 set getservbyport_r d_getservbyport_r
14378 case "$d_getservbyport_r" in
14380 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14381 case "$d_getservbyport_r_proto:$usethreads" in
14382 ":define") d_getservbyport_r_proto=define
14383 set d_getservbyport_r_proto getservbyport_r $hdrs
14387 case "$d_getservbyport_r_proto" in
14389 case "$getservbyport_r_proto" in
14390 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
14391 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
14393 case "$getservbyport_r_proto" in
14394 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
14395 ./protochk "extern $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
14397 case "$getservbyport_r_proto" in
14398 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
14399 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
14401 case "$getservbyport_r_proto" in
14402 ''|0) d_getservbyport_r=undef
14403 getservbyport_r_proto=0
14404 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
14405 * ) case "$getservbyport_r_proto" in
14406 REENTRANT_PROTO*) ;;
14407 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
14409 echo "Prototype: $try" ;;
14412 *) case "$usethreads" in
14413 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
14415 d_getservbyport_r=undef
14416 getservbyport_r_proto=0
14420 *) getservbyport_r_proto=0
14424 : see if getservent_r exists
14425 set getservent_r d_getservent_r
14427 case "$d_getservent_r" in
14429 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14430 case "$d_getservent_r_proto:$usethreads" in
14431 ":define") d_getservent_r_proto=define
14432 set d_getservent_r_proto getservent_r $hdrs
14436 case "$d_getservent_r_proto" in
14438 case "$getservent_r_proto" in
14439 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
14440 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBWR ;;
14442 case "$getservent_r_proto" in
14443 ''|0) try='int getservent_r(struct servent*, char*, int);'
14444 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBI ;;
14446 case "$getservent_r_proto" in
14447 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
14448 ./protochk "extern $try" $hdrs && getservent_r_proto=S_SBI ;;
14450 case "$getservent_r_proto" in
14451 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
14452 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SD ;;
14454 case "$getservent_r_proto" in
14455 ''|0) d_getservent_r=undef
14456 getservent_r_proto=0
14457 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
14458 * ) case "$getservent_r_proto" in
14459 REENTRANT_PROTO*) ;;
14460 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
14462 echo "Prototype: $try" ;;
14465 *) case "$usethreads" in
14466 define) echo "getservent_r has no prototype, not using it." >&4 ;;
14468 d_getservent_r=undef
14469 getservent_r_proto=0
14473 *) getservent_r_proto=0
14477 : see if prototypes for various getservxxx netdb.h functions are available
14479 set d_getservprotos getservent $i_netdb netdb.h
14482 : see if getspnam exists
14483 set getspnam d_getspnam
14486 : see if this is a shadow.h system
14487 set shadow.h i_shadow
14490 : see if getspnam_r exists
14491 set getspnam_r d_getspnam_r
14493 case "$d_getspnam_r" in
14495 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
14496 case "$d_getspnam_r_proto:$usethreads" in
14497 ":define") d_getspnam_r_proto=define
14498 set d_getspnam_r_proto getspnam_r $hdrs
14502 case "$d_getspnam_r_proto" in
14504 case "$getspnam_r_proto" in
14505 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
14506 ./protochk "extern $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
14508 case "$getspnam_r_proto" in
14509 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
14510 ./protochk "extern $try" $hdrs && getspnam_r_proto=S_CSBI ;;
14512 case "$getspnam_r_proto" in
14513 ''|0) d_getspnam_r=undef
14515 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
14516 * ) case "$getspnam_r_proto" in
14517 REENTRANT_PROTO*) ;;
14518 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
14520 echo "Prototype: $try" ;;
14523 *) case "$usethreads" in
14524 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
14531 *) getspnam_r_proto=0
14535 : see if gettimeofday or ftime exists
14536 set gettimeofday d_gettimeod
14538 case "$d_gettimeod" in
14544 val="$undef"; set d_ftime; eval $setvar
14547 case "$d_gettimeod$d_ftime" in
14550 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
14554 : see if gmtime_r exists
14555 set gmtime_r d_gmtime_r
14557 case "$d_gmtime_r" in
14559 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14560 case "$d_gmtime_r_proto:$usethreads" in
14561 ":define") d_gmtime_r_proto=define
14562 set d_gmtime_r_proto gmtime_r $hdrs
14566 case "$d_gmtime_r_proto" in
14568 case "$gmtime_r_proto" in
14569 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
14570 ./protochk "extern $try" $hdrs && gmtime_r_proto=S_TS ;;
14572 case "$gmtime_r_proto" in
14573 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
14574 ./protochk "extern $try" $hdrs && gmtime_r_proto=I_TS ;;
14576 case "$gmtime_r_proto" in
14577 ''|0) d_gmtime_r=undef
14579 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
14580 * ) case "$gmtime_r_proto" in
14581 REENTRANT_PROTO*) ;;
14582 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
14584 echo "Prototype: $try" ;;
14587 *) case "$usethreads" in
14588 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
14595 *) gmtime_r_proto=0
14599 : see if hasmntopt exists
14600 set hasmntopt d_hasmntopt
14603 : see if this is a netinet/in.h or sys/in.h system
14604 set netinet/in.h i_niin sys/in.h i_sysin
14607 : see if arpa/inet.h has to be included
14608 set arpa/inet.h i_arpainet
14611 : see if htonl --and friends-- exists
14616 : Maybe they are macros.
14619 $cat >htonl.c <<EOM
14621 #include <sys/types.h>
14622 #$i_niin I_NETINET_IN
14624 #$i_arpainet I_ARPA_INET
14625 #ifdef I_NETINET_IN
14626 #include <netinet/in.h>
14629 #include <sys/in.h>
14632 #include <arpa/inet.h>
14635 printf("Defined as a macro.");
14638 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
14639 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
14641 echo "But it seems to be defined as a macro." >&4
14649 : see if ilogbl exists
14650 set ilogbl d_ilogbl
14655 if set index val -f; eval $csym; $val; then
14656 if set strchr val -f d_strchr; eval $csym; $val; then
14657 if $contains strchr "$strings" >/dev/null 2>&1 ; then
14660 echo "strchr() found." >&4
14664 echo "index() found." >&4
14669 echo "index() found." >&4
14672 if set strchr val -f d_strchr; eval $csym; $val; then
14675 echo "strchr() found." >&4
14677 echo "No index() or strchr() found!" >&4
14682 set d_strchr; eval $setvar
14684 set d_index; eval $setvar
14686 : check whether inet_aton exists
14687 set inet_aton d_inetaton
14692 $cat >isascii.c <<EOCP
14695 #$i_stdlib I_STDLIB
14697 #include <stdlib.h>
14708 if eval $compile; then
14709 echo "isascii() found." >&4
14712 echo "isascii() NOT found." >&4
14719 : see if isfinite exists
14720 set isfinite d_isfinite
14723 : see if isinf exists
14727 : see if isnan exists
14731 : see if isnanl exists
14732 set isnanl d_isnanl
14735 : see if killpg exists
14736 set killpg d_killpg
14739 : see if lchown exists
14741 $cat > try.c <<'EOCP'
14742 /* System header to define __stub macros and hopefully few prototypes,
14743 which can conflict with char lchown(); below. */
14744 #include <assert.h>
14745 /* Override any gcc2 internal prototype to avoid an error. */
14746 /* We use char because int might match the return type of a gcc2
14747 builtin and then its argument prototype would still apply. */
14750 /* The GNU C library defines this for functions which it implements
14751 to always fail with ENOSYS. Some functions are actually named
14752 something starting with __ and the normal name is an alias. */
14753 #if defined (__stub_lchown) || defined (__stub___lchown)
14761 if eval $compile; then
14762 $echo "lchown() found." >&4
14765 $echo "lchown() NOT found." >&4
14771 : See if number of significant digits in a double precision number is known
14773 $cat >ldbl_dig.c <<EOM
14774 #$i_limits I_LIMITS
14777 #include <limits.h>
14783 printf("Contains LDBL_DIG");
14786 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
14787 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
14788 echo "LDBL_DIG found." >&4
14791 echo "LDBL_DIG NOT found." >&4
14798 : see if this is a math.h system
14802 : check to see if math.h defines _LIB_VERSION
14803 d_libm_lib_version="$undef"
14807 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
14809 #include <unistd.h>
14811 int main (int argc, char *argv[])
14813 printf ("%d\n", _LIB_VERSION);
14818 if eval $compile; then
14820 echo "Yes, it does ($foo)" >&4
14821 d_libm_lib_version="$define"
14823 echo "No, it does not (probably harmless)" >&4
14830 : see if link exists
14834 : see if localtime_r exists
14835 set localtime_r d_localtime_r
14837 case "$d_localtime_r" in
14839 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14840 case "$d_localtime_r_proto:$usethreads" in
14841 ":define") d_localtime_r_proto=define
14842 set d_localtime_r_proto localtime_r $hdrs
14846 case "$d_localtime_r_proto" in
14848 case "$localtime_r_proto" in
14849 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
14850 ./protochk "extern $try" $hdrs && localtime_r_proto=S_TS ;;
14852 case "$localtime_r_proto" in
14853 ''|0) try='int localtime_r(const time_t*, struct tm*);'
14854 ./protochk "extern $try" $hdrs && localtime_r_proto=I_TS ;;
14856 case "$localtime_r_proto" in
14857 ''|0) d_localtime_r=undef
14858 localtime_r_proto=0
14859 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
14860 * ) case "$localtime_r_proto" in
14861 REENTRANT_PROTO*) ;;
14862 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
14864 echo "Prototype: $try" ;;
14867 *) case "$usethreads" in
14868 define) echo "localtime_r has no prototype, not using it." >&4 ;;
14870 d_localtime_r=undef
14871 localtime_r_proto=0
14875 *) localtime_r_proto=0
14879 : see if localtime_r calls tzset
14880 case "$localtime_r_proto" in
14883 /* Does our libc's localtime_r call tzset ?
14884 * return 0 if so, 1 otherwise.
14886 #include <sys/types.h>
14887 #include <unistd.h>
14889 #include <string.h>
14890 #include <malloc.h>
14893 time_t t = time(0L);
14894 char w_tz[]="TZ" "=GMT+5",
14895 e_tz[]="TZ" "=GMT-5",
14896 *tz_e = (char*)malloc(16),
14897 *tz_w = (char*)malloc(16);
14898 struct tm tm_e, tm_w;
14899 memset(&tm_e,'\0',sizeof(struct tm));
14900 memset(&tm_w,'\0',sizeof(struct tm));
14905 localtime_r(&t, &tm_e);
14908 localtime_r(&t, &tm_w);
14910 if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 )
14916 if eval $compile; then
14917 if $run ./try; then
14918 d_localtime_r_needs_tzset=undef;
14920 d_localtime_r_needs_tzset=define;
14923 d_localtime_r_needs_tzset=undef;
14927 d_localtime_r_needs_tzset=undef;
14932 : see if localeconv exists
14933 set localeconv d_locconv
14936 : see if lockf exists
14940 : see if prototype for lseek is available
14942 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
14945 : see if lstat exists
14949 : see if madvise exists
14950 set madvise d_madvise
14953 : see if malloc_size exists
14954 set malloc_size d_malloc_size
14957 : see if malloc_size_good exists
14958 set malloc_good_size d_malloc_good_size
14961 : see if mblen exists
14965 : see if mbstowcs exists
14966 set mbstowcs d_mbstowcs
14969 : see if mbtowc exists
14970 set mbtowc d_mbtowc
14973 : see if memchr exists
14974 set memchr d_memchr
14977 : see if memcmp exists
14978 set memcmp d_memcmp
14981 : see if memcpy exists
14982 set memcpy d_memcpy
14985 : see if memmove exists
14986 set memmove d_memmove
14989 : see if memset exists
14990 set memset d_memset
14993 : see if mkdir exists
14997 : see if mkdtemp exists
14998 set mkdtemp d_mkdtemp
15001 : see if mkfifo exists
15002 set mkfifo d_mkfifo
15005 : see if mkstemp exists
15006 set mkstemp d_mkstemp
15009 : see if mkstemps exists
15010 set mkstemps d_mkstemps
15013 : see if mktime exists
15014 set mktime d_mktime
15017 : see if this is a sys/mman.h system
15018 set sys/mman.h i_sysmman
15021 : see if mmap exists
15024 : see what shmat returns
15025 : default to something harmless
15027 case "$i_sysmman$d_mmap" in
15029 $cat >mmap.c <<'END'
15030 #include <sys/mman.h>
15033 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
15038 echo "and it returns ($mmaptype)." >&4
15044 : see if sqrtl exists
15048 : see if scalbnl exists
15049 set scalbnl d_scalbnl
15052 : see if modfl exists
15056 : see if prototype for modfl is available
15058 set d_modflproto modfl $i_math math.h
15061 d_modfl_pow32_bug="$undef"
15063 case "$d_longdbl$d_modfl" in
15066 Checking to see whether your modfl() is okay for large values...
15072 if $test "X$d_modflproto" != "X$define"; then
15073 $cat >>try.c <<EOCP
15074 /* Sigh. many current glibcs provide the function, but do not prototype it. */
15075 long double modfl (long double, long double *);
15078 $cat >>try.c <<EOCP
15080 long double nv = 4294967303.15;
15086 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
15090 case "$osname:$gccversion" in
15091 aix:) saveccflags="$ccflags"
15092 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
15095 if eval $compile; then
15098 *" 4294967303.150000 1.150000 4294967302.000000")
15099 echo >&4 "Your modfl() is broken for large values."
15100 d_modfl_pow32_bug="$define"
15102 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
15106 *" 4294967303.150000 0.150000 4294967303.000000")
15107 echo >&4 "Your modfl() seems okay for large values."
15109 *) echo >&4 "I don't understand your modfl() at all."
15115 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
15118 case "$osname:$gccversion" in
15119 aix:) ccflags="$saveccflags" ;; # restore
15124 if $test "$uselongdouble" = "$define"; then
15126 if $test "$d_sqrtl" != "$define"; then
15127 message="$message sqrtl"
15129 if $test "$d_modfl" != "$define"; then
15130 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
15131 echo "You have both aintl and copysignl, so I can emulate modfl."
15133 message="$message modfl"
15136 if $test "$d_frexpl" != "$define"; then
15137 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
15138 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
15140 message="$message frexpl"
15144 if $test "$message" != ""; then
15147 *** You requested the use of long doubles but you do not seem to have
15148 *** the following mathematical functions needed for long double support:
15150 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
15151 *** Cannot continue, aborting.
15159 : see if mprotect exists
15160 set mprotect d_mprotect
15163 : see if msgctl exists
15164 set msgctl d_msgctl
15167 : see if msgget exists
15168 set msgget d_msgget
15171 : see if msgsnd exists
15172 set msgsnd d_msgsnd
15175 : see if msgrcv exists
15176 set msgrcv d_msgrcv
15179 : see how much of the 'msg*(2)' library is present.
15182 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
15183 *"$undef"*) h_msg=false;;
15187 case "`ipcs 2>&1`" in
15188 "SVID messages"*"not configured"*)
15189 echo "Your $osname does not have the msg*(2) configured." >&4
15192 set msgctl d_msgctl
15194 set msgget d_msgget
15196 set msgsnd d_msgsnd
15198 set msgrcv d_msgrcv
15204 : we could also check for sys/ipc.h ...
15205 if $h_msg && $test `./findhdr sys/msg.h`; then
15206 echo "You have the full msg*(2) library." >&4
15209 echo "You don't have the full msg*(2) library." >&4
15215 : Check for msghdr_s
15217 echo "Checking to see if your system supports struct msghdr..." >&4
15218 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
15220 case "$d_msghdr_s" in
15221 "$define") echo "Yes, it does." ;;
15222 *) echo "No, it doesn't." ;;
15226 : see if msync exists
15230 : see if munmap exists
15231 set munmap d_munmap
15234 : see if nice exists
15238 : see if this is a langinfo.h system
15239 set langinfo.h i_langinfo
15242 : see if nl_langinfo exists
15243 set nl_langinfo d_nl_langinfo
15246 : check for volatile keyword
15248 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
15249 $cat >try.c <<'EOCP'
15252 typedef struct _goo_struct goo_struct;
15253 goo_struct * volatile goo = ((goo_struct *)0);
15254 struct _goo_struct {
15259 typedef unsigned short foo_t;
15260 char *volatile foo;
15262 volatile foo_t blech;
15266 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
15268 echo "Yup, it does."
15271 echo "Nope, it doesn't."
15277 : Check basic sizes
15279 $echo "Choosing the C types to be used for Perl's internal types..." >&4
15281 case "$use64bitint:$d_quad:$quadtype" in
15284 uvtype="$uquadtype"
15289 uvtype="unsigned long"
15295 case "$uselongdouble:$d_longdbl" in
15297 nvtype="long double"
15298 nvsize=$longdblsize
15305 $echo "(IV will be "$ivtype", $ivsize bytes)"
15306 $echo "(UV will be "$uvtype", $uvsize bytes)"
15307 $echo "(NV will be "$nvtype", $nvsize bytes)"
15310 #$i_inttypes I_INTTYPES
15312 #include <inttypes.h>
15317 int8_t i = INT8_MAX;
15318 uint8_t u = UINT8_MAX;
15319 printf("int8_t\n");
15322 int16_t i = INT16_MAX;
15323 uint16_t i = UINT16_MAX;
15324 printf("int16_t\n");
15327 int32_t i = INT32_MAX;
15328 uint32_t u = UINT32_MAX;
15329 printf("int32_t\n");
15334 i8type="signed char"
15335 u8type="unsigned char"
15340 '') case "$shortsize" in
15342 u16type="unsigned short"
15350 '') set try -DINT16
15351 if eval $compile; then
15352 case "`$run ./try`" in
15364 '') if $test $shortsize -ge 2; then
15366 u16type="unsigned short"
15374 '') case "$longsize" in
15376 u32type="unsigned long"
15380 *) case "$intsize" in
15382 u32type="unsigned int"
15392 '') set try -DINT32
15393 if eval $compile; then
15394 case "`$run ./try`" in
15406 '') if $test $intsize -ge 4; then
15408 u32type="unsigned int"
15416 '') case "$d_quad:$quadtype" in
15418 i64type="$quadtype"
15419 u64type="$uquadtype"
15427 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
15428 : volatile so that the compiler has to store it out to memory.
15429 if test X"$d_volatile" = X"$define"; then
15434 #$i_stdlib I_STDLIB
15436 #include <stdlib.h>
15438 #include <sys/types.h>
15439 #include <signal.h>
15441 $volatile int bletched = 0;
15442 $signal_t blech(int s) { bletched = 1; }
15447 int n = 8 * $uvsize;
15450 signal(SIGFPE, blech);
15453 for (i = 0; i < n; i++) {
15454 u = u << 1 | ($uvtype)1;
15456 if (($uvtype)d != u)
15460 d = ($nvtype)(u - 1);
15461 if (($uvtype)d != (u - 1))
15468 printf("%d\n", ((i == n) ? -n : i));
15474 d_nv_preserves_uv="$undef"
15475 if eval $compile; then
15476 nv_preserves_uv_bits="`$run ./try`"
15478 case "$nv_preserves_uv_bits" in
15480 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
15481 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
15482 d_nv_preserves_uv="$define"
15484 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
15485 d_nv_preserves_uv="$undef" ;;
15486 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
15487 nv_preserves_uv_bits="0" ;;
15491 $echo "Checking to find the largest integer value your NVs can hold..." >&4
15492 : volatile so that the compiler has to store it out to memory.
15493 if test X"$d_volatile" = X"$define"; then
15499 typedef $nvtype NV;
15506 while(count < 256) {
15507 $volatile NV up = value + 1.0;
15508 $volatile NV negated = -value;
15509 $volatile NV down = negated - 1.0;
15510 $volatile NV got_up = up - value;
15511 int up_good = got_up == 1.0;
15512 int got_down = down - negated;
15513 int down_good = got_down == -1.0;
15515 if (down_good != up_good) {
15517 "Inconsistency - up %d %f; down %d %f; for 2**%d (%.20f)\n",
15518 up_good, (double) got_up, down_good, (double) got_down,
15519 count, (double) value);
15526 fputs("256.0", stdout);
15529 fputs("2.0", stdout);
15535 fputs("*", stdout);
15541 fprintf(stderr, "Cannot overflow integer range, even at 2**%d (%.20f)\n",
15542 count, (double) value);
15548 nv_overflows_integers_at='0'
15549 if eval $compile; then
15555 The largest integer your NVs can preserve is equal to $xxx
15557 nv_overflows_integers_at="$xxx"
15560 Cannot determine the largest integer value your NVs can hold, unexpected output
15567 Cannot determine the largest integer value your NVs can hold
15574 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
15575 : volatile so that the compiler has to store it out to memory.
15576 if test X"$d_volatile" = X"$define"; then
15581 #$i_stdlib I_STDLIB
15583 #include <stdlib.h>
15585 #$i_string I_STRING
15587 # include <string.h>
15589 # include <strings.h>
15591 #include <sys/types.h>
15592 #include <signal.h>
15594 $volatile int bletched = 0;
15595 $signal_t blech(int s) { bletched = 1; }
15598 int checkit($nvtype d, char *where) {
15599 unsigned char *p = (char *)&d;
15600 unsigned char *end = p + sizeof(d);
15610 printf("No - %s: 0x", where);
15612 printf ("%02X", *p++);
15617 int main(int argc, char **argv) {
15620 fail += checkit(d, "0.0");
15622 /* The compiler shouldn't be assuming that bletched is 0 */
15625 fail += checkit(d, "bleched");
15628 signal(SIGFPE, blech);
15631 /* Paranoia - the compiler should have no way of knowing that ANSI says
15632 that argv[argc] will always be NULL. Actually, if it did assume this it
15633 would be buggy, as this is C and main() can be called from elsewhere in
15635 d = argv[argc] ? 1 : 0;
15638 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
15641 fail += checkit(d, "ternary");
15643 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
15646 printf("No - memset doesn't give 0.0\n");
15647 /* This might just blow up: */
15648 printf("(gives %g)\n", d);
15654 printf("No - something bleched\n");
15659 printf("No - %d fail(s)\n", fail);
15668 d_nv_zero_is_allbits_zero="$undef"
15669 if eval $compile; then
15675 0.0 is represented as all bits zero in memory
15677 d_nv_zero_is_allbits_zero="$define"
15680 0.0 is not represented as all bits zero in memory
15682 d_nv_zero_is_allbits_zero="$undef"
15687 0.0 is not represented as all bits zero in memory
15689 d_nv_zero_is_allbits_zero="$undef"
15695 : check for off64_t
15697 echo "Checking to see if you have off64_t..." >&4
15699 #include <sys/types.h>
15700 #include <unistd.h>
15701 int main() { off64_t x = 7; }
15704 if eval $compile; then
15706 echo "You have off64_t."
15709 echo "You do not have off64_t."
15710 case "$lseeksize" in
15711 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
15718 : how to create joinable pthreads
15719 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
15721 echo "Checking what constant to use for creating joinable pthreads..." >&4
15722 $cat >try.c <<'EOCP'
15723 #include <pthread.h>
15725 int detachstate = JOINABLE;
15728 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
15729 if eval $compile; then
15730 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
15731 val="$undef" # Yes, undef.
15732 set d_old_pthread_create_joinable
15735 set old_pthread_create_joinable
15738 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
15739 if eval $compile; then
15740 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
15742 set d_old_pthread_create_joinable
15744 val=PTHREAD_CREATE_UNDETACHED
15745 set old_pthread_create_joinable
15748 set try -DJOINABLE=__UNDETACHED
15749 if eval $compile; then
15750 echo "You seem to use __UNDETACHED." >&4
15752 set d_old_pthread_create_joinable
15755 set old_pthread_create_joinable
15758 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
15760 set d_old_pthread_create_joinable
15763 set old_pthread_create_joinable
15770 d_old_pthread_create_joinable="$undef"
15771 old_pthread_create_joinable=""
15774 : see if pause exists
15778 : see if poll exists
15782 : see if readlink exists
15783 set readlink d_readlink
15786 : Check if exe is symlink to abs path of executing program
15790 case "$d_readlink" in
15792 if $issymlink /proc/self/exe ; then
15793 $ls -l /proc/self/exe > reflect
15794 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
15795 echo "You have Linux-like /proc/self/exe."
15796 procselfexe='"/proc/self/exe"'
15800 if $issymlink /proc/curproc/file ; then
15801 $ls -l /proc/curproc/file > reflect
15802 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
15803 echo "You have BSD-like /proc/curproc/file."
15804 procselfexe='"/proc/curproc/file"'
15814 : backward compatibility for d_hvfork
15815 if test X$d_hvfork != X; then
15816 d_vfork="$d_hvfork"
15819 : see if there is a vfork
15824 d_pseudofork=$undef
15826 : Ok, but do we want to use it. vfork is reportedly unreliable in
15827 : perl on Solaris 2.x, and probably elsewhere.
15831 case "$usevfork" in
15837 Perl can only use a vfork() that doesn't suffer from strict
15838 restrictions on calling functions or modifying global data in
15839 the child. For example, glibc-2.1 contains such a vfork()
15840 that is unsuitable. If your system provides a proper fork()
15841 call, chances are that you do NOT want perl to use vfork().
15844 rp="Do you still want to use vfork()?"
15849 echo "Ok, we won't use vfork()."
15858 $define) usevfork='true';;
15859 *) usevfork='false';;
15862 : see whether the pthread_atfork exists
15864 #include <pthread.h>
15867 #ifdef PTHREAD_ATFORK
15868 pthread_atfork(NULL,NULL,NULL);
15873 : see if pthread_atfork exists
15874 set try -DPTHREAD_ATFORK
15875 if eval $compile; then
15880 case "$usethreads" in
15883 $define) echo 'pthread_atfork found.' >&4 ;;
15884 *) echo 'pthread_atfork NOT found.' >&4 ;;
15887 set d_pthread_atfork
15890 : see if pthread_attr_setscope exists
15891 set pthread_attr_setscope d_pthread_attr_setscope
15894 : see whether the various POSIXish _yields exist
15896 #include <pthread.h>
15902 #ifdef PTHREAD_YIELD
15905 #ifdef PTHREAD_YIELD_NULL
15906 pthread_yield(NULL);
15912 : see if sched_yield exists
15913 set try -DSCHED_YIELD
15914 if eval $compile; then
15916 sched_yield='sched_yield()'
15920 case "$usethreads" in
15923 $define) echo 'sched_yield() found.' >&4 ;;
15924 *) echo 'sched_yield() NOT found.' >&4 ;;
15930 : see if pthread_yield exists
15931 set try -DPTHREAD_YIELD
15932 if eval $compile; then
15934 case "$sched_yield" in
15935 '') sched_yield='pthread_yield()' ;;
15938 set try -DPTHREAD_YIELD_NULL
15939 if eval $compile; then
15941 case "$sched_yield" in
15942 '') sched_yield='pthread_yield(NULL)' ;;
15948 case "$usethreads" in
15951 $define) echo 'pthread_yield() found.' >&4 ;;
15952 *) echo 'pthread_yield() NOT found.' >&4 ;;
15956 set d_pthread_yield
15958 case "$sched_yield" in
15959 '') sched_yield=undef ;;
15963 : see if random_r exists
15964 set random_r d_random_r
15966 case "$d_random_r" in
15968 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
15969 case "$d_random_r_proto:$usethreads" in
15970 ":define") d_random_r_proto=define
15971 set d_random_r_proto random_r $hdrs
15975 case "$d_random_r_proto" in
15977 case "$random_r_proto" in
15978 ''|0) try='int random_r(int*, struct random_data*);'
15979 ./protochk "extern $try" $hdrs && random_r_proto=I_iS ;;
15981 case "$random_r_proto" in
15982 ''|0) try='int random_r(long*, struct random_data*);'
15983 ./protochk "extern $try" $hdrs && random_r_proto=I_lS ;;
15985 case "$random_r_proto" in
15986 ''|0) try='int random_r(struct random_data*, int32_t*);'
15987 ./protochk "extern $try" $hdrs && random_r_proto=I_St ;;
15989 case "$random_r_proto" in
15990 ''|0) d_random_r=undef
15992 echo "Disabling random_r, cannot determine prototype." >&4 ;;
15993 * ) case "$random_r_proto" in
15994 REENTRANT_PROTO*) ;;
15995 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
15997 echo "Prototype: $try" ;;
16000 *) case "$usethreads" in
16001 define) echo "random_r has no prototype, not using it." >&4 ;;
16008 *) random_r_proto=0
16012 : see if readdir and friends exist
16013 set readdir d_readdir
16015 set seekdir d_seekdir
16017 set telldir d_telldir
16019 set rewinddir d_rewinddir
16022 : see if readdir64_r exists
16023 set readdir64_r d_readdir64_r
16025 case "$d_readdir64_r" in
16027 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
16028 case "$d_readdir64_r_proto:$usethreads" in
16029 ":define") d_readdir64_r_proto=define
16030 set d_readdir64_r_proto readdir64_r $hdrs
16034 case "$d_readdir64_r_proto" in
16036 case "$readdir64_r_proto" in
16037 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
16038 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TSR ;;
16040 case "$readdir64_r_proto" in
16041 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
16042 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TS ;;
16044 case "$readdir64_r_proto" in
16045 ''|0) d_readdir64_r=undef
16046 readdir64_r_proto=0
16047 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
16048 * ) case "$readdir64_r_proto" in
16049 REENTRANT_PROTO*) ;;
16050 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
16052 echo "Prototype: $try" ;;
16055 *) case "$usethreads" in
16056 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
16058 d_readdir64_r=undef
16059 readdir64_r_proto=0
16063 *) readdir64_r_proto=0
16067 : see if readdir_r exists
16068 set readdir_r d_readdir_r
16070 case "$d_readdir_r" in
16072 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
16073 case "$d_readdir_r_proto:$usethreads" in
16074 ":define") d_readdir_r_proto=define
16075 set d_readdir_r_proto readdir_r $hdrs
16079 case "$d_readdir_r_proto" in
16081 case "$readdir_r_proto" in
16082 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
16083 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TSR ;;
16085 case "$readdir_r_proto" in
16086 ''|0) try='int readdir_r(DIR*, struct dirent*);'
16087 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TS ;;
16089 case "$readdir_r_proto" in
16090 ''|0) d_readdir_r=undef
16092 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
16093 * ) case "$readdir_r_proto" in
16094 REENTRANT_PROTO*) ;;
16095 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
16097 echo "Prototype: $try" ;;
16100 *) case "$usethreads" in
16101 define) echo "readdir_r has no prototype, not using it." >&4 ;;
16108 *) readdir_r_proto=0
16112 : see if readv exists
16116 : see if recvmsg exists
16117 set recvmsg d_recvmsg
16120 : see if rename exists
16121 set rename d_rename
16124 : see if rmdir exists
16128 : see if memory.h is available.
16133 : See if it conflicts with string.h
16139 $cppstdin $cppflags $cppminus < $strings > mem.h
16140 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
16142 echo "We won't be including <memory.h>."
16152 : can bcopy handle overlapping blocks?
16155 case "$d_memmove" in
16156 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
16157 *) case "$d_bcopy" in
16159 echo "Checking to see if bcopy() can do overlapping copies..." >&4
16161 #$i_memory I_MEMORY
16162 #$i_stdlib I_STDLIB
16163 #$i_string I_STRING
16164 #$i_unistd I_UNISTD
16166 $cat >>try.c <<'EOCP'
16169 # include <memory.h>
16172 # include <stdlib.h>
16175 # include <string.h>
16177 # include <strings.h>
16180 # include <unistd.h> /* Needed for NetBSD */
16184 char buf[128], abc[128];
16190 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16191 try to store the string in read-only memory. */
16192 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
16194 for (align = 7; align >= 0; align--) {
16195 for (len = 36; len; len--) {
16197 bcopy(abc, b, len);
16198 for (off = 1; off <= len; off++) {
16199 bcopy(b, b+off, len);
16200 bcopy(b+off, b, len);
16201 if (bcmp(b, abc, len))
16210 if eval $compile_ok; then
16211 if $run ./try 2>/dev/null; then
16212 echo "Yes, it can."
16215 echo "It can't, sorry."
16218 echo "(I can't compile the test program, so we'll assume not...)"
16228 : can memcpy handle overlapping blocks?
16231 case "$d_memmove" in
16232 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
16233 *) case "$d_memcpy" in
16235 echo "Checking to see if memcpy() can do overlapping copies..." >&4
16237 #$i_memory I_MEMORY
16238 #$i_stdlib I_STDLIB
16239 #$i_string I_STRING
16240 #$i_unistd I_UNISTD
16242 $cat >>try.c <<'EOCP'
16245 # include <memory.h>
16248 # include <stdlib.h>
16251 # include <string.h>
16253 # include <strings.h>
16256 # include <unistd.h> /* Needed for NetBSD */
16260 char buf[128], abc[128];
16266 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16267 try to store the string in read-only memory. */
16268 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
16270 for (align = 7; align >= 0; align--) {
16271 for (len = 36; len; len--) {
16273 memcpy(b, abc, len);
16274 for (off = 1; off <= len; off++) {
16275 memcpy(b+off, b, len);
16276 memcpy(b, b+off, len);
16277 if (memcmp(b, abc, len))
16286 if eval $compile_ok; then
16287 if $run ./try 2>/dev/null; then
16288 echo "Yes, it can."
16291 echo "It can't, sorry."
16294 echo "(I can't compile the test program, so we'll assume not...)"
16304 : can memcmp be trusted to compare relative magnitude?
16306 case "$d_memcmp" in
16309 echo "Checking if your memcmp() can compare relative magnitude..." >&4
16311 #$i_memory I_MEMORY
16312 #$i_stdlib I_STDLIB
16313 #$i_string I_STRING
16314 #$i_unistd I_UNISTD
16316 $cat >>try.c <<'EOCP'
16319 # include <memory.h>
16322 # include <stdlib.h>
16325 # include <string.h>
16327 # include <strings.h>
16330 # include <unistd.h> /* Needed for NetBSD */
16336 if ((a < b) && memcmp(&a, &b, 1) < 0)
16342 if eval $compile_ok; then
16343 if $run ./try 2>/dev/null; then
16344 echo "Yes, it can."
16347 echo "No, it can't (it uses signed chars)."
16350 echo "(I can't compile the test program, so we'll assume not...)"
16358 : see if prototype for sbrk is available
16360 set d_sbrkproto sbrk $i_unistd unistd.h
16363 : see if select exists
16364 set select d_select
16367 : see if semctl exists
16368 set semctl d_semctl
16371 : see if semget exists
16372 set semget d_semget
16375 : see if semop exists
16379 : see how much of the 'sem*(2)' library is present.
16382 case "$d_semctl$d_semget$d_semop" in
16383 *"$undef"*) h_sem=false;;
16387 case "`ipcs 2>&1`" in
16388 "SVID messages"*"not configured"*)
16389 echo "Your $osname does not have the sem*(2) configured." >&4
16392 set semctl d_semctl
16394 set semget d_semget
16402 : we could also check for sys/ipc.h ...
16403 if $h_sem && $test `./findhdr sys/sem.h`; then
16404 echo "You have the full sem*(2) library." >&4
16407 echo "You don't have the full sem*(2) library." >&4
16413 : see whether sys/sem.h defines union semun
16415 $cat > try.c <<'END'
16416 #include <sys/types.h>
16417 #include <sys/ipc.h>
16418 #include <sys/sem.h>
16419 int main () { union semun semun; semun.buf = 0; }
16422 if eval $compile; then
16423 echo "You have union semun in <sys/sem.h>." >&4
16426 echo "You do not have union semun in <sys/sem.h>." >&4
16433 : see how to do semctl IPC_STAT
16437 $cat > tryh.h <<END
16440 # define S_IRUSR S_IREAD
16441 # define S_IWUSR S_IWRITE
16442 # define S_IXUSR S_IEXEC
16444 # define S_IRUSR 0400
16445 # define S_IWUSR 0200
16446 # define S_IXUSR 0100
16448 # define S_IRGRP (S_IRUSR>>3)
16449 # define S_IWGRP (S_IWUSR>>3)
16450 # define S_IXGRP (S_IXUSR>>3)
16451 # define S_IROTH (S_IRUSR>>6)
16452 # define S_IWOTH (S_IWUSR>>6)
16453 # define S_IXOTH (S_IXUSR>>6)
16456 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
16457 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
16458 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
16461 : see whether semctl IPC_STAT can use union semun
16462 case "$d_semctl_semun" in
16466 #include <sys/types.h>
16467 #include <sys/ipc.h>
16468 #include <sys/sem.h>
16469 #include <sys/stat.h>
16476 #$d_union_semun HAS_UNION_SEMUN
16479 #ifndef HAS_UNION_SEMUN
16482 struct semid_ds *buf;
16483 unsigned short *array;
16489 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16490 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16492 struct semid_ds argbuf;
16495 st = semctl(sem, 0, IPC_STAT, arg);
16499 # endif /* IPC_STAT */
16500 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16502 if (semctl(sem, 0, IPC_RMID, arg) != 0)
16503 # endif /* IPC_RMID */
16504 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16506 #endif /* IPC_PRIVATE && ... */
16507 printf("semget failed: errno = %d\n", errno);
16512 if eval $compile; then
16515 semun) val="$define" ;;
16523 case "$d_semctl_semun" in
16525 echo "You can use union semun for semctl IPC_STAT." >&4
16528 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
16533 : see whether semctl IPC_STAT can use struct semid_ds pointer
16534 case "$d_semctl_semid_ds" in
16537 $cat > try.c <<'END'
16538 #include <sys/types.h>
16539 #include <sys/ipc.h>
16540 #include <sys/sem.h>
16541 #include <sys/stat.h>
16549 struct semid_ds arg;
16552 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16553 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16556 st = semctl(sem, 0, IPC_STAT, &arg);
16558 printf("semid_ds\n");
16560 # endif /* IPC_STAT */
16561 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16563 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
16564 # endif /* IPC_RMID */
16565 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16567 #endif /* IPC_PRIVATE && ... */
16568 printf("semget failed: errno = %d\n", errno);
16574 if eval $compile; then
16577 semid_ds) val="$define" ;;
16581 set d_semctl_semid_ds
16585 case "$d_semctl_semid_ds" in
16587 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
16589 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
16595 # We do not have the full sem*(2) library, so assume we can not
16601 set d_semctl_semid_ds
16607 : see if sendmsg exists
16608 set sendmsg d_sendmsg
16611 : see if setegid exists
16612 set setegid d_setegid
16615 : see if seteuid exists
16616 set seteuid d_seteuid
16619 : see if setgrent exists
16620 set setgrent d_setgrent
16623 : see if setgrent_r exists
16624 set setgrent_r d_setgrent_r
16626 case "$d_setgrent_r" in
16628 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
16629 case "$d_setgrent_r_proto:$usethreads" in
16630 ":define") d_setgrent_r_proto=define
16631 set d_setgrent_r_proto setgrent_r $hdrs
16635 case "$d_setgrent_r_proto" in
16637 case "$setgrent_r_proto" in
16638 ''|0) try='int setgrent_r(FILE**);'
16639 ./protochk "extern $try" $hdrs && setgrent_r_proto=I_H ;;
16641 case "$setgrent_r_proto" in
16642 ''|0) try='void setgrent_r(FILE**);'
16643 ./protochk "extern $try" $hdrs && setgrent_r_proto=V_H ;;
16645 case "$setgrent_r_proto" in
16646 ''|0) d_setgrent_r=undef
16648 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
16649 * ) case "$setgrent_r_proto" in
16650 REENTRANT_PROTO*) ;;
16651 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
16653 echo "Prototype: $try" ;;
16656 *) case "$usethreads" in
16657 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
16664 *) setgrent_r_proto=0
16668 : see if sethostent exists
16669 set sethostent d_sethent
16672 : see if sethostent_r exists
16673 set sethostent_r d_sethostent_r
16675 case "$d_sethostent_r" in
16677 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16678 case "$d_sethostent_r_proto:$usethreads" in
16679 ":define") d_sethostent_r_proto=define
16680 set d_sethostent_r_proto sethostent_r $hdrs
16684 case "$d_sethostent_r_proto" in
16686 case "$sethostent_r_proto" in
16687 ''|0) try='int sethostent_r(int, struct hostent_data*);'
16688 ./protochk "extern $try" $hdrs && sethostent_r_proto=I_ID ;;
16690 case "$sethostent_r_proto" in
16691 ''|0) try='void sethostent_r(int, struct hostent_data*);'
16692 ./protochk "extern $try" $hdrs && sethostent_r_proto=V_ID ;;
16694 case "$sethostent_r_proto" in
16695 ''|0) d_sethostent_r=undef
16696 sethostent_r_proto=0
16697 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
16698 * ) case "$sethostent_r_proto" in
16699 REENTRANT_PROTO*) ;;
16700 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
16702 echo "Prototype: $try" ;;
16705 *) case "$usethreads" in
16706 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
16708 d_sethostent_r=undef
16709 sethostent_r_proto=0
16713 *) sethostent_r_proto=0
16717 : see if setitimer exists
16718 set setitimer d_setitimer
16721 : see if setlinebuf exists
16722 set setlinebuf d_setlinebuf
16725 : see if setlocale exists
16726 set setlocale d_setlocale
16729 : see if locale.h is available
16730 set locale.h i_locale
16733 : see if setlocale_r exists
16734 set setlocale_r d_setlocale_r
16736 case "$d_setlocale_r" in
16738 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
16739 case "$d_setlocale_r_proto:$usethreads" in
16740 ":define") d_setlocale_r_proto=define
16741 set d_setlocale_r_proto setlocale_r $hdrs
16745 case "$d_setlocale_r_proto" in
16747 case "$setlocale_r_proto" in
16748 ''|0) try='int setlocale_r(int, const char*, char*, int);'
16749 ./protochk "extern $try" $hdrs && setlocale_r_proto=I_ICBI ;;
16751 case "$setlocale_r_proto" in
16752 ''|0) d_setlocale_r=undef
16753 setlocale_r_proto=0
16754 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
16755 * ) case "$setlocale_r_proto" in
16756 REENTRANT_PROTO*) ;;
16757 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
16759 echo "Prototype: $try" ;;
16762 *) case "$usethreads" in
16763 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
16765 d_setlocale_r=undef
16766 setlocale_r_proto=0
16770 *) setlocale_r_proto=0
16774 : see if setnetent exists
16775 set setnetent d_setnent
16778 : see if setnetent_r exists
16779 set setnetent_r d_setnetent_r
16781 case "$d_setnetent_r" in
16783 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16784 case "$d_setnetent_r_proto:$usethreads" in
16785 ":define") d_setnetent_r_proto=define
16786 set d_setnetent_r_proto setnetent_r $hdrs
16790 case "$d_setnetent_r_proto" in
16792 case "$setnetent_r_proto" in
16793 ''|0) try='int setnetent_r(int, struct netent_data*);'
16794 ./protochk "extern $try" $hdrs && setnetent_r_proto=I_ID ;;
16796 case "$setnetent_r_proto" in
16797 ''|0) try='void setnetent_r(int, struct netent_data*);'
16798 ./protochk "extern $try" $hdrs && setnetent_r_proto=V_ID ;;
16800 case "$setnetent_r_proto" in
16801 ''|0) d_setnetent_r=undef
16802 setnetent_r_proto=0
16803 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
16804 * ) case "$setnetent_r_proto" in
16805 REENTRANT_PROTO*) ;;
16806 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
16808 echo "Prototype: $try" ;;
16811 *) case "$usethreads" in
16812 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
16814 d_setnetent_r=undef
16815 setnetent_r_proto=0
16819 *) setnetent_r_proto=0
16823 : see if setprotoent exists
16824 set setprotoent d_setpent
16827 : see if setpgid exists
16828 set setpgid d_setpgid
16831 : see if setpgrp2 exists
16832 set setpgrp2 d_setpgrp2
16835 : see if setpriority exists
16836 set setpriority d_setprior
16839 : see if setproctitle exists
16840 set setproctitle d_setproctitle
16843 : see if setprotoent_r exists
16844 set setprotoent_r d_setprotoent_r
16846 case "$d_setprotoent_r" in
16848 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16849 case "$d_setprotoent_r_proto:$usethreads" in
16850 ":define") d_setprotoent_r_proto=define
16851 set d_setprotoent_r_proto setprotoent_r $hdrs
16855 case "$d_setprotoent_r_proto" in
16857 case "$setprotoent_r_proto" in
16858 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
16859 ./protochk "extern $try" $hdrs && setprotoent_r_proto=I_ID ;;
16861 case "$setprotoent_r_proto" in
16862 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
16863 ./protochk "extern $try" $hdrs && setprotoent_r_proto=V_ID ;;
16865 case "$setprotoent_r_proto" in
16866 ''|0) d_setprotoent_r=undef
16867 setprotoent_r_proto=0
16868 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
16869 * ) case "$setprotoent_r_proto" in
16870 REENTRANT_PROTO*) ;;
16871 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
16873 echo "Prototype: $try" ;;
16876 *) case "$usethreads" in
16877 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
16879 d_setprotoent_r=undef
16880 setprotoent_r_proto=0
16884 *) setprotoent_r_proto=0
16888 : see if setpwent exists
16889 set setpwent d_setpwent
16892 : see if setpwent_r exists
16893 set setpwent_r d_setpwent_r
16895 case "$d_setpwent_r" in
16897 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
16898 case "$d_setpwent_r_proto:$usethreads" in
16899 ":define") d_setpwent_r_proto=define
16900 set d_setpwent_r_proto setpwent_r $hdrs
16904 case "$d_setpwent_r_proto" in
16906 case "$setpwent_r_proto" in
16907 ''|0) try='int setpwent_r(FILE**);'
16908 ./protochk "extern $try" $hdrs && setpwent_r_proto=I_H ;;
16910 case "$setpwent_r_proto" in
16911 ''|0) try='void setpwent_r(FILE**);'
16912 ./protochk "extern $try" $hdrs && setpwent_r_proto=V_H ;;
16914 case "$setpwent_r_proto" in
16915 ''|0) d_setpwent_r=undef
16917 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
16918 * ) case "$setpwent_r_proto" in
16919 REENTRANT_PROTO*) ;;
16920 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
16922 echo "Prototype: $try" ;;
16925 *) case "$usethreads" in
16926 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
16933 *) setpwent_r_proto=0
16937 : see if setregid exists
16938 set setregid d_setregid
16940 set setresgid d_setresgid
16943 : see if setreuid exists
16944 set setreuid d_setreuid
16946 set setresuid d_setresuid
16949 : see if setrgid exists
16950 set setrgid d_setrgid
16953 : see if setruid exists
16954 set setruid d_setruid
16957 : see if setservent exists
16958 set setservent d_setsent
16961 : see if setservent_r exists
16962 set setservent_r d_setservent_r
16964 case "$d_setservent_r" in
16966 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16967 case "$d_setservent_r_proto:$usethreads" in
16968 ":define") d_setservent_r_proto=define
16969 set d_setservent_r_proto setservent_r $hdrs
16973 case "$d_setservent_r_proto" in
16975 case "$setservent_r_proto" in
16976 ''|0) try='int setservent_r(int, struct servent_data*);'
16977 ./protochk "extern $try" $hdrs && setservent_r_proto=I_ID ;;
16979 case "$setservent_r_proto" in
16980 ''|0) try='void setservent_r(int, struct servent_data*);'
16981 ./protochk "extern $try" $hdrs && setservent_r_proto=V_ID ;;
16983 case "$setservent_r_proto" in
16984 ''|0) d_setservent_r=undef
16985 setservent_r_proto=0
16986 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
16987 * ) case "$setservent_r_proto" in
16988 REENTRANT_PROTO*) ;;
16989 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
16991 echo "Prototype: $try" ;;
16994 *) case "$usethreads" in
16995 define) echo "setservent_r has no prototype, not using it." >&4 ;;
16997 d_setservent_r=undef
16998 setservent_r_proto=0
17002 *) setservent_r_proto=0
17006 : see if setsid exists
17007 set setsid d_setsid
17010 : see if setvbuf exists
17011 set setvbuf d_setvbuf
17014 : see if sfio.h is available
17018 : see if sfio library is available
17029 : Ok, but do we want to use it.
17033 true|$define|[yY]*) dflt='y';;
17036 echo "$package can use the sfio library, but it is experimental."
17037 case "$useperlio" in
17039 echo "For sfio also the PerlIO abstraction layer is needed."
17040 echo "Earlier you said you wouldn't want that."
17043 rp="You seem to have sfio available, do you want to try using it?"
17046 y|Y) echo "Ok, turning on both sfio and PerlIO, then."
17047 useperlio="$define"
17050 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
17055 *) case "$usesfio" in
17056 true|$define|[yY]*)
17057 echo "Sorry, cannot find sfio on this machine." >&4
17058 echo "Ignoring your setting of usesfio=$usesfio." >&4
17067 $define) usesfio='true';;
17068 *) usesfio='false';;
17072 *) : Remove sfio from list of libraries to use
17075 echo "Removing unneeded -lsfio from library list" >&4
17076 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
17079 echo "libs = $libs" >&4
17086 : see if shmctl exists
17087 set shmctl d_shmctl
17090 : see if shmget exists
17091 set shmget d_shmget
17094 : see if shmat exists
17097 : see what shmat returns
17100 $cat >shmat.c <<'END'
17101 #include <sys/shm.h>
17104 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
17109 echo "and it returns ($shmattype)." >&4
17110 : see if a prototype for shmat is available
17111 xxx=`./findhdr sys/shm.h`
17112 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
17113 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
17124 set d_shmatprototype
17127 : see if shmdt exists
17131 : see how much of the 'shm*(2)' library is present.
17134 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
17135 *"$undef"*) h_shm=false;;
17139 case "`ipcs 2>&1`" in
17140 "SVID shared memory"*"not configured"*)
17141 echo "Your $osname does not have the shm*(2) configured." >&4
17144 set shmctl d_shmctl
17146 set shmget d_shmget
17156 : we could also check for sys/ipc.h ...
17157 if $h_shm && $test `./findhdr sys/shm.h`; then
17158 echo "You have the full shm*(2) library." >&4
17161 echo "You don't have the full shm*(2) library." >&4
17167 : see if we have sigaction
17169 if set sigaction val -f d_sigaction; eval $csym; $val; then
17170 echo 'sigaction() found.' >&4
17173 #include <sys/types.h>
17174 #include <signal.h>
17175 #$i_stdlib I_STDLIB
17177 #include <stdlib.h>
17181 struct sigaction act, oact;
17183 oact.sa_handler = 0;
17184 /* so that act and oact are used */
17185 exit(act.sa_flags == 0 && oact.sa_handler == 0);
17189 if eval $compile_ok; then
17192 echo "But you don't seem to have a useable struct sigaction." >&4
17196 echo 'sigaction NOT found.' >&4
17199 set d_sigaction; eval $setvar
17202 : see if this is a sunmath.h system
17203 set sunmath.h i_sunmath
17206 : see if signbit exists
17207 $echo $n "Checking to see if you have signbit() available to work on $nvtype... $c" >&4
17210 #$i_sunmath I_SUNMATH
17214 #ifdef I_SUNMATH /* Solaris special math library */
17215 # include <sunmath.h>
17218 int main(int argc, char **argv)
17222 if ((signbit(x) == 0) && (signbit(y) != 0))
17230 if eval $compile; then
17231 if $run ./try; then
17235 $echo "Signbit seems to be available, but doesn't work as I expected."
17236 $echo "I won't use it." >&4
17247 : see if sigprocmask exists
17248 set sigprocmask d_sigprocmask
17251 : see if sigsetjmp exists
17253 case "$d_sigsetjmp" in
17256 #include <setjmp.h>
17257 #$i_stdlib I_STDLIB
17259 #include <stdlib.h>
17265 if (sigsetjmp(env,1))
17268 siglongjmp(env, 1);
17273 if eval $compile; then
17274 if $run ./try >/dev/null 2>&1; then
17275 echo "POSIX sigsetjmp found." >&4
17279 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
17285 echo "sigsetjmp not found." >&4
17289 *) val="$d_sigsetjmp"
17290 case "$d_sigsetjmp" in
17291 $define) echo "POSIX sigsetjmp found." >&4;;
17292 $undef) echo "sigsetjmp not found." >&4;;
17300 : see if snprintf exists
17301 set snprintf d_snprintf
17304 : see if vsnprintf exists
17305 set vsnprintf d_vsnprintf
17308 case "$d_snprintf-$d_vsnprintf" in
17311 Checking whether your snprintf() and vsnprintf() work okay...
17313 $cat >try.c <<'EOCP'
17314 /* v?snprintf testing logic courtesy of Russ Allbery.
17315 * According to C99:
17316 * - if the buffer is too short it still must be \0-terminated
17317 * - if the buffer is too short the potentially required length
17318 * must be returned and not -1
17319 * - if the buffer is NULL the potentially required length
17320 * must be returned and not -1 or core dump
17323 #include <stdarg.h>
17327 int test (char *format, ...)
17332 va_start (args, format);
17333 count = vsnprintf (buf, sizeof buf, format, args);
17340 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
17341 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
17345 if eval $compile; then
17348 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
17350 Your snprintf() and snprintf() don't seem to be working okay.
17352 d_snprintf="$undef"
17353 d_vsnprintf="$undef"
17357 echo "(I can't seem to compile the test program--assuming they don't)"
17358 d_snprintf="$undef"
17359 d_vsnprintf="$undef"
17365 : see if sockatmark exists
17366 set sockatmark d_sockatmark
17369 : see if prototype for sockatmark is available
17371 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
17374 : see if socks5_init exists
17375 set socks5_init d_socks5_init
17378 : see if sprintf returns the length of the string in the buffer as per ANSI
17379 $echo "Checking whether sprintf returns the length of the string..." >&4
17382 #$i_stdlib I_STDLIB
17384 #include <stdlib.h>
17386 #$i_string I_STRING
17388 # include <string.h>
17390 # include <strings.h>
17399 int check (size_t expect, int test) {
17400 size_t got = strlen(buffer);
17404 printf("expected %ld, got %ld in test %d '%s'\n", (long) expect, (long) got,
17409 int main(int argc, char **argv) {
17412 check(sprintf(buffer, ""), ++test);
17413 check(sprintf(buffer, "%s %s", "perl", "rules"), ++test);
17414 check(sprintf(buffer, "I like %g", atan2(0,-1)), ++test);
17421 d_sprintf_returns_strlen="$undef"
17422 if eval $compile; then
17426 sprintf returns the length of the string (as ANSI says it should)
17428 d_sprintf_returns_strlen="$define"
17431 sprintf does not return the length of the string (how old is this system?)
17433 d_sprintf_returns_strlen="$undef"
17439 : see if srand48_r exists
17440 set srand48_r d_srand48_r
17442 case "$d_srand48_r" in
17444 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17445 case "$d_srand48_r_proto:$usethreads" in
17446 ":define") d_srand48_r_proto=define
17447 set d_srand48_r_proto srand48_r $hdrs
17451 case "$d_srand48_r_proto" in
17453 case "$srand48_r_proto" in
17454 ''|0) try='int srand48_r(long, struct drand48_data*);'
17455 ./protochk "extern $try" $hdrs && srand48_r_proto=I_LS ;;
17457 case "$srand48_r_proto" in
17458 ''|0) d_srand48_r=undef
17460 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
17461 * ) case "$srand48_r_proto" in
17462 REENTRANT_PROTO*) ;;
17463 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
17465 echo "Prototype: $try" ;;
17468 *) case "$usethreads" in
17469 define) echo "srand48_r has no prototype, not using it." >&4 ;;
17476 *) srand48_r_proto=0
17480 : see if srandom_r exists
17481 set srandom_r d_srandom_r
17483 case "$d_srandom_r" in
17485 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17486 case "$d_srandom_r_proto:$usethreads" in
17487 ":define") d_srandom_r_proto=define
17488 set d_srandom_r_proto srandom_r $hdrs
17492 case "$d_srandom_r_proto" in
17494 case "$srandom_r_proto" in
17495 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
17496 ./protochk "extern $try" $hdrs && srandom_r_proto=I_TS ;;
17498 case "$srandom_r_proto" in
17499 ''|0) d_srandom_r=undef
17501 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
17502 * ) case "$srandom_r_proto" in
17503 REENTRANT_PROTO*) ;;
17504 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
17506 echo "Prototype: $try" ;;
17509 *) case "$usethreads" in
17510 define) echo "srandom_r has no prototype, not using it." >&4 ;;
17517 *) srandom_r_proto=0
17521 : see if prototype for setresgid is available
17523 set d_sresgproto setresgid $i_unistd unistd.h
17526 : see if prototype for setresuid is available
17528 set d_sresuproto setresuid $i_unistd unistd.h
17531 : see if sys/stat.h is available
17532 set sys/stat.h i_sysstat
17535 : see if stat knows about block sizes
17537 echo "Checking to see if your struct stat has st_blocks field..." >&4
17538 set d_statblks stat st_blocks $i_sysstat sys/stat.h
17541 : see if this is a sys/vfs.h system
17542 set sys/vfs.h i_sysvfs
17545 : see if this is a sys/statfs.h system
17546 set sys/statfs.h i_sysstatfs
17549 : Check for statfs_s
17551 echo "Checking to see if your system supports struct statfs..." >&4
17552 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
17554 case "$d_statfs_s" in
17555 "$define") echo "Yes, it does." ;;
17556 *) echo "No, it doesn't." ;;
17560 : see if struct statfs knows about f_flags
17561 case "$d_statfs_s" in
17564 echo "Checking to see if your struct statfs has f_flags field..." >&4
17565 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
17569 set d_statfs_f_flags
17573 case "$d_statfs_f_flags" in
17574 "$define") echo "Yes, it does." ;;
17575 *) echo "No, it doesn't." ;;
17578 : Check stream access
17580 Checking how to access stdio streams by file descriptor number...
17582 case "$stdio_stream_array" in
17583 '') $cat >try.c <<EOCP
17586 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
17590 for s in _iob __iob __sF
17592 set try -DSTDIO_STREAM_ARRAY=$s
17593 if eval $compile; then
17594 case "`$run ./try`" in
17595 yes) stdio_stream_array=$s; break ;;
17601 case "$stdio_stream_array" in
17603 I can't figure out how to access stdio streams by file descriptor number.
17605 d_stdio_stream_array="$undef"
17608 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
17610 d_stdio_stream_array="$define"
17614 : see if strcoll exists
17615 set strcoll d_strcoll
17618 : check for structure copying
17620 echo "Checking to see if your C compiler can copy structs..." >&4
17621 $cat >try.c <<'EOCP'
17631 if $cc -c try.c >/dev/null 2>&1 ; then
17633 echo "Yup, it can."
17636 echo "Nope, it can't."
17642 : see if strerror and/or sys_errlist[] exist
17644 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
17645 if set strerror val -f d_strerror; eval $csym; $val; then
17646 echo 'strerror() found.' >&4
17647 d_strerror="$define"
17648 d_strerrm='strerror(e)'
17649 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17650 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
17651 d_syserrlst="$define"
17653 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
17654 d_syserrlst="$undef"
17656 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
17657 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
17658 echo 'strerror() found in string header.' >&4
17659 d_strerror="$define"
17660 d_strerrm='strerror(e)'
17661 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17662 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
17663 d_syserrlst="$define"
17665 echo "(You don't appear to have any sys_errlist[], how can this be?)"
17666 d_syserrlst="$undef"
17668 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17669 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
17670 d_strerror="$undef"
17671 d_syserrlst="$define"
17672 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
17674 echo 'strerror() and sys_errlist[] NOT found.' >&4
17675 d_strerror="$undef"
17676 d_syserrlst="$undef"
17677 d_strerrm='"unknown"'
17681 : see if strerror_r exists
17682 set strerror_r d_strerror_r
17684 case "$d_strerror_r" in
17686 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
17687 case "$d_strerror_r_proto:$usethreads" in
17688 ":define") d_strerror_r_proto=define
17689 set d_strerror_r_proto strerror_r $hdrs
17693 case "$d_strerror_r_proto" in
17695 case "$strerror_r_proto" in
17696 ''|0) try='int strerror_r(int, char*, size_t);'
17697 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBW ;;
17699 case "$strerror_r_proto" in
17700 ''|0) try='int strerror_r(int, char*, int);'
17701 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBI ;;
17703 case "$strerror_r_proto" in
17704 ''|0) try='char* strerror_r(int, char*, size_t);'
17705 ./protochk "extern $try" $hdrs && strerror_r_proto=B_IBW ;;
17707 case "$strerror_r_proto" in
17708 ''|0) d_strerror_r=undef
17710 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
17711 * ) case "$strerror_r_proto" in
17712 REENTRANT_PROTO*) ;;
17713 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
17715 echo "Prototype: $try" ;;
17718 *) case "$usethreads" in
17719 define) echo "strerror_r has no prototype, not using it." >&4 ;;
17726 *) strerror_r_proto=0
17730 : see if strftime exists
17731 set strftime d_strftime
17734 : see if strlcat exists
17735 set strlcat d_strlcat
17738 : see if strlcpy exists
17739 set strlcpy d_strlcpy
17742 : see if strtod exists
17743 set strtod d_strtod
17746 : see if strtol exists
17747 set strtol d_strtol
17750 : see if strtold exists
17751 set strtold d_strtold
17754 : see if strtoll exists
17755 set strtoll d_strtoll
17758 case "$d_longlong-$d_strtoll" in
17761 Checking whether your strtoll() works okay...
17763 $cat >try.c <<'EOCP'
17766 #define strtoll __strtoll
17769 #define strtoll _strtoll
17772 extern long long int strtoll(char *s, char **, int);
17773 static int bad = 0;
17774 int check(char *s, long long ell, int een) {
17777 gll = strtoll(s, 0, 10);
17778 if (!((gll == ell) && (errno == een)))
17782 check(" 1", 1LL, 0);
17783 check(" 0", 0LL, 0);
17784 check("-1", -1LL, 0);
17785 check("-9223372036854775808", -9223372036854775808LL, 0);
17786 check("-9223372036854775808", -9223372036854775808LL, 0);
17787 check(" 9223372036854775807", 9223372036854775807LL, 0);
17788 check("-9223372036854775808", -9223372036854775808LL, 0);
17789 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
17790 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
17796 if eval $compile; then
17799 ok) echo "Your strtoll() seems to be working okay." ;;
17801 Your strtoll() doesn't seem to be working okay.
17807 echo "(I can't seem to compile the test program--assuming it doesn't)"
17813 : see if strtoq exists
17814 set strtoq d_strtoq
17817 : see if strtoul exists
17818 set strtoul d_strtoul
17821 case "$d_strtoul" in
17824 Checking whether your strtoul() works okay...
17826 $cat >try.c <<'EOCP'
17829 extern unsigned long int strtoul(char *s, char **, int);
17830 static int bad = 0;
17831 void check(char *s, unsigned long eul, int een) {
17834 gul = strtoul(s, 0, 10);
17835 if (!((gul == eul) && (errno == een)))
17839 check(" 1", 1L, 0);
17840 check(" 0", 0L, 0);
17842 case "$longsize" in
17844 $cat >>try.c <<'EOCP'
17845 check("18446744073709551615", 18446744073709551615UL, 0);
17846 check("18446744073709551616", 18446744073709551615UL, ERANGE);
17847 #if 0 /* strtoul() for /^-/ strings is undefined. */
17848 check("-1", 18446744073709551615UL, 0);
17849 check("-18446744073709551614", 2, 0);
17850 check("-18446744073709551615", 1, 0);
17851 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
17852 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
17857 $cat >>try.c <<'EOCP'
17858 check("4294967295", 4294967295UL, 0);
17859 check("4294967296", 4294967295UL, ERANGE);
17860 #if 0 /* strtoul() for /^-/ strings is undefined. */
17861 check("-1", 4294967295UL, 0);
17862 check("-4294967294", 2, 0);
17863 check("-4294967295", 1, 0);
17864 check("-4294967296", 4294967295UL, ERANGE);
17865 check("-4294967297", 4294967295UL, ERANGE);
17870 : Should we write these tests to be more portable by sprintf-ing
17871 : ~0 and then manipulating that char string as input for strtol?
17874 $cat >>try.c <<'EOCP'
17881 if eval $compile; then
17882 case "`$run ./try`" in
17883 ok) echo "Your strtoul() seems to be working okay." ;;
17885 Your strtoul() doesn't seem to be working okay.
17891 echo "(I can't seem to compile the test program--assuming it doesn't)"
17897 : see if strtoull exists
17898 set strtoull d_strtoull
17901 case "$d_longlong-$d_strtoull" in
17904 Checking whether your strtoull() works okay...
17906 $cat >try.c <<'EOCP'
17909 #define strtoull __strtoull
17912 extern unsigned long long int strtoull(char *s, char **, int);
17913 static int bad = 0;
17914 int check(char *s, long long eull, int een) {
17917 gull = strtoull(s, 0, 10);
17918 if (!((gull == eull) && (errno == een)))
17922 check(" 1", 1LL, 0);
17923 check(" 0", 0LL, 0);
17924 check("18446744073709551615", 18446744073709551615ULL, 0);
17925 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
17926 #if 0 /* strtoull() for /^-/ strings is undefined. */
17927 check("-1", 18446744073709551615ULL, 0);
17928 check("-18446744073709551614", 2LL, 0);
17929 check("-18446744073709551615", 1LL, 0);
17930 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
17931 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
17938 if eval $compile; then
17939 case "`$run ./try`" in
17940 ok) echo "Your strtoull() seems to be working okay." ;;
17942 Your strtoull() doesn't seem to be working okay.
17944 d_strtoull="$undef"
17948 echo "(I can't seem to compile the test program--assuming it doesn't)"
17949 d_strtoull="$undef"
17954 : see if strtouq exists
17955 set strtouq d_strtouq
17958 case "$d_strtouq" in
17961 Checking whether your strtouq() works okay...
17963 $cat >try.c <<'EOCP'
17966 extern unsigned long long int strtouq(char *s, char **, int);
17967 static int bad = 0;
17968 void check(char *s, unsigned long long eull, int een) {
17969 unsigned long long gull;
17971 gull = strtouq(s, 0, 10);
17972 if (!((gull == eull) && (errno == een)))
17976 check(" 1", 1LL, 0);
17977 check(" 0", 0LL, 0);
17978 check("18446744073709551615", 18446744073709551615ULL, 0);
17979 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
17980 #if 0 /* strtouq() for /^-/ strings is undefined. */
17981 check("-1", 18446744073709551615ULL, 0);
17982 check("-18446744073709551614", 2LL, 0);
17983 check("-18446744073709551615", 1LL, 0);
17984 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
17985 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
17993 if eval $compile; then
17994 case "`$run ./try`" in
17995 ok) echo "Your strtouq() seems to be working okay." ;;
17997 Your strtouq() doesn't seem to be working okay.
18003 echo "(I can't seem to compile the test program--assuming it doesn't)"
18009 : see if strxfrm exists
18010 set strxfrm d_strxfrm
18013 : see if symlink exists
18014 set symlink d_symlink
18017 : see if syscall exists
18018 set syscall d_syscall
18021 : see if prototype for syscall is available
18023 set d_syscallproto syscall $i_unistd unistd.h
18026 : see if sysconf exists
18027 set sysconf d_sysconf
18030 : see if system exists
18031 set system d_system
18034 : see if tcgetpgrp exists
18035 set tcgetpgrp d_tcgetpgrp
18038 : see if tcsetpgrp exists
18039 set tcsetpgrp d_tcsetpgrp
18042 : see if prototype for telldir is available
18044 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
18047 : see if time exists
18049 if test "X$d_time" = X -o X"$timetype" = X; then
18050 if set time val -f d_time; eval $csym; $val; then
18051 echo 'time() found.' >&4
18053 rp="What is the type returned by time() on this system?"
18054 set time_t timetype long stdio.h sys/types.h
18057 echo 'time() not found, hope that will do.' >&4
18065 : see if this is a sys/times.h system
18066 set sys/times.h i_systimes
18069 : see if times exists
18071 if set times val -f d_times; eval $csym; $val; then
18072 echo 'times() found.' >&4
18075 case "$i_systimes" in
18076 "$define") inc='sys/times.h';;
18078 rp="What is the type returned by times() on this system?"
18079 set clock_t clocktype long stdio.h sys/types.h $inc
18082 echo 'times() NOT found, hope that will do.' >&4
18087 : see if tmpnam_r exists
18088 set tmpnam_r d_tmpnam_r
18090 case "$d_tmpnam_r" in
18092 hdrs="$i_systypes sys/types.h define stdio.h "
18093 case "$d_tmpnam_r_proto:$usethreads" in
18094 ":define") d_tmpnam_r_proto=define
18095 set d_tmpnam_r_proto tmpnam_r $hdrs
18099 case "$d_tmpnam_r_proto" in
18101 case "$tmpnam_r_proto" in
18102 ''|0) try='char* tmpnam_r(char*);'
18103 ./protochk "extern $try" $hdrs && tmpnam_r_proto=B_B ;;
18105 case "$tmpnam_r_proto" in
18106 ''|0) d_tmpnam_r=undef
18108 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
18109 * ) case "$tmpnam_r_proto" in
18110 REENTRANT_PROTO*) ;;
18111 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
18113 echo "Prototype: $try" ;;
18116 *) case "$usethreads" in
18117 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
18124 *) tmpnam_r_proto=0
18128 : see if truncate exists
18129 set truncate d_truncate
18132 : see if ttyname_r exists
18133 set ttyname_r d_ttyname_r
18135 case "$d_ttyname_r" in
18137 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
18138 case "$d_ttyname_r_proto:$usethreads" in
18139 ":define") d_ttyname_r_proto=define
18140 set d_ttyname_r_proto ttyname_r $hdrs
18144 case "$d_ttyname_r_proto" in
18146 case "$ttyname_r_proto" in
18147 ''|0) try='int ttyname_r(int, char*, size_t);'
18148 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBW ;;
18150 case "$ttyname_r_proto" in
18151 ''|0) try='int ttyname_r(int, char*, int);'
18152 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBI ;;
18154 case "$ttyname_r_proto" in
18155 ''|0) try='char* ttyname_r(int, char*, int);'
18156 ./protochk "extern $try" $hdrs && ttyname_r_proto=B_IBI ;;
18158 case "$ttyname_r_proto" in
18159 ''|0) d_ttyname_r=undef
18161 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
18162 * ) case "$ttyname_r_proto" in
18163 REENTRANT_PROTO*) ;;
18164 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
18166 echo "Prototype: $try" ;;
18169 *) case "$usethreads" in
18170 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
18177 *) ttyname_r_proto=0
18181 : see if tzname[] exists
18183 if set tzname val -a d_tzname; eval $csym; $val; then
18185 echo 'tzname[] found.' >&4
18188 echo 'tzname[] NOT found.' >&4
18193 : Check if is a multiplatform env
18195 next|rhapsody|darwin) multiarch="$define" ;;
18197 case "$multiarch" in
18198 ''|[nN]*) multiarch="$undef" ;;
18201 : check for ordering of bytes in a UV
18203 case "$usecrosscompile$multiarch" in
18206 You seem to be either cross-compiling or doing a multiarchitecture build,
18207 skipping the byteorder check.
18213 case "$byteorder" in
18216 In the following, larger digits indicate more significance. A big-endian
18217 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
18218 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
18219 machines may have weird orders like 3412. A Cray will report 87654321,
18220 an Alpha will report 12345678. If the test program works the default is
18222 I'm now running the test program...
18226 #$i_stdlib I_STDLIB
18228 #include <stdlib.h>
18230 #include <sys/types.h>
18231 typedef $uvtype UV;
18241 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
18243 u.l = (UV)0x04030201;
18244 for (i = 0; i < $uvsize; i++)
18245 printf("%c", u.c[i]+'0');
18252 if eval $compile && $run ./try > /dev/null; then
18255 [1-4][1-4][1-4][1-4]|12345678|87654321)
18256 echo "(The test program ran ok.)"
18257 echo "byteorder=$dflt"
18260 ????|????????) echo "(The test program ran ok.)" ;;
18261 *) echo "(The test program didn't run right for some reason.)" ;;
18266 (I can't seem to compile the test program. Guessing big-endian...)
18269 case "$xxx_prompt" in
18271 rp="What is the order of bytes in $uvtype?"
18284 : Checking 32bit aligndness
18287 Checking to see whether you can access character data unalignedly...
18289 case "$d_u32align" in
18290 '') $cat >try.c <<EOCP
18292 #$i_stdlib I_STDLIB
18294 #include <stdlib.h>
18296 #define U32 $u32type
18297 #define BYTEORDER 0x$byteorder
18299 #include <signal.h>
18301 $signal_t bletch(int s) { exit(4); }
18304 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
18309 if (sizeof(U32) != 4) {
18310 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
18317 signal(SIGBUS, bletch);
18329 for (i = 0; i < 4; i++) {
18330 up = (U32*)(buf + i);
18331 if (! ((*up == 1 << (8*i)) || /* big-endian */
18332 (*up == 1 << (8*(3-i))) /* little-endian */
18336 printf("read failed (%x)\n", *up);
18342 for (i = 0; i < 4; i++) {
18343 up = (U32*)(buf + i);
18345 if (*up != 0xBeef) {
18346 printf("write failed (%x)\n", *up);
18360 if eval $compile_ok; then
18361 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
18362 $run ./try 2>&1 >/dev/null
18365 You can access character data pretty unalignedly.
18367 d_u32align="$undef"
18370 It seems that you must access character data in an aligned manner.
18372 d_u32align="$define"
18376 rp='Can you access character data at unaligned addresses?'
18380 [yY]*) d_u32align="$undef" ;;
18381 *) d_u32align="$define" ;;
18388 : see if ualarm exists
18389 set ualarm d_ualarm
18392 : see if umask exists
18396 : see if unordered exists
18397 set unordered d_unordered
18400 : see if unsetenv exists
18401 set unsetenv d_unsetenv
18404 : see if usleep exists
18405 set usleep d_usleep
18408 : see if prototype for usleep is available
18410 set d_usleepproto usleep $i_unistd unistd.h
18413 : see if ustat exists
18417 : see if closedir exists
18418 set closedir d_closedir
18421 case "$d_closedir" in
18424 echo "Checking whether closedir() returns a status..." >&4
18426 #$i_dirent I_DIRENT /**/
18427 #$i_sysdir I_SYS_DIR /**/
18428 #$i_sysndir I_SYS_NDIR /**/
18429 #$i_systypes I_SYS_TYPES /**/
18431 #if defined(I_SYS_TYPES)
18432 #include <sys/types.h>
18434 #if defined(I_DIRENT)
18435 #include <dirent.h>
18436 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
18437 #include <sys/dir.h>
18441 #include <sys/ndir.h>
18445 #include <ndir.h> /* may be wrong in the future */
18447 #include <sys/dir.h>
18452 int main() { return closedir(opendir(".")); }
18455 if eval $compile_ok; then
18456 if $run ./try > /dev/null 2>&1 ; then
18457 echo "Yes, it does."
18460 echo "No, it doesn't."
18464 echo "(I can't seem to compile the test program--assuming it doesn't)"
18472 set d_void_closedir
18476 : see if there is a wait4
18480 : see if waitpid exists
18481 set waitpid d_waitpid
18484 : see if wcstombs exists
18485 set wcstombs d_wcstombs
18488 : see if wctomb exists
18489 set wctomb d_wctomb
18492 : see if writev exists
18493 set writev d_writev
18496 : preserve RCS keywords in files with variable substitution, grrr
18501 Revision='$Revision'
18503 : check for alignment requirements
18505 case "$usecrosscompile$multiarch" in
18508 You seem to be either cross-compiling or doing a multiarchitecture build,
18509 skipping the memory alignment check.
18512 case "$alignbytes" in
18513 '') alignbytes=8 ;;
18517 case "$alignbytes" in
18518 '') echo "Checking alignment constraints..." >&4
18519 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
18520 $cat >try.c <<'EOCP'
18521 typedef long double NV;
18524 $cat >try.c <<'EOCP'
18528 $cat >>try.c <<'EOCP'
18536 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
18541 if eval $compile_ok; then
18545 echo "(I can't seem to compile the test program...)"
18548 *) dflt="$alignbytes"
18551 rp="Doubles must be aligned on a how-many-byte boundary?"
18559 : set the base revision
18562 : how do we concatenate cpp tokens here?
18564 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
18565 $cat >cpp_stuff.c <<'EOCP'
18566 #define RCAT(a,b)a/**/b
18567 #define ACAT(a,b)a ## b
18571 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
18572 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
18573 echo "Oh! Smells like ANSI's been here." >&4
18574 echo "We can catify or stringify, separately or together!"
18576 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
18577 echo "Ah, yes! The good old days!" >&4
18578 echo "However, in the good old days we don't know how to stringify and"
18579 echo "catify at the same time."
18583 Hmm, I don't seem to be able to concatenate tokens with your cpp.
18584 You're going to have to edit the values of CAT[2-5] in config.h...
18586 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
18590 : see if this is a db.h system
18596 : Check db version.
18598 echo "Checking Berkeley DB version ..." >&4
18604 #include <sys/types.h>
18606 #$i_stdlib I_STDLIB
18608 #include <stdlib.h>
18611 int main(int argc, char *argv[])
18613 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
18614 int Major, Minor, Patch ;
18615 unsigned long Version ;
18616 (void)db_version(&Major, &Minor, &Patch) ;
18618 printf("%d %d %d %d %d %d\n",
18619 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
18620 Major, Minor, Patch);
18623 printf("You have Berkeley DB Version 2 or greater.\n");
18625 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
18626 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
18627 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
18628 Major, Minor, Patch) ;
18630 /* check that db.h & libdb are compatible */
18631 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
18632 printf("db.h and libdb are incompatible.\n") ;
18636 printf("db.h and libdb are compatible.\n") ;
18638 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
18639 + DB_VERSION_PATCH ;
18641 /* needs to be >= 2.3.4 */
18642 if (Version < 2003004) {
18643 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
18644 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
18650 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
18655 printf("You have Berkeley DB Version 1.\n");
18656 exit(0); /* DB version < 2: the coast is clear. */
18658 exit(1); /* <db.h> not Berkeley DB? */
18664 if eval $compile_ok && $run ./try; then
18665 echo 'Looks OK.' >&4
18667 db_version_major=$1
18668 db_version_minor=$2
18669 db_version_patch=$3
18671 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
18675 : Remove db from list of libraries to use
18676 echo "Removing unusable -ldb from library list" >&4
18677 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
18680 echo "libs = $libs" >&4
18690 : Check the return type needed for hash
18692 echo "Checking return type needed for hash for Berkeley DB ..." >&4
18698 #include <sys/types.h>
18701 #ifndef DB_VERSION_MAJOR
18702 u_int32_t hash_cb (ptr, size)
18710 info.hash = hash_cb;
18714 if $cc $ccflags -c try.c >try.out 2>&1 ; then
18715 if $contains warning try.out >>/dev/null 2>&1 ; then
18718 db_hashtype='u_int32_t'
18721 : XXX Maybe we should just give up here.
18722 db_hashtype=u_int32_t
18724 echo "Help: I can't seem to compile the db test program." >&4
18725 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
18728 echo "Your version of Berkeley DB uses $db_hashtype for hash."
18730 *) db_hashtype=u_int32_t
18735 : Check the return type needed for prefix
18737 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
18743 #include <sys/types.h>
18746 #ifndef DB_VERSION_MAJOR
18747 size_t prefix_cb (key1, key2)
18755 info.prefix = prefix_cb;
18759 if $cc $ccflags -c try.c >try.out 2>&1 ; then
18760 if $contains warning try.out >>/dev/null 2>&1 ; then
18761 db_prefixtype='int'
18763 db_prefixtype='size_t'
18766 db_prefixtype='size_t'
18767 : XXX Maybe we should just give up here.
18769 echo "Help: I can't seem to compile the db test program." >&4
18770 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
18773 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
18775 *) db_prefixtype='size_t'
18779 : How can we generate normalized random numbers ?
18781 echo "Looking for a random number function..." >&4
18782 case "$randfunc" in
18784 if set drand48 val -f; eval $csym; $val; then
18786 echo "Good, found drand48()." >&4
18787 elif set random val -f; eval $csym; $val; then
18789 echo "OK, found random()." >&4
18792 echo "Yick, looks like I have to use rand()." >&4
18803 *-Dmy_rand=*|*-Dmy_srand=*)
18804 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
18805 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
18806 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
18807 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
18811 while $test "$cont"; do
18812 rp="Use which function to generate random numbers?"
18814 if $test "$ans" = "$dflt"; then
18820 if set $ans val -f; eval $csym; $val; then
18824 rp="I cannot find function $ans. Use that name anyway?"
18833 case "$randfunc" in
18835 drand01="drand48()"
18841 case "$randbits" in
18843 echo "Checking to see how many bits your $randfunc() function produces..." >&4
18845 #$i_unistd I_UNISTD
18846 #$i_stdlib I_STDLIB
18849 # include <unistd.h>
18852 # include <stdlib.h>
18857 register unsigned long tmp;
18858 register unsigned long max = 0L;
18860 for (i = 1000; i; i--) {
18861 tmp = (unsigned long) $randfunc();
18862 if (tmp > max) max = tmp;
18864 for (i = 0; max; i++)
18870 if eval $compile_ok; then
18874 echo "(I can't seem to compile the test program...)"
18881 rp="How many bits does your $randfunc() function produce?"
18885 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
18886 seedfunc="s$randfunc"
18887 randseedtype=unsigned
18891 rp="How many bits does your $randfunc() function produce?"
18894 seedfunc="s$randfunc"
18895 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
18896 if set $seedfunc val -f; eval $csym; $val; then
18897 echo "(Using $seedfunc() to seed random generator)"
18899 echo "(Warning: no $seedfunc() to seed random generator)"
18902 randseedtype=unsigned
18909 : Determine if this is an EBCDIC system
18911 echo "Determining whether or not we are on an EBCDIC system..." >&4
18912 $cat >try.c <<'EOM'
18915 if ('M'==0xd4) return 0;
18922 if eval $compile_ok; then
18923 if $run ./try; then
18924 echo "You seem to speak EBCDIC." >&4
18927 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
18930 echo "I'm unable to compile the test program." >&4
18931 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
18937 : Check how to flush
18940 Checking how to flush all pending stdio output...
18942 # I only know how to find the first 32 possibly open files on SunOS.
18943 # See also hints/sunos_4_1.sh and util.c --AD
18945 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
18947 $cat >>try.c <<EOCP
18949 #$i_stdlib I_STDLIB
18951 #include <stdlib.h>
18953 #$i_unistd I_UNISTD
18955 # include <unistd.h>
18957 #$d_sysconf HAS_SYSCONF
18958 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
18959 #ifdef HAS_STDIO_STREAM_ARRAY
18960 # define STDIO_STREAM_ARRAY $stdio_stream_array
18965 p = fopen("try.out", "w");
18969 # ifdef TRY_FPRINTF
18973 #ifdef TRY_FFLUSH_NULL
18976 #ifdef TRY_FFLUSH_ALL
18978 long open_max = -1;
18979 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
18980 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
18982 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
18983 open_max = sysconf(_SC_OPEN_MAX);
18986 open_max = FOPEN_MAX;
18989 open_max = OPEN_MAX;
18998 # ifdef HAS_STDIO_STREAM_ARRAY
18999 if (open_max > 0) {
19001 for (i = 0; i < open_max; i++)
19002 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
19003 STDIO_STREAM_ARRAY[i]._file < open_max &&
19004 STDIO_STREAM_ARRAY[i]._flag)
19005 fflush(&STDIO_STREAM_ARRAY[i]);
19013 : first we have to find out how _not_ to flush
19015 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
19017 set try -DTRY_FPUTC
19018 if eval $compile; then
19019 $run ./try 2>/dev/null
19022 if $test ! -s try.out -a "X$code" = X42; then
19028 set try -DTRY_FPRINTF
19029 if eval $compile; then
19030 $run ./try 2>/dev/null
19033 if $test ! -s try.out -a "X$code" = X42; then
19034 output=-DTRY_FPRINTF
19040 : check for fflush NULL behaviour
19041 case "$fflushNULL" in
19042 '') set try -DTRY_FFLUSH_NULL $output
19043 if eval $compile; then
19044 $run ./try 2>/dev/null
19047 if $test -s try.out -a "X$code" = X42; then
19048 fflushNULL="`$cat try.out`"
19050 if $test "X$code" != X42; then
19052 (If this test failed, don't worry, we'll try another method shortly.)
19058 case "$fflushNULL" in
19060 Your fflush(NULL) works okay for output streams.
19061 Let's see if it clobbers input pipes...
19063 # As of mid-March 2000 all versions of Solaris appear to have a stdio
19064 # bug that improperly flushes the input end of pipes. So we avoid the
19065 # autoflush on fork/system/exec support for now. :-(
19066 $cat >tryp.c <<EOCP
19069 main(int argc, char **argv)
19075 while ((i = getc(stdin)) != -1
19076 && (*bp++ = i) != '\n'
19077 && bp < &buf[1024])
19080 fprintf(stdout, "%s", buf);
19088 fflushNULL="$define"
19090 if eval $compile; then
19092 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
19093 if cmp tryp.c tryp.out >/dev/null 2>&1; then
19095 fflush(NULL) seems to behave okay with input streams.
19097 fflushNULL="$define"
19100 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
19102 fflushNULL="$undef"
19105 $rm -f core tryp.c tryp.core core.tryp.*
19108 Your fflush(NULL) isn't working (contrary to ANSI C).
19110 fflushNULL="$undef"
19113 Cannot figure out whether your fflush(NULL) works or not.
19114 I'm assuming it doesn't (contrary to ANSI C).
19116 fflushNULL="$undef"
19120 $define|true|[yY]*)
19121 fflushNULL="$define"
19124 fflushNULL="$undef"
19127 : check explicit looping only if NULL did not work, and if the pipe
19128 : bug does not show up on an explicit flush too
19129 case "$fflushNULL" in
19131 $cat >tryp.c <<EOCP
19134 main(int argc, char **argv)
19140 while ((i = getc(stdin)) != -1
19141 && (*bp++ = i) != '\n'
19142 && bp < &buf[1024])
19145 fprintf(stdout, "%s", buf);
19154 if eval $compile; then
19156 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
19157 if cmp tryp.c tryp.out >/dev/null 2>&1; then
19159 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
19161 : now check for fflushall behaviour
19162 case "$fflushall" in
19163 '') set try -DTRY_FFLUSH_ALL $output
19164 if eval $compile; then
19166 (Now testing the other method--but note that this also may fail.)
19168 $run ./try 2>/dev/null
19171 if $test -s try.out -a "X$code" = X42; then
19172 fflushall="`$cat try.out`"
19176 case "$fflushall" in
19178 Whew. Flushing explicitly all the stdio streams works.
19180 fflushall="$define"
19183 Sigh. Flushing explicitly all the stdio streams doesn't work.
19188 Cannot figure out whether flushing stdio streams explicitly works or not.
19189 I'm assuming it doesn't.
19195 "$define"|true|[yY]*)
19196 fflushall="$define"
19204 All is futile. Even fflush(stdin) clobbers input pipes!
19211 $rm -f core tryp.c tryp.core core.tryp.*
19213 *) fflushall="$undef"
19217 case "$fflushNULL$fflushall" in
19220 OK, I give up. I cannot figure out how to flush pending stdio output.
19221 We won't be flushing handles at all before fork/exec/popen.
19227 : Store the full pathname to the ar program for use in the C program
19228 : Respect a hint or command line value for full_ar.
19233 : Store the full pathname to the sed program for use in the C program
19236 : see what type gids are declared as in the kernel
19238 echo "Looking for the type for group ids returned by getgid()."
19239 set gid_t gidtype xxx stdio.h sys/types.h
19243 xxx=`./findhdr sys/user.h`
19244 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
19246 unsigned) dflt="$1 $2" ;;
19250 *) dflt="$gidtype";;
19253 gid_t) echo "gid_t found." ;;
19254 *) rp="What is the type for group ids returned by getgid()?"
19260 : Check the size of GID
19263 *_t) zzz="$gidtype" ;;
19266 echo "Checking the size of $zzz..." >&4
19268 #include <sys/types.h>
19270 #$i_stdlib I_STDLIB
19272 #include <stdlib.h>
19275 printf("%d\n", (int)sizeof($gidtype));
19280 if eval $compile_ok; then
19284 echo "(I can't execute the test program--guessing $gidsize.)" >&4
19287 echo "Your $zzz is $gidsize bytes long."
19292 echo "(I can't compile the test program--guessing $gidsize.)" >&4
19296 : Check if GID is signed
19299 *_t) zzz="$gidtype" ;;
19302 echo "Checking the sign of $zzz..." >&4
19304 #include <sys/types.h>
19315 if eval $compile; then
19319 echo "(I can't execute the test program--guessing unsigned.)" >&4
19323 1) echo "Your $zzz is unsigned." ;;
19324 -1) echo "Your $zzz is signed." ;;
19330 echo "(I can't compile the test program--guessing unsigned.)" >&4
19334 : Check 64bit sizes
19337 if $test X"$quadtype" != X; then
19339 echo "Checking how to print 64-bit integers..." >&4
19341 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
19342 $cat >try.c <<'EOCP'
19343 #include <sys/types.h>
19346 int q = 12345678901;
19347 printf("%ld\n", q);
19351 if eval $compile; then
19355 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
19356 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
19357 echo "We will use %d."
19363 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
19364 $cat >try.c <<'EOCP'
19365 #include <sys/types.h>
19368 long q = 12345678901;
19369 printf("%ld\n", q);
19373 if eval $compile; then
19377 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
19378 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
19379 echo "We will use %ld."
19385 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
19386 $cat >try.c <<'EOCP'
19387 #include <sys/types.h>
19388 #include <inttypes.h>
19391 int64_t q = 12345678901;
19392 printf("%" PRId64 "\n", q);
19396 if eval $compile; then
19400 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
19401 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
19402 echo "We will use the C9X style."
19408 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
19410 #include <sys/types.h>
19413 $quadtype q = 12345678901;
19414 printf("%Ld\n", q);
19418 if eval $compile; then
19422 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
19423 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
19424 echo "We will use %Ld."
19430 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
19431 $cat >try.c <<'EOCP'
19432 #include <sys/types.h>
19435 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
19436 printf("%lld\n", q);
19440 if eval $compile; then
19444 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
19445 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
19446 echo "We will use the %lld style."
19452 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
19454 #include <sys/types.h>
19457 $quadtype q = 12345678901;
19458 printf("%qd\n", q);
19462 if eval $compile; then
19466 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
19467 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
19468 echo "We will use %qd."
19474 if $test X"$sPRId64" = X; then
19475 echo "Cannot figure out how to print 64-bit integers." >&4
19482 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
19483 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
19485 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
19486 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
19490 : Check format strings for internal types
19492 $echo "Checking the format strings to be used for Perl's internal types..." >&4
19494 if $test X"$ivsize" = X8; then
19495 ivdformat="$sPRId64"
19496 uvuformat="$sPRIu64"
19497 uvoformat="$sPRIo64"
19498 uvxformat="$sPRIx64"
19499 uvXUformat="$sPRIXU64"
19501 if $test X"$ivsize" = X"$longsize"; then
19508 if $test X"$ivsize" = X"$intsize"; then
19516 if $test X"$ivsize" = X"$shortsize"; then
19527 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
19528 nveformat="$sPRIeldbl"
19529 nvfformat="$sPRIfldbl"
19530 nvgformat="$sPRIgldbl"
19531 nvEUformat="$sPRIEUldbl"
19532 nvFUformat="$sPRIFUldbl"
19533 nvGUformat="$sPRIGUldbl"
19543 case "$ivdformat" in
19544 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
19549 : Check format string for GID
19552 $echo "Checking the format string to be used for gids..." >&4
19555 -1) if $test X"$gidsize" = X"$ivsize"; then
19556 gidformat="$ivdformat"
19558 if $test X"$gidsize" = X"$longsize"; then
19561 if $test X"$gidsize" = X"$intsize"; then
19564 if $test X"$gidsize" = X"$shortsize"; then
19571 *) if $test X"$gidsize" = X"$uvsize"; then
19572 gidformat="$uvuformat"
19574 if $test X"$gidsize" = X"$longsize"; then
19577 if $test X"$gidsize" = X"$intsize"; then
19580 if $test X"$gidsize" = X"$shortsize"; then
19589 : see if getgroups exists
19590 set getgroups d_getgrps
19593 : see if setgroups exists
19594 set setgroups d_setgrps
19597 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
19599 case "$d_getgrps$d_setgrps" in
19601 case "$groupstype" in
19602 '') dflt="$gidtype" ;;
19603 *) dflt="$groupstype" ;;
19606 What type of pointer is the second argument to getgroups() and setgroups()?
19607 Usually this is the same as group ids, $gidtype, but not always.
19610 rp='What type pointer is the second argument to getgroups() and setgroups()?'
19614 *) groupstype="$gidtype";;
19617 : MAD = Misc Attribute Definition
19619 if $test $patchlevel -lt 9; then
19620 : MAD is not available in 5.8.x or earlier.
19624 $define|true|[yY]*) dflt='y' ;;
19629 Would you like to build with Misc Attribute Decoration? This is development
19630 work leading to a Perl 5 to Perl 6 convertor, which imposes a space and speed
19631 overhead on the interpreter.
19633 If this doesn't make any sense to you, just accept the default '$dflt'.
19635 rp='Build Perl with MAD?'
19640 madlyh='madly.h madly.act madly.tab'
19642 madlyobj="madly$_o" ;;
19651 : check whether make sets MAKE
19653 echo "Checking if your $make program sets \$(MAKE)..." >&4
19654 case "$make_set_make" in
19656 $sed 's/^X //' > testmake.mak << 'EOF'
19658 X @echo 'maketemp="$(MAKE)"'
19660 case "`$make -f testmake.mak 2>/dev/null`" in
19661 *maketemp=*) make_set_make='#' ;;
19662 *) make_set_make="MAKE=$make" ;;
19664 $rm -f testmake.mak
19667 case "$make_set_make" in
19668 '#') echo "Yup, it does.";;
19669 *) echo "Nope, it doesn't.";;
19672 : see what type is used for mode_t
19673 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
19674 set mode_t modetype int stdio.h sys/types.h
19677 : see if we need va_copy
19679 case "$i_stdarg" in
19682 #include <stdarg.h>
19684 #$i_stdlib I_STDLIB
19686 #include <stdlib.h>
19688 #include <signal.h>
19691 ivfprintf(FILE *f, const char *fmt, va_list *valp)
19693 return vfprintf(f, fmt, *valp);
19697 myvfprintf(FILE *f, const char *fmt, va_list val)
19699 return ivfprintf(f, fmt, &val);
19703 myprintf(char *fmt, ...)
19706 va_start(val, fmt);
19707 return myvfprintf(stdout, fmt, val);
19711 main(int ac, char **av)
19713 signal(SIGSEGV, exit);
19715 myprintf("%s%cs all right, then\n", "that", '\'');
19720 if eval $compile && $run ./try 2>&1 >/dev/null; then
19721 case "`$run ./try`" in
19722 "that's all right, then")
19728 yes) echo "It seems that you don't need va_copy()." >&4
19729 need_va_copy="$undef"
19731 *) echo "It seems that va_copy() or similar will be needed." >&4
19732 need_va_copy="$define"
19737 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
19741 : see what type is used for size_t
19742 rp="What is the type used for the length parameter for string functions?"
19743 set size_t sizetype 'unsigned int' stdio.h sys/types.h
19746 : check for type of arguments to gethostbyaddr.
19747 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
19748 case "$d_gethbyaddr" in
19752 Checking to see what type of arguments are accepted by gethostbyaddr().
19754 hdrs="$define sys/types.h
19755 $d_socket sys/socket.h
19756 $i_niin netinet/in.h
19758 $i_unistd unistd.h"
19759 : The first arg can 'char *' or 'void *'
19760 : The second arg is some of integral type
19761 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
19762 for yyy in size_t long int; do
19763 case "$netdb_host_type" in
19764 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
19765 if ./protochk "$try" $hdrs; then
19766 echo "Your system accepts $xxx for the first arg."
19767 echo "...and $yyy for the second arg."
19768 netdb_host_type="$xxx"
19769 netdb_hlen_type="$yyy"
19775 : In case none of those worked, prompt the user.
19776 case "$netdb_host_type" in
19777 '') rp='What is the type for the 1st argument to gethostbyaddr?'
19780 netdb_host_type=$ans
19781 rp='What is the type for the 2nd argument to gethostbyaddr?'
19784 netdb_hlen_type=$ans
19788 *) : no gethostbyaddr, so pick harmless defaults
19789 netdb_host_type='char *'
19790 netdb_hlen_type="$sizetype"
19793 # Remove the "const" if needed. -- but then we'll have a
19795 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
19798 : check for type of argument to gethostbyname.
19799 if test "X$netdb_name_type" = X ; then
19800 case "$d_gethbyname" in
19804 Checking to see what type of argument is accepted by gethostbyname().
19806 hdrs="$define sys/types.h
19807 $d_socket sys/socket.h
19808 $i_niin netinet/in.h
19810 $i_unistd unistd.h"
19811 for xxx in "const char *" "char *"; do
19812 case "$netdb_name_type" in
19813 '') try="extern struct hostent *gethostbyname($xxx);"
19814 if ./protochk "$try" $hdrs; then
19815 echo "Your system accepts $xxx."
19816 netdb_name_type="$xxx"
19821 : In case none of those worked, prompt the user.
19822 case "$netdb_name_type" in
19823 '') rp='What is the type for the 1st argument to gethostbyname?'
19826 netdb_name_type=$ans
19830 *) : no gethostbyname, so pick harmless default
19831 netdb_name_type='char *'
19836 : check for type of 1st argument to getnetbyaddr.
19837 if test "X$netdb_net_type" = X ; then
19838 case "$d_getnbyaddr" in
19842 Checking to see what type of 1st argument is accepted by getnetbyaddr().
19844 hdrs="$define sys/types.h
19845 $d_socket sys/socket.h
19846 $i_niin netinet/in.h
19848 $i_unistd unistd.h"
19849 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
19850 case "$netdb_net_type" in
19851 '') try="extern struct netent *getnetbyaddr($xxx, int);"
19852 if ./protochk "$try" $hdrs; then
19853 echo "Your system accepts $xxx."
19854 netdb_net_type="$xxx"
19859 : In case none of those worked, prompt the user.
19860 case "$netdb_net_type" in
19861 '') rp='What is the type for the 1st argument to getnetbyaddr?'
19864 netdb_net_type=$ans
19868 *) : no getnetbyaddr, so pick harmless default
19869 netdb_net_type='long'
19873 : locate the preferred pager for this system
19880 [a-zA-Z]:/*) dflt=$pg;;
19884 [a-zA-Z]:/*) dflt=$more;;
19888 [a-zA-Z]:/*) dflt=$less;;
19891 '') dflt=/usr/ucb/more;;
19895 : Instruct ./getfile to trust the hinted or previous pager value,
19896 : even if it does not begin with a slash. For example, on os2,
19897 : pager might be cmd /c more. See comments in UU/getfile.
19902 rp='What pager is used on your system?'
19906 : see what type pids are declared as in the kernel
19907 rp="What is the type of process ids on this system?"
19908 set pid_t pidtype int stdio.h sys/types.h
19911 : see if ar generates random libraries by itself
19913 echo "Checking how to generate random libraries on your machine..." >&4
19914 echo 'int bar1() { return bar2(); }' > bar1.c
19915 echo 'int bar2() { return 2; }' > bar2.c
19917 #$i_stdlib I_STDLIB
19919 #include <stdlib.h>
19921 int main() { printf("%d\n", bar1()); exit(0); }
19923 $cc $ccflags -c bar1.c >/dev/null 2>&1
19924 $cc $ccflags -c bar2.c >/dev/null 2>&1
19925 $cc $ccflags -c foo.c >/dev/null 2>&1
19926 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
19927 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19928 $run ./foobar >/dev/null 2>&1; then
19929 echo "$ar appears to generate random libraries itself."
19931 if [ "X$ranlib" = "X" ]; then
19934 elif $ar s bar$_a >/dev/null 2>&1 &&
19935 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19936 $run ./foobar >/dev/null 2>&1; then
19937 echo "a table of contents needs to be added with '$ar s'."
19940 elif $ar ts bar$_a >/dev/null 2>&1 &&
19941 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19942 $run ./foobar >/dev/null 2>&1; then
19943 echo "a table of contents needs to be added with '$ar ts'."
19950 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
19951 $test -f $ranlib || ranlib=''
19954 if $test -n "$ranlib"; then
19955 echo "your system has '$ranlib'; we'll use that."
19958 echo "your system doesn't seem to support random libraries"
19959 echo "so we'll use lorder and tsort to order the libraries."
19966 : check for type of arguments to select.
19967 case "$selecttype" in
19968 '') case "$d_select" in
19972 Checking to see what type of arguments are accepted by select().
19974 hdrs="$define sys/types.h
19975 $i_systime sys/time.h
19976 $i_sysselct sys/select.h
19977 $d_socket sys/socket.h"
19978 : The first arg can be int, unsigned, or size_t
19979 : The last arg may or may not be 'const'
19981 : void pointer has been seen but using that
19982 : breaks the selectminbits test
19983 for xxx in 'fd_set *' 'int *'; do
19984 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
19985 for tmo in 'struct timeval *' 'const struct timeval *'; do
19987 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
19988 if ./protochk "$try" $hdrs; then
19989 echo "Your system accepts $xxx."
19998 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
19999 case "$d_fd_set" in
20000 $define) dflt="fd_set *" ;;
20009 *) : no select, so pick a harmless default
20016 : check for the select 'width'
20017 case "$selectminbits" in
20018 '') safebits=`expr $ptrsize \* 8`
20019 case "$d_select" in
20023 Checking to see on how many bits at a time your select() operates...
20026 #include <sys/types.h>
20028 #$i_systime I_SYS_TIME
20029 #$i_systimek I_SYS_TIME_KERNEL
20034 # ifdef I_SYS_TIME_KERNEL
20037 # include <sys/time.h>
20038 # ifdef I_SYS_TIME_KERNEL
20042 #$i_sysselct I_SYS_SELECT
20043 #ifdef I_SYS_SELECT
20044 #include <sys/select.h>
20046 #$d_socket HAS_SOCKET
20048 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
20051 #$i_stdlib I_STDLIB
20053 #include <stdlib.h>
20056 #define S sizeof(*(b))
20058 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
20059 #define NBITS (NBYTES * 8)
20061 char *s = (char *)malloc(NBYTES);
20070 fp = fopen("try.c", "r");
20076 b = ($selecttype)s;
20077 for (i = 0; i < NBITS; i++)
20081 select(fd + 1, b, 0, 0, &t);
20082 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
20084 printf("%d\n", i + 1);
20089 if eval $compile_ok; then
20090 selectminbits=`$run ./try`
20091 case "$selectminbits" in
20093 Cannot figure out on how many bits at a time your select() operates.
20094 I'll play safe and guess it is $safebits bits.
20096 selectminbits=$safebits
20097 bits="$safebits bits"
20100 *) bits="$selectminbits bits" ;;
20102 echo "Your select() operates on $bits at a time." >&4
20104 rp='What is the minimum number of bits your select() operates on?'
20105 case "$byteorder" in
20106 12345678) dflt=64 ;;
20112 selectminbits="$val"
20116 *) : no select, so pick a harmless default
20117 selectminbits=$safebits
20123 : Trace out the files included by signal.h, then look for SIGxxx names.
20124 if [ "X$fieldn" = X ]; then
20125 : Just make some guesses. We check them later.
20126 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
20128 xxx=`echo '#include <signal.h>' |
20129 $cppstdin $cppminus $cppflags 2>/dev/null |
20130 $grep '^[ ]*#.*include' |
20131 $awk "{print \\$$fieldn}" | $sed 's!"!!g' |\
20132 $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
20135 for xx in $xxx /dev/null ; do
20136 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
20138 case "$xxxfiles" in
20139 '') xxxfiles=`./findhdr signal.h` ;;
20142 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
20143 print substr($2, 4, 20)
20145 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
20146 print substr($3, 4, 20)
20148 : Append some common names just in case the awk scan failed.
20149 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
20150 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
20151 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
20152 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
20153 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
20155 : generate a few handy files for later
20156 $cat > signal.c <<EOCP
20157 #include <sys/types.h>
20158 #include <signal.h>
20159 #$i_stdlib I_STDLIB
20161 #include <stdlib.h>
20166 /* Strange style to avoid deeply-nested #if/#else/#endif */
20169 # define NSIG (_NSIG)
20175 # define NSIG (SIGMAX+1)
20181 # define NSIG (SIG_MAX+1)
20187 # define NSIG (_SIG_MAX+1)
20193 # define NSIG (MAXSIG+1)
20199 # define NSIG (MAX_SIG+1)
20204 # ifdef SIGARRAYSIZE
20205 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
20211 # define NSIG (_sys_nsig) /* Solaris 2.5 */
20215 /* Default to some arbitrary number that's big enough to get most
20216 of the common signals.
20222 printf("NSIG %d\n", NSIG);
20228 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
20230 printf "#ifdef SIG"; printf $1; printf "\n"
20231 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
20232 printf $1; printf ");\n"
20236 printf "#endif /* JUST_NSIG */\n";
20237 printf "exit(0);\n}\n";
20240 $cat >signal.awk <<'EOP'
20241 BEGIN { ndups = 0 }
20242 $1 ~ /^NSIG$/ { nsig = $2 }
20243 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
20244 if ($2 > maxsig) { maxsig = $2 }
20245 if (sig_name[$2]) {
20246 dup_name[ndups] = $1
20247 dup_num[ndups] = $2
20259 printf("NSIG %d\n", nsig);
20260 for (n = 1; n < nsig; n++) {
20262 printf("%s %d\n", sig_name[n], sig_num[n])
20265 printf("NUM%d %d\n", n, n)
20268 for (n = 0; n < ndups; n++) {
20269 printf("%s %d\n", dup_name[n], dup_num[n])
20273 $cat >signal_cmd <<EOS
20275 if $test -s signal.lst; then
20276 echo "Using your existing signal.lst file"
20281 $cat >>signal_cmd <<'EOS'
20284 if eval $compile_ok; then
20285 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) |\
20286 $uniq | $awk -f signal.awk >signal.lst
20288 echo "(I can't seem be able to compile the whole test program)" >&4
20289 echo "(I'll try it in little pieces.)" >&4
20290 set signal -DJUST_NSIG
20291 if eval $compile_ok; then
20292 $run ./signal$_exe > signal.nsg
20295 echo "I can't seem to figure out how many signals you have." >&4
20296 echo "Guessing 50." >&4
20297 echo 'NSIG 50' > signal.nsg
20299 : Now look at all the signal names, one at a time.
20300 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
20301 $cat > signal.c <<EOCP
20302 #include <sys/types.h>
20303 #include <signal.h>
20306 printf("$xx %d\n", SIG${xx});
20311 if eval $compile; then
20312 echo "SIG${xx} found."
20313 $run ./signal$_exe >> signal.ls1
20315 echo "SIG${xx} NOT found."
20318 if $test -s signal.ls1; then
20319 $cat signal.nsg signal.ls1 |
20320 $sort -n | $uniq | $awk -f signal.awk >signal.lst
20324 if $test -s signal.lst; then
20327 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
20328 echo 'kill -l' >signal
20329 set X `csh -f <signal`
20333 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
20335 echo $@ | $tr ' ' $trnl | \
20336 $awk '{ printf "%s %d\n", $1, ++s; }
20337 END { printf "NSIG %d\n", ++s }' >signal.lst
20339 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
20341 chmod a+x signal_cmd
20342 $eunicefix signal_cmd
20344 : generate list of signal names
20346 case "$sig_name_init" in
20348 *) case "$sig_num_init" in
20349 ''|*,*) doinit=yes ;;
20354 echo "Generating a list of signal names and numbers..." >&4
20356 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
20357 sig_name=`$awk 'BEGIN { printf "ZERO " }
20358 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
20359 sig_num=`$awk 'BEGIN { printf "0 " }
20360 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
20361 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
20362 !/^NSIG/ { printf "\"%s\", ", $1 }
20363 END { printf "0\n" }' signal.lst`
20364 sig_num_init=`$awk 'BEGIN { printf "0, " }
20365 !/^NSIG/ { printf "%d, ", $2}
20366 END { printf "0\n"}' signal.lst`
20369 echo "The following $sig_count signals are available:"
20371 echo $sig_name | $awk \
20372 'BEGIN { linelen = 0 }
20374 for (i = 1; i <= NF; i++) {
20375 name = "SIG" $i " "
20376 linelen = linelen + length(name)
20377 if (linelen > 70) {
20379 linelen = length(name)
20385 sig_size=`echo $sig_name | awk '{print NF}'`
20386 $rm -f signal signal.c signal.awk signal.lst signal_cmd
20388 : Check size of size
20390 case "$sizetype" in
20391 *_t) zzz="$sizetype" ;;
20392 *) zzz="filesize" ;;
20394 echo "Checking the size of $zzz..." >&4
20396 #include <sys/types.h>
20398 #$i_stdlib I_STDLIB
20400 #include <stdlib.h>
20403 printf("%d\n", (int)sizeof($sizetype));
20408 if eval $compile_ok; then
20412 echo "(I can't execute the test program--guessing $sizesize.)" >&4
20415 echo "Your $zzz size is $sizesize bytes."
20420 echo "(I can't compile the test program--guessing $sizesize.)" >&4
20424 : check for socklen_t
20426 echo "Checking to see if you have socklen_t..." >&4
20428 #include <sys/types.h>
20429 #$d_socket HAS_SOCKET
20431 #include <sys/socket.h>
20433 int main() { socklen_t x = 16; }
20436 if eval $compile; then
20438 echo "You have socklen_t."
20441 echo "You do not have socklen_t."
20442 case "$sizetype" in
20443 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
20450 : see if this is a socks.h system
20451 set socks.h i_socks
20454 : check for type of the size argument to socket calls
20455 case "$d_socket" in
20459 Checking to see what type is the last argument of accept().
20462 case "$d_socklen_t" in
20463 "$define") yyy="$yyy socklen_t"
20465 yyy="$yyy $sizetype int long unsigned"
20466 for xxx in $yyy; do
20467 case "$socksizetype" in
20468 '') try="extern int accept(int, struct sockaddr *, $xxx *);"
20469 case "$usesocks" in
20471 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
20472 echo "Your system accepts '$xxx *' for the last argument of accept()."
20473 socksizetype="$xxx"
20476 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
20477 echo "Your system accepts '$xxx *' for the last argument of accept()."
20478 socksizetype="$xxx"
20485 : In case none of those worked, prompt the user.
20486 case "$socksizetype" in
20487 '') rp='What is the type for socket address structure sizes?'
20494 *) : no sockets, so pick relatively harmless default
20499 : see what type is used for signed size_t
20500 set ssize_t ssizetype int stdio.h sys/types.h
20505 #$i_stdlib I_STDLIB
20507 #include <stdlib.h>
20509 #include <sys/types.h>
20510 #define Size_t $sizetype
20511 #define SSize_t $dflt
20514 if (sizeof(Size_t) == sizeof(SSize_t))
20516 else if (sizeof(Size_t) == sizeof(int))
20525 if eval $compile_ok && $run ./try > /dev/null; then
20526 ssizetype=`$run ./try`
20527 echo "I'll be using $ssizetype for functions returning a byte count." >&4
20530 Help! I can't compile and run the ssize_t test program: please enlighten me!
20531 (This is probably a misconfiguration in your system or libraries, and
20532 you really ought to fix it. Still, I'll try anyway.)
20534 I need a type that is the same size as $sizetype, but is guaranteed to
20535 be signed. Common values are ssize_t, int and long.
20538 rp="What signed type is the same size as $sizetype?"
20544 : see what type of char stdio uses.
20546 echo '#include <stdio.h>' > stdio.c
20547 $cppstdin $cppminus < stdio.c > stdioh
20548 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
20549 echo "Your stdio uses unsigned chars." >&4
20550 stdchar="unsigned char"
20552 echo "Your stdio uses signed chars." >&4
20555 $rm -f stdio.* stdioh
20557 : see what type uids are declared as in the kernel
20559 echo "Looking for the type for user ids returned by getuid()."
20560 set uid_t uidtype xxx stdio.h sys/types.h
20564 xxx=`./findhdr sys/user.h`
20565 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
20567 unsigned) dflt="$1 $2" ;;
20571 *) dflt="$uidtype";;
20574 uid_t) echo "uid_t found." ;;
20575 *) rp="What is the type for user ids returned by getuid()?"
20581 : Check size of UID
20584 *_t) zzz="$uidtype" ;;
20587 echo "Checking the size of $zzz..." >&4
20589 #include <sys/types.h>
20591 #$i_stdlib I_STDLIB
20593 #include <stdlib.h>
20596 printf("%d\n", (int)sizeof($uidtype));
20601 if eval $compile_ok; then
20605 echo "(I can't execute the test program--guessing $uidsize.)" >&4
20608 echo "Your $zzz is $uidsize bytes long."
20613 echo "(I can't compile the test program--guessing $uidsize.)" >&4
20616 : Check if UID is signed
20619 *_t) zzz="$uidtype" ;;
20622 echo "Checking the sign of $zzz..." >&4
20624 #include <sys/types.h>
20635 if eval $compile; then
20639 echo "(I can't execute the test program--guessing unsigned.)" >&4
20643 1) echo "Your $zzz is unsigned." ;;
20644 -1) echo "Your $zzz is signed." ;;
20650 echo "(I can't compile the test program--guessing unsigned.)" >&4
20654 : Check format string for UID
20656 $echo "Checking the format string to be used for uids..." >&4
20659 -1) if $test X"$uidsize" = X"$ivsize"; then
20660 uidformat="$ivdformat"
20662 if $test X"$uidsize" = X"$longsize"; then
20665 if $test X"$uidsize" = X"$intsize"; then
20668 if $test X"$uidsize" = X"$shortsize"; then
20675 *) if $test X"$uidsize" = X"$uvsize"; then
20676 uidformat="$uvuformat"
20678 if $test X"$uidsize" = X"$longsize"; then
20681 if $test X"$uidsize" = X"$intsize"; then
20684 if $test X"$uidsize" = X"$shortsize"; then
20693 : Check if site customization support was requested
20694 case "$usesitecustomize" in
20695 $define|true|[Yy]*)
20696 usesitecustomize="$define"
20699 usesitecustomize="$undef"
20703 : determine compiler compiler
20712 if $test -f "$byacc$_exe"; then
20714 comp="byacc or $comp"
20716 if $test -f "$bison$_exe"; then
20717 comp="$comp or bison -y"
20719 rp="Which compiler compiler ($comp) shall I use?"
20728 echo "(Adding -y option to bison to get yacc-compatible behaviour.)"
20734 : see if this is a assert.h system
20735 set assert.h i_assert
20738 : see if this is a fp.h system
20742 : see if this is a fp_class.h system
20743 set fp_class.h i_fp_class
20746 : see if gdbm.h is available
20751 : see if gdbm_open exists
20752 set gdbm_open d_gdbm_open
20754 case "$d_gdbm_open" in
20757 echo "We won't be including <gdbm.h>"
20766 : see if this is a ieeefp.h system
20767 case "$i_ieeefp" in
20768 '' ) set ieeefp.h i_ieeefp
20773 : see if this is a libutil.h system
20774 set libutil.h i_libutil
20777 : see if mach cthreads are available
20778 if test "X$usethreads" = "X$define"; then
20779 set mach/cthreads.h i_machcthr
20782 i_machcthr="$undef"
20785 : see if this is a mntent.h system
20786 set mntent.h i_mntent
20789 : see if ndbm.h is available
20795 # Some Linux distributions such as RedHat 7.1 put the
20796 # ndbm.h header in /usr/include/gdbm/ndbm.h.
20797 if $test -f /usr/include/gdbm/ndbm.h; then
20798 echo '<gdbm/ndbm.h> found.'
20799 ccflags="$ccflags -I/usr/include/gdbm"
20800 cppflags="$cppflags -I/usr/include/gdbm"
20808 : see if dbm_open exists
20809 set dbm_open d_dbm_open
20811 case "$d_dbm_open" in
20814 echo "We won't be including <ndbm.h>"
20823 : see if net/errno.h is available
20825 set net/errno.h val
20828 : Unfortunately, it causes problems on some systems. Arrgh.
20831 cat > try.c <<'EOM'
20834 #include <net/errno.h>
20840 if $cc $ccflags -c try.c >/dev/null 2>&1; then
20841 echo "We'll be including <net/errno.h>." >&4
20843 echo "We won't be including <net/errno.h>." >&4
20852 : see if netinet/tcp.h is available
20853 set netinet/tcp.h i_netinettcp
20856 : see if this is a poll.h system
20860 : see if this is a prot.h system
20864 : Preprocessor symbols
20866 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
20867 $cat <<'EOSH' > Cppsym.know
20868 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
20869 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
20870 alliant alpha am29000 AM29000 AMD64 amd64 amiga AMIGAOS AMIX
20871 ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
20872 BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
20873 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
20874 bull c cadmus clipper CMU COFF COMPILER_VERSION
20875 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
20876 CYGWIN DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
20877 Dynix DynixPTX ELF encore EPI EXTENSIONS FAVOR_BSD
20878 FILE_OFFSET_BITS FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
20880 GNU_SOURCE GNUC GNUC_MINOR GNU_LIBRARY GO32 gould GOULD_PN
20881 H3050R H3050RX hbullx20 hcx host_mips
20882 hp200 hp300 hp700 HP700 hp800 hp9000
20883 hp9000s200 hp9000s300 hp9000s400 hp9000s500
20884 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
20885 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
20886 IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
20887 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
20888 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
20889 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
20890 LIBCATAMOUNT Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
20891 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
20892 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
20893 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
20894 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
20895 MATH_HAS_NO_SIDE_EFFECTS
20896 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
20897 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
20898 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
20899 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
20900 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
20901 NetBSD news1500 news1700 news1800 news1900 news3700
20902 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
20903 ns32016 ns32332 ns32k nsc32000
20904 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
20905 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
20906 pc532 pdp11 PGC PIC plexus PORTAR posix
20907 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
20908 POSIX_C_SOURCE POSIX_SOURCE POWER
20909 PROTOTYPES PWB pyr QNX QK_USER R3000 REENTRANT RES Rhapsody RISC6000
20910 riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
20911 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
20912 sony sony_news sonyrisc sparc sparclite spectrum
20913 stardent stdc STDC_EXT stratos sun sun3 sun386
20914 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
20915 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
20916 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
20917 sysV68 sysV88 Tek4132 Tek4300 titan
20918 TM3200 TM5400 TM5600
20919 tower tower32 tower32_200 tower32_600 tower32_700
20920 tower32_800 tower32_850 tss
20921 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
20922 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
20923 unix UNIX95 UNIX99 unixpc unos
20924 USE_BSD USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE USE_LARGEFILE64
20925 USE_MISC USE_POSIX USE_POSIX199309 USE_POSIX199506 USE_POSIX2
20926 USE_REENTRANT USE_SVID USE_UNIX98 USE_XOPEN USE_XOPEN_EXTENDED
20928 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms x86_64 xenix Xenix286
20929 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
20930 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
20933 # Maybe put other stuff here too.
20934 cat <<EOSH >>Cppsym.know
20937 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
20938 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
20939 $cat Cppsym.know > Cppsym.c
20940 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
20941 $rm -f Cppsym.a Cppsym.b Cppsym.c
20942 cat <<EOSH > Cppsym
20944 if $test \$# -gt 0; then
20945 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
20946 if $test -s Cppsym.got; then
20953 $tr " " "$trnl" | ./Cppsym.try
20959 cat <<EOSH > Cppsym.try
20961 cat <<'EOCP' > try.c
20964 #define STRINGIFY(a) "a"
20966 #if cpp_stuff == 42
20967 #define StGiFy(a) #a
20968 #define STRINGIFY(a) StGiFy(a)
20970 #if $cpp_stuff != 1 && $cpp_stuff != 42
20971 # include "Bletch: How does this C preprocessor stringify macros?"
20977 cat <<'EOSH' >> Cppsym.try
20979 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
20980 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
20981 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
20982 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
20984 echo 'return 0;}' >> try.c
20986 cat <<EOSH >> Cppsym.try
20988 case "$osname-$gccversion" in
20989 irix-) ccflags="\$ccflags -woff 1178" ;;
20990 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
20992 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs && $run ./try | $sed 's/ /\\\\ /g'
20994 chmod +x Cppsym.try
20995 $eunicefix Cppsym.try
20996 ./Cppsym < Cppsym.know > Cppsym.true
20997 : Add in any linux cpp "predefined macros":
20998 case "$osname::$gccversion" in
21001 rm -f $tHdrH'.h' $tHdrH
21003 if cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
21004 sed 's/#define[\ \ ]*//;s/[\ \ ].*$//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
21005 if [ -s $tHdrH'_cppsym.real' ]; then
21006 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
21009 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
21012 : now check the C compiler for additional symbols
21013 postprocess_cc_v=''
21015 aix) postprocess_cc_v="|$tr , ' '" ;;
21022 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
21025 -D*) echo "\$i" | $sed 's/^-D//';;
21026 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
21031 postprocess_cc_v=''
21034 ./ccsym > ccsym1.raw
21035 if $test -s ccsym1.raw; then
21036 $sort ccsym1.raw | $uniq >ccsym.raw
21038 mv ccsym1.raw ccsym.raw
21041 $awk '/\=/ { print $0; next }
21042 { print $0"=1" }' ccsym.raw >ccsym.list
21043 $comm -13 Cppsym.true ccsym.list >ccsym.own
21044 $comm -12 Cppsym.true ccsym.list >ccsym.com
21045 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
21047 if $test -z ccsym.raw; then
21048 echo "Your C compiler doesn't seem to define any symbols!" >&4
21050 echo "However, your C preprocessor defines the following symbols:"
21053 cppsymbols=`$cat Cppsym.true`
21054 cppsymbols=`echo $cppsymbols`
21055 cppccsymbols="$cppsymbols"
21057 if $test -s ccsym.com; then
21058 echo "Your C compiler and pre-processor define these symbols:"
21059 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
21062 cppccsymbols=`$cat ccsym.com`
21063 cppccsymbols=`echo $cppccsymbols`
21064 $test "$silent" || sleep 1
21066 if $test -s ccsym.cpp; then
21067 $test "$also" && echo " "
21068 echo "Your C pre-processor ${also}defines the following symbols:"
21069 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
21071 cppsymbols=`$cat ccsym.cpp`
21072 cppsymbols=`echo $cppsymbols`
21073 $test "$silent" || sleep 1
21075 if $test -s ccsym.own; then
21076 $test "$also" && echo " "
21077 echo "Your C compiler ${also}defines the following cpp symbols:"
21078 $sed -e 's/\(..*\)=1/\1/' ccsym.own
21079 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
21080 ccsymbols=`$cat ccsym.own`
21081 ccsymbols=`echo $ccsymbols`
21082 $test "$silent" || sleep 1
21086 : see if this is a termio system
21090 if $test `./findhdr termios.h`; then
21091 set tcsetattr i_termios
21097 "$define") echo "You have POSIX termios.h... good!" >&4;;
21098 *) if ./Cppsym pyr; then
21099 case "`/bin/universe`" in
21100 ucb) if $test `./findhdr sgtty.h`; then
21102 echo "<sgtty.h> found." >&4
21104 echo "System is pyramid with BSD universe."
21105 ./warn "<sgtty.h> not found--you could have problems."
21107 *) if $test `./findhdr termio.h`; then
21109 echo "<termio.h> found." >&4
21111 echo "System is pyramid with USG universe."
21112 ./warn "<termio.h> not found--you could have problems."
21116 if $test `./findhdr termio.h`; then
21117 echo "<termio.h> found." >&4
21119 elif $test `./findhdr sgtty.h`; then
21120 echo "<sgtty.h> found." >&4
21123 ./warn "Neither <termio.h> nor <sgtty.h> found--cross fingers!"
21126 if $test `./findhdr sgtty.h`; then
21127 echo "<sgtty.h> found." >&4
21129 elif $test `./findhdr termio.h`; then
21130 echo "<termio.h> found." >&4
21133 ./warn "Neither <sgtty.h> nor <termio.h> found--cross fingers!"
21137 set i_termio; eval $setvar
21138 val=$val2; set i_sgtty; eval $setvar
21139 val=$val3; set i_termios; eval $setvar
21141 : see if stddef is available
21142 set stddef.h i_stddef
21145 : see if sys/access.h is available
21146 set sys/access.h i_sysaccess
21149 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
21150 set sys/filio.h i_sysfilio
21153 if $test `./findhdr sys/ioctl.h`; then
21155 echo '<sys/ioctl.h> found.' >&4
21158 if $test $i_sysfilio = "$define"; then
21159 echo '<sys/ioctl.h> NOT found.' >&4
21161 $test $i_sgtty = "$define" && xxx="sgtty.h"
21162 $test $i_termio = "$define" && xxx="termio.h"
21163 $test $i_termios = "$define" && xxx="termios.h"
21164 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
21170 : see if socket ioctl defs are in sys/sockio.h
21172 xxx=`./findhdr sys/sockio.h`
21173 if $test "$xxx"; then
21174 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
21176 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
21179 echo "No socket ioctls found in <sys/sockio.h>." >&4
21184 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
21190 : see if this is a syslog.h system
21191 set syslog.h i_syslog
21194 : see if this is a sys/mode.h system
21195 set sys/mode.h i_sysmode
21198 : see if there is a sys/poll.h file
21199 set sys/poll.h i_syspoll
21202 : see if sys/resource.h has to be included
21203 set sys/resource.h i_sysresrc
21206 : see if sys/security.h is available
21207 set sys/security.h i_syssecrt
21210 : see if this is a sys/statvfs.h system
21211 set sys/statvfs.h i_sysstatvfs
21214 : see if this is a sys/un.h system
21215 set sys/un.h i_sysun
21218 : see if this is a sys/utsname.h system
21219 set sys/utsname.h i_sysutsname
21222 : see if this is a syswait system
21223 set sys/wait.h i_syswait
21226 : see if this is a ustat.h system
21227 set ustat.h i_ustat
21230 : see if this is an utime system
21231 set utime.h i_utime
21234 : see if this is a values.h system
21235 set values.h i_values
21238 : see if this is a vfork system
21241 set vfork.h i_vfork
21251 echo "Looking for extensions..." >&4
21252 : If we are using the old config.sh, known_extensions may contain
21253 : old or inaccurate or duplicate values.
21254 known_extensions=''
21255 nonxs_extensions=''
21256 : We do not use find because it might not be available.
21257 : We do not just use MANIFEST because the user may have dropped
21258 : some additional extensions into the source tree and expect them
21261 : Function to recursively find available extensions, ignoring DynaLoader
21262 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
21266 DynaLoader|dynaload) ;;
21268 if $test -f $xxx/$xxx.xs -o -f $xxx/$xxx.c; then
21269 known_extensions="$known_extensions $1$xxx";
21270 elif $test -f $xxx/Makefile.PL; then
21271 nonxs_extensions="$nonxs_extensions $1$xxx";
21273 if $test -d $xxx -a $# -lt 10; then
21276 eval $find_extensions;
21288 eval $find_extensions
21289 # Special case: Add in modules that nest beyond the first level.
21290 # Currently threads/shared and Hash/Util/FieldHash, since they are
21291 # not picked up by the recursive find above (and adding in general
21292 # recursive finding breaks SDBM_File/sdbm).
21293 # A.D. 20011025 (SDBM), ajgough 20071008 (FieldHash)
21294 known_extensions="$known_extensions threads/shared Hash/Util/FieldHash"
21295 set X $known_extensions
21297 known_extensions="$*"
21298 set X $nonxs_extensions
21300 nonxs_extensions="$*"
21303 : Now see which are supported on this system.
21305 for xxx in $known_extensions ; do
21309 $define) avail_ext="$avail_ext $xxx" ;;
21312 GDBM_File|gdbm_fil)
21314 $define) avail_ext="$avail_ext $xxx" ;;
21317 I18N/Langinfo|i18n_lan)
21318 case "$i_langinfo$d_nl_langinfo" in
21319 $define$define) avail_ext="$avail_ext $xxx" ;;
21323 : XXX Do we need a useipcsysv variable here
21324 case "${d_msg}${d_sem}${d_shm}" in
21325 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
21328 NDBM_File|ndbm_fil)
21331 case "$osname-$use64bitint" in
21334 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
21337 *) avail_ext="$avail_ext $xxx" ;;
21342 ODBM_File|odbm_fil)
21343 case "${i_dbm}${i_rpcsvcdbm}" in
21345 case "$d_cplusplus" in
21346 define) ;; # delete as a function name will not work
21347 *) case "$osname-$use64bitint" in
21350 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
21353 *) avail_ext="$avail_ext $xxx" ;;
21361 case "$useopcode" in
21362 true|define|y) avail_ext="$avail_ext $xxx" ;;
21366 case "$useposix" in
21367 true|define|y) avail_ext="$avail_ext $xxx" ;;
21371 case "$d_socket" in
21374 beos) ;; # not unless BONE
21375 *) avail_ext="$avail_ext $xxx" ;;
21380 Sys/Syslog|sys/syslog)
21381 : XXX syslog requires socket
21382 case "$d_socket" in
21383 true|$define|y) avail_ext="$avail_ext $xxx" ;;
21387 case "$usethreads" in
21389 case "$use5005threads" in
21390 $define|true|[yY]*) avail_ext="$avail_ext $xxx" ;;
21394 threads|threads/shared)
21395 # threads and threads::shared are special cases.
21396 # To stop people from asking "Perl 5.8.0 was supposed
21397 # to have this new fancy threads implementation but my
21398 # perl doesn't have it" and from people trying to
21399 # (re)install the threads module using CPAN.pm and
21400 # CPAN.pm then offering to reinstall Perl 5.8.0,
21401 # the threads.pm and threads/shared.pm will always be
21402 # there, croaking informatively ("you need to rebuild
21403 # all of Perl with threads, sorry") when threads haven't
21404 # been compiled in.
21406 avail_ext="$avail_ext $xxx"
21410 cygwin) avail_ext="$avail_ext $xxx" ;;
21413 XS/APItest|xs/apitest)
21414 # This is just for testing. Skip it unless we have dynamic loading.
21417 $define) avail_ext="$avail_ext $xxx" ;;
21420 XS/Typemap|xs/typemap)
21421 # This is just for testing. Skip it unless we have dynamic loading.
21423 $define) avail_ext="$avail_ext $xxx" ;;
21426 *) avail_ext="$avail_ext $xxx"
21435 case "$onlyextensions" in
21437 *) keepextensions=''
21438 echo "You have requested that only certains extensions be included..." >&4
21439 for i in $onlyextensions; do
21440 case " $avail_ext " in
21442 echo "Keeping extension $i."
21443 keepextensions="$keepextensions $i"
21445 *) echo "Ignoring extension $i." ;;
21448 avail_ext="$keepextensions"
21452 case "$noextensions" in
21454 *) keepextensions=''
21455 echo "You have requested that certain extensions be ignored..." >&4
21456 for i in $avail_ext; do
21457 case " $noextensions " in
21458 *" $i "*) echo "Ignoring extension $i." ;;
21459 *) echo "Keeping extension $i.";
21460 keepextensions="$keepextensions $i"
21464 avail_ext="$keepextensions"
21468 : Now see which nonxs extensions are supported on this system.
21469 : For now assume all are.
21471 for xxx in $nonxs_extensions ; do
21473 *) nonxs_ext="$nonxs_ext $xxx"
21485 A number of extensions are supplied with $package. You may choose to
21486 compile these extensions for dynamic loading (the default), compile
21487 them into the $package executable (static loading), or not include
21488 them at all. Answer "none" to include no extensions.
21489 Note that DynaLoader is always built and need not be mentioned here.
21492 case "$dynamic_ext" in
21494 : Exclude those listed in static_ext
21496 for xxx in $avail_ext; do
21497 case " $static_ext " in
21499 *) dflt="$dflt $xxx" ;;
21506 *) dflt="$dynamic_ext"
21507 # Perhaps we are reusing an old out-of-date config.sh.
21510 if test X"$dynamic_ext" != X"$avail_ext"; then
21512 NOTICE: Your previous config.sh list may be incorrect.
21513 The extensions now available to you are
21515 but the default list from your previous config.sh is
21527 rp="What extensions do you wish to load dynamically?"
21530 none) dynamic_ext=' ' ;;
21531 *) dynamic_ext="$ans" ;;
21534 case "$static_ext" in
21536 : Exclude those already listed in dynamic linking
21538 for xxx in $avail_ext; do
21539 case " $dynamic_ext " in
21541 *) dflt="$dflt $xxx" ;;
21548 *) dflt="$static_ext"
21555 rp="What extensions do you wish to load statically?"
21558 none) static_ext=' ' ;;
21559 *) static_ext="$ans" ;;
21564 A number of extensions are supplied with $package. Answer "none"
21565 to include no extensions.
21566 Note that DynaLoader is always built and need not be mentioned here.
21569 case "$static_ext" in
21570 '') dflt="$avail_ext" ;;
21571 *) dflt="$static_ext"
21572 # Perhaps we are reusing an old out-of-date config.sh.
21575 if test X"$static_ext" != X"$avail_ext"; then
21577 NOTICE: Your previous config.sh list may be incorrect.
21578 The extensions now available to you are
21580 but the default list from your previous config.sh is
21589 : Exclude those that are not xs extensions
21593 rp="What extensions do you wish to include?"
21596 none) static_ext=' ' ;;
21597 *) static_ext="$ans" ;;
21602 # Encode is a special case. If we are building Encode as a static
21603 # extension, we need to explicitly list its subextensions as well.
21604 # For other nested extensions, this is handled automatically by
21605 # the appropriate Makefile.PL.
21606 case " $static_ext " in
21607 *" Encode "*) # Add the subextensions of Encode
21609 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
21610 static_ext="$static_ext Encode/$xxx"
21616 set X $dynamic_ext $static_ext $nonxs_ext
21620 # Sanity check: We require an extension suitable for use with
21621 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
21622 # should show up as failures in the test suite, but it's helpful to
21623 # catch them now.) The 'extensions' list is normally sorted
21624 # alphabetically, so we need to accept either
21625 # DB_File ... Fcntl ... IO ....
21626 # or something like
21627 # Fcntl ... NDBM_File ... IO ....
21628 case " $extensions" in
21629 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
21630 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
21631 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
21632 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
21633 echo "WARNING: The Perl you are building will be quite crippled." >& 4
21637 : Remove libraries needed only for extensions
21638 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
21639 : The exception is SunOS 4.x, which needs them.
21640 case "${osname}X${osvers}" in
21644 *) case "$usedl" in
21645 $define|true|[yY]*)
21646 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
21650 *) perllibs="$libs"
21656 : Remove build directory name from cppstdin so it can be used from
21657 : either the present location or the final installed location.
21659 : Get out of the UU directory to get correct path name.
21661 case "$cppstdin" in
21663 echo "Stripping down cppstdin path name"
21669 : end of configuration questions
21671 echo "End of configuration questions."
21674 : back to where it started
21675 if test -d ../UU; then
21679 : configuration may be unconditionally patched via a 'config.arch' file
21680 if $test -f config.arch; then
21681 echo "I see a config.arch file, loading it." >&4
21685 : configuration may be patched via a 'config.over' file
21686 if $test -f config.over; then
21689 rp='I see a config.over file. Do you wish to load it?'
21692 n*) echo "OK, I'll ignore it.";;
21694 echo "Configuration override changes have been loaded."
21699 : in case they want portability, strip down executable paths
21700 case "$d_portable" in
21703 echo "Stripping down executable paths..." >&4
21704 for file in $loclist $trylist; do
21706 eval $file=`basename $temp`
21711 : create config.sh file
21713 echo "Creating config.sh..." >&4
21714 $spitshell <<EOT >config.sh
21717 # This file was produced by running the Configure script. It holds all the
21718 # definitions figured out by Configure. Should you modify one of these values,
21719 # do not forget to propagate your changes by running "Configure -der". You may
21720 # instead choose to run each of the .SH files by yourself, or "Configure -S".
21723 # Package name : $package
21724 # Source directory : $src
21725 # Configuration time: $cf_time
21726 # Configured by : $cf_by
21727 # Target system : $myuname
21730 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
21731 $spitshell <<EOT >>config.sh
21740 Revision='$Revision'
21748 alignbytes='$alignbytes'
21749 ansi2knr='$ansi2knr'
21750 aphostname='$aphostname'
21751 api_revision='$api_revision'
21752 api_subversion='$api_subversion'
21753 api_version='$api_version'
21754 api_versionstring='$api_versionstring'
21757 archlibexp='$archlibexp'
21758 archname64='$archname64'
21759 archname='$archname'
21760 archobjs='$archobjs'
21761 asctime_r_proto='$asctime_r_proto'
21769 byteorder='$byteorder'
21771 castflags='$castflags'
21774 cccdlflags='$cccdlflags'
21775 ccdlflags='$ccdlflags'
21777 ccflags_uselargefiles='$ccflags_uselargefiles'
21779 ccsymbols='$ccsymbols'
21780 ccversion='$ccversion'
21782 cf_email='$cf_email'
21787 clocktype='$clocktype'
21789 compress='$compress'
21790 contains='$contains'
21794 cpp_stuff='$cpp_stuff'
21795 cppccsymbols='$cppccsymbols'
21796 cppflags='$cppflags'
21798 cppminus='$cppminus'
21800 cppstdin='$cppstdin'
21801 cppsymbols='$cppsymbols'
21802 crypt_r_proto='$crypt_r_proto'
21803 cryptlib='$cryptlib'
21805 ctermid_r_proto='$ctermid_r_proto'
21806 ctime_r_proto='$ctime_r_proto'
21807 d_Gconvert='$d_Gconvert'
21808 d_PRIEUldbl='$d_PRIEUldbl'
21809 d_PRIFUldbl='$d_PRIFUldbl'
21810 d_PRIGUldbl='$d_PRIGUldbl'
21811 d_PRIXU64='$d_PRIXU64'
21812 d_PRId64='$d_PRId64'
21813 d_PRIeldbl='$d_PRIeldbl'
21814 d_PRIfldbl='$d_PRIfldbl'
21815 d_PRIgldbl='$d_PRIgldbl'
21816 d_PRIi64='$d_PRIi64'
21817 d_PRIo64='$d_PRIo64'
21818 d_PRIu64='$d_PRIu64'
21819 d_PRIx64='$d_PRIx64'
21820 d_SCNfldbl='$d_SCNfldbl'
21821 d__fwalk='$d__fwalk'
21822 d_access='$d_access'
21823 d_accessx='$d_accessx'
21826 d_archlib='$d_archlib'
21827 d_asctime_r='$d_asctime_r'
21830 d_attribute_format='$d_attribute_format'
21831 d_attribute_malloc='$d_attribute_malloc'
21832 d_attribute_nonnull='$d_attribute_nonnull'
21833 d_attribute_noreturn='$d_attribute_noreturn'
21834 d_attribute_pure='$d_attribute_pure'
21835 d_attribute_unused='$d_attribute_unused'
21836 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
21840 d_bsdgetpgrp='$d_bsdgetpgrp'
21841 d_bsdsetpgrp='$d_bsdsetpgrp'
21842 d_builtin_choose_expr='$d_builtin_choose_expr'
21843 d_builtin_expect='$d_builtin_expect'
21845 d_c99_variadic_macros='$d_c99_variadic_macros'
21846 d_casti32='$d_casti32'
21847 d_castneg='$d_castneg'
21848 d_charvspr='$d_charvspr'
21850 d_chroot='$d_chroot'
21851 d_chsize='$d_chsize'
21853 d_clearenv='$d_clearenv'
21854 d_closedir='$d_closedir'
21855 d_cmsghdr_s='$d_cmsghdr_s'
21857 d_copysignl='$d_copysignl'
21858 d_cplusplus='$d_cplusplus'
21860 d_crypt_r='$d_crypt_r'
21862 d_ctermid='$d_ctermid'
21863 d_ctermid_r='$d_ctermid_r'
21864 d_ctime_r='$d_ctime_r'
21865 d_cuserid='$d_cuserid'
21866 d_dbl_dig='$d_dbl_dig'
21867 d_dbminitproto='$d_dbminitproto'
21868 d_difftime='$d_difftime'
21869 d_dir_dd_fd='$d_dir_dd_fd'
21871 d_dirnamlen='$d_dirnamlen'
21872 d_dlerror='$d_dlerror'
21873 d_dlopen='$d_dlopen'
21874 d_dlsymun='$d_dlsymun'
21875 d_dosuid='$d_dosuid'
21876 d_drand48_r='$d_drand48_r'
21877 d_drand48proto='$d_drand48proto'
21879 d_eaccess='$d_eaccess'
21880 d_endgrent='$d_endgrent'
21881 d_endgrent_r='$d_endgrent_r'
21882 d_endhent='$d_endhent'
21883 d_endhostent_r='$d_endhostent_r'
21884 d_endnent='$d_endnent'
21885 d_endnetent_r='$d_endnetent_r'
21886 d_endpent='$d_endpent'
21887 d_endprotoent_r='$d_endprotoent_r'
21888 d_endpwent='$d_endpwent'
21889 d_endpwent_r='$d_endpwent_r'
21890 d_endsent='$d_endsent'
21891 d_endservent_r='$d_endservent_r'
21892 d_eofnblk='$d_eofnblk'
21893 d_eunice='$d_eunice'
21894 d_faststdio='$d_faststdio'
21895 d_fchdir='$d_fchdir'
21896 d_fchmod='$d_fchmod'
21897 d_fchown='$d_fchown'
21899 d_fcntl_can_lock='$d_fcntl_can_lock'
21900 d_fd_macros='$d_fd_macros'
21901 d_fd_set='$d_fd_set'
21902 d_fds_bits='$d_fds_bits'
21903 d_fgetpos='$d_fgetpos'
21904 d_finite='$d_finite'
21905 d_finitel='$d_finitel'
21906 d_flexfnam='$d_flexfnam'
21908 d_flockproto='$d_flockproto'
21910 d_fp_class='$d_fp_class'
21911 d_fpathconf='$d_fpathconf'
21912 d_fpclass='$d_fpclass'
21913 d_fpclassify='$d_fpclassify'
21914 d_fpclassl='$d_fpclassl'
21915 d_fpos64_t='$d_fpos64_t'
21916 d_frexpl='$d_frexpl'
21917 d_fs_data_s='$d_fs_data_s'
21918 d_fseeko='$d_fseeko'
21919 d_fsetpos='$d_fsetpos'
21920 d_fstatfs='$d_fstatfs'
21921 d_fstatvfs='$d_fstatvfs'
21923 d_ftello='$d_ftello'
21925 d_futimes='$d_futimes'
21926 d_getcwd='$d_getcwd'
21927 d_getespwnam='$d_getespwnam'
21928 d_getfsstat='$d_getfsstat'
21929 d_getgrent='$d_getgrent'
21930 d_getgrent_r='$d_getgrent_r'
21931 d_getgrgid_r='$d_getgrgid_r'
21932 d_getgrnam_r='$d_getgrnam_r'
21933 d_getgrps='$d_getgrps'
21934 d_gethbyaddr='$d_gethbyaddr'
21935 d_gethbyname='$d_gethbyname'
21936 d_gethent='$d_gethent'
21937 d_gethname='$d_gethname'
21938 d_gethostbyaddr_r='$d_gethostbyaddr_r'
21939 d_gethostbyname_r='$d_gethostbyname_r'
21940 d_gethostent_r='$d_gethostent_r'
21941 d_gethostprotos='$d_gethostprotos'
21942 d_getitimer='$d_getitimer'
21943 d_getlogin='$d_getlogin'
21944 d_getlogin_r='$d_getlogin_r'
21945 d_getmnt='$d_getmnt'
21946 d_getmntent='$d_getmntent'
21947 d_getnbyaddr='$d_getnbyaddr'
21948 d_getnbyname='$d_getnbyname'
21949 d_getnent='$d_getnent'
21950 d_getnetbyaddr_r='$d_getnetbyaddr_r'
21951 d_getnetbyname_r='$d_getnetbyname_r'
21952 d_getnetent_r='$d_getnetent_r'
21953 d_getnetprotos='$d_getnetprotos'
21954 d_getpagsz='$d_getpagsz'
21955 d_getpbyname='$d_getpbyname'
21956 d_getpbynumber='$d_getpbynumber'
21957 d_getpent='$d_getpent'
21958 d_getpgid='$d_getpgid'
21959 d_getpgrp2='$d_getpgrp2'
21960 d_getpgrp='$d_getpgrp'
21961 d_getppid='$d_getppid'
21962 d_getprior='$d_getprior'
21963 d_getprotobyname_r='$d_getprotobyname_r'
21964 d_getprotobynumber_r='$d_getprotobynumber_r'
21965 d_getprotoent_r='$d_getprotoent_r'
21966 d_getprotoprotos='$d_getprotoprotos'
21967 d_getprpwnam='$d_getprpwnam'
21968 d_getpwent='$d_getpwent'
21969 d_getpwent_r='$d_getpwent_r'
21970 d_getpwnam_r='$d_getpwnam_r'
21971 d_getpwuid_r='$d_getpwuid_r'
21972 d_getsbyname='$d_getsbyname'
21973 d_getsbyport='$d_getsbyport'
21974 d_getsent='$d_getsent'
21975 d_getservbyname_r='$d_getservbyname_r'
21976 d_getservbyport_r='$d_getservbyport_r'
21977 d_getservent_r='$d_getservent_r'
21978 d_getservprotos='$d_getservprotos'
21979 d_getspnam='$d_getspnam'
21980 d_getspnam_r='$d_getspnam_r'
21981 d_gettimeod='$d_gettimeod'
21982 d_gmtime_r='$d_gmtime_r'
21983 d_gnulibc='$d_gnulibc'
21984 d_grpasswd='$d_grpasswd'
21985 d_hasmntopt='$d_hasmntopt'
21987 d_ilogbl='$d_ilogbl'
21988 d_inc_version_list='$d_inc_version_list'
21990 d_inetaton='$d_inetaton'
21991 d_int64_t='$d_int64_t'
21992 d_isascii='$d_isascii'
21993 d_isfinite='$d_isfinite'
21996 d_isnanl='$d_isnanl'
21997 d_killpg='$d_killpg'
21998 d_lchown='$d_lchown'
21999 d_ldbl_dig='$d_ldbl_dig'
22000 d_libm_lib_version='$d_libm_lib_version'
22002 d_localtime_r='$d_localtime_r'
22003 d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset'
22004 d_locconv='$d_locconv'
22006 d_longdbl='$d_longdbl'
22007 d_longlong='$d_longlong'
22008 d_lseekproto='$d_lseekproto'
22010 d_madvise='$d_madvise'
22011 d_malloc_good_size='$d_malloc_good_size'
22012 d_malloc_size='$d_malloc_size'
22014 d_mbstowcs='$d_mbstowcs'
22015 d_mbtowc='$d_mbtowc'
22016 d_memchr='$d_memchr'
22017 d_memcmp='$d_memcmp'
22018 d_memcpy='$d_memcpy'
22019 d_memmove='$d_memmove'
22020 d_memset='$d_memset'
22022 d_mkdtemp='$d_mkdtemp'
22023 d_mkfifo='$d_mkfifo'
22024 d_mkstemp='$d_mkstemp'
22025 d_mkstemps='$d_mkstemps'
22026 d_mktime='$d_mktime'
22029 d_modfl_pow32_bug='$d_modfl_pow32_bug'
22030 d_modflproto='$d_modflproto'
22031 d_mprotect='$d_mprotect'
22033 d_msg_ctrunc='$d_msg_ctrunc'
22034 d_msg_dontroute='$d_msg_dontroute'
22035 d_msg_oob='$d_msg_oob'
22036 d_msg_peek='$d_msg_peek'
22037 d_msg_proxy='$d_msg_proxy'
22038 d_msgctl='$d_msgctl'
22039 d_msgget='$d_msgget'
22040 d_msghdr_s='$d_msghdr_s'
22041 d_msgrcv='$d_msgrcv'
22042 d_msgsnd='$d_msgsnd'
22044 d_munmap='$d_munmap'
22045 d_mymalloc='$d_mymalloc'
22047 d_nl_langinfo='$d_nl_langinfo'
22048 d_nv_preserves_uv='$d_nv_preserves_uv'
22049 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
22050 d_off64_t='$d_off64_t'
22051 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
22052 d_oldpthreads='$d_oldpthreads'
22053 d_oldsock='$d_oldsock'
22055 d_pathconf='$d_pathconf'
22057 d_perl_otherlibdirs='$d_perl_otherlibdirs'
22058 d_phostname='$d_phostname'
22061 d_portable='$d_portable'
22062 d_printf_format_null='$d_printf_format_null'
22063 d_procselfexe='$d_procselfexe'
22064 d_pseudofork='$d_pseudofork'
22065 d_pthread_atfork='$d_pthread_atfork'
22066 d_pthread_attr_setscope='$d_pthread_attr_setscope'
22067 d_pthread_yield='$d_pthread_yield'
22069 d_pwchange='$d_pwchange'
22070 d_pwclass='$d_pwclass'
22071 d_pwcomment='$d_pwcomment'
22072 d_pwexpire='$d_pwexpire'
22073 d_pwgecos='$d_pwgecos'
22074 d_pwpasswd='$d_pwpasswd'
22075 d_pwquota='$d_pwquota'
22078 d_random_r='$d_random_r'
22079 d_readdir64_r='$d_readdir64_r'
22080 d_readdir='$d_readdir'
22081 d_readdir_r='$d_readdir_r'
22082 d_readlink='$d_readlink'
22084 d_recvmsg='$d_recvmsg'
22085 d_rename='$d_rename'
22086 d_rewinddir='$d_rewinddir'
22088 d_safebcpy='$d_safebcpy'
22089 d_safemcpy='$d_safemcpy'
22090 d_sanemcmp='$d_sanemcmp'
22091 d_sbrkproto='$d_sbrkproto'
22092 d_scalbnl='$d_scalbnl'
22093 d_sched_yield='$d_sched_yield'
22094 d_scm_rights='$d_scm_rights'
22095 d_seekdir='$d_seekdir'
22096 d_select='$d_select'
22098 d_semctl='$d_semctl'
22099 d_semctl_semid_ds='$d_semctl_semid_ds'
22100 d_semctl_semun='$d_semctl_semun'
22101 d_semget='$d_semget'
22103 d_sendmsg='$d_sendmsg'
22104 d_setegid='$d_setegid'
22105 d_seteuid='$d_seteuid'
22106 d_setgrent='$d_setgrent'
22107 d_setgrent_r='$d_setgrent_r'
22108 d_setgrps='$d_setgrps'
22109 d_sethent='$d_sethent'
22110 d_sethostent_r='$d_sethostent_r'
22111 d_setitimer='$d_setitimer'
22112 d_setlinebuf='$d_setlinebuf'
22113 d_setlocale='$d_setlocale'
22114 d_setlocale_r='$d_setlocale_r'
22115 d_setnent='$d_setnent'
22116 d_setnetent_r='$d_setnetent_r'
22117 d_setpent='$d_setpent'
22118 d_setpgid='$d_setpgid'
22119 d_setpgrp2='$d_setpgrp2'
22120 d_setpgrp='$d_setpgrp'
22121 d_setprior='$d_setprior'
22122 d_setproctitle='$d_setproctitle'
22123 d_setprotoent_r='$d_setprotoent_r'
22124 d_setpwent='$d_setpwent'
22125 d_setpwent_r='$d_setpwent_r'
22126 d_setregid='$d_setregid'
22127 d_setresgid='$d_setresgid'
22128 d_setresuid='$d_setresuid'
22129 d_setreuid='$d_setreuid'
22130 d_setrgid='$d_setrgid'
22131 d_setruid='$d_setruid'
22132 d_setsent='$d_setsent'
22133 d_setservent_r='$d_setservent_r'
22134 d_setsid='$d_setsid'
22135 d_setvbuf='$d_setvbuf'
22139 d_shmatprototype='$d_shmatprototype'
22140 d_shmctl='$d_shmctl'
22142 d_shmget='$d_shmget'
22143 d_sigaction='$d_sigaction'
22144 d_signbit='$d_signbit'
22145 d_sigprocmask='$d_sigprocmask'
22146 d_sigsetjmp='$d_sigsetjmp'
22147 d_sitearch='$d_sitearch'
22148 d_snprintf='$d_snprintf'
22149 d_sockatmark='$d_sockatmark'
22150 d_sockatmarkproto='$d_sockatmarkproto'
22151 d_socket='$d_socket'
22152 d_socklen_t='$d_socklen_t'
22153 d_sockpair='$d_sockpair'
22154 d_socks5_init='$d_socks5_init'
22155 d_sprintf_returns_strlen='$d_sprintf_returns_strlen'
22157 d_srand48_r='$d_srand48_r'
22158 d_srandom_r='$d_srandom_r'
22159 d_sresgproto='$d_sresgproto'
22160 d_sresuproto='$d_sresuproto'
22161 d_statblks='$d_statblks'
22162 d_statfs_f_flags='$d_statfs_f_flags'
22163 d_statfs_s='$d_statfs_s'
22164 d_statvfs='$d_statvfs'
22165 d_stdio_cnt_lval='$d_stdio_cnt_lval'
22166 d_stdio_ptr_lval='$d_stdio_ptr_lval'
22167 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
22168 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
22169 d_stdio_stream_array='$d_stdio_stream_array'
22170 d_stdiobase='$d_stdiobase'
22171 d_stdstdio='$d_stdstdio'
22172 d_strchr='$d_strchr'
22173 d_strcoll='$d_strcoll'
22174 d_strctcpy='$d_strctcpy'
22175 d_strerrm='$d_strerrm'
22176 d_strerror='$d_strerror'
22177 d_strerror_r='$d_strerror_r'
22178 d_strftime='$d_strftime'
22179 d_strlcat='$d_strlcat'
22180 d_strlcpy='$d_strlcpy'
22181 d_strtod='$d_strtod'
22182 d_strtol='$d_strtol'
22183 d_strtold='$d_strtold'
22184 d_strtoll='$d_strtoll'
22185 d_strtoq='$d_strtoq'
22186 d_strtoul='$d_strtoul'
22187 d_strtoull='$d_strtoull'
22188 d_strtouq='$d_strtouq'
22189 d_strxfrm='$d_strxfrm'
22190 d_suidsafe='$d_suidsafe'
22191 d_symlink='$d_symlink'
22192 d_syscall='$d_syscall'
22193 d_syscallproto='$d_syscallproto'
22194 d_sysconf='$d_sysconf'
22195 d_sysernlst='$d_sysernlst'
22196 d_syserrlst='$d_syserrlst'
22197 d_system='$d_system'
22198 d_tcgetpgrp='$d_tcgetpgrp'
22199 d_tcsetpgrp='$d_tcsetpgrp'
22200 d_telldir='$d_telldir'
22201 d_telldirproto='$d_telldirproto'
22204 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
22205 d_tm_tm_zone='$d_tm_tm_zone'
22206 d_tmpnam_r='$d_tmpnam_r'
22207 d_truncate='$d_truncate'
22208 d_ttyname_r='$d_ttyname_r'
22209 d_tzname='$d_tzname'
22210 d_u32align='$d_u32align'
22211 d_ualarm='$d_ualarm'
22214 d_union_semun='$d_union_semun'
22215 d_unordered='$d_unordered'
22216 d_unsetenv='$d_unsetenv'
22217 d_usleep='$d_usleep'
22218 d_usleepproto='$d_usleepproto'
22220 d_vendorarch='$d_vendorarch'
22221 d_vendorbin='$d_vendorbin'
22222 d_vendorlib='$d_vendorlib'
22223 d_vendorscript='$d_vendorscript'
22225 d_void_closedir='$d_void_closedir'
22226 d_voidsig='$d_voidsig'
22227 d_voidtty='$d_voidtty'
22228 d_volatile='$d_volatile'
22229 d_vprintf='$d_vprintf'
22230 d_vsnprintf='$d_vsnprintf'
22232 d_waitpid='$d_waitpid'
22233 d_wcstombs='$d_wcstombs'
22234 d_wctomb='$d_wctomb'
22235 d_writev='$d_writev'
22238 db_hashtype='$db_hashtype'
22239 db_prefixtype='$db_prefixtype'
22240 db_version_major='$db_version_major'
22241 db_version_minor='$db_version_minor'
22242 db_version_patch='$db_version_patch'
22243 defvoidused='$defvoidused'
22244 direntrytype='$direntrytype'
22247 doublesize='$doublesize'
22249 drand48_r_proto='$drand48_r_proto'
22251 dynamic_ext='$dynamic_ext'
22257 endgrent_r_proto='$endgrent_r_proto'
22258 endhostent_r_proto='$endhostent_r_proto'
22259 endnetent_r_proto='$endnetent_r_proto'
22260 endprotoent_r_proto='$endprotoent_r_proto'
22261 endpwent_r_proto='$endpwent_r_proto'
22262 endservent_r_proto='$endservent_r_proto'
22263 eunicefix='$eunicefix'
22266 extensions='$extensions'
22268 fflushNULL='$fflushNULL'
22269 fflushall='$fflushall'
22271 firstmakefile='$firstmakefile'
22273 fpossize='$fpossize'
22274 fpostype='$fpostype'
22275 freetype='$freetype'
22278 full_csh='$full_csh'
22279 full_sed='$full_sed'
22280 gccansipedantic='$gccansipedantic'
22281 gccosandvers='$gccosandvers'
22282 gccversion='$gccversion'
22283 getgrent_r_proto='$getgrent_r_proto'
22284 getgrgid_r_proto='$getgrgid_r_proto'
22285 getgrnam_r_proto='$getgrnam_r_proto'
22286 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
22287 gethostbyname_r_proto='$gethostbyname_r_proto'
22288 gethostent_r_proto='$gethostent_r_proto'
22289 getlogin_r_proto='$getlogin_r_proto'
22290 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
22291 getnetbyname_r_proto='$getnetbyname_r_proto'
22292 getnetent_r_proto='$getnetent_r_proto'
22293 getprotobyname_r_proto='$getprotobyname_r_proto'
22294 getprotobynumber_r_proto='$getprotobynumber_r_proto'
22295 getprotoent_r_proto='$getprotoent_r_proto'
22296 getpwent_r_proto='$getpwent_r_proto'
22297 getpwnam_r_proto='$getpwnam_r_proto'
22298 getpwuid_r_proto='$getpwuid_r_proto'
22299 getservbyname_r_proto='$getservbyname_r_proto'
22300 getservbyport_r_proto='$getservbyport_r_proto'
22301 getservent_r_proto='$getservent_r_proto'
22302 getspnam_r_proto='$getspnam_r_proto'
22303 gidformat='$gidformat'
22309 gmtime_r_proto='$gmtime_r_proto'
22310 gnulibc_version='$gnulibc_version'
22312 groupcat='$groupcat'
22313 groupstype='$groupstype'
22316 h_sysfile='$h_sysfile'
22319 html1dir='$html1dir'
22320 html1direxp='$html1direxp'
22321 html3dir='$html3dir'
22322 html3direxp='$html3direxp'
22331 i_arpainet='$i_arpainet'
22332 i_assert='$i_assert'
22333 i_bsdioctl='$i_bsdioctl'
22337 i_dirent='$i_dirent'
22343 i_fp_class='$i_fp_class'
22346 i_ieeefp='$i_ieeefp'
22347 i_inttypes='$i_inttypes'
22348 i_langinfo='$i_langinfo'
22349 i_libutil='$i_libutil'
22350 i_limits='$i_limits'
22351 i_locale='$i_locale'
22352 i_machcthr='$i_machcthr'
22353 i_malloc='$i_malloc'
22355 i_memory='$i_memory'
22356 i_mntent='$i_mntent'
22359 i_neterrno='$i_neterrno'
22360 i_netinettcp='$i_netinettcp'
22364 i_pthread='$i_pthread'
22366 i_rpcsvcdbm='$i_rpcsvcdbm'
22369 i_shadow='$i_shadow'
22371 i_stdarg='$i_stdarg'
22372 i_stddef='$i_stddef'
22373 i_stdlib='$i_stdlib'
22374 i_string='$i_string'
22375 i_sunmath='$i_sunmath'
22376 i_sysaccess='$i_sysaccess'
22377 i_sysdir='$i_sysdir'
22378 i_sysfile='$i_sysfile'
22379 i_sysfilio='$i_sysfilio'
22381 i_sysioctl='$i_sysioctl'
22382 i_syslog='$i_syslog'
22383 i_sysmman='$i_sysmman'
22384 i_sysmode='$i_sysmode'
22385 i_sysmount='$i_sysmount'
22386 i_sysndir='$i_sysndir'
22387 i_sysparam='$i_sysparam'
22388 i_syspoll='$i_syspoll'
22389 i_sysresrc='$i_sysresrc'
22390 i_syssecrt='$i_syssecrt'
22391 i_sysselct='$i_sysselct'
22392 i_syssockio='$i_syssockio'
22393 i_sysstat='$i_sysstat'
22394 i_sysstatfs='$i_sysstatfs'
22395 i_sysstatvfs='$i_sysstatvfs'
22396 i_systime='$i_systime'
22397 i_systimek='$i_systimek'
22398 i_systimes='$i_systimes'
22399 i_systypes='$i_systypes'
22400 i_sysuio='$i_sysuio'
22402 i_sysutsname='$i_sysutsname'
22403 i_sysvfs='$i_sysvfs'
22404 i_syswait='$i_syswait'
22405 i_termio='$i_termio'
22406 i_termios='$i_termios'
22408 i_unistd='$i_unistd'
22411 i_values='$i_values'
22412 i_varargs='$i_varargs'
22413 i_varhdr='$i_varhdr'
22415 ignore_versioned_solibs='$ignore_versioned_solibs'
22416 inc_version_list='$inc_version_list'
22417 inc_version_list_init='$inc_version_list_init'
22420 initialinstalllocation='$initialinstalllocation'
22421 installarchlib='$installarchlib'
22422 installbin='$installbin'
22423 installhtml1dir='$installhtml1dir'
22424 installhtml3dir='$installhtml3dir'
22425 installman1dir='$installman1dir'
22426 installman3dir='$installman3dir'
22427 installprefix='$installprefix'
22428 installprefixexp='$installprefixexp'
22429 installprivlib='$installprivlib'
22430 installscript='$installscript'
22431 installsitearch='$installsitearch'
22432 installsitebin='$installsitebin'
22433 installsitehtml1dir='$installsitehtml1dir'
22434 installsitehtml3dir='$installsitehtml3dir'
22435 installsitelib='$installsitelib'
22436 installsiteman1dir='$installsiteman1dir'
22437 installsiteman3dir='$installsiteman3dir'
22438 installsitescript='$installsitescript'
22439 installstyle='$installstyle'
22440 installusrbinperl='$installusrbinperl'
22441 installvendorarch='$installvendorarch'
22442 installvendorbin='$installvendorbin'
22443 installvendorhtml1dir='$installvendorhtml1dir'
22444 installvendorhtml3dir='$installvendorhtml3dir'
22445 installvendorlib='$installvendorlib'
22446 installvendorman1dir='$installvendorman1dir'
22447 installvendorman3dir='$installvendorman3dir'
22448 installvendorscript='$installvendorscript'
22450 issymlink='$issymlink'
22451 ivdformat='$ivdformat'
22454 known_extensions='$known_extensions'
22457 lddlflags='$lddlflags'
22459 ldflags_uselargefiles='$ldflags_uselargefiles'
22460 ldlibpthname='$ldlibpthname'
22467 libsdirs='$libsdirs'
22468 libsfiles='$libsfiles'
22469 libsfound='$libsfound'
22470 libspath='$libspath'
22471 libswanted='$libswanted'
22472 libswanted_uselargefiles='$libswanted_uselargefiles'
22478 localtime_r_proto='$localtime_r_proto'
22479 locincpth='$locincpth'
22480 loclibpth='$loclibpth'
22481 longdblsize='$longdblsize'
22482 longlongsize='$longlongsize'
22483 longsize='$longsize'
22487 lseeksize='$lseeksize'
22488 lseektype='$lseektype'
22491 madlyobj='$madlyobj'
22492 madlysrc='$madlysrc'
22496 make_set_make='$make_set_make'
22497 mallocobj='$mallocobj'
22498 mallocsrc='$mallocsrc'
22499 malloctype='$malloctype'
22501 man1direxp='$man1direxp'
22504 man3direxp='$man3direxp'
22506 mips_type='$mips_type'
22507 mistrustnm='$mistrustnm'
22509 mmaptype='$mmaptype'
22510 modetype='$modetype'
22512 multiarch='$multiarch'
22514 myarchname='$myarchname'
22515 mydomain='$mydomain'
22516 myhostname='$myhostname'
22519 need_va_copy='$need_va_copy'
22520 netdb_hlen_type='$netdb_hlen_type'
22521 netdb_host_type='$netdb_host_type'
22522 netdb_name_type='$netdb_name_type'
22523 netdb_net_type='$netdb_net_type'
22526 nm_so_opt='$nm_so_opt'
22527 nonxs_ext='$nonxs_ext'
22529 nvEUformat='$nvEUformat'
22530 nvFUformat='$nvFUformat'
22531 nvGUformat='$nvGUformat'
22532 nv_overflows_integers_at='$nv_overflows_integers_at'
22533 nv_preserves_uv_bits='$nv_preserves_uv_bits'
22534 nveformat='$nveformat'
22535 nvfformat='$nvfformat'
22536 nvgformat='$nvgformat'
22539 o_nonblock='$o_nonblock'
22541 old_pthread_create_joinable='$old_pthread_create_joinable'
22542 optimize='$optimize'
22543 orderlib='$orderlib'
22546 otherlibdirs='$otherlibdirs'
22550 patchlevel='$patchlevel'
22551 path_sep='$path_sep'
22554 perl_patchlevel='$perl_patchlevel'
22555 perladmin='$perladmin'
22556 perllibs='$perllibs'
22557 perlpath='$perlpath'
22559 phostname='$phostname'
22565 prefixexp='$prefixexp'
22567 privlibexp='$privlibexp'
22568 procselfexe='$procselfexe'
22569 prototype='$prototype'
22571 quadkind='$quadkind'
22572 quadtype='$quadtype'
22573 randbits='$randbits'
22574 randfunc='$randfunc'
22575 random_r_proto='$random_r_proto'
22576 randseedtype='$randseedtype'
22578 rd_nodata='$rd_nodata'
22579 readdir64_r_proto='$readdir64_r_proto'
22580 readdir_r_proto='$readdir_r_proto'
22581 revision='$revision'
22587 sPRIEUldbl='$sPRIEUldbl'
22588 sPRIFUldbl='$sPRIFUldbl'
22589 sPRIGUldbl='$sPRIGUldbl'
22590 sPRIXU64='$sPRIXU64'
22592 sPRIeldbl='$sPRIeldbl'
22593 sPRIfldbl='$sPRIfldbl'
22594 sPRIgldbl='$sPRIgldbl'
22599 sSCNfldbl='$sSCNfldbl'
22600 sched_yield='$sched_yield'
22601 scriptdir='$scriptdir'
22602 scriptdirexp='$scriptdirexp'
22604 seedfunc='$seedfunc'
22605 selectminbits='$selectminbits'
22606 selecttype='$selecttype'
22607 sendmail='$sendmail'
22608 setgrent_r_proto='$setgrent_r_proto'
22609 sethostent_r_proto='$sethostent_r_proto'
22610 setlocale_r_proto='$setlocale_r_proto'
22611 setnetent_r_proto='$setnetent_r_proto'
22612 setprotoent_r_proto='$setprotoent_r_proto'
22613 setpwent_r_proto='$setpwent_r_proto'
22614 setservent_r_proto='$setservent_r_proto'
22617 sharpbang='$sharpbang'
22618 shmattype='$shmattype'
22619 shortsize='$shortsize'
22622 sig_count='$sig_count'
22623 sig_name='$sig_name'
22624 sig_name_init='$sig_name_init'
22626 sig_num_init='$sig_num_init'
22627 sig_size='$sig_size'
22628 signal_t='$signal_t'
22629 sitearch='$sitearch'
22630 sitearchexp='$sitearchexp'
22632 sitebinexp='$sitebinexp'
22633 sitehtml1dir='$sitehtml1dir'
22634 sitehtml1direxp='$sitehtml1direxp'
22635 sitehtml3dir='$sitehtml3dir'
22636 sitehtml3direxp='$sitehtml3direxp'
22638 sitelib_stem='$sitelib_stem'
22639 sitelibexp='$sitelibexp'
22640 siteman1dir='$siteman1dir'
22641 siteman1direxp='$siteman1direxp'
22642 siteman3dir='$siteman3dir'
22643 siteman3direxp='$siteman3direxp'
22644 siteprefix='$siteprefix'
22645 siteprefixexp='$siteprefixexp'
22646 sitescript='$sitescript'
22647 sitescriptexp='$sitescriptexp'
22648 sizesize='$sizesize'
22649 sizetype='$sizetype'
22653 sockethdr='$sockethdr'
22654 socketlib='$socketlib'
22655 socksizetype='$socksizetype'
22657 spackage='$spackage'
22658 spitshell='$spitshell'
22659 srand48_r_proto='$srand48_r_proto'
22660 srandom_r_proto='$srandom_r_proto'
22662 ssizetype='$ssizetype'
22663 startperl='$startperl'
22665 static_ext='$static_ext'
22667 stdio_base='$stdio_base'
22668 stdio_bufsiz='$stdio_bufsiz'
22669 stdio_cnt='$stdio_cnt'
22670 stdio_filbuf='$stdio_filbuf'
22671 stdio_ptr='$stdio_ptr'
22672 stdio_stream_array='$stdio_stream_array'
22673 strerror_r_proto='$strerror_r_proto'
22676 subversion='$subversion'
22680 targetarch='$targetarch'
22684 timeincl='$timeincl'
22685 timetype='$timetype'
22686 tmpnam_r_proto='$tmpnam_r_proto'
22692 ttyname_r_proto='$ttyname_r_proto'
22701 uidformat='$uidformat'
22707 uquadtype='$uquadtype'
22708 use5005threads='$use5005threads'
22709 use64bitall='$use64bitall'
22710 use64bitint='$use64bitint'
22711 usecrosscompile='$usecrosscompile'
22713 usedtrace='$usedtrace'
22714 usefaststdio='$usefaststdio'
22715 useithreads='$useithreads'
22716 uselargefiles='$uselargefiles'
22717 uselongdouble='$uselongdouble'
22718 usemallocwrap='$usemallocwrap'
22719 usemorebits='$usemorebits'
22720 usemultiplicity='$usemultiplicity'
22721 usemymalloc='$usemymalloc'
22723 useopcode='$useopcode'
22724 useperlio='$useperlio'
22725 useposix='$useposix'
22726 usereentrant='$usereentrant'
22727 userelocatableinc='$userelocatableinc'
22729 useshrplib='$useshrplib'
22730 usesitecustomize='$usesitecustomize'
22731 usesocks='$usesocks'
22732 usethreads='$usethreads'
22733 usevendorprefix='$usevendorprefix'
22734 usevfork='$usevfork'
22737 uvXUformat='$uvXUformat'
22738 uvoformat='$uvoformat'
22741 uvuformat='$uvuformat'
22742 uvxformat='$uvxformat'
22743 vendorarch='$vendorarch'
22744 vendorarchexp='$vendorarchexp'
22745 vendorbin='$vendorbin'
22746 vendorbinexp='$vendorbinexp'
22747 vendorhtml1dir='$vendorhtml1dir'
22748 vendorhtml1direxp='$vendorhtml1direxp'
22749 vendorhtml3dir='$vendorhtml3dir'
22750 vendorhtml3direxp='$vendorhtml3direxp'
22751 vendorlib='$vendorlib'
22752 vendorlib_stem='$vendorlib_stem'
22753 vendorlibexp='$vendorlibexp'
22754 vendorman1dir='$vendorman1dir'
22755 vendorman1direxp='$vendorman1direxp'
22756 vendorman3dir='$vendorman3dir'
22757 vendorman3direxp='$vendorman3direxp'
22758 vendorprefix='$vendorprefix'
22759 vendorprefixexp='$vendorprefixexp'
22760 vendorscript='$vendorscript'
22761 vendorscriptexp='$vendorscriptexp'
22763 version_patchlevel_string='$version_patchlevel_string'
22764 versiononly='$versiononly'
22766 voidflags='$voidflags'
22769 yaccflags='$yaccflags'
22774 : Add in command line options if available
22775 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
22777 : add special variables
22778 $test -f $src/patchlevel.h && \
22779 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
22780 echo "PERL_PATCHLEVEL=$perl_patchlevel" >>config.sh
22781 echo "PERL_CONFIG_SH=true" >>config.sh
22783 : propagate old symbols
22784 if $test -f UU/config.sh; then
22785 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
22786 $sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' \
22787 config.sh config.sh UU/oldconfig.sh |\
22788 $sort | $uniq -u >UU/oldsyms
22789 set X `cat UU/oldsyms`
22795 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
22797 echo ": Variables propagated from previous config.sh file." >>config.sh
22798 for sym in `cat UU/oldsyms`; do
22799 echo " Propagating $hint variable "'$'"$sym..."
22800 eval 'tmp="$'"${sym}"'"'
22802 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
22808 : Finish up by extracting the .SH files
22812 echo "Extraction done."
22822 If you'd like to make any changes to the config.sh file before I begin
22823 to configure things, do it as a shell escape now (e.g. !vi config.sh).
22826 rp="Press return or use a shell escape to edit config.sh:"
22831 *) : in case they cannot read
22832 sh 1>&4 -c "$ans";;
22837 : if this fails, just run all the .SH files by hand
22846 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
22853 Now you need to generate make dependencies by running "$make depend".
22854 You might prefer to run it in background: "$make depend > makedepend.out &"
22855 It can take a while, so you might not want to run it right now.
22860 rp="Run $make depend now?"
22864 $make depend && echo "Now you must run '$make'."
22867 echo "You must run '$make depend' then '$make'."
22870 elif test -f [Mm]akefile; then
22872 echo "Now you must run a $make."
22874 echo "Configure done."
22877 if $test -f Policy.sh; then
22880 If you compile $package on a different machine or from a different object
22881 directory, copy the Policy.sh file from this object directory to the
22882 new one before you run Configure -- this will help you with most of
22883 the policy defaults.
22887 if $test -f config.msg; then
22888 echo "Hmm. I also noted the following information while running:"
22890 $cat config.msg >&4
22893 $rm -f kit*isdone ark*isdone