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 Mon Jun 16 16:07:02 CEST 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=''
950 d_inc_version_list=''
952 inc_version_list_init=''
971 ignore_versioned_solibs=''
1035 d_perl_otherlibdirs=''
1043 api_versionstring=''
1049 version_patchlevel_string=''
1053 d_nv_preserves_uv=''
1054 d_nv_zero_is_allbits_zero=''
1065 nv_overflows_integers_at=''
1066 nv_preserves_uv_bits=''
1138 installsitehtml1dir=''
1141 installsitehtml3dir=''
1148 installsiteman1dir=''
1151 installsiteman3dir=''
1156 installsitescript=''
1171 d_stdio_stream_array=''
1172 stdio_stream_array=''
1185 ccflags_uselargefiles=''
1186 ldflags_uselargefiles=''
1187 libswanted_uselargefiles=''
1207 installvendorarch=''
1214 installvendorhtml1dir=''
1216 vendorhtml1direxp=''
1217 installvendorhtml3dir=''
1219 vendorhtml3direxp=''
1225 installvendorman1dir=''
1228 installvendorman3dir=''
1235 installvendorscript=''
1248 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1251 : We must find out about Eunice early
1253 if test -f /etc/unixtovms; then
1254 eunicefix=/etc/unixtovms
1256 if test -f /etc/unixtovms.exe; then
1257 eunicefix=/etc/unixtovms.exe
1260 : Set executable suffix now -- needed before hints available
1261 if test -f "/libs/version.library"; then
1264 elif test -f "/system/gnu_library/bin/ar.pm"; then
1267 elif test -n "$DJGPP"; then
1270 elif test -d c:/. -o -n "$is_os2" ; then
1277 : Trailing extension. Override this in a hint file, if needed.
1278 : Extra object files, if any, needed on this platform.
1282 : change the next line if compiling for Xenix/286 on Xenix/386
1283 xlibpth='/usr/lib/386 /lib/386'
1284 : Possible local library directories to search.
1285 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1286 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1288 : general looking path for locating libraries
1289 glibpth="/lib /usr/lib $xlibpth"
1290 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1291 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1292 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1293 test -d /usr/lib64 && glibpth="$glibpth /lib64 /usr/lib64 /usr/local/lib64"
1295 : Private path used by Configure to find libraries. Its value
1296 : is prepended to libpth. This variable takes care of special
1297 : machines, like the mips. Usually, it should be empty.
1300 : default library list
1302 : some systems want to use only the non-versioned libso:s
1303 ignore_versioned_solibs=''
1304 : set usethreads on the Configure command line to enable threads.
1305 usereentrant='undef'
1306 : full support for void wanted by default
1309 : Possible local include directories to search.
1310 : Set locincpth to "" in a hint file to defeat local include searches.
1311 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1312 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1314 : no include file wanted by default
1317 : Enable -DEBUGGING and -DDEBUGGING from the command line
1324 : set useposix=false in your hint file to disable the POSIX extension.
1326 : set useopcode=false in your hint file to disable the Opcode extension.
1329 ccflags_uselargefiles=''
1330 ldflags_uselargefiles=''
1331 libswanted_uselargefiles=''
1332 : set usemultiplicity on the Configure command line to enable multiplicity.
1333 : set usesocks on the Configure command line to enable socks.
1334 : List of libraries we want.
1335 : If anyone needs extra -lxxx, put those in a hint file.
1336 libswanted="sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun"
1337 libswanted="$libswanted m crypt sec util c cposix posix ucb bsd BSD"
1338 : We probably want to search /usr/shlib before most other libraries.
1339 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1340 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1341 glibpth="/usr/shlib $glibpth"
1342 : Do not use vfork unless overridden by a hint file.
1345 : Find the basic shell for Bourne shell scripts
1349 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1352 if test -f "$xxx"; then
1355 : Build up a list and do a single loop so we can 'break' out.
1356 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1357 for xxx in sh bash ksh pdksh ash; do
1359 try="$try ${p}/${xxx}"
1363 if test -f "$xxx"; then
1366 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1369 elif test -f "$xxx.exe"; then
1380 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1382 Usually it's in /bin/sh. How did you even get this far?
1383 Please contact me (Perl Maintainers) at perlbug@perl.org and
1384 we'll try to straighten this all out.
1390 : see if sh knows # comments
1391 if `$sh -c '#' >/dev/null 2>&1`; then
1395 test -f $xcat$_exe || xcat=/usr/bin/cat
1396 if test ! -f $xcat$_exe; then
1397 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1398 if test -f $p/cat$_exe; then
1403 if test ! -f $xcat$_exe; then
1404 echo "Can't find cat anywhere!"
1408 echo "#!$xcat" >sharp
1411 ./sharp > today 2>/dev/null
1412 if test -s today; then
1415 echo "#! $xcat" > sharp
1418 ./sharp > today 2>/dev/null
1419 if test -s today; then
1427 echo "Your $sh doesn't grok # comments--I will strip them later on."
1430 echo "exec grep -v '^[ ]*#'" >spitshell
1432 $eunicefix spitshell
1433 spitshell=`pwd`/spitshell
1435 echo "I presume that if # doesn't work, #! won't work either!"
1440 : figure out how to guarantee sh startup
1442 '') startsh=${sharpbang}${sh} ;;
1454 : echo "Yup, it does."
1456 echo "Hmm... '$startsh' does not guarantee sh startup..."
1457 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1461 : Save command line options in file UU/cmdline.opt for later use in
1462 : generating config.sh.
1463 cat > cmdline.opt <<EOSH
1464 : Configure command line arguments.
1473 cat >>cmdline.opt <<EOSH
1474 config_arg$argn='$arg'
1476 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1479 arg_exp=`cat cmdl.opt`
1480 args_exp="$args_exp$args_sep'$arg_exp'"
1481 argn=`expr $argn + 1`
1486 : produce awk script to parse command line options
1487 cat >options.awk <<'EOF'
1489 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1491 len = length(optstr);
1492 for (i = 1; i <= len; i++) {
1493 c = substr(optstr, i, 1);
1494 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1505 if (substr(str, 1, 1) != "-") {
1506 printf("'%s'\n", str);
1510 for (i = 2; i <= len; i++) {
1511 c = substr(str, i, 1);
1513 printf("-%s\n", substr(str, i));
1519 printf("'%s'\n", substr(str, i + 1));
1532 : process the command line options
1533 set X `for arg in "$@"; do echo "X$arg"; done |
1534 sed -e s/X// | awk -f options.awk`
1539 : set up default values
1549 rm -f optdef.sh posthint.sh
1550 cat >optdef.sh <<EOS
1556 while test $# -gt 0; do
1558 -d) shift; fastread=yes;;
1559 -e) shift; alldone=cont;;
1563 if test -r "$1"; then
1566 echo "$me: cannot read config file $1." >&2
1572 -h) shift; error=true;;
1573 -r) shift; reuseval=true;;
1574 -s) shift; silent=true; realsilent=true;;
1575 -E) shift; alldone=exit;;
1576 -K) shift; knowitall=true;;
1577 -O) shift; override=true;;
1578 -S) shift; silent=true; extractsh=true;;
1583 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1584 echo "$me: ignoring -D $1" >&2
1587 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1588 *) echo "$1='define'" >> optdef.sh;;
1595 *=) echo "$1" >> optdef.sh;;
1597 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1598 echo "$me: ignoring -U $1" >&2
1600 *) echo "$1='undef'" >> optdef.sh;;
1611 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1615 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1616 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1622 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1623 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1624 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1625 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1626 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1627 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1633 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1635 echo "$yyy=''" >> posthint.sh ;;
1640 echo "$yyy='$zzz'" >> posthint.sh ;;
1642 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1644 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1649 echo "$yyy=$zzz" >> posthint.sh ;;
1650 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1654 -V) echo "$me generated by metaconfig 3.5 PL0." >&2
1657 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1665 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1666 [-U symbol] [-U symbol=] [-A command:symbol...]
1667 -d : use defaults for all answers.
1668 -e : go on without questioning past the production of config.sh.
1669 -f : specify an alternate default configuration file.
1670 -h : print this help message and exit (with an error status).
1671 -r : reuse C symbols value if possible (skips costly nm extraction).
1672 -s : silent mode, only echoes questions and essential information.
1673 -D : define symbol to have some value:
1674 -D symbol symbol gets the value 'define'
1675 -D symbol=value symbol gets the value 'value'
1676 common used examples (see INSTALL for more info):
1677 -Duse64bitint use 64bit integers
1678 -Duse64bitall use 64bit integers and pointers
1679 -Dusethreads use thread support
1680 -Dinc_version_list=none do not include older perl trees in @INC
1681 -DEBUGGING=none DEBUGGING options
1682 -Dcc=gcc choose your compiler
1683 -Dprefix=/opt/perl5 choose your destination
1684 -E : stop at the end of questions, after having produced config.sh.
1685 -K : do not use unless you know what you are doing.
1686 -O : let -D and -U override definitions from loaded configuration file.
1687 -S : perform variable substitutions on all .SH files (can mix with -f)
1688 -U : undefine symbol:
1689 -U symbol symbol gets the value 'undef'
1690 -U symbol= symbol gets completely empty
1692 -A : manipulate symbol after the platform specific hints have been applied:
1693 -A append:symbol=value append value to symbol
1694 -A symbol=value like append:, but with a separating space
1695 -A define:symbol=value define symbol to have value
1696 -A clear:symbol define symbol to be ''
1697 -A define:symbol define symbol to be 'define'
1698 -A eval:symbol=value define symbol to be eval of value
1699 -A prepend:symbol=value prepend value to symbol
1700 -A undef:symbol define symbol to be 'undef'
1701 -A undef:symbol= define symbol to be ''
1702 e.g.: -A prepend:libswanted='cl pthread '
1703 -A ccflags=-DSOME_MACRO
1704 -V : print version number and exit (with a zero status).
1711 case "$fastread$alldone" in
1714 case "$extractsh" in
1717 if test ! -t 0; then
1718 echo "Say 'sh Configure', not 'sh <Configure'"
1728 true) exec 1>/dev/null;;
1731 : run the defines and the undefines, if any, but leave the file out there...
1734 : create the posthint manipulation script and leave the file out there...
1739 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1740 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1741 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1742 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1743 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1746 : Some greps do not return status, grrr.
1747 echo "grimblepritz" >grimble
1748 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1750 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1756 : the following should work in any shell
1760 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1761 cat >contains <<'EOSS'
1762 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1767 : Find the path to the source tree
1770 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1774 *) src=`cd ../$src && pwd` ;;
1787 if test -f $rsrc/Configure && \
1788 $contains "^package='$package'\$" $rsrc/Configure >/dev/null 2>&1
1790 : found it, so we are ok.
1793 for src in . .. ../.. ../../.. ../../../..; do
1794 if test -f ../$src/Configure && \
1795 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1806 Sorry, I can't seem to locate the source dir for $package. Please start
1807 Configure with an explicit path -- i.e. /some/path/Configure.
1815 echo "Sources for $package found in \"$src\"." >&4
1819 : script used to extract .SH files with variable substitutions
1820 cat >extract <<'EOS'
1822 echo "Doing variable substitutions on .SH files..."
1823 if test -f MANIFEST; then
1824 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1826 echo "(Looking for .SH files under the source directory.)"
1827 set x `(cd "$src"; find . -name "*.SH" -print)`
1831 0) set x `(cd "$src"; echo *.SH)`; shift;;
1833 if test ! -f "$src/$1"; then
1839 while test $name; do
1840 if test ! -d "$name"; then
1841 create="$name $create";
1842 name=`echo $name | sed -e "s|^[^/]*$||"`;
1843 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1848 for file in $create; do
1857 dir=`expr X$file : 'X\(.*\)/'`
1858 file=`expr X$file : 'X.*/\(.*\)'`
1859 (cd "$dir" && . ./$file)
1869 dir=`expr X$file : 'X\(.*\)/'`
1870 file=`expr X$file : 'X.*/\(.*\)'`
1871 (set x $dir; shift; eval $mkdir_p)
1872 sh <"$src/$dir/$file"
1881 if test -f "$src/config_h.SH"; then
1882 if test ! -f config.h; then
1883 : oops, they left it out of MANIFEST, probably, so do it anyway.
1884 . "$src/config_h.SH"
1889 : extract files and exit if asked to do so
1890 case "$extractsh" in
1892 case "$realsilent" in
1896 case "$config_sh" in
1897 '') config_sh='config.sh';;
1900 echo "Fetching answers from $config_sh..."
1903 test "$override" && . ./optdef.sh
1907 echo "Extraction done."
1912 : Eunice requires " " instead of "", can you believe it
1915 echo "Beginning of configuration questions for $package."
1917 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1919 : first determine how to suppress newline on echo command
1921 echo "Checking echo to see how to suppress newlines..."
1922 (echo "hi there\c" ; echo " ") >.echotmp
1923 if $contains c .echotmp >/dev/null 2>&1 ; then
1934 echo $n "The star should be here-->$c"
1938 : Now test for existence of everything in MANIFEST
1940 if test -f "$rsrc/MANIFEST"; then
1941 echo "First let's make sure your kit is complete. Checking..." >&4
1942 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | \
1943 (split -l 50 2>/dev/null || split -50)
1946 for filelist in x??; do
1947 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` \
1948 >/dev/null 2>>"$tmppwd/missing")
1950 if test -s missing; then
1954 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1956 You have the option of continuing the configuration process, despite the
1957 distinct possibility that your kit is damaged, by typing 'y'es. If you
1958 do, don't blame me if something goes wrong. I advise you to type 'n'o
1959 and contact the author (perlbug@perl.org).
1962 echo $n "Continue? [n] $c" >&4
1966 echo "Continuing..." >&4
1970 echo "ABORTING..." >&4
1975 echo "Looks good..."
1978 echo "There is no MANIFEST file. I hope your kit is complete !"
1982 : Find the appropriate value for a newline for tr
1984 if test -n "$DJGPP"; then
1987 if test X"$trnl" = X; then
1988 case "`echo foo|tr '\n' x 2>/dev/null`" in
1992 if test X"$trnl" = X; then
1993 case "`echo foo|tr '\012' x 2>/dev/null`" in
1994 foox) trnl='\012' ;;
1997 if test X"$trnl" = X; then
1998 case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
1999 fooxy) trnl='\n\r' ;;
2002 if test X"$trnl" = X; then
2005 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
2011 : compute the number of columns on the terminal for proper question formatting
2016 : set up the echo used in my read
2017 myecho="case \"\$xxxm\" in
2018 '') echo $n \"\$rp $c\" >&4;;
2020 '') echo $n \"[\$xxxm] $c\";;
2022 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
2024 echo $n \"[\$xxxm] $c\" >&4
2026 echo $n \"\$rp [\$xxxm] $c\" >&4
2032 : now set up to do reads with possible shell escape and default assignment
2038 case "\$fastread" in
2039 yes) case "\$dflt" in
2042 case "\$silent-\$rp" in
2047 *) case "\$silent" in
2048 true) case "\$rp" in
2053 while expr "X\$ans" : "X!" >/dev/null; do
2057 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2065 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2074 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2079 echo "(OK, I'll run with -d after this question.)" >&4
2082 echo "*** Sorry, \$1 not supported yet." >&4
2092 echo "*** Substitution done -- please confirm."
2094 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2099 echo "*** Error -- try again."
2106 case "\$ans\$xxxm\$nostick" in
2118 : create .config dir to save info across Configure sessions
2119 test -d ../.config || mkdir ../.config
2120 cat >../.config/README <<EOF
2121 This directory created by Configure to save information that should
2122 persist across sessions for $package.
2124 You may safely delete it if you wish.
2127 : See if we are using a devel version and want that
2128 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2130 $define|true|[yY]*) ;;
2131 *) case "$xversion" in
2134 *** WHOA THERE!!! ***
2136 This is an UNSTABLE DEVELOPMENT release.
2137 The version of this $package distribution is $xversion, that is, odd,
2138 (as opposed to even) and that signifies a development release.
2139 If you want a maintenance release, you want an even-numbered version.
2141 Do ***NOT*** install this into production use.
2142 Data corruption and crashes are possible.
2144 It is most seriously suggested that you do not continue any further
2145 unless you want to help in developing and debugging Perl.
2147 If you *still* want to build perl, you can answer 'y' now,
2148 or pass -Dusedevel to Configure.
2151 rp='Do you really want to continue?'
2155 [yY]) echo >&4 "Okay, continuing."
2156 usedevel="$define" ;;
2157 *) echo >&4 "Okay, bye."
2167 case "$versiononly" in
2168 '') versiononly="$define" ;;
2170 case "$installusrbinperl" in
2171 '') installusrbinperl="$undef" ;;
2176 : general instructions
2179 user=`(logname) 2>/dev/null`
2181 '') user=`whoami 2>&1`;;
2183 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2186 rp='Would you like to see the instructions?'
2197 This installation shell script will examine your system and ask you questions
2198 to determine how the perl5 package should be installed. If you get
2199 stuck on a question, you may use a ! shell escape to start a subshell or
2200 execute a command. Many of the questions will have default answers in square
2201 brackets; typing carriage return will give you the default.
2203 On some of the questions which ask for file or directory names you are allowed
2204 to use the ~name construct to specify the login directory belonging to "name",
2205 even if you don't have a shell which knows about that. Questions where this is
2206 allowed will be marked "(~name ok)".
2210 dflt='Type carriage return to continue'
2214 The prompter used in this script allows you to use shell variables and
2215 backticks in your answers. You may use $1, $2, etc... to refer to the words
2216 in the default answer, as if the default line was a set of arguments given to a
2217 script shell. This means you may also use $* to repeat the whole default line,
2218 so you do not have to re-type everything to add something to the default.
2220 Everytime there is a substitution, you will have to confirm. If there is an
2221 error (e.g. an unmatched backtick), the default answer will remain unchanged
2222 and you will be prompted again.
2224 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2225 the questions and use the computed defaults (or the previous answers if there
2226 was already a config.sh file). Type 'Configure -h' for a list of options.
2227 You may also start interactively and then answer '& -d' at any prompt to turn
2228 on the non-interactive behaviour for the remainder of the execution.
2234 Much effort has been expended to ensure that this shell script will run on any
2235 Unix system. If despite that it blows up on yours, your best bet is to edit
2236 Configure and run it again. If you can't run Configure for some reason,
2237 you'll have to generate a config.sh file by hand. Whatever problems you
2238 have, let me (perlbug@perl.org) know how I blew it.
2240 This installation script affects things in two ways:
2242 1) it may do direct variable substitutions on some of the files included
2244 2) it builds a config.h file for inclusion in C programs. You may edit
2245 any of these files as the need arises after running this script.
2247 If you make a mistake on a question, there is no easy way to back up to it
2248 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2249 files. Configure will offer to let you do this before it runs the SH files.
2252 dflt='Type carriage return to continue'
2254 case "$firsttime" in
2255 true) echo $user >>../.config/instruct;;
2259 : find out where common programs are
2261 echo "Locating common programs..." >&4
2274 if test -d \$dir/\$thing; then
2280 for thisthing in \$dir/\$thing; do
2281 : just loop through to pick last item
2283 if test -f \$thisthing; then
2286 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2289 elif test -f \$dir/\$thing.exe; then
2290 if test -n "$DJGPP"; then
2291 echo \$dir/\$thing.exe
2292 elif test "$eunicefix" != ":"; then
2293 : on Eunice apparently
2345 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2346 pth="$pth /lib /usr/lib"
2347 for file in $loclist; do
2351 if test -f "$xxx"; then
2354 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2355 xxx=`./loc $file $file $pth`
2358 '') xxx=`./loc $file $file $pth`;;
2359 *) xxx=`./loc $xxx $xxx $pth`;;
2361 eval $file=$xxx$_exe
2365 echo $file is in $xxx.
2368 echo $file is in $xxx.
2371 echo "I don't know where '$file' is, and my life depends on it." >&4
2372 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2378 echo "Don't worry if any of the following aren't found..."
2380 for file in $trylist; do
2384 if test -f "$xxx"; then
2387 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2388 xxx=`./loc $file $file $pth`
2391 '') xxx=`./loc $file $file $pth`;;
2392 *) xxx=`./loc $xxx $xxx $pth`;;
2394 eval $file=$xxx$_exe
2398 echo $file is in $xxx.
2401 echo $file is in $xxx.
2404 echo "I don't see $file out there, $say."
2411 echo "Substituting grep for egrep."
2418 echo "Substituting cp for ln."
2427 echo "I can't find make or gmake, and my life depends on it." >&4
2428 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2436 *) # We can't have osname yet.
2437 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2438 # Assume that gmake, if found, is definitely GNU make
2439 # and prefer it over the system make.
2440 echo "Substituting gmake for make."
2448 echo "Hopefully test is built into your sh."
2451 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2452 echo "Using the test built into your sh."
2460 echo "Hopefully echo is built into your sh."
2465 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2466 $echo $n "hi there$c" >foo1
2467 echo $n "hi there$c" >foo2
2468 if cmp foo1 foo2 >/dev/null 2>&1; then
2469 echo "They are compatible. In fact, they may be identical."
2476 They are not compatible! You are probably running ksh on a non-USG system.
2477 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2478 have echo built in and we may have to run some Bourne shell scripts. That
2479 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2482 $echo $n "The star should be here-->$c"
2489 # This question was auctioned at YAPC::Europe-2007 in Vienna
2490 # I never promised you could answer it. I only auctioned the question.
2492 The following message is sponsored by
2494 Dresden.pm<--The stars should be here.
2496 Dear Perl user, system administrator or package
2497 maintainer, the Perl community sends greetings to
2498 you. Do you (emblematical) greet back [Y/n]? n
2502 : Check what type of C compiler we use
2506 cat <<'EOSC' >>trygcc
2511 int main(int argc, char *argv[]) {
2515 if $cc -o try $ccflags $ldflags try.c; then
2518 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2524 # Skip this test because it gives a false match on output like:
2525 # ./trygcc: line 23: cc: command not found
2526 # case "`$cc -v -c try.c 2>&1`" in
2527 # *gcc*) trygcc=no ;;
2529 if $test X"$trygcc" = Xyes; then
2530 if gcc -o try -c try.c; then
2532 echo "You seem to have a working gcc, though." >&4
2533 # Switching compilers may undo the work of hints files.
2534 # The most common problem is -D_REENTRANT for threads.
2535 # This heuristic catches that case, but gets false positives
2536 # if -Dusethreads was not actually specified. Better to
2537 # bail out here with a useful message than fail
2538 # mysteriously later. Should we perhaps just try to
2539 # re-invoke Configure -Dcc=gcc config_args ?
2540 if $test -f usethreads.cbu; then
2543 *** However, any setting of the C compiler flags (e.g. for thread support)
2544 *** will be lost. It may be necessary for you to restart Configure and
2545 *** add -Dcc=gcc to your Configure command line.
2548 rp="Would you like to go ahead and try gcc anyway?"
2551 rp="Would you like to use it?"
2554 if $test -f myread; then
2557 if $test -f UU/myread; then
2560 echo "Cannot find myread, sorry. Aborting." >&2
2565 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2578 cat <<'EOSC' >>checkcc
2583 int main(int argc, char *argv[]) {
2587 if $cc -o try $ccflags $ldflags try.c; then
2590 if $test X"$despair" = Xyes; then
2591 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2594 You need to find a working C compiler.
2595 Either (purchase and) install the C compiler supplied by your OS vendor,
2596 or for a free C compiler try http://gcc.gnu.org/
2597 I cannot continue any further, aborting.
2606 : determine whether symbolic links are supported
2609 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2610 echo "Symbolic links are supported." >&4
2613 echo "Symbolic links are NOT supported." >&4
2618 : determine whether symbolic links are supported
2622 echo "Checking how to test for symbolic links..." >&4
2624 if $test "X$issymlink" = X; then
2626 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2627 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2629 if test $? = 0; then
2632 echo "Your builtin 'test -h' may be broken." >&4
2635 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2638 if test -f "$p/$test"; then
2647 echo "Trying external '$test -h'." >&4
2648 issymlink="$test -h"
2649 if $test ! -h sym >/dev/null 2>&1; then
2650 echo "External '$test -h' is broken, too." >&4
2658 if $test "X$issymlink" = X; then
2659 if $test -L sym 2>/dev/null; then
2660 issymlink="$test -L"
2661 echo "The builtin '$test -L' worked." >&4
2664 if $test "X$issymlink" != X; then
2665 echo "You can test for symbolic links with '$issymlink'." >&4
2667 echo "I do not know how you can test for symbolic links." >&4
2671 *) echo "No symbolic links, so not testing for their testing..." >&4
2676 : Make symlinks util
2677 case "$mksymlinks" in
2680 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2683 *) case "$lns:$issymlink" in
2684 *"ln"*" -s:"*"test -"?)
2685 echo "Creating the symbolic links..." >&4
2686 echo "(First creating the subdirectories...)" >&4
2688 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2690 test -z "$directory" && break
2694 if test ! -d t/base; then
2695 echo "Failed to create the subdirectories. Aborting." >&4
2698 echo "(Then creating the symlinks...)" >&4
2699 awk '{print $1}' $src/MANIFEST | while true; do
2701 test -z "$filename" && break
2702 if test -f $filename; then
2703 if $issymlink $filename; then
2707 if test -f $filename; then
2708 echo "$filename already exists, not symlinking."
2710 ln -s $src/$filename $filename
2714 if test ! -f t/base/lex.t; then
2715 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2720 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2728 : Check for Cross-Compilation
2729 case "$usecrosscompile" in
2731 $echo "Cross-compiling..."
2734 *-*-gcc) # A cross-compiling gcc, probably.
2735 targetarch=`$echo $cc|$sed 's/-gcc$//'`
2737 # leave out ld, choosing it is more complex
2739 ranlib=$targetarch-ranlib
2740 $echo 'extern int foo;' > try.c
2741 set X `$cc -v -E try.c 2>&1 | $awk '/^#include </,/^End of search /'|$grep '/include'`
2743 if $test $# -gt 0; then
2745 incpth="`$echo $incpth|$sed 's/^ //'`"
2746 echo "Guessing incpth '$incpth'." >&4
2748 j="`$echo $i|$sed 's,/include$,/lib,'`"
2749 if $test -d $j; then
2753 libpth="`$echo $libpth|$sed 's/^ //'`"
2754 echo "Guessing libpth '$libpth'." >&4
2759 case "$targetarch" in
2760 '') echo "Targetarch not defined." >&4; croak=y ;;
2761 *) echo "Using targetarch $targetarch." >&4 ;;
2764 '') echo "Incpth not defined." >&4; croak=y ;;
2765 *) echo "Using incpth '$incpth'." >&4 ;;
2768 '') echo "Libpth not defined." >&4; croak=y ;;
2769 *) echo "Using libpth '$libpth'." >&4 ;;
2772 '') for i in $incpth; do
2773 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
2775 echo "Guessing usrinc $usrinc." >&4
2780 '') echo "Usrinc not defined." >&4; croak=y ;;
2783 *) echo "Using usrinc $usrinc." >&4 ;;
2785 case "$targethost" in
2786 '') echo "Targethost not defined." >&4; croak=y ;;
2787 *) echo "Using targethost $targethost." >&4
2792 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2795 /*) run=$src/Cross/run
2796 targetmkdir=$src/Cross/mkdir
2798 from=$src/Cross/from
2800 *) pwd=`$test -f ../Configure & cd ..; pwd`
2802 targetmkdir=$pwd/Cross/mkdir
2804 from=$pwd/Cross/from
2807 case "$targetrun" in
2808 '') targetrun=ssh ;;
2813 case "$targetfrom" in
2814 '') targetfrom=scp ;;
2818 from=$from-$targetfrom
2819 case "$targetdir" in
2821 echo "Guessing targetdir $targetdir." >&4
2824 case "$targetuser" in
2826 echo "Guessing targetuser $targetuser." >&4
2829 case "$targetfrom" in
2833 case "$targetrun" in
2845 '') cwd=$targetdir ;;
2849 if $test ! -f \$exe.xok; then
2853 $targetrun -l $targetuser $targethost "cd \$cwd && ./\$exe \$@"
2856 *) echo "Unknown targetrun '$targetrun'" >&4
2860 case "$targetmkdir" in
2862 cat >$targetmkdir <<EOF
2864 $targetrun -l $targetuser $targethost "mkdir -p \$@"
2866 $chmod a+rx $targetmkdir
2868 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
2880 $targetmkdir \`dirname \$f\`
2881 $targetto $q \$f $targetuser@$targethost:\$f || exit 1
2884 $targetmkdir $targetdir/\`dirname \$f\`
2885 $targetto $q \$f $targetuser@$targethost:$targetdir/\$f || exit 1
2898 $mkdir -p $targetdir/\`dirname \$f\`
2899 $cp \$f $targetdir/\$f || exit 1
2902 $targetmkdir $targetdir/\`dirname \$f\`
2903 $cp \$f $targetdir/\$f || exit 1
2910 *) echo "Unknown targetto '$targetto'" >&4
2914 case "$targetfrom" in
2921 $targetfrom $q $targetuser@$targethost:$targetdir/\$f . || exit 1
2926 cp) cat >$from <<EOF
2931 cp $targetdir/\$f . || exit 1
2936 *) echo "Unknown targetfrom '$targetfrom'" >&4
2940 if $test ! -f $run; then
2941 echo "Target 'run' script '$run' not found." >&4
2945 if $test ! -f $to; then
2946 echo "Target 'to' script '$to' not found." >&4
2950 if $test ! -f $from; then
2951 echo "Target 'from' script '$from' not found." >&4
2955 if $test ! -f $run -o ! -f $to -o ! -f $from; then
2959 Using '$run' for remote execution,
2960 and '$from' and '$to'
2961 for remote file transfer.
2967 usecrosscompile='undef'
2972 : see whether [:lower:] and [:upper:] are supported character classes
2974 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2976 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2980 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
2981 # (0xd9 and 0xe2), therefore that is a nice testing point.
2982 if test "X$up" = X -o "X$low" = X; then
2983 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
2989 if test "X$up" = X -o "X$low" = X; then
2990 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
2996 if test "X$up" = X -o "X$low" = X; then
2997 case "`echo RS | od -x 2>/dev/null`" in
2999 echo "Hey, this might be EBCDIC." >&4
3000 if test "X$up" = X -o "X$low" = X; then
3001 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
3002 rs) up='[A-IJ-RS-Z]'
3007 if test "X$up" = X -o "X$low" = X; then
3008 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
3018 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
3020 echo "Using $up and $low to convert case." >&4
3023 echo "I don't know how to translate letters from upper to lower case." >&4
3024 echo "Your tr is not acting any way I know of." >&4
3028 : set up the translation script tr, must be called with ./tr of course
3032 '[A-Z][a-z]') exec $tr '$up' '$low';;
3033 '[a-z][A-Z]') exec $tr '$low' '$up';;
3040 : Try to determine whether config.sh was made on this system
3041 case "$config_sh" in
3043 myuname=`$uname -a 2>/dev/null`
3044 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
3045 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
3046 # because the A-Z/a-z are not consecutive.
3047 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e "s,['/],,g" | \
3048 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
3049 newmyuname="$myuname"
3051 case "$knowitall" in
3053 if test -f ../config.sh; then
3054 if $contains myuname= ../config.sh >/dev/null 2>&1; then
3055 eval "`grep myuname= ../config.sh`"
3057 if test "X$myuname" = "X$newmyuname"; then
3065 : Get old answers from old config file if Configure was run on the
3066 : same system, otherwise use the hints.
3069 if test -f config.sh; then
3071 rp="I see a config.sh file. Shall I use it to set the defaults?"
3074 n*|N*) echo "OK, I'll ignore it."
3075 mv config.sh config.sh.old
3076 myuname="$newmyuname"
3078 *) echo "Fetching default answers from your old config.sh file..." >&4
3086 : Older versions did not always set $sh. Catch re-use of such
3096 if test ! -f config.sh; then
3099 First time through, eh? I have some defaults handy for some systems
3100 that need some extra help getting the Configure answers right:
3103 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3105 : Half the following guesses are probably wrong... If you have better
3106 : tests or hints, please send them to perlbug@perl.org
3107 : The metaconfig authors would also appreciate a copy...
3108 $test -f /irix && osname=irix
3109 $test -f /xenix && osname=sco_xenix
3110 $test -f /dynix && osname=dynix
3111 $test -f /dnix && osname=dnix
3112 $test -f /lynx.os && osname=lynxos
3113 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3114 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3115 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3116 $test -f /bin/mips && /bin/mips && osname=mips
3117 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
3118 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
3119 $test -d /usr/apollo/bin && osname=apollo
3120 $test -f /etc/saf/_sactab && osname=svr4
3121 $test -d /usr/include/minix && osname=minix
3122 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3123 if $test -d /MachTen -o -d /MachTen_Folder; then
3125 if $test -x /sbin/version; then
3126 osvers=`/sbin/version | $awk '{print $2}' |
3127 $sed -e 's/[A-Za-z]$//'`
3128 elif $test -x /usr/etc/version; then
3129 osvers=`/usr/etc/version | $awk '{print $2}' |
3130 $sed -e 's/[A-Za-z]$//'`
3136 $test -f /sys/posix.dll &&
3137 $test -f /usr/bin/what &&
3138 set X `/usr/bin/what /sys/posix.dll` &&
3139 $test "$3" = UWIN &&
3143 if $test -f $uname; then
3151 umips) osname=umips ;;
3154 [23]100) osname=mips ;;
3155 next*) osname=next ;;
3157 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3158 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3161 elif $test -f /etc/kconfig; then
3163 if test "$lns" = "$ln -s"; then
3165 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3167 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3174 if test -n "$DJGPP"; then
3183 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3185 # oslevel can fail with:
3186 # oslevel: Unable to acquire lock.
3187 *not\ found) osvers="$4"."$3" ;;
3188 '<3240'|'<>3240') osvers=3.2.0 ;;
3189 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3190 '=3250'|'>3250') osvers=3.2.5 ;;
3194 bsd386) osname=bsd386
3197 cygwin*) osname=cygwin
3200 *dc.osx) osname=dcosx
3206 domainos) osname=apollo
3212 dragonfly) osname=dragonfly
3215 dynixptx*) osname=dynixptx
3216 osvers=`echo "$4"|sed 's/^v//'`
3218 freebsd) osname=freebsd
3220 genix) osname=genix ;;
3224 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3240 netbsd*) osname=netbsd
3243 news-os) osvers="$3"
3245 4*) osname=newsos4 ;;
3249 next*) osname=next ;;
3250 nonstop-ux) osname=nonstopux ;;
3251 openbsd) osname=openbsd
3257 POSIX-BC | posix-bc ) osname=posix-bc
3260 powerux | power_ux | powermax_os | powermaxos | \
3261 powerunix | power_unix) osname=powerux
3267 solaris) osname=solaris
3269 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3276 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3280 titanos) osname=titanos
3289 ultrix) osname=ultrix
3292 osf1|mls+) case "$5" in
3295 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3298 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3301 hp*) osname=hp_osf1 ;;
3302 mips) osname=mips_osf1 ;;
3305 # UnixWare 7.1.2 is known as Open UNIX 8
3306 openunix|unixware) osname=svr5
3314 $2) case "$osname" in
3318 : svr4.x or possibly later
3328 if test -f /stand/boot ; then
3329 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3330 if test -n "$INITPROG" -a -f "$INITPROG"; then
3331 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3332 if test -n "$isesix"; then
3340 *) if test -f /etc/systemid; then
3342 set `echo $3 | $sed 's/\./ /g'` $4
3343 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3345 elif $test -f $src/hints/sco_$1_$2.sh; then
3347 elif $test -f $src/hints/sco_$1.sh; then
3352 '') : Still unknown. Probably a generic Sys V.
3361 *) case "$osname" in
3362 '') : Still unknown. Probably a generic BSD.
3370 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3371 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3372 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3375 $rm -f UU/kernel.what
3376 elif test -d c:/. -o -n "$is_os2" ; then
3383 case "$targetarch" in
3386 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3391 : Now look for a hint file osname_osvers, unless one has been
3392 : specified already.
3395 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3396 : Also try without trailing minor version numbers.
3397 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3398 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3399 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3400 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3403 *) case "$osvers" in
3406 *) if $test -f $src/hints/$file.sh ; then
3408 elif $test -f $src/hints/$xfile.sh ; then
3410 elif $test -f $src/hints/$xxfile.sh ; then
3412 elif $test -f $src/hints/$xxxfile.sh ; then
3414 elif $test -f $src/hints/$xxxxfile.sh ; then
3416 elif $test -f "$src/hints/${osname}.sh" ; then
3425 if $test -f Policy.sh ; then
3428 none) dflt="Policy" ;;
3429 *) dflt="Policy $dflt" ;;
3434 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3438 if $test -f Policy.sh ; then
3441 There's also a Policy hint file available, which should make the
3442 site-specific (policy) questions easier to answer.
3449 You may give one or more space-separated answers, or "none" if appropriate.
3450 If you have a handcrafted Policy.sh file or a Policy.sh file generated by a
3451 previous run of Configure, you may specify it as well as or instead of
3452 OS-specific hints. If hints are provided for your OS, you should use them:
3453 although Perl can probably be built without hints on many platforms, using
3454 hints often improve performance and may enable features that Configure can't
3455 set up on its own. If there are no hints that match your OS, specify "none";
3456 DO NOT give a wrong version or a wrong OS.
3460 rp="Which of these apply, if any?"
3463 for file in $tans; do
3464 if $test X$file = XPolicy -a -f Policy.sh; then
3466 $cat Policy.sh >> UU/config.sh
3467 elif $test -f $src/hints/$file.sh; then
3468 . $src/hints/$file.sh
3469 $cat $src/hints/$file.sh >> UU/config.sh
3470 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3473 : Give one chance to correct a possible typo.
3474 echo "$file.sh does not exist"
3476 rp="hint to use instead?"
3478 for file in $ans; do
3479 if $test -f "$src/hints/$file.sh"; then
3480 . $src/hints/$file.sh
3481 $cat $src/hints/$file.sh >> UU/config.sh
3482 elif $test X$ans = X -o X$ans = Xnone ; then
3485 echo "$file.sh does not exist -- ignored."
3492 : Remember our hint file for later.
3493 if $test -f "$src/hints/$file.sh" ; then
3503 echo "Fetching default answers from $config_sh..." >&4
3507 cp $config_sh config.sh 2>/dev/null
3517 test "$override" && . ./optdef.sh
3519 : Restore computed paths
3520 for file in $loclist $trylist; do
3521 eval $file="\$_$file"
3526 Configure uses the operating system name and version to set some defaults.
3527 The default value is probably right if the name rings a bell. Otherwise,
3528 since spelling matters for me, either accept the default or answer "none"
3535 ''|' '|none) dflt=none ;;
3536 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3539 *) dflt="$osname" ;;
3541 rp="Operating system name?"
3545 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3551 ''|' '|none) dflt=none ;;
3552 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3553 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3555 ''|' ') dflt=none ;;
3560 *) dflt="$osvers" ;;
3562 rp="Operating system version?"
3572 : who configured the system
3573 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3576 cf_by=`(logname) 2>/dev/null`
3579 cf_by=`(whoami) 2>/dev/null`
3581 "") cf_by=unknown ;;
3586 : decide how portable to be. Allow command line overrides.
3587 case "$d_portable" in
3589 *) d_portable="$define" ;;
3592 : set up shell script to do ~ expansion
3598 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3601 if $test -f /bin/csh; then
3602 /bin/csh -f -c "glob \$1"
3607 name=\`$expr x\$1 : '..\([^/]*\)'\`
3608 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3609 if $test ! -d "\$dir"; then
3611 echo "\$me: can't locate home directory for: \$name" >&2
3616 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3632 : now set up to get a file name
3636 cat <<'EOSC' >>getfile
3652 : getfile will accept an answer from the comma-separated list
3653 : enclosed in parentheses even if it does not meet other criteria.
3654 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3655 fn=`echo $fn | sed 's/(.*)//'`
3661 loc_file=`expr $fn : '.*:\(.*\)'`
3662 fn=`expr $fn : '\(.*\):.*'`
3670 */*) fullpath=true;;
3679 *e*) exp_file=true;;
3682 *p*) nopath_ok=true;;
3687 *d*) type='Directory';;
3688 *l*) type='Locate';;
3693 Locate) what='File';;
3698 case "$d_portable" in
3706 while test "$type"; do
3711 true) rp="$rp (~name ok)";;
3714 if test -f UU/getfile.ok && \
3715 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3734 value=`UU/filexp $ans`
3737 if test "$ans" != "$value"; then
3738 echo "(That expands to $value on this system.)"
3752 /*) value="$ansexp" ;;
3753 [a-zA-Z]:/*) value="$ansexp" ;;
3758 echo "I shall only accept a full path name, as in /bin/ls." >&4
3759 echo "Use a ! shell escape if you wish to check pathnames." >&4
3762 echo "Please give a full path name, starting with slash." >&4
3765 echo "Note that using ~name is ok provided it expands well." >&4
3778 for fp in $gfpth; do
3779 if test "X$fp" = X.; then
3784 if test -f "$pf"; then
3786 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3788 echo "($value is not a plain file, but that's ok.)"
3791 if test X"$type" = X; then
3798 for fp in $gfpth; do
3799 if test "X$fp" = X.; then
3804 direxp="$fp/$ansexp"
3806 if test -d "$direxp"; then
3814 if test -d "$ansexp"; then
3815 echo "(Looking for $loc_file in directory $value.)"
3816 value="$value/$loc_file"
3817 ansexp="$ansexp/$loc_file"
3819 if test -f "$ansexp"; then
3822 case "$nopath_ok" in
3823 true) case "$value" in
3825 *) echo "Assuming $value will be in people's path."
3841 if test "$fastread" = yes; then
3846 rp="$what $value doesn't exist. Use that name anyway?"
3865 test "X$gfpthkeep" != Xy && gfpth=""
3868 : determine root of directory hierarchy where package will be installed.
3871 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
3874 dflt=`echo "$prefix" | sed 's/.$//'`
3882 By default, $package will be installed in $dflt/bin, manual pages
3883 under $dflt/man, etc..., i.e. with $dflt as prefix for all
3884 installation directories. Typically this is something like /usr/local.
3885 If you wish to have binaries under /usr/bin but other parts of the
3886 installation under /usr/local, that's ok: you will be prompted
3887 separately for each of the installation directories, the prefix being
3888 only used to set the defaults.
3892 rp='Installation prefix to use?'
3900 *) oldprefix="$prefix";;
3907 : allow them to override the AFS root
3910 *) afsroot=$afsroot ;;
3916 $define|true) afs=true ;;
3917 $undef|false) afs=false ;;
3918 *) if $test -d $afsroot; then
3926 echo "AFS may be running... I'll be extra cautious then..." >&4
3928 echo "AFS does not seem to be running..." >&4
3931 : determine installation prefix for where package is to be installed.
3935 Since you are running AFS, I need to distinguish the directory in which
3936 files will reside from the directory in which they are installed (and from
3937 which they are presumably copied to the former directory by occult means).
3940 case "$installprefix" in
3941 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
3942 *) dflt="$installprefix";;
3947 In some special cases, particularly when building $package for distribution,
3948 it is convenient to distinguish the directory in which files should be
3949 installed from the directory ($prefix) in which they will
3950 eventually reside. For most users, these two directories are the same.
3953 case "$installprefix" in
3955 *) dflt=$installprefix;;
3959 rp='What installation prefix should I use for installing files?'
3961 installprefix="$ans"
3962 installprefixexp="$ansexp"
3964 : Perform the prefixexp/installprefixexp correction if necessary
3965 cat <<EOS >installprefix
3968 cat <<'EOSC' >>installprefix
3969 : Change installation prefix, if necessary.
3970 if $test X"$prefix" != X"$installprefix"; then
3971 eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`"
3973 eval "install${prefixvar}=\"\$${prefixvar}exp\""
3976 chmod +x installprefix
3977 $eunicefix installprefix
3979 : Set variables such as privlib and privlibexp from the output of ./getfile
3980 : performing the prefixexp/installprefixexp correction if necessary.
3981 cat <<EOS >setprefixvar
3984 cat <<'EOSC' >>setprefixvar
3985 eval "${prefixvar}=\"\$ans\""
3986 eval "${prefixvar}exp=\"\$ansexp\""
3989 chmod +x setprefixvar
3990 $eunicefix setprefixvar
3992 : set up the script used to warn in case of inconsistency
4001 '') echo "The $hint value for \$$var on this machine was \"$was\"!" >&4
4003 *) echo "Hmm. Based on the hints in hints/$hintfile.sh, " >&4
4004 echo "the $hint value for \$$var on this machine was \"$was\"!" >&4
4009 echo "*** WHOA THERE!!! ***" >&4
4010 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
4013 rp=" Keep the $hint value?"
4016 y) td=$was; tu=$was;;
4020 : function used to set '$1' to '$val'
4021 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
4023 $define$undef) . ./whoa; eval "$var=\$td";;
4024 $undef$define) . ./whoa; eval "$var=\$tu";;
4025 *) eval "$var=$val";;
4028 : Check is we will use socks
4030 $define|true|[yY]*) dflt='y';;
4035 Perl can be built to use the SOCKS proxy protocol library. To do so,
4036 Configure must be run with -Dusesocks. If you use SOCKS you also need
4037 to use the PerlIO abstraction layer, this will be implicitly selected.
4039 If this doesn't make any sense to you, just accept the default '$dflt'.
4041 rp='Build Perl for SOCKS?'
4044 y|Y) val="$define" ;;
4051 $define|true|[yY]*) useperlio="$define";;
4054 : Check if we want perlio
4055 case "$useperlio" in
4056 $define|true|[yY]*|'') dflt='y';;
4061 Previous version of $package used the standard IO mechanisms as
4062 defined in <stdio.h>. Versions 5.003_02 and later of $package allow
4063 alternate IO mechanisms via the PerlIO abstraction layer, but the
4064 stdio mechanism is still available if needed. The abstraction layer
4065 can use AT&T's sfio (if you already have sfio installed) or regular stdio.
4066 Using PerlIO with sfio may cause problems with some extension modules.
4068 If this doesn't make any sense to you, just accept the default '$dflt'.
4070 rp='Use the PerlIO abstraction layer?'
4077 echo "Ok, doing things the stdio way."
4086 case "$useperlio" in
4087 $define|true|[yY]*) ;;
4090 You are using the SOCKS proxy protocol library which means that you
4091 should also use the PerlIO layer. You may be headed for trouble.
4099 : get the patchlevel
4101 echo "Getting the current patchlevel..." >&4
4102 if $test -r $rsrc/patchlevel.h;then
4103 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
4104 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
4105 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4106 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
4107 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
4108 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4109 perl_patchlevel=`egrep ',"(MAINT|SMOKE)[0-9][0-9]*"' $rsrc/patchlevel.h|tail -1|sed 's/[^0-9]//g'`
4118 $echo "(You do not have patchlevel.h. Eek.)"
4120 if $test -r $rsrc/.patch ; then
4121 if $test "X$perl_patchlevel" = "X" || $test "`cat $rsrc/.patch`" -gt "$perl_patchlevel" ; then
4122 perl_patchlevel=`cat $rsrc/.patch`
4125 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
4126 version_patchlevel_string="version $patchlevel subversion $subversion"
4127 case "$perl_patchlevel" in
4129 *) version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel" ;;
4132 $echo "(You have $package $version_patchlevel_string.)"
4136 : XXX Should be a Configure test for double-dots in filenames.
4137 version=`echo $revision $patchlevel $subversion | \
4138 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4139 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4140 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4143 version=`echo $revision $patchlevel $subversion | \
4144 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4145 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4146 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4149 : Special case the 5.005_xx maintenance series, which used 5.005
4150 : without any subversion label as a subdirectory in $sitelib
4151 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
4152 api_versionstring='5.005'
4155 : Do we want threads support and if so, what type
4156 case "$usethreads" in
4157 $define|true|[yY]*) dflt='y';;
4158 *) # Catch case where user specified ithreads or 5005threads but
4159 # forgot -Dusethreads (A.D. 4/2002)
4160 case "$useithreads$use5005threads" in
4162 case "$useperlio" in
4163 "$define") dflt='y' ;;
4173 Perl can be built to take advantage of threads on some systems.
4174 To do so, Configure can be run with -Dusethreads.
4176 Note that Perl built with threading support runs slightly slower
4177 and uses more memory than plain Perl. The current implementation
4178 is believed to be stable, but it is fairly new, and so should be
4179 treated with caution.
4181 If this doesn't make any sense to you, just accept the default '$dflt'.
4183 rp='Build a threading Perl?'
4186 y|Y) val="$define" ;;
4192 if $test $patchlevel -lt 9; then
4193 case "$usethreads" in
4197 Since release 5.6, Perl has had two different threading implementations,
4198 the newer interpreter-based version (ithreads) with one interpreter per
4199 thread, and the older 5.005 version (5005threads).
4200 The 5005threads version is effectively unmaintained and will probably be
4201 removed in Perl 5.10, so there should be no need to build a Perl using it
4202 unless needed for backwards compatibility with some existing 5.005threads
4206 : Default to ithreads unless overridden on command line or with
4209 case "$use5005threads" in
4210 $define|true|[yY]*) dflt='n';;
4212 case "$useithreads" in
4213 $undef|false|[nN]*) dflt='n';;
4215 rp='Use the newer interpreter-based ithreads?'
4218 y|Y) val="$define" ;;
4223 : Now set use5005threads to the opposite value.
4224 case "$useithreads" in
4225 $define) val="$undef" ;;
4232 useithreads="$undef"
4233 use5005threads="$undef"
4237 case "$useithreads$use5005threads" in
4241 You cannot have both the ithreads and the 5.005 threads enabled
4242 at the same time. Disabling the 5.005 threads since they are
4243 much less stable than the ithreads.
4246 use5005threads="$undef"
4251 : perl-5.9.x and later
4253 if test X"$usethreads" = "X$define"; then
4254 case "$use5005threads" in
4258 5.005 threads has been removed for 5.10. Perl will be built using ithreads.
4265 use5005threads="$undef"
4266 useithreads="$usethreads"
4269 if test X"$usethreads" = "X$define" -a "X$useperlio" = "Xundef"; then
4272 *** To build with ithreads you must also use the PerlIO layer.
4273 *** Cannot continue, aborting.
4279 case "$d_oldpthreads" in
4280 '') : Configure tests would be welcome here. For now, assume undef.
4282 *) val="$d_oldpthreads" ;;
4288 : Look for a hint-file generated 'call-back-unit'. If the
4289 : user has specified that a threading perl is to be built,
4290 : we may need to set or change some other defaults.
4291 if $test -f usethreads.cbu; then
4292 echo "Your platform has some specific hints regarding threaded builds, using them..."
4295 case "$usethreads" in
4296 "$define"|true|[yY]*)
4298 (Your platform does not have any specific hints for threaded builds.
4299 Assuming POSIX threads, then.)
4305 : Check if multiplicity is required
4308 Perl can be built so that multiple Perl interpreters can coexist
4309 within the same Perl executable.
4312 case "$useithreads" in
4315 This multiple interpreter support is required for interpreter-based threads.
4319 *) case "$usemultiplicity" in
4320 $define|true|[yY]*) dflt='y';;
4324 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
4325 rp='Build Perl for multiplicity?'
4328 y|Y) val="$define" ;;
4336 : Check if morebits is requested
4337 case "$usemorebits" in
4338 "$define"|true|[yY]*)
4339 use64bitint="$define"
4340 uselongdouble="$define"
4341 usemorebits="$define"
4343 *) usemorebits="$undef"
4347 : Determine the C compiler to be used
4353 rp="Use which C compiler?"
4357 : See whether they have no cc but they do have gcc
4359 if $test -f cc.cbu; then
4364 : make some quick guesses about what we are up against
4366 $echo $n "Hmm... $c"
4376 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
4377 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
4379 echo "Looks kind of like an OSF/1 system, but we'll see..."
4381 elif test `echo abc | $tr a-z A-Z` = Abc ; then
4382 xxx=`./loc addbib blurfl $pth`
4383 if $test -f $xxx; then
4384 echo "Looks kind of like a USG system with BSD features, but we'll see..."
4388 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
4389 echo "Looks kind of like an extended USG system, but we'll see..."
4391 echo "Looks kind of like a USG system, but we'll see..."
4395 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
4396 echo "Looks kind of like a BSD system, but we'll see..."
4400 echo "Looks kind of like a Version 7 system, but we'll see..."
4403 case "$eunicefix" in
4406 There is, however, a strange, musty smell in the air that reminds me of
4407 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
4411 : it so happens the Eunice I know will not run shell scripts in Unix format
4415 echo "Congratulations. You aren't running Eunice."
4419 : Detect OS2. The p_ variable is set above in the Head.U unit.
4420 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
4421 : semicolon as a patch separator
4426 I have the feeling something is not exactly right, however...don't tell me...
4427 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
4428 (Or you may be running DOS with DJGPP.)
4433 if test -f /xenix; then
4434 echo "Actually, this looks more like a XENIX system..."
4439 echo "It's not Xenix..."
4444 if test -f /venix; then
4445 echo "Actually, this looks more like a VENIX system..."
4452 echo "Nor is it Venix..."
4455 chmod +x bsd usg v7 osf1 eunice xenix venix os2
4456 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
4459 : Check if we are using GNU gcc and what its version is
4461 echo "Checking for GNU cc in disguise and/or its version number..." >&4
4465 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
4467 printf("%s\n", __VERSION__);
4469 printf("%s\n", "1");
4475 if $cc -o try $ccflags $ldflags try.c; then
4476 gccversion=`$run ./try`
4477 case "$gccversion" in
4478 '') echo "You are not using GNU cc." ;;
4479 *) echo "You are using GNU cc $gccversion."
4485 echo "*** WHOA THERE!!! ***" >&4
4486 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
4487 case "$knowitall" in
4489 echo " You'd better start hunting for one and let me know about it." >&4
4495 case "$gccversion" in
4496 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
4498 case "$gccversion" in
4499 '') gccosandvers='' ;;
4500 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
4501 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
4503 case "$gccosandvers" in
4504 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
4505 $osname$osvers) ;; # looking good
4506 $osname*) cat <<EOM >&4
4508 *** WHOA THERE!!! ***
4510 Your gcc has not been compiled for the exact release of
4511 your operating system ($gccosandvers versus $osname$osvers).
4513 In general it is a good idea to keep gcc synchronized with
4514 the operating system because otherwise serious problems
4515 may ensue when trying to compile software, like Perl.
4517 I'm trying to be optimistic here, though, and will continue.
4518 If later during the configuration and build icky compilation
4519 problems appear (headerfile conflicts being the most common
4520 manifestation), I suggest reinstalling the gcc to match
4521 your operating system release.
4525 *) gccosandvers='' ;; # failed to parse, better be silent
4533 # gcc 3.* complain about adding -Idirectories that they already know about,
4534 # so we will take those off from locincpth.
4535 case "$gccversion" in
4537 echo "main(){}">try.c
4538 for incdir in $locincpth; do
4539 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
4540 grep '^c[cp]p*[01]: warning: changing search order '`
4541 if test "X$warn" != X; then
4542 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
4548 : What should the include directory be ?
4550 $echo $n "Hmm... $c"
4554 if $test -f /bin/mips && /bin/mips; then
4555 echo "Looks like a MIPS system..."
4556 $cat >usr.c <<'EOCP'
4557 #ifdef SYSTYPE_BSD43
4561 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4562 dflt='/bsd43/usr/include'
4566 mips_type='System V'
4568 $rm -f usr.c usr.out
4569 echo "and you're compiling with the $mips_type compiler and libraries."
4573 echo "Doesn't look like a MIPS system."
4583 case "$xxx_prompt" in
4586 rp='Where are the include files you want to use?'
4594 : see how we invoke the C preprocessor
4596 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4597 cat <<'EOT' >testcpp.c
4603 if test ! -f cppstdin; then
4604 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4605 # AIX cc -E doesn't show the absolute headerfile
4606 # locations but we'll cheat by using the -M flag.
4607 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
4609 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4612 echo "Keeping your $hint cppstdin wrapper."
4615 wrapper=`pwd`/cppstdin
4619 if $test "X$cppstdin" != "X" && \
4620 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4621 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4623 echo "You used to use $cppstdin $cppminus so we'll use that again."
4625 '') echo "But let's see if we can live without a wrapper..." ;;
4627 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4628 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4630 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4633 echo "(However, $cpprun $cpplast does not work, let's see...)"
4641 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4648 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4649 $cc -E <testcpp.c >testcpp.out 2>&1; \
4650 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4651 echo "Yup, it does."
4654 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4655 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4656 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4657 echo "Yup, it does."
4660 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4661 $cc -P <testcpp.c >testcpp.out 2>&1; \
4662 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4663 echo "Yipee, that works!"
4666 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4667 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4668 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4669 echo "At long last!"
4672 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4673 $cpp <testcpp.c >testcpp.out 2>&1; \
4674 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4678 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4679 $cpp - <testcpp.c >testcpp.out 2>&1; \
4680 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4681 echo "Hooray, it works! I was beginning to wonder."
4684 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4685 $wrapper <testcpp.c >testcpp.out 2>&1; \
4686 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4692 rp="No dice. I can't find a C preprocessor. Name one:"
4696 $x_cpp <testcpp.c >testcpp.out 2>&1
4697 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4698 echo "OK, that will do." >&4
4700 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4715 echo "Perhaps can we force $cc -E using a wrapper..."
4716 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4717 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4723 echo "Nope, we'll have to live without it..."
4737 "$wrapper"|'cppstdin') ;;
4738 *) $rm -f $wrapper;;
4740 $rm -f testcpp.c testcpp.out
4742 : Set private lib path
4745 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4750 '') dlist="$loclibpth $plibpth $glibpth";;
4751 *) dlist="$libpth";;
4754 : Now check and see which directories actually exist, avoiding duplicates
4758 if $test -d $xxx; then
4761 *) libpth="$libpth $xxx";;
4767 Some systems have incompatible or broken versions of libraries. Among
4768 the directories listed in the question below, please remove any you
4769 know not to be holding relevant libraries, and add any that are needed.
4770 Say "none" for none.
4781 rp="Directories to use for library searches?"
4788 : compute shared library extension
4791 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4801 On some systems, shared libraries may be available. Answer 'none' if
4802 you want to suppress searching of shared libraries for the remainder
4803 of this configuration.
4806 rp='What is the file extension used for shared libraries?'
4810 : Define several unixisms.
4811 : Hints files or command line option can be used to override them.
4812 : The convoluted testing is in case hints files set either the old
4815 '') case "$exe_ext" in
4817 *) _exe="$exe_ext" ;;
4822 '') case "$lib_ext" in
4829 '') case "$obj_ext" in
4836 '') case "$path_sep" in
4847 rm_try="$rm -f try try$_exe a.out .out try.[cho] try.$_o core core.try* try.core*"
4849 : Which makefile gets called first. This is used by make depend.
4850 case "$firstmakefile" in
4851 '') firstmakefile='makefile';;
4854 : Check for uselongdouble support
4856 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
4859 case "$uselongdouble" in
4860 $define|true|[yY]*) dflt='y';;
4865 Perl can be built to take advantage of long doubles which
4866 (if available) may give more accuracy and range for floating point numbers.
4868 If this doesn't make any sense to you, just accept the default '$dflt'.
4870 rp='Try to use long doubles if available?'
4873 y|Y) val="$define" ;;
4879 case "$uselongdouble" in
4880 true|[yY]*) uselongdouble="$define" ;;
4883 : Look for a hint-file generated 'call-back-unit'. If the
4884 : user has specified that long doubles should be used,
4885 : we may need to set or change some other defaults.
4886 if $test -f uselongdouble.cbu; then
4887 echo "Your platform has some specific hints regarding long doubles, using them..."
4888 . ./uselongdouble.cbu
4890 case "$uselongdouble" in
4893 (Your platform does not have any specific hints for long doubles.)
4899 : Looking for optional libraries
4901 echo "Checking for optional libraries..." >&4
4906 case "$libswanted" in
4907 '') libswanted='c_s';;
4910 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
4916 for thisdir in $libpth $xlibpth; do
4917 test -d $thisdir && libspath="$libspath $thisdir"
4919 for thislib in $libswanted; do
4920 for thisdir in $libspath; do
4922 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4923 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
4924 $test -f "$xxx" && eval $libscheck
4925 $test -f "$xxx" && libstyle=shared
4927 if test ! -f "$xxx"; then
4928 xxx=$thisdir/lib$thislib.$so
4929 $test -f "$xxx" && eval $libscheck
4930 $test -f "$xxx" && libstyle=shared
4932 if test ! -f "$xxx"; then
4933 xxx=$thisdir/lib$thislib$_a
4934 $test -f "$xxx" && eval $libscheck
4935 $test -f "$xxx" && libstyle=static
4937 if test ! -f "$xxx"; then
4938 xxx=$thisdir/$thislib$_a
4939 $test -f "$xxx" && eval $libscheck
4940 $test -f "$xxx" && libstyle=static
4942 if test ! -f "$xxx"; then
4943 xxx=$thisdir/lib${thislib}_s$_a
4944 $test -f "$xxx" && eval $libscheck
4945 $test -f "$xxx" && libstyle=static
4946 $test -f "$xxx" && thislib=${thislib}_s
4948 if test ! -f "$xxx"; then
4949 xxx=$thisdir/Slib$thislib$_a
4950 $test -f "$xxx" && eval $libscheck
4951 $test -f "$xxx" && libstyle=static
4953 if $test -f "$xxx"; then
4955 shared) echo "Found -l$thislib (shared)." ;;
4956 static) echo "Found -l$thislib." ;;
4957 *) echo "Found -l$thislib ($libstyle)." ;;
4961 *) dflt="$dflt -l$thislib"
4962 libsfound="$libsfound $xxx"
4964 libsfiles="$libsfiles $yyy"
4965 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
4966 case " $libsdirs " in
4968 *) libsdirs="$libsdirs $yyy" ;;
4975 if $test ! -f "$xxx"; then
4976 echo "No -l$thislib."
4987 ' '|'') dflt='none';;
4992 In order to compile $package on your machine, a number of libraries
4993 are usually needed. Include any other special libraries here as well.
4994 Say "none" for none. The default list is almost always right.
4998 rp="What libraries to use?"
5005 : determine optimization, if desired, or use for debug flag also
5007 ' '|$undef) dflt='none';;
5009 *) dflt="$optimize";;
5013 By default, $package compiles with the -O flag to use the optimizer.
5014 Alternately, you might want to use the symbolic debugger, which uses
5015 the -g flag (on traditional Unix systems). Either flag can be
5016 specified here. To use neither flag, specify the word "none".
5019 rp="What optimizer/debugger flag should be used?"
5023 'none') optimize=" ";;
5026 : Check what DEBUGGING is required from the command line
5027 : -DEBUGGING or -DDEBUGGING or
5028 : -DEBUGGING=both = -g + -DDEBUGGING
5029 : -DEBUGGING=-g or -Doptimize=-g = -g
5030 : -DEBUGGING=none or -UDEBUGGING =
5031 : -DEBUGGING=old or -DEBUGGING=default = ? $optimize
5034 *) DEBUGGING=$EBUGGING ;;
5037 case "$DEBUGGING" in
5041 *) optimize="$optimize -g" ;;
5045 *-g*) set `echo "X $optimize " | sed 's/ -g / /'`
5053 case "$DEBUGGING" in
5054 both|$define) dflt='-DDEBUGGING'
5057 : argument order is deliberate, as the flag will start with - which set could
5058 : think is an option
5059 checkccflag='check=$1; flag=$2; callback=$3;
5061 echo "Checking if your compiler accepts $flag" 2>&1;
5062 echo "int main(void) { return 0; }" > gcctest.c;
5063 if $cc -O2 $flag -o gcctest gcctest.c 2>gcctest.out && ./gcctest; then
5064 echo "Yes, it does." 2>&1;
5065 if $test -s gcctest.out ; then
5066 echo "But your platform does not like it:";
5071 echo "Leaving current flags $ccflags alone." 2>&1
5073 *) dflt="$dflt $flag";
5079 echo "Nope, it does not, but that is ok." 2>&1;
5083 : We will not override a previous value, but we might want to
5084 : augment a hint file
5086 default|recommended)
5087 case "$gccversion" in
5088 1*) dflt="$dflt -fpcc-struct-return" ;;
5090 case "$optimize:$DEBUGGING" in
5091 *-g*:old) dflt="$dflt -DDEBUGGING";;
5093 case "$gccversion" in
5094 2*) if $test -d /etc/conf/kconfig.d &&
5095 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
5097 # Interactive Systems (ISC) POSIX mode.
5102 case "$gccversion" in
5105 ?*) set strict-aliasing -fno-strict-aliasing
5109 # For gcc, adding -pipe speeds up compilations for some, but apparently
5110 # some assemblers can't read from stdin. (It also slows down compilations
5111 # in other cases, but those are apparently rarer these days.) AD 5/2004.
5112 case "$gccversion" in
5118 # on x86_64 (at least) we require an extra library (libssp) in the
5119 # link command line. This library is not named, so I infer that it is
5120 # an implementation detail that may change. Hence the safest approach
5121 # is to add the flag to the flags passed to the compiler at link time,
5122 # as that way the compiler can do the right implementation dependant
5124 case "$gccversion" in
5125 ?*) set stack-protector -fstack-protector
5132 case "$mips_type" in
5133 *BSD*|'') inclwanted="$locincpth $usrinc";;
5134 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
5136 for thisincl in $inclwanted; do
5137 if $test -d $thisincl; then
5138 if $test x$thisincl != x$usrinc; then
5140 *" -I$thisincl "*);;
5141 *) dflt="$dflt -I$thisincl ";;
5147 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
5149 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
5157 *) dflt="$dflt -D$2";;
5161 set signal.h LANGUAGE_C; eval $inctest
5165 ccflags="$ccflags -DSOCKS"
5170 default|recommended) dflt="$ccflags $dflt" ;;
5171 *) dflt="$ccflags";;
5180 Your C compiler may want other flags. For this question you should include
5181 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
5182 but you should NOT include libraries or ld flags like -lwhatever. If you
5183 want $package to honor its debug switch, you should include -DDEBUGGING here.
5184 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
5186 To use no flags, specify the word "none".
5192 rp="Any additional cc flags?"
5199 : the following weeds options from ccflags that are of no interest to cpp
5201 '') cppflags="$ccflags" ;;
5202 *) cppflags="$cppflags $ccflags" ;;
5204 case "$gccversion" in
5205 1*) cppflags="$cppflags -D__GNUC__"
5207 case "$mips_type" in
5209 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
5215 echo "Let me guess what the preprocessor flags are..." >&4
5229 *) ftry="$previous $flag";;
5231 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
5232 >cpp1.out 2>/dev/null && \
5233 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
5234 >cpp2.out 2>/dev/null && \
5235 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
5236 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
5238 cppflags="$cppflags $ftry"
5248 *-*) echo "They appear to be: $cppflags";;
5250 $rm -f cpp.c cpp?.out
5254 : flags used in final linking phase
5256 '') if ./venix; then
5262 *-posix*) dflt="$dflt -posix" ;;
5265 *) dflt="$ldflags";;
5267 # See note above about -fstack-protector
5269 *-fstack-protector*)
5271 *-fstack-protector*) ;; # Don't add it again
5272 *) dflt="$dflt -fstack-protector" ;;
5277 : Try to guess additional flags to pick up local libraries.
5278 for thislibdir in $libpth; do
5279 case " $loclibpth " in
5282 *"-L$thislibdir "*) ;;
5283 *) dflt="$dflt -L$thislibdir" ;;
5295 Your C linker may need flags. For this question you should
5296 include -L/whatever and any other flags used by the C linker, but you
5297 should NOT include libraries like -lwhatever.
5299 Make sure you include the appropriate -L/path flags if your C linker
5300 does not normally search all of the directories you specified above,
5303 To use no flags, specify the word "none".
5307 rp="Any additional ld flags (NOT including libraries)?"
5313 rmlist="$rmlist pdp11"
5317 echo "Checking your choice of C compiler and flags for coherency..." >&4
5318 $cat > try.c <<'EOF'
5320 int main() { printf("Ok\n"); return(0); }
5322 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
5324 $cat >try.msg <<'EOM'
5325 I've tried to compile and run the following simple program:
5328 $cat try.c >> try.msg
5330 $cat >> try.msg <<EOM
5337 and I got the following output:
5341 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5342 if $sh -c "$run ./try " >>try.msg 2>&1; then
5346 *) echo 'The program compiled OK, but produced no output.' >> try.msg
5349 cat >> try.msg <<'EOQS'
5350 If $libs contains -lsfio, and sfio is mis-configured, then it
5351 sometimes (apparently) runs and exits with a 0 status, but with no
5352 output! It may have to do with sfio's use of _exit vs. exit.
5355 rp="You have a big problem. Shall I abort Configure"
5362 echo "The program compiled OK, but exited with status $?." >>try.msg
5363 rp="You have a problem. Shall I abort Configure"
5367 echo "I can't compile the test program." >>try.msg
5368 rp="You have a BIG problem. Shall I abort Configure"
5374 case "$knowitall" in
5376 echo "(The supplied flags or libraries might be incorrect.)"
5384 *) echo "Ok. Stopping Configure." >&4
5389 n) echo "OK, that should do.";;
5391 $rm_try gcctest gcctest.out
5393 : define a shorthand compile call
5397 case "$usedevel" in $define|true|[yY]*) if $test ! -f "${mc_file}.c"; then
5398 echo "Internal Configure script bug - compiler test file ${mc_file}.c is missing. Please report this to perlbug@perl.org" >&4;
5402 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5403 : define a shorthand compile call for compilations that should be ok.
5407 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5409 : determine filename position in cpp output
5411 echo "Computing filename position in cpp output for #include directives..." >&4
5413 vos) testaccess=-e ;;
5416 echo '#include <stdio.h>' > foo.c
5419 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5420 $grep '^[ ]*#.*stdio\.h' | \
5421 while read cline; do
5424 while $test \$# -gt 0; do
5425 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5430 pos=\`expr \$pos + 1\`
5442 *) pos="${fieldn}th";;
5444 echo "Your cpp writes the filename in the $pos field of the line."
5447 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
5448 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
5451 : locate header file
5456 for usrincdir in $usrinc
5458 if test -f \$usrincdir/\$wanted; then
5459 echo "\$usrincdir/\$wanted"
5463 awkprg='{ print \$$fieldn }'
5464 echo "#include <\$wanted>" > foo\$\$.c
5465 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5466 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5467 while read cline; do
5468 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5470 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5471 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5476 # status = 0: grep returned 0 lines, case statement not executed
5477 # status = 1: headerfile found
5478 # status = 2: while loop executed, no headerfile found
5482 if test \$status -eq 1; then
5489 : define an alternate in-header-list? function
5490 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5491 cont=true; xxf="echo \"<\$1> found.\" >&4";
5492 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5493 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5495 case $# in 4) instead=instead;; *) instead="at last";; esac;
5496 while $test "$cont"; do
5498 var=$2; eval "was=\$$2";
5499 if $test "$xxx" && $test -r "$xxx";
5501 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5504 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5505 set $yyy; shift; shift; yyy=$@;
5506 case $# in 0) cont="";;
5507 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5508 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5509 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5510 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5514 do set $yyy; var=$2; eval "was=\$$2";
5515 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5516 set $yyy; shift; shift; yyy=$@;
5519 : see if stdlib is available
5520 set stdlib.h i_stdlib
5523 : check for lengths of integral types
5527 echo "Checking to see how big your integers are..." >&4
5536 printf("intsize=%d;\n", (int)sizeof(int));
5537 printf("longsize=%d;\n", (int)sizeof(long));
5538 printf("shortsize=%d;\n", (int)sizeof(short));
5543 if eval $compile_ok && $run ./try > /dev/null; then
5545 echo "Your integers are $intsize bytes long."
5546 echo "Your long integers are $longsize bytes long."
5547 echo "Your short integers are $shortsize bytes long."
5551 Help! I can't compile and run the intsize test program: please enlighten me!
5552 (This is probably a misconfiguration in your system or libraries, and
5553 you really ought to fix it. Still, I'll try anyway.)
5557 rp="What is the size of an integer (in bytes)?"
5561 rp="What is the size of a long integer (in bytes)?"
5565 rp="What is the size of a short integer (in bytes)?"
5573 : check for long long
5575 echo "Checking to see if you have long long..." >&4
5576 echo 'int main() { long long x = 7; return 0; }' > try.c
5578 if eval $compile; then
5580 echo "You have long long."
5583 echo "You do not have long long."
5589 : check for length of long long
5590 case "${d_longlong}${longlongsize}" in
5593 echo "Checking to see how big your long longs are..." >&4
5594 $cat >try.c <<'EOCP'
5598 printf("%d\n", (int)sizeof(long long));
5603 if eval $compile_ok; then
5604 longlongsize=`$run ./try`
5605 echo "Your long longs are $longlongsize bytes long."
5609 echo "(I can't seem to compile the test program. Guessing...)"
5610 rp="What is the size of a long long (in bytes)?"
5614 if $test "X$longsize" = "X$longlongsize"; then
5615 echo "(That isn't any different from an ordinary long.)"
5621 : see if inttypes.h is available
5622 : we want a real compile instead of Inhdr because some systems
5623 : have an inttypes.h which includes non-existent headers
5626 #include <inttypes.h>
5628 static int32_t foo32 = 0x12345678;
5632 if eval $compile; then
5633 echo "<inttypes.h> found." >&4
5636 echo "<inttypes.h> NOT found." >&4
5645 echo "Checking to see if you have int64_t..." >&4
5647 #include <sys/types.h>
5648 #$i_inttypes I_INTTYPES
5650 #include <inttypes.h>
5652 int main() { int64_t x = 7; }
5655 if eval $compile; then
5657 echo "You have int64_t."
5660 echo "You do not have int64_t."
5666 : Check if 64bit ints have a quad type
5668 echo "Checking which 64-bit integer type we could use..." >&4
5674 val='"unsigned int"'
5679 *) case "$longsize" in
5683 val='"unsigned long"'
5688 *) case "$d_longlong:$longlongsize" in
5693 val='"unsigned long long"'
5698 *) case "$d_int64_t" in
5717 '') echo "Alas, no 64-bit integer types in sight." >&4
5720 *) echo "We could use '$quadtype' for 64-bit integers." >&4
5725 : Do we want 64bit support
5726 case "$uselonglong" in
5727 "$define"|true|[yY]*)
5730 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
5732 use64bitint="$define"
5735 case "$use64bits" in
5736 "$define"|true|[yY]*)
5739 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
5741 use64bitint="$define"
5744 case "$use64bitints" in
5745 "$define"|true|[yY]*)
5748 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
5750 use64bitint="$define"
5753 case "$use64bitsint" in
5754 "$define"|true|[yY]*)
5757 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
5759 use64bitint="$define"
5762 case "$uselonglongs" in
5763 "$define"|true|[yY]*)
5766 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
5768 use64bitint="$define"
5771 case "$use64bitsall" in
5772 "$define"|true|[yY]*)
5775 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
5777 use64bitall="$define"
5782 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
5784 case "$use64bitall" in
5785 "$define"|true|[yY]*) use64bitint="$define" ;;
5791 You have natively 64-bit long integers.
5795 *) case "$use64bitint" in
5796 "$define"|true|[yY]*) dflt='y';;
5805 Perl can be built to take advantage of 64-bit integer types
5806 on some systems. To do so, Configure can be run with -Duse64bitint.
5807 Choosing this option will most probably introduce binary incompatibilities.
5809 If this doesn't make any sense to you, just accept the default '$dflt'.
5810 (The default has been chosen based on your configuration.)
5812 rp='Try to use 64-bit integers, if available?'
5815 [yY]*) val="$define" ;;
5823 case "$use64bitall" in
5824 "$define"|true|[yY]*) dflt='y' ;;
5825 *) case "$longsize" in
5833 You may also choose to try maximal 64-bitness. It means using as much
5834 64-bitness as possible on the platform. This in turn means even more
5835 binary incompatibilities. On the other hand, your platform may not
5836 have any more 64-bitness available than what you already have chosen.
5838 If this doesn't make any sense to you, just accept the default '$dflt'.
5839 (The default has been chosen based on your configuration.)
5841 rp='Try to use maximal 64-bit support, if available?'
5844 [yY]*) val="$define" ;;
5849 case "$use64bitall" in
5851 case "$use64bitint" in
5855 Since you have chosen a maximally 64-bit build, I'm also turning on
5856 the use of 64-bit integers.
5858 use64bitint="$define" ;;
5863 : Look for a hint-file generated 'call-back-unit'. If the
5864 : user has specified that a 64-bit perl is to be built,
5865 : we may need to set or change some other defaults.
5866 if $test -f use64bitint.cbu; then
5867 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
5870 case "$use64bitint" in
5871 "$define"|true|[yY]*)
5873 4) case "$archname64" in
5874 '') archname64=64int ;;
5881 : Look for a hint-file generated 'call-back-unit'. If the
5882 : user has specified that a maximally 64-bit perl is to be built,
5883 : we may need to set or change some other defaults.
5884 if $test -f use64bitall.cbu; then
5885 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
5888 case "$use64bitall" in
5889 "$define"|true|[yY]*)
5891 4) case "$archname64" in
5892 ''|64int) archname64=64all ;;
5899 case "$d_quad:$use64bitint" in
5903 *** You have chosen to use 64-bit integers,
5904 *** but none can be found.
5905 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
5906 *** Cannot continue, aborting.
5913 : check for length of double
5915 case "$doublesize" in
5917 echo "Checking to see how big your double precision numbers are..." >&4
5926 printf("%d\n", (int)sizeof(double));
5931 if eval $compile_ok; then
5932 doublesize=`$run ./try`
5933 echo "Your double is $doublesize bytes long."
5936 echo "(I can't seem to compile the test program. Guessing...)"
5937 rp="What is the size of a double precision number (in bytes)?"
5945 : check for long doubles
5947 echo "Checking to see if you have long double..." >&4
5948 echo 'int main() { long double x = 7.0; }' > try.c
5950 if eval $compile; then
5952 echo "You have long double."
5955 echo "You do not have long double."
5961 : check for length of long double
5962 case "${d_longdbl}${longdblsize}" in
5965 echo "Checking to see how big your long doubles are..." >&4
5966 $cat >try.c <<'EOCP'
5970 printf("%d\n", sizeof(long double));
5975 if eval $compile; then
5976 longdblsize=`$run ./try`
5977 echo "Your long doubles are $longdblsize bytes long."
5981 echo "(I can't seem to compile the test program. Guessing...)" >&4
5982 rp="What is the size of a long double (in bytes)?"
5986 if $test "X$doublesize" = "X$longdblsize"; then
5987 echo "That isn't any different from an ordinary double."
5988 echo "I'll keep your setting anyway, but you may see some"
5989 echo "harmless compilation warnings."
5995 : determine the architecture name
5997 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
5998 tarch=`arch`"-$osname"
5999 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
6000 if uname -m > tmparch 2>&1 ; then
6001 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
6002 -e 's/$/'"-$osname/" tmparch`
6010 case "$myarchname" in
6013 echo "(Your architecture name used to be $myarchname.)"
6017 case "$targetarch" in
6019 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
6024 *) dflt="$archname";;
6026 rp='What is your architecture name'
6029 case "$usethreads" in
6031 echo "Threads selected." >&4
6033 *-thread*) echo "...and architecture name already has -thread." >&4
6035 *) archname="$archname-thread"
6036 echo "...setting architecture name to $archname." >&4
6041 case "$usemultiplicity" in
6043 echo "Multiplicity selected." >&4
6045 *-multi*) echo "...and architecture name already has -multi." >&4
6047 *) archname="$archname-multi"
6048 echo "...setting architecture name to $archname." >&4
6053 case "$use64bitint$use64bitall" in
6055 case "$archname64" in
6057 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
6060 case "$use64bitint" in
6061 "$define") echo "64 bit integers selected." >&4 ;;
6063 case "$use64bitall" in
6064 "$define") echo "Maximal 64 bitness selected." >&4 ;;
6067 *-$archname64*) echo "...and architecture name already has $archname64." >&4
6069 *) archname="$archname-$archname64"
6070 echo "...setting architecture name to $archname." >&4
6076 case "$uselongdouble" in
6078 echo "Long doubles selected." >&4
6079 case "$longdblsize" in
6081 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
6085 *-ld*) echo "...and architecture name already has -ld." >&4
6087 *) archname="$archname-ld"
6088 echo "...setting architecture name to $archname." >&4
6095 case "$useperlio" in
6097 echo "Perlio selected." >&4
6100 echo "Perlio not selected, using stdio." >&4
6102 *-stdio*) echo "...and architecture name already has -stdio." >&4
6104 *) archname="$archname-stdio"
6105 echo "...setting architecture name to $archname." >&4
6110 if $test -f archname.cbu; then
6111 echo "Your platform has some specific hints for architecture name, using them..."
6115 : set the prefixit variable, to compute a suitable default value
6116 prefixit='case "$3" in
6118 case "$oldprefix" in
6119 "") eval "$1=\"\$$2\"";;
6126 ""|" ") eval "$1=\"\$$2\"";;
6132 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
6134 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
6135 /*-$oldprefix/*|\~*-$oldprefix/*)
6136 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
6137 *) eval "$1=\"\$$2\"";;
6141 : determine installation style
6142 : For now, try to deduce it from prefix unless it is already set.
6143 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
6144 case "$installstyle" in
6145 '') case "$prefix" in
6146 *perl*) dflt='lib';;
6147 *) dflt='lib/perl5' ;;
6150 *) dflt="$installstyle" ;;
6152 : Probably not worth prompting for this since we prompt for all
6153 : the directories individually, and the prompt would be too long and
6157 : determine where public executables go
6162 rp='Pathname where the public executables will reside?'
6164 if $test "X$ansexp" != "X$binexp"; then
6168 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
6169 : XXX If this is fixed, also fix the "start perl" hunk below, which relies on
6170 : this via initialinstalllocation
6173 case "$userelocatableinc" in
6174 $define|true|[yY]*) dflt='y' ;;
6179 Would you like to build Perl so that the installation is relocatable, so that
6180 library paths in @INC are determined relative to the path of the perl binary?
6181 This is not advised for system Perl installs, or if you need to run setid
6182 scripts or scripts under taint mode.
6184 If this doesn't make any sense to you, just accept the default '$dflt'.
6186 rp='Use relocatable @INC?'
6189 y|Y) val="$define" ;;
6192 set userelocatableinc
6195 initialinstalllocation="$binexp"
6196 : Default prefix is now "up one level from where the binaries are"
6197 case "$userelocatableinc" in
6203 installprefixexp=".../.."
6207 : determine where private library files go
6208 : Usual default is /usr/local/lib/perl5/$version.
6209 : Also allow things like /opt/perl/lib/$version, since
6210 : /opt/perl/lib/perl5... would be redundant.
6211 : The default "style" setting is made in installstyle.U
6212 case "$installstyle" in
6213 *lib/perl5*) set dflt privlib lib/$package/$version ;;
6214 *) set dflt privlib lib/$version ;;
6219 There are some auxiliary files for $package that need to be put into a
6220 private library directory that is accessible by everyone.
6225 rp='Pathname where the private library files will reside?'
6230 : set the prefixup variable, to restore leading tilda escape
6231 prefixup='case "$prefixexp" in
6233 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
6236 : determine where public architecture dependent libraries go
6239 : privlib default is /usr/local/lib/$package/$version
6240 : archlib default is /usr/local/lib/$package/$version/$archname
6241 : privlib may have an optional trailing /share.
6242 tdflt=`echo $privlib | $sed 's,/share$,,'`
6243 tdflt=$tdflt/$archname
6252 $spackage contains architecture-dependent library files. If you are
6253 sharing libraries in a heterogeneous environment, you might store
6254 these files in a separate location. Otherwise, you can just include
6255 them with the rest of the public library files.
6260 rp='Where do you want to put the public architecture-dependent libraries?'
6264 if $test X"$archlib" = X"$privlib"; then
6270 : see if setuid scripts can be secure
6273 Some kernels have a bug that prevents setuid #! scripts from being
6274 secure. Some sites have disabled setuid #! scripts because of this.
6276 First let's decide if your kernel supports secure setuid #! scripts.
6277 (If setuid #! scripts would be secure but have been disabled anyway,
6278 don't say that they are secure if asked.)
6283 if $test -d /dev/fd; then
6284 echo "#!$ls" >reflect
6285 chmod +x,u+s reflect
6286 ./reflect >flect 2>&1
6287 if $contains "/dev/fd" flect >/dev/null; then
6288 echo "Congratulations, your kernel has secure setuid scripts!" >&4
6292 If you are not sure if they are secure, I can check but I'll need a
6293 username and password different from the one you are using right now.
6294 If you don't have such a username or don't want me to test, simply
6298 rp='Other username to test security of setuid scripts with?'
6303 case "$d_suidsafe" in
6304 '') echo "I'll assume setuid scripts are *not* secure." >&4
6307 echo "Well, the $hint value is *not* secure." >&4
6309 *) echo "Well, the $hint value *is* secure." >&4
6314 $rm -f reflect flect
6315 echo "#!$ls" >reflect
6316 chmod +x,u+s reflect
6319 echo '"su" will (probably) prompt you for '"$ans's password."
6320 su $ans -c './reflect >flect'
6321 if $contains "/dev/fd" flect >/dev/null; then
6322 echo "Okay, it looks like setuid scripts are secure." >&4
6325 echo "I don't think setuid scripts are secure." >&4
6330 rp='Does your kernel have *secure* setuid scripts?'
6333 [yY]*) val="$define";;
6338 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
6339 echo "(That's for file descriptors, not floppy disks.)"
6345 $rm -f reflect flect
6347 : now see if they want to do setuid emulation
6350 case "$d_suidsafe" in
6353 echo "No need to emulate SUID scripts since they are secure here." >&4
6357 Some systems have disabled setuid scripts, especially systems where
6358 setuid scripts cannot be secure. On systems where setuid scripts have
6359 been disabled, the setuid/setgid bits on scripts are currently
6360 useless. It is possible for $package to detect those bits and emulate
6361 setuid/setgid in a secure fashion. This emulation will only work if
6362 setuid scripts have been disabled in your kernel.
6366 "$define") dflt=y ;;
6369 rp="Do you want to do setuid/setgid emulation?"
6372 [yY]*) val="$define";;
6380 : Find perl5.005 or later.
6381 echo "Looking for a previously installed perl5.005 or later... "
6383 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
6384 : Check if this perl is recent and can load a simple module
6385 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6388 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6398 '') echo "None found. That's ok.";;
6399 *) echo "Using $perl5." ;;
6402 : Set the siteprefix variables
6405 After $package is installed, you may wish to install various
6406 add-on modules and utilities. Typically, these add-ons will
6407 be installed under $prefix with the rest
6408 of this package. However, you may wish to install such add-ons
6409 elsewhere under a different prefix.
6411 If you do not wish to put everything under a single prefix, that's
6412 ok. You will be prompted for the individual locations; this siteprefix
6413 is only used to suggest the defaults.
6415 The default should be fine for most people.
6419 rp='Installation prefix to use for add-on modules and utilities?'
6420 : XXX Here might be another good place for an installstyle setting.
6421 case "$siteprefix" in
6423 *) dflt=$siteprefix ;;
6426 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6428 case "$siteprefix" in
6432 *) oldsiteprefix="$prefix";;
6437 siteprefixexp="$ansexp"
6439 : determine where site specific libraries go.
6440 : Usual default is /usr/local/lib/perl5/site_perl/$version
6441 : The default "style" setting is made in installstyle.U
6442 : XXX No longer works with Prefixit stuff.
6443 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6445 '') case "$installstyle" in
6446 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
6447 *) dflt=$siteprefix/lib/site_$prog/$version ;;
6455 The installation process will create a directory for
6456 site-specific extensions and modules. Most users find it convenient
6457 to place all site-specific files in this directory rather than in the
6458 main distribution directory.
6462 rp='Pathname for the site-specific library files?'
6466 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6468 : Determine list of previous versions to include in @INC
6469 $cat > getverlist <<EOPL
6472 \$api_versionstring = "$api_versionstring";
6473 \$version = "$version";
6474 \$stem = "$sitelib_stem";
6475 \$archname = "$archname";
6477 $cat >> getverlist <<'EOPL'
6478 # The list found is store twice for each entry: the original name, and
6479 # the binary broken down version as pack "sss", so sorting is easy and
6480 # unambiguous. This will work for all versions that have a maximum of
6481 # three digit groups, separate by '.'s or '_'s. Names are extended with
6482 # ".0.0" to ensure at least three elements for the pack.
6483 # -- H.Merijn Brand (m)'06 23-10-2006
6485 # Can't have leading @ because metaconfig interprets it as a command!
6486 ;@inc_version_list=();
6487 # XXX Redo to do opendir/readdir?
6490 ;@candidates = map {
6491 [ $_, pack "sss", split m/[._]/, "$_.0.0" ] } glob("5.*");
6497 ($pversion, $aversion, $vsn5005) = map {
6498 pack "sss", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005";
6499 foreach $d (@candidates) {
6500 if ($d->[1] lt $pversion) {
6501 if ($d->[1] ge $aversion) {
6502 unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]);
6504 elsif ($d->[1] ge $vsn5005) {
6505 unshift(@inc_version_list, grep { -d } $d->[0]);
6509 # Skip newer version. I.e. don't look in
6510 # 5.7.0 if we're installing 5.6.1.
6514 if (@inc_version_list) {
6515 print join(' ', @inc_version_list);
6518 # Blank space to preserve value for next Configure run.
6523 case "$inc_version_list" in
6524 '') if test -x "$perl5$exe_ext"; then
6525 dflt=`$perl5 getverlist`
6530 $undef) dflt='none' ;;
6531 *) eval dflt=\"$inc_version_list\" ;;
6534 ''|' ') dflt=none ;;
6541 In order to ease the process of upgrading, this version of perl
6542 can be configured to use modules built and installed with earlier
6543 versions of perl that were installed under $prefix. Specify here
6544 the list of earlier versions that this version of perl should check.
6545 If Configure detected no earlier versions of perl installed under
6546 $prefix, then the list will be empty. Answer 'none' to tell perl
6547 to not search earlier versions.
6549 The default should almost always be sensible, so if you're not sure,
6550 just accept the default.
6553 rp='List of earlier versions to include in @INC?'
6556 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
6557 *) inc_version_list="$ans" ;;
6559 case "$inc_version_list" in
6561 inc_version_list_init='0'
6562 d_inc_version_list="$undef"
6564 *) inc_version_list_init=`echo $inc_version_list |
6565 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
6566 d_inc_version_list="$define"
6571 : see if malloc/malloc.h has to be included
6572 set malloc/malloc.h i_mallocmalloc
6575 : see if this is a malloc.h system
6576 : we want a real compile instead of Inhdr because some systems have a
6577 : malloc.h that just gives a compile error saying to use stdlib.h instead
6582 #$i_mallocmalloc I_MALLOCMALLOC
6583 #ifdef I_MALLOCMALLOC
6584 # include <malloc/malloc.h>
6587 int main () { return 0; }
6590 if eval $compile; then
6591 echo "<malloc.h> found." >&4
6594 echo "<malloc.h> NOT found." >&4
6601 : check for void type
6603 echo "Checking to see how well your C compiler groks the void type..." >&4
6604 case "$voidflags" in
6616 extern void moo(); /* function returning void */
6617 void (*goo)(); /* ptr to func returning void */
6619 void *hue; /* generic ptr */
6632 int main() { sub(); }
6634 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
6635 voidflags=$defvoidused
6636 echo "Good. It appears to support void to the level $package wants.">&4
6637 if $contains warning .out >/dev/null 2>&1; then
6638 echo "However, you might get some warnings that look like this:"
6642 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
6643 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
6644 echo "It supports 1..."
6645 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
6646 echo "It also supports 2..."
6647 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
6649 echo "And it supports 4 but not 8 definitely."
6651 echo "It doesn't support 4..."
6652 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
6654 echo "But it supports 8."
6657 echo "Neither does it support 8."
6661 echo "It does not support 2..."
6662 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
6664 echo "But it supports 4 and 8."
6666 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
6668 echo "And it supports 4 but has not heard about 8."
6670 echo "However it supports 8 but not 4."
6675 echo "There is no support at all for void."
6680 case "$voidflags" in
6683 Support flag bits are:
6684 1: basic void declarations.
6685 2: arrays of pointers to functions returning void.
6686 4: operations between pointers to and addresses of void functions.
6687 8: generic void pointers.
6690 rp="Your void support flags add up to what?"
6697 : check for length of pointer
6701 echo "Checking to see how big your pointers are..." >&4
6702 if test "$voidflags" -gt 7; then
6703 echo '#define VOID_PTR char *' > try.c
6705 echo '#define VOID_PTR void *' > try.c
6715 printf("%d\n", (int)sizeof(VOID_PTR));
6720 if eval $compile_ok; then
6721 ptrsize=`$run ./try`
6722 echo "Your pointers are $ptrsize bytes long."
6725 echo "(I can't seem to compile the test program. Guessing...)" >&4
6726 rp="What is the size of a pointer (in bytes)?"
6733 case "$use64bitall" in
6734 "$define"|true|[yY]*)
6738 *** You have chosen a maximally 64-bit build,
6739 *** but your pointers are only 4 bytes wide.
6740 *** Please rerun Configure without -Duse64bitall.
6745 *** Since you have quads, you could possibly try with -Duse64bitint.
6750 *** Cannot continue, aborting.
6761 : determine whether to use malloc wrapping
6763 case "$usemallocwrap" in
6764 [yY]*|true|$define) dflt='y' ;;
6765 [nN]*|false|$undef) dflt='n' ;;
6766 *) case "$usedevel" in
6767 [yY]*|true|$define) dflt='y' ;;
6772 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
6774 usemallocwrap="$ans"
6777 usemallocwrap="$define" ;;
6779 usemallocwrap="$undef" ;;
6782 : determine which malloc to compile in
6784 case "$usemymalloc" in
6785 [yY]*|true|$define) dflt='y' ;;
6786 [nN]*|false|$undef) dflt='n' ;;
6787 *) case "$ptrsize" in
6793 rp="Do you wish to attempt to use the malloc that comes with $package?"
6799 mallocsrc='malloc.c'
6800 mallocobj="malloc$_o"
6801 d_mymalloc="$define"
6804 : Remove malloc from list of libraries to use
6805 echo "Removing unneeded -lmalloc from library list" >&4
6806 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
6809 echo "libs = $libs" >&4
6821 : compute the return types of malloc and free
6823 $cat >malloc.c <<END
6827 #include <sys/types.h>
6841 case "$malloctype" in
6843 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
6850 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
6854 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
6861 echo "Your system uses $freetype free(), it would seem." >&4
6863 : determine where site specific architecture-dependent libraries go.
6864 : sitelib default is /usr/local/lib/perl5/site_perl/$version
6865 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6866 : sitelib may have an optional trailing /share.
6868 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
6869 dflt="$dflt/$archname"
6874 set sitearch sitearch none
6878 The installation process will also create a directory for
6879 architecture-dependent site-specific extensions and modules.
6883 rp='Pathname for the site-specific architecture-dependent library files?'
6887 if $test X"$sitearch" = X"$sitelib"; then
6890 d_sitearch="$define"
6893 : Set the vendorprefix variables
6896 The installation process will also create a directory for
6897 vendor-supplied add-ons. Vendors who supply perl with their system
6898 may find it convenient to place all vendor-supplied files in this
6899 directory rather than in the main distribution directory. This will
6900 ease upgrades between binary-compatible maintenance versions of perl.
6902 Of course you may also use these directories in whatever way you see
6903 fit. For example, you might use them to access modules shared over a
6904 company-wide network.
6906 The default answer should be fine for most people.
6907 This causes further questions about vendor add-ons to be skipped
6908 and no vendor-specific directories will be configured for perl.
6911 rp='Do you want to configure vendor-specific add-on directories?'
6912 case "$usevendorprefix" in
6913 define|true|[yY]*) dflt=y ;;
6914 *) : User may have set vendorprefix directly on Configure command line.
6915 case "$vendorprefix" in
6924 rp='Installation prefix to use for vendor-supplied add-ons?'
6925 case "$vendorprefix" in
6927 *) dflt=$vendorprefix ;;
6930 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6932 case "$vendorprefix" in
6936 *) oldvendorprefix="$prefix";;
6940 usevendorprefix="$define"
6942 vendorprefixexp="$ansexp"
6944 *) usevendorprefix="$undef"
6950 : Set the vendorlib variables
6951 case "$vendorprefix" in
6952 '') d_vendorlib="$undef"
6956 *) d_vendorlib="$define"
6957 : determine where vendor-supplied modules go.
6958 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
6959 case "$vendorlib" in
6961 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6962 case "$installstyle" in
6963 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
6964 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
6967 *) dflt="$vendorlib"
6971 rp='Pathname for the vendor-supplied library files?'
6974 vendorlibexp="$ansexp"
6977 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
6981 : Set the vendorarch variables
6982 case "$vendorprefix" in
6983 '') d_vendorarch="$undef"
6987 *) d_vendorarch="$define"
6988 : determine where vendor-supplied architecture-dependent libraries go.
6989 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
6990 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
6991 : vendorlib may have an optional trailing /share.
6992 case "$vendorarch" in
6993 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
6994 dflt="$dflt/$archname"
6996 *) dflt="$vendorarch" ;;
6999 rp='Pathname for vendor-supplied architecture-dependent files?'
7002 vendorarchexp="$ansexp"
7005 prefixvar=vendorarch
7008 : Final catch-all directories to search
7011 Lastly, you can have perl look in other directories for extensions and
7012 modules in addition to those already specified.
7013 These directories will be searched after
7017 test X"$vendorlib" != "X" && echo ' ' $vendorlib
7018 test X"$vendorarch" != "X" && echo ' ' $vendorarch
7020 case "$otherlibdirs" in
7021 ''|' ') dflt='none' ;;
7022 *) dflt="$otherlibdirs" ;;
7025 Enter a colon-separated set of extra paths to include in perl's @INC
7026 search path, or enter 'none' for no extra paths.
7030 rp='Colon-separated list of additional directories for perl to search?'
7033 ' '|''|none) otherlibdirs=' ' ;;
7034 *) otherlibdirs="$ans" ;;
7036 case "$otherlibdirs" in
7040 set d_perl_otherlibdirs
7043 : Cruising for prototypes
7045 echo "Checking out function prototypes..." >&4
7046 $cat >prototype.c <<EOCP
7051 int main(int argc, char *argv[]) {
7054 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
7055 echo "Your C compiler appears to support function prototypes."
7058 echo "Your C compiler doesn't seem to understand function prototypes."
7065 : Check if ansi2knr is required
7066 case "$prototype" in
7068 *) ansi2knr='ansi2knr'
7073 This version of $package can only be compiled by a compiler that
7074 understands function prototypes. Unfortunately, your C compiler
7076 doesn't seem to understand them. Sorry about that.
7078 If GNU cc is available for your system, perhaps you could try that instead.
7080 Eventually, we hope to support building Perl with pre-ANSI compilers.
7081 If you would like to help in that effort, please contact <perlbug@perl.org>.
7083 Aborting Configure now.
7090 dflt_dtrace='/usr/sbin/dtrace'
7093 Perl can be built to support DTrace on platforms that support it.
7094 DTrace is a diagnosis and performance analysis tool from Sun.
7096 If this doesn't make any sense to you, just accept the default '$dflt'.
7100 case "$usedtrace" in
7106 dflt_dtrace=$usedtrace
7113 rp='Support DTrace if available?'
7116 y|Y) val="$define" ;;
7122 test "X$usedtrace" != "X$define" && break
7125 rp='Where is the dtrace executable?'
7134 if $dtrace -h -s ../perldtrace.d \
7135 -o perldtrace.tmp >/dev/null 2>&1 \
7136 && rm -f perldtrace.tmp
7139 echo "Good: your $dtrace knows about the -h flag."
7143 *** $me: Fatal Error: $dtrace doesn't support -h flag
7145 *** Your installed dtrace doesn't support the -h switch to compile a D
7146 *** program into a C header. Can't continue.
7158 *** $me: Fatal Error: $dtrace not found.
7165 echo "*** $dtrace was not found."
7171 : See if we want extra modules installed
7178 Perl can be built with extra modules or bundles of modules which
7179 will be fetched from the CPAN and installed alongside Perl.
7181 Notice that you will need access to the CPAN; either via the Internet,
7182 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
7183 be asked later to configure the CPAN.pm module which will in turn do
7184 the installation of the rest of the extra modules or bundles.)
7186 Notice also that if the modules require any external software such as
7187 libraries and headers (the libz library and the zlib.h header for the
7188 Compress::Zlib module, for example) you MUST have any such software
7189 already installed, this configuration process will NOT install such
7192 If this doesn't make any sense to you, just accept the default '$dflt'.
7194 rp='Install any extra modules (y or n)?'
7200 Please list any extra modules or bundles to be installed from CPAN,
7201 with spaces between the names. The names can be in any format the
7202 'install' command of CPAN.pm will understand. (Answer 'none',
7203 without the quotes, to install no extra modules or bundles.)
7213 $rm -f ../extras.lst
7215 *) echo "(Saving the list of extras for later...)"
7216 echo "$extras" > ../extras.lst
7224 : determine where html pages for programs go
7225 set html1dir html1dir none
7229 If you wish to install html files for programs in $spackage, indicate
7230 the appropriate directory here. To skip installing html files,
7234 ''|none|$undef|' ') dflt=none ;;
7235 *) dflt=$html1dir ;;
7238 rp="Directory for the main $spackage html pages?"
7242 : Use ' ' for none so value is preserved next time through Configure
7243 $test X"$html1dir" = "X" && html1dir=' '
7245 : determine where html pages for libraries and modules go
7246 set html3dir html3dir none
7250 If you wish to install html files for modules associated with $spackage,
7251 indicate the appropriate directory here. To skip installing html files,
7254 : There is no obvious default. If they have specified html1dir, then
7255 : try to key off that, possibly changing .../html1 into .../html3.
7257 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
7258 *) dflt=$html3dir ;;
7261 rp="Directory for the $spackage module html pages?"
7265 : Use ' ' for none so value is preserved next time through Configure
7266 $test X"$html3dir" = "X" && html3dir=' '
7268 : determine whether to install perl also as /usr/bin/perl
7271 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
7273 Many scripts expect perl to be installed as /usr/bin/perl.
7275 If you want to, I can install the perl you are about to compile
7276 as /usr/bin/perl (in addition to $bin/perl).
7278 if test -f /usr/bin/perl; then
7281 However, please note that because you already have a /usr/bin/perl,
7282 overwriting that with a new Perl would very probably cause problems.
7283 Therefore I'm assuming you don't want to do that (unless you insist).
7286 case "$installusrbinperl" in
7287 "$define"|[yY]*) dflt='y';;
7293 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
7296 case "$installusrbinperl" in
7297 "$undef"|[nN]*) dflt='n';;
7301 rp="Do you want to install perl as /usr/bin/perl?"
7304 [yY]*) val="$define";;
7310 set installusrbinperl
7313 : Check if we are using the GNU C library
7315 echo "Checking for GNU C Library..." >&4
7317 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
7318 alone are insufficient to distinguish different versions, such as
7319 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
7320 libc version 2.1.0. A. Dougherty, June 3, 2002.
7326 # ifdef __GLIBC_MINOR__
7327 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus)
7328 # include <gnu/libc-version.h>
7329 printf("%s\n", gnu_get_libc_version());
7331 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
7334 printf("%d\n", __GLIBC__);
7343 if eval $compile_ok && $run ./try > glibc.ver; then
7345 gnulibc_version=`$cat glibc.ver`
7346 echo "You are using the GNU C Library version $gnulibc_version"
7350 echo "You are not using the GNU C Library"
7356 : see if nm is to be used to determine whether a symbol is defined or not
7360 case "$d_gnulibc" in
7363 echo "nm probably won't work on the GNU C Library." >&4
7369 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
7371 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
7372 echo "'nm' won't be sufficient on this sytem." >&4
7378 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
7379 if $test $dflt -gt 20; then
7389 true|$define) dflt=y;;
7396 I can use $nm to extract the symbols from your C libraries. This
7397 is a time consuming task which may generate huge output on the disk (up
7398 to 3 megabytes) but that should make the symbols extraction faster. The
7399 alternative is to skip the 'nm' extraction part and to compile a small
7400 test program instead to determine whether each symbol is present. If
7401 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
7402 this may be the best solution.
7404 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
7407 rp="Shall I use $nm to extract C symbols from the libraries?"
7410 [Nn]*) usenm=false;;
7419 : nm options which may be necessary
7421 '') if $test -f /mach_boot; then
7423 elif $test -d /usr/ccs/lib; then
7424 nm_opt='-p' # Solaris (and SunOS?)
7425 elif $test -f /dgux; then
7427 elif $test -f /lib64/rld; then
7428 nm_opt='-p' # 64-bit Irix
7434 : nm options which may be necessary for shared libraries but illegal
7435 : for archive libraries. Thank you, Linux.
7436 case "$nm_so_opt" in
7437 '') case "$myuname" in
7439 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
7440 nm_so_opt='--dynamic'
7447 : Figure out where the libc is located
7450 : get list of predefined functions in a handy place
7455 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
7461 *) for thislib in $libs; do
7464 : Handle C library specially below.
7467 thislib=`echo $thislib | $sed -e 's/^-l//'`
7468 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
7470 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
7472 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
7474 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
7476 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
7478 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
7480 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
7485 libnames="$libnames $try"
7487 *) libnames="$libnames $thislib" ;;
7496 for xxx in $libpth; do
7497 $test -r $1 || set $xxx/libc.$so
7498 : The messy sed command sorts on library version numbers.
7500 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
7501 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
7503 s/[0-9][0-9]*/0000&/g
7504 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
7507 $sort | $sed -e 's/^.* //'`
7510 $test -r $1 || set /usr/ccs/lib/libc.$so
7511 $test -r $1 || set /lib/libsys_s$_a
7517 if $test -r "$1"; then
7518 echo "Your (shared) C library seems to be in $1."
7520 elif $test -r /lib/libc && $test -r /lib/clib; then
7521 echo "Your C library seems to be in both /lib/clib and /lib/libc."
7523 libc='/lib/clib /lib/libc'
7524 if $test -r /lib/syslib; then
7525 echo "(Your math library is in /lib/syslib.)"
7526 libc="$libc /lib/syslib"
7528 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7529 echo "Your C library seems to be in $libc, as you said before."
7530 elif $test -r $incpath/usr/lib/libc$_a; then
7531 libc=$incpath/usr/lib/libc$_a;
7532 echo "Your C library seems to be in $libc. That's fine."
7533 elif $test -r /lib/libc$_a; then
7535 echo "Your C library seems to be in $libc. You're normal."
7537 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
7539 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
7540 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
7541 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
7543 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7545 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7548 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
7550 if $test -r "$tans"; then
7551 echo "Your C library seems to be in $tans, of all places."
7557 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7561 If the guess above is wrong (which it might be if you're using a strange
7562 compiler, or your machine supports multiple models), you can override it here.
7567 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
7569 I can't seem to find your C library. I've looked in the following places:
7572 $sed 's/^/ /' libpath
7575 None of these seems to contain your C library. I need to get its name...
7580 rp='Where is your C library?'
7585 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
7586 set X `cat libnames`
7589 case $# in 1) xxx=file; esac
7590 echo "Extracting names from the following $xxx for later perusal:" >&4
7592 $sed 's/^/ /' libnames >&4
7594 $echo $n "This may take a while...$c" >&4
7598 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
7599 *) $nm $nm_opt $file 2>/dev/null;;
7604 $grep fprintf libc.tmp > libc.ptf
7605 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
7606 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
7608 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
7610 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7612 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
7614 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7616 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
7618 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7620 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
7622 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7624 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
7626 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7628 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
7630 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7632 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
7633 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
7635 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7637 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
7639 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7641 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
7643 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7645 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
7647 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7649 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
7651 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7653 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
7655 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7657 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
7659 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7661 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
7663 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7666 $nm -p $* 2>/dev/null >libc.tmp
7667 $grep fprintf libc.tmp > libc.ptf
7668 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
7669 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
7675 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
7677 if $ar t $libc > libc.tmp && \
7678 $contains '^fprintf$' libc.tmp >/dev/null 2>&1
7680 for thisname in $libnames $libc; do
7681 $ar t $thisname >>libc.tmp
7683 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
7685 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
7686 for thisname in $libnames $libc; do
7687 $ar tv $thisname >>libc.tmp
7688 emximp -o tmp.imp $thisname \
7690 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
7691 < tmp.imp >>libc.tmp
7694 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
7697 echo "$ar didn't seem to work right." >&4
7698 echo "Maybe this is a Cray...trying bld instead..." >&4
7700 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list &&
7703 for thisname in $libnames; do
7705 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
7706 $ar t $thisname >>libc.tmp
7710 echo "That didn't work either. Giving up." >&4
7720 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
7721 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
7723 *) if $test -f /lib/syscalls.exp; then
7725 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
7726 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' \
7727 /lib/syscalls.exp >>libc.list
7733 $rm -f libnames libpath
7735 : see if dld is available
7739 : Check if we are using C++
7741 echo "Checking for C++..." >&4
7742 $cat >try.c <<'EOCP'
7754 if eval $compile_ok && $run ./try; then
7756 echo "You are using a C++ compiler."
7759 echo "You are not using a C++ compiler."
7765 : is a C symbol defined?
7768 -v) tf=libc.tmp; tdc="";;
7769 -a) tf=libc.tmp; tdc="[]";;
7770 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
7773 case "$reuseval-$4" in
7775 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
7780 case "$d_cplusplus" in
7781 $define) extern_C=\"C\";;
7783 if $test "$runnm" = true; then
7784 if $contains $tlook $tf >/dev/null 2>&1; then
7786 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
7787 echo "extern $extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7788 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
7789 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
7793 echo "extern $extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7794 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
7800 $define) tval=true;;
7807 : define an is-in-libc? function
7808 inlibc='echo " "; td=$define; tu=$undef;
7809 sym=$1; var=$2; eval "was=\$$2";
7811 case "$reuseval$was" in
7821 echo "$sym() found." >&4;
7822 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
7824 echo "$sym() NOT found." >&4;
7825 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
7829 $define) echo "$sym() found." >&4;;
7830 *) echo "$sym() NOT found." >&4;;
7834 : see if dlopen exists
7836 xxx_ccflags="$ccflags"
7838 : with g++ one needs -shared to get is-in-libc to work for dlopen
7839 case "$gccversion" in
7841 *) case "$d_cplusplus" in
7842 "$define") ccflags="$ccflags -shared" ;;
7849 ccflags="$xxx_ccflags"
7851 : see if this is a unistd.h system
7852 set unistd.h i_unistd
7855 : determine which dynamic loading, if any, to compile in
7857 dldir="ext/DynaLoader"
7870 $define) dflt='y' ;;
7873 $define) dflt='y' ;;
7875 : Does a dl_xxx.xs file exist for this operating system
7876 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
7879 rp="Do you wish to use dynamic loading?"
7886 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
7887 dflt="$dldir/dl_${osname}.xs"
7888 elif $test "$d_dlopen" = "$define" ; then
7889 dflt="$dldir/dl_dlopen.xs"
7890 elif $test "$i_dld" = "$define" ; then
7891 dflt="$dldir/dl_dld.xs"
7896 *) dflt="$dldir/$dlsrc"
7899 echo "The following dynamic loading files are available:"
7900 : Can not go over to $dldir because getfile has path hard-coded in.
7901 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
7902 rp="Source file to use for dynamic loading"
7908 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
7912 Some systems may require passing special flags to $cc -c to
7913 compile modules that will be used to create a shared library.
7914 To use no flags, say "none".
7917 case "$cccdlflags" in
7918 '') case "$gccversion" in
7919 '') case "$osname" in
7921 next) dflt='none' ;;
7922 irix*) dflt='-KPIC' ;;
7923 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
7924 sunos) dflt='-pic' ;;
7928 *) case "$osname" in
7929 darwin) dflt='none' ;;
7930 linux*|svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
7935 *) dflt="$cccdlflags" ;;
7937 rp="Any special flags to pass to $cc -c to compile shared library modules?"
7940 none) cccdlflags=' ' ;;
7941 *) cccdlflags="$ans" ;;
7946 Some systems use ld to create libraries that can be dynamically loaded,
7947 while other systems (such as those using ELF) use $cc.
7951 '') $cat >try.c <<EOM
7952 /* Test for whether ELF binaries are produced */
7964 int i = open("a.out",O_RDONLY);
7967 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
7968 exit(0); /* succeed (yes, it's ELF) */
7973 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
7975 You appear to have ELF support. I'll use $cc to build dynamic libraries.
7979 echo "I'll use ld to build dynamic libraries."
7988 rp="What command should be used to create dynamic libraries?"
7994 Some systems may require passing special flags to $ld to create a
7995 library that can be dynamically loaded. If your ld flags include
7996 -L/other/path options to locate libraries outside your loader's normal
7997 search path, you may need to specify those -L options here as well. To
7998 use no flags, say "none".
8001 case "$lddlflags" in
8002 '') case "$osname" in
8003 beos) dflt='-nostart' ;;
8005 case "$gccversion" in
8006 '') dflt="$dflt +vnocompatwarnings" ;;
8009 linux|irix*|gnu*) dflt="-shared $optimize" ;;
8010 next) dflt='none' ;;
8011 solaris) dflt='-G' ;;
8012 sunos) dflt='-assert nodefinitions' ;;
8013 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
8017 *) dflt="$lddlflags" ;;
8020 : Try to guess additional flags to pick up local libraries.
8021 : Be careful not to append to a plain 'none'
8025 for thisflag in $ldflags; do
8030 *) dflt="$dflt $thisflag" ;;
8037 ''|' ') dflt='none' ;;
8041 *-fstack-protector*)
8043 *-fstack-protector*) ;; # Don't add it again
8044 *) dflt="$dflt -fstack-protector" ;;
8050 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
8053 none) lddlflags=' ' ;;
8054 *) lddlflags="$ans" ;;
8059 Some systems may require passing special flags to $cc to indicate that
8060 the resulting executable will use dynamic linking. To use no flags,
8064 case "$ccdlflags" in
8065 '') case "$osname" in
8066 linux|hpux|gnu*) dflt='-Wl,-E' ;;
8067 next|sunos) dflt='none' ;;
8071 *) dflt="$ccdlflags" ;;
8073 rp="Any special flags to pass to $cc to use dynamic linking?"
8076 none) ccdlflags=' ' ;;
8077 *) ccdlflags="$ans" ;;
8088 : Do we want a shared libperl?
8092 # No dynamic loading being used, so don't bother even to prompt.
8095 *) case "$useshrplib" in
8096 '') case "$osname" in
8097 svr4*|nonstopux|dgux|dynixptx|esix|powerux|beos|cygwin*)
8099 also='Building a shared libperl is required for dynamic loading to work on your system.'
8104 also='Building a shared libperl is needed for MAB support.'
8122 The perl executable is normally obtained by linking perlmain.c with
8123 libperl${_a}, any static extensions (usually just DynaLoader), and
8124 any other libraries needed on this system (such as -lm, etc.). Since
8125 your system supports dynamic loading, it is probably possible to build
8126 a shared libperl.$so. If you will have more than one executable linked
8127 to libperl.$so, this will significantly reduce the size of each
8128 executable, but it may have a noticeable effect on performance. The
8129 default is probably sensible for your system.
8133 rp="Build a shared libperl.$so (y/n)"
8137 useshrplib='true' ;;
8138 *) useshrplib='false' ;;
8143 case "$useshrplib" in
8147 # Figure out a good name for libperl.so. Since it gets stored in
8148 # a version-specific architecture-dependent library, the version
8149 # number isn't really that important, except for making cc/ld happy.
8151 # A name such as libperl.so.3.1
8152 majmin="libperl.$so.$patchlevel.$subversion"
8153 # A name such as libperl.so.301
8154 majonly=`echo $patchlevel $subversion |
8155 $awk '{printf "%d%02d", $1, $2}'`
8156 majonly=libperl.$so.$majonly
8157 # I'd prefer to keep the os-specific stuff here to a minimum, and
8158 # rely on figuring it out from the naming of libc.
8159 case "${osname}${osvers}" in
8162 # XXX How handle the --version stuff for MAB?
8164 linux*|gnu*) # ld won't link with a bare -lperl otherwise.
8167 cygwin*) # ld links against an importlib
8168 dflt=libperl$lib_ext
8170 *) # Try to guess based on whether libc has major.minor.
8172 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
8173 *libc.$so.[0-9]*) dflt=$majonly ;;
8174 *) dflt=libperl.$so ;;
8184 I need to select a good name for the shared libperl. If your system uses
8185 library names with major and minor numbers, then you might want something
8186 like $majmin. Alternatively, if your system uses a single version
8187 number for shared libraries, then you might want to use $majonly.
8188 Or, your system might be quite happy with a simple libperl.$so.
8190 Since the shared libperl will get installed into a version-specific
8191 architecture-dependent directory, the version number of the shared perl
8192 library probably isn't important, so the default should be o.k.
8195 rp='What name do you want to give to the shared libperl?'
8198 echo "Ok, I'll use $libperl"
8201 libperl="libperl${_a}"
8205 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
8209 WARNING: Use of the shrpdir variable for the installation location of
8210 the shared $libperl is not supported. It was never documented and
8211 will not work in this version. Let me (perlbug@perl.org)
8212 know of any problems this may cause.
8218 But your current setting of $shrpdir is
8219 the default anyway, so it's harmless.
8224 Further, your current attempted setting of $shrpdir
8225 conflicts with the value of $archlibexp/CORE
8226 that installperl will use.
8233 # How will the perl executable find the installed shared $libperl?
8234 # Add $xxx to ccdlflags.
8235 # If we can't figure out a command-line option, use $shrpenv to
8236 # set env LD_RUN_PATH. The main perl makefile uses this.
8237 shrpdir=$archlibexp/CORE
8240 if "$useshrplib"; then
8243 # We'll set it in Makefile.SH...
8248 freebsd|netbsd|openbsd|interix|dragonfly)
8249 xxx="-Wl,-R$shrpdir"
8251 bsdos|linux|irix*|dec_osf|gnu*)
8252 xxx="-Wl,-rpath,$shrpdir"
8255 # next doesn't like the default...
8258 # beos doesn't like the default, either.
8261 # hpux doesn't like the default, either.
8262 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
8265 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
8271 # Only add $xxx if it isn't already in ccdlflags.
8272 case " $ccdlflags " in
8274 *) ccdlflags="$ccdlflags $xxx"
8277 Adding $xxx to the flags
8278 passed to $ld so that the perl executable will find the
8279 installed shared $libperl.
8287 # Fix ccdlflags in AIX for building external extensions.
8288 # (For building Perl itself bare -bE:perl.exp is needed,
8289 # Makefile.SH takes care of this.)
8291 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8293 # Respect a hint or command-line value.
8295 '') shrpenv="$tmp_shrpenv" ;;
8297 case "$ldlibpthname" in
8298 '') ldlibpthname=LD_LIBRARY_PATH ;;
8299 none) ldlibpthname='' ;;
8302 : determine where manual pages are on this system
8306 syspath='/usr/share/man/man1 /usr/man/man1'
8307 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8308 syspath="$syspath /usr/man/u_man/man1"
8309 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8310 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8311 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8312 sysman=`./loc . /usr/man/man1 $syspath`
8315 if $test -d "$sysman"; then
8316 echo "System manual is in $sysman." >&4
8318 echo "Could not find manual pages in source form." >&4
8321 : determine where manual pages go
8322 set man1dir man1dir none
8326 $spackage has manual pages available in source form.
8330 echo "However, you don't have nroff, so they're probably useless to you."
8332 '') man1dir="none";;
8335 echo "If you don't want the manual sources installed, answer 'none'."
8340 lookpath="$prefixexp/share/man/man1"
8341 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8342 lookpath="$lookpath $prefixexp/man/p_man/man1"
8343 lookpath="$lookpath $prefixexp/man/u_man/man1"
8344 lookpath="$lookpath $prefixexp/man/man.1"
8346 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8347 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8357 rp="Where do the main $spackage manual pages (source) go?"
8359 if $test "X$man1direxp" != "X$ansexp"; then
8370 : What suffix to use on installed man pages
8377 rp="What suffix should be used for the main $spackage man pages?"
8379 '') case "$man1dir" in
8393 *) dflt="$man1ext";;
8400 : see if we can have long filenames
8402 first=123456789abcdef
8404 if (echo hi >$first) 2>/dev/null; then
8405 if $test -f 123456789abcde; then
8406 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8409 echo 'You can have filenames longer than 14 characters.'>&4
8414 You can't have filenames longer than 14 chars.
8415 You can't even think about them!
8421 $rm -rf 123456789abcde*
8423 : determine where library module manual pages go
8424 set man3dir man3dir none
8428 $spackage has manual pages for many of the library modules.
8434 However, you don't have nroff, so they're probably useless to you.
8437 '') man3dir="none";;
8441 case "$d_flexfnam" in
8444 However, your system can't handle the long file names like File::Basename.3.
8447 '') man3dir="none";;
8451 echo "If you don't want the manual sources installed, answer 'none'."
8452 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8454 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
8455 if $test -d "$privlib/man/man3"; then
8458 WARNING: Previous versions of perl installed man3 pages into
8459 $privlib/man/man3. This version will suggest a
8460 new default of $dflt.
8464 rp='Do you wish to preserve the old behavior?(y/n)'
8467 y*) dflt="$privlib/man/man3" ;;
8472 *) dflt="$man3dir" ;;
8479 rp="Where do the $package library man pages (source) go?"
8489 : What suffix to use on installed man pages
8495 rp="What suffix should be used for the $package library man pages?"
8497 '') case "$man3dir" in
8511 *) dflt="$man3ext";;
8518 : see if we have to deal with yellow pages, now NIS.
8519 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
8520 if $test -f /usr/etc/nibindd; then
8522 echo "I'm fairly confident you're on a NeXT."
8524 rp='Do you get the hosts file via NetInfo?'
8533 y*) hostcat='nidump hosts .';;
8534 *) case "$hostcat" in
8535 nidump*) hostcat='';;
8545 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
8553 rp='Are you getting the hosts file via yellow pages?'
8556 y*) hostcat='ypcat hosts';;
8557 *) hostcat='cat /etc/hosts';;
8563 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
8566 '') test -f /etc/group && groupcat='cat /etc/group';;
8569 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
8572 : now get the host name
8574 echo "Figuring out host name..." >&4
8575 case "$myhostname" in
8577 echo 'Maybe "hostname" will work...'
8578 if tans=`sh -c hostname 2>&1` ; then
8586 if $test "$cont"; then
8588 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
8589 if tans=`cat /etc/systemid 2>&1` ; then
8591 phostname='cat /etc/systemid'
8592 echo "Whadyaknow. Xenix always was a bit strange..."
8595 elif $test -r /etc/systemid; then
8596 echo "(What is a non-Xenix system doing with /etc/systemid?)"
8599 if $test "$cont"; then
8600 echo 'No, maybe "uuname -l" will work...'
8601 if tans=`sh -c 'uuname -l' 2>&1` ; then
8603 phostname='uuname -l'
8605 echo 'Strange. Maybe "uname -n" will work...'
8606 if tans=`sh -c 'uname -n' 2>&1` ; then
8608 phostname='uname -n'
8610 echo 'Oh well, maybe I can mine it out of whoami.h...'
8611 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
8612 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
8613 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
8615 case "$myhostname" in
8616 '') echo "Does this machine have an identity crisis or something?"
8619 echo "Well, you said $myhostname before..."
8620 phostname='echo $myhostname';;
8626 case "$myhostname" in
8627 '') myhostname=noname ;;
8629 : you do not want to know about this
8634 if $test "$myhostname" ; then
8636 rp='Your host name appears to be "'$myhostname'".'" Right?"
8644 : bad guess or no guess
8645 while $test "X$myhostname" = X ; do
8647 rp="Please type the (one word) name of your host:"
8652 : translate upper to lower if necessary
8653 case "$myhostname" in
8655 echo "(Normalizing case in your host name)"
8656 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
8660 case "$myhostname" in
8662 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
8663 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
8664 echo "(Trimming domain name from host name--host name is now $myhostname)"
8666 *) case "$mydomain" in
8669 test "X$hostcat" = "Xypcat hosts" &&
8670 ypmatch "$myhostname" hosts 2>/dev/null |\
8671 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
8674 test "X$hostcat" != "X" &&
8675 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
8676 /[ ]$myhostname[ . ]/p" > hosts
8679 if $test -f hosts; then
8680 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
8681 END { print sum }" hosts` = x1 || tmp_re="[ ]"
8682 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
8683 hosts | $sort | $uniq | \
8684 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
8685 case `$echo X$dflt` in
8686 X*\ *) echo "(Several hosts in the database matched hostname)"
8689 X.) echo "(You do not have fully-qualified names in the hosts database)"
8693 echo "(I cannot locate a hosts database anywhere)"
8698 tans=`./loc resolv.conf X /etc /usr/etc`
8699 if $test -f "$tans"; then
8700 echo "(Attempting domain name extraction from $tans)"
8701 dflt=.`$sed -n -e 's/ / /g' \
8702 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
8703 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8705 .) dflt=.`$sed -n -e 's/ / /g' \
8706 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
8707 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8714 .) echo "(No help from resolv.conf either -- attempting clever guess)"
8715 dflt=.`sh -c domainname 2>/dev/null`
8718 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
8722 case "$dflt$osname" in
8723 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
8724 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
8728 .) echo "(Lost all hope -- silly guess then)"
8734 *) dflt="$mydomain";;
8738 rp="What is your domain name?"
8748 : translate upper to lower if necessary
8751 echo "(Normalizing case in your domain name)"
8752 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
8756 : a little sanity check here
8757 case "$phostname" in
8760 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
8761 $myhostname$mydomain|$myhostname) ;;
8763 case "$phostname" in
8765 echo "(That doesn't agree with your whoami.h file, by the way.)"
8768 echo "(That doesn't agree with your $phostname command, by the way.)"
8776 : determine the e-mail address of the user who is running us
8779 I need to get your e-mail address in Internet format if possible, i.e.
8780 something like user@host.domain. Please answer accurately since I have
8781 no easy means to double check it. The default value provided below
8782 is most probably close to reality but may not be valid from outside
8783 your organization...
8787 while test "$cont"; do
8789 '') dflt="$cf_by@$myhostname$mydomain";;
8790 *) dflt="$cf_email";;
8792 rp='What is your e-mail address?'
8798 rp='Address does not look like an Internet one. Use it anyway?'
8812 : Ask e-mail of administrator
8815 If you or somebody else will be maintaining perl at your site, please
8816 fill in the correct e-mail address here so that they may be contacted
8817 if necessary. Currently, the "perlbug" program included with perl
8818 will send mail to this address in addition to perlbug@perl.org. You may
8819 enter "none" for no administrator.
8822 case "$perladmin" in
8823 '') dflt="$cf_email";;
8824 *) dflt="$perladmin";;
8826 rp='Perl administrator e-mail address'
8830 : determine whether to only install version-specific parts.
8833 Do you want to install only the version-specific parts of the perl
8834 distribution? Usually you do *not* want to do this.
8836 case "$versiononly" in
8837 "$define"|[Yy]*|true) dflt='y' ;;
8840 rp="Do you want to install only the version-specific parts of perl?"
8843 [yY]*) val="$define";;
8849 case "$versiononly" in
8850 "$define") inc_version_list=''
8851 inc_version_list_init=0
8855 : figure out how to guarantee perl startup
8856 : XXX Note that this currently takes advantage of the bug that binexp ignores
8857 : the Configure -Dinstallprefix setting, which in turn means that under
8858 : relocatable @INC, initialinstalllocation is what binexp started as.
8859 case "$startperl" in
8861 case "$sharpbang" in
8865 I can use the #! construct to start perl on your system. This will
8866 make startup of perl scripts faster, but may cause problems if you
8867 want to share those scripts and perl is not in a standard place
8868 ($initialinstalllocation/perl) on all your platforms. The alternative
8869 is to force a shell by starting the script with a single ':' character.
8872 case "$versiononly" in
8873 "$define") dflt="$initialinstalllocation/perl$version";;
8874 *) dflt="$initialinstalllocation/perl";;
8876 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
8879 none) startperl=": # use perl";;
8880 *) startperl="#!$ans"
8881 if $test 30 -lt `echo "$ans" | wc -c`; then
8884 WARNING: Some systems limit the #! command to 32 characters.
8885 If you experience difficulty running Perl scripts with #!, try
8886 installing Perl in a directory with a shorter pathname.
8892 *) startperl=": # use perl"
8897 echo "I'll use $startperl to start perl scripts."
8899 : figure best path for perl in scripts
8902 case "$versiononly" in
8903 "$define") perlpath="$initialinstalllocation/perl$version";;
8904 *) perlpath="$initialinstalllocation/perl";;
8906 case "$startperl" in
8911 I will use the "eval 'exec'" idiom to start Perl on your system.
8912 I can use the full path of your Perl binary for this purpose, but
8913 doing so may cause problems if you want to share those scripts and
8914 Perl is not always in a standard place ($initialinstalllocation/perl).
8917 dflt="$initialinstalllocation/perl"
8918 rp="What path shall I use in \"eval 'exec'\"?"
8925 case "$startperl" in
8927 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
8930 : determine where public executable scripts go
8931 set scriptdir scriptdir
8933 case "$scriptdir" in
8936 : guess some guesses
8937 $test -d /usr/share/scripts && dflt=/usr/share/scripts
8938 $test -d /usr/share/bin && dflt=/usr/share/bin
8939 $test -d /usr/local/script && dflt=/usr/local/script
8940 $test -d /usr/local/scripts && dflt=/usr/local/scripts
8941 $test -d $prefixexp/script && dflt=$prefixexp/script
8945 *) dflt="$scriptdir"
8950 Some installations have a separate directory just for executable scripts so
8951 that they can mount it across multiple architectures but keep the scripts in
8952 one spot. You might, for example, have a subdirectory of /usr/share for this.
8953 Or you might just lump your scripts in with all your other executables.
8957 rp='Where do you keep publicly executable scripts?'
8959 if $test "X$ansexp" != "X$scriptdirexp"; then
8965 : A little fix up for an irregularly named variable.
8966 installscript="$installscriptdir"
8968 : determine where add-on public executables go
8970 '') dflt=$siteprefix/bin ;;
8974 rp='Pathname where the add-on public executables should be installed?'
8979 : determine where add-on html pages go
8980 : There is no standard location, so try to copy the previously-selected
8981 : directory structure for the core html pages.
8982 case "$sitehtml1dir" in
8983 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
8984 *) dflt=$sitehtml1dir ;;
8987 ''|' ') dflt=none ;;
8990 rp='Pathname where the site-specific html pages should be installed?'
8992 prefixvar=sitehtml1dir
8995 : determine where add-on library html pages go
8996 : There is no standard location, so try to copy the previously-selected
8997 : directory structure for the core html pages.
8998 case "$sitehtml3dir" in
8999 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9000 *) dflt=$sitehtml3dir ;;
9003 ''|' ') dflt=none ;;
9006 rp='Pathname where the site-specific library html pages should be installed?'
9008 prefixvar=sitehtml3dir
9011 : determine where add-on manual pages go
9012 case "$siteman1dir" in
9013 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
9014 *) dflt=$siteman1dir ;;
9017 ''|' ') dflt=none ;;
9020 rp='Pathname where the site-specific manual pages should be installed?'
9022 prefixvar=siteman1dir
9025 : determine where add-on library man pages go
9026 case "$siteman3dir" in
9027 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
9028 *) dflt=$siteman3dir ;;
9031 ''|' ') dflt=none ;;
9034 rp='Pathname where the site-specific library manual pages should be installed?'
9036 prefixvar=siteman3dir
9039 : determine where add-on public executable scripts go
9040 case "$sitescript" in
9041 '') dflt=$siteprefix/script
9042 $test -d $dflt || dflt=$sitebin ;;
9043 *) dflt="$sitescript" ;;
9046 rp='Pathname where add-on public executable scripts should be installed?'
9048 prefixvar=sitescript
9051 : Check if faststdio is requested and available
9052 case "$usefaststdio" in
9053 $define|true|[yY]*|'')
9054 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
9064 Perl can be built to use 'fast stdio', which means using the stdio
9065 library but also directly manipulating the stdio buffers to enable
9066 faster I/O. Using stdio is better for backward compatibility (especially
9067 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
9068 interface has been preferred instead of stdio.
9070 If this doesn't make any sense to you, just accept the default '$dflt'.
9072 rp='Use the "fast stdio" if available?'
9075 y|Y) val="$define" ;;
9082 : define an is-a-typedef? function
9083 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9085 "") inclist="sys/types.h";;
9087 eval "varval=\$$var";
9091 for inc in $inclist; do
9092 echo "#include <$inc>" >>temp.c;
9094 echo "#ifdef $type" >> temp.c;
9095 echo "printf(\"We have $type\");" >> temp.c;
9096 echo "#endif" >> temp.c;
9097 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9098 if $contains $type temp.E >/dev/null 2>&1; then
9104 *) eval "$var=\$varval";;
9107 : define an is-a-typedef? function that prompts if the type is not available.
9108 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9110 "") inclist="sys/types.h";;
9112 eval "varval=\$$var";
9116 for inc in $inclist; do
9117 echo "#include <$inc>" >>temp.c;
9119 echo "#ifdef $type" >> temp.c;
9120 echo "printf(\"We have $type\");" >> temp.c;
9121 echo "#endif" >> temp.c;
9122 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9124 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
9125 if $contains $type temp.E >/dev/null 2>&1; then
9126 echo "$type found." >&4;
9129 echo "$type NOT found." >&4;
9135 *) eval "$var=\$varval";;
9138 : see what type lseek is declared as in the kernel
9139 rp="What is the type used for lseek's offset on this system?"
9140 set off_t lseektype long stdio.h sys/types.h
9144 echo "Checking to see how big your file offsets are..." >&4
9146 #include <sys/types.h>
9150 printf("%d\n", (int)sizeof($lseektype));
9155 if eval $compile_ok; then
9156 lseeksize=`$run ./try`
9157 echo "Your file offsets are $lseeksize bytes long."
9161 echo "(I can't seem to compile the test program. Guessing...)"
9162 rp="What is the size of your file offsets (in bytes)?"
9168 : see what type file positions are declared as in the library
9169 rp="What is the type for file position used by fsetpos()?"
9170 set fpos_t fpostype long stdio.h sys/types.h
9173 : Check size for Fpos_t
9176 *_t) zzz="$fpostype" ;;
9179 echo "Checking the size of $zzz..." >&4
9181 #include <sys/types.h>
9188 printf("%d\n", (int)sizeof($fpostype));
9193 if eval $compile_ok; then
9197 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9200 echo "Your $zzz is $fpossize bytes long."
9206 echo "(I can't compile the test program. Guessing...)" >&4
9207 rp="What is the size of your file positions (in bytes)?"
9212 : Check for large file support
9213 # Backward compatibility (uselfs is deprecated).
9215 "$define"|true|[yY]*)
9218 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
9220 uselargefiles="$define"
9224 case "$lseeksize:$fpossize" in
9227 You can have files larger than 2 gigabytes.
9230 *) case "$uselargefiles" in
9231 "$undef"|false|[nN]*) dflt='n' ;;
9236 Perl can be built to understand large files (files larger than 2 gigabytes)
9237 on some systems. To do so, Configure can be run with -Duselargefiles.
9239 If this doesn't make any sense to you, just accept the default '$dflt'.
9241 rp='Try to understand large files, if available?'
9244 y|Y) val="$define" ;;
9251 : Look for a hint-file generated 'call-back-unit'. If the
9252 : user has specified that a large files perl is to be built,
9253 : we may need to set or change some other defaults.
9254 if $test -f uselargefiles.cbu; then
9255 echo "Your platform has some specific hints regarding large file builds, using them..."
9256 . ./uselargefiles.cbu
9258 case "$uselargefiles" in
9260 if $test -f uselargefiles.cbu; then
9262 echo "Rechecking to see how big your file offsets are..." >&4
9264 #include <sys/types.h>
9268 printf("%d\n", (int)sizeof($lseektype));
9273 if eval $compile_ok; then
9274 lseeksize=`$run ./try`
9275 $echo "Your file offsets are now $lseeksize bytes long."
9279 echo "(I can't seem to compile the test program. Guessing...)"
9280 rp="What is the size of your file offsets (in bytes)?"
9285 *_t) zzz="$fpostype" ;;
9288 $echo $n "Rechecking the size of $zzz...$c" >&4
9290 #include <sys/types.h>
9297 printf("%d\n", (int)sizeof($fpostype));
9302 if eval $compile_ok; then
9307 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9310 echo " $fpossize bytes." >&4
9316 echo "(I can't compile the test program. Guessing...)" >&4
9317 rp="What is the size of your file positions (in bytes)?"
9326 : Set the vendorbin variables
9327 case "$vendorprefix" in
9328 '') d_vendorbin="$undef"
9332 *) d_vendorbin="$define"
9333 : determine where vendor-supplied executables go.
9334 case "$vendorbin" in
9335 '') dflt=$vendorprefix/bin ;;
9336 *) dflt="$vendorbin" ;;
9339 rp='Pathname for the vendor-supplied executables directory?'
9342 vendorbinexp="$ansexp"
9348 : Set the vendorhtml1dir variables
9349 case "$vendorprefix" in
9350 '') vendorhtml1dir=''
9351 vendorhtml1direxp=''
9353 *) : determine where vendor-supplied html pages go.
9354 : There is no standard location, so try to copy the previously-selected
9355 : directory structure for the core html pages.
9356 : XXX Better default suggestions would be welcome.
9357 case "$vendorhtml1dir" in
9358 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9359 *) dflt=$vendorhtml1dir ;;
9362 ''|' ') dflt=none ;;
9365 rp='Pathname for the vendor-supplied html pages?'
9367 vendorhtml1dir="$ans"
9368 vendorhtml1direxp="$ansexp"
9371 : Use ' ' for none so value is preserved next time through Configure
9372 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9373 prefixvar=vendorhtml1dir
9376 : Set the vendorhtml3dir variables
9377 case "$vendorprefix" in
9378 '') vendorhtml3dir=''
9379 vendorhtml3direxp=''
9381 *) : determine where vendor-supplied module html pages go.
9382 : There is no standard location, so try to copy the previously-selected
9383 : directory structure for the core html pages.
9384 : XXX Better default suggestions would be welcome.
9385 case "$vendorhtml3dir" in
9386 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9387 *) dflt=$vendorhtml3dir ;;
9390 ''|' ') dflt=none ;;
9393 rp='Pathname for the vendor-supplied html pages?'
9395 vendorhtml3dir="$ans"
9396 vendorhtml3direxp="$ansexp"
9399 : Use ' ' for none so value is preserved next time through Configure
9400 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9401 prefixvar=vendorhtml3dir
9404 : Set the vendorman1dir variables
9405 case "$vendorprefix" in
9406 '') vendorman1dir=''
9409 *) : determine where vendor-supplied manual pages go.
9410 case "$vendorman1dir" in
9411 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9412 *) dflt=$vendorman1dir ;;
9415 ''|' ') dflt=none ;;
9418 rp='Pathname for the vendor-supplied manual section 1 pages?'
9420 vendorman1dir="$ans"
9421 vendorman1direxp="$ansexp"
9424 : Use ' ' for none so value is preserved next time through Configure
9425 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
9426 prefixvar=vendorman1dir
9429 : Set the vendorman3dir variables
9430 case "$vendorprefix" in
9431 '') vendorman3dir=''
9434 *) : determine where vendor-supplied module manual pages go.
9435 case "$vendorman3dir" in
9436 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9437 *) dflt=$vendorman3dir ;;
9440 ''|' ') dflt=none ;;
9443 rp='Pathname for the vendor-supplied manual section 3 pages?'
9445 vendorman3dir="$ans"
9446 vendorman3direxp="$ansexp"
9449 : Use ' ' for none so value is preserved next time through Configure
9450 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
9451 prefixvar=vendorman3dir
9454 : Set the vendorscript variables
9455 case "$vendorprefix" in
9456 '') d_vendorscript="$undef"
9460 *) d_vendorscript="$define"
9461 : determine where vendor-supplied scripts go.
9462 case "$vendorscript" in
9463 '') dflt=$vendorprefix/script
9464 $test -d $dflt || dflt=$vendorbin ;;
9465 *) dflt="$vendorscript" ;;
9469 The installation process will create a directory for
9470 vendor-supplied scripts.
9474 rp='Pathname for the vendor-supplied scripts directory?'
9477 vendorscriptexp="$ansexp"
9480 prefixvar=vendorscript
9483 : see if qgcvt exists
9487 : Check print/scan long double stuff
9490 if $test X"$d_longdbl" = X"$define"; then
9492 echo "Checking how to print long doubles..." >&4
9494 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
9495 $cat >try.c <<'EOCP'
9496 #include <sys/types.h>
9500 printf("%.3f\n", d);
9504 if eval $compile; then
9508 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
9509 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
9510 echo "We will use %f."
9516 if $test X"$sPRIfldbl" = X; then
9517 $cat >try.c <<'EOCP'
9518 #include <sys/types.h>
9521 long double d = 123.456;
9522 printf("%.3Lf\n", d);
9526 if eval $compile; then
9530 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
9531 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
9532 echo "We will use %Lf."
9538 if $test X"$sPRIfldbl" = X; then
9539 $cat >try.c <<'EOCP'
9540 #include <sys/types.h>
9543 long double d = 123.456;
9544 printf("%.3llf\n", d);
9548 if eval $compile; then
9552 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
9553 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
9554 echo "We will use %llf."
9560 if $test X"$sPRIfldbl" = X; then
9561 $cat >try.c <<'EOCP'
9562 #include <sys/types.h>
9565 long double d = 123.456;
9566 printf("%.3lf\n", d);
9570 if eval $compile; then
9574 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
9575 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
9576 echo "We will use %lf."
9582 if $test X"$sPRIfldbl" = X; then
9583 echo "Cannot figure out how to print long doubles." >&4
9585 sSCNfldbl=$sPRIfldbl # expect consistency
9592 case "$sPRIfldbl" in
9593 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
9594 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
9595 d_SCNfldbl="$undef";
9597 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
9598 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
9599 d_SCNfldbl="$define";
9603 : Check how to convert floats to strings.
9605 if test "X$d_Gconvert" = X; then
9608 echo "Checking for an efficient way to convert floats to strings."
9610 case "$uselongdouble" in
9611 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
9613 case "$d_longdbl" in
9614 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
9616 case "$d_PRIgldbl" in
9617 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
9621 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
9622 char *myname = "gconvert";
9625 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
9626 char *myname = "gcvt";
9629 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
9630 char *myname = "qgcvt";
9631 #define DOUBLETYPE long double
9634 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9636 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
9638 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
9641 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
9643 char *myname = "sprintf";
9647 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9648 #define DOUBLETYPE long double
9650 #define DOUBLETYPE double
9656 #define I_STDLIB $i_stdlib
9662 checkit(expect, got)
9666 if (strcmp(expect, got)) {
9667 printf("%s oddity: Expected %s, got %s\n",
9668 myname, expect, got);
9678 /* This must be 1st test on (which?) platform */
9679 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
9680 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
9681 checkit("0.1", buf);
9683 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
9684 checkit("0.01", buf);
9686 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
9687 checkit("0.001", buf);
9689 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
9690 checkit("0.0001", buf);
9692 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
9693 if (strlen(buf) > 5)
9694 checkit("9e-005", buf); /* for Microsoft ?? */
9696 checkit("9e-05", buf);
9698 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
9701 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
9702 checkit("1.1", buf);
9704 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
9705 checkit("1.01", buf);
9707 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
9708 checkit("1.001", buf);
9710 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
9711 checkit("1.0001", buf);
9713 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
9714 checkit("1.00001", buf);
9716 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
9717 checkit("1.000001", buf);
9719 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
9722 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
9725 /* Some Linux gcvt's give 1.e+5 here. */
9726 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
9727 checkit("100000", buf);
9729 /* Some Linux gcvt's give -1.e+5 here. */
9730 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
9731 checkit("-100000", buf);
9733 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
9734 checkit("123.456", buf);
9736 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
9737 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
9738 /* 34 should be enough to scare even long double
9739 * places into using the e notation. */
9740 if (strlen(buf) > 5)
9741 checkit("1e+034", buf); /* for Microsoft */
9743 checkit("1e+34", buf);
9745 /* For Perl, if you add additional tests here, also add them to
9746 * t/base/num.t for benefit of platforms not using Configure or
9747 * overriding d_Gconvert */
9752 : first add preferred functions to our list
9754 for xxx_convert in $gconvert_preference; do
9755 case $xxx_convert in
9756 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
9757 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
9760 : then add any others
9761 for xxx_convert in gconvert gcvt sprintf; do
9764 *) xxx_list="$xxx_list $xxx_convert" ;;
9768 case "$d_longdbl$uselongdouble" in
9770 : again, add prefered functions to our list first
9772 for xxx_convert in $gconvert_ld_preference; do
9773 case $xxx_convert in
9774 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9775 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
9778 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
9779 for xxx_convert in qgcvt sprintf $xxx_list; do
9780 case "$xxx_ld_list" in
9781 $xxx_convert*|*" $xxx_convert"*) ;;
9782 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9785 : if sprintf cannot do long doubles, move it to the end
9786 if test "$d_PRIgldbl" != "$define"; then
9787 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
9789 : if no qgcvt, remove it
9790 if test "$d_qgcvt" != "$define"; then
9791 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
9794 xxx_list="$xxx_ld_list"
9798 for xxx_convert in $xxx_list; do
9799 echo "Trying $xxx_convert..."
9800 $rm -f try try$_o core
9801 set try -DTRY_$xxx_convert
9802 if eval $compile; then
9803 echo "$xxx_convert() found." >&4
9805 echo "I'll use $xxx_convert to convert floats into a string." >&4
9808 echo "...But $xxx_convert didn't work as I expected."
9812 echo "$xxx_convert NOT found." >&4
9816 if test X$xxx_convert = X; then
9817 echo "*** WHOA THERE!!! ***" >&4
9818 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
9822 case "$xxx_convert" in
9823 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
9824 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
9825 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
9826 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
9827 "$define$define$define")
9828 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
9829 "$define$define$undef")
9830 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
9831 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
9839 : see if _fwalk exists
9843 : Initialize h_fcntl
9846 : Initialize h_sysfile
9849 : access call always available on UNIX
9853 : locate the flags for 'access()'
9857 $cat >access.c <<EOCP
9858 #include <sys/types.h>
9863 #include <sys/file.h>
9876 : check sys/file.h first, no particular reason here
9877 if $test `./findhdr sys/file.h` && \
9878 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
9880 echo "<sys/file.h> defines the *_OK access constants." >&4
9881 elif $test `./findhdr fcntl.h` && \
9882 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
9884 echo "<fcntl.h> defines the *_OK access constants." >&4
9885 elif $test `./findhdr unistd.h` && \
9886 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
9887 echo "<unistd.h> defines the *_OK access constants." >&4
9889 echo "I can't find the four *_OK access constants--I'll use mine." >&4
9895 : see if accessx exists
9896 set accessx d_accessx
9899 : see if aintl exists
9903 : see if alarm exists
9907 : see if POSIX threads are available
9908 set pthread.h i_pthread
9911 : define a fucntion to check prototypes
9912 $cat > protochk <<EOSH
9915 optimize="$optimize"
9917 prototype="$prototype"
9920 usethreads=$usethreads
9921 i_pthread=$i_pthread
9922 pthread_h_first=$pthread_h_first
9925 $cat >> protochk <<'EOSH'
9930 while test $# -ge 2; do
9932 $define) echo "#include <$2>" >> try.c ;;
9933 literal) echo "$2" >> try.c ;;
9935 # Extra magic for the benefit of systems that need pthread.h
9936 # to be included early to correctly detect threadsafe functions.
9937 # Such functions must guarantee themselves, though, that the usethreads
9938 # and i_pthread have been defined, before calling protochk.
9939 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
9940 echo "#include <pthread.h>" >> try.c
9945 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
9946 cat >> try.c <<'EOCP'
9947 #ifdef CAN_PROTOTYPE
9948 #define _(args) args
9953 echo "$foo" >> try.c
9954 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
9955 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
9963 : Define hasproto macro for Configure internal use
9964 hasproto='varname=$1; func=$2; shift; shift;
9965 while $test $# -ge 2; do
9967 $define) echo "#include <$2>";;
9971 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
9972 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
9973 echo "$func() prototype found.";
9976 echo "$func() prototype NOT found.";
9983 : see if sys/types.h has to be included
9984 set sys/types.h i_systypes
9987 : see if sys/select.h has to be included
9988 set sys/select.h i_sysselct
9991 : Define hasfield macro for Configure internal use
9992 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
9993 while $test $# -ge 2; do
9995 $define) echo "#include <$2>";;
9999 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
10001 if eval $compile; then
10010 : see if we should include time.h, sys/time.h, or both
10012 if test "X$timeincl" = X; then
10013 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
10014 $echo $n "I'm now running the test program...$c"
10016 #include <sys/types.h>
10021 #ifdef SYSTIMEKERNEL
10024 #include <sys/time.h>
10027 #include <sys/select.h>
10029 #$i_stdlib I_STDLIB
10031 #include <stdlib.h>
10037 struct timeval bar;
10040 struct timezone tzp;
10042 if (foo.tm_sec == foo.tm_sec)
10045 if (bar.tv_sec == bar.tv_sec)
10052 for s_timezone in '-DS_TIMEZONE' ''; do
10054 for s_timeval in '-DS_TIMEVAL' ''; do
10055 for i_systimek in '' '-DSYSTIMEKERNEL'; do
10056 for i_time in '' '-DI_TIME'; do
10057 for i_systime in '-DI_SYSTIME' ''; do
10060 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
10061 if eval $compile; then
10062 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
10066 $echo $n "Succeeded with $flags$c"
10078 *SYSTIMEKERNEL*) i_systimek="$define"
10079 timeincl=`./findhdr sys/time.h`
10080 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
10081 *) i_systimek="$undef";;
10084 *I_TIME*) i_time="$define"
10085 timeincl=`./findhdr time.h`" $timeincl"
10086 echo "We'll include <time.h>." >&4;;
10087 *) i_time="$undef";;
10090 *I_SYSTIME*) i_systime="$define"
10091 timeincl=`./findhdr sys/time.h`" $timeincl"
10092 echo "We'll include <sys/time.h>." >&4;;
10093 *) i_systime="$undef";;
10097 : see if struct tm knows about tm_zone
10098 case "$i_systime$i_time" in
10101 echo "Checking to see if your struct tm has tm_zone field..." >&4
10102 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
10110 case "$d_tm_tm_zone" in
10111 "$define") echo "Yes, it does." ;;
10112 *) echo "No, it doesn't." ;;
10114 : see if struct tm knows about tm_gmtoff
10115 case "$i_systime$i_time" in
10118 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
10119 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
10127 case "$d_tm_tm_gmtoff" in
10128 "$define") echo "Yes, it does." ;;
10129 *) echo "No, it doesn't." ;;
10132 : see if asctime_r exists
10133 set asctime_r d_asctime_r
10135 case "$d_asctime_r" in
10137 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10138 case "$d_asctime_r_proto:$usethreads" in
10139 ":define") d_asctime_r_proto=define
10140 set d_asctime_r_proto asctime_r $hdrs
10144 case "$d_asctime_r_proto" in
10146 case "$asctime_r_proto" in
10147 ''|0) try='char* asctime_r(const struct tm*, char*);'
10148 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SB ;;
10150 case "$asctime_r_proto" in
10151 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
10152 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SBI ;;
10154 case "$asctime_r_proto" in
10155 ''|0) try='int asctime_r(const struct tm*, char*);'
10156 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SB ;;
10158 case "$asctime_r_proto" in
10159 ''|0) try='int asctime_r(const struct tm*, char*, int);'
10160 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SBI ;;
10162 case "$asctime_r_proto" in
10163 ''|0) d_asctime_r=undef
10165 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
10166 * ) case "$asctime_r_proto" in
10167 REENTRANT_PROTO*) ;;
10168 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
10170 echo "Prototype: $try" ;;
10173 *) case "$usethreads" in
10174 define) echo "asctime_r has no prototype, not using it." >&4 ;;
10181 *) asctime_r_proto=0
10185 : see if atolf exists
10189 : see if atoll exists
10193 : Look for GCC-style attribute format
10194 case "$d_attribute_format" in
10197 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
10198 $cat >attrib.c <<'EOCP'
10200 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
10202 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10203 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10204 echo "Your C compiler doesn't support __attribute__((format))."
10207 echo "Your C compiler supports __attribute__((format))."
10211 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10215 *) val="$d_attribute_format" ;;
10217 set d_attribute_format
10221 : Look for GCC-style attribute format with null format allowed
10222 case "$d_printf_format_null" in
10223 '') case "$d_attribute_format" in
10226 echo "Checking whether your compiler allows __printf__ format to be null ..." >&4
10227 $cat >attrib.c <<EOCP
10229 #$i_stdlib I_STDLIB
10231 #include <stdlib.h>
10233 int null_printf (char* pat,...) __attribute__((__format__(__printf__,1,2)));
10234 int null_printf (char* pat,...) { return (int)pat; }
10235 int main () { exit(null_printf(NULL)); }
10237 if $cc $ccflags -o attrib attrib.c >attrib.out 2>&1 ; then
10238 : run the executable in case it produces a run-time warning
10239 if $run ./attrib >>attrib.out 2>&1; then
10240 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10241 echo "Your C compiler doesn't allow __printf__ format to be null."
10244 echo "Your C compiler allows __printf__ format to be null."
10248 echo "Your C compiler executable failed with __printf__ format null."
10252 echo "Your C compiler fails with __printf__ format null."
10259 *) val="$d_printf_format_null" ;;
10261 set d_printf_format_null
10265 : Look for GCC-style attribute malloc
10266 case "$d_attribute_malloc" in
10269 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
10270 $cat >attrib.c <<'EOCP'
10272 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
10274 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10275 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10276 echo "Your C compiler doesn't support __attribute__((malloc))."
10279 echo "Your C compiler supports __attribute__((malloc))."
10283 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10287 *) val="$d_attribute_malloc" ;;
10289 set d_attribute_malloc
10293 : Look for GCC-style attribute nonnull
10294 case "$d_attribute_nonnull" in
10297 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
10298 $cat >attrib.c <<'EOCP'
10300 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
10302 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10303 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10304 echo "Your C compiler doesn't support __attribute__((nonnull))."
10307 echo "Your C compiler supports __attribute__((nonnull))."
10311 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10315 *) val="$d_attribute_nonnull" ;;
10317 set d_attribute_nonnull
10321 : Look for GCC-style attribute noreturn
10322 case "$d_attribute_noreturn" in
10325 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
10326 $cat >attrib.c <<'EOCP'
10328 void fall_over_dead( void ) __attribute__((noreturn));
10330 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10331 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10332 echo "Your C compiler doesn't support __attribute__((noreturn))."
10335 echo "Your C compiler supports __attribute__((noreturn))."
10339 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10343 *) val="$d_attribute_noreturn" ;;
10345 set d_attribute_noreturn
10349 : Look for GCC-style attribute pure
10350 case "$d_attribute_pure" in
10353 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
10354 $cat >attrib.c <<'EOCP'
10356 int square( int n ) __attribute__((pure));
10358 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10359 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10360 echo "Your C compiler doesn't support __attribute__((pure))."
10363 echo "Your C compiler supports __attribute__((pure))."
10367 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10371 *) val="$d_attribute_pure" ;;
10373 set d_attribute_pure
10377 : Look for GCC-style attribute unused
10378 case "$d_attribute_unused" in
10381 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
10382 $cat >attrib.c <<'EOCP'
10384 int do_something( int dummy __attribute__((unused)), int n );
10386 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10387 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10388 echo "Your C compiler doesn't support __attribute__((unused))."
10391 echo "Your C compiler supports __attribute__((unused))."
10395 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10399 *) val="$d_attribute_unused" ;;
10401 set d_attribute_unused
10405 : Look for GCC-style attribute warn_unused_result
10406 case "$d_attribute_warn_unused_result" in
10409 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
10410 $cat >attrib.c <<'EOCP'
10412 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
10414 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10415 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10416 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
10419 echo "Your C compiler supports __attribute__((warn_unused_result))."
10423 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10427 *) val="$d_attribute_warn_unused_result" ;;
10429 set d_attribute_warn_unused_result
10433 : see if bcmp exists
10437 : see if bcopy exists
10441 : see if getpgrp exists
10442 set getpgrp d_getpgrp
10445 case "$d_getpgrp" in
10448 echo "Checking to see which flavor of getpgrp is in use..."
10450 #$i_unistd I_UNISTD
10451 #include <sys/types.h>
10453 # include <unistd.h>
10455 #$i_stdlib I_STDLIB
10457 #include <stdlib.h>
10461 if (getuid() == 0) {
10462 printf("(I see you are running Configure as super-user...)\n");
10465 #ifdef TRY_BSD_PGRP
10466 if (getpgrp(1) == 0)
10475 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10476 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
10478 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10479 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
10482 echo "I can't seem to compile and run the test program."
10484 xxx="a USG one, i.e. you use getpgrp()."
10486 # SVR4 systems can appear rather BSD-ish.
10487 case "$i_unistd" in
10489 xxx="a BSD one, i.e. you use getpgrp(pid)."
10493 xxx="probably a USG one, i.e. you use getpgrp()."
10498 echo "Assuming your getpgrp is $xxx" >&4
10507 : see if setpgrp exists
10508 set setpgrp d_setpgrp
10511 case "$d_setpgrp" in
10514 echo "Checking to see which flavor of setpgrp is in use..."
10516 #$i_unistd I_UNISTD
10517 #include <sys/types.h>
10519 # include <unistd.h>
10521 #$i_stdlib I_STDLIB
10523 #include <stdlib.h>
10527 if (getuid() == 0) {
10528 printf("(I see you are running Configure as super-user...)\n");
10531 #ifdef TRY_BSD_PGRP
10532 if (-1 == setpgrp(1, 1))
10535 if (setpgrp() != -1)
10541 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10542 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
10544 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10545 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
10548 echo "(I can't seem to compile and run the test program.)"
10550 xxx="a USG one, i.e. you use setpgrp()."
10552 # SVR4 systems can appear rather BSD-ish.
10553 case "$i_unistd" in
10555 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
10559 xxx="probably a USG one, i.e. you use setpgrp()."
10564 echo "Assuming your setpgrp is $xxx" >&4
10573 : Look for GCC-style __builtin_choose_expr
10574 case "$d_builtin_choose_expr" in
10577 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
10578 $cat >try.c <<'EOCP'
10579 #include <assert.h>
10580 #include <stdlib.h>
10583 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
10586 assert( SYRINX(1) == 2112 );
10587 assert( SYRINX(1) != 5150 );
10588 assert( SYRINX(0) == 5150 );
10589 assert( SYRINX(0) != 2112 );
10590 puts( "All good!" );
10596 if eval $compile && $run ./try; then
10597 echo "Your C compiler supports __builtin_choose_expr."
10600 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
10604 *) val="$d_builtin_choose_expr" ;;
10607 set d_builtin_choose_expr
10611 : Look for GCC-style __builtin_expect
10612 case "$d_builtin_expect" in
10615 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
10616 $cat >try.c <<'EOCP'
10619 if ( __builtin_expect(n, 0) ) n = 1;
10620 /* Remember shell exit code truth is 0, C truth is non-zero */
10625 if eval $compile && $run ./try; then
10626 echo "Your C compiler supports __builtin_expect."
10629 echo "Your C compiler doesn't seem to understand __builtin_expect."
10633 *) val="$d_builtin_expect" ;;
10636 set d_builtin_expect
10640 : see if bzero exists
10644 : see if stdarg is available
10646 if $test `./findhdr stdarg.h`; then
10647 echo "<stdarg.h> found." >&4
10650 echo "<stdarg.h> NOT found." >&4
10654 : see if varags is available
10656 if $test `./findhdr varargs.h`; then
10657 echo "<varargs.h> found." >&4
10659 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
10662 : set up the varargs testing programs
10663 $cat > varargs.c <<EOP
10665 #include <stdarg.h>
10668 #include <varargs.h>
10672 int f(char *p, ...)
10686 p = va_arg(ap, char *);
10692 $cat > varargs <<EOP
10694 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
10703 : now check which varargs header should be included
10708 if `./varargs I_STDARG`; then
10710 elif `./varargs I_VARARGS`; then
10715 if `./varargs I_VARARGS`; then
10722 echo "I could not find the definition for va_dcl... You have problems..." >&4
10723 val="$undef"; set i_stdarg; eval $setvar
10724 val="$undef"; set i_varargs; eval $setvar
10729 case "$i_varhdr" in
10731 val="$define"; set i_stdarg; eval $setvar
10732 val="$undef"; set i_varargs; eval $setvar
10735 val="$undef"; set i_stdarg; eval $setvar
10736 val="$define"; set i_varargs; eval $setvar
10739 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
10743 : see if the Compiler supports C99 variadic macros
10744 case "$i_stdarg$i_stdlib" in
10746 echo "You have <stdarg.h> and <stdlib.h>, so checking for C99 variadic macros." >&4
10749 #include <stdarg.h>
10751 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
10755 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
10761 if eval $compile && $run ./try 2>&1 >/dev/null; then
10762 case "`$run ./try`" in
10764 echo "You have C99 variadic macros." >&4
10765 d_c99_variadic_macros="$define"
10768 echo "You don't have functional C99 variadic macros." >&4
10769 d_c99_variadic_macros="$undef"
10773 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
10774 d_c99_variadic_macros="$undef"
10779 echo "You don't have <stdarg.h> and <stdlib.h>, so not checking for C99 variadic macros." >&4
10780 d_c99_variadic_macros="$undef"
10784 : see if signal is declared as pointer to function returning int or void
10786 xxx=`./findhdr signal.h`
10787 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
10788 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10789 echo "You have int (*signal())() instead of void." >&4
10791 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10792 echo "You have void (*signal())()." >&4
10794 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
10795 echo "You have int (*signal())() instead of void." >&4
10797 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
10798 echo "You have void (*signal())()." >&4
10801 case "$d_voidsig" in
10803 echo "I can't determine whether signal handler returns void or int..." >&4
10805 rp="What type does your signal handler return?"
10808 v*) val="$define";;
10812 echo "As you already told me, signal handler returns void." >&4
10815 *) echo "As you already told me, signal handler returns int." >&4
10822 case "$d_voidsig" in
10823 "$define") signal_t="void";;
10824 *) signal_t="int";;
10828 : check for ability to cast large floats to 32-bit ints.
10830 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
10831 if $test "$intsize" -ge 4; then
10838 #$i_stdlib I_STDLIB
10840 #include <stdlib.h>
10842 #include <sys/types.h>
10843 #include <signal.h>
10844 $signal_t blech(int s) { exit(3); }
10851 signal(SIGFPE, blech);
10853 /* Don't let compiler optimize the test away. Store the number
10854 in a writable string for gcc to pass to sscanf under HP/UX.
10856 sprintf(str, "2147483647");
10857 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
10861 /* x86 processors will probably give 0x8000 0000, which is a
10862 sign change. We don't want that. We want to mimic SPARC
10863 behavior here, which is to preserve the sign and give
10866 if (i32 != ($xxx) f)
10872 if eval $compile_ok; then
10876 echo "(I can't seem to compile the test program--assuming it can't)"
10881 echo "Yup, it can."
10884 echo "Nope, it can't."
10891 : check for ability to cast negative floats to unsigned
10893 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
10896 #$i_stdlib I_STDLIB
10898 #include <stdlib.h>
10900 #include <sys/types.h>
10901 #include <signal.h>
10902 $signal_t blech(int s) { exit(7); }
10903 $signal_t blech_in_list(int s) { exit(4); }
10904 unsigned long dummy_long(unsigned long p) { return p; }
10905 unsigned int dummy_int(unsigned int p) { return p; }
10906 unsigned short dummy_short(unsigned short p) { return p; }
10910 unsigned long along;
10912 unsigned short ashort;
10916 /* Frustrate gcc-2.7.2's optimizer which failed this test with
10917 a direct f = -123. assignment. gcc-2.8.0 reportedly
10918 optimized the whole file away
10920 /* Store the number in a writable string for gcc to pass to
10921 sscanf under HP/UX.
10923 sprintf(str, "-123");
10924 sscanf(str, "%lf", &f); /* f = -123.; */
10926 signal(SIGFPE, blech);
10927 along = (unsigned long)f;
10928 aint = (unsigned int)f;
10929 ashort = (unsigned short)f;
10930 if (along != (unsigned long)-123)
10932 if (aint != (unsigned int)-123)
10934 if (ashort != (unsigned short)-123)
10936 sprintf(str, "1073741824.");
10937 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
10940 along = (unsigned long)f;
10941 if (along != 0x80000000)
10945 along = (unsigned long)f;
10946 if (along != 0x7fffffff)
10950 along = (unsigned long)f;
10951 if (along != 0x80000001)
10955 signal(SIGFPE, blech_in_list);
10956 sprintf(str, "123.");
10957 sscanf(str, "%lf", &f); /* f = 123.; */
10958 along = dummy_long((unsigned long)f);
10959 aint = dummy_int((unsigned int)f);
10960 ashort = dummy_short((unsigned short)f);
10961 if (along != (unsigned long)123)
10963 if (aint != (unsigned int)123)
10965 if (ashort != (unsigned short)123)
10972 if eval $compile_ok; then
10976 echo "(I can't seem to compile the test program--assuming it can't)"
10979 case "$castflags" in
10981 echo "Yup, it can."
10984 echo "Nope, it can't."
10991 : see if vprintf exists
10993 if set vprintf val -f d_vprintf; eval $csym; $val; then
10994 echo 'vprintf() found.' >&4
10997 #$i_stdarg I_STDARG /* Only one of these can be defined by i_varhrd */
10998 #$i_varargs I_VARARGS
11000 #$i_stdlib I_STDLIB
11001 #$i_unistd I_UNISTD
11004 # include <stdarg.h>
11005 #else /* I_VARARGS */
11006 # include <varargs.h>
11010 # include <unistd.h>
11014 # include <stdlib.h>
11017 #include <stdio.h> /* vsprintf prototype */
11020 void xxx(int n, ...)
11025 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11027 int main() { xxx(1, "foo"); }
11029 #else /* I_VARARGS */
11037 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11039 int main() { xxx("foo"); }
11045 if eval $compile_ok; then
11046 if $run ./try; then
11047 echo "Your vsprintf() returns (int)." >&4
11050 echo "Your vsprintf() returns (char*)." >&4
11054 echo 'I am unable to compile the vsprintf() test program.' >&4
11055 # We shouldn't get here. If we do, assume the standard signature,
11056 # not the old BSD one.
11057 echo 'Guessing that vsprintf() returns (int).' >&4
11061 echo 'vprintf() NOT found.' >&4
11072 : see if chown exists
11076 : see if chroot exists
11077 set chroot d_chroot
11080 : see if chsize exists
11081 set chsize d_chsize
11084 : see if class exists
11088 : see if clearenv exists
11089 set clearenv d_clearenv
11092 : Define hasstruct macro for Configure internal use
11093 hasstruct='varname=$1; struct=$2; shift; shift;
11094 while $test $# -ge 2; do
11096 $define) echo "#include <$2>";;
11100 echo "int main () { struct $struct foo; }" >> try.c;
11102 if eval $compile; then
11111 : see whether socket exists
11115 $echo $n "Hmm... $c" >&4
11116 if set socket val -f d_socket; eval $csym; $val; then
11117 echo "Looks like you have Berkeley networking support." >&4
11119 if set setsockopt val -f; eval $csym; $val; then
11122 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
11123 d_oldsock="$define"
11126 if $contains socklib libc.list >/dev/null 2>&1; then
11127 echo "Looks like you have Berkeley networking support." >&4
11129 : we will have to assume that it supports the 4.2 BSD interface
11132 echo "You don't have Berkeley networking in libc$_a..." >&4
11133 if test "X$d_socket" = "X$define"; then
11134 echo "...but you seem to believe that you have sockets." >&4
11136 for net in net socket
11138 if test -f /usr/lib/lib$net$_a; then
11139 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
11140 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
11141 if $contains socket libc.list >/dev/null 2>&1; then
11146 echo "...but the Wollongong group seems to have hacked it in." >&4
11147 sockethdr="-I/usr/netinclude"
11150 echo "Found Berkeley sockets interface in lib$net." >&4
11151 if $contains setsockopt libc.list >/dev/null 2>&1; then
11154 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
11155 d_oldsock="$define"
11161 if test "X$d_socket" != "X$define"; then
11162 echo "or anywhere else I see." >&4
11170 : see if socketpair exists
11171 set socketpair d_sockpair
11176 echo "Checking the availability of certain socket constants..." >&4
11177 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
11178 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
11180 #include <sys/types.h>
11181 #include <sys/socket.h>
11187 set try; if eval $compile; then
11190 set d_${enum}; eval $setvar
11194 : see if this is a sys/uio.h system
11195 set sys/uio.h i_sysuio
11198 : Check for cmsghdr support
11200 echo "Checking to see if your system supports struct cmsghdr..." >&4
11201 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
11203 case "$d_cmsghdr_s" in
11204 "$define") echo "Yes, it does." ;;
11205 *) echo "No, it doesn't." ;;
11209 : check for const keyword
11211 echo 'Checking to see if your C compiler knows about "const"...' >&4
11212 $cat >const.c <<'EOCP'
11213 typedef struct spug { int drokk; } spug;
11217 const spug y = { 0 };
11220 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
11222 echo "Yup, it does."
11225 echo "Nope, it doesn't."
11230 : see if copysignl exists
11231 set copysignl d_copysignl
11234 : see if crypt exists
11239 $define) cryptlib='' ;;
11240 *) if set crypt val -f d_crypt; eval $csym; $val; then
11241 echo 'crypt() found.' >&4
11245 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
11246 if $test -z "$cryptlib"; then
11247 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
11251 if $test -z "$cryptlib"; then
11252 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
11256 if $test -z "$cryptlib"; then
11257 cryptlib=`./loc libcrypt$_a "" $libpth`
11261 if $test -z "$cryptlib"; then
11262 echo 'crypt() NOT found.' >&4
11273 : see if this is a crypt.h system
11274 set crypt.h i_crypt
11277 : see if crypt_r exists
11278 set crypt_r d_crypt_r
11280 case "$d_crypt_r" in
11282 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
11283 case "$d_crypt_r_proto:$usethreads" in
11284 ":define") d_crypt_r_proto=define
11285 set d_crypt_r_proto crypt_r $hdrs
11289 case "$d_crypt_r_proto" in
11291 case "$crypt_r_proto" in
11292 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
11293 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCS ;;
11295 case "$crypt_r_proto" in
11296 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
11297 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCD ;;
11299 case "$crypt_r_proto" in
11300 ''|0) d_crypt_r=undef
11302 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
11303 * ) case "$crypt_r_proto" in
11304 REENTRANT_PROTO*) ;;
11305 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
11307 echo "Prototype: $try" ;;
11310 *) case "$usethreads" in
11311 define) echo "crypt_r has no prototype, not using it." >&4 ;;
11322 : get csh whereabouts
11324 'csh') val="$undef" ;;
11325 *) val="$define" ;;
11329 : Respect a hint or command line value for full_csh.
11330 case "$full_csh" in
11331 '') full_csh=$csh ;;
11334 : see if ctermid exists
11335 set ctermid d_ctermid
11338 : see if ctermid_r exists
11339 set ctermid_r d_ctermid_r
11341 case "$d_ctermid_r" in
11343 hdrs="$i_systypes sys/types.h define stdio.h "
11344 case "$d_ctermid_r_proto:$usethreads" in
11345 ":define") d_ctermid_r_proto=define
11346 set d_ctermid_r_proto ctermid_r $hdrs
11350 case "$d_ctermid_r_proto" in
11352 case "$ctermid_r_proto" in
11353 ''|0) try='char* ctermid_r(char*);'
11354 ./protochk "extern $try" $hdrs && ctermid_r_proto=B_B ;;
11356 case "$ctermid_r_proto" in
11357 ''|0) d_ctermid_r=undef
11359 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
11360 * ) case "$ctermid_r_proto" in
11361 REENTRANT_PROTO*) ;;
11362 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
11364 echo "Prototype: $try" ;;
11367 *) case "$usethreads" in
11368 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
11375 *) ctermid_r_proto=0
11379 : see if ctime_r exists
11380 set ctime_r d_ctime_r
11382 case "$d_ctime_r" in
11384 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
11385 case "$d_ctime_r_proto:$usethreads" in
11386 ":define") d_ctime_r_proto=define
11387 set d_ctime_r_proto ctime_r $hdrs
11391 case "$d_ctime_r_proto" in
11393 case "$ctime_r_proto" in
11394 ''|0) try='char* ctime_r(const time_t*, char*);'
11395 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SB ;;
11397 case "$ctime_r_proto" in
11398 ''|0) try='char* ctime_r(const time_t*, char*, int);'
11399 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SBI ;;
11401 case "$ctime_r_proto" in
11402 ''|0) try='int ctime_r(const time_t*, char*);'
11403 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SB ;;
11405 case "$ctime_r_proto" in
11406 ''|0) try='int ctime_r(const time_t*, char*, int);'
11407 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SBI ;;
11409 case "$ctime_r_proto" in
11410 ''|0) d_ctime_r=undef
11412 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
11413 * ) case "$ctime_r_proto" in
11414 REENTRANT_PROTO*) ;;
11415 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
11417 echo "Prototype: $try" ;;
11420 *) case "$usethreads" in
11421 define) echo "ctime_r has no prototype, not using it." >&4 ;;
11432 : see if cuserid exists
11433 set cuserid d_cuserid
11436 : see if this is a limits.h system
11437 set limits.h i_limits
11440 : see if this is a float.h system
11441 set float.h i_float
11444 : See if number of significant digits in a double precision number is known
11446 $cat >dbl_dig.c <<EOM
11447 #$i_limits I_LIMITS
11450 #include <limits.h>
11456 printf("Contains DBL_DIG");
11459 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
11460 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
11461 echo "DBL_DIG found." >&4
11464 echo "DBL_DIG NOT found." >&4
11471 : see if dbm.h is available
11472 : see if dbmclose exists
11473 set dbmclose d_dbmclose
11476 case "$d_dbmclose" in
11486 *) set rpcsvc/dbm.h i_rpcsvcdbm
11491 *) echo "We won't be including <dbm.h>"
11501 : see if prototype for dbminit is available
11503 set d_dbminitproto dbminit $i_dbm dbm.h
11506 : see if difftime exists
11507 set difftime d_difftime
11510 : see if this is a dirent system
11512 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
11514 echo "<dirent.h> found." >&4
11517 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
11518 echo "<sys/dir.h> found." >&4
11521 xinc=`./findhdr sys/ndir.h`
11523 echo "<dirent.h> NOT found." >&4
11528 : Look for type of directory structure.
11530 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11532 case "$direntrytype" in
11534 case "$i_dirent" in
11535 $define) guess1='struct dirent' ;;
11536 *) guess1='struct direct' ;;
11539 *) guess1="$direntrytype"
11544 'struct dirent') guess2='struct direct' ;;
11545 *) guess2='struct dirent' ;;
11548 if $contains "$guess1" try.c >/dev/null 2>&1; then
11549 direntrytype="$guess1"
11550 echo "Your directory entries are $direntrytype." >&4
11551 elif $contains "$guess2" try.c >/dev/null 2>&1; then
11552 direntrytype="$guess2"
11553 echo "Your directory entries seem to be $direntrytype." >&4
11555 echo "I don't recognize your system's directory entries." >&4
11556 rp="What type is used for directory entries on this system?"
11559 direntrytype="$ans"
11563 : see if the directory entry stores field length
11565 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11566 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
11567 echo "Good, your directory entry keeps length information in d_namlen." >&4
11570 echo "Your directory entry does not know about the d_namlen field." >&4
11577 : Look for DIR.dd_fd
11578 case "$i_dirent" in
11580 echo "Checking to see if DIR has a dd_fd member variable" >&4
11582 #$i_stdlib I_STDLIB
11584 #include <stdlib.h>
11586 #include <dirent.h>
11596 if eval $compile; then
11597 echo "Yes, it does."
11600 echo "No, it does not."
11605 echo "You don't have a <dirent.h>, so not checking for dd_fd." >&4
11613 : see if this is an sysdir system
11614 set sys/dir.h i_sysdir
11617 : see if this is an sysndir system
11618 set sys/ndir.h i_sysndir
11623 $cat >dirfd.c <<EOM
11625 #$i_stdlib I_STDLIB
11627 #include <stdlib.h>
11629 #$i_dirent I_DIRENT /**/
11630 #$i_sysdir I_SYS_DIR /**/
11631 #$i_sysndir I_SYS_NDIR /**/
11632 #$i_systypes I_SYS_TYPES /**/
11633 #if defined(I_SYS_TYPES)
11634 #include <sys/types.h>
11636 #if defined(I_DIRENT)
11637 #include <dirent.h>
11638 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
11639 #include <sys/dir.h>
11643 #include <sys/ndir.h>
11647 #include <ndir.h> /* may be wrong in the future */
11649 #include <sys/dir.h>
11655 DIR *dirp = opendir(".");
11656 if (dirfd(dirp) >= 0)
11664 if eval $compile; then
11668 $define) echo "dirfd() found." >&4 ;;
11669 *) echo "dirfd() NOT found." >&4 ;;
11675 : see if dlerror exists
11678 set dlerror d_dlerror
11682 : see if dlfcn is available
11683 set dlfcn.h i_dlfcn
11686 : Check what extension to use for shared libs
11691 On a few systems, the dynamically loaded modules that perl generates and uses
11692 will need a different extension than shared libs. The default will probably
11698 *) dflt="$dlext" ;;
11700 rp='What is the extension of dynamically loaded modules'
11709 : Check if dlsym need a leading underscore
11715 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
11716 $cat >dyna.c <<'EOM'
11723 #$i_stdlib I_STDLIB
11725 #include <stdlib.h>
11729 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
11731 #include <sys/types.h>
11736 extern int fred() ;
11745 int mode = RTLD_LAZY ;
11747 handle = dlopen("./dyna.$dlext", mode) ;
11748 if (handle == NULL) {
11753 symbol = dlsym(handle, "fred") ;
11754 if (symbol == NULL) {
11755 /* try putting a leading underscore */
11756 symbol = dlsym(handle, "_fred") ;
11757 if (symbol == NULL) {
11770 : Call the object file tmp-dyna.o in case dlext=o.
11771 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
11772 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
11773 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
11774 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
11777 1) echo "Test program failed using dlopen." >&4
11778 echo "Perhaps you should not use dynamic loading." >&4;;
11779 2) echo "Test program failed using dlsym." >&4
11780 echo "Perhaps you should not use dynamic loading." >&4;;
11781 3) echo "dlsym needs a leading underscore" >&4
11783 4) echo "dlsym doesn't need a leading underscore." >&4;;
11786 echo "I can't compile and run the test program." >&4
11787 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
11792 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
11797 : see if drand48_r exists
11798 set drand48_r d_drand48_r
11800 case "$d_drand48_r" in
11802 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
11803 case "$d_drand48_r_proto:$usethreads" in
11804 ":define") d_drand48_r_proto=define
11805 set d_drand48_r_proto drand48_r $hdrs
11809 case "$d_drand48_r_proto" in
11811 case "$drand48_r_proto" in
11812 ''|0) try='int drand48_r(struct drand48_data*, double*);'
11813 ./protochk "extern $try" $hdrs && drand48_r_proto=I_ST ;;
11815 case "$drand48_r_proto" in
11816 ''|0) d_drand48_r=undef
11818 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
11819 * ) case "$drand48_r_proto" in
11820 REENTRANT_PROTO*) ;;
11821 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
11823 echo "Prototype: $try" ;;
11826 *) case "$usethreads" in
11827 define) echo "drand48_r has no prototype, not using it." >&4 ;;
11834 *) drand48_r_proto=0
11838 : see if prototype for drand48 is available
11840 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
11843 : see if dup2 exists
11847 : see if eaccess exists
11848 set eaccess d_eaccess
11851 : see if endgrent exists
11852 set endgrent d_endgrent
11855 : see if this is an grp system
11861 xxx=`./findhdr grp.h`
11862 $cppstdin $cppflags $cppminus < $xxx >$$.h
11864 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
11876 set d_grpasswd; eval $setvar
11880 : see if endgrent_r exists
11881 set endgrent_r d_endgrent_r
11883 case "$d_endgrent_r" in
11885 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
11886 case "$d_endgrent_r_proto:$usethreads" in
11887 ":define") d_endgrent_r_proto=define
11888 set d_endgrent_r_proto endgrent_r $hdrs
11892 case "$d_endgrent_r_proto" in
11894 case "$endgrent_r_proto" in
11895 ''|0) try='int endgrent_r(FILE**);'
11896 ./protochk "extern $try" $hdrs && endgrent_r_proto=I_H ;;
11898 case "$endgrent_r_proto" in
11899 ''|0) try='void endgrent_r(FILE**);'
11900 ./protochk "extern $try" $hdrs && endgrent_r_proto=V_H ;;
11902 case "$endgrent_r_proto" in
11903 ''|0) d_endgrent_r=undef
11905 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
11906 * ) case "$endgrent_r_proto" in
11907 REENTRANT_PROTO*) ;;
11908 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
11910 echo "Prototype: $try" ;;
11913 *) case "$usethreads" in
11914 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
11921 *) endgrent_r_proto=0
11925 : see if endhostent exists
11926 set endhostent d_endhent
11929 : see if this is a netdb.h system
11930 set netdb.h i_netdb
11933 : see if endhostent_r exists
11934 set endhostent_r d_endhostent_r
11936 case "$d_endhostent_r" in
11938 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11939 case "$d_endhostent_r_proto:$usethreads" in
11940 ":define") d_endhostent_r_proto=define
11941 set d_endhostent_r_proto endhostent_r $hdrs
11945 case "$d_endhostent_r_proto" in
11947 case "$endhostent_r_proto" in
11948 ''|0) try='int endhostent_r(struct hostent_data*);'
11949 ./protochk "extern $try" $hdrs && endhostent_r_proto=I_D ;;
11951 case "$endhostent_r_proto" in
11952 ''|0) try='void endhostent_r(struct hostent_data*);'
11953 ./protochk "extern $try" $hdrs && endhostent_r_proto=V_D ;;
11955 case "$endhostent_r_proto" in
11956 ''|0) d_endhostent_r=undef
11957 endhostent_r_proto=0
11958 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
11959 * ) case "$endhostent_r_proto" in
11960 REENTRANT_PROTO*) ;;
11961 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
11963 echo "Prototype: $try" ;;
11966 *) case "$usethreads" in
11967 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
11969 d_endhostent_r=undef
11970 endhostent_r_proto=0
11974 *) endhostent_r_proto=0
11978 : see if endnetent exists
11979 set endnetent d_endnent
11982 : see if endnetent_r exists
11983 set endnetent_r d_endnetent_r
11985 case "$d_endnetent_r" in
11987 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11988 case "$d_endnetent_r_proto:$usethreads" in
11989 ":define") d_endnetent_r_proto=define
11990 set d_endnetent_r_proto endnetent_r $hdrs
11994 case "$d_endnetent_r_proto" in
11996 case "$endnetent_r_proto" in
11997 ''|0) try='int endnetent_r(struct netent_data*);'
11998 ./protochk "extern $try" $hdrs && endnetent_r_proto=I_D ;;
12000 case "$endnetent_r_proto" in
12001 ''|0) try='void endnetent_r(struct netent_data*);'
12002 ./protochk "extern $try" $hdrs && endnetent_r_proto=V_D ;;
12004 case "$endnetent_r_proto" in
12005 ''|0) d_endnetent_r=undef
12006 endnetent_r_proto=0
12007 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
12008 * ) case "$endnetent_r_proto" in
12009 REENTRANT_PROTO*) ;;
12010 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
12012 echo "Prototype: $try" ;;
12015 *) case "$usethreads" in
12016 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
12018 d_endnetent_r=undef
12019 endnetent_r_proto=0
12023 *) endnetent_r_proto=0
12027 : see if endprotoent exists
12028 set endprotoent d_endpent
12031 : see if endprotoent_r exists
12032 set endprotoent_r d_endprotoent_r
12034 case "$d_endprotoent_r" in
12036 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12037 case "$d_endprotoent_r_proto:$usethreads" in
12038 ":define") d_endprotoent_r_proto=define
12039 set d_endprotoent_r_proto endprotoent_r $hdrs
12043 case "$d_endprotoent_r_proto" in
12045 case "$endprotoent_r_proto" in
12046 ''|0) try='int endprotoent_r(struct protoent_data*);'
12047 ./protochk "extern $try" $hdrs && endprotoent_r_proto=I_D ;;
12049 case "$endprotoent_r_proto" in
12050 ''|0) try='void endprotoent_r(struct protoent_data*);'
12051 ./protochk "extern $try" $hdrs && endprotoent_r_proto=V_D ;;
12053 case "$endprotoent_r_proto" in
12054 ''|0) d_endprotoent_r=undef
12055 endprotoent_r_proto=0
12056 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
12057 * ) case "$endprotoent_r_proto" in
12058 REENTRANT_PROTO*) ;;
12059 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
12061 echo "Prototype: $try" ;;
12064 *) case "$usethreads" in
12065 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
12067 d_endprotoent_r=undef
12068 endprotoent_r_proto=0
12072 *) endprotoent_r_proto=0
12076 : see if endpwent exists
12077 set endpwent d_endpwent
12080 : see if this is a pwd.h system
12086 xxx=`./findhdr pwd.h`
12087 $cppstdin $cppflags $cppminus < $xxx >$$.h
12089 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
12097 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
12105 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
12113 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
12121 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
12129 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
12137 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
12145 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
12157 set d_pwquota; eval $setvar
12158 set d_pwage; eval $setvar
12159 set d_pwchange; eval $setvar
12160 set d_pwclass; eval $setvar
12161 set d_pwexpire; eval $setvar
12162 set d_pwcomment; eval $setvar
12163 set d_pwgecos; eval $setvar
12164 set d_pwpasswd; eval $setvar
12168 : see if endpwent_r exists
12169 set endpwent_r d_endpwent_r
12171 case "$d_endpwent_r" in
12173 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
12174 case "$d_endpwent_r_proto:$usethreads" in
12175 ":define") d_endpwent_r_proto=define
12176 set d_endpwent_r_proto endpwent_r $hdrs
12180 case "$d_endpwent_r_proto" in
12182 case "$endpwent_r_proto" in
12183 ''|0) try='int endpwent_r(FILE**);'
12184 ./protochk "extern $try" $hdrs && endpwent_r_proto=I_H ;;
12186 case "$endpwent_r_proto" in
12187 ''|0) try='void endpwent_r(FILE**);'
12188 ./protochk "extern $try" $hdrs && endpwent_r_proto=V_H ;;
12190 case "$endpwent_r_proto" in
12191 ''|0) d_endpwent_r=undef
12193 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
12194 * ) case "$endpwent_r_proto" in
12195 REENTRANT_PROTO*) ;;
12196 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
12198 echo "Prototype: $try" ;;
12201 *) case "$usethreads" in
12202 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
12209 *) endpwent_r_proto=0
12213 : see if endservent exists
12214 set endservent d_endsent
12217 : see if endservent_r exists
12218 set endservent_r d_endservent_r
12220 case "$d_endservent_r" in
12222 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12223 case "$d_endservent_r_proto:$usethreads" in
12224 ":define") d_endservent_r_proto=define
12225 set d_endservent_r_proto endservent_r $hdrs
12229 case "$d_endservent_r_proto" in
12231 case "$endservent_r_proto" in
12232 ''|0) try='int endservent_r(struct servent_data*);'
12233 ./protochk "extern $try" $hdrs && endservent_r_proto=I_D ;;
12235 case "$endservent_r_proto" in
12236 ''|0) try='void endservent_r(struct servent_data*);'
12237 ./protochk "extern $try" $hdrs && endservent_r_proto=V_D ;;
12239 case "$endservent_r_proto" in
12240 ''|0) d_endservent_r=undef
12241 endservent_r_proto=0
12242 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
12243 * ) case "$endservent_r_proto" in
12244 REENTRANT_PROTO*) ;;
12245 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
12247 echo "Prototype: $try" ;;
12250 *) case "$usethreads" in
12251 define) echo "endservent_r has no prototype, not using it." >&4 ;;
12253 d_endservent_r=undef
12254 endservent_r_proto=0
12258 *) endservent_r_proto=0
12262 : Locate the flags for 'open()'
12265 #include <sys/types.h>
12270 #include <sys/file.h>
12272 #$i_stdlib I_STDLIB
12274 #include <stdlib.h>
12285 : check sys/file.h first to get FREAD on Sun
12286 if $test `./findhdr sys/file.h` && \
12287 set try -DI_SYS_FILE && eval $compile; then
12289 echo "<sys/file.h> defines the O_* constants..." >&4
12290 if $run ./try; then
12291 echo "and you have the 3 argument form of open()." >&4
12294 echo "but not the 3 argument form of open(). Oh, well." >&4
12297 elif $test `./findhdr fcntl.h` && \
12298 set try -DI_FCNTL && eval $compile; then
12300 echo "<fcntl.h> defines the O_* constants..." >&4
12301 if $run ./try; then
12302 echo "and you have the 3 argument form of open()." >&4
12305 echo "but not the 3 argument form of open(). Oh, well." >&4
12310 echo "I can't find the O_* constant definitions! You got problems." >&4
12316 : script used to emit important warnings
12319 if test \$# -gt 0; then
12324 echo "*** WARNING:" >&4
12325 sed -e 's/^/*** /' <msg >&4
12327 cat msg >>config.msg
12328 echo " " >>config.msg
12334 : see which of string.h or strings.h is needed
12336 strings=`./findhdr string.h`
12337 if $test "$strings" && $test -r "$strings"; then
12338 echo "Using <string.h> instead of <strings.h>." >&4
12342 strings=`./findhdr strings.h`
12343 if $test "$strings" && $test -r "$strings"; then
12344 echo "Using <strings.h> instead of <string.h>." >&4
12346 ./warn "No string header found -- You'll surely have problems."
12351 case "$i_string" in
12352 "$undef") strings=`./findhdr strings.h`;;
12353 *) strings=`./findhdr string.h`;;
12356 : see if this is a sys/file.h system
12361 : do we need to include sys/file.h ?
12365 if $h_sysfile; then
12367 echo "We'll be including <sys/file.h>." >&4
12370 echo "We won't be including <sys/file.h>." >&4
12380 : see if fcntl.h is there
12385 : see if we can include fcntl.h
12391 echo "We'll be including <fcntl.h>." >&4
12394 if $h_sysfile; then
12395 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
12397 echo "We won't be including <fcntl.h>." >&4
12409 : see if fork exists
12413 : see if pipe exists
12417 : check for non-blocking I/O stuff
12418 case "$h_sysfile" in
12419 true) echo "#include <sys/file.h>" > head.c;;
12422 true) echo "#include <fcntl.h>" > head.c;;
12423 *) echo "#include <sys/fcntl.h>" > head.c;;
12428 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
12429 case "$o_nonblock" in
12431 $cat head.c > try.c
12432 $cat >>try.c <<EOCP
12434 #$i_stdlib I_STDLIB
12436 #include <stdlib.h>
12444 printf("O_NONBLOCK\n");
12448 printf("O_NDELAY\n");
12452 printf("FNDELAY\n");
12459 if eval $compile_ok; then
12460 o_nonblock=`$run ./try`
12461 case "$o_nonblock" in
12462 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
12463 *) echo "Seems like we can use $o_nonblock.";;
12466 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
12469 *) echo "Using $hint value $o_nonblock.";;
12474 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
12477 case "$d_fork:$d_pipe" in
12479 $cat head.c > try.c
12480 $cat >>try.c <<EOCP
12482 #include <sys/types.h>
12483 #include <signal.h>
12485 #$i_stdlib I_STDLIB
12487 #include <stdlib.h>
12493 #define MY_O_NONBLOCK $o_nonblock
12494 #ifndef errno /* XXX need better Configure test */
12497 #$i_unistd I_UNISTD
12499 #include <unistd.h>
12501 #$i_string I_STRING
12503 #include <string.h>
12505 #include <strings.h>
12507 $signal_t blech(int x) { exit(3); }
12509 $cat >> try.c <<'EOCP'
12517 pipe(pd); /* Down: child -> parent */
12518 pipe(pu); /* Up: parent -> child */
12521 close(pd[1]); /* Parent reads from pd[0] */
12522 close(pu[0]); /* Parent writes (blocking) to pu[1] */
12524 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
12529 signal(SIGALRM, blech);
12531 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
12533 sprintf(string, "%d\n", ret);
12534 write(2, string, strlen(string));
12537 if (errno == EAGAIN) {
12538 printf("EAGAIN\n");
12543 if (errno == EWOULDBLOCK)
12544 printf("EWOULDBLOCK\n");
12547 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
12548 sleep(2); /* Give it time to close our pipe */
12550 ret = read(pd[0], buf, 1); /* Should read EOF */
12552 sprintf(string, "%d\n", ret);
12553 write(4, string, strlen(string));
12557 close(pd[0]); /* We write to pd[1] */
12558 close(pu[1]); /* We read from pu[0] */
12559 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
12560 close(pd[1]); /* Pipe pd is now fully closed! */
12561 exit(0); /* Bye bye, thank you for playing! */
12565 if eval $compile_ok; then
12566 echo "$startsh" >mtry
12567 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
12569 ./mtry >/dev/null 2>&1
12571 0) eagain=`$cat try.out`;;
12572 1) echo "Could not perform non-blocking setting!";;
12573 2) echo "I did a successful read() for something that was not there!";;
12574 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
12575 4) echo "Could not find F_SETFL!";;
12576 *) echo "Something terribly wrong happened during testing.";;
12578 rd_nodata=`$cat try.ret`
12579 echo "A read() system call with no data present returns $rd_nodata."
12580 case "$rd_nodata" in
12583 echo "(That's peculiar, fixing that to be -1.)"
12589 echo "Forcing errno EAGAIN on read() with no data available."
12593 echo "Your read() sets errno to $eagain when no data is available."
12596 status=`$cat try.err`
12598 0) echo "And it correctly returns 0 to signal EOF.";;
12599 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
12600 *) echo "However, your read() returns '$status' on EOF??";;
12603 if test "$status" = "$rd_nodata"; then
12604 echo "WARNING: you can't distinguish between EOF and no data!"
12608 echo "I can't compile the test program--assuming errno EAGAIN will do."
12612 *) echo "Can't figure out how to test this--assuming errno EAGAIN will do."
12621 echo "Using $hint value $eagain."
12622 echo "Your read() returns $rd_nodata when no data is present."
12623 case "$d_eofnblk" in
12624 "$define") echo "And you can see EOF because read() returns 0.";;
12625 "$undef") echo "But you can't see EOF status from read() returned value.";;
12627 echo "(Assuming you can't see EOF status from read anyway.)"
12633 $rm_try head.c mtry
12635 : see if _ptr and _cnt from stdio act std
12638 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
12639 echo "(Looks like you have stdio.h from BSD.)"
12640 case "$stdio_ptr" in
12641 '') stdio_ptr='((fp)->_p)'
12644 *) ptr_lval=$d_stdio_ptr_lval;;
12646 case "$stdio_cnt" in
12647 '') stdio_cnt='((fp)->_r)'
12650 *) cnt_lval=$d_stdio_cnt_lval;;
12652 case "$stdio_base" in
12653 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
12655 case "$stdio_bufsiz" in
12656 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
12658 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
12659 echo "(Looks like you have stdio.h from Linux.)"
12660 case "$stdio_ptr" in
12661 '') stdio_ptr='((fp)->_IO_read_ptr)'
12664 *) ptr_lval=$d_stdio_ptr_lval;;
12666 case "$stdio_cnt" in
12667 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
12670 *) cnt_lval=$d_stdio_cnt_lval;;
12672 case "$stdio_base" in
12673 '') stdio_base='((fp)->_IO_read_base)';;
12675 case "$stdio_bufsiz" in
12676 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
12679 case "$stdio_ptr" in
12680 '') stdio_ptr='((fp)->_ptr)'
12683 *) ptr_lval=$d_stdio_ptr_lval;;
12685 case "$stdio_cnt" in
12686 '') stdio_cnt='((fp)->_cnt)'
12689 *) cnt_lval=$d_stdio_cnt_lval;;
12691 case "$stdio_base" in
12692 '') stdio_base='((fp)->_base)';;
12694 case "$stdio_bufsiz" in
12695 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
12699 : test whether _ptr and _cnt really work
12700 echo "Checking how std your stdio is..." >&4
12703 #$i_stdlib I_STDLIB
12705 #include <stdlib.h>
12707 #define FILE_ptr(fp) $stdio_ptr
12708 #define FILE_cnt(fp) $stdio_cnt
12710 FILE *fp = fopen("try.c", "r");
12713 18 <= FILE_cnt(fp) &&
12714 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12722 if eval $compile && $to try.c; then
12723 if $run ./try; then
12724 echo "Your stdio acts pretty std."
12727 echo "Your stdio isn't very std."
12730 echo "Your stdio doesn't appear very std."
12734 # glibc 2.2.90 and above apparently change stdio streams so Perl's
12735 # direct buffer manipulation no longer works. The Configure tests
12736 # should be changed to correctly detect this, but until then,
12737 # the following check should at least let perl compile and run.
12738 # (This quick fix should be updated before 5.8.1.)
12739 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
12740 # A. Dougherty, June 3, 2002.
12741 case "$d_gnulibc" in
12743 case "$gnulibc_version" in
12747 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
12756 : Can _ptr be used as an lvalue?
12757 case "$d_stdstdio$ptr_lval" in
12758 $define$define) val=$define ;;
12761 set d_stdio_ptr_lval
12764 : Can _cnt be used as an lvalue?
12765 case "$d_stdstdio$cnt_lval" in
12766 $define$define) val=$define ;;
12769 set d_stdio_cnt_lval
12773 : test whether setting _ptr sets _cnt as a side effect
12774 d_stdio_ptr_lval_sets_cnt="$undef"
12775 d_stdio_ptr_lval_nochange_cnt="$undef"
12776 case "$d_stdio_ptr_lval$d_stdstdio" in
12778 echo "Checking to see what happens if we set the stdio ptr..." >&4
12781 /* Can we scream? */
12782 /* Eat dust sed :-) */
12783 /* In the buffer space, no one can hear you scream. */
12784 #$i_stdlib I_STDLIB
12786 #include <stdlib.h>
12788 #define FILE_ptr(fp) $stdio_ptr
12789 #define FILE_cnt(fp) $stdio_cnt
12790 #include <sys/types.h>
12792 FILE *fp = fopen("try.c", "r");
12797 puts("Fail even to read");
12800 c = getc(fp); /* Read away the first # */
12802 puts("Fail even to read");
12806 18 <= FILE_cnt(fp) &&
12807 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12809 puts("Fail even to read");
12812 ptr = (char*) FILE_ptr(fp);
12813 cnt = (size_t)FILE_cnt(fp);
12815 FILE_ptr(fp) += 42;
12817 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
12818 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
12821 if (FILE_cnt(fp) <= 20) {
12822 printf ("Fail (<20 chars to test)");
12825 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
12826 puts("Fail compare");
12829 if (cnt == FILE_cnt(fp)) {
12830 puts("Pass_unchanged");
12833 if (FILE_cnt(fp) == (cnt - 42)) {
12834 puts("Pass_changed");
12837 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
12843 if eval $compile && $to try.c; then
12844 case `$run ./try` in
12846 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
12847 d_stdio_ptr_lval_sets_cnt="$define" ;;
12849 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
12850 d_stdio_ptr_lval_nochange_cnt="$define" ;;
12852 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
12854 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
12857 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
12863 : see if _base is also standard
12865 case "$d_stdstdio" in
12869 #$i_stdlib I_STDLIB
12871 #include <stdlib.h>
12873 #define FILE_base(fp) $stdio_base
12874 #define FILE_bufsiz(fp) $stdio_bufsiz
12876 FILE *fp = fopen("try.c", "r");
12879 19 <= FILE_bufsiz(fp) &&
12880 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
12887 if eval $compile && $to try.c; then
12888 if $run ./try; then
12889 echo "And its _base field acts std."
12892 echo "But its _base field isn't std."
12895 echo "However, it seems to be lacking the _base field."
12903 : see if fast_stdio exists
12905 case "$d_stdstdio:$d_stdio_ptr_lval" in
12907 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
12909 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
12920 : see if fchdir exists
12921 set fchdir d_fchdir
12924 : see if fchmod exists
12925 set fchmod d_fchmod
12928 : see if fchown exists
12929 set fchown d_fchown
12932 : see if this is an fcntl system
12936 : See if fcntl-based locking works.
12939 #$i_stdlib I_STDLIB
12941 #include <stdlib.h>
12943 #include <unistd.h>
12945 #include <signal.h>
12946 $signal_t blech(int x) { exit(3); }
12948 #if defined(F_SETLK) && defined(F_SETLKW)
12949 struct flock flock;
12951 fd = open("try.c", O_RDONLY);
12952 flock.l_type = F_RDLCK;
12953 flock.l_whence = SEEK_SET;
12954 flock.l_start = flock.l_len = 0;
12955 signal(SIGALRM, blech);
12957 retval = fcntl(fd, F_SETLK, &flock);
12959 (retval < 0 ? exit(2) : exit(0));
12965 echo "Checking if fcntl-based file locking works... "
12969 if eval $compile_ok; then
12970 if $run ./try; then
12971 echo "Yes, it seems to work."
12974 echo "Nope, it didn't work."
12979 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
12980 *** This is (almost) impossible.
12981 *** If your NFS lock daemons are not feeling well, something like
12982 *** this may happen, please investigate. Cannot continue, aborting.
12990 echo "I'm unable to compile the test program, so I'll assume not."
12995 echo "Nope, since you don't even have fcntl()."
12998 set d_fcntl_can_lock
13002 : check for fd_set items
13005 Checking to see how well your C compiler handles fd_set and friends ...
13008 #$i_stdlib I_STDLIB
13010 #include <stdlib.h>
13012 #$i_systime I_SYS_TIME
13013 #$i_sysselct I_SYS_SELECT
13014 #$d_socket HAS_SOCKET
13015 #include <sys/types.h>
13017 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
13020 #include <sys/time.h>
13022 #ifdef I_SYS_SELECT
13023 #include <sys/select.h>
13032 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
13040 if eval $compile; then
13041 d_fds_bits="$define"
13043 echo "Well, your system knows about the normal fd_set typedef..." >&4
13044 if $run ./try; then
13045 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
13046 d_fd_macros="$define"
13049 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
13051 d_fd_macros="$undef"
13055 Hmm, your compiler has some difficulty with fd_set. Checking further...
13058 if eval $compile; then
13059 d_fds_bits="$undef"
13061 echo "Well, your system has some sort of fd_set available..." >&4
13062 if $run ./try; then
13063 echo "and you have the normal fd_set macros." >&4
13064 d_fd_macros="$define"
13067 but not the normal fd_set macros! Gross! More work for me...
13069 d_fd_macros="$undef"
13072 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
13074 d_fds_bits="$undef"
13075 d_fd_macros="$undef"
13080 : see if fgetpos exists
13081 set fgetpos d_fgetpos
13084 : see if finite exists
13085 set finite d_finite
13088 : see if finitel exists
13089 set finitel d_finitel
13092 : see if flock exists
13096 : see if prototype for flock is available
13098 set d_flockproto flock $i_sysfile sys/file.h
13101 : see if fp_class exists
13102 set fp_class d_fp_class
13105 : see if pathconf exists
13106 set pathconf d_pathconf
13109 : see if fpathconf exists
13110 set fpathconf d_fpathconf
13113 : see if fpclass exists
13114 set fpclass d_fpclass
13117 : see if fpclassify exists
13118 set fpclassify d_fpclassify
13121 : see if fpclassl exists
13122 set fpclassl d_fpclassl
13125 : check for fpos64_t
13127 echo "Checking to see if you have fpos64_t..." >&4
13130 int main() { fpos64_t x = 7; }
13133 if eval $compile; then
13135 echo "You have fpos64_t."
13138 echo "You do not have fpos64_t."
13139 case "$fpossize" in
13140 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
13147 : see if frexpl exists
13148 set frexpl d_frexpl
13151 : see if this is a sys/param system
13152 set sys/param.h i_sysparam
13155 : see if this is a sys/mount.h system
13156 set sys/mount.h i_sysmount
13159 : Check for fs_data_s
13161 echo "Checking to see if your system supports struct fs_data..." >&4
13162 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
13164 case "$d_fs_data_s" in
13165 "$define") echo "Yes, it does." ;;
13166 *) echo "No, it doesn't." ;;
13169 : see if fseeko exists
13170 set fseeko d_fseeko
13172 case "$longsize" in
13173 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
13176 : see if fsetpos exists
13177 set fsetpos d_fsetpos
13180 : see if fstatfs exists
13181 set fstatfs d_fstatfs
13184 : see if statvfs exists
13185 set statvfs d_statvfs
13188 : see if fstatvfs exists
13189 set fstatvfs d_fstatvfs
13193 : see if fsync exists
13197 : see if ftello exists
13198 set ftello d_ftello
13200 case "$longsize" in
13201 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
13204 : check for a working futimes
13207 echo "Checking if you have a working futimes()" >&4
13210 #include <sys/time.h>
13217 fd = open ("try.c", O_RDWR);
13218 if (-1 == fd) exit (1);
13219 rv = futimes (fd, NULL);
13220 exit (rv == -1 ? errno : 0);
13224 if eval $compile; then
13228 0) echo "Yes, you have" >&4
13229 d_futimes="$define"
13231 *) echo "No, you have futimes, but it isn't working ($rc) (probably harmless)" >&4
13235 echo "No, it does not (probably harmless)" >&4
13239 : see if getcwd exists
13240 set getcwd d_getcwd
13243 : see if getespwnam exists
13244 set getespwnam d_getespwnam
13247 : see if getfsstat exists
13248 set getfsstat d_getfsstat
13251 : see if getgrent exists
13252 set getgrent d_getgrent
13255 : see if getgrent_r exists
13256 set getgrent_r d_getgrent_r
13258 case "$d_getgrent_r" in
13260 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13261 case "$d_getgrent_r_proto:$usethreads" in
13262 ":define") d_getgrent_r_proto=define
13263 set d_getgrent_r_proto getgrent_r $hdrs
13267 case "$d_getgrent_r_proto" in
13269 case "$getgrent_r_proto" in
13270 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
13271 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBWR ;;
13273 case "$getgrent_r_proto" in
13274 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
13275 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIR ;;
13277 case "$getgrent_r_proto" in
13278 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
13279 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBW ;;
13281 case "$getgrent_r_proto" in
13282 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
13283 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBI ;;
13285 case "$getgrent_r_proto" in
13286 ''|0) try='int getgrent_r(struct group*, char*, int);'
13287 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBI ;;
13289 case "$getgrent_r_proto" in
13290 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
13291 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIH ;;
13293 case "$getgrent_r_proto" in
13294 ''|0) d_getgrent_r=undef
13296 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
13297 * ) case "$getgrent_r_proto" in
13298 REENTRANT_PROTO*) ;;
13299 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
13301 echo "Prototype: $try" ;;
13304 *) case "$usethreads" in
13305 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
13312 *) getgrent_r_proto=0
13316 : see if getgrgid_r exists
13317 set getgrgid_r d_getgrgid_r
13319 case "$d_getgrgid_r" in
13321 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13322 case "$d_getgrgid_r_proto:$usethreads" in
13323 ":define") d_getgrgid_r_proto=define
13324 set d_getgrgid_r_proto getgrgid_r $hdrs
13328 case "$d_getgrgid_r_proto" in
13330 case "$getgrgid_r_proto" in
13331 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
13332 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
13334 case "$getgrgid_r_proto" in
13335 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
13336 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
13338 case "$getgrgid_r_proto" in
13339 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
13340 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
13342 case "$getgrgid_r_proto" in
13343 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
13344 ./protochk "extern $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
13346 case "$getgrgid_r_proto" in
13347 ''|0) d_getgrgid_r=undef
13349 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
13350 * ) case "$getgrgid_r_proto" in
13351 REENTRANT_PROTO*) ;;
13352 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
13354 echo "Prototype: $try" ;;
13357 *) case "$usethreads" in
13358 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
13365 *) getgrgid_r_proto=0
13369 : see if getgrnam_r exists
13370 set getgrnam_r d_getgrnam_r
13372 case "$d_getgrnam_r" in
13374 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13375 case "$d_getgrnam_r_proto:$usethreads" in
13376 ":define") d_getgrnam_r_proto=define
13377 set d_getgrnam_r_proto getgrnam_r $hdrs
13381 case "$d_getgrnam_r_proto" in
13383 case "$getgrnam_r_proto" in
13384 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
13385 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
13387 case "$getgrnam_r_proto" in
13388 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
13389 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
13391 case "$getgrnam_r_proto" in
13392 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
13393 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CBI ;;
13395 case "$getgrnam_r_proto" in
13396 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
13397 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
13399 case "$getgrnam_r_proto" in
13400 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
13401 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
13403 case "$getgrnam_r_proto" in
13404 ''|0) d_getgrnam_r=undef
13406 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
13407 * ) case "$getgrnam_r_proto" in
13408 REENTRANT_PROTO*) ;;
13409 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
13411 echo "Prototype: $try" ;;
13414 *) case "$usethreads" in
13415 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
13422 *) getgrnam_r_proto=0
13426 : see if gethostbyaddr exists
13427 set gethostbyaddr d_gethbyaddr
13430 : see if gethostbyname exists
13431 set gethostbyname d_gethbyname
13434 : see if gethostent exists
13435 set gethostent d_gethent
13438 : see how we will look up host name
13441 if set gethostname val -f d_gethname; eval $csym; $val; then
13442 echo 'gethostname() found.' >&4
13443 d_gethname="$define"
13446 if set uname val -f d_uname; eval $csym; $val; then
13449 uname() was found, but you're running xenix, and older versions of xenix
13450 have a broken uname(). If you don't really know whether your xenix is old
13451 enough to have a broken system call, use the default answer.
13456 "$define") dflt=n;;
13458 rp='Is your uname() broken?'
13461 n*) d_uname="$define"; call=uname;;
13464 echo 'uname() found.' >&4
13471 case "$d_gethname" in
13472 '') d_gethname="$undef";;
13475 '') d_uname="$undef";;
13477 case "$d_uname$d_gethname" in
13482 Every now and then someone has a $call() that lies about the hostname
13483 but can't be fixed for political or economic reasons. If you wish, I can
13484 pretend $call() isn't there and maybe compute hostname at run-time
13485 thanks to the '$phostname' command.
13488 rp="Shall I ignore $call() from now on?"
13491 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
13494 case "$phostname" in
13495 '') aphostname='';;
13496 *) case "$aphostname" in
13498 *) set X $phostname
13502 file=`./loc $file $file $pth`
13503 aphostname=`echo $file $*`
13508 case "$d_uname$d_gethname" in
13511 case "$phostname" in
13513 echo "There will be no way for $package to get your hostname." >&4;;
13515 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
13519 case "$d_phostname" in
13520 '') d_phostname="$undef";;
13523 : see if gethostbyaddr_r exists
13524 set gethostbyaddr_r d_gethostbyaddr_r
13526 case "$d_gethostbyaddr_r" in
13528 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13529 case "$d_gethostbyaddr_r_proto:$usethreads" in
13530 ":define") d_gethostbyaddr_r_proto=define
13531 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
13535 case "$d_gethostbyaddr_r_proto" in
13537 case "$gethostbyaddr_r_proto" in
13538 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13539 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
13541 case "$gethostbyaddr_r_proto" in
13542 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
13543 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
13545 case "$gethostbyaddr_r_proto" in
13546 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
13547 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
13549 case "$gethostbyaddr_r_proto" in
13550 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
13551 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
13553 case "$gethostbyaddr_r_proto" in
13554 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
13555 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
13557 case "$gethostbyaddr_r_proto" in
13558 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
13559 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
13561 case "$gethostbyaddr_r_proto" in
13562 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
13563 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
13565 case "$gethostbyaddr_r_proto" in
13566 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
13567 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
13569 case "$gethostbyaddr_r_proto" in
13570 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
13571 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
13573 case "$gethostbyaddr_r_proto" in
13574 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
13575 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
13577 case "$gethostbyaddr_r_proto" in
13578 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13579 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
13581 case "$gethostbyaddr_r_proto" in
13582 ''|0) d_gethostbyaddr_r=undef
13583 gethostbyaddr_r_proto=0
13584 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
13585 * ) case "$gethostbyaddr_r_proto" in
13586 REENTRANT_PROTO*) ;;
13587 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
13589 echo "Prototype: $try" ;;
13592 *) case "$usethreads" in
13593 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
13595 d_gethostbyaddr_r=undef
13596 gethostbyaddr_r_proto=0
13600 *) gethostbyaddr_r_proto=0
13604 : see if gethostbyname_r exists
13605 set gethostbyname_r d_gethostbyname_r
13607 case "$d_gethostbyname_r" in
13609 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13610 case "$d_gethostbyname_r_proto:$usethreads" in
13611 ":define") d_gethostbyname_r_proto=define
13612 set d_gethostbyname_r_proto gethostbyname_r $hdrs
13616 case "$d_gethostbyname_r_proto" in
13618 case "$gethostbyname_r_proto" in
13619 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
13620 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
13622 case "$gethostbyname_r_proto" in
13623 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
13624 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
13626 case "$gethostbyname_r_proto" in
13627 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
13628 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
13630 case "$gethostbyname_r_proto" in
13631 ''|0) d_gethostbyname_r=undef
13632 gethostbyname_r_proto=0
13633 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
13634 * ) case "$gethostbyname_r_proto" in
13635 REENTRANT_PROTO*) ;;
13636 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
13638 echo "Prototype: $try" ;;
13641 *) case "$usethreads" in
13642 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
13644 d_gethostbyname_r=undef
13645 gethostbyname_r_proto=0
13649 *) gethostbyname_r_proto=0
13653 : see if gethostent_r exists
13654 set gethostent_r d_gethostent_r
13656 case "$d_gethostent_r" in
13658 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13659 case "$d_gethostent_r_proto:$usethreads" in
13660 ":define") d_gethostent_r_proto=define
13661 set d_gethostent_r_proto gethostent_r $hdrs
13665 case "$d_gethostent_r_proto" in
13667 case "$gethostent_r_proto" in
13668 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
13669 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
13671 case "$gethostent_r_proto" in
13672 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
13673 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBIE ;;
13675 case "$gethostent_r_proto" in
13676 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
13677 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBIE ;;
13679 case "$gethostent_r_proto" in
13680 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
13681 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBI ;;
13683 case "$gethostent_r_proto" in
13684 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
13685 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBI ;;
13687 case "$gethostent_r_proto" in
13688 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
13689 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SD ;;
13691 case "$gethostent_r_proto" in
13692 ''|0) d_gethostent_r=undef
13693 gethostent_r_proto=0
13694 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
13695 * ) case "$gethostent_r_proto" in
13696 REENTRANT_PROTO*) ;;
13697 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
13699 echo "Prototype: $try" ;;
13702 *) case "$usethreads" in
13703 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
13705 d_gethostent_r=undef
13706 gethostent_r_proto=0
13710 *) gethostent_r_proto=0
13714 : see if prototypes for various gethostxxx netdb.h functions are available
13716 set d_gethostprotos gethostent $i_netdb netdb.h
13719 : see if getitimer exists
13720 set getitimer d_getitimer
13723 : see if getlogin exists
13724 set getlogin d_getlogin
13727 : see if getlogin_r exists
13728 set getlogin_r d_getlogin_r
13730 case "$d_getlogin_r" in
13732 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
13733 case "$d_getlogin_r_proto:$usethreads" in
13734 ":define") d_getlogin_r_proto=define
13735 set d_getlogin_r_proto getlogin_r $hdrs
13739 case "$d_getlogin_r_proto" in
13741 case "$getlogin_r_proto" in
13742 ''|0) try='int getlogin_r(char*, size_t);'
13743 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BW ;;
13745 case "$getlogin_r_proto" in
13746 ''|0) try='int getlogin_r(char*, int);'
13747 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BI ;;
13749 case "$getlogin_r_proto" in
13750 ''|0) try='char* getlogin_r(char*, size_t);'
13751 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BW ;;
13753 case "$getlogin_r_proto" in
13754 ''|0) try='char* getlogin_r(char*, int);'
13755 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BI ;;
13757 case "$getlogin_r_proto" in
13758 ''|0) d_getlogin_r=undef
13760 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
13761 * ) case "$getlogin_r_proto" in
13762 REENTRANT_PROTO*) ;;
13763 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
13765 echo "Prototype: $try" ;;
13768 *) case "$usethreads" in
13769 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
13776 *) getlogin_r_proto=0
13780 : see if getmnt exists
13781 set getmnt d_getmnt
13784 : see if getmntent exists
13785 set getmntent d_getmntent
13788 : see if getnetbyaddr exists
13789 set getnetbyaddr d_getnbyaddr
13792 : see if getnetbyname exists
13793 set getnetbyname d_getnbyname
13796 : see if getnetent exists
13797 set getnetent d_getnent
13800 : see if getnetbyaddr_r exists
13801 set getnetbyaddr_r d_getnetbyaddr_r
13803 case "$d_getnetbyaddr_r" in
13805 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13806 case "$d_getnetbyaddr_r_proto:$usethreads" in
13807 ":define") d_getnetbyaddr_r_proto=define
13808 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
13812 case "$d_getnetbyaddr_r_proto" in
13814 case "$getnetbyaddr_r_proto" in
13815 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
13816 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
13818 case "$getnetbyaddr_r_proto" in
13819 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
13820 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
13822 case "$getnetbyaddr_r_proto" in
13823 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
13824 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
13826 case "$getnetbyaddr_r_proto" in
13827 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
13828 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
13830 case "$getnetbyaddr_r_proto" in
13831 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
13832 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
13834 case "$getnetbyaddr_r_proto" in
13835 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
13836 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
13838 case "$getnetbyaddr_r_proto" in
13839 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
13840 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
13842 case "$getnetbyaddr_r_proto" in
13843 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
13844 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
13846 case "$getnetbyaddr_r_proto" in
13847 ''|0) d_getnetbyaddr_r=undef
13848 getnetbyaddr_r_proto=0
13849 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
13850 * ) case "$getnetbyaddr_r_proto" in
13851 REENTRANT_PROTO*) ;;
13852 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
13854 echo "Prototype: $try" ;;
13857 *) case "$usethreads" in
13858 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
13860 d_getnetbyaddr_r=undef
13861 getnetbyaddr_r_proto=0
13865 *) getnetbyaddr_r_proto=0
13869 : see if getnetbyname_r exists
13870 set getnetbyname_r d_getnetbyname_r
13872 case "$d_getnetbyname_r" in
13874 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13875 case "$d_getnetbyname_r_proto:$usethreads" in
13876 ":define") d_getnetbyname_r_proto=define
13877 set d_getnetbyname_r_proto getnetbyname_r $hdrs
13881 case "$d_getnetbyname_r_proto" in
13883 case "$getnetbyname_r_proto" in
13884 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
13885 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
13887 case "$getnetbyname_r_proto" in
13888 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
13889 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
13891 case "$getnetbyname_r_proto" in
13892 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
13893 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
13895 case "$getnetbyname_r_proto" in
13896 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
13897 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
13899 case "$getnetbyname_r_proto" in
13900 ''|0) d_getnetbyname_r=undef
13901 getnetbyname_r_proto=0
13902 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
13903 * ) case "$getnetbyname_r_proto" in
13904 REENTRANT_PROTO*) ;;
13905 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
13907 echo "Prototype: $try" ;;
13910 *) case "$usethreads" in
13911 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
13913 d_getnetbyname_r=undef
13914 getnetbyname_r_proto=0
13918 *) getnetbyname_r_proto=0
13922 : see if getnetent_r exists
13923 set getnetent_r d_getnetent_r
13925 case "$d_getnetent_r" in
13927 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13928 case "$d_getnetent_r_proto:$usethreads" in
13929 ":define") d_getnetent_r_proto=define
13930 set d_getnetent_r_proto getnetent_r $hdrs
13934 case "$d_getnetent_r_proto" in
13936 case "$getnetent_r_proto" in
13937 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
13938 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
13940 case "$getnetent_r_proto" in
13941 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
13942 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBIE ;;
13944 case "$getnetent_r_proto" in
13945 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
13946 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBIE ;;
13948 case "$getnetent_r_proto" in
13949 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
13950 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBI ;;
13952 case "$getnetent_r_proto" in
13953 ''|0) try='int getnetent_r(struct netent*, char*, int);'
13954 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBI ;;
13956 case "$getnetent_r_proto" in
13957 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
13958 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SD ;;
13960 case "$getnetent_r_proto" in
13961 ''|0) d_getnetent_r=undef
13962 getnetent_r_proto=0
13963 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
13964 * ) case "$getnetent_r_proto" in
13965 REENTRANT_PROTO*) ;;
13966 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
13968 echo "Prototype: $try" ;;
13971 *) case "$usethreads" in
13972 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
13974 d_getnetent_r=undef
13975 getnetent_r_proto=0
13979 *) getnetent_r_proto=0
13983 : see if prototypes for various getnetxxx netdb.h functions are available
13985 set d_getnetprotos getnetent $i_netdb netdb.h
13988 : see if getpagesize exists
13989 set getpagesize d_getpagsz
13992 : Optional checks for getprotobyname and getprotobynumber
13994 : see if getprotobyname exists
13995 set getprotobyname d_getpbyname
13998 : see if getprotobynumber exists
13999 set getprotobynumber d_getpbynumber
14002 : see if getprotoent exists
14003 set getprotoent d_getpent
14006 : see if getpgid exists
14007 set getpgid d_getpgid
14010 : see if getpgrp2 exists
14011 set getpgrp2 d_getpgrp2
14014 : see if getppid exists
14015 set getppid d_getppid
14018 : see if getpriority exists
14019 set getpriority d_getprior
14022 : see if getprotobyname_r exists
14023 set getprotobyname_r d_getprotobyname_r
14025 case "$d_getprotobyname_r" in
14027 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14028 case "$d_getprotobyname_r_proto:$usethreads" in
14029 ":define") d_getprotobyname_r_proto=define
14030 set d_getprotobyname_r_proto getprotobyname_r $hdrs
14034 case "$d_getprotobyname_r_proto" in
14036 case "$getprotobyname_r_proto" in
14037 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
14038 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
14040 case "$getprotobyname_r_proto" in
14041 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
14042 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
14044 case "$getprotobyname_r_proto" in
14045 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
14046 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
14048 case "$getprotobyname_r_proto" in
14049 ''|0) d_getprotobyname_r=undef
14050 getprotobyname_r_proto=0
14051 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
14052 * ) case "$getprotobyname_r_proto" in
14053 REENTRANT_PROTO*) ;;
14054 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
14056 echo "Prototype: $try" ;;
14059 *) case "$usethreads" in
14060 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
14062 d_getprotobyname_r=undef
14063 getprotobyname_r_proto=0
14067 *) getprotobyname_r_proto=0
14071 : see if getprotobynumber_r exists
14072 set getprotobynumber_r d_getprotobynumber_r
14074 case "$d_getprotobynumber_r" in
14076 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14077 case "$d_getprotobynumber_r_proto:$usethreads" in
14078 ":define") d_getprotobynumber_r_proto=define
14079 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
14083 case "$d_getprotobynumber_r_proto" in
14085 case "$getprotobynumber_r_proto" in
14086 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
14087 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
14089 case "$getprotobynumber_r_proto" in
14090 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
14091 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
14093 case "$getprotobynumber_r_proto" in
14094 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
14095 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
14097 case "$getprotobynumber_r_proto" in
14098 ''|0) d_getprotobynumber_r=undef
14099 getprotobynumber_r_proto=0
14100 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
14101 * ) case "$getprotobynumber_r_proto" in
14102 REENTRANT_PROTO*) ;;
14103 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
14105 echo "Prototype: $try" ;;
14108 *) case "$usethreads" in
14109 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
14111 d_getprotobynumber_r=undef
14112 getprotobynumber_r_proto=0
14116 *) getprotobynumber_r_proto=0
14120 : see if getprotoent_r exists
14121 set getprotoent_r d_getprotoent_r
14123 case "$d_getprotoent_r" in
14125 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14126 case "$d_getprotoent_r_proto:$usethreads" in
14127 ":define") d_getprotoent_r_proto=define
14128 set d_getprotoent_r_proto getprotoent_r $hdrs
14132 case "$d_getprotoent_r_proto" in
14134 case "$getprotoent_r_proto" in
14135 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
14136 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
14138 case "$getprotoent_r_proto" in
14139 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
14140 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBI ;;
14142 case "$getprotoent_r_proto" in
14143 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
14144 ./protochk "extern $try" $hdrs && getprotoent_r_proto=S_SBI ;;
14146 case "$getprotoent_r_proto" in
14147 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
14148 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SD ;;
14150 case "$getprotoent_r_proto" in
14151 ''|0) d_getprotoent_r=undef
14152 getprotoent_r_proto=0
14153 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
14154 * ) case "$getprotoent_r_proto" in
14155 REENTRANT_PROTO*) ;;
14156 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
14158 echo "Prototype: $try" ;;
14161 *) case "$usethreads" in
14162 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
14164 d_getprotoent_r=undef
14165 getprotoent_r_proto=0
14169 *) getprotoent_r_proto=0
14173 : see if prototypes for various getprotoxxx netdb.h functions are available
14175 set d_getprotoprotos getprotoent $i_netdb netdb.h
14178 : see if getprpwnam exists
14179 set getprpwnam d_getprpwnam
14182 : see if getpwent exists
14183 set getpwent d_getpwent
14186 : see if getpwent_r exists
14187 set getpwent_r d_getpwent_r
14189 case "$d_getpwent_r" in
14191 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14192 case "$d_getpwent_r_proto:$usethreads" in
14193 ":define") d_getpwent_r_proto=define
14194 set d_getpwent_r_proto getpwent_r $hdrs
14198 case "$d_getpwent_r_proto" in
14200 case "$getpwent_r_proto" in
14201 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
14202 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBWR ;;
14204 case "$getpwent_r_proto" in
14205 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
14206 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIR ;;
14208 case "$getpwent_r_proto" in
14209 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
14210 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBW ;;
14212 case "$getpwent_r_proto" in
14213 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
14214 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBI ;;
14216 case "$getpwent_r_proto" in
14217 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
14218 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBI ;;
14220 case "$getpwent_r_proto" in
14221 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
14222 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIH ;;
14224 case "$getpwent_r_proto" in
14225 ''|0) d_getpwent_r=undef
14227 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
14228 * ) case "$getpwent_r_proto" in
14229 REENTRANT_PROTO*) ;;
14230 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
14232 echo "Prototype: $try" ;;
14235 *) case "$usethreads" in
14236 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
14243 *) getpwent_r_proto=0
14247 : see if getpwnam_r exists
14248 set getpwnam_r d_getpwnam_r
14250 case "$d_getpwnam_r" in
14252 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14253 case "$d_getpwnam_r_proto:$usethreads" in
14254 ":define") d_getpwnam_r_proto=define
14255 set d_getpwnam_r_proto getpwnam_r $hdrs
14259 case "$d_getpwnam_r_proto" in
14261 case "$getpwnam_r_proto" in
14262 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
14263 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
14265 case "$getpwnam_r_proto" in
14266 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
14267 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
14269 case "$getpwnam_r_proto" in
14270 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
14271 ./protochk "extern $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
14273 case "$getpwnam_r_proto" in
14274 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
14275 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
14277 case "$getpwnam_r_proto" in
14278 ''|0) d_getpwnam_r=undef
14280 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
14281 * ) case "$getpwnam_r_proto" in
14282 REENTRANT_PROTO*) ;;
14283 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
14285 echo "Prototype: $try" ;;
14288 *) case "$usethreads" in
14289 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
14296 *) getpwnam_r_proto=0
14300 : see if getpwuid_r exists
14301 set getpwuid_r d_getpwuid_r
14303 case "$d_getpwuid_r" in
14305 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14306 case "$d_getpwuid_r_proto:$usethreads" in
14307 ":define") d_getpwuid_r_proto=define
14308 set d_getpwuid_r_proto getpwuid_r $hdrs
14312 case "$d_getpwuid_r_proto" in
14314 case "$getpwuid_r_proto" in
14315 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
14316 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
14318 case "$getpwuid_r_proto" in
14319 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
14320 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
14322 case "$getpwuid_r_proto" in
14323 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
14324 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
14326 case "$getpwuid_r_proto" in
14327 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
14328 ./protochk "extern $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
14330 case "$getpwuid_r_proto" in
14331 ''|0) d_getpwuid_r=undef
14333 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
14334 * ) case "$getpwuid_r_proto" in
14335 REENTRANT_PROTO*) ;;
14336 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
14338 echo "Prototype: $try" ;;
14341 *) case "$usethreads" in
14342 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
14349 *) getpwuid_r_proto=0
14353 : Optional checks for getsbyname and getsbyport
14355 : see if getservbyname exists
14356 set getservbyname d_getsbyname
14359 : see if getservbyport exists
14360 set getservbyport d_getsbyport
14363 : see if getservent exists
14364 set getservent d_getsent
14367 : see if getservbyname_r exists
14368 set getservbyname_r d_getservbyname_r
14370 case "$d_getservbyname_r" in
14372 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14373 case "$d_getservbyname_r_proto:$usethreads" in
14374 ":define") d_getservbyname_r_proto=define
14375 set d_getservbyname_r_proto getservbyname_r $hdrs
14379 case "$d_getservbyname_r_proto" in
14381 case "$getservbyname_r_proto" in
14382 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
14383 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
14385 case "$getservbyname_r_proto" in
14386 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
14387 ./protochk "extern $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
14389 case "$getservbyname_r_proto" in
14390 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
14391 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
14393 case "$getservbyname_r_proto" in
14394 ''|0) d_getservbyname_r=undef
14395 getservbyname_r_proto=0
14396 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
14397 * ) case "$getservbyname_r_proto" in
14398 REENTRANT_PROTO*) ;;
14399 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
14401 echo "Prototype: $try" ;;
14404 *) case "$usethreads" in
14405 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
14407 d_getservbyname_r=undef
14408 getservbyname_r_proto=0
14412 *) getservbyname_r_proto=0
14416 : see if getservbyport_r exists
14417 set getservbyport_r d_getservbyport_r
14419 case "$d_getservbyport_r" in
14421 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14422 case "$d_getservbyport_r_proto:$usethreads" in
14423 ":define") d_getservbyport_r_proto=define
14424 set d_getservbyport_r_proto getservbyport_r $hdrs
14428 case "$d_getservbyport_r_proto" in
14430 case "$getservbyport_r_proto" in
14431 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
14432 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
14434 case "$getservbyport_r_proto" in
14435 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
14436 ./protochk "extern $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
14438 case "$getservbyport_r_proto" in
14439 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
14440 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
14442 case "$getservbyport_r_proto" in
14443 ''|0) d_getservbyport_r=undef
14444 getservbyport_r_proto=0
14445 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
14446 * ) case "$getservbyport_r_proto" in
14447 REENTRANT_PROTO*) ;;
14448 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
14450 echo "Prototype: $try" ;;
14453 *) case "$usethreads" in
14454 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
14456 d_getservbyport_r=undef
14457 getservbyport_r_proto=0
14461 *) getservbyport_r_proto=0
14465 : see if getservent_r exists
14466 set getservent_r d_getservent_r
14468 case "$d_getservent_r" in
14470 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14471 case "$d_getservent_r_proto:$usethreads" in
14472 ":define") d_getservent_r_proto=define
14473 set d_getservent_r_proto getservent_r $hdrs
14477 case "$d_getservent_r_proto" in
14479 case "$getservent_r_proto" in
14480 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
14481 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBWR ;;
14483 case "$getservent_r_proto" in
14484 ''|0) try='int getservent_r(struct servent*, char*, int);'
14485 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBI ;;
14487 case "$getservent_r_proto" in
14488 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
14489 ./protochk "extern $try" $hdrs && getservent_r_proto=S_SBI ;;
14491 case "$getservent_r_proto" in
14492 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
14493 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SD ;;
14495 case "$getservent_r_proto" in
14496 ''|0) d_getservent_r=undef
14497 getservent_r_proto=0
14498 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
14499 * ) case "$getservent_r_proto" in
14500 REENTRANT_PROTO*) ;;
14501 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
14503 echo "Prototype: $try" ;;
14506 *) case "$usethreads" in
14507 define) echo "getservent_r has no prototype, not using it." >&4 ;;
14509 d_getservent_r=undef
14510 getservent_r_proto=0
14514 *) getservent_r_proto=0
14518 : see if prototypes for various getservxxx netdb.h functions are available
14520 set d_getservprotos getservent $i_netdb netdb.h
14523 : see if getspnam exists
14524 set getspnam d_getspnam
14527 : see if this is a shadow.h system
14528 set shadow.h i_shadow
14531 : see if getspnam_r exists
14532 set getspnam_r d_getspnam_r
14534 case "$d_getspnam_r" in
14536 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
14537 case "$d_getspnam_r_proto:$usethreads" in
14538 ":define") d_getspnam_r_proto=define
14539 set d_getspnam_r_proto getspnam_r $hdrs
14543 case "$d_getspnam_r_proto" in
14545 case "$getspnam_r_proto" in
14546 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
14547 ./protochk "extern $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
14549 case "$getspnam_r_proto" in
14550 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
14551 ./protochk "extern $try" $hdrs && getspnam_r_proto=S_CSBI ;;
14553 case "$getspnam_r_proto" in
14554 ''|0) d_getspnam_r=undef
14556 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
14557 * ) case "$getspnam_r_proto" in
14558 REENTRANT_PROTO*) ;;
14559 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
14561 echo "Prototype: $try" ;;
14564 *) case "$usethreads" in
14565 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
14572 *) getspnam_r_proto=0
14576 : see if gettimeofday or ftime exists
14577 set gettimeofday d_gettimeod
14579 case "$d_gettimeod" in
14585 val="$undef"; set d_ftime; eval $setvar
14588 case "$d_gettimeod$d_ftime" in
14591 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
14595 : see if gmtime_r exists
14596 set gmtime_r d_gmtime_r
14598 case "$d_gmtime_r" in
14600 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14601 case "$d_gmtime_r_proto:$usethreads" in
14602 ":define") d_gmtime_r_proto=define
14603 set d_gmtime_r_proto gmtime_r $hdrs
14607 case "$d_gmtime_r_proto" in
14609 case "$gmtime_r_proto" in
14610 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
14611 ./protochk "extern $try" $hdrs && gmtime_r_proto=S_TS ;;
14613 case "$gmtime_r_proto" in
14614 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
14615 ./protochk "extern $try" $hdrs && gmtime_r_proto=I_TS ;;
14617 case "$gmtime_r_proto" in
14618 ''|0) d_gmtime_r=undef
14620 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
14621 * ) case "$gmtime_r_proto" in
14622 REENTRANT_PROTO*) ;;
14623 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
14625 echo "Prototype: $try" ;;
14628 *) case "$usethreads" in
14629 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
14636 *) gmtime_r_proto=0
14640 : see if hasmntopt exists
14641 set hasmntopt d_hasmntopt
14644 : see if this is a netinet/in.h or sys/in.h system
14645 set netinet/in.h i_niin sys/in.h i_sysin
14648 : see if arpa/inet.h has to be included
14649 set arpa/inet.h i_arpainet
14652 : see if htonl --and friends-- exists
14657 : Maybe they are macros.
14660 $cat >htonl.c <<EOM
14662 #include <sys/types.h>
14663 #$i_niin I_NETINET_IN
14665 #$i_arpainet I_ARPA_INET
14666 #ifdef I_NETINET_IN
14667 #include <netinet/in.h>
14670 #include <sys/in.h>
14673 #include <arpa/inet.h>
14676 printf("Defined as a macro.");
14679 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
14680 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
14682 echo "But it seems to be defined as a macro." >&4
14690 : see if ilogbl exists
14691 set ilogbl d_ilogbl
14696 if set index val -f; eval $csym; $val; then
14697 if set strchr val -f d_strchr; eval $csym; $val; then
14698 if $contains strchr "$strings" >/dev/null 2>&1 ; then
14701 echo "strchr() found." >&4
14705 echo "index() found." >&4
14710 echo "index() found." >&4
14713 if set strchr val -f d_strchr; eval $csym; $val; then
14716 echo "strchr() found." >&4
14718 echo "No index() or strchr() found!" >&4
14723 set d_strchr; eval $setvar
14725 set d_index; eval $setvar
14727 : check whether inet_aton exists
14728 set inet_aton d_inetaton
14733 $cat >isascii.c <<EOCP
14736 #$i_stdlib I_STDLIB
14738 #include <stdlib.h>
14749 if eval $compile; then
14750 echo "isascii() found." >&4
14753 echo "isascii() NOT found." >&4
14760 : see if isfinite exists
14761 set isfinite d_isfinite
14764 : see if isinf exists
14768 : see if isnan exists
14772 : see if isnanl exists
14773 set isnanl d_isnanl
14776 : see if killpg exists
14777 set killpg d_killpg
14780 : see if lchown exists
14782 $cat > try.c <<'EOCP'
14783 /* System header to define __stub macros and hopefully few prototypes,
14784 which can conflict with char lchown(); below. */
14785 #include <assert.h>
14786 /* Override any gcc2 internal prototype to avoid an error. */
14787 /* We use char because int might match the return type of a gcc2
14788 builtin and then its argument prototype would still apply. */
14791 /* The GNU C library defines this for functions which it implements
14792 to always fail with ENOSYS. Some functions are actually named
14793 something starting with __ and the normal name is an alias. */
14794 #if defined (__stub_lchown) || defined (__stub___lchown)
14802 if eval $compile; then
14803 $echo "lchown() found." >&4
14806 $echo "lchown() NOT found." >&4
14812 : See if number of significant digits in a double precision number is known
14814 $cat >ldbl_dig.c <<EOM
14815 #$i_limits I_LIMITS
14818 #include <limits.h>
14824 printf("Contains LDBL_DIG");
14827 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
14828 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
14829 echo "LDBL_DIG found." >&4
14832 echo "LDBL_DIG NOT found." >&4
14839 : see if this is a math.h system
14843 : check to see if math.h defines _LIB_VERSION
14844 d_libm_lib_version="$undef"
14848 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
14850 #include <unistd.h>
14852 int main (int argc, char *argv[])
14854 printf ("%d\n", _LIB_VERSION);
14859 if eval $compile; then
14861 echo "Yes, it does ($foo)" >&4
14862 d_libm_lib_version="$define"
14864 echo "No, it does not (probably harmless)" >&4
14871 : see if link exists
14875 : see if localtime_r exists
14876 set localtime_r d_localtime_r
14878 case "$d_localtime_r" in
14880 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14881 case "$d_localtime_r_proto:$usethreads" in
14882 ":define") d_localtime_r_proto=define
14883 set d_localtime_r_proto localtime_r $hdrs
14887 case "$d_localtime_r_proto" in
14889 case "$localtime_r_proto" in
14890 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
14891 ./protochk "extern $try" $hdrs && localtime_r_proto=S_TS ;;
14893 case "$localtime_r_proto" in
14894 ''|0) try='int localtime_r(const time_t*, struct tm*);'
14895 ./protochk "extern $try" $hdrs && localtime_r_proto=I_TS ;;
14897 case "$localtime_r_proto" in
14898 ''|0) d_localtime_r=undef
14899 localtime_r_proto=0
14900 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
14901 * ) case "$localtime_r_proto" in
14902 REENTRANT_PROTO*) ;;
14903 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
14905 echo "Prototype: $try" ;;
14908 *) case "$usethreads" in
14909 define) echo "localtime_r has no prototype, not using it." >&4 ;;
14911 d_localtime_r=undef
14912 localtime_r_proto=0
14916 *) localtime_r_proto=0
14920 : see if localtime_r calls tzset
14921 case "$localtime_r_proto" in
14924 /* Does our libc's localtime_r call tzset ?
14925 * return 0 if so, 1 otherwise.
14927 #include <sys/types.h>
14928 #include <unistd.h>
14930 #include <string.h>
14931 #include <malloc.h>
14934 time_t t = time(0L);
14935 char w_tz[]="TZ" "=GMT+5",
14936 e_tz[]="TZ" "=GMT-5",
14937 *tz_e = (char*)malloc(16),
14938 *tz_w = (char*)malloc(16);
14939 struct tm tm_e, tm_w;
14940 memset(&tm_e,'\0',sizeof(struct tm));
14941 memset(&tm_w,'\0',sizeof(struct tm));
14946 localtime_r(&t, &tm_e);
14949 localtime_r(&t, &tm_w);
14951 if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 )
14957 if eval $compile; then
14958 if $run ./try; then
14959 d_localtime_r_needs_tzset=undef;
14961 d_localtime_r_needs_tzset=define;
14964 d_localtime_r_needs_tzset=undef;
14968 d_localtime_r_needs_tzset=undef;
14973 : see if localeconv exists
14974 set localeconv d_locconv
14977 : see if lockf exists
14981 : see if prototype for lseek is available
14983 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
14986 : see if lstat exists
14990 : see if madvise exists
14991 set madvise d_madvise
14994 : see if malloc_size exists
14995 set malloc_size d_malloc_size
14998 : see if malloc_size_good exists
14999 set malloc_good_size d_malloc_good_size
15002 : see if mblen exists
15006 : see if mbstowcs exists
15007 set mbstowcs d_mbstowcs
15010 : see if mbtowc exists
15011 set mbtowc d_mbtowc
15014 : see if memchr exists
15015 set memchr d_memchr
15018 : see if memcmp exists
15019 set memcmp d_memcmp
15022 : see if memcpy exists
15023 set memcpy d_memcpy
15026 : see if memmove exists
15027 set memmove d_memmove
15030 : see if memset exists
15031 set memset d_memset
15034 : see if mkdir exists
15038 : see if mkdtemp exists
15039 set mkdtemp d_mkdtemp
15042 : see if mkfifo exists
15043 set mkfifo d_mkfifo
15046 : see if mkstemp exists
15047 set mkstemp d_mkstemp
15050 : see if mkstemps exists
15051 set mkstemps d_mkstemps
15054 : see if mktime exists
15055 set mktime d_mktime
15058 : see if this is a sys/mman.h system
15059 set sys/mman.h i_sysmman
15062 : see if mmap exists
15065 : see what shmat returns
15066 : default to something harmless
15068 case "$i_sysmman$d_mmap" in
15070 $cat >mmap.c <<'END'
15071 #include <sys/mman.h>
15074 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
15079 echo "and it returns ($mmaptype)." >&4
15085 : see if sqrtl exists
15089 : see if scalbnl exists
15090 set scalbnl d_scalbnl
15093 : see if modfl exists
15097 : see if prototype for modfl is available
15099 set d_modflproto modfl $i_math math.h
15102 d_modfl_pow32_bug="$undef"
15104 case "$d_longdbl$d_modfl" in
15107 Checking to see whether your modfl() is okay for large values...
15113 if $test "X$d_modflproto" != "X$define"; then
15114 $cat >>try.c <<EOCP
15115 /* Sigh. many current glibcs provide the function, but do not prototype it. */
15116 long double modfl (long double, long double *);
15119 $cat >>try.c <<EOCP
15121 long double nv = 4294967303.15;
15127 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
15131 case "$osname:$gccversion" in
15132 aix:) saveccflags="$ccflags"
15133 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
15136 if eval $compile; then
15139 *" 4294967303.150000 1.150000 4294967302.000000")
15140 echo >&4 "Your modfl() is broken for large values."
15141 d_modfl_pow32_bug="$define"
15143 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
15147 *" 4294967303.150000 0.150000 4294967303.000000")
15148 echo >&4 "Your modfl() seems okay for large values."
15150 *) echo >&4 "I don't understand your modfl() at all."
15156 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
15159 case "$osname:$gccversion" in
15160 aix:) ccflags="$saveccflags" ;; # restore
15165 if $test "$uselongdouble" = "$define"; then
15167 if $test "$d_sqrtl" != "$define"; then
15168 message="$message sqrtl"
15170 if $test "$d_modfl" != "$define"; then
15171 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
15172 echo "You have both aintl and copysignl, so I can emulate modfl."
15174 message="$message modfl"
15177 if $test "$d_frexpl" != "$define"; then
15178 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
15179 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
15181 message="$message frexpl"
15185 if $test "$message" != ""; then
15188 *** You requested the use of long doubles but you do not seem to have
15189 *** the following mathematical functions needed for long double support:
15191 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
15192 *** Cannot continue, aborting.
15200 : see if mprotect exists
15201 set mprotect d_mprotect
15204 : see if msgctl exists
15205 set msgctl d_msgctl
15208 : see if msgget exists
15209 set msgget d_msgget
15212 : see if msgsnd exists
15213 set msgsnd d_msgsnd
15216 : see if msgrcv exists
15217 set msgrcv d_msgrcv
15220 : see how much of the 'msg*(2)' library is present.
15223 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
15224 *"$undef"*) h_msg=false;;
15228 case "`ipcs 2>&1`" in
15229 "SVID messages"*"not configured"*)
15230 echo "Your $osname does not have the msg*(2) configured." >&4
15233 set msgctl d_msgctl
15235 set msgget d_msgget
15237 set msgsnd d_msgsnd
15239 set msgrcv d_msgrcv
15245 : we could also check for sys/ipc.h ...
15246 if $h_msg && $test `./findhdr sys/msg.h`; then
15247 echo "You have the full msg*(2) library." >&4
15250 echo "You don't have the full msg*(2) library." >&4
15256 : Check for msghdr_s
15258 echo "Checking to see if your system supports struct msghdr..." >&4
15259 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
15261 case "$d_msghdr_s" in
15262 "$define") echo "Yes, it does." ;;
15263 *) echo "No, it doesn't." ;;
15267 : see if msync exists
15271 : see if munmap exists
15272 set munmap d_munmap
15275 : see if nice exists
15279 : see if this is a langinfo.h system
15280 set langinfo.h i_langinfo
15283 : see if nl_langinfo exists
15284 set nl_langinfo d_nl_langinfo
15287 : check for volatile keyword
15289 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
15290 $cat >try.c <<'EOCP'
15293 typedef struct _goo_struct goo_struct;
15294 goo_struct * volatile goo = ((goo_struct *)0);
15295 struct _goo_struct {
15300 typedef unsigned short foo_t;
15301 char *volatile foo;
15303 volatile foo_t blech;
15307 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
15309 echo "Yup, it does."
15312 echo "Nope, it doesn't."
15318 : Check basic sizes
15320 $echo "Choosing the C types to be used for Perl's internal types..." >&4
15322 case "$use64bitint:$d_quad:$quadtype" in
15325 uvtype="$uquadtype"
15330 uvtype="unsigned long"
15336 case "$uselongdouble:$d_longdbl" in
15338 nvtype="long double"
15339 nvsize=$longdblsize
15346 $echo "(IV will be "$ivtype", $ivsize bytes)"
15347 $echo "(UV will be "$uvtype", $uvsize bytes)"
15348 $echo "(NV will be "$nvtype", $nvsize bytes)"
15351 #$i_inttypes I_INTTYPES
15353 #include <inttypes.h>
15358 int8_t i = INT8_MAX;
15359 uint8_t u = UINT8_MAX;
15360 printf("int8_t\n");
15363 int16_t i = INT16_MAX;
15364 uint16_t i = UINT16_MAX;
15365 printf("int16_t\n");
15368 int32_t i = INT32_MAX;
15369 uint32_t u = UINT32_MAX;
15370 printf("int32_t\n");
15375 i8type="signed char"
15376 u8type="unsigned char"
15381 '') case "$shortsize" in
15383 u16type="unsigned short"
15391 '') set try -DINT16
15392 if eval $compile; then
15393 case "`$run ./try`" in
15405 '') if $test $shortsize -ge 2; then
15407 u16type="unsigned short"
15415 '') case "$longsize" in
15417 u32type="unsigned long"
15421 *) case "$intsize" in
15423 u32type="unsigned int"
15433 '') set try -DINT32
15434 if eval $compile; then
15435 case "`$run ./try`" in
15447 '') if $test $intsize -ge 4; then
15449 u32type="unsigned int"
15457 '') case "$d_quad:$quadtype" in
15459 i64type="$quadtype"
15460 u64type="$uquadtype"
15468 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
15469 : volatile so that the compiler has to store it out to memory.
15470 if test X"$d_volatile" = X"$define"; then
15475 #$i_stdlib I_STDLIB
15477 #include <stdlib.h>
15479 #include <sys/types.h>
15480 #include <signal.h>
15482 $volatile int bletched = 0;
15483 $signal_t blech(int s) { bletched = 1; }
15488 int n = 8 * $uvsize;
15491 signal(SIGFPE, blech);
15494 for (i = 0; i < n; i++) {
15495 u = u << 1 | ($uvtype)1;
15497 if (($uvtype)d != u)
15501 d = ($nvtype)(u - 1);
15502 if (($uvtype)d != (u - 1))
15509 printf("%d\n", ((i == n) ? -n : i));
15515 d_nv_preserves_uv="$undef"
15516 if eval $compile; then
15517 nv_preserves_uv_bits="`$run ./try`"
15519 case "$nv_preserves_uv_bits" in
15521 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
15522 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
15523 d_nv_preserves_uv="$define"
15525 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
15526 d_nv_preserves_uv="$undef" ;;
15527 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
15528 nv_preserves_uv_bits="0" ;;
15532 $echo "Checking to find the largest integer value your NVs can hold..." >&4
15533 : volatile so that the compiler has to store it out to memory.
15534 if test X"$d_volatile" = X"$define"; then
15540 typedef $nvtype NV;
15547 while(count < 256) {
15548 $volatile NV up = value + 1.0;
15549 $volatile NV negated = -value;
15550 $volatile NV down = negated - 1.0;
15551 $volatile NV got_up = up - value;
15552 int up_good = got_up == 1.0;
15553 int got_down = down - negated;
15554 int down_good = got_down == -1.0;
15556 if (down_good != up_good) {
15558 "Inconsistency - up %d %f; down %d %f; for 2**%d (%.20f)\n",
15559 up_good, (double) got_up, down_good, (double) got_down,
15560 count, (double) value);
15567 fputs("256.0", stdout);
15570 fputs("2.0", stdout);
15576 fputs("*", stdout);
15582 fprintf(stderr, "Cannot overflow integer range, even at 2**%d (%.20f)\n",
15583 count, (double) value);
15589 nv_overflows_integers_at='0'
15590 if eval $compile; then
15596 The largest integer your NVs can preserve is equal to $xxx
15598 nv_overflows_integers_at="$xxx"
15601 Cannot determine the largest integer value your NVs can hold, unexpected output
15608 Cannot determine the largest integer value your NVs can hold
15615 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
15616 : volatile so that the compiler has to store it out to memory.
15617 if test X"$d_volatile" = X"$define"; then
15622 #$i_stdlib I_STDLIB
15624 #include <stdlib.h>
15626 #$i_string I_STRING
15628 # include <string.h>
15630 # include <strings.h>
15632 #include <sys/types.h>
15633 #include <signal.h>
15635 $volatile int bletched = 0;
15636 $signal_t blech(int s) { bletched = 1; }
15639 int checkit($nvtype d, char *where) {
15640 unsigned char *p = (char *)&d;
15641 unsigned char *end = p + sizeof(d);
15651 printf("No - %s: 0x", where);
15653 printf ("%02X", *p++);
15658 int main(int argc, char **argv) {
15661 fail += checkit(d, "0.0");
15663 /* The compiler shouldn't be assuming that bletched is 0 */
15666 fail += checkit(d, "bleched");
15669 signal(SIGFPE, blech);
15672 /* Paranoia - the compiler should have no way of knowing that ANSI says
15673 that argv[argc] will always be NULL. Actually, if it did assume this it
15674 would be buggy, as this is C and main() can be called from elsewhere in
15676 d = argv[argc] ? 1 : 0;
15679 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
15682 fail += checkit(d, "ternary");
15684 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
15687 printf("No - memset doesn't give 0.0\n");
15688 /* This might just blow up: */
15689 printf("(gives %g)\n", d);
15695 printf("No - something bleched\n");
15700 printf("No - %d fail(s)\n", fail);
15709 d_nv_zero_is_allbits_zero="$undef"
15710 if eval $compile; then
15716 0.0 is represented as all bits zero in memory
15718 d_nv_zero_is_allbits_zero="$define"
15721 0.0 is not represented as all bits zero in memory
15723 d_nv_zero_is_allbits_zero="$undef"
15728 0.0 is not represented as all bits zero in memory
15730 d_nv_zero_is_allbits_zero="$undef"
15736 : check for off64_t
15738 echo "Checking to see if you have off64_t..." >&4
15740 #include <sys/types.h>
15741 #include <unistd.h>
15742 int main() { off64_t x = 7; }
15745 if eval $compile; then
15747 echo "You have off64_t."
15750 echo "You do not have off64_t."
15751 case "$lseeksize" in
15752 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
15759 : how to create joinable pthreads
15760 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
15762 echo "Checking what constant to use for creating joinable pthreads..." >&4
15763 $cat >try.c <<'EOCP'
15764 #include <pthread.h>
15766 int detachstate = JOINABLE;
15769 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
15770 if eval $compile; then
15771 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
15772 val="$undef" # Yes, undef.
15773 set d_old_pthread_create_joinable
15776 set old_pthread_create_joinable
15779 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
15780 if eval $compile; then
15781 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
15783 set d_old_pthread_create_joinable
15785 val=PTHREAD_CREATE_UNDETACHED
15786 set old_pthread_create_joinable
15789 set try -DJOINABLE=__UNDETACHED
15790 if eval $compile; then
15791 echo "You seem to use __UNDETACHED." >&4
15793 set d_old_pthread_create_joinable
15796 set old_pthread_create_joinable
15799 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
15801 set d_old_pthread_create_joinable
15804 set old_pthread_create_joinable
15811 d_old_pthread_create_joinable="$undef"
15812 old_pthread_create_joinable=""
15815 : see if pause exists
15819 : see if poll exists
15823 : see if readlink exists
15824 set readlink d_readlink
15827 : Check if exe is symlink to abs path of executing program
15831 case "$d_readlink" in
15833 if $issymlink /proc/self/exe ; then
15834 $ls -l /proc/self/exe > reflect
15835 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
15836 echo "You have Linux-like /proc/self/exe."
15837 procselfexe='"/proc/self/exe"'
15841 if $issymlink /proc/curproc/file ; then
15842 $ls -l /proc/curproc/file > reflect
15843 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
15844 echo "You have BSD-like /proc/curproc/file."
15845 procselfexe='"/proc/curproc/file"'
15855 : backward compatibility for d_hvfork
15856 if test X$d_hvfork != X; then
15857 d_vfork="$d_hvfork"
15860 : see if there is a vfork
15865 d_pseudofork=$undef
15867 : Ok, but do we want to use it. vfork is reportedly unreliable in
15868 : perl on Solaris 2.x, and probably elsewhere.
15872 case "$usevfork" in
15878 Perl can only use a vfork() that doesn't suffer from strict
15879 restrictions on calling functions or modifying global data in
15880 the child. For example, glibc-2.1 contains such a vfork()
15881 that is unsuitable. If your system provides a proper fork()
15882 call, chances are that you do NOT want perl to use vfork().
15885 rp="Do you still want to use vfork()?"
15890 echo "Ok, we won't use vfork()."
15899 $define) usevfork='true';;
15900 *) usevfork='false';;
15903 : see whether the pthread_atfork exists
15905 #include <pthread.h>
15908 #ifdef PTHREAD_ATFORK
15909 pthread_atfork(NULL,NULL,NULL);
15914 : see if pthread_atfork exists
15915 set try -DPTHREAD_ATFORK
15916 if eval $compile; then
15921 case "$usethreads" in
15924 $define) echo 'pthread_atfork found.' >&4 ;;
15925 *) echo 'pthread_atfork NOT found.' >&4 ;;
15928 set d_pthread_atfork
15931 : see if pthread_attr_setscope exists
15932 set pthread_attr_setscope d_pthread_attr_setscope
15935 : see whether the various POSIXish _yields exist
15937 #include <pthread.h>
15943 #ifdef PTHREAD_YIELD
15946 #ifdef PTHREAD_YIELD_NULL
15947 pthread_yield(NULL);
15953 : see if sched_yield exists
15954 set try -DSCHED_YIELD
15955 if eval $compile; then
15957 sched_yield='sched_yield()'
15961 case "$usethreads" in
15964 $define) echo 'sched_yield() found.' >&4 ;;
15965 *) echo 'sched_yield() NOT found.' >&4 ;;
15971 : see if pthread_yield exists
15972 set try -DPTHREAD_YIELD
15973 if eval $compile; then
15975 case "$sched_yield" in
15976 '') sched_yield='pthread_yield()' ;;
15979 set try -DPTHREAD_YIELD_NULL
15980 if eval $compile; then
15982 case "$sched_yield" in
15983 '') sched_yield='pthread_yield(NULL)' ;;
15989 case "$usethreads" in
15992 $define) echo 'pthread_yield() found.' >&4 ;;
15993 *) echo 'pthread_yield() NOT found.' >&4 ;;
15997 set d_pthread_yield
15999 case "$sched_yield" in
16000 '') sched_yield=undef ;;
16004 : see if random_r exists
16005 set random_r d_random_r
16007 case "$d_random_r" in
16009 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
16010 case "$d_random_r_proto:$usethreads" in
16011 ":define") d_random_r_proto=define
16012 set d_random_r_proto random_r $hdrs
16016 case "$d_random_r_proto" in
16018 case "$random_r_proto" in
16019 ''|0) try='int random_r(int*, struct random_data*);'
16020 ./protochk "extern $try" $hdrs && random_r_proto=I_iS ;;
16022 case "$random_r_proto" in
16023 ''|0) try='int random_r(long*, struct random_data*);'
16024 ./protochk "extern $try" $hdrs && random_r_proto=I_lS ;;
16026 case "$random_r_proto" in
16027 ''|0) try='int random_r(struct random_data*, int32_t*);'
16028 ./protochk "extern $try" $hdrs && random_r_proto=I_St ;;
16030 case "$random_r_proto" in
16031 ''|0) d_random_r=undef
16033 echo "Disabling random_r, cannot determine prototype." >&4 ;;
16034 * ) case "$random_r_proto" in
16035 REENTRANT_PROTO*) ;;
16036 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
16038 echo "Prototype: $try" ;;
16041 *) case "$usethreads" in
16042 define) echo "random_r has no prototype, not using it." >&4 ;;
16049 *) random_r_proto=0
16053 : see if readdir and friends exist
16054 set readdir d_readdir
16056 set seekdir d_seekdir
16058 set telldir d_telldir
16060 set rewinddir d_rewinddir
16063 : see if readdir64_r exists
16064 set readdir64_r d_readdir64_r
16066 case "$d_readdir64_r" in
16068 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
16069 case "$d_readdir64_r_proto:$usethreads" in
16070 ":define") d_readdir64_r_proto=define
16071 set d_readdir64_r_proto readdir64_r $hdrs
16075 case "$d_readdir64_r_proto" in
16077 case "$readdir64_r_proto" in
16078 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
16079 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TSR ;;
16081 case "$readdir64_r_proto" in
16082 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
16083 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TS ;;
16085 case "$readdir64_r_proto" in
16086 ''|0) d_readdir64_r=undef
16087 readdir64_r_proto=0
16088 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
16089 * ) case "$readdir64_r_proto" in
16090 REENTRANT_PROTO*) ;;
16091 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
16093 echo "Prototype: $try" ;;
16096 *) case "$usethreads" in
16097 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
16099 d_readdir64_r=undef
16100 readdir64_r_proto=0
16104 *) readdir64_r_proto=0
16108 : see if readdir_r exists
16109 set readdir_r d_readdir_r
16111 case "$d_readdir_r" in
16113 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
16114 case "$d_readdir_r_proto:$usethreads" in
16115 ":define") d_readdir_r_proto=define
16116 set d_readdir_r_proto readdir_r $hdrs
16120 case "$d_readdir_r_proto" in
16122 case "$readdir_r_proto" in
16123 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
16124 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TSR ;;
16126 case "$readdir_r_proto" in
16127 ''|0) try='int readdir_r(DIR*, struct dirent*);'
16128 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TS ;;
16130 case "$readdir_r_proto" in
16131 ''|0) d_readdir_r=undef
16133 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
16134 * ) case "$readdir_r_proto" in
16135 REENTRANT_PROTO*) ;;
16136 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
16138 echo "Prototype: $try" ;;
16141 *) case "$usethreads" in
16142 define) echo "readdir_r has no prototype, not using it." >&4 ;;
16149 *) readdir_r_proto=0
16153 : see if readv exists
16157 : see if recvmsg exists
16158 set recvmsg d_recvmsg
16161 : see if rename exists
16162 set rename d_rename
16165 : see if rmdir exists
16169 : see if memory.h is available.
16174 : See if it conflicts with string.h
16180 $cppstdin $cppflags $cppminus < $strings > mem.h
16181 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
16183 echo "We won't be including <memory.h>."
16193 : can bcopy handle overlapping blocks?
16196 case "$d_memmove" in
16197 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
16198 *) case "$d_bcopy" in
16200 echo "Checking to see if bcopy() can do overlapping copies..." >&4
16202 #$i_memory I_MEMORY
16203 #$i_stdlib I_STDLIB
16204 #$i_string I_STRING
16205 #$i_unistd I_UNISTD
16207 $cat >>try.c <<'EOCP'
16210 # include <memory.h>
16213 # include <stdlib.h>
16216 # include <string.h>
16218 # include <strings.h>
16221 # include <unistd.h> /* Needed for NetBSD */
16225 char buf[128], abc[128];
16231 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16232 try to store the string in read-only memory. */
16233 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
16235 for (align = 7; align >= 0; align--) {
16236 for (len = 36; len; len--) {
16238 bcopy(abc, b, len);
16239 for (off = 1; off <= len; off++) {
16240 bcopy(b, b+off, len);
16241 bcopy(b+off, b, len);
16242 if (bcmp(b, abc, len))
16251 if eval $compile_ok; then
16252 if $run ./try 2>/dev/null; then
16253 echo "Yes, it can."
16256 echo "It can't, sorry."
16259 echo "(I can't compile the test program, so we'll assume not...)"
16269 : can memcpy handle overlapping blocks?
16272 case "$d_memmove" in
16273 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
16274 *) case "$d_memcpy" in
16276 echo "Checking to see if memcpy() can do overlapping copies..." >&4
16278 #$i_memory I_MEMORY
16279 #$i_stdlib I_STDLIB
16280 #$i_string I_STRING
16281 #$i_unistd I_UNISTD
16283 $cat >>try.c <<'EOCP'
16286 # include <memory.h>
16289 # include <stdlib.h>
16292 # include <string.h>
16294 # include <strings.h>
16297 # include <unistd.h> /* Needed for NetBSD */
16301 char buf[128], abc[128];
16307 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16308 try to store the string in read-only memory. */
16309 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
16311 for (align = 7; align >= 0; align--) {
16312 for (len = 36; len; len--) {
16314 memcpy(b, abc, len);
16315 for (off = 1; off <= len; off++) {
16316 memcpy(b+off, b, len);
16317 memcpy(b, b+off, len);
16318 if (memcmp(b, abc, len))
16327 if eval $compile_ok; then
16328 if $run ./try 2>/dev/null; then
16329 echo "Yes, it can."
16332 echo "It can't, sorry."
16335 echo "(I can't compile the test program, so we'll assume not...)"
16345 : can memcmp be trusted to compare relative magnitude?
16347 case "$d_memcmp" in
16350 echo "Checking if your memcmp() can compare relative magnitude..." >&4
16352 #$i_memory I_MEMORY
16353 #$i_stdlib I_STDLIB
16354 #$i_string I_STRING
16355 #$i_unistd I_UNISTD
16357 $cat >>try.c <<'EOCP'
16360 # include <memory.h>
16363 # include <stdlib.h>
16366 # include <string.h>
16368 # include <strings.h>
16371 # include <unistd.h> /* Needed for NetBSD */
16377 if ((a < b) && memcmp(&a, &b, 1) < 0)
16383 if eval $compile_ok; then
16384 if $run ./try 2>/dev/null; then
16385 echo "Yes, it can."
16388 echo "No, it can't (it uses signed chars)."
16391 echo "(I can't compile the test program, so we'll assume not...)"
16399 : see if prototype for sbrk is available
16401 set d_sbrkproto sbrk $i_unistd unistd.h
16404 : see if select exists
16405 set select d_select
16408 : see if semctl exists
16409 set semctl d_semctl
16412 : see if semget exists
16413 set semget d_semget
16416 : see if semop exists
16420 : see how much of the 'sem*(2)' library is present.
16423 case "$d_semctl$d_semget$d_semop" in
16424 *"$undef"*) h_sem=false;;
16428 case "`ipcs 2>&1`" in
16429 "SVID messages"*"not configured"*)
16430 echo "Your $osname does not have the sem*(2) configured." >&4
16433 set semctl d_semctl
16435 set semget d_semget
16443 : we could also check for sys/ipc.h ...
16444 if $h_sem && $test `./findhdr sys/sem.h`; then
16445 echo "You have the full sem*(2) library." >&4
16448 echo "You don't have the full sem*(2) library." >&4
16454 : see whether sys/sem.h defines union semun
16456 $cat > try.c <<'END'
16457 #include <sys/types.h>
16458 #include <sys/ipc.h>
16459 #include <sys/sem.h>
16460 int main () { union semun semun; semun.buf = 0; }
16463 if eval $compile; then
16464 echo "You have union semun in <sys/sem.h>." >&4
16467 echo "You do not have union semun in <sys/sem.h>." >&4
16474 : see how to do semctl IPC_STAT
16478 $cat > tryh.h <<END
16481 # define S_IRUSR S_IREAD
16482 # define S_IWUSR S_IWRITE
16483 # define S_IXUSR S_IEXEC
16485 # define S_IRUSR 0400
16486 # define S_IWUSR 0200
16487 # define S_IXUSR 0100
16489 # define S_IRGRP (S_IRUSR>>3)
16490 # define S_IWGRP (S_IWUSR>>3)
16491 # define S_IXGRP (S_IXUSR>>3)
16492 # define S_IROTH (S_IRUSR>>6)
16493 # define S_IWOTH (S_IWUSR>>6)
16494 # define S_IXOTH (S_IXUSR>>6)
16497 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
16498 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
16499 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
16502 : see whether semctl IPC_STAT can use union semun
16503 case "$d_semctl_semun" in
16507 #include <sys/types.h>
16508 #include <sys/ipc.h>
16509 #include <sys/sem.h>
16510 #include <sys/stat.h>
16517 #$d_union_semun HAS_UNION_SEMUN
16520 #ifndef HAS_UNION_SEMUN
16523 struct semid_ds *buf;
16524 unsigned short *array;
16530 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16531 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16533 struct semid_ds argbuf;
16536 st = semctl(sem, 0, IPC_STAT, arg);
16540 # endif /* IPC_STAT */
16541 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16543 if (semctl(sem, 0, IPC_RMID, arg) != 0)
16544 # endif /* IPC_RMID */
16545 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16547 #endif /* IPC_PRIVATE && ... */
16548 printf("semget failed: errno = %d\n", errno);
16553 if eval $compile; then
16556 semun) val="$define" ;;
16564 case "$d_semctl_semun" in
16566 echo "You can use union semun for semctl IPC_STAT." >&4
16569 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
16574 : see whether semctl IPC_STAT can use struct semid_ds pointer
16575 case "$d_semctl_semid_ds" in
16578 $cat > try.c <<'END'
16579 #include <sys/types.h>
16580 #include <sys/ipc.h>
16581 #include <sys/sem.h>
16582 #include <sys/stat.h>
16590 struct semid_ds arg;
16593 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16594 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16597 st = semctl(sem, 0, IPC_STAT, &arg);
16599 printf("semid_ds\n");
16601 # endif /* IPC_STAT */
16602 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16604 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
16605 # endif /* IPC_RMID */
16606 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16608 #endif /* IPC_PRIVATE && ... */
16609 printf("semget failed: errno = %d\n", errno);
16615 if eval $compile; then
16618 semid_ds) val="$define" ;;
16622 set d_semctl_semid_ds
16626 case "$d_semctl_semid_ds" in
16628 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
16630 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
16636 # We do not have the full sem*(2) library, so assume we can not
16642 set d_semctl_semid_ds
16648 : see if sendmsg exists
16649 set sendmsg d_sendmsg
16652 : see if setegid exists
16653 set setegid d_setegid
16656 : see if seteuid exists
16657 set seteuid d_seteuid
16660 : see if setgrent exists
16661 set setgrent d_setgrent
16664 : see if setgrent_r exists
16665 set setgrent_r d_setgrent_r
16667 case "$d_setgrent_r" in
16669 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
16670 case "$d_setgrent_r_proto:$usethreads" in
16671 ":define") d_setgrent_r_proto=define
16672 set d_setgrent_r_proto setgrent_r $hdrs
16676 case "$d_setgrent_r_proto" in
16678 case "$setgrent_r_proto" in
16679 ''|0) try='int setgrent_r(FILE**);'
16680 ./protochk "extern $try" $hdrs && setgrent_r_proto=I_H ;;
16682 case "$setgrent_r_proto" in
16683 ''|0) try='void setgrent_r(FILE**);'
16684 ./protochk "extern $try" $hdrs && setgrent_r_proto=V_H ;;
16686 case "$setgrent_r_proto" in
16687 ''|0) d_setgrent_r=undef
16689 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
16690 * ) case "$setgrent_r_proto" in
16691 REENTRANT_PROTO*) ;;
16692 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
16694 echo "Prototype: $try" ;;
16697 *) case "$usethreads" in
16698 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
16705 *) setgrent_r_proto=0
16709 : see if sethostent exists
16710 set sethostent d_sethent
16713 : see if sethostent_r exists
16714 set sethostent_r d_sethostent_r
16716 case "$d_sethostent_r" in
16718 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16719 case "$d_sethostent_r_proto:$usethreads" in
16720 ":define") d_sethostent_r_proto=define
16721 set d_sethostent_r_proto sethostent_r $hdrs
16725 case "$d_sethostent_r_proto" in
16727 case "$sethostent_r_proto" in
16728 ''|0) try='int sethostent_r(int, struct hostent_data*);'
16729 ./protochk "extern $try" $hdrs && sethostent_r_proto=I_ID ;;
16731 case "$sethostent_r_proto" in
16732 ''|0) try='void sethostent_r(int, struct hostent_data*);'
16733 ./protochk "extern $try" $hdrs && sethostent_r_proto=V_ID ;;
16735 case "$sethostent_r_proto" in
16736 ''|0) d_sethostent_r=undef
16737 sethostent_r_proto=0
16738 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
16739 * ) case "$sethostent_r_proto" in
16740 REENTRANT_PROTO*) ;;
16741 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
16743 echo "Prototype: $try" ;;
16746 *) case "$usethreads" in
16747 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
16749 d_sethostent_r=undef
16750 sethostent_r_proto=0
16754 *) sethostent_r_proto=0
16758 : see if setitimer exists
16759 set setitimer d_setitimer
16762 : see if setlinebuf exists
16763 set setlinebuf d_setlinebuf
16766 : see if setlocale exists
16767 set setlocale d_setlocale
16770 : see if locale.h is available
16771 set locale.h i_locale
16774 : see if setlocale_r exists
16775 set setlocale_r d_setlocale_r
16777 case "$d_setlocale_r" in
16779 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
16780 case "$d_setlocale_r_proto:$usethreads" in
16781 ":define") d_setlocale_r_proto=define
16782 set d_setlocale_r_proto setlocale_r $hdrs
16786 case "$d_setlocale_r_proto" in
16788 case "$setlocale_r_proto" in
16789 ''|0) try='int setlocale_r(int, const char*, char*, int);'
16790 ./protochk "extern $try" $hdrs && setlocale_r_proto=I_ICBI ;;
16792 case "$setlocale_r_proto" in
16793 ''|0) d_setlocale_r=undef
16794 setlocale_r_proto=0
16795 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
16796 * ) case "$setlocale_r_proto" in
16797 REENTRANT_PROTO*) ;;
16798 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
16800 echo "Prototype: $try" ;;
16803 *) case "$usethreads" in
16804 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
16806 d_setlocale_r=undef
16807 setlocale_r_proto=0
16811 *) setlocale_r_proto=0
16815 : see if setnetent exists
16816 set setnetent d_setnent
16819 : see if setnetent_r exists
16820 set setnetent_r d_setnetent_r
16822 case "$d_setnetent_r" in
16824 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16825 case "$d_setnetent_r_proto:$usethreads" in
16826 ":define") d_setnetent_r_proto=define
16827 set d_setnetent_r_proto setnetent_r $hdrs
16831 case "$d_setnetent_r_proto" in
16833 case "$setnetent_r_proto" in
16834 ''|0) try='int setnetent_r(int, struct netent_data*);'
16835 ./protochk "extern $try" $hdrs && setnetent_r_proto=I_ID ;;
16837 case "$setnetent_r_proto" in
16838 ''|0) try='void setnetent_r(int, struct netent_data*);'
16839 ./protochk "extern $try" $hdrs && setnetent_r_proto=V_ID ;;
16841 case "$setnetent_r_proto" in
16842 ''|0) d_setnetent_r=undef
16843 setnetent_r_proto=0
16844 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
16845 * ) case "$setnetent_r_proto" in
16846 REENTRANT_PROTO*) ;;
16847 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
16849 echo "Prototype: $try" ;;
16852 *) case "$usethreads" in
16853 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
16855 d_setnetent_r=undef
16856 setnetent_r_proto=0
16860 *) setnetent_r_proto=0
16864 : see if setprotoent exists
16865 set setprotoent d_setpent
16868 : see if setpgid exists
16869 set setpgid d_setpgid
16872 : see if setpgrp2 exists
16873 set setpgrp2 d_setpgrp2
16876 : see if setpriority exists
16877 set setpriority d_setprior
16880 : see if setproctitle exists
16881 set setproctitle d_setproctitle
16884 : see if setprotoent_r exists
16885 set setprotoent_r d_setprotoent_r
16887 case "$d_setprotoent_r" in
16889 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16890 case "$d_setprotoent_r_proto:$usethreads" in
16891 ":define") d_setprotoent_r_proto=define
16892 set d_setprotoent_r_proto setprotoent_r $hdrs
16896 case "$d_setprotoent_r_proto" in
16898 case "$setprotoent_r_proto" in
16899 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
16900 ./protochk "extern $try" $hdrs && setprotoent_r_proto=I_ID ;;
16902 case "$setprotoent_r_proto" in
16903 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
16904 ./protochk "extern $try" $hdrs && setprotoent_r_proto=V_ID ;;
16906 case "$setprotoent_r_proto" in
16907 ''|0) d_setprotoent_r=undef
16908 setprotoent_r_proto=0
16909 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
16910 * ) case "$setprotoent_r_proto" in
16911 REENTRANT_PROTO*) ;;
16912 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
16914 echo "Prototype: $try" ;;
16917 *) case "$usethreads" in
16918 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
16920 d_setprotoent_r=undef
16921 setprotoent_r_proto=0
16925 *) setprotoent_r_proto=0
16929 : see if setpwent exists
16930 set setpwent d_setpwent
16933 : see if setpwent_r exists
16934 set setpwent_r d_setpwent_r
16936 case "$d_setpwent_r" in
16938 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
16939 case "$d_setpwent_r_proto:$usethreads" in
16940 ":define") d_setpwent_r_proto=define
16941 set d_setpwent_r_proto setpwent_r $hdrs
16945 case "$d_setpwent_r_proto" in
16947 case "$setpwent_r_proto" in
16948 ''|0) try='int setpwent_r(FILE**);'
16949 ./protochk "extern $try" $hdrs && setpwent_r_proto=I_H ;;
16951 case "$setpwent_r_proto" in
16952 ''|0) try='void setpwent_r(FILE**);'
16953 ./protochk "extern $try" $hdrs && setpwent_r_proto=V_H ;;
16955 case "$setpwent_r_proto" in
16956 ''|0) d_setpwent_r=undef
16958 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
16959 * ) case "$setpwent_r_proto" in
16960 REENTRANT_PROTO*) ;;
16961 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
16963 echo "Prototype: $try" ;;
16966 *) case "$usethreads" in
16967 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
16974 *) setpwent_r_proto=0
16978 : see if setregid exists
16979 set setregid d_setregid
16981 set setresgid d_setresgid
16984 : see if setreuid exists
16985 set setreuid d_setreuid
16987 set setresuid d_setresuid
16990 : see if setrgid exists
16991 set setrgid d_setrgid
16994 : see if setruid exists
16995 set setruid d_setruid
16998 : see if setservent exists
16999 set setservent d_setsent
17002 : see if setservent_r exists
17003 set setservent_r d_setservent_r
17005 case "$d_setservent_r" in
17007 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17008 case "$d_setservent_r_proto:$usethreads" in
17009 ":define") d_setservent_r_proto=define
17010 set d_setservent_r_proto setservent_r $hdrs
17014 case "$d_setservent_r_proto" in
17016 case "$setservent_r_proto" in
17017 ''|0) try='int setservent_r(int, struct servent_data*);'
17018 ./protochk "extern $try" $hdrs && setservent_r_proto=I_ID ;;
17020 case "$setservent_r_proto" in
17021 ''|0) try='void setservent_r(int, struct servent_data*);'
17022 ./protochk "extern $try" $hdrs && setservent_r_proto=V_ID ;;
17024 case "$setservent_r_proto" in
17025 ''|0) d_setservent_r=undef
17026 setservent_r_proto=0
17027 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
17028 * ) case "$setservent_r_proto" in
17029 REENTRANT_PROTO*) ;;
17030 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
17032 echo "Prototype: $try" ;;
17035 *) case "$usethreads" in
17036 define) echo "setservent_r has no prototype, not using it." >&4 ;;
17038 d_setservent_r=undef
17039 setservent_r_proto=0
17043 *) setservent_r_proto=0
17047 : see if setsid exists
17048 set setsid d_setsid
17051 : see if setvbuf exists
17052 set setvbuf d_setvbuf
17055 : see if sfio.h is available
17059 : see if sfio library is available
17070 : Ok, but do we want to use it.
17074 true|$define|[yY]*) dflt='y';;
17077 echo "$package can use the sfio library, but it is experimental."
17078 case "$useperlio" in
17080 echo "For sfio also the PerlIO abstraction layer is needed."
17081 echo "Earlier you said you wouldn't want that."
17084 rp="You seem to have sfio available, do you want to try using it?"
17087 y|Y) echo "Ok, turning on both sfio and PerlIO, then."
17088 useperlio="$define"
17091 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
17096 *) case "$usesfio" in
17097 true|$define|[yY]*)
17098 echo "Sorry, cannot find sfio on this machine." >&4
17099 echo "Ignoring your setting of usesfio=$usesfio." >&4
17108 $define) usesfio='true';;
17109 *) usesfio='false';;
17113 *) : Remove sfio from list of libraries to use
17116 echo "Removing unneeded -lsfio from library list" >&4
17117 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
17120 echo "libs = $libs" >&4
17127 : see if shmctl exists
17128 set shmctl d_shmctl
17131 : see if shmget exists
17132 set shmget d_shmget
17135 : see if shmat exists
17138 : see what shmat returns
17141 $cat >shmat.c <<'END'
17142 #include <sys/shm.h>
17145 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
17150 echo "and it returns ($shmattype)." >&4
17151 : see if a prototype for shmat is available
17152 xxx=`./findhdr sys/shm.h`
17153 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
17154 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
17165 set d_shmatprototype
17168 : see if shmdt exists
17172 : see how much of the 'shm*(2)' library is present.
17175 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
17176 *"$undef"*) h_shm=false;;
17180 case "`ipcs 2>&1`" in
17181 "SVID shared memory"*"not configured"*)
17182 echo "Your $osname does not have the shm*(2) configured." >&4
17185 set shmctl d_shmctl
17187 set shmget d_shmget
17197 : we could also check for sys/ipc.h ...
17198 if $h_shm && $test `./findhdr sys/shm.h`; then
17199 echo "You have the full shm*(2) library." >&4
17202 echo "You don't have the full shm*(2) library." >&4
17208 : see if we have sigaction
17210 if set sigaction val -f d_sigaction; eval $csym; $val; then
17211 echo 'sigaction() found.' >&4
17214 #include <sys/types.h>
17215 #include <signal.h>
17216 #$i_stdlib I_STDLIB
17218 #include <stdlib.h>
17222 struct sigaction act, oact;
17224 oact.sa_handler = 0;
17225 /* so that act and oact are used */
17226 exit(act.sa_flags == 0 && oact.sa_handler == 0);
17230 if eval $compile_ok; then
17233 echo "But you don't seem to have a useable struct sigaction." >&4
17237 echo 'sigaction NOT found.' >&4
17240 set d_sigaction; eval $setvar
17243 : see if this is a sunmath.h system
17244 set sunmath.h i_sunmath
17247 : see if signbit exists
17248 $echo $n "Checking to see if you have signbit() available to work on $nvtype... $c" >&4
17251 #$i_sunmath I_SUNMATH
17255 #ifdef I_SUNMATH /* Solaris special math library */
17256 # include <sunmath.h>
17259 int main(int argc, char **argv)
17263 if ((signbit(x) == 0) && (signbit(y) != 0))
17271 if eval $compile; then
17272 if $run ./try; then
17276 $echo "Signbit seems to be available, but doesn't work as I expected."
17277 $echo "I won't use it." >&4
17288 : see if sigprocmask exists
17289 set sigprocmask d_sigprocmask
17292 : see if sigsetjmp exists
17294 case "$d_sigsetjmp" in
17297 #include <setjmp.h>
17298 #$i_stdlib I_STDLIB
17300 #include <stdlib.h>
17306 if (sigsetjmp(env,1))
17309 siglongjmp(env, 1);
17314 if eval $compile; then
17315 if $run ./try >/dev/null 2>&1; then
17316 echo "POSIX sigsetjmp found." >&4
17320 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
17326 echo "sigsetjmp not found." >&4
17330 *) val="$d_sigsetjmp"
17331 case "$d_sigsetjmp" in
17332 $define) echo "POSIX sigsetjmp found." >&4;;
17333 $undef) echo "sigsetjmp not found." >&4;;
17341 : see if snprintf exists
17342 set snprintf d_snprintf
17345 : see if vsnprintf exists
17346 set vsnprintf d_vsnprintf
17349 case "$d_snprintf-$d_vsnprintf" in
17352 Checking whether your snprintf() and vsnprintf() work okay...
17354 $cat >try.c <<'EOCP'
17355 /* v?snprintf testing logic courtesy of Russ Allbery.
17356 * According to C99:
17357 * - if the buffer is too short it still must be \0-terminated
17358 * - if the buffer is too short the potentially required length
17359 * must be returned and not -1
17360 * - if the buffer is NULL the potentially required length
17361 * must be returned and not -1 or core dump
17364 #include <stdarg.h>
17368 int test (char *format, ...)
17373 va_start (args, format);
17374 count = vsnprintf (buf, sizeof buf, format, args);
17381 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
17382 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
17386 if eval $compile; then
17389 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
17391 Your snprintf() and snprintf() don't seem to be working okay.
17393 d_snprintf="$undef"
17394 d_vsnprintf="$undef"
17398 echo "(I can't seem to compile the test program--assuming they don't)"
17399 d_snprintf="$undef"
17400 d_vsnprintf="$undef"
17406 : see if sockatmark exists
17407 set sockatmark d_sockatmark
17410 : see if prototype for sockatmark is available
17412 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
17415 : see if socks5_init exists
17416 set socks5_init d_socks5_init
17419 : see if sprintf returns the length of the string in the buffer as per ANSI
17420 $echo "Checking whether sprintf returns the length of the string..." >&4
17423 #$i_stdlib I_STDLIB
17425 #include <stdlib.h>
17427 #$i_string I_STRING
17429 # include <string.h>
17431 # include <strings.h>
17440 int check (size_t expect, int test) {
17441 size_t got = strlen(buffer);
17445 printf("expected %ld, got %ld in test %d '%s'\n", (long) expect, (long) got,
17450 int main(int argc, char **argv) {
17453 check(sprintf(buffer, ""), ++test);
17454 check(sprintf(buffer, "%s %s", "perl", "rules"), ++test);
17455 check(sprintf(buffer, "I like %g", atan2(0,-1)), ++test);
17462 d_sprintf_returns_strlen="$undef"
17463 if eval $compile; then
17467 sprintf returns the length of the string (as ANSI says it should)
17469 d_sprintf_returns_strlen="$define"
17472 sprintf does not return the length of the string (how old is this system?)
17474 d_sprintf_returns_strlen="$undef"
17480 : see if srand48_r exists
17481 set srand48_r d_srand48_r
17483 case "$d_srand48_r" in
17485 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17486 case "$d_srand48_r_proto:$usethreads" in
17487 ":define") d_srand48_r_proto=define
17488 set d_srand48_r_proto srand48_r $hdrs
17492 case "$d_srand48_r_proto" in
17494 case "$srand48_r_proto" in
17495 ''|0) try='int srand48_r(long, struct drand48_data*);'
17496 ./protochk "extern $try" $hdrs && srand48_r_proto=I_LS ;;
17498 case "$srand48_r_proto" in
17499 ''|0) d_srand48_r=undef
17501 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
17502 * ) case "$srand48_r_proto" in
17503 REENTRANT_PROTO*) ;;
17504 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
17506 echo "Prototype: $try" ;;
17509 *) case "$usethreads" in
17510 define) echo "srand48_r has no prototype, not using it." >&4 ;;
17517 *) srand48_r_proto=0
17521 : see if srandom_r exists
17522 set srandom_r d_srandom_r
17524 case "$d_srandom_r" in
17526 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17527 case "$d_srandom_r_proto:$usethreads" in
17528 ":define") d_srandom_r_proto=define
17529 set d_srandom_r_proto srandom_r $hdrs
17533 case "$d_srandom_r_proto" in
17535 case "$srandom_r_proto" in
17536 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
17537 ./protochk "extern $try" $hdrs && srandom_r_proto=I_TS ;;
17539 case "$srandom_r_proto" in
17540 ''|0) d_srandom_r=undef
17542 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
17543 * ) case "$srandom_r_proto" in
17544 REENTRANT_PROTO*) ;;
17545 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
17547 echo "Prototype: $try" ;;
17550 *) case "$usethreads" in
17551 define) echo "srandom_r has no prototype, not using it." >&4 ;;
17558 *) srandom_r_proto=0
17562 : see if prototype for setresgid is available
17564 set d_sresgproto setresgid $i_unistd unistd.h
17567 : see if prototype for setresuid is available
17569 set d_sresuproto setresuid $i_unistd unistd.h
17572 : see if sys/stat.h is available
17573 set sys/stat.h i_sysstat
17576 : see if stat knows about block sizes
17578 echo "Checking to see if your struct stat has st_blocks field..." >&4
17579 set d_statblks stat st_blocks $i_sysstat sys/stat.h
17582 : see if this is a sys/vfs.h system
17583 set sys/vfs.h i_sysvfs
17586 : see if this is a sys/statfs.h system
17587 set sys/statfs.h i_sysstatfs
17590 : Check for statfs_s
17592 echo "Checking to see if your system supports struct statfs..." >&4
17593 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
17595 case "$d_statfs_s" in
17596 "$define") echo "Yes, it does." ;;
17597 *) echo "No, it doesn't." ;;
17601 : see if struct statfs knows about f_flags
17602 case "$d_statfs_s" in
17605 echo "Checking to see if your struct statfs has f_flags field..." >&4
17606 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
17610 set d_statfs_f_flags
17614 case "$d_statfs_f_flags" in
17615 "$define") echo "Yes, it does." ;;
17616 *) echo "No, it doesn't." ;;
17619 : Check stream access
17621 Checking how to access stdio streams by file descriptor number...
17623 case "$stdio_stream_array" in
17624 '') $cat >try.c <<EOCP
17627 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
17631 for s in _iob __iob __sF
17633 set try -DSTDIO_STREAM_ARRAY=$s
17634 if eval $compile; then
17635 case "`$run ./try`" in
17636 yes) stdio_stream_array=$s; break ;;
17642 case "$stdio_stream_array" in
17644 I can't figure out how to access stdio streams by file descriptor number.
17646 d_stdio_stream_array="$undef"
17649 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
17651 d_stdio_stream_array="$define"
17655 : see if strcoll exists
17656 set strcoll d_strcoll
17659 : check for structure copying
17661 echo "Checking to see if your C compiler can copy structs..." >&4
17662 $cat >try.c <<'EOCP'
17672 if $cc -c try.c >/dev/null 2>&1 ; then
17674 echo "Yup, it can."
17677 echo "Nope, it can't."
17683 : see if strerror and/or sys_errlist[] exist
17685 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
17686 if set strerror val -f d_strerror; eval $csym; $val; then
17687 echo 'strerror() found.' >&4
17688 d_strerror="$define"
17689 d_strerrm='strerror(e)'
17690 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17691 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
17692 d_syserrlst="$define"
17694 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
17695 d_syserrlst="$undef"
17697 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
17698 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
17699 echo 'strerror() found in string header.' >&4
17700 d_strerror="$define"
17701 d_strerrm='strerror(e)'
17702 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17703 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
17704 d_syserrlst="$define"
17706 echo "(You don't appear to have any sys_errlist[], how can this be?)"
17707 d_syserrlst="$undef"
17709 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17710 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
17711 d_strerror="$undef"
17712 d_syserrlst="$define"
17713 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
17715 echo 'strerror() and sys_errlist[] NOT found.' >&4
17716 d_strerror="$undef"
17717 d_syserrlst="$undef"
17718 d_strerrm='"unknown"'
17722 : see if strerror_r exists
17723 set strerror_r d_strerror_r
17725 case "$d_strerror_r" in
17727 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
17728 case "$d_strerror_r_proto:$usethreads" in
17729 ":define") d_strerror_r_proto=define
17730 set d_strerror_r_proto strerror_r $hdrs
17734 case "$d_strerror_r_proto" in
17736 case "$strerror_r_proto" in
17737 ''|0) try='int strerror_r(int, char*, size_t);'
17738 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBW ;;
17740 case "$strerror_r_proto" in
17741 ''|0) try='int strerror_r(int, char*, int);'
17742 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBI ;;
17744 case "$strerror_r_proto" in
17745 ''|0) try='char* strerror_r(int, char*, size_t);'
17746 ./protochk "extern $try" $hdrs && strerror_r_proto=B_IBW ;;
17748 case "$strerror_r_proto" in
17749 ''|0) d_strerror_r=undef
17751 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
17752 * ) case "$strerror_r_proto" in
17753 REENTRANT_PROTO*) ;;
17754 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
17756 echo "Prototype: $try" ;;
17759 *) case "$usethreads" in
17760 define) echo "strerror_r has no prototype, not using it." >&4 ;;
17767 *) strerror_r_proto=0
17771 : see if strftime exists
17772 set strftime d_strftime
17775 : see if strlcat exists
17776 set strlcat d_strlcat
17779 : see if strlcpy exists
17780 set strlcpy d_strlcpy
17783 : see if strtod exists
17784 set strtod d_strtod
17787 : see if strtol exists
17788 set strtol d_strtol
17791 : see if strtold exists
17792 set strtold d_strtold
17795 : see if strtoll exists
17796 set strtoll d_strtoll
17799 case "$d_longlong-$d_strtoll" in
17802 Checking whether your strtoll() works okay...
17804 $cat >try.c <<'EOCP'
17807 #define strtoll __strtoll
17810 #define strtoll _strtoll
17813 extern long long int strtoll(char *s, char **, int);
17814 static int bad = 0;
17815 int check(char *s, long long ell, int een) {
17818 gll = strtoll(s, 0, 10);
17819 if (!((gll == ell) && (errno == een)))
17823 check(" 1", 1LL, 0);
17824 check(" 0", 0LL, 0);
17825 check("-1", -1LL, 0);
17826 check("-9223372036854775808", -9223372036854775808LL, 0);
17827 check("-9223372036854775808", -9223372036854775808LL, 0);
17828 check(" 9223372036854775807", 9223372036854775807LL, 0);
17829 check("-9223372036854775808", -9223372036854775808LL, 0);
17830 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
17831 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
17837 if eval $compile; then
17840 ok) echo "Your strtoll() seems to be working okay." ;;
17842 Your strtoll() doesn't seem to be working okay.
17848 echo "(I can't seem to compile the test program--assuming it doesn't)"
17854 : see if strtoq exists
17855 set strtoq d_strtoq
17858 : see if strtoul exists
17859 set strtoul d_strtoul
17862 case "$d_strtoul" in
17865 Checking whether your strtoul() works okay...
17867 $cat >try.c <<'EOCP'
17870 extern unsigned long int strtoul(char *s, char **, int);
17871 static int bad = 0;
17872 void check(char *s, unsigned long eul, int een) {
17875 gul = strtoul(s, 0, 10);
17876 if (!((gul == eul) && (errno == een)))
17880 check(" 1", 1L, 0);
17881 check(" 0", 0L, 0);
17883 case "$longsize" in
17885 $cat >>try.c <<'EOCP'
17886 check("18446744073709551615", 18446744073709551615UL, 0);
17887 check("18446744073709551616", 18446744073709551615UL, ERANGE);
17888 #if 0 /* strtoul() for /^-/ strings is undefined. */
17889 check("-1", 18446744073709551615UL, 0);
17890 check("-18446744073709551614", 2, 0);
17891 check("-18446744073709551615", 1, 0);
17892 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
17893 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
17898 $cat >>try.c <<'EOCP'
17899 check("4294967295", 4294967295UL, 0);
17900 check("4294967296", 4294967295UL, ERANGE);
17901 #if 0 /* strtoul() for /^-/ strings is undefined. */
17902 check("-1", 4294967295UL, 0);
17903 check("-4294967294", 2, 0);
17904 check("-4294967295", 1, 0);
17905 check("-4294967296", 4294967295UL, ERANGE);
17906 check("-4294967297", 4294967295UL, ERANGE);
17911 : Should we write these tests to be more portable by sprintf-ing
17912 : ~0 and then manipulating that char string as input for strtol?
17915 $cat >>try.c <<'EOCP'
17922 if eval $compile; then
17923 case "`$run ./try`" in
17924 ok) echo "Your strtoul() seems to be working okay." ;;
17926 Your strtoul() doesn't seem to be working okay.
17932 echo "(I can't seem to compile the test program--assuming it doesn't)"
17938 : see if strtoull exists
17939 set strtoull d_strtoull
17942 case "$d_longlong-$d_strtoull" in
17945 Checking whether your strtoull() works okay...
17947 $cat >try.c <<'EOCP'
17950 #define strtoull __strtoull
17953 extern unsigned long long int strtoull(char *s, char **, int);
17954 static int bad = 0;
17955 int check(char *s, long long eull, int een) {
17958 gull = strtoull(s, 0, 10);
17959 if (!((gull == eull) && (errno == een)))
17963 check(" 1", 1LL, 0);
17964 check(" 0", 0LL, 0);
17965 check("18446744073709551615", 18446744073709551615ULL, 0);
17966 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
17967 #if 0 /* strtoull() for /^-/ strings is undefined. */
17968 check("-1", 18446744073709551615ULL, 0);
17969 check("-18446744073709551614", 2LL, 0);
17970 check("-18446744073709551615", 1LL, 0);
17971 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
17972 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
17979 if eval $compile; then
17980 case "`$run ./try`" in
17981 ok) echo "Your strtoull() seems to be working okay." ;;
17983 Your strtoull() doesn't seem to be working okay.
17985 d_strtoull="$undef"
17989 echo "(I can't seem to compile the test program--assuming it doesn't)"
17990 d_strtoull="$undef"
17995 : see if strtouq exists
17996 set strtouq d_strtouq
17999 case "$d_strtouq" in
18002 Checking whether your strtouq() works okay...
18004 $cat >try.c <<'EOCP'
18007 extern unsigned long long int strtouq(char *s, char **, int);
18008 static int bad = 0;
18009 void check(char *s, unsigned long long eull, int een) {
18010 unsigned long long gull;
18012 gull = strtouq(s, 0, 10);
18013 if (!((gull == eull) && (errno == een)))
18017 check(" 1", 1LL, 0);
18018 check(" 0", 0LL, 0);
18019 check("18446744073709551615", 18446744073709551615ULL, 0);
18020 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
18021 #if 0 /* strtouq() for /^-/ strings is undefined. */
18022 check("-1", 18446744073709551615ULL, 0);
18023 check("-18446744073709551614", 2LL, 0);
18024 check("-18446744073709551615", 1LL, 0);
18025 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
18026 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
18034 if eval $compile; then
18035 case "`$run ./try`" in
18036 ok) echo "Your strtouq() seems to be working okay." ;;
18038 Your strtouq() doesn't seem to be working okay.
18044 echo "(I can't seem to compile the test program--assuming it doesn't)"
18050 : see if strxfrm exists
18051 set strxfrm d_strxfrm
18054 : see if symlink exists
18055 set symlink d_symlink
18058 : see if syscall exists
18059 set syscall d_syscall
18062 : see if prototype for syscall is available
18064 set d_syscallproto syscall $i_unistd unistd.h
18067 : see if sysconf exists
18068 set sysconf d_sysconf
18071 : see if system exists
18072 set system d_system
18075 : see if tcgetpgrp exists
18076 set tcgetpgrp d_tcgetpgrp
18079 : see if tcsetpgrp exists
18080 set tcsetpgrp d_tcsetpgrp
18083 : see if prototype for telldir is available
18085 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
18088 : see if time exists
18090 if test "X$d_time" = X -o X"$timetype" = X; then
18091 if set time val -f d_time; eval $csym; $val; then
18092 echo 'time() found.' >&4
18094 rp="What is the type returned by time() on this system?"
18095 set time_t timetype long stdio.h sys/types.h
18098 echo 'time() not found, hope that will do.' >&4
18106 : see if this is a sys/times.h system
18107 set sys/times.h i_systimes
18110 : see if times exists
18112 if set times val -f d_times; eval $csym; $val; then
18113 echo 'times() found.' >&4
18116 case "$i_systimes" in
18117 "$define") inc='sys/times.h';;
18119 rp="What is the type returned by times() on this system?"
18120 set clock_t clocktype long stdio.h sys/types.h $inc
18123 echo 'times() NOT found, hope that will do.' >&4
18128 : see if tmpnam_r exists
18129 set tmpnam_r d_tmpnam_r
18131 case "$d_tmpnam_r" in
18133 hdrs="$i_systypes sys/types.h define stdio.h "
18134 case "$d_tmpnam_r_proto:$usethreads" in
18135 ":define") d_tmpnam_r_proto=define
18136 set d_tmpnam_r_proto tmpnam_r $hdrs
18140 case "$d_tmpnam_r_proto" in
18142 case "$tmpnam_r_proto" in
18143 ''|0) try='char* tmpnam_r(char*);'
18144 ./protochk "extern $try" $hdrs && tmpnam_r_proto=B_B ;;
18146 case "$tmpnam_r_proto" in
18147 ''|0) d_tmpnam_r=undef
18149 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
18150 * ) case "$tmpnam_r_proto" in
18151 REENTRANT_PROTO*) ;;
18152 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
18154 echo "Prototype: $try" ;;
18157 *) case "$usethreads" in
18158 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
18165 *) tmpnam_r_proto=0
18169 : see if truncate exists
18170 set truncate d_truncate
18173 : see if ttyname_r exists
18174 set ttyname_r d_ttyname_r
18176 case "$d_ttyname_r" in
18178 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
18179 case "$d_ttyname_r_proto:$usethreads" in
18180 ":define") d_ttyname_r_proto=define
18181 set d_ttyname_r_proto ttyname_r $hdrs
18185 case "$d_ttyname_r_proto" in
18187 case "$ttyname_r_proto" in
18188 ''|0) try='int ttyname_r(int, char*, size_t);'
18189 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBW ;;
18191 case "$ttyname_r_proto" in
18192 ''|0) try='int ttyname_r(int, char*, int);'
18193 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBI ;;
18195 case "$ttyname_r_proto" in
18196 ''|0) try='char* ttyname_r(int, char*, int);'
18197 ./protochk "extern $try" $hdrs && ttyname_r_proto=B_IBI ;;
18199 case "$ttyname_r_proto" in
18200 ''|0) d_ttyname_r=undef
18202 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
18203 * ) case "$ttyname_r_proto" in
18204 REENTRANT_PROTO*) ;;
18205 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
18207 echo "Prototype: $try" ;;
18210 *) case "$usethreads" in
18211 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
18218 *) ttyname_r_proto=0
18222 : see if tzname[] exists
18224 if set tzname val -a d_tzname; eval $csym; $val; then
18226 echo 'tzname[] found.' >&4
18229 echo 'tzname[] NOT found.' >&4
18234 : Check if is a multiplatform env
18236 next|rhapsody|darwin) multiarch="$define" ;;
18238 case "$multiarch" in
18239 ''|[nN]*) multiarch="$undef" ;;
18242 : check for ordering of bytes in a UV
18244 case "$usecrosscompile$multiarch" in
18247 You seem to be either cross-compiling or doing a multiarchitecture build,
18248 skipping the byteorder check.
18254 case "$byteorder" in
18257 In the following, larger digits indicate more significance. A big-endian
18258 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
18259 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
18260 machines may have weird orders like 3412. A Cray will report 87654321,
18261 an Alpha will report 12345678. If the test program works the default is
18263 I'm now running the test program...
18267 #$i_stdlib I_STDLIB
18269 #include <stdlib.h>
18271 #include <sys/types.h>
18272 typedef $uvtype UV;
18282 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
18284 u.l = (UV)0x04030201;
18285 for (i = 0; i < $uvsize; i++)
18286 printf("%c", u.c[i]+'0');
18293 if eval $compile && $run ./try > /dev/null; then
18296 [1-4][1-4][1-4][1-4]|12345678|87654321)
18297 echo "(The test program ran ok.)"
18298 echo "byteorder=$dflt"
18301 ????|????????) echo "(The test program ran ok.)" ;;
18302 *) echo "(The test program didn't run right for some reason.)" ;;
18307 (I can't seem to compile the test program. Guessing big-endian...)
18310 case "$xxx_prompt" in
18312 rp="What is the order of bytes in $uvtype?"
18325 : Checking 32bit aligndness
18328 Checking to see whether you can access character data unalignedly...
18330 case "$d_u32align" in
18331 '') $cat >try.c <<EOCP
18333 #$i_stdlib I_STDLIB
18335 #include <stdlib.h>
18337 #define U32 $u32type
18338 #define BYTEORDER 0x$byteorder
18340 #include <signal.h>
18342 $signal_t bletch(int s) { exit(4); }
18345 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
18350 if (sizeof(U32) != 4) {
18351 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
18358 signal(SIGBUS, bletch);
18370 for (i = 0; i < 4; i++) {
18371 up = (U32*)(buf + i);
18372 if (! ((*up == 1 << (8*i)) || /* big-endian */
18373 (*up == 1 << (8*(3-i))) /* little-endian */
18377 printf("read failed (%x)\n", *up);
18383 for (i = 0; i < 4; i++) {
18384 up = (U32*)(buf + i);
18386 if (*up != 0xBeef) {
18387 printf("write failed (%x)\n", *up);
18401 if eval $compile_ok; then
18402 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
18403 $run ./try 2>&1 >/dev/null
18406 You can access character data pretty unalignedly.
18408 d_u32align="$undef"
18411 It seems that you must access character data in an aligned manner.
18413 d_u32align="$define"
18417 rp='Can you access character data at unaligned addresses?'
18421 [yY]*) d_u32align="$undef" ;;
18422 *) d_u32align="$define" ;;
18429 : see if ualarm exists
18430 set ualarm d_ualarm
18433 : see if umask exists
18437 : see if unordered exists
18438 set unordered d_unordered
18441 : see if unsetenv exists
18442 set unsetenv d_unsetenv
18445 : see if usleep exists
18446 set usleep d_usleep
18449 : see if prototype for usleep is available
18451 set d_usleepproto usleep $i_unistd unistd.h
18454 : see if ustat exists
18458 : see if closedir exists
18459 set closedir d_closedir
18462 case "$d_closedir" in
18465 echo "Checking whether closedir() returns a status..." >&4
18467 #$i_dirent I_DIRENT /**/
18468 #$i_sysdir I_SYS_DIR /**/
18469 #$i_sysndir I_SYS_NDIR /**/
18470 #$i_systypes I_SYS_TYPES /**/
18472 #if defined(I_SYS_TYPES)
18473 #include <sys/types.h>
18475 #if defined(I_DIRENT)
18476 #include <dirent.h>
18477 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
18478 #include <sys/dir.h>
18482 #include <sys/ndir.h>
18486 #include <ndir.h> /* may be wrong in the future */
18488 #include <sys/dir.h>
18493 int main() { return closedir(opendir(".")); }
18496 if eval $compile_ok; then
18497 if $run ./try > /dev/null 2>&1 ; then
18498 echo "Yes, it does."
18501 echo "No, it doesn't."
18505 echo "(I can't seem to compile the test program--assuming it doesn't)"
18513 set d_void_closedir
18517 : see if there is a wait4
18521 : see if waitpid exists
18522 set waitpid d_waitpid
18525 : see if wcstombs exists
18526 set wcstombs d_wcstombs
18529 : see if wctomb exists
18530 set wctomb d_wctomb
18533 : see if writev exists
18534 set writev d_writev
18537 : preserve RCS keywords in files with variable substitution, grrr
18542 Revision='$Revision'
18544 : check for alignment requirements
18546 case "$usecrosscompile$multiarch" in
18549 You seem to be either cross-compiling or doing a multiarchitecture build,
18550 skipping the memory alignment check.
18553 case "$alignbytes" in
18554 '') alignbytes=8 ;;
18558 case "$alignbytes" in
18559 '') echo "Checking alignment constraints..." >&4
18560 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
18561 $cat >try.c <<'EOCP'
18562 typedef long double NV;
18565 $cat >try.c <<'EOCP'
18569 $cat >>try.c <<'EOCP'
18577 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
18582 if eval $compile_ok; then
18586 echo "(I can't seem to compile the test program...)"
18589 *) dflt="$alignbytes"
18592 rp="Doubles must be aligned on a how-many-byte boundary?"
18600 : set the base revision
18603 : how do we concatenate cpp tokens here?
18605 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
18606 $cat >cpp_stuff.c <<'EOCP'
18607 #define RCAT(a,b)a/**/b
18608 #define ACAT(a,b)a ## b
18612 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
18613 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
18614 echo "Oh! Smells like ANSI's been here." >&4
18615 echo "We can catify or stringify, separately or together!"
18617 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
18618 echo "Ah, yes! The good old days!" >&4
18619 echo "However, in the good old days we don't know how to stringify and"
18620 echo "catify at the same time."
18624 Hmm, I don't seem to be able to concatenate tokens with your cpp.
18625 You're going to have to edit the values of CAT[2-5] in config.h...
18627 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
18631 : see if this is a db.h system
18637 : Check db version.
18639 echo "Checking Berkeley DB version ..." >&4
18645 #include <sys/types.h>
18647 #$i_stdlib I_STDLIB
18649 #include <stdlib.h>
18652 int main(int argc, char *argv[])
18654 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
18655 int Major, Minor, Patch ;
18656 unsigned long Version ;
18657 (void)db_version(&Major, &Minor, &Patch) ;
18659 printf("%d %d %d %d %d %d\n",
18660 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
18661 Major, Minor, Patch);
18664 printf("You have Berkeley DB Version 2 or greater.\n");
18666 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
18667 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
18668 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
18669 Major, Minor, Patch) ;
18671 /* check that db.h & libdb are compatible */
18672 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
18673 printf("db.h and libdb are incompatible.\n") ;
18677 printf("db.h and libdb are compatible.\n") ;
18679 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
18680 + DB_VERSION_PATCH ;
18682 /* needs to be >= 2.3.4 */
18683 if (Version < 2003004) {
18684 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
18685 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
18691 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
18696 printf("You have Berkeley DB Version 1.\n");
18697 exit(0); /* DB version < 2: the coast is clear. */
18699 exit(1); /* <db.h> not Berkeley DB? */
18705 if eval $compile_ok && $run ./try; then
18706 echo 'Looks OK.' >&4
18708 db_version_major=$1
18709 db_version_minor=$2
18710 db_version_patch=$3
18712 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
18716 : Remove db from list of libraries to use
18717 echo "Removing unusable -ldb from library list" >&4
18718 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
18721 echo "libs = $libs" >&4
18731 : Check the return type needed for hash
18733 echo "Checking return type needed for hash for Berkeley DB ..." >&4
18739 #include <sys/types.h>
18742 #ifndef DB_VERSION_MAJOR
18743 u_int32_t hash_cb (ptr, size)
18751 info.hash = hash_cb;
18755 if $cc $ccflags -c try.c >try.out 2>&1 ; then
18756 if $contains warning try.out >>/dev/null 2>&1 ; then
18759 db_hashtype='u_int32_t'
18762 : XXX Maybe we should just give up here.
18763 db_hashtype=u_int32_t
18765 echo "Help: I can't seem to compile the db test program." >&4
18766 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
18769 echo "Your version of Berkeley DB uses $db_hashtype for hash."
18771 *) db_hashtype=u_int32_t
18776 : Check the return type needed for prefix
18778 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
18784 #include <sys/types.h>
18787 #ifndef DB_VERSION_MAJOR
18788 size_t prefix_cb (key1, key2)
18796 info.prefix = prefix_cb;
18800 if $cc $ccflags -c try.c >try.out 2>&1 ; then
18801 if $contains warning try.out >>/dev/null 2>&1 ; then
18802 db_prefixtype='int'
18804 db_prefixtype='size_t'
18807 db_prefixtype='size_t'
18808 : XXX Maybe we should just give up here.
18810 echo "Help: I can't seem to compile the db test program." >&4
18811 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
18814 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
18816 *) db_prefixtype='size_t'
18820 : How can we generate normalized random numbers ?
18822 echo "Looking for a random number function..." >&4
18823 case "$randfunc" in
18825 if set drand48 val -f; eval $csym; $val; then
18827 echo "Good, found drand48()." >&4
18828 elif set random val -f; eval $csym; $val; then
18830 echo "OK, found random()." >&4
18833 echo "Yick, looks like I have to use rand()." >&4
18844 *-Dmy_rand=*|*-Dmy_srand=*)
18845 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
18846 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
18847 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
18848 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
18852 while $test "$cont"; do
18853 rp="Use which function to generate random numbers?"
18855 if $test "$ans" = "$dflt"; then
18861 if set $ans val -f; eval $csym; $val; then
18865 rp="I cannot find function $ans. Use that name anyway?"
18874 case "$randfunc" in
18876 drand01="drand48()"
18882 case "$randbits" in
18884 echo "Checking to see how many bits your $randfunc() function produces..." >&4
18886 #$i_unistd I_UNISTD
18887 #$i_stdlib I_STDLIB
18890 # include <unistd.h>
18893 # include <stdlib.h>
18898 register unsigned long tmp;
18899 register unsigned long max = 0L;
18901 for (i = 1000; i; i--) {
18902 tmp = (unsigned long) $randfunc();
18903 if (tmp > max) max = tmp;
18905 for (i = 0; max; i++)
18911 if eval $compile_ok; then
18915 echo "(I can't seem to compile the test program...)"
18922 rp="How many bits does your $randfunc() function produce?"
18926 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
18927 seedfunc="s$randfunc"
18928 randseedtype=unsigned
18932 rp="How many bits does your $randfunc() function produce?"
18935 seedfunc="s$randfunc"
18936 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
18937 if set $seedfunc val -f; eval $csym; $val; then
18938 echo "(Using $seedfunc() to seed random generator)"
18940 echo "(Warning: no $seedfunc() to seed random generator)"
18943 randseedtype=unsigned
18950 : Determine if this is an EBCDIC system
18952 echo "Determining whether or not we are on an EBCDIC system..." >&4
18953 $cat >try.c <<'EOM'
18956 if ('M'==0xd4) return 0;
18963 if eval $compile_ok; then
18964 if $run ./try; then
18965 echo "You seem to speak EBCDIC." >&4
18968 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
18971 echo "I'm unable to compile the test program." >&4
18972 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
18978 : Check how to flush
18981 Checking how to flush all pending stdio output...
18983 # I only know how to find the first 32 possibly open files on SunOS.
18984 # See also hints/sunos_4_1.sh and util.c --AD
18986 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
18988 $cat >>try.c <<EOCP
18990 #$i_stdlib I_STDLIB
18992 #include <stdlib.h>
18994 #$i_unistd I_UNISTD
18996 # include <unistd.h>
18998 #$d_sysconf HAS_SYSCONF
18999 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
19000 #ifdef HAS_STDIO_STREAM_ARRAY
19001 # define STDIO_STREAM_ARRAY $stdio_stream_array
19006 p = fopen("try.out", "w");
19010 # ifdef TRY_FPRINTF
19014 #ifdef TRY_FFLUSH_NULL
19017 #ifdef TRY_FFLUSH_ALL
19019 long open_max = -1;
19020 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
19021 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
19023 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
19024 open_max = sysconf(_SC_OPEN_MAX);
19027 open_max = FOPEN_MAX;
19030 open_max = OPEN_MAX;
19039 # ifdef HAS_STDIO_STREAM_ARRAY
19040 if (open_max > 0) {
19042 for (i = 0; i < open_max; i++)
19043 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
19044 STDIO_STREAM_ARRAY[i]._file < open_max &&
19045 STDIO_STREAM_ARRAY[i]._flag)
19046 fflush(&STDIO_STREAM_ARRAY[i]);
19054 : first we have to find out how _not_ to flush
19056 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
19058 set try -DTRY_FPUTC
19059 if eval $compile; then
19060 $run ./try 2>/dev/null
19063 if $test ! -s try.out -a "X$code" = X42; then
19069 set try -DTRY_FPRINTF
19070 if eval $compile; then
19071 $run ./try 2>/dev/null
19074 if $test ! -s try.out -a "X$code" = X42; then
19075 output=-DTRY_FPRINTF
19081 : check for fflush NULL behaviour
19082 case "$fflushNULL" in
19083 '') set try -DTRY_FFLUSH_NULL $output
19084 if eval $compile; then
19085 $run ./try 2>/dev/null
19088 if $test -s try.out -a "X$code" = X42; then
19089 fflushNULL="`$cat try.out`"
19091 if $test "X$code" != X42; then
19093 (If this test failed, don't worry, we'll try another method shortly.)
19098 $rm -f core try.core core.try.*
19099 case "$fflushNULL" in
19101 Your fflush(NULL) works okay for output streams.
19102 Let's see if it clobbers input pipes...
19104 # As of mid-March 2000 all versions of Solaris appear to have a stdio
19105 # bug that improperly flushes the input end of pipes. So we avoid the
19106 # autoflush on fork/system/exec support for now. :-(
19107 $cat >tryp.c <<EOCP
19110 main(int argc, char **argv)
19116 while ((i = getc(stdin)) != -1
19117 && (*bp++ = i) != '\n'
19118 && bp < &buf[1024])
19121 fprintf(stdout, "%s", buf);
19129 fflushNULL="$define"
19131 if eval $compile; then
19133 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
19134 if cmp tryp.c tryp.out >/dev/null 2>&1; then
19136 fflush(NULL) seems to behave okay with input streams.
19138 fflushNULL="$define"
19141 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
19143 fflushNULL="$undef"
19146 $rm -f core tryp.c tryp.core core.tryp.*
19149 Your fflush(NULL) isn't working (contrary to ANSI C).
19151 fflushNULL="$undef"
19154 Cannot figure out whether your fflush(NULL) works or not.
19155 I'm assuming it doesn't (contrary to ANSI C).
19157 fflushNULL="$undef"
19161 $define|true|[yY]*)
19162 fflushNULL="$define"
19165 fflushNULL="$undef"
19168 : check explicit looping only if NULL did not work, and if the pipe
19169 : bug does not show up on an explicit flush too
19170 case "$fflushNULL" in
19172 $cat >tryp.c <<EOCP
19175 main(int argc, char **argv)
19181 while ((i = getc(stdin)) != -1
19182 && (*bp++ = i) != '\n'
19183 && bp < &buf[1024])
19186 fprintf(stdout, "%s", buf);
19195 if eval $compile; then
19197 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
19198 if cmp tryp.c tryp.out >/dev/null 2>&1; then
19200 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
19202 : now check for fflushall behaviour
19203 case "$fflushall" in
19204 '') set try -DTRY_FFLUSH_ALL $output
19205 if eval $compile; then
19207 (Now testing the other method--but note that this also may fail.)
19209 $run ./try 2>/dev/null
19212 if $test -s try.out -a "X$code" = X42; then
19213 fflushall="`$cat try.out`"
19217 case "$fflushall" in
19219 Whew. Flushing explicitly all the stdio streams works.
19221 fflushall="$define"
19224 Sigh. Flushing explicitly all the stdio streams doesn't work.
19229 Cannot figure out whether flushing stdio streams explicitly works or not.
19230 I'm assuming it doesn't.
19236 "$define"|true|[yY]*)
19237 fflushall="$define"
19245 All is futile. Even fflush(stdin) clobbers input pipes!
19252 $rm -f core tryp.c tryp.core core.tryp.*
19254 *) fflushall="$undef"
19258 case "$fflushNULL$fflushall" in
19261 OK, I give up. I cannot figure out how to flush pending stdio output.
19262 We won't be flushing handles at all before fork/exec/popen.
19268 : Store the full pathname to the ar program for use in the C program
19269 : Respect a hint or command line value for full_ar.
19274 : Store the full pathname to the sed program for use in the C program
19277 : see what type gids are declared as in the kernel
19279 echo "Looking for the type for group ids returned by getgid()."
19280 set gid_t gidtype xxx stdio.h sys/types.h
19284 xxx=`./findhdr sys/user.h`
19285 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
19287 unsigned) dflt="$1 $2" ;;
19291 *) dflt="$gidtype";;
19294 gid_t) echo "gid_t found." ;;
19295 *) rp="What is the type for group ids returned by getgid()?"
19301 : Check the size of GID
19304 *_t) zzz="$gidtype" ;;
19307 echo "Checking the size of $zzz..." >&4
19309 #include <sys/types.h>
19311 #$i_stdlib I_STDLIB
19313 #include <stdlib.h>
19316 printf("%d\n", (int)sizeof($gidtype));
19321 if eval $compile_ok; then
19325 echo "(I can't execute the test program--guessing $gidsize.)" >&4
19328 echo "Your $zzz is $gidsize bytes long."
19333 echo "(I can't compile the test program--guessing $gidsize.)" >&4
19337 : Check if GID is signed
19340 *_t) zzz="$gidtype" ;;
19343 echo "Checking the sign of $zzz..." >&4
19345 #include <sys/types.h>
19356 if eval $compile; then
19360 echo "(I can't execute the test program--guessing unsigned.)" >&4
19364 1) echo "Your $zzz is unsigned." ;;
19365 -1) echo "Your $zzz is signed." ;;
19371 echo "(I can't compile the test program--guessing unsigned.)" >&4
19375 : Check 64bit sizes
19378 if $test X"$quadtype" != X; then
19380 echo "Checking how to print 64-bit integers..." >&4
19382 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
19383 $cat >try.c <<'EOCP'
19384 #include <sys/types.h>
19387 int q = 12345678901;
19388 printf("%ld\n", q);
19392 if eval $compile; then
19396 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
19397 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
19398 echo "We will use %d."
19404 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
19405 $cat >try.c <<'EOCP'
19406 #include <sys/types.h>
19409 long q = 12345678901;
19410 printf("%ld\n", q);
19414 if eval $compile; then
19418 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
19419 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
19420 echo "We will use %ld."
19426 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
19427 $cat >try.c <<'EOCP'
19428 #include <sys/types.h>
19429 #include <inttypes.h>
19432 int64_t q = 12345678901;
19433 printf("%" PRId64 "\n", q);
19437 if eval $compile; then
19441 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
19442 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
19443 echo "We will use the C9X style."
19449 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
19451 #include <sys/types.h>
19454 $quadtype q = 12345678901;
19455 printf("%Ld\n", q);
19459 if eval $compile; then
19463 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
19464 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
19465 echo "We will use %Ld."
19471 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
19472 $cat >try.c <<'EOCP'
19473 #include <sys/types.h>
19476 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
19477 printf("%lld\n", q);
19481 if eval $compile; then
19485 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
19486 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
19487 echo "We will use the %lld style."
19493 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
19495 #include <sys/types.h>
19498 $quadtype q = 12345678901;
19499 printf("%qd\n", q);
19503 if eval $compile; then
19507 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
19508 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
19509 echo "We will use %qd."
19515 if $test X"$sPRId64" = X; then
19516 echo "Cannot figure out how to print 64-bit integers." >&4
19523 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
19524 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
19526 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
19527 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
19531 : Check format strings for internal types
19533 $echo "Checking the format strings to be used for Perl's internal types..." >&4
19535 if $test X"$ivsize" = X8; then
19536 ivdformat="$sPRId64"
19537 uvuformat="$sPRIu64"
19538 uvoformat="$sPRIo64"
19539 uvxformat="$sPRIx64"
19540 uvXUformat="$sPRIXU64"
19542 if $test X"$ivsize" = X"$longsize"; then
19549 if $test X"$ivsize" = X"$intsize"; then
19557 if $test X"$ivsize" = X"$shortsize"; then
19568 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
19569 nveformat="$sPRIeldbl"
19570 nvfformat="$sPRIfldbl"
19571 nvgformat="$sPRIgldbl"
19572 nvEUformat="$sPRIEUldbl"
19573 nvFUformat="$sPRIFUldbl"
19574 nvGUformat="$sPRIGUldbl"
19584 case "$ivdformat" in
19585 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
19590 : Check format string for GID
19593 $echo "Checking the format string to be used for gids..." >&4
19596 -1) if $test X"$gidsize" = X"$ivsize"; then
19597 gidformat="$ivdformat"
19599 if $test X"$gidsize" = X"$longsize"; then
19602 if $test X"$gidsize" = X"$intsize"; then
19605 if $test X"$gidsize" = X"$shortsize"; then
19612 *) if $test X"$gidsize" = X"$uvsize"; then
19613 gidformat="$uvuformat"
19615 if $test X"$gidsize" = X"$longsize"; then
19618 if $test X"$gidsize" = X"$intsize"; then
19621 if $test X"$gidsize" = X"$shortsize"; then
19630 : see if getgroups exists
19631 set getgroups d_getgrps
19634 : see if setgroups exists
19635 set setgroups d_setgrps
19638 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
19640 case "$d_getgrps$d_setgrps" in
19642 case "$groupstype" in
19643 '') dflt="$gidtype" ;;
19644 *) dflt="$groupstype" ;;
19647 What type of pointer is the second argument to getgroups() and setgroups()?
19648 Usually this is the same as group ids, $gidtype, but not always.
19651 rp='What type pointer is the second argument to getgroups() and setgroups()?'
19655 *) groupstype="$gidtype";;
19658 : MAD = Misc Attribute Definition
19660 if $test $patchlevel -lt 9; then
19661 : MAD is not available in 5.8.x or earlier.
19665 $define|true|[yY]*) dflt='y' ;;
19670 Would you like to build with Misc Attribute Decoration? This is development
19671 work leading to a Perl 5 to Perl 6 convertor, which imposes a space and speed
19672 overhead on the interpreter.
19674 If this doesn't make any sense to you, just accept the default '$dflt'.
19676 rp='Build Perl with MAD?'
19681 madlyh='madly.h madly.act madly.tab'
19683 madlyobj="madly$_o" ;;
19692 : check whether make sets MAKE
19694 echo "Checking if your $make program sets \$(MAKE)..." >&4
19695 case "$make_set_make" in
19697 $sed 's/^X //' > testmake.mak << 'EOF'
19699 X @echo 'maketemp="$(MAKE)"'
19701 case "`$make -f testmake.mak 2>/dev/null`" in
19702 *maketemp=*) make_set_make='#' ;;
19703 *) make_set_make="MAKE=$make" ;;
19705 $rm -f testmake.mak
19708 case "$make_set_make" in
19709 '#') echo "Yup, it does.";;
19710 *) echo "Nope, it doesn't.";;
19713 : see what type is used for mode_t
19714 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
19715 set mode_t modetype int stdio.h sys/types.h
19718 : see if we need va_copy
19720 case "$i_stdarg" in
19723 #include <stdarg.h>
19725 #$i_stdlib I_STDLIB
19727 #include <stdlib.h>
19729 #include <signal.h>
19732 ivfprintf(FILE *f, const char *fmt, va_list *valp)
19734 return vfprintf(f, fmt, *valp);
19738 myvfprintf(FILE *f, const char *fmt, va_list val)
19740 return ivfprintf(f, fmt, &val);
19744 myprintf(char *fmt, ...)
19747 va_start(val, fmt);
19748 return myvfprintf(stdout, fmt, val);
19752 main(int ac, char **av)
19754 signal(SIGSEGV, exit);
19756 myprintf("%s%cs all right, then\n", "that", '\'');
19761 if eval $compile && $run ./try 2>&1 >/dev/null; then
19762 case "`$run ./try`" in
19763 "that's all right, then")
19769 yes) echo "It seems that you don't need va_copy()." >&4
19770 need_va_copy="$undef"
19772 *) echo "It seems that va_copy() or similar will be needed." >&4
19773 need_va_copy="$define"
19778 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
19782 : see what type is used for size_t
19783 rp="What is the type used for the length parameter for string functions?"
19784 set size_t sizetype 'unsigned int' stdio.h sys/types.h
19787 : check for type of arguments to gethostbyaddr.
19788 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
19789 case "$d_gethbyaddr" in
19793 Checking to see what type of arguments are accepted by gethostbyaddr().
19795 hdrs="$define sys/types.h
19796 $d_socket sys/socket.h
19797 $i_niin netinet/in.h
19799 $i_unistd unistd.h"
19800 : The first arg can 'char *' or 'void *'
19801 : The second arg is some of integral type
19802 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
19803 for yyy in size_t long int; do
19804 case "$netdb_host_type" in
19805 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
19806 if ./protochk "$try" $hdrs; then
19807 echo "Your system accepts $xxx for the first arg."
19808 echo "...and $yyy for the second arg."
19809 netdb_host_type="$xxx"
19810 netdb_hlen_type="$yyy"
19816 : In case none of those worked, prompt the user.
19817 case "$netdb_host_type" in
19818 '') rp='What is the type for the 1st argument to gethostbyaddr?'
19821 netdb_host_type=$ans
19822 rp='What is the type for the 2nd argument to gethostbyaddr?'
19825 netdb_hlen_type=$ans
19829 *) : no gethostbyaddr, so pick harmless defaults
19830 netdb_host_type='char *'
19831 netdb_hlen_type="$sizetype"
19834 # Remove the "const" if needed. -- but then we'll have a
19836 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
19839 : check for type of argument to gethostbyname.
19840 if test "X$netdb_name_type" = X ; then
19841 case "$d_gethbyname" in
19845 Checking to see what type of argument is accepted by gethostbyname().
19847 hdrs="$define sys/types.h
19848 $d_socket sys/socket.h
19849 $i_niin netinet/in.h
19851 $i_unistd unistd.h"
19852 for xxx in "const char *" "char *"; do
19853 case "$netdb_name_type" in
19854 '') try="extern struct hostent *gethostbyname($xxx);"
19855 if ./protochk "$try" $hdrs; then
19856 echo "Your system accepts $xxx."
19857 netdb_name_type="$xxx"
19862 : In case none of those worked, prompt the user.
19863 case "$netdb_name_type" in
19864 '') rp='What is the type for the 1st argument to gethostbyname?'
19867 netdb_name_type=$ans
19871 *) : no gethostbyname, so pick harmless default
19872 netdb_name_type='char *'
19877 : check for type of 1st argument to getnetbyaddr.
19878 if test "X$netdb_net_type" = X ; then
19879 case "$d_getnbyaddr" in
19883 Checking to see what type of 1st argument is accepted by getnetbyaddr().
19885 hdrs="$define sys/types.h
19886 $d_socket sys/socket.h
19887 $i_niin netinet/in.h
19889 $i_unistd unistd.h"
19890 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
19891 case "$netdb_net_type" in
19892 '') try="extern struct netent *getnetbyaddr($xxx, int);"
19893 if ./protochk "$try" $hdrs; then
19894 echo "Your system accepts $xxx."
19895 netdb_net_type="$xxx"
19900 : In case none of those worked, prompt the user.
19901 case "$netdb_net_type" in
19902 '') rp='What is the type for the 1st argument to getnetbyaddr?'
19905 netdb_net_type=$ans
19909 *) : no getnetbyaddr, so pick harmless default
19910 netdb_net_type='long'
19914 : locate the preferred pager for this system
19921 [a-zA-Z]:/*) dflt=$pg;;
19925 [a-zA-Z]:/*) dflt=$more;;
19929 [a-zA-Z]:/*) dflt=$less;;
19932 '') dflt=/usr/ucb/more;;
19940 rp='What pager is used on your system?'
19944 : see what type pids are declared as in the kernel
19945 rp="What is the type of process ids on this system?"
19946 set pid_t pidtype int stdio.h sys/types.h
19949 : see if ar generates random libraries by itself
19951 echo "Checking how to generate random libraries on your machine..." >&4
19952 echo 'int bar1() { return bar2(); }' > bar1.c
19953 echo 'int bar2() { return 2; }' > bar2.c
19955 #$i_stdlib I_STDLIB
19957 #include <stdlib.h>
19959 int main() { printf("%d\n", bar1()); exit(0); }
19961 $cc $ccflags -c bar1.c >/dev/null 2>&1
19962 $cc $ccflags -c bar2.c >/dev/null 2>&1
19963 $cc $ccflags -c foo.c >/dev/null 2>&1
19964 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
19965 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19966 $run ./foobar >/dev/null 2>&1; then
19967 echo "$ar appears to generate random libraries itself."
19969 if [ "X$ranlib" = "X" ]; then
19972 elif $ar s bar$_a >/dev/null 2>&1 &&
19973 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19974 $run ./foobar >/dev/null 2>&1; then
19975 echo "a table of contents needs to be added with '$ar s'."
19978 elif $ar ts bar$_a >/dev/null 2>&1 &&
19979 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19980 $run ./foobar >/dev/null 2>&1; then
19981 echo "a table of contents needs to be added with '$ar ts'."
19988 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
19989 $test -f $ranlib || ranlib=''
19992 if $test -n "$ranlib"; then
19993 echo "your system has '$ranlib'; we'll use that."
19996 echo "your system doesn't seem to support random libraries"
19997 echo "so we'll use lorder and tsort to order the libraries."
20004 : check for type of arguments to select.
20005 case "$selecttype" in
20006 '') case "$d_select" in
20010 Checking to see what type of arguments are accepted by select().
20012 hdrs="$define sys/types.h
20013 $i_systime sys/time.h
20014 $i_sysselct sys/select.h
20015 $d_socket sys/socket.h"
20016 : The first arg can be int, unsigned, or size_t
20017 : The last arg may or may not be 'const'
20019 : void pointer has been seen but using that
20020 : breaks the selectminbits test
20021 for xxx in 'fd_set *' 'int *'; do
20022 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
20023 for tmo in 'struct timeval *' 'const struct timeval *'; do
20025 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
20026 if ./protochk "$try" $hdrs; then
20027 echo "Your system accepts $xxx."
20036 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
20037 case "$d_fd_set" in
20038 $define) dflt="fd_set *" ;;
20047 *) : no select, so pick a harmless default
20054 : check for the select 'width'
20055 case "$selectminbits" in
20056 '') safebits=`expr $ptrsize \* 8`
20057 case "$d_select" in
20061 Checking to see on how many bits at a time your select() operates...
20064 #include <sys/types.h>
20066 #$i_systime I_SYS_TIME
20067 #$i_systimek I_SYS_TIME_KERNEL
20072 # ifdef I_SYS_TIME_KERNEL
20075 # include <sys/time.h>
20076 # ifdef I_SYS_TIME_KERNEL
20080 #$i_sysselct I_SYS_SELECT
20081 #ifdef I_SYS_SELECT
20082 #include <sys/select.h>
20084 #$d_socket HAS_SOCKET
20086 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
20089 #$i_stdlib I_STDLIB
20091 #include <stdlib.h>
20094 #define S sizeof(*(b))
20096 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
20097 #define NBITS (NBYTES * 8)
20099 char *s = (char *)malloc(NBYTES);
20108 fp = fopen("try.c", "r");
20114 b = ($selecttype)s;
20115 for (i = 0; i < NBITS; i++)
20119 select(fd + 1, b, 0, 0, &t);
20120 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
20122 printf("%d\n", i + 1);
20127 if eval $compile_ok; then
20128 selectminbits=`$run ./try`
20129 case "$selectminbits" in
20131 Cannot figure out on how many bits at a time your select() operates.
20132 I'll play safe and guess it is $safebits bits.
20134 selectminbits=$safebits
20135 bits="$safebits bits"
20138 *) bits="$selectminbits bits" ;;
20140 echo "Your select() operates on $bits at a time." >&4
20142 rp='What is the minimum number of bits your select() operates on?'
20143 case "$byteorder" in
20144 12345678) dflt=64 ;;
20150 selectminbits="$val"
20154 *) : no select, so pick a harmless default
20155 selectminbits=$safebits
20161 : Trace out the files included by signal.h, then look for SIGxxx names.
20162 if [ "X$fieldn" = X ]; then
20163 : Just make some guesses. We check them later.
20164 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
20166 xxx=`echo '#include <signal.h>' |
20167 $cppstdin $cppminus $cppflags 2>/dev/null |
20168 $grep '^[ ]*#.*include' |
20169 $awk "{print \\$$fieldn}" | $sed 's!"!!g' |\
20170 $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
20173 for xx in $xxx /dev/null ; do
20174 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
20176 case "$xxxfiles" in
20177 '') xxxfiles=`./findhdr signal.h` ;;
20180 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
20181 print substr($2, 4, 20)
20183 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
20184 print substr($3, 4, 20)
20186 : Append some common names just in case the awk scan failed.
20187 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
20188 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
20189 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
20190 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
20191 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
20193 : generate a few handy files for later
20194 $cat > signal.c <<EOCP
20195 #include <sys/types.h>
20196 #include <signal.h>
20197 #$i_stdlib I_STDLIB
20199 #include <stdlib.h>
20204 /* Strange style to avoid deeply-nested #if/#else/#endif */
20207 # define NSIG (_NSIG)
20213 # define NSIG (SIGMAX+1)
20219 # define NSIG (SIG_MAX+1)
20225 # define NSIG (_SIG_MAX+1)
20231 # define NSIG (MAXSIG+1)
20237 # define NSIG (MAX_SIG+1)
20242 # ifdef SIGARRAYSIZE
20243 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
20249 # define NSIG (_sys_nsig) /* Solaris 2.5 */
20253 /* Default to some arbitrary number that's big enough to get most
20254 of the common signals.
20260 printf("NSIG %d\n", NSIG);
20266 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
20268 printf "#ifdef SIG"; printf $1; printf "\n"
20269 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
20270 printf $1; printf ");\n"
20274 printf "#endif /* JUST_NSIG */\n";
20275 printf "exit(0);\n}\n";
20278 $cat >signal.awk <<'EOP'
20279 BEGIN { ndups = 0 }
20280 $1 ~ /^NSIG$/ { nsig = $2 }
20281 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
20282 if ($2 > maxsig) { maxsig = $2 }
20283 if (sig_name[$2]) {
20284 dup_name[ndups] = $1
20285 dup_num[ndups] = $2
20297 printf("NSIG %d\n", nsig);
20298 for (n = 1; n < nsig; n++) {
20300 printf("%s %d\n", sig_name[n], sig_num[n])
20303 printf("NUM%d %d\n", n, n)
20306 for (n = 0; n < ndups; n++) {
20307 printf("%s %d\n", dup_name[n], dup_num[n])
20311 $cat >signal_cmd <<EOS
20313 if $test -s signal.lst; then
20314 echo "Using your existing signal.lst file"
20319 $cat >>signal_cmd <<'EOS'
20322 if eval $compile_ok; then
20323 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) |\
20324 $uniq | $awk -f signal.awk >signal.lst
20326 echo "(I can't seem be able to compile the whole test program)" >&4
20327 echo "(I'll try it in little pieces.)" >&4
20328 set signal -DJUST_NSIG
20329 if eval $compile_ok; then
20330 $run ./signal$_exe > signal.nsg
20333 echo "I can't seem to figure out how many signals you have." >&4
20334 echo "Guessing 50." >&4
20335 echo 'NSIG 50' > signal.nsg
20337 : Now look at all the signal names, one at a time.
20338 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
20339 $cat > signal.c <<EOCP
20340 #include <sys/types.h>
20341 #include <signal.h>
20344 printf("$xx %d\n", SIG${xx});
20349 if eval $compile; then
20350 echo "SIG${xx} found."
20351 $run ./signal$_exe >> signal.ls1
20353 echo "SIG${xx} NOT found."
20356 if $test -s signal.ls1; then
20357 $cat signal.nsg signal.ls1 |
20358 $sort -n | $uniq | $awk -f signal.awk >signal.lst
20362 if $test -s signal.lst; then
20365 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
20366 echo 'kill -l' >signal
20367 set X `csh -f <signal`
20371 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
20373 echo $@ | $tr ' ' $trnl | \
20374 $awk '{ printf "%s %d\n", $1, ++s; }
20375 END { printf "NSIG %d\n", ++s }' >signal.lst
20377 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
20379 chmod a+x signal_cmd
20380 $eunicefix signal_cmd
20382 : generate list of signal names
20384 case "$sig_name_init" in
20386 *) case "$sig_num_init" in
20387 ''|*,*) doinit=yes ;;
20392 echo "Generating a list of signal names and numbers..." >&4
20394 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
20395 sig_name=`$awk 'BEGIN { printf "ZERO " }
20396 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
20397 sig_num=`$awk 'BEGIN { printf "0 " }
20398 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
20399 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
20400 !/^NSIG/ { printf "\"%s\", ", $1 }
20401 END { printf "0\n" }' signal.lst`
20402 sig_num_init=`$awk 'BEGIN { printf "0, " }
20403 !/^NSIG/ { printf "%d, ", $2}
20404 END { printf "0\n"}' signal.lst`
20407 echo "The following $sig_count signals are available:"
20409 echo $sig_name | $awk \
20410 'BEGIN { linelen = 0 }
20412 for (i = 1; i <= NF; i++) {
20413 name = "SIG" $i " "
20414 linelen = linelen + length(name)
20415 if (linelen > 70) {
20417 linelen = length(name)
20423 sig_size=`echo $sig_name | awk '{print NF}'`
20424 $rm -f signal signal.c signal.awk signal.lst signal_cmd
20426 : Check size of size
20428 case "$sizetype" in
20429 *_t) zzz="$sizetype" ;;
20430 *) zzz="filesize" ;;
20432 echo "Checking the size of $zzz..." >&4
20434 #include <sys/types.h>
20436 #$i_stdlib I_STDLIB
20438 #include <stdlib.h>
20441 printf("%d\n", (int)sizeof($sizetype));
20446 if eval $compile_ok; then
20450 echo "(I can't execute the test program--guessing $sizesize.)" >&4
20453 echo "Your $zzz size is $sizesize bytes."
20458 echo "(I can't compile the test program--guessing $sizesize.)" >&4
20462 : check for socklen_t
20464 echo "Checking to see if you have socklen_t..." >&4
20466 #include <sys/types.h>
20467 #$d_socket HAS_SOCKET
20469 #include <sys/socket.h>
20471 int main() { socklen_t x = 16; }
20474 if eval $compile; then
20476 echo "You have socklen_t."
20479 echo "You do not have socklen_t."
20480 case "$sizetype" in
20481 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
20488 : see if this is a socks.h system
20489 set socks.h i_socks
20492 : check for type of the size argument to socket calls
20493 case "$d_socket" in
20497 Checking to see what type is the last argument of accept().
20500 case "$d_socklen_t" in
20501 "$define") yyy="$yyy socklen_t"
20503 yyy="$yyy $sizetype int long unsigned"
20504 for xxx in $yyy; do
20505 case "$socksizetype" in
20506 '') try="extern int accept(int, struct sockaddr *, $xxx *);"
20507 case "$usesocks" in
20509 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
20510 echo "Your system accepts '$xxx *' for the last argument of accept()."
20511 socksizetype="$xxx"
20514 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
20515 echo "Your system accepts '$xxx *' for the last argument of accept()."
20516 socksizetype="$xxx"
20523 : In case none of those worked, prompt the user.
20524 case "$socksizetype" in
20525 '') rp='What is the type for socket address structure sizes?'
20532 *) : no sockets, so pick relatively harmless default
20537 : see what type is used for signed size_t
20538 set ssize_t ssizetype int stdio.h sys/types.h
20543 #$i_stdlib I_STDLIB
20545 #include <stdlib.h>
20547 #include <sys/types.h>
20548 #define Size_t $sizetype
20549 #define SSize_t $dflt
20552 if (sizeof(Size_t) == sizeof(SSize_t))
20554 else if (sizeof(Size_t) == sizeof(int))
20563 if eval $compile_ok && $run ./try > /dev/null; then
20564 ssizetype=`$run ./try`
20565 echo "I'll be using $ssizetype for functions returning a byte count." >&4
20568 Help! I can't compile and run the ssize_t test program: please enlighten me!
20569 (This is probably a misconfiguration in your system or libraries, and
20570 you really ought to fix it. Still, I'll try anyway.)
20572 I need a type that is the same size as $sizetype, but is guaranteed to
20573 be signed. Common values are ssize_t, int and long.
20576 rp="What signed type is the same size as $sizetype?"
20582 : see what type of char stdio uses.
20584 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
20585 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
20586 echo "Your stdio uses unsigned chars." >&4
20587 stdchar="unsigned char"
20589 echo "Your stdio uses signed chars." >&4
20594 : see what type uids are declared as in the kernel
20596 echo "Looking for the type for user ids returned by getuid()."
20597 set uid_t uidtype xxx stdio.h sys/types.h
20601 xxx=`./findhdr sys/user.h`
20602 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
20604 unsigned) dflt="$1 $2" ;;
20608 *) dflt="$uidtype";;
20611 uid_t) echo "uid_t found." ;;
20612 *) rp="What is the type for user ids returned by getuid()?"
20618 : Check size of UID
20621 *_t) zzz="$uidtype" ;;
20624 echo "Checking the size of $zzz..." >&4
20626 #include <sys/types.h>
20628 #$i_stdlib I_STDLIB
20630 #include <stdlib.h>
20633 printf("%d\n", (int)sizeof($uidtype));
20638 if eval $compile_ok; then
20642 echo "(I can't execute the test program--guessing $uidsize.)" >&4
20645 echo "Your $zzz is $uidsize bytes long."
20650 echo "(I can't compile the test program--guessing $uidsize.)" >&4
20653 : Check if UID is signed
20656 *_t) zzz="$uidtype" ;;
20659 echo "Checking the sign of $zzz..." >&4
20661 #include <sys/types.h>
20672 if eval $compile; then
20676 echo "(I can't execute the test program--guessing unsigned.)" >&4
20680 1) echo "Your $zzz is unsigned." ;;
20681 -1) echo "Your $zzz is signed." ;;
20687 echo "(I can't compile the test program--guessing unsigned.)" >&4
20691 : Check format string for UID
20693 $echo "Checking the format string to be used for uids..." >&4
20696 -1) if $test X"$uidsize" = X"$ivsize"; then
20697 uidformat="$ivdformat"
20699 if $test X"$uidsize" = X"$longsize"; then
20702 if $test X"$uidsize" = X"$intsize"; then
20705 if $test X"$uidsize" = X"$shortsize"; then
20712 *) if $test X"$uidsize" = X"$uvsize"; then
20713 uidformat="$uvuformat"
20715 if $test X"$uidsize" = X"$longsize"; then
20718 if $test X"$uidsize" = X"$intsize"; then
20721 if $test X"$uidsize" = X"$shortsize"; then
20730 : Check if site customization support was requested
20731 case "$usesitecustomize" in
20732 $define|true|[Yy]*)
20733 usesitecustomize="$define"
20736 usesitecustomize="$undef"
20740 : determine compiler compiler
20749 if $test -f "$byacc$_exe"; then
20751 comp="byacc or $comp"
20753 if $test -f "$bison$_exe"; then
20754 comp="$comp or bison -y"
20756 rp="Which compiler compiler ($comp) shall I use?"
20765 echo "(Adding -y option to bison to get yacc-compatible behaviour.)"
20771 : see if this is a assert.h system
20772 set assert.h i_assert
20775 : see if this is a fp.h system
20779 : see if this is a fp_class.h system
20780 set fp_class.h i_fp_class
20783 : see if gdbm.h is available
20788 : see if gdbm_open exists
20789 set gdbm_open d_gdbm_open
20791 case "$d_gdbm_open" in
20794 echo "We won't be including <gdbm.h>"
20803 : see if ndbm.h is available
20806 : Compatibility location for RedHat 7.1
20807 set gdbm/ndbm.h i_gdbmndbm
20809 : Compatibility location for Debian 4.0
20810 set gdbm-ndbm.h i_gdbm_ndbm
20813 if $test "$i_ndbm" = "$define" -o "$i_gdbmndbm" = "$define" -o "$i_gdbm_ndbm" = "$define"; then
20814 : see if dbm_open exists
20815 set dbm_open d_dbm_open
20817 case "$d_dbm_open" in
20820 i_gdbmndbm="$undef"
20821 i_gdbm_ndbm="$undef"
20822 echo "We won't be including <ndbm.h>"
20832 : see if this is a ieeefp.h system
20833 case "$i_ieeefp" in
20834 '' ) set ieeefp.h i_ieeefp
20839 : see if this is a libutil.h system
20840 set libutil.h i_libutil
20843 : see if mach cthreads are available
20844 if test "X$usethreads" = "X$define"; then
20845 set mach/cthreads.h i_machcthr
20848 i_machcthr="$undef"
20851 : see if this is a mntent.h system
20852 set mntent.h i_mntent
20855 : see if net/errno.h is available
20857 set net/errno.h val
20860 : Unfortunately, it causes problems on some systems. Arrgh.
20863 cat > try.c <<'EOM'
20866 #include <net/errno.h>
20872 if $cc $ccflags -c try.c >/dev/null 2>&1; then
20873 echo "We'll be including <net/errno.h>." >&4
20875 echo "We won't be including <net/errno.h>." >&4
20884 : see if netinet/tcp.h is available
20885 set netinet/tcp.h i_netinettcp
20888 : see if this is a poll.h system
20892 : see if this is a prot.h system
20896 : Preprocessor symbols
20898 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
20899 $cat <<'EOSH' > Cppsym.know
20900 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
20901 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
20902 alliant alpha am29000 AM29000 AMD64 amd64 amiga AMIGAOS AMIX
20903 ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
20904 BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
20905 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
20906 bull c cadmus clipper CMU COFF COMPILER_VERSION
20907 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
20908 CYGWIN DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
20909 Dynix DynixPTX ELF encore EPI EXTENSIONS FAVOR_BSD
20910 FILE_OFFSET_BITS FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
20912 GNU_SOURCE GNUC GNUC_MINOR GNU_LIBRARY GO32 gould GOULD_PN
20913 H3050R H3050RX hbullx20 hcx host_mips
20914 hp200 hp300 hp700 HP700 hp800 hp9000
20915 hp9000s200 hp9000s300 hp9000s400 hp9000s500
20916 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
20917 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
20918 IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
20919 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
20920 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
20921 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
20922 LIBCATAMOUNT Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
20923 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
20924 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
20925 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
20926 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
20927 MATH_HAS_NO_SIDE_EFFECTS
20928 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
20929 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
20930 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
20931 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
20932 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
20933 NetBSD news1500 news1700 news1800 news1900 news3700
20934 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
20935 ns32016 ns32332 ns32k nsc32000
20936 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
20937 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
20938 pc532 pdp11 PGC PIC plexus PORTAR posix
20939 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
20940 POSIX_C_SOURCE POSIX_SOURCE POWER
20941 PROTOTYPES PWB pyr QNX QK_USER R3000 REENTRANT RES Rhapsody RISC6000
20942 riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
20943 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
20944 sony sony_news sonyrisc sparc sparclite spectrum
20945 stardent stdc STDC_EXT stratos sun sun3 sun386
20946 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
20947 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
20948 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
20949 sysV68 sysV88 Tek4132 Tek4300 titan
20950 TM3200 TM5400 TM5600
20951 tower tower32 tower32_200 tower32_600 tower32_700
20952 tower32_800 tower32_850 tss
20953 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
20954 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
20955 unix UNIX95 UNIX99 unixpc unos
20956 USE_BSD USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE USE_LARGEFILE64
20957 USE_MISC USE_POSIX USE_POSIX199309 USE_POSIX199506 USE_POSIX2
20958 USE_REENTRANT USE_SVID USE_UNIX98 USE_XOPEN USE_XOPEN_EXTENDED
20960 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms x86_64 xenix Xenix286
20961 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
20962 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
20965 # Maybe put other stuff here too.
20966 cat <<EOSH >>Cppsym.know
20969 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
20970 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
20971 $cat Cppsym.know > Cppsym.c
20972 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
20973 $rm -f Cppsym.a Cppsym.b Cppsym.c
20974 cat <<EOSH > Cppsym
20976 if $test \$# -gt 0; then
20977 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
20978 if $test -s Cppsym.got; then
20985 $tr " " "$trnl" | ./Cppsym.try
20991 cat <<EOSH > Cppsym.try
20993 cat <<'EOCP' > try.c
20996 #define STRINGIFY(a) "a"
20998 #if cpp_stuff == 42
20999 #define StGiFy(a) #a
21000 #define STRINGIFY(a) StGiFy(a)
21002 #if $cpp_stuff != 1 && $cpp_stuff != 42
21003 # include "Bletch: How does this C preprocessor stringify macros?"
21009 cat <<'EOSH' >> Cppsym.try
21011 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
21012 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
21013 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
21014 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
21016 echo 'return 0;}' >> try.c
21018 cat <<EOSH >> Cppsym.try
21020 case "$osname-$gccversion" in
21021 irix-) ccflags="\$ccflags -woff 1178" ;;
21022 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
21024 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs && $run ./try | $sed 's/ /\\\\ /g'
21026 chmod +x Cppsym.try
21027 $eunicefix Cppsym.try
21028 ./Cppsym < Cppsym.know > Cppsym.true
21029 : Add in any linux cpp "predefined macros":
21030 case "$osname::$gccversion" in
21033 rm -f $tHdrH'.h' $tHdrH
21035 if cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
21036 sed 's/#define[\ \ ]*//;s/[\ \ ].*$//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
21037 if [ -s $tHdrH'_cppsym.real' ]; then
21038 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
21041 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
21044 : now check the C compiler for additional symbols
21045 postprocess_cc_v=''
21047 aix) postprocess_cc_v="|$tr , ' '" ;;
21054 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
21057 -D*) echo "\$i" | $sed 's/^-D//';;
21058 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
21063 postprocess_cc_v=''
21066 ./ccsym > ccsym1.raw
21067 if $test -s ccsym1.raw; then
21068 $sort ccsym1.raw | $uniq >ccsym.raw
21070 mv ccsym1.raw ccsym.raw
21073 $awk '/\=/ { print $0; next }
21074 { print $0"=1" }' ccsym.raw >ccsym.list
21075 $comm -13 Cppsym.true ccsym.list >ccsym.own
21076 $comm -12 Cppsym.true ccsym.list >ccsym.com
21077 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
21079 if $test -z ccsym.raw; then
21080 echo "Your C compiler doesn't seem to define any symbols!" >&4
21082 echo "However, your C preprocessor defines the following symbols:"
21085 cppsymbols=`$cat Cppsym.true`
21086 cppsymbols=`echo $cppsymbols`
21087 cppccsymbols="$cppsymbols"
21089 if $test -s ccsym.com; then
21090 echo "Your C compiler and pre-processor define these symbols:"
21091 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
21094 cppccsymbols=`$cat ccsym.com`
21095 cppccsymbols=`echo $cppccsymbols`
21096 $test "$silent" || sleep 1
21098 if $test -s ccsym.cpp; then
21099 $test "$also" && echo " "
21100 echo "Your C pre-processor ${also}defines the following symbols:"
21101 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
21103 cppsymbols=`$cat ccsym.cpp`
21104 cppsymbols=`echo $cppsymbols`
21105 $test "$silent" || sleep 1
21107 if $test -s ccsym.own; then
21108 $test "$also" && echo " "
21109 echo "Your C compiler ${also}defines the following cpp symbols:"
21110 $sed -e 's/\(..*\)=1/\1/' ccsym.own
21111 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
21112 ccsymbols=`$cat ccsym.own`
21113 ccsymbols=`echo $ccsymbols`
21114 $test "$silent" || sleep 1
21118 : see if this is a termio system
21122 if $test `./findhdr termios.h`; then
21123 set tcsetattr i_termios
21129 "$define") echo "You have POSIX termios.h... good!" >&4;;
21130 *) if ./Cppsym pyr; then
21131 case "`/bin/universe`" in
21132 ucb) if $test `./findhdr sgtty.h`; then
21134 echo "<sgtty.h> found." >&4
21136 echo "System is pyramid with BSD universe."
21137 ./warn "<sgtty.h> not found--you could have problems."
21139 *) if $test `./findhdr termio.h`; then
21141 echo "<termio.h> found." >&4
21143 echo "System is pyramid with USG universe."
21144 ./warn "<termio.h> not found--you could have problems."
21148 if $test `./findhdr termio.h`; then
21149 echo "<termio.h> found." >&4
21151 elif $test `./findhdr sgtty.h`; then
21152 echo "<sgtty.h> found." >&4
21155 ./warn "Neither <termio.h> nor <sgtty.h> found--cross fingers!"
21158 if $test `./findhdr sgtty.h`; then
21159 echo "<sgtty.h> found." >&4
21161 elif $test `./findhdr termio.h`; then
21162 echo "<termio.h> found." >&4
21165 ./warn "Neither <sgtty.h> nor <termio.h> found--cross fingers!"
21169 set i_termio; eval $setvar
21170 val=$val2; set i_sgtty; eval $setvar
21171 val=$val3; set i_termios; eval $setvar
21173 : see if stddef is available
21174 set stddef.h i_stddef
21177 : see if sys/access.h is available
21178 set sys/access.h i_sysaccess
21181 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
21182 set sys/filio.h i_sysfilio
21185 if $test `./findhdr sys/ioctl.h`; then
21187 echo '<sys/ioctl.h> found.' >&4
21190 if $test $i_sysfilio = "$define"; then
21191 echo '<sys/ioctl.h> NOT found.' >&4
21193 $test $i_sgtty = "$define" && xxx="sgtty.h"
21194 $test $i_termio = "$define" && xxx="termio.h"
21195 $test $i_termios = "$define" && xxx="termios.h"
21196 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
21202 : see if socket ioctl defs are in sys/sockio.h
21204 xxx=`./findhdr sys/sockio.h`
21205 if $test "$xxx"; then
21206 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
21208 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
21211 echo "No socket ioctls found in <sys/sockio.h>." >&4
21216 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
21222 : see if this is a syslog.h system
21223 set syslog.h i_syslog
21226 : see if this is a sys/mode.h system
21227 set sys/mode.h i_sysmode
21230 : see if there is a sys/poll.h file
21231 set sys/poll.h i_syspoll
21234 : see if sys/resource.h has to be included
21235 set sys/resource.h i_sysresrc
21238 : see if sys/security.h is available
21239 set sys/security.h i_syssecrt
21242 : see if this is a sys/statvfs.h system
21243 set sys/statvfs.h i_sysstatvfs
21246 : see if this is a sys/un.h system
21247 set sys/un.h i_sysun
21250 : see if this is a sys/utsname.h system
21251 set sys/utsname.h i_sysutsname
21254 : see if this is a syswait system
21255 set sys/wait.h i_syswait
21258 : see if this is a ustat.h system
21259 set ustat.h i_ustat
21262 : see if this is an utime system
21263 set utime.h i_utime
21266 : see if this is a values.h system
21267 set values.h i_values
21270 : see if this is a vfork system
21273 set vfork.h i_vfork
21283 echo "Looking for extensions..." >&4
21284 : If we are using the old config.sh, known_extensions may contain
21285 : old or inaccurate or duplicate values.
21286 known_extensions=''
21287 nonxs_extensions=''
21288 : We do not use find because it might not be available.
21289 : We do not just use MANIFEST because the user may have dropped
21290 : some additional extensions into the source tree and expect them
21293 : Function to recursively find available extensions, ignoring DynaLoader
21294 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
21298 DynaLoader|dynaload) ;;
21300 if $test -f $xxx/$xxx.xs -o -f $xxx/$xxx.c; then
21301 known_extensions="$known_extensions $1$xxx";
21302 elif $test -f $xxx/Makefile.PL; then
21303 nonxs_extensions="$nonxs_extensions $1$xxx";
21305 if $test -d $xxx -a $# -lt 10; then
21308 eval $find_extensions;
21320 eval $find_extensions
21321 # Special case: Add in modules that nest beyond the first level.
21322 # Currently threads/shared and Hash/Util/FieldHash, since they are
21323 # not picked up by the recursive find above (and adding in general
21324 # recursive finding breaks SDBM_File/sdbm).
21325 # A.D. 20011025 (SDBM), ajgough 20071008 (FieldHash)
21326 known_extensions="$known_extensions threads/shared Hash/Util/FieldHash"
21327 set X $known_extensions
21329 known_extensions="$*"
21330 set X $nonxs_extensions
21332 nonxs_extensions="$*"
21335 : Now see which are supported on this system.
21337 for xxx in $known_extensions ; do
21341 $define) avail_ext="$avail_ext $xxx" ;;
21344 GDBM_File|gdbm_fil)
21346 $define) avail_ext="$avail_ext $xxx" ;;
21349 I18N/Langinfo|i18n_lan)
21350 case "$i_langinfo$d_nl_langinfo" in
21351 $define$define) avail_ext="$avail_ext $xxx" ;;
21355 : XXX Do we need a useipcsysv variable here
21356 case "${d_msg}${d_sem}${d_shm}" in
21357 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
21360 NDBM_File|ndbm_fil)
21363 case "$osname-$use64bitint" in
21366 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
21369 *) avail_ext="$avail_ext $xxx" ;;
21374 ODBM_File|odbm_fil)
21375 case "${i_dbm}${i_rpcsvcdbm}" in
21377 case "$d_cplusplus" in
21378 define) ;; # delete as a function name will not work
21379 *) case "$osname-$use64bitint" in
21382 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
21385 *) avail_ext="$avail_ext $xxx" ;;
21393 case "$useopcode" in
21394 true|define|y) avail_ext="$avail_ext $xxx" ;;
21398 case "$useposix" in
21399 true|define|y) avail_ext="$avail_ext $xxx" ;;
21403 case "$d_socket" in
21406 beos) ;; # not unless BONE
21407 *) avail_ext="$avail_ext $xxx" ;;
21412 Sys/Syslog|sys/syslog)
21413 : XXX syslog requires socket
21414 case "$d_socket" in
21415 true|$define|y) avail_ext="$avail_ext $xxx" ;;
21419 case "$usethreads" in
21421 case "$use5005threads" in
21422 $define|true|[yY]*) avail_ext="$avail_ext $xxx" ;;
21426 threads|threads/shared)
21427 # threads and threads::shared are special cases.
21428 # To stop people from asking "Perl 5.8.0 was supposed
21429 # to have this new fancy threads implementation but my
21430 # perl doesn't have it" and from people trying to
21431 # (re)install the threads module using CPAN.pm and
21432 # CPAN.pm then offering to reinstall Perl 5.8.0,
21433 # the threads.pm and threads/shared.pm will always be
21434 # there, croaking informatively ("you need to rebuild
21435 # all of Perl with threads, sorry") when threads haven't
21436 # been compiled in.
21438 avail_ext="$avail_ext $xxx"
21442 cygwin) avail_ext="$avail_ext $xxx" ;;
21445 XS/APItest|xs/apitest)
21446 # This is just for testing. Skip it unless we have dynamic loading.
21449 $define) avail_ext="$avail_ext $xxx" ;;
21452 XS/Typemap|xs/typemap)
21453 # This is just for testing. Skip it unless we have dynamic loading.
21455 $define) avail_ext="$avail_ext $xxx" ;;
21458 *) avail_ext="$avail_ext $xxx"
21467 case "$onlyextensions" in
21469 *) keepextensions=''
21470 echo "You have requested that only certains extensions be included..." >&4
21471 for i in $onlyextensions; do
21472 case " $avail_ext " in
21474 echo "Keeping extension $i."
21475 keepextensions="$keepextensions $i"
21477 *) echo "Ignoring extension $i." ;;
21480 avail_ext="$keepextensions"
21484 case "$noextensions" in
21486 *) keepextensions=''
21487 echo "You have requested that certain extensions be ignored..." >&4
21488 for i in $avail_ext; do
21489 case " $noextensions " in
21490 *" $i "*) echo "Ignoring extension $i." ;;
21491 *) echo "Keeping extension $i.";
21492 keepextensions="$keepextensions $i"
21496 avail_ext="$keepextensions"
21500 : Now see which nonxs extensions are supported on this system.
21501 : For now assume all are.
21503 for xxx in $nonxs_extensions ; do
21505 *) nonxs_ext="$nonxs_ext $xxx"
21517 A number of extensions are supplied with $package. You may choose to
21518 compile these extensions for dynamic loading (the default), compile
21519 them into the $package executable (static loading), or not include
21520 them at all. Answer "none" to include no extensions.
21521 Note that DynaLoader is always built and need not be mentioned here.
21524 case "$dynamic_ext" in
21526 : Exclude those listed in static_ext
21528 for xxx in $avail_ext; do
21529 case " $static_ext " in
21531 *) dflt="$dflt $xxx" ;;
21538 *) dflt="$dynamic_ext"
21539 # Perhaps we are reusing an old out-of-date config.sh.
21542 if test X"$dynamic_ext" != X"$avail_ext"; then
21544 NOTICE: Your previous config.sh list may be incorrect.
21545 The extensions now available to you are
21547 but the default list from your previous config.sh is
21559 rp="What extensions do you wish to load dynamically?"
21562 none) dynamic_ext=' ' ;;
21563 *) dynamic_ext="$ans" ;;
21566 case "$static_ext" in
21568 : Exclude those already listed in dynamic linking
21570 for xxx in $avail_ext; do
21571 case " $dynamic_ext " in
21573 *) dflt="$dflt $xxx" ;;
21580 *) dflt="$static_ext"
21587 rp="What extensions do you wish to load statically?"
21590 none) static_ext=' ' ;;
21591 *) static_ext="$ans" ;;
21596 A number of extensions are supplied with $package. Answer "none"
21597 to include no extensions.
21598 Note that DynaLoader is always built and need not be mentioned here.
21601 case "$static_ext" in
21602 '') dflt="$avail_ext" ;;
21603 *) dflt="$static_ext"
21604 # Perhaps we are reusing an old out-of-date config.sh.
21607 if test X"$static_ext" != X"$avail_ext"; then
21609 NOTICE: Your previous config.sh list may be incorrect.
21610 The extensions now available to you are
21612 but the default list from your previous config.sh is
21621 : Exclude those that are not xs extensions
21625 rp="What extensions do you wish to include?"
21628 none) static_ext=' ' ;;
21629 *) static_ext="$ans" ;;
21634 # Encode is a special case. If we are building Encode as a static
21635 # extension, we need to explicitly list its subextensions as well.
21636 # For other nested extensions, this is handled automatically by
21637 # the appropriate Makefile.PL.
21638 case " $static_ext " in
21639 *" Encode "*) # Add the subextensions of Encode
21641 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
21642 static_ext="$static_ext Encode/$xxx"
21648 set X $dynamic_ext $static_ext $nonxs_ext
21652 # Sanity check: We require an extension suitable for use with
21653 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
21654 # should show up as failures in the test suite, but it's helpful to
21655 # catch them now.) The 'extensions' list is normally sorted
21656 # alphabetically, so we need to accept either
21657 # DB_File ... Fcntl ... IO ....
21658 # or something like
21659 # Fcntl ... NDBM_File ... IO ....
21660 case " $extensions" in
21661 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
21662 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
21663 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
21664 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
21665 echo "WARNING: The Perl you are building will be quite crippled." >& 4
21669 : Remove libraries needed only for extensions
21670 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
21671 : The exception is SunOS 4.x, which needs them.
21672 case "${osname}X${osvers}" in
21676 *) case "$usedl" in
21677 $define|true|[yY]*)
21678 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -lgdbm_compat @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
21682 *) perllibs="$libs"
21688 : Remove build directory name from cppstdin so it can be used from
21689 : either the present location or the final installed location.
21691 : Get out of the UU directory to get correct path name.
21693 case "$cppstdin" in
21695 echo "Stripping down cppstdin path name"
21701 : end of configuration questions
21703 echo "End of configuration questions."
21706 : back to where it started
21707 if test -d ../UU; then
21711 : configuration may be unconditionally patched via a 'config.arch' file
21712 if $test -f config.arch; then
21713 echo "I see a config.arch file, loading it." >&4
21717 : configuration may be patched via a 'config.over' file
21718 if $test -f config.over; then
21721 rp='I see a config.over file. Do you wish to load it?'
21724 n*) echo "OK, I'll ignore it.";;
21726 echo "Configuration override changes have been loaded."
21731 : in case they want portability, strip down executable paths
21732 case "$d_portable" in
21735 echo "Stripping down executable paths..." >&4
21736 for file in $loclist $trylist; do
21738 eval $file=`basename $temp`
21743 : create config.sh file
21745 echo "Creating config.sh..." >&4
21746 $spitshell <<EOT >config.sh
21749 # This file was produced by running the Configure script. It holds all the
21750 # definitions figured out by Configure. Should you modify one of these values,
21751 # do not forget to propagate your changes by running "Configure -der". You may
21752 # instead choose to run each of the .SH files by yourself, or "Configure -S".
21755 # Package name : $package
21756 # Source directory : $src
21757 # Configuration time: $cf_time
21758 # Configured by : $cf_by
21759 # Target system : $myuname
21762 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
21763 $spitshell <<EOT >>config.sh
21772 Revision='$Revision'
21780 alignbytes='$alignbytes'
21781 ansi2knr='$ansi2knr'
21782 aphostname='$aphostname'
21783 api_revision='$api_revision'
21784 api_subversion='$api_subversion'
21785 api_version='$api_version'
21786 api_versionstring='$api_versionstring'
21789 archlibexp='$archlibexp'
21790 archname64='$archname64'
21791 archname='$archname'
21792 archobjs='$archobjs'
21793 asctime_r_proto='$asctime_r_proto'
21801 byteorder='$byteorder'
21803 castflags='$castflags'
21806 cccdlflags='$cccdlflags'
21807 ccdlflags='$ccdlflags'
21809 ccflags_uselargefiles='$ccflags_uselargefiles'
21811 ccsymbols='$ccsymbols'
21812 ccversion='$ccversion'
21814 cf_email='$cf_email'
21819 clocktype='$clocktype'
21821 compress='$compress'
21822 contains='$contains'
21826 cpp_stuff='$cpp_stuff'
21827 cppccsymbols='$cppccsymbols'
21828 cppflags='$cppflags'
21830 cppminus='$cppminus'
21832 cppstdin='$cppstdin'
21833 cppsymbols='$cppsymbols'
21834 crypt_r_proto='$crypt_r_proto'
21835 cryptlib='$cryptlib'
21837 ctermid_r_proto='$ctermid_r_proto'
21838 ctime_r_proto='$ctime_r_proto'
21839 d_Gconvert='$d_Gconvert'
21840 d_PRIEUldbl='$d_PRIEUldbl'
21841 d_PRIFUldbl='$d_PRIFUldbl'
21842 d_PRIGUldbl='$d_PRIGUldbl'
21843 d_PRIXU64='$d_PRIXU64'
21844 d_PRId64='$d_PRId64'
21845 d_PRIeldbl='$d_PRIeldbl'
21846 d_PRIfldbl='$d_PRIfldbl'
21847 d_PRIgldbl='$d_PRIgldbl'
21848 d_PRIi64='$d_PRIi64'
21849 d_PRIo64='$d_PRIo64'
21850 d_PRIu64='$d_PRIu64'
21851 d_PRIx64='$d_PRIx64'
21852 d_SCNfldbl='$d_SCNfldbl'
21853 d__fwalk='$d__fwalk'
21854 d_access='$d_access'
21855 d_accessx='$d_accessx'
21858 d_archlib='$d_archlib'
21859 d_asctime_r='$d_asctime_r'
21862 d_attribute_format='$d_attribute_format'
21863 d_attribute_malloc='$d_attribute_malloc'
21864 d_attribute_nonnull='$d_attribute_nonnull'
21865 d_attribute_noreturn='$d_attribute_noreturn'
21866 d_attribute_pure='$d_attribute_pure'
21867 d_attribute_unused='$d_attribute_unused'
21868 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
21872 d_bsdgetpgrp='$d_bsdgetpgrp'
21873 d_bsdsetpgrp='$d_bsdsetpgrp'
21874 d_builtin_choose_expr='$d_builtin_choose_expr'
21875 d_builtin_expect='$d_builtin_expect'
21877 d_c99_variadic_macros='$d_c99_variadic_macros'
21878 d_casti32='$d_casti32'
21879 d_castneg='$d_castneg'
21880 d_charvspr='$d_charvspr'
21882 d_chroot='$d_chroot'
21883 d_chsize='$d_chsize'
21885 d_clearenv='$d_clearenv'
21886 d_closedir='$d_closedir'
21887 d_cmsghdr_s='$d_cmsghdr_s'
21889 d_copysignl='$d_copysignl'
21890 d_cplusplus='$d_cplusplus'
21892 d_crypt_r='$d_crypt_r'
21894 d_ctermid='$d_ctermid'
21895 d_ctermid_r='$d_ctermid_r'
21896 d_ctime_r='$d_ctime_r'
21897 d_cuserid='$d_cuserid'
21898 d_dbl_dig='$d_dbl_dig'
21899 d_dbminitproto='$d_dbminitproto'
21900 d_difftime='$d_difftime'
21901 d_dir_dd_fd='$d_dir_dd_fd'
21903 d_dirnamlen='$d_dirnamlen'
21904 d_dlerror='$d_dlerror'
21905 d_dlopen='$d_dlopen'
21906 d_dlsymun='$d_dlsymun'
21907 d_dosuid='$d_dosuid'
21908 d_drand48_r='$d_drand48_r'
21909 d_drand48proto='$d_drand48proto'
21911 d_eaccess='$d_eaccess'
21912 d_endgrent='$d_endgrent'
21913 d_endgrent_r='$d_endgrent_r'
21914 d_endhent='$d_endhent'
21915 d_endhostent_r='$d_endhostent_r'
21916 d_endnent='$d_endnent'
21917 d_endnetent_r='$d_endnetent_r'
21918 d_endpent='$d_endpent'
21919 d_endprotoent_r='$d_endprotoent_r'
21920 d_endpwent='$d_endpwent'
21921 d_endpwent_r='$d_endpwent_r'
21922 d_endsent='$d_endsent'
21923 d_endservent_r='$d_endservent_r'
21924 d_eofnblk='$d_eofnblk'
21925 d_eunice='$d_eunice'
21926 d_faststdio='$d_faststdio'
21927 d_fchdir='$d_fchdir'
21928 d_fchmod='$d_fchmod'
21929 d_fchown='$d_fchown'
21931 d_fcntl_can_lock='$d_fcntl_can_lock'
21932 d_fd_macros='$d_fd_macros'
21933 d_fd_set='$d_fd_set'
21934 d_fds_bits='$d_fds_bits'
21935 d_fgetpos='$d_fgetpos'
21936 d_finite='$d_finite'
21937 d_finitel='$d_finitel'
21938 d_flexfnam='$d_flexfnam'
21940 d_flockproto='$d_flockproto'
21942 d_fp_class='$d_fp_class'
21943 d_fpathconf='$d_fpathconf'
21944 d_fpclass='$d_fpclass'
21945 d_fpclassify='$d_fpclassify'
21946 d_fpclassl='$d_fpclassl'
21947 d_fpos64_t='$d_fpos64_t'
21948 d_frexpl='$d_frexpl'
21949 d_fs_data_s='$d_fs_data_s'
21950 d_fseeko='$d_fseeko'
21951 d_fsetpos='$d_fsetpos'
21952 d_fstatfs='$d_fstatfs'
21953 d_fstatvfs='$d_fstatvfs'
21955 d_ftello='$d_ftello'
21957 d_futimes='$d_futimes'
21958 d_getcwd='$d_getcwd'
21959 d_getespwnam='$d_getespwnam'
21960 d_getfsstat='$d_getfsstat'
21961 d_getgrent='$d_getgrent'
21962 d_getgrent_r='$d_getgrent_r'
21963 d_getgrgid_r='$d_getgrgid_r'
21964 d_getgrnam_r='$d_getgrnam_r'
21965 d_getgrps='$d_getgrps'
21966 d_gethbyaddr='$d_gethbyaddr'
21967 d_gethbyname='$d_gethbyname'
21968 d_gethent='$d_gethent'
21969 d_gethname='$d_gethname'
21970 d_gethostbyaddr_r='$d_gethostbyaddr_r'
21971 d_gethostbyname_r='$d_gethostbyname_r'
21972 d_gethostent_r='$d_gethostent_r'
21973 d_gethostprotos='$d_gethostprotos'
21974 d_getitimer='$d_getitimer'
21975 d_getlogin='$d_getlogin'
21976 d_getlogin_r='$d_getlogin_r'
21977 d_getmnt='$d_getmnt'
21978 d_getmntent='$d_getmntent'
21979 d_getnbyaddr='$d_getnbyaddr'
21980 d_getnbyname='$d_getnbyname'
21981 d_getnent='$d_getnent'
21982 d_getnetbyaddr_r='$d_getnetbyaddr_r'
21983 d_getnetbyname_r='$d_getnetbyname_r'
21984 d_getnetent_r='$d_getnetent_r'
21985 d_getnetprotos='$d_getnetprotos'
21986 d_getpagsz='$d_getpagsz'
21987 d_getpbyname='$d_getpbyname'
21988 d_getpbynumber='$d_getpbynumber'
21989 d_getpent='$d_getpent'
21990 d_getpgid='$d_getpgid'
21991 d_getpgrp2='$d_getpgrp2'
21992 d_getpgrp='$d_getpgrp'
21993 d_getppid='$d_getppid'
21994 d_getprior='$d_getprior'
21995 d_getprotobyname_r='$d_getprotobyname_r'
21996 d_getprotobynumber_r='$d_getprotobynumber_r'
21997 d_getprotoent_r='$d_getprotoent_r'
21998 d_getprotoprotos='$d_getprotoprotos'
21999 d_getprpwnam='$d_getprpwnam'
22000 d_getpwent='$d_getpwent'
22001 d_getpwent_r='$d_getpwent_r'
22002 d_getpwnam_r='$d_getpwnam_r'
22003 d_getpwuid_r='$d_getpwuid_r'
22004 d_getsbyname='$d_getsbyname'
22005 d_getsbyport='$d_getsbyport'
22006 d_getsent='$d_getsent'
22007 d_getservbyname_r='$d_getservbyname_r'
22008 d_getservbyport_r='$d_getservbyport_r'
22009 d_getservent_r='$d_getservent_r'
22010 d_getservprotos='$d_getservprotos'
22011 d_getspnam='$d_getspnam'
22012 d_getspnam_r='$d_getspnam_r'
22013 d_gettimeod='$d_gettimeod'
22014 d_gmtime_r='$d_gmtime_r'
22015 d_gnulibc='$d_gnulibc'
22016 d_grpasswd='$d_grpasswd'
22017 d_hasmntopt='$d_hasmntopt'
22019 d_ilogbl='$d_ilogbl'
22020 d_inc_version_list='$d_inc_version_list'
22022 d_inetaton='$d_inetaton'
22023 d_int64_t='$d_int64_t'
22024 d_isascii='$d_isascii'
22025 d_isfinite='$d_isfinite'
22028 d_isnanl='$d_isnanl'
22029 d_killpg='$d_killpg'
22030 d_lchown='$d_lchown'
22031 d_ldbl_dig='$d_ldbl_dig'
22032 d_libm_lib_version='$d_libm_lib_version'
22034 d_localtime_r='$d_localtime_r'
22035 d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset'
22036 d_locconv='$d_locconv'
22038 d_longdbl='$d_longdbl'
22039 d_longlong='$d_longlong'
22040 d_lseekproto='$d_lseekproto'
22042 d_madvise='$d_madvise'
22043 d_malloc_good_size='$d_malloc_good_size'
22044 d_malloc_size='$d_malloc_size'
22046 d_mbstowcs='$d_mbstowcs'
22047 d_mbtowc='$d_mbtowc'
22048 d_memchr='$d_memchr'
22049 d_memcmp='$d_memcmp'
22050 d_memcpy='$d_memcpy'
22051 d_memmove='$d_memmove'
22052 d_memset='$d_memset'
22054 d_mkdtemp='$d_mkdtemp'
22055 d_mkfifo='$d_mkfifo'
22056 d_mkstemp='$d_mkstemp'
22057 d_mkstemps='$d_mkstemps'
22058 d_mktime='$d_mktime'
22061 d_modfl_pow32_bug='$d_modfl_pow32_bug'
22062 d_modflproto='$d_modflproto'
22063 d_mprotect='$d_mprotect'
22065 d_msg_ctrunc='$d_msg_ctrunc'
22066 d_msg_dontroute='$d_msg_dontroute'
22067 d_msg_oob='$d_msg_oob'
22068 d_msg_peek='$d_msg_peek'
22069 d_msg_proxy='$d_msg_proxy'
22070 d_msgctl='$d_msgctl'
22071 d_msgget='$d_msgget'
22072 d_msghdr_s='$d_msghdr_s'
22073 d_msgrcv='$d_msgrcv'
22074 d_msgsnd='$d_msgsnd'
22076 d_munmap='$d_munmap'
22077 d_mymalloc='$d_mymalloc'
22080 d_nl_langinfo='$d_nl_langinfo'
22081 d_nv_preserves_uv='$d_nv_preserves_uv'
22082 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
22083 d_off64_t='$d_off64_t'
22084 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
22085 d_oldpthreads='$d_oldpthreads'
22086 d_oldsock='$d_oldsock'
22088 d_pathconf='$d_pathconf'
22090 d_perl_otherlibdirs='$d_perl_otherlibdirs'
22091 d_phostname='$d_phostname'
22094 d_portable='$d_portable'
22095 d_printf_format_null='$d_printf_format_null'
22096 d_procselfexe='$d_procselfexe'
22097 d_pseudofork='$d_pseudofork'
22098 d_pthread_atfork='$d_pthread_atfork'
22099 d_pthread_attr_setscope='$d_pthread_attr_setscope'
22100 d_pthread_yield='$d_pthread_yield'
22102 d_pwchange='$d_pwchange'
22103 d_pwclass='$d_pwclass'
22104 d_pwcomment='$d_pwcomment'
22105 d_pwexpire='$d_pwexpire'
22106 d_pwgecos='$d_pwgecos'
22107 d_pwpasswd='$d_pwpasswd'
22108 d_pwquota='$d_pwquota'
22111 d_random_r='$d_random_r'
22112 d_readdir64_r='$d_readdir64_r'
22113 d_readdir='$d_readdir'
22114 d_readdir_r='$d_readdir_r'
22115 d_readlink='$d_readlink'
22117 d_recvmsg='$d_recvmsg'
22118 d_rename='$d_rename'
22119 d_rewinddir='$d_rewinddir'
22121 d_safebcpy='$d_safebcpy'
22122 d_safemcpy='$d_safemcpy'
22123 d_sanemcmp='$d_sanemcmp'
22124 d_sbrkproto='$d_sbrkproto'
22125 d_scalbnl='$d_scalbnl'
22126 d_sched_yield='$d_sched_yield'
22127 d_scm_rights='$d_scm_rights'
22128 d_seekdir='$d_seekdir'
22129 d_select='$d_select'
22131 d_semctl='$d_semctl'
22132 d_semctl_semid_ds='$d_semctl_semid_ds'
22133 d_semctl_semun='$d_semctl_semun'
22134 d_semget='$d_semget'
22136 d_sendmsg='$d_sendmsg'
22137 d_setegid='$d_setegid'
22138 d_seteuid='$d_seteuid'
22139 d_setgrent='$d_setgrent'
22140 d_setgrent_r='$d_setgrent_r'
22141 d_setgrps='$d_setgrps'
22142 d_sethent='$d_sethent'
22143 d_sethostent_r='$d_sethostent_r'
22144 d_setitimer='$d_setitimer'
22145 d_setlinebuf='$d_setlinebuf'
22146 d_setlocale='$d_setlocale'
22147 d_setlocale_r='$d_setlocale_r'
22148 d_setnent='$d_setnent'
22149 d_setnetent_r='$d_setnetent_r'
22150 d_setpent='$d_setpent'
22151 d_setpgid='$d_setpgid'
22152 d_setpgrp2='$d_setpgrp2'
22153 d_setpgrp='$d_setpgrp'
22154 d_setprior='$d_setprior'
22155 d_setproctitle='$d_setproctitle'
22156 d_setprotoent_r='$d_setprotoent_r'
22157 d_setpwent='$d_setpwent'
22158 d_setpwent_r='$d_setpwent_r'
22159 d_setregid='$d_setregid'
22160 d_setresgid='$d_setresgid'
22161 d_setresuid='$d_setresuid'
22162 d_setreuid='$d_setreuid'
22163 d_setrgid='$d_setrgid'
22164 d_setruid='$d_setruid'
22165 d_setsent='$d_setsent'
22166 d_setservent_r='$d_setservent_r'
22167 d_setsid='$d_setsid'
22168 d_setvbuf='$d_setvbuf'
22172 d_shmatprototype='$d_shmatprototype'
22173 d_shmctl='$d_shmctl'
22175 d_shmget='$d_shmget'
22176 d_sigaction='$d_sigaction'
22177 d_signbit='$d_signbit'
22178 d_sigprocmask='$d_sigprocmask'
22179 d_sigsetjmp='$d_sigsetjmp'
22180 d_sitearch='$d_sitearch'
22181 d_snprintf='$d_snprintf'
22182 d_sockatmark='$d_sockatmark'
22183 d_sockatmarkproto='$d_sockatmarkproto'
22184 d_socket='$d_socket'
22185 d_socklen_t='$d_socklen_t'
22186 d_sockpair='$d_sockpair'
22187 d_socks5_init='$d_socks5_init'
22188 d_sprintf_returns_strlen='$d_sprintf_returns_strlen'
22190 d_srand48_r='$d_srand48_r'
22191 d_srandom_r='$d_srandom_r'
22192 d_sresgproto='$d_sresgproto'
22193 d_sresuproto='$d_sresuproto'
22194 d_statblks='$d_statblks'
22195 d_statfs_f_flags='$d_statfs_f_flags'
22196 d_statfs_s='$d_statfs_s'
22197 d_statvfs='$d_statvfs'
22198 d_stdio_cnt_lval='$d_stdio_cnt_lval'
22199 d_stdio_ptr_lval='$d_stdio_ptr_lval'
22200 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
22201 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
22202 d_stdio_stream_array='$d_stdio_stream_array'
22203 d_stdiobase='$d_stdiobase'
22204 d_stdstdio='$d_stdstdio'
22205 d_strchr='$d_strchr'
22206 d_strcoll='$d_strcoll'
22207 d_strctcpy='$d_strctcpy'
22208 d_strerrm='$d_strerrm'
22209 d_strerror='$d_strerror'
22210 d_strerror_r='$d_strerror_r'
22211 d_strftime='$d_strftime'
22212 d_strlcat='$d_strlcat'
22213 d_strlcpy='$d_strlcpy'
22214 d_strtod='$d_strtod'
22215 d_strtol='$d_strtol'
22216 d_strtold='$d_strtold'
22217 d_strtoll='$d_strtoll'
22218 d_strtoq='$d_strtoq'
22219 d_strtoul='$d_strtoul'
22220 d_strtoull='$d_strtoull'
22221 d_strtouq='$d_strtouq'
22222 d_strxfrm='$d_strxfrm'
22223 d_suidsafe='$d_suidsafe'
22224 d_symlink='$d_symlink'
22225 d_syscall='$d_syscall'
22226 d_syscallproto='$d_syscallproto'
22227 d_sysconf='$d_sysconf'
22228 d_sysernlst='$d_sysernlst'
22229 d_syserrlst='$d_syserrlst'
22230 d_system='$d_system'
22231 d_tcgetpgrp='$d_tcgetpgrp'
22232 d_tcsetpgrp='$d_tcsetpgrp'
22233 d_telldir='$d_telldir'
22234 d_telldirproto='$d_telldirproto'
22237 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
22238 d_tm_tm_zone='$d_tm_tm_zone'
22239 d_tmpnam_r='$d_tmpnam_r'
22240 d_truncate='$d_truncate'
22241 d_ttyname_r='$d_ttyname_r'
22242 d_tzname='$d_tzname'
22243 d_u32align='$d_u32align'
22244 d_ualarm='$d_ualarm'
22247 d_union_semun='$d_union_semun'
22248 d_unordered='$d_unordered'
22249 d_unsetenv='$d_unsetenv'
22250 d_usleep='$d_usleep'
22251 d_usleepproto='$d_usleepproto'
22253 d_vendorarch='$d_vendorarch'
22254 d_vendorbin='$d_vendorbin'
22255 d_vendorlib='$d_vendorlib'
22256 d_vendorscript='$d_vendorscript'
22258 d_void_closedir='$d_void_closedir'
22259 d_voidsig='$d_voidsig'
22260 d_voidtty='$d_voidtty'
22261 d_volatile='$d_volatile'
22262 d_vprintf='$d_vprintf'
22263 d_vsnprintf='$d_vsnprintf'
22265 d_waitpid='$d_waitpid'
22266 d_wcstombs='$d_wcstombs'
22267 d_wctomb='$d_wctomb'
22268 d_writev='$d_writev'
22271 db_hashtype='$db_hashtype'
22272 db_prefixtype='$db_prefixtype'
22273 db_version_major='$db_version_major'
22274 db_version_minor='$db_version_minor'
22275 db_version_patch='$db_version_patch'
22276 defvoidused='$defvoidused'
22277 direntrytype='$direntrytype'
22280 doublesize='$doublesize'
22282 drand48_r_proto='$drand48_r_proto'
22284 dynamic_ext='$dynamic_ext'
22290 endgrent_r_proto='$endgrent_r_proto'
22291 endhostent_r_proto='$endhostent_r_proto'
22292 endnetent_r_proto='$endnetent_r_proto'
22293 endprotoent_r_proto='$endprotoent_r_proto'
22294 endpwent_r_proto='$endpwent_r_proto'
22295 endservent_r_proto='$endservent_r_proto'
22296 eunicefix='$eunicefix'
22299 extensions='$extensions'
22301 fflushNULL='$fflushNULL'
22302 fflushall='$fflushall'
22304 firstmakefile='$firstmakefile'
22306 fpossize='$fpossize'
22307 fpostype='$fpostype'
22308 freetype='$freetype'
22311 full_csh='$full_csh'
22312 full_sed='$full_sed'
22313 gccansipedantic='$gccansipedantic'
22314 gccosandvers='$gccosandvers'
22315 gccversion='$gccversion'
22316 getgrent_r_proto='$getgrent_r_proto'
22317 getgrgid_r_proto='$getgrgid_r_proto'
22318 getgrnam_r_proto='$getgrnam_r_proto'
22319 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
22320 gethostbyname_r_proto='$gethostbyname_r_proto'
22321 gethostent_r_proto='$gethostent_r_proto'
22322 getlogin_r_proto='$getlogin_r_proto'
22323 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
22324 getnetbyname_r_proto='$getnetbyname_r_proto'
22325 getnetent_r_proto='$getnetent_r_proto'
22326 getprotobyname_r_proto='$getprotobyname_r_proto'
22327 getprotobynumber_r_proto='$getprotobynumber_r_proto'
22328 getprotoent_r_proto='$getprotoent_r_proto'
22329 getpwent_r_proto='$getpwent_r_proto'
22330 getpwnam_r_proto='$getpwnam_r_proto'
22331 getpwuid_r_proto='$getpwuid_r_proto'
22332 getservbyname_r_proto='$getservbyname_r_proto'
22333 getservbyport_r_proto='$getservbyport_r_proto'
22334 getservent_r_proto='$getservent_r_proto'
22335 getspnam_r_proto='$getspnam_r_proto'
22336 gidformat='$gidformat'
22342 gmtime_r_proto='$gmtime_r_proto'
22343 gnulibc_version='$gnulibc_version'
22345 groupcat='$groupcat'
22346 groupstype='$groupstype'
22349 h_sysfile='$h_sysfile'
22352 html1dir='$html1dir'
22353 html1direxp='$html1direxp'
22354 html3dir='$html3dir'
22355 html3direxp='$html3direxp'
22364 i_arpainet='$i_arpainet'
22365 i_assert='$i_assert'
22366 i_bsdioctl='$i_bsdioctl'
22370 i_dirent='$i_dirent'
22376 i_fp_class='$i_fp_class'
22378 i_gdbm_ndbm='$i_gdbm_ndbm'
22379 i_gdbmndbm='$i_gdbmndbm'
22381 i_ieeefp='$i_ieeefp'
22382 i_inttypes='$i_inttypes'
22383 i_langinfo='$i_langinfo'
22384 i_libutil='$i_libutil'
22385 i_limits='$i_limits'
22386 i_locale='$i_locale'
22387 i_machcthr='$i_machcthr'
22388 i_malloc='$i_malloc'
22389 i_mallocmalloc='$i_mallocmalloc'
22391 i_memory='$i_memory'
22392 i_mntent='$i_mntent'
22395 i_neterrno='$i_neterrno'
22396 i_netinettcp='$i_netinettcp'
22400 i_pthread='$i_pthread'
22402 i_rpcsvcdbm='$i_rpcsvcdbm'
22405 i_shadow='$i_shadow'
22407 i_stdarg='$i_stdarg'
22408 i_stddef='$i_stddef'
22409 i_stdlib='$i_stdlib'
22410 i_string='$i_string'
22411 i_sunmath='$i_sunmath'
22412 i_sysaccess='$i_sysaccess'
22413 i_sysdir='$i_sysdir'
22414 i_sysfile='$i_sysfile'
22415 i_sysfilio='$i_sysfilio'
22417 i_sysioctl='$i_sysioctl'
22418 i_syslog='$i_syslog'
22419 i_sysmman='$i_sysmman'
22420 i_sysmode='$i_sysmode'
22421 i_sysmount='$i_sysmount'
22422 i_sysndir='$i_sysndir'
22423 i_sysparam='$i_sysparam'
22424 i_syspoll='$i_syspoll'
22425 i_sysresrc='$i_sysresrc'
22426 i_syssecrt='$i_syssecrt'
22427 i_sysselct='$i_sysselct'
22428 i_syssockio='$i_syssockio'
22429 i_sysstat='$i_sysstat'
22430 i_sysstatfs='$i_sysstatfs'
22431 i_sysstatvfs='$i_sysstatvfs'
22432 i_systime='$i_systime'
22433 i_systimek='$i_systimek'
22434 i_systimes='$i_systimes'
22435 i_systypes='$i_systypes'
22436 i_sysuio='$i_sysuio'
22438 i_sysutsname='$i_sysutsname'
22439 i_sysvfs='$i_sysvfs'
22440 i_syswait='$i_syswait'
22441 i_termio='$i_termio'
22442 i_termios='$i_termios'
22444 i_unistd='$i_unistd'
22447 i_values='$i_values'
22448 i_varargs='$i_varargs'
22449 i_varhdr='$i_varhdr'
22451 ignore_versioned_solibs='$ignore_versioned_solibs'
22452 inc_version_list='$inc_version_list'
22453 inc_version_list_init='$inc_version_list_init'
22456 initialinstalllocation='$initialinstalllocation'
22457 installarchlib='$installarchlib'
22458 installbin='$installbin'
22459 installhtml1dir='$installhtml1dir'
22460 installhtml3dir='$installhtml3dir'
22461 installman1dir='$installman1dir'
22462 installman3dir='$installman3dir'
22463 installprefix='$installprefix'
22464 installprefixexp='$installprefixexp'
22465 installprivlib='$installprivlib'
22466 installscript='$installscript'
22467 installsitearch='$installsitearch'
22468 installsitebin='$installsitebin'
22469 installsitehtml1dir='$installsitehtml1dir'
22470 installsitehtml3dir='$installsitehtml3dir'
22471 installsitelib='$installsitelib'
22472 installsiteman1dir='$installsiteman1dir'
22473 installsiteman3dir='$installsiteman3dir'
22474 installsitescript='$installsitescript'
22475 installstyle='$installstyle'
22476 installusrbinperl='$installusrbinperl'
22477 installvendorarch='$installvendorarch'
22478 installvendorbin='$installvendorbin'
22479 installvendorhtml1dir='$installvendorhtml1dir'
22480 installvendorhtml3dir='$installvendorhtml3dir'
22481 installvendorlib='$installvendorlib'
22482 installvendorman1dir='$installvendorman1dir'
22483 installvendorman3dir='$installvendorman3dir'
22484 installvendorscript='$installvendorscript'
22486 issymlink='$issymlink'
22487 ivdformat='$ivdformat'
22490 known_extensions='$known_extensions'
22493 lddlflags='$lddlflags'
22495 ldflags_uselargefiles='$ldflags_uselargefiles'
22496 ldlibpthname='$ldlibpthname'
22503 libsdirs='$libsdirs'
22504 libsfiles='$libsfiles'
22505 libsfound='$libsfound'
22506 libspath='$libspath'
22507 libswanted='$libswanted'
22508 libswanted_uselargefiles='$libswanted_uselargefiles'
22514 localtime_r_proto='$localtime_r_proto'
22515 locincpth='$locincpth'
22516 loclibpth='$loclibpth'
22517 longdblsize='$longdblsize'
22518 longlongsize='$longlongsize'
22519 longsize='$longsize'
22523 lseeksize='$lseeksize'
22524 lseektype='$lseektype'
22527 madlyobj='$madlyobj'
22528 madlysrc='$madlysrc'
22532 make_set_make='$make_set_make'
22533 mallocobj='$mallocobj'
22534 mallocsrc='$mallocsrc'
22535 malloctype='$malloctype'
22537 man1direxp='$man1direxp'
22540 man3direxp='$man3direxp'
22542 mips_type='$mips_type'
22543 mistrustnm='$mistrustnm'
22545 mmaptype='$mmaptype'
22546 modetype='$modetype'
22548 multiarch='$multiarch'
22550 myarchname='$myarchname'
22551 mydomain='$mydomain'
22552 myhostname='$myhostname'
22555 need_va_copy='$need_va_copy'
22556 netdb_hlen_type='$netdb_hlen_type'
22557 netdb_host_type='$netdb_host_type'
22558 netdb_name_type='$netdb_name_type'
22559 netdb_net_type='$netdb_net_type'
22562 nm_so_opt='$nm_so_opt'
22563 nonxs_ext='$nonxs_ext'
22565 nvEUformat='$nvEUformat'
22566 nvFUformat='$nvFUformat'
22567 nvGUformat='$nvGUformat'
22568 nv_overflows_integers_at='$nv_overflows_integers_at'
22569 nv_preserves_uv_bits='$nv_preserves_uv_bits'
22570 nveformat='$nveformat'
22571 nvfformat='$nvfformat'
22572 nvgformat='$nvgformat'
22575 o_nonblock='$o_nonblock'
22577 old_pthread_create_joinable='$old_pthread_create_joinable'
22578 optimize='$optimize'
22579 orderlib='$orderlib'
22582 otherlibdirs='$otherlibdirs'
22586 patchlevel='$patchlevel'
22587 path_sep='$path_sep'
22590 perl_patchlevel='$perl_patchlevel'
22591 perladmin='$perladmin'
22592 perllibs='$perllibs'
22593 perlpath='$perlpath'
22595 phostname='$phostname'
22601 prefixexp='$prefixexp'
22603 privlibexp='$privlibexp'
22604 procselfexe='$procselfexe'
22605 prototype='$prototype'
22607 quadkind='$quadkind'
22608 quadtype='$quadtype'
22609 randbits='$randbits'
22610 randfunc='$randfunc'
22611 random_r_proto='$random_r_proto'
22612 randseedtype='$randseedtype'
22614 rd_nodata='$rd_nodata'
22615 readdir64_r_proto='$readdir64_r_proto'
22616 readdir_r_proto='$readdir_r_proto'
22617 revision='$revision'
22623 sPRIEUldbl='$sPRIEUldbl'
22624 sPRIFUldbl='$sPRIFUldbl'
22625 sPRIGUldbl='$sPRIGUldbl'
22626 sPRIXU64='$sPRIXU64'
22628 sPRIeldbl='$sPRIeldbl'
22629 sPRIfldbl='$sPRIfldbl'
22630 sPRIgldbl='$sPRIgldbl'
22635 sSCNfldbl='$sSCNfldbl'
22636 sched_yield='$sched_yield'
22637 scriptdir='$scriptdir'
22638 scriptdirexp='$scriptdirexp'
22640 seedfunc='$seedfunc'
22641 selectminbits='$selectminbits'
22642 selecttype='$selecttype'
22643 sendmail='$sendmail'
22644 setgrent_r_proto='$setgrent_r_proto'
22645 sethostent_r_proto='$sethostent_r_proto'
22646 setlocale_r_proto='$setlocale_r_proto'
22647 setnetent_r_proto='$setnetent_r_proto'
22648 setprotoent_r_proto='$setprotoent_r_proto'
22649 setpwent_r_proto='$setpwent_r_proto'
22650 setservent_r_proto='$setservent_r_proto'
22653 sharpbang='$sharpbang'
22654 shmattype='$shmattype'
22655 shortsize='$shortsize'
22658 sig_count='$sig_count'
22659 sig_name='$sig_name'
22660 sig_name_init='$sig_name_init'
22662 sig_num_init='$sig_num_init'
22663 sig_size='$sig_size'
22664 signal_t='$signal_t'
22665 sitearch='$sitearch'
22666 sitearchexp='$sitearchexp'
22668 sitebinexp='$sitebinexp'
22669 sitehtml1dir='$sitehtml1dir'
22670 sitehtml1direxp='$sitehtml1direxp'
22671 sitehtml3dir='$sitehtml3dir'
22672 sitehtml3direxp='$sitehtml3direxp'
22674 sitelib_stem='$sitelib_stem'
22675 sitelibexp='$sitelibexp'
22676 siteman1dir='$siteman1dir'
22677 siteman1direxp='$siteman1direxp'
22678 siteman3dir='$siteman3dir'
22679 siteman3direxp='$siteman3direxp'
22680 siteprefix='$siteprefix'
22681 siteprefixexp='$siteprefixexp'
22682 sitescript='$sitescript'
22683 sitescriptexp='$sitescriptexp'
22684 sizesize='$sizesize'
22685 sizetype='$sizetype'
22689 sockethdr='$sockethdr'
22690 socketlib='$socketlib'
22691 socksizetype='$socksizetype'
22693 spackage='$spackage'
22694 spitshell='$spitshell'
22695 srand48_r_proto='$srand48_r_proto'
22696 srandom_r_proto='$srandom_r_proto'
22698 ssizetype='$ssizetype'
22699 startperl='$startperl'
22701 static_ext='$static_ext'
22703 stdio_base='$stdio_base'
22704 stdio_bufsiz='$stdio_bufsiz'
22705 stdio_cnt='$stdio_cnt'
22706 stdio_filbuf='$stdio_filbuf'
22707 stdio_ptr='$stdio_ptr'
22708 stdio_stream_array='$stdio_stream_array'
22709 strerror_r_proto='$strerror_r_proto'
22712 subversion='$subversion'
22716 targetarch='$targetarch'
22720 timeincl='$timeincl'
22721 timetype='$timetype'
22722 tmpnam_r_proto='$tmpnam_r_proto'
22728 ttyname_r_proto='$ttyname_r_proto'
22737 uidformat='$uidformat'
22743 uquadtype='$uquadtype'
22744 use5005threads='$use5005threads'
22745 use64bitall='$use64bitall'
22746 use64bitint='$use64bitint'
22747 usecrosscompile='$usecrosscompile'
22749 usedtrace='$usedtrace'
22750 usefaststdio='$usefaststdio'
22751 useithreads='$useithreads'
22752 uselargefiles='$uselargefiles'
22753 uselongdouble='$uselongdouble'
22754 usemallocwrap='$usemallocwrap'
22755 usemorebits='$usemorebits'
22756 usemultiplicity='$usemultiplicity'
22757 usemymalloc='$usemymalloc'
22759 useopcode='$useopcode'
22760 useperlio='$useperlio'
22761 useposix='$useposix'
22762 usereentrant='$usereentrant'
22763 userelocatableinc='$userelocatableinc'
22765 useshrplib='$useshrplib'
22766 usesitecustomize='$usesitecustomize'
22767 usesocks='$usesocks'
22768 usethreads='$usethreads'
22769 usevendorprefix='$usevendorprefix'
22770 usevfork='$usevfork'
22773 uvXUformat='$uvXUformat'
22774 uvoformat='$uvoformat'
22777 uvuformat='$uvuformat'
22778 uvxformat='$uvxformat'
22779 vendorarch='$vendorarch'
22780 vendorarchexp='$vendorarchexp'
22781 vendorbin='$vendorbin'
22782 vendorbinexp='$vendorbinexp'
22783 vendorhtml1dir='$vendorhtml1dir'
22784 vendorhtml1direxp='$vendorhtml1direxp'
22785 vendorhtml3dir='$vendorhtml3dir'
22786 vendorhtml3direxp='$vendorhtml3direxp'
22787 vendorlib='$vendorlib'
22788 vendorlib_stem='$vendorlib_stem'
22789 vendorlibexp='$vendorlibexp'
22790 vendorman1dir='$vendorman1dir'
22791 vendorman1direxp='$vendorman1direxp'
22792 vendorman3dir='$vendorman3dir'
22793 vendorman3direxp='$vendorman3direxp'
22794 vendorprefix='$vendorprefix'
22795 vendorprefixexp='$vendorprefixexp'
22796 vendorscript='$vendorscript'
22797 vendorscriptexp='$vendorscriptexp'
22799 version_patchlevel_string='$version_patchlevel_string'
22800 versiononly='$versiononly'
22802 voidflags='$voidflags'
22805 yaccflags='$yaccflags'
22810 : Add in command line options if available
22811 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
22813 : add special variables
22814 $test -f $src/patchlevel.h && \
22815 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
22816 echo "PERL_PATCHLEVEL=$perl_patchlevel" >>config.sh
22817 echo "PERL_CONFIG_SH=true" >>config.sh
22819 : propagate old symbols
22820 if $test -f UU/config.sh; then
22821 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
22822 $sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' \
22823 config.sh config.sh UU/oldconfig.sh |\
22824 $sort | $uniq -u >UU/oldsyms
22825 set X `cat UU/oldsyms`
22831 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
22833 echo ": Variables propagated from previous config.sh file." >>config.sh
22834 for sym in `cat UU/oldsyms`; do
22835 echo " Propagating $hint variable "'$'"$sym..."
22836 eval 'tmp="$'"${sym}"'"'
22838 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
22844 : Finish up by extracting the .SH files
22848 echo "Extraction done."
22858 If you'd like to make any changes to the config.sh file before I begin
22859 to configure things, do it as a shell escape now (e.g. !vi config.sh).
22862 rp="Press return or use a shell escape to edit config.sh:"
22867 *) : in case they cannot read
22868 sh 1>&4 -c "$ans";;
22873 : if this fails, just run all the .SH files by hand
22882 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
22889 Now you need to generate make dependencies by running "$make depend".
22890 You might prefer to run it in background: "$make depend > makedepend.out &"
22891 It can take a while, so you might not want to run it right now.
22896 rp="Run $make depend now?"
22900 $make depend && echo "Now you must run '$make'."
22903 echo "You must run '$make depend' then '$make'."
22906 elif test -f [Mm]akefile; then
22908 echo "Now you must run a $make."
22910 echo "Configure done."
22913 if $test -f Policy.sh; then
22916 If you compile $package on a different machine or from a different object
22917 directory, copy the Policy.sh file from this object directory to the
22918 new one before you run Configure -- this will help you with most of
22919 the policy defaults.
22923 if $test -f config.msg; then
22924 echo "Hmm. I also noted the following information while running:"
22926 $cat config.msg >&4
22929 $rm -f kit*isdone ark*isdone