3 # If these # comments don't work, trim them. Don't worry about any other
4 # shell scripts, Configure will trim # comments from them for you.
6 # (If you are trying to port this package to a machine without sh,
7 # I would suggest you have a look at the prototypical config_h.SH file
8 # and edit it to reflect your system. Some packages may include samples
9 # of config.h for certain machines, so you might look for one of those.)
11 # Yes, you may rip this off to use in other distribution packages. This
12 # script belongs to the public domain and cannot be copyrighted.
14 # Note: this Configure script was generated automatically. Rather than
15 # working with this copy of Configure, you may wish to get metaconfig.
16 # The dist package (which contains metaconfig) is available via SVN:
17 # svn co https://svn.sourceforge.net/svnroot/dist/trunk/dist
20 # Though this script was generated by metaconfig, it is OK to send
21 # patches against it. It's up to the Configure pumpkin to backport
22 # the patch to the metaunits if it is accepted.
23 # See Porting/pumpkin.pod for more information on metaconfig.
26 # $Id: Head.U 6 2006-08-25 22:21:46Z rmanfredi $
28 # Generated on Fri Aug 8 16:16:43 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=''
951 d_inc_version_list=''
953 inc_version_list_init=''
972 ignore_versioned_solibs=''
1036 d_perl_otherlibdirs=''
1044 api_versionstring=''
1050 version_patchlevel_string=''
1054 d_nv_preserves_uv=''
1055 d_nv_zero_is_allbits_zero=''
1066 nv_overflows_integers_at=''
1067 nv_preserves_uv_bits=''
1139 installsitehtml1dir=''
1142 installsitehtml3dir=''
1149 installsiteman1dir=''
1152 installsiteman3dir=''
1157 installsitescript=''
1172 d_stdio_stream_array=''
1173 stdio_stream_array=''
1188 ccflags_uselargefiles=''
1189 ldflags_uselargefiles=''
1190 libswanted_uselargefiles=''
1210 installvendorarch=''
1217 installvendorhtml1dir=''
1219 vendorhtml1direxp=''
1220 installvendorhtml3dir=''
1222 vendorhtml3direxp=''
1228 installvendorman1dir=''
1231 installvendorman3dir=''
1238 installvendorscript=''
1251 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1254 : We must find out about Eunice early
1256 if test -f /etc/unixtovms; then
1257 eunicefix=/etc/unixtovms
1259 if test -f /etc/unixtovms.exe; then
1260 eunicefix=/etc/unixtovms.exe
1263 : Set executable suffix now -- needed before hints available
1264 if test -f "/libs/version.library"; then
1267 elif test -f "/system/gnu_library/bin/ar.pm"; then
1270 elif test -n "$DJGPP"; then
1273 elif test -d c:/. -o -n "$is_os2" ; then
1280 : Trailing extension. Override this in a hint file, if needed.
1281 : Extra object files, if any, needed on this platform.
1285 : change the next line if compiling for Xenix/286 on Xenix/386
1286 xlibpth='/usr/lib/386 /lib/386'
1287 : Possible local library directories to search.
1288 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1289 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1291 : general looking path for locating libraries
1292 glibpth="/lib /usr/lib $xlibpth"
1293 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1294 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1295 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1296 test -d /usr/lib64 && glibpth="$glibpth /lib64 /usr/lib64 /usr/local/lib64"
1298 : Private path used by Configure to find libraries. Its value
1299 : is prepended to libpth. This variable takes care of special
1300 : machines, like the mips. Usually, it should be empty.
1303 : default library list
1305 : some systems want to use only the non-versioned libso:s
1306 ignore_versioned_solibs=''
1307 : set usethreads on the Configure command line to enable threads.
1308 usereentrant='undef'
1309 : full support for void wanted by default
1312 : Possible local include directories to search.
1313 : Set locincpth to "" in a hint file to defeat local include searches.
1314 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1315 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1317 : no include file wanted by default
1320 : Enable -DEBUGGING and -DDEBUGGING from the command line
1327 : set useposix=false in your hint file to disable the POSIX extension.
1329 : set useopcode=false in your hint file to disable the Opcode extension.
1332 ccflags_uselargefiles=''
1333 ldflags_uselargefiles=''
1334 libswanted_uselargefiles=''
1335 : set usemultiplicity on the Configure command line to enable multiplicity.
1336 : set usesocks on the Configure command line to enable socks.
1337 : List of libraries we want.
1338 : If anyone needs extra -lxxx, put those in a hint file.
1339 libswanted="sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun"
1340 libswanted="$libswanted m crypt sec util c cposix posix ucb bsd BSD"
1341 : We probably want to search /usr/shlib before most other libraries.
1342 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1343 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1344 glibpth="/usr/shlib $glibpth"
1345 : Do not use vfork unless overridden by a hint file.
1348 : Find the basic shell for Bourne shell scripts
1352 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1355 if test -f "$xxx"; then
1358 : Build up a list and do a single loop so we can 'break' out.
1359 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1360 for xxx in sh bash ksh pdksh ash; do
1362 try="$try ${p}/${xxx}"
1366 if test -f "$xxx"; then
1369 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1372 elif test -f "$xxx.exe"; then
1383 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1385 Usually it's in /bin/sh. How did you even get this far?
1386 Please contact me (Perl Maintainers) at perlbug@perl.org and
1387 we'll try to straighten this all out.
1393 : see if sh knows # comments
1394 if `$sh -c '#' >/dev/null 2>&1`; then
1398 test -f $xcat$_exe || xcat=/usr/bin/cat
1399 if test ! -f $xcat$_exe; then
1400 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1401 if test -f $p/cat$_exe; then
1406 if test ! -f $xcat$_exe; then
1407 echo "Can't find cat anywhere!"
1411 echo "#!$xcat" >sharp
1414 ./sharp > today 2>/dev/null
1415 if test -s today; then
1418 echo "#! $xcat" > sharp
1421 ./sharp > today 2>/dev/null
1422 if test -s today; then
1430 echo "Your $sh doesn't grok # comments--I will strip them later on."
1433 echo "exec grep -v '^[ ]*#'" >spitshell
1435 $eunicefix spitshell
1436 spitshell=`pwd`/spitshell
1438 echo "I presume that if # doesn't work, #! won't work either!"
1443 : figure out how to guarantee sh startup
1445 '') startsh=${sharpbang}${sh} ;;
1457 : echo "Yup, it does."
1459 echo "Hmm... '$startsh' does not guarantee sh startup..."
1460 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1464 : Save command line options in file UU/cmdline.opt for later use in
1465 : generating config.sh.
1466 cat > cmdline.opt <<EOSH
1467 : Configure command line arguments.
1476 cat >>cmdline.opt <<EOSH
1477 config_arg$argn='$arg'
1479 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1482 arg_exp=`cat cmdl.opt`
1483 args_exp="$args_exp$args_sep'$arg_exp'"
1484 argn=`expr $argn + 1`
1489 : produce awk script to parse command line options
1490 cat >options.awk <<'EOF'
1492 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1494 len = length(optstr);
1495 for (i = 1; i <= len; i++) {
1496 c = substr(optstr, i, 1);
1497 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1508 if (substr(str, 1, 1) != "-") {
1509 printf("'%s'\n", str);
1513 for (i = 2; i <= len; i++) {
1514 c = substr(str, i, 1);
1516 printf("-%s\n", substr(str, i));
1522 printf("'%s'\n", substr(str, i + 1));
1535 : process the command line options
1536 set X `for arg in "$@"; do echo "X$arg"; done |
1537 sed -e s/X// | awk -f options.awk`
1542 : set up default values
1552 rm -f optdef.sh posthint.sh
1553 cat >optdef.sh <<EOS
1559 while test $# -gt 0; do
1561 -d) shift; fastread=yes;;
1562 -e) shift; alldone=cont;;
1566 if test -r "$1"; then
1569 echo "$me: cannot read config file $1." >&2
1575 -h) shift; error=true;;
1576 -r) shift; reuseval=true;;
1577 -s) shift; silent=true; realsilent=true;;
1578 -E) shift; alldone=exit;;
1579 -K) shift; knowitall=true;;
1580 -O) shift; override=true;;
1581 -S) shift; silent=true; extractsh=true;;
1586 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1587 echo "$me: ignoring -D $1" >&2
1590 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1591 *) echo "$1='define'" >> optdef.sh;;
1598 *=) echo "$1" >> optdef.sh;;
1600 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1601 echo "$me: ignoring -U $1" >&2
1603 *) echo "$1='undef'" >> optdef.sh;;
1614 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1618 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1619 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1625 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1626 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1627 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1628 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1629 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1630 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1636 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1638 echo "$yyy=''" >> posthint.sh ;;
1643 echo "$yyy='$zzz'" >> posthint.sh ;;
1645 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1647 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1652 echo "$yyy=$zzz" >> posthint.sh ;;
1653 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1657 -V) echo "$me generated by metaconfig 3.5 PL0." >&2
1660 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1668 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1669 [-U symbol] [-U symbol=] [-A command:symbol...]
1670 -d : use defaults for all answers.
1671 -e : go on without questioning past the production of config.sh.
1672 -f : specify an alternate default configuration file.
1673 -h : print this help message and exit (with an error status).
1674 -r : reuse C symbols value if possible (skips costly nm extraction).
1675 -s : silent mode, only echoes questions and essential information.
1676 -D : define symbol to have some value:
1677 -D symbol symbol gets the value 'define'
1678 -D symbol=value symbol gets the value 'value'
1679 common used examples (see INSTALL for more info):
1680 -Duse64bitint use 64bit integers
1681 -Duse64bitall use 64bit integers and pointers
1682 -Dusethreads use thread support
1683 -Dinc_version_list=none do not include older perl trees in @INC
1684 -DEBUGGING=none DEBUGGING options
1685 -Dcc=gcc choose your compiler
1686 -Dprefix=/opt/perl5 choose your destination
1687 -E : stop at the end of questions, after having produced config.sh.
1688 -K : do not use unless you know what you are doing.
1689 -O : let -D and -U override definitions from loaded configuration file.
1690 -S : perform variable substitutions on all .SH files (can mix with -f)
1691 -U : undefine symbol:
1692 -U symbol symbol gets the value 'undef'
1693 -U symbol= symbol gets completely empty
1695 -A : manipulate symbol after the platform specific hints have been applied:
1696 -A append:symbol=value append value to symbol
1697 -A symbol=value like append:, but with a separating space
1698 -A define:symbol=value define symbol to have value
1699 -A clear:symbol define symbol to be ''
1700 -A define:symbol define symbol to be 'define'
1701 -A eval:symbol=value define symbol to be eval of value
1702 -A prepend:symbol=value prepend value to symbol
1703 -A undef:symbol define symbol to be 'undef'
1704 -A undef:symbol= define symbol to be ''
1705 e.g.: -A prepend:libswanted='cl pthread '
1706 -A ccflags=-DSOME_MACRO
1707 -V : print version number and exit (with a zero status).
1714 case "$fastread$alldone" in
1717 case "$extractsh" in
1720 if test ! -t 0; then
1721 echo "Say 'sh Configure', not 'sh <Configure'"
1731 true) exec 1>/dev/null;;
1734 : run the defines and the undefines, if any, but leave the file out there...
1737 : create the posthint manipulation script and leave the file out there...
1742 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1743 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1744 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1745 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1746 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1749 : Some greps do not return status, grrr.
1750 echo "grimblepritz" >grimble
1751 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1753 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1759 : the following should work in any shell
1763 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1764 cat >contains <<'EOSS'
1765 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1770 : Find the path to the source tree
1773 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1777 *) src=`cd ../$src && pwd` ;;
1790 if test -f $rsrc/Configure && \
1791 $contains "^package='$package'\$" $rsrc/Configure >/dev/null 2>&1
1793 : found it, so we are ok.
1796 for src in . .. ../.. ../../.. ../../../..; do
1797 if test -f ../$src/Configure && \
1798 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1809 Sorry, I can't seem to locate the source dir for $package. Please start
1810 Configure with an explicit path -- i.e. /some/path/Configure.
1818 echo "Sources for $package found in \"$src\"." >&4
1822 : script used to extract .SH files with variable substitutions
1823 cat >extract <<'EOS'
1825 echo "Doing variable substitutions on .SH files..."
1826 if test -f MANIFEST; then
1827 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1829 echo "(Looking for .SH files under the source directory.)"
1830 set x `(cd "$src"; find . -name "*.SH" -print)`
1834 0) set x `(cd "$src"; echo *.SH)`; shift;;
1836 if test ! -f "$src/$1"; then
1842 while test $name; do
1843 if test ! -d "$name"; then
1844 create="$name $create";
1845 name=`echo $name | sed -e "s|^[^/]*$||"`;
1846 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1851 for file in $create; do
1860 dir=`expr X$file : 'X\(.*\)/'`
1861 file=`expr X$file : 'X.*/\(.*\)'`
1862 (cd "$dir" && . ./$file)
1872 dir=`expr X$file : 'X\(.*\)/'`
1873 file=`expr X$file : 'X.*/\(.*\)'`
1874 (set x $dir; shift; eval $mkdir_p)
1875 sh <"$src/$dir/$file"
1884 if test -f "$src/config_h.SH"; then
1885 if test ! -f config.h; then
1886 : oops, they left it out of MANIFEST, probably, so do it anyway.
1887 . "$src/config_h.SH"
1892 : extract files and exit if asked to do so
1893 case "$extractsh" in
1895 case "$realsilent" in
1899 case "$config_sh" in
1900 '') config_sh='config.sh';;
1903 echo "Fetching answers from $config_sh..."
1906 test "$override" && . ./optdef.sh
1910 echo "Extraction done."
1915 : Eunice requires " " instead of "", can you believe it
1918 echo "Beginning of configuration questions for $package."
1920 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1922 : first determine how to suppress newline on echo command
1924 echo "Checking echo to see how to suppress newlines..."
1925 (echo "hi there\c" ; echo " ") >.echotmp
1926 if $contains c .echotmp >/dev/null 2>&1 ; then
1937 echo $n "The star should be here-->$c"
1941 : Now test for existence of everything in MANIFEST
1943 if test -f "$rsrc/MANIFEST"; then
1944 echo "First let's make sure your kit is complete. Checking..." >&4
1945 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | \
1946 (split -l 50 2>/dev/null || split -50)
1949 for filelist in x??; do
1950 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` \
1951 >/dev/null 2>>"$tmppwd/missing")
1953 if test -s missing; then
1957 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1959 You have the option of continuing the configuration process, despite the
1960 distinct possibility that your kit is damaged, by typing 'y'es. If you
1961 do, don't blame me if something goes wrong. I advise you to type 'n'o
1962 and contact the author (perlbug@perl.org).
1965 echo $n "Continue? [n] $c" >&4
1969 echo "Continuing..." >&4
1973 echo "ABORTING..." >&4
1978 echo "Looks good..."
1981 echo "There is no MANIFEST file. I hope your kit is complete !"
1985 : Find the appropriate value for a newline for tr
1987 if test -n "$DJGPP"; then
1990 if test X"$trnl" = X; then
1991 case "`echo foo|tr '\n' x 2>/dev/null`" in
1995 if test X"$trnl" = X; then
1996 case "`echo foo|tr '\012' x 2>/dev/null`" in
1997 foox) trnl='\012' ;;
2000 if test X"$trnl" = X; then
2001 case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
2002 fooxy) trnl='\n\r' ;;
2005 if test X"$trnl" = X; then
2008 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
2014 : compute the number of columns on the terminal for proper question formatting
2019 : set up the echo used in my read
2020 myecho="case \"\$xxxm\" in
2021 '') echo $n \"\$rp $c\" >&4;;
2023 '') echo $n \"[\$xxxm] $c\";;
2025 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
2027 echo $n \"[\$xxxm] $c\" >&4
2029 echo $n \"\$rp [\$xxxm] $c\" >&4
2035 : now set up to do reads with possible shell escape and default assignment
2041 case "\$fastread" in
2042 yes) case "\$dflt" in
2045 case "\$silent-\$rp" in
2050 *) case "\$silent" in
2051 true) case "\$rp" in
2056 while expr "X\$ans" : "X!" >/dev/null; do
2060 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2068 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2077 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2082 echo "(OK, I'll run with -d after this question.)" >&4
2085 echo "*** Sorry, \$1 not supported yet." >&4
2095 echo "*** Substitution done -- please confirm."
2097 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2102 echo "*** Error -- try again."
2109 case "\$ans\$xxxm\$nostick" in
2121 : create .config dir to save info across Configure sessions
2122 test -d ../.config || mkdir ../.config
2123 cat >../.config/README <<EOF
2124 This directory created by Configure to save information that should
2125 persist across sessions for $package.
2127 You may safely delete it if you wish.
2130 : See if we are using a devel version and want that
2131 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2133 $define|true|[yY]*) ;;
2134 *) case "$xversion" in
2137 *** WHOA THERE!!! ***
2139 This is an UNSTABLE DEVELOPMENT release.
2140 The version of this $package distribution is $xversion, that is, odd,
2141 (as opposed to even) and that signifies a development release.
2142 If you want a maintenance release, you want an even-numbered version.
2144 Do ***NOT*** install this into production use.
2145 Data corruption and crashes are possible.
2147 It is most seriously suggested that you do not continue any further
2148 unless you want to help in developing and debugging Perl.
2150 If you *still* want to build perl, you can answer 'y' now,
2151 or pass -Dusedevel to Configure.
2154 rp='Do you really want to continue?'
2158 [yY]) echo >&4 "Okay, continuing."
2159 usedevel="$define" ;;
2160 *) echo >&4 "Okay, bye."
2170 case "$versiononly" in
2171 '') versiononly="$define" ;;
2173 case "$installusrbinperl" in
2174 '') installusrbinperl="$undef" ;;
2179 : general instructions
2182 user=`(logname) 2>/dev/null`
2184 '') user=`whoami 2>&1`;;
2186 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2189 rp='Would you like to see the instructions?'
2200 This installation shell script will examine your system and ask you questions
2201 to determine how the perl5 package should be installed. If you get
2202 stuck on a question, you may use a ! shell escape to start a subshell or
2203 execute a command. Many of the questions will have default answers in square
2204 brackets; typing carriage return will give you the default.
2206 On some of the questions which ask for file or directory names you are allowed
2207 to use the ~name construct to specify the login directory belonging to "name",
2208 even if you don't have a shell which knows about that. Questions where this is
2209 allowed will be marked "(~name ok)".
2213 dflt='Type carriage return to continue'
2217 The prompter used in this script allows you to use shell variables and
2218 backticks in your answers. You may use $1, $2, etc... to refer to the words
2219 in the default answer, as if the default line was a set of arguments given to a
2220 script shell. This means you may also use $* to repeat the whole default line,
2221 so you do not have to re-type everything to add something to the default.
2223 Everytime there is a substitution, you will have to confirm. If there is an
2224 error (e.g. an unmatched backtick), the default answer will remain unchanged
2225 and you will be prompted again.
2227 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2228 the questions and use the computed defaults (or the previous answers if there
2229 was already a config.sh file). Type 'Configure -h' for a list of options.
2230 You may also start interactively and then answer '& -d' at any prompt to turn
2231 on the non-interactive behaviour for the remainder of the execution.
2237 Much effort has been expended to ensure that this shell script will run on any
2238 Unix system. If despite that it blows up on yours, your best bet is to edit
2239 Configure and run it again. If you can't run Configure for some reason,
2240 you'll have to generate a config.sh file by hand. Whatever problems you
2241 have, let me (perlbug@perl.org) know how I blew it.
2243 This installation script affects things in two ways:
2245 1) it may do direct variable substitutions on some of the files included
2247 2) it builds a config.h file for inclusion in C programs. You may edit
2248 any of these files as the need arises after running this script.
2250 If you make a mistake on a question, there is no easy way to back up to it
2251 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2252 files. Configure will offer to let you do this before it runs the SH files.
2255 dflt='Type carriage return to continue'
2257 case "$firsttime" in
2258 true) echo $user >>../.config/instruct;;
2262 : find out where common programs are
2264 echo "Locating common programs..." >&4
2277 if test -d \$dir/\$thing; then
2283 for thisthing in \$dir/\$thing; do
2284 : just loop through to pick last item
2286 if test -f \$thisthing; then
2289 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2292 elif test -f \$dir/\$thing.exe; then
2293 if test -n "$DJGPP"; then
2294 echo \$dir/\$thing.exe
2295 elif test "$eunicefix" != ":"; then
2296 : on Eunice apparently
2348 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2349 pth="$pth /lib /usr/lib"
2350 for file in $loclist; do
2354 if test -f "$xxx"; then
2357 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2358 xxx=`./loc $file $file $pth`
2361 '') xxx=`./loc $file $file $pth`;;
2362 *) xxx=`./loc $xxx $xxx $pth`;;
2364 eval $file=$xxx$_exe
2368 echo $file is in $xxx.
2371 echo $file is in $xxx.
2374 echo "I don't know where '$file' is, and my life depends on it." >&4
2375 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2381 echo "Don't worry if any of the following aren't found..."
2383 for file in $trylist; do
2387 if test -f "$xxx"; then
2390 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2391 xxx=`./loc $file $file $pth`
2394 '') xxx=`./loc $file $file $pth`;;
2395 *) xxx=`./loc $xxx $xxx $pth`;;
2397 eval $file=$xxx$_exe
2401 echo $file is in $xxx.
2404 echo $file is in $xxx.
2407 echo "I don't see $file out there, $say."
2414 echo "Substituting grep for egrep."
2421 echo "Substituting cp for ln."
2430 echo "I can't find make or gmake, and my life depends on it." >&4
2431 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2439 *) # We can't have osname yet.
2440 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2441 # Assume that gmake, if found, is definitely GNU make
2442 # and prefer it over the system make.
2443 echo "Substituting gmake for make."
2451 echo "Hopefully test is built into your sh."
2454 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2455 echo "Using the test built into your sh."
2463 echo "Hopefully echo is built into your sh."
2468 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2469 $echo $n "hi there$c" >foo1
2470 echo $n "hi there$c" >foo2
2471 if cmp foo1 foo2 >/dev/null 2>&1; then
2472 echo "They are compatible. In fact, they may be identical."
2479 They are not compatible! You are probably running ksh on a non-USG system.
2480 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2481 have echo built in and we may have to run some Bourne shell scripts. That
2482 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2485 $echo $n "The star should be here-->$c"
2492 # This question was auctioned at YAPC::Europe-2007 in Vienna
2493 # I never promised you could answer it. I only auctioned the question.
2495 The following message is sponsored by
2497 Dresden.pm<--The stars should be here.
2499 Dear Perl user, system administrator or package
2500 maintainer, the Perl community sends greetings to
2501 you. Do you (emblematical) greet back [Y/n]? n
2505 : Check what type of C compiler we use
2509 cat <<'EOSC' >>trygcc
2514 int main(int argc, char *argv[]) {
2518 if $cc -o try $ccflags $ldflags try.c; then
2521 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2527 # Skip this test because it gives a false match on output like:
2528 # ./trygcc: line 23: cc: command not found
2529 # case "`$cc -v -c try.c 2>&1`" in
2530 # *gcc*) trygcc=no ;;
2532 if $test X"$trygcc" = Xyes; then
2533 if gcc -o try -c try.c; then
2535 echo "You seem to have a working gcc, though." >&4
2536 # Switching compilers may undo the work of hints files.
2537 # The most common problem is -D_REENTRANT for threads.
2538 # This heuristic catches that case, but gets false positives
2539 # if -Dusethreads was not actually specified. Better to
2540 # bail out here with a useful message than fail
2541 # mysteriously later. Should we perhaps just try to
2542 # re-invoke Configure -Dcc=gcc config_args ?
2543 if $test -f usethreads.cbu; then
2546 *** However, any setting of the C compiler flags (e.g. for thread support)
2547 *** will be lost. It may be necessary for you to restart Configure and
2548 *** add -Dcc=gcc to your Configure command line.
2551 rp="Would you like to go ahead and try gcc anyway?"
2554 rp="Would you like to use it?"
2557 if $test -f myread; then
2560 if $test -f UU/myread; then
2563 echo "Cannot find myread, sorry. Aborting." >&2
2568 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2581 cat <<'EOSC' >>checkcc
2586 int main(int argc, char *argv[]) {
2590 if $cc -o try $ccflags $ldflags try.c; then
2593 if $test X"$despair" = Xyes; then
2594 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2597 You need to find a working C compiler.
2598 Either (purchase and) install the C compiler supplied by your OS vendor,
2599 or for a free C compiler try http://gcc.gnu.org/
2600 I cannot continue any further, aborting.
2609 : determine whether symbolic links are supported
2612 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2613 echo "Symbolic links are supported." >&4
2616 echo "Symbolic links are NOT supported." >&4
2621 : determine whether symbolic links are supported
2625 echo "Checking how to test for symbolic links..." >&4
2627 if $test "X$issymlink" = X; then
2629 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2630 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2632 if test $? = 0; then
2635 echo "Your builtin 'test -h' may be broken." >&4
2638 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2641 if test -f "$p/$test"; then
2650 echo "Trying external '$test -h'." >&4
2651 issymlink="$test -h"
2652 if $test ! -h sym >/dev/null 2>&1; then
2653 echo "External '$test -h' is broken, too." >&4
2661 if $test "X$issymlink" = X; then
2662 if $test -L sym 2>/dev/null; then
2663 issymlink="$test -L"
2664 echo "The builtin '$test -L' worked." >&4
2667 if $test "X$issymlink" != X; then
2668 echo "You can test for symbolic links with '$issymlink'." >&4
2670 echo "I do not know how you can test for symbolic links." >&4
2674 *) echo "No symbolic links, so not testing for their testing..." >&4
2679 : Make symlinks util
2680 case "$mksymlinks" in
2683 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2686 *) case "$lns:$issymlink" in
2687 *"ln"*" -s:"*"test -"?)
2688 echo "Creating the symbolic links..." >&4
2689 echo "(First creating the subdirectories...)" >&4
2691 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2693 test -z "$directory" && break
2697 if test ! -d t/base; then
2698 echo "Failed to create the subdirectories. Aborting." >&4
2701 echo "(Then creating the symlinks...)" >&4
2702 awk '{print $1}' $src/MANIFEST | while true; do
2704 test -z "$filename" && break
2705 if test -f $filename; then
2706 if $issymlink $filename; then
2710 if test -f $filename; then
2711 echo "$filename already exists, not symlinking."
2713 ln -s $src/$filename $filename
2717 if test ! -f t/base/lex.t; then
2718 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2723 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2731 : Check for Cross-Compilation
2732 case "$usecrosscompile" in
2734 $echo "Cross-compiling..."
2737 *-*-gcc) # A cross-compiling gcc, probably.
2738 targetarch=`$echo $cc|$sed 's/-gcc$//'`
2740 # leave out ld, choosing it is more complex
2742 ranlib=$targetarch-ranlib
2743 $echo 'extern int foo;' > try.c
2744 set X `$cc -v -E try.c 2>&1 | $awk '/^#include </,/^End of search /'|$grep '/include'`
2746 if $test $# -gt 0; then
2748 incpth="`$echo $incpth|$sed 's/^ //'`"
2749 echo "Guessing incpth '$incpth'." >&4
2751 j="`$echo $i|$sed 's,/include$,/lib,'`"
2752 if $test -d $j; then
2756 libpth="`$echo $libpth|$sed 's/^ //'`"
2757 echo "Guessing libpth '$libpth'." >&4
2762 case "$targetarch" in
2763 '') echo "Targetarch not defined." >&4; croak=y ;;
2764 *) echo "Using targetarch $targetarch." >&4 ;;
2767 '') echo "Incpth not defined." >&4; croak=y ;;
2768 *) echo "Using incpth '$incpth'." >&4 ;;
2771 '') echo "Libpth not defined." >&4; croak=y ;;
2772 *) echo "Using libpth '$libpth'." >&4 ;;
2775 '') for i in $incpth; do
2776 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
2778 echo "Guessing usrinc $usrinc." >&4
2783 '') echo "Usrinc not defined." >&4; croak=y ;;
2786 *) echo "Using usrinc $usrinc." >&4 ;;
2788 case "$targethost" in
2789 '') echo "Targethost not defined." >&4; croak=y ;;
2790 *) echo "Using targethost $targethost." >&4
2795 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2798 /*) run=$src/Cross/run
2799 targetmkdir=$src/Cross/mkdir
2801 from=$src/Cross/from
2803 *) pwd=`$test -f ../Configure & cd ..; pwd`
2805 targetmkdir=$pwd/Cross/mkdir
2807 from=$pwd/Cross/from
2810 case "$targetrun" in
2811 '') targetrun=ssh ;;
2816 case "$targetfrom" in
2817 '') targetfrom=scp ;;
2821 from=$from-$targetfrom
2822 case "$targetdir" in
2824 echo "Guessing targetdir $targetdir." >&4
2827 case "$targetuser" in
2829 echo "Guessing targetuser $targetuser." >&4
2832 case "$targetfrom" in
2836 case "$targetrun" in
2848 '') cwd=$targetdir ;;
2852 if $test ! -f \$exe.xok; then
2856 $targetrun -l $targetuser $targethost "cd \$cwd && ./\$exe \$@"
2859 *) echo "Unknown targetrun '$targetrun'" >&4
2863 case "$targetmkdir" in
2865 cat >$targetmkdir <<EOF
2867 $targetrun -l $targetuser $targethost "mkdir -p \$@"
2869 $chmod a+rx $targetmkdir
2871 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
2883 $targetmkdir \`dirname \$f\`
2884 $targetto $q \$f $targetuser@$targethost:\$f || exit 1
2887 $targetmkdir $targetdir/\`dirname \$f\`
2888 $targetto $q \$f $targetuser@$targethost:$targetdir/\$f || exit 1
2901 $mkdir -p $targetdir/\`dirname \$f\`
2902 $cp \$f $targetdir/\$f || exit 1
2905 $targetmkdir $targetdir/\`dirname \$f\`
2906 $cp \$f $targetdir/\$f || exit 1
2913 *) echo "Unknown targetto '$targetto'" >&4
2917 case "$targetfrom" in
2924 $targetfrom $q $targetuser@$targethost:$targetdir/\$f . || exit 1
2929 cp) cat >$from <<EOF
2934 cp $targetdir/\$f . || exit 1
2939 *) echo "Unknown targetfrom '$targetfrom'" >&4
2943 if $test ! -f $run; then
2944 echo "Target 'run' script '$run' not found." >&4
2948 if $test ! -f $to; then
2949 echo "Target 'to' script '$to' not found." >&4
2953 if $test ! -f $from; then
2954 echo "Target 'from' script '$from' not found." >&4
2958 if $test ! -f $run -o ! -f $to -o ! -f $from; then
2962 Using '$run' for remote execution,
2963 and '$from' and '$to'
2964 for remote file transfer.
2970 usecrosscompile='undef'
2975 : see whether [:lower:] and [:upper:] are supported character classes
2977 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2979 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2983 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
2984 # (0xd9 and 0xe2), therefore that is a nice testing point.
2985 if test "X$up" = X -o "X$low" = X; then
2986 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
2992 if test "X$up" = X -o "X$low" = X; then
2993 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
2999 if test "X$up" = X -o "X$low" = X; then
3000 case "`echo RS | od -x 2>/dev/null`" in
3002 echo "Hey, this might be EBCDIC." >&4
3003 if test "X$up" = X -o "X$low" = X; then
3004 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
3005 rs) up='[A-IJ-RS-Z]'
3010 if test "X$up" = X -o "X$low" = X; then
3011 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
3021 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
3023 echo "Using $up and $low to convert case." >&4
3026 echo "I don't know how to translate letters from upper to lower case." >&4
3027 echo "Your tr is not acting any way I know of." >&4
3031 : set up the translation script tr, must be called with ./tr of course
3035 '[A-Z][a-z]') exec $tr '$up' '$low';;
3036 '[a-z][A-Z]') exec $tr '$low' '$up';;
3043 : Try to determine whether config.sh was made on this system
3044 case "$config_sh" in
3046 myuname=`$uname -a 2>/dev/null`
3047 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
3048 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
3049 # because the A-Z/a-z are not consecutive.
3050 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e "s,['/],,g" | \
3051 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
3052 newmyuname="$myuname"
3054 case "$knowitall" in
3056 if test -f ../config.sh; then
3057 if $contains myuname= ../config.sh >/dev/null 2>&1; then
3058 eval "`grep myuname= ../config.sh`"
3060 if test "X$myuname" = "X$newmyuname"; then
3068 : Get old answers from old config file if Configure was run on the
3069 : same system, otherwise use the hints.
3072 if test -f config.sh; then
3074 rp="I see a config.sh file. Shall I use it to set the defaults?"
3077 n*|N*) echo "OK, I'll ignore it."
3078 mv config.sh config.sh.old
3079 myuname="$newmyuname"
3081 *) echo "Fetching default answers from your old config.sh file..." >&4
3089 : Older versions did not always set $sh. Catch re-use of such
3099 if test ! -f config.sh; then
3102 First time through, eh? I have some defaults handy for some systems
3103 that need some extra help getting the Configure answers right:
3106 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3108 : Half the following guesses are probably wrong... If you have better
3109 : tests or hints, please send them to perlbug@perl.org
3110 : The metaconfig authors would also appreciate a copy...
3111 $test -f /irix && osname=irix
3112 $test -f /xenix && osname=sco_xenix
3113 $test -f /dynix && osname=dynix
3114 $test -f /dnix && osname=dnix
3115 $test -f /lynx.os && osname=lynxos
3116 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3117 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3118 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3119 $test -f /bin/mips && /bin/mips && osname=mips
3120 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
3121 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
3122 $test -d /usr/apollo/bin && osname=apollo
3123 $test -f /etc/saf/_sactab && osname=svr4
3124 $test -d /usr/include/minix && osname=minix
3125 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3126 if $test -d /MachTen -o -d /MachTen_Folder; then
3128 if $test -x /sbin/version; then
3129 osvers=`/sbin/version | $awk '{print $2}' |
3130 $sed -e 's/[A-Za-z]$//'`
3131 elif $test -x /usr/etc/version; then
3132 osvers=`/usr/etc/version | $awk '{print $2}' |
3133 $sed -e 's/[A-Za-z]$//'`
3139 $test -f /sys/posix.dll &&
3140 $test -f /usr/bin/what &&
3141 set X `/usr/bin/what /sys/posix.dll` &&
3142 $test "$3" = UWIN &&
3146 if $test -f $uname; then
3154 umips) osname=umips ;;
3157 [23]100) osname=mips ;;
3158 next*) osname=next ;;
3160 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3161 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3164 elif $test -f /etc/kconfig; then
3166 if test "$lns" = "$ln -s"; then
3168 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3170 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3177 if test -n "$DJGPP"; then
3186 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3188 # oslevel can fail with:
3189 # oslevel: Unable to acquire lock.
3190 *not\ found) osvers="$4"."$3" ;;
3191 '<3240'|'<>3240') osvers=3.2.0 ;;
3192 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3193 '=3250'|'>3250') osvers=3.2.5 ;;
3197 bsd386) osname=bsd386
3200 cygwin*) osname=cygwin
3203 *dc.osx) osname=dcosx
3209 domainos) osname=apollo
3215 dragonfly) osname=dragonfly
3218 dynixptx*) osname=dynixptx
3219 osvers=`echo "$4"|sed 's/^v//'`
3221 freebsd) osname=freebsd
3223 genix) osname=genix ;;
3227 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3243 netbsd*) osname=netbsd
3246 news-os) osvers="$3"
3248 4*) osname=newsos4 ;;
3252 next*) osname=next ;;
3253 nonstop-ux) osname=nonstopux ;;
3254 openbsd) osname=openbsd
3260 POSIX-BC | posix-bc ) osname=posix-bc
3263 powerux | power_ux | powermax_os | powermaxos | \
3264 powerunix | power_unix) osname=powerux
3270 solaris) osname=solaris
3272 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3279 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3283 titanos) osname=titanos
3292 ultrix) osname=ultrix
3295 osf1|mls+) case "$5" in
3298 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3301 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3304 hp*) osname=hp_osf1 ;;
3305 mips) osname=mips_osf1 ;;
3308 # UnixWare 7.1.2 is known as Open UNIX 8
3309 openunix|unixware) osname=svr5
3317 $2) case "$osname" in
3321 : svr4.x or possibly later
3331 if test -f /stand/boot ; then
3332 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3333 if test -n "$INITPROG" -a -f "$INITPROG"; then
3334 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3335 if test -n "$isesix"; then
3343 *) if test -f /etc/systemid; then
3345 set `echo $3 | $sed 's/\./ /g'` $4
3346 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3348 elif $test -f $src/hints/sco_$1_$2.sh; then
3350 elif $test -f $src/hints/sco_$1.sh; then
3355 '') : Still unknown. Probably a generic Sys V.
3364 *) case "$osname" in
3365 '') : Still unknown. Probably a generic BSD.
3373 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3374 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3375 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3378 $rm -f UU/kernel.what
3379 elif test -d c:/. -o -n "$is_os2" ; then
3386 case "$targetarch" in
3389 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3394 : Now look for a hint file osname_osvers, unless one has been
3395 : specified already.
3398 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3399 : Also try without trailing minor version numbers.
3400 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3401 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3402 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3403 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3406 *) case "$osvers" in
3409 *) if $test -f $src/hints/$file.sh ; then
3411 elif $test -f $src/hints/$xfile.sh ; then
3413 elif $test -f $src/hints/$xxfile.sh ; then
3415 elif $test -f $src/hints/$xxxfile.sh ; then
3417 elif $test -f $src/hints/$xxxxfile.sh ; then
3419 elif $test -f "$src/hints/${osname}.sh" ; then
3428 if $test -f Policy.sh ; then
3431 none) dflt="Policy" ;;
3432 *) dflt="Policy $dflt" ;;
3437 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3441 if $test -f Policy.sh ; then
3444 There's also a Policy hint file available, which should make the
3445 site-specific (policy) questions easier to answer.
3452 You may give one or more space-separated answers, or "none" if appropriate.
3453 If you have a handcrafted Policy.sh file or a Policy.sh file generated by a
3454 previous run of Configure, you may specify it as well as or instead of
3455 OS-specific hints. If hints are provided for your OS, you should use them:
3456 although Perl can probably be built without hints on many platforms, using
3457 hints often improve performance and may enable features that Configure can't
3458 set up on its own. If there are no hints that match your OS, specify "none";
3459 DO NOT give a wrong version or a wrong OS.
3463 rp="Which of these apply, if any?"
3466 for file in $tans; do
3467 if $test X$file = XPolicy -a -f Policy.sh; then
3469 $cat Policy.sh >> UU/config.sh
3470 elif $test -f $src/hints/$file.sh; then
3471 . $src/hints/$file.sh
3472 $cat $src/hints/$file.sh >> UU/config.sh
3473 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3476 : Give one chance to correct a possible typo.
3477 echo "$file.sh does not exist"
3479 rp="hint to use instead?"
3481 for file in $ans; do
3482 if $test -f "$src/hints/$file.sh"; then
3483 . $src/hints/$file.sh
3484 $cat $src/hints/$file.sh >> UU/config.sh
3485 elif $test X$ans = X -o X$ans = Xnone ; then
3488 echo "$file.sh does not exist -- ignored."
3495 : Remember our hint file for later.
3496 if $test -f "$src/hints/$file.sh" ; then
3506 echo "Fetching default answers from $config_sh..." >&4
3510 cp $config_sh config.sh 2>/dev/null
3520 test "$override" && . ./optdef.sh
3522 : Restore computed paths
3523 for file in $loclist $trylist; do
3524 eval $file="\$_$file"
3529 Configure uses the operating system name and version to set some defaults.
3530 The default value is probably right if the name rings a bell. Otherwise,
3531 since spelling matters for me, either accept the default or answer "none"
3538 ''|' '|none) dflt=none ;;
3539 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3542 *) dflt="$osname" ;;
3544 rp="Operating system name?"
3548 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3554 ''|' '|none) dflt=none ;;
3555 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3556 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3558 ''|' ') dflt=none ;;
3563 *) dflt="$osvers" ;;
3565 rp="Operating system version?"
3575 : who configured the system
3576 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3579 cf_by=`(logname) 2>/dev/null`
3582 cf_by=`(whoami) 2>/dev/null`
3584 "") cf_by=unknown ;;
3589 : decide how portable to be. Allow command line overrides.
3590 case "$d_portable" in
3592 *) d_portable="$define" ;;
3595 : set up shell script to do ~ expansion
3601 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3604 if $test -f /bin/csh; then
3605 /bin/csh -f -c "glob \$1"
3610 name=\`$expr x\$1 : '..\([^/]*\)'\`
3611 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3612 if $test ! -d "\$dir"; then
3614 echo "\$me: can't locate home directory for: \$name" >&2
3619 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3635 : now set up to get a file name
3639 cat <<'EOSC' >>getfile
3655 : getfile will accept an answer from the comma-separated list
3656 : enclosed in parentheses even if it does not meet other criteria.
3657 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3658 fn=`echo $fn | sed 's/(.*)//'`
3664 loc_file=`expr $fn : '.*:\(.*\)'`
3665 fn=`expr $fn : '\(.*\):.*'`
3673 */*) fullpath=true;;
3682 *e*) exp_file=true;;
3685 *p*) nopath_ok=true;;
3690 *d*) type='Directory';;
3691 *l*) type='Locate';;
3696 Locate) what='File';;
3701 case "$d_portable" in
3709 while test "$type"; do
3714 true) rp="$rp (~name ok)";;
3717 if test -f UU/getfile.ok && \
3718 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3737 value=`UU/filexp $ans`
3740 if test "$ans" != "$value"; then
3741 echo "(That expands to $value on this system.)"
3755 /*) value="$ansexp" ;;
3756 [a-zA-Z]:/*) value="$ansexp" ;;
3761 echo "I shall only accept a full path name, as in /bin/ls." >&4
3762 echo "Use a ! shell escape if you wish to check pathnames." >&4
3765 echo "Please give a full path name, starting with slash." >&4
3768 echo "Note that using ~name is ok provided it expands well." >&4
3781 for fp in $gfpth; do
3782 if test "X$fp" = X.; then
3787 if test -f "$pf"; then
3789 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3791 echo "($value is not a plain file, but that's ok.)"
3794 if test X"$type" = X; then
3801 for fp in $gfpth; do
3802 if test "X$fp" = X.; then
3807 direxp="$fp/$ansexp"
3809 if test -d "$direxp"; then
3817 if test -d "$ansexp"; then
3818 echo "(Looking for $loc_file in directory $value.)"
3819 value="$value/$loc_file"
3820 ansexp="$ansexp/$loc_file"
3822 if test -f "$ansexp"; then
3825 case "$nopath_ok" in
3826 true) case "$value" in
3828 *) echo "Assuming $value will be in people's path."
3844 if test "$fastread" = yes; then
3849 rp="$what $value doesn't exist. Use that name anyway?"
3868 test "X$gfpthkeep" != Xy && gfpth=""
3871 : determine root of directory hierarchy where package will be installed.
3874 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
3877 dflt=`echo "$prefix" | sed 's/.$//'`
3885 By default, $package will be installed in $dflt/bin, manual pages
3886 under $dflt/man, etc..., i.e. with $dflt as prefix for all
3887 installation directories. Typically this is something like /usr/local.
3888 If you wish to have binaries under /usr/bin but other parts of the
3889 installation under /usr/local, that's ok: you will be prompted
3890 separately for each of the installation directories, the prefix being
3891 only used to set the defaults.
3895 rp='Installation prefix to use?'
3903 *) oldprefix="$prefix";;
3910 : allow them to override the AFS root
3913 *) afsroot=$afsroot ;;
3919 $define|true) afs=true ;;
3920 $undef|false) afs=false ;;
3921 *) if $test -d $afsroot; then
3929 echo "AFS may be running... I'll be extra cautious then..." >&4
3931 echo "AFS does not seem to be running..." >&4
3934 : determine installation prefix for where package is to be installed.
3938 Since you are running AFS, I need to distinguish the directory in which
3939 files will reside from the directory in which they are installed (and from
3940 which they are presumably copied to the former directory by occult means).
3943 case "$installprefix" in
3944 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
3945 *) dflt="$installprefix";;
3950 In some special cases, particularly when building $package for distribution,
3951 it is convenient to distinguish the directory in which files should be
3952 installed from the directory ($prefix) in which they will
3953 eventually reside. For most users, these two directories are the same.
3956 case "$installprefix" in
3958 *) dflt=$installprefix;;
3962 rp='What installation prefix should I use for installing files?'
3964 installprefix="$ans"
3965 installprefixexp="$ansexp"
3967 : Perform the prefixexp/installprefixexp correction if necessary
3968 cat <<EOS >installprefix
3971 cat <<'EOSC' >>installprefix
3972 : Change installation prefix, if necessary.
3973 if $test X"$prefix" != X"$installprefix"; then
3974 eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`"
3976 eval "install${prefixvar}=\"\$${prefixvar}exp\""
3979 chmod +x installprefix
3980 $eunicefix installprefix
3982 : Set variables such as privlib and privlibexp from the output of ./getfile
3983 : performing the prefixexp/installprefixexp correction if necessary.
3984 cat <<EOS >setprefixvar
3987 cat <<'EOSC' >>setprefixvar
3988 eval "${prefixvar}=\"\$ans\""
3989 eval "${prefixvar}exp=\"\$ansexp\""
3992 chmod +x setprefixvar
3993 $eunicefix setprefixvar
3995 : set up the script used to warn in case of inconsistency
4004 '') echo "The $hint value for \$$var on this machine was \"$was\"!" >&4
4006 *) echo "Hmm. Based on the hints in hints/$hintfile.sh, " >&4
4007 echo "the $hint value for \$$var on this machine was \"$was\"!" >&4
4012 echo "*** WHOA THERE!!! ***" >&4
4013 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
4016 rp=" Keep the $hint value?"
4019 y) td=$was; tu=$was;;
4023 : function used to set '$1' to '$val'
4024 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
4026 $define$undef) . ./whoa; eval "$var=\$td";;
4027 $undef$define) . ./whoa; eval "$var=\$tu";;
4028 *) eval "$var=$val";;
4031 : Check is we will use socks
4033 $define|true|[yY]*) dflt='y';;
4038 Perl can be built to use the SOCKS proxy protocol library. To do so,
4039 Configure must be run with -Dusesocks. If you use SOCKS you also need
4040 to use the PerlIO abstraction layer, this will be implicitly selected.
4042 If this doesn't make any sense to you, just accept the default '$dflt'.
4044 rp='Build Perl for SOCKS?'
4047 y|Y) val="$define" ;;
4054 $define|true|[yY]*) useperlio="$define";;
4057 : Check if we want perlio
4058 case "$useperlio" in
4059 $define|true|[yY]*|'') dflt='y';;
4064 Previous version of $package used the standard IO mechanisms as
4065 defined in <stdio.h>. Versions 5.003_02 and later of $package allow
4066 alternate IO mechanisms via the PerlIO abstraction layer, but the
4067 stdio mechanism is still available if needed. The abstraction layer
4068 can use AT&T's sfio (if you already have sfio installed) or regular stdio.
4069 Using PerlIO with sfio may cause problems with some extension modules.
4071 If this doesn't make any sense to you, just accept the default '$dflt'.
4073 rp='Use the PerlIO abstraction layer?'
4080 echo "Ok, doing things the stdio way."
4089 case "$useperlio" in
4090 $define|true|[yY]*) ;;
4093 You are using the SOCKS proxy protocol library which means that you
4094 should also use the PerlIO layer. You may be headed for trouble.
4102 : get the patchlevel
4104 echo "Getting the current patchlevel..." >&4
4105 if $test -r $rsrc/patchlevel.h;then
4106 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
4107 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
4108 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4109 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
4110 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
4111 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4112 perl_patchlevel=`egrep ',"(MAINT|SMOKE)[0-9][0-9]*"' $rsrc/patchlevel.h|tail -1|sed 's/[^0-9]//g'`
4121 $echo "(You do not have patchlevel.h. Eek.)"
4123 if $test -r $rsrc/.patch ; then
4124 if $test "X$perl_patchlevel" = "X" || $test "`cat $rsrc/.patch`" -gt "$perl_patchlevel" ; then
4125 perl_patchlevel=`cat $rsrc/.patch`
4128 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
4129 version_patchlevel_string="version $patchlevel subversion $subversion"
4130 case "$perl_patchlevel" in
4132 *) version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel" ;;
4135 $echo "(You have $package $version_patchlevel_string.)"
4139 : XXX Should be a Configure test for double-dots in filenames.
4140 version=`echo $revision $patchlevel $subversion | \
4141 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4142 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4143 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4146 version=`echo $revision $patchlevel $subversion | \
4147 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4148 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4149 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4152 : Special case the 5.005_xx maintenance series, which used 5.005
4153 : without any subversion label as a subdirectory in $sitelib
4154 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
4155 api_versionstring='5.005'
4158 : Do we want threads support and if so, what type
4159 case "$usethreads" in
4160 $define|true|[yY]*) dflt='y';;
4161 *) # Catch case where user specified ithreads or 5005threads but
4162 # forgot -Dusethreads (A.D. 4/2002)
4163 case "$useithreads$use5005threads" in
4165 case "$useperlio" in
4166 "$define") dflt='y' ;;
4176 Perl can be built to take advantage of threads on some systems.
4177 To do so, Configure can be run with -Dusethreads.
4179 Note that Perl built with threading support runs slightly slower
4180 and uses more memory than plain Perl. The current implementation
4181 is believed to be stable, but it is fairly new, and so should be
4182 treated with caution.
4184 If this doesn't make any sense to you, just accept the default '$dflt'.
4186 rp='Build a threading Perl?'
4189 y|Y) val="$define" ;;
4195 if $test $patchlevel -lt 9; then
4196 case "$usethreads" in
4200 Since release 5.6, Perl has had two different threading implementations,
4201 the newer interpreter-based version (ithreads) with one interpreter per
4202 thread, and the older 5.005 version (5005threads).
4203 The 5005threads version is effectively unmaintained and will probably be
4204 removed in Perl 5.10, so there should be no need to build a Perl using it
4205 unless needed for backwards compatibility with some existing 5.005threads
4209 : Default to ithreads unless overridden on command line or with
4212 case "$use5005threads" in
4213 $define|true|[yY]*) dflt='n';;
4215 case "$useithreads" in
4216 $undef|false|[nN]*) dflt='n';;
4218 rp='Use the newer interpreter-based ithreads?'
4221 y|Y) val="$define" ;;
4226 : Now set use5005threads to the opposite value.
4227 case "$useithreads" in
4228 $define) val="$undef" ;;
4235 useithreads="$undef"
4236 use5005threads="$undef"
4240 case "$useithreads$use5005threads" in
4244 You cannot have both the ithreads and the 5.005 threads enabled
4245 at the same time. Disabling the 5.005 threads since they are
4246 much less stable than the ithreads.
4249 use5005threads="$undef"
4254 : perl-5.9.x and later
4256 if test X"$usethreads" = "X$define"; then
4257 case "$use5005threads" in
4261 5.005 threads has been removed for 5.10. Perl will be built using ithreads.
4268 use5005threads="$undef"
4269 useithreads="$usethreads"
4272 if test X"$usethreads" = "X$define" -a "X$useperlio" = "Xundef"; then
4275 *** To build with ithreads you must also use the PerlIO layer.
4276 *** Cannot continue, aborting.
4282 case "$d_oldpthreads" in
4283 '') : Configure tests would be welcome here. For now, assume undef.
4285 *) val="$d_oldpthreads" ;;
4291 : Look for a hint-file generated 'call-back-unit'. If the
4292 : user has specified that a threading perl is to be built,
4293 : we may need to set or change some other defaults.
4294 if $test -f usethreads.cbu; then
4295 echo "Your platform has some specific hints regarding threaded builds, using them..."
4298 case "$usethreads" in
4299 "$define"|true|[yY]*)
4301 (Your platform does not have any specific hints for threaded builds.
4302 Assuming POSIX threads, then.)
4308 : Check if multiplicity is required
4311 Perl can be built so that multiple Perl interpreters can coexist
4312 within the same Perl executable.
4315 case "$useithreads" in
4318 This multiple interpreter support is required for interpreter-based threads.
4322 *) case "$usemultiplicity" in
4323 $define|true|[yY]*) dflt='y';;
4327 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
4328 rp='Build Perl for multiplicity?'
4331 y|Y) val="$define" ;;
4339 : Check if morebits is requested
4340 case "$usemorebits" in
4341 "$define"|true|[yY]*)
4342 use64bitint="$define"
4343 uselongdouble="$define"
4344 usemorebits="$define"
4346 *) usemorebits="$undef"
4350 : Determine the C compiler to be used
4356 rp="Use which C compiler?"
4360 : See whether they have no cc but they do have gcc
4362 if $test -f cc.cbu; then
4367 : make some quick guesses about what we are up against
4369 $echo $n "Hmm... $c"
4379 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
4380 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
4382 echo "Looks kind of like an OSF/1 system, but we'll see..."
4384 elif test `echo abc | $tr a-z A-Z` = Abc ; then
4385 xxx=`./loc addbib blurfl $pth`
4386 if $test -f $xxx; then
4387 echo "Looks kind of like a USG system with BSD features, but we'll see..."
4391 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
4392 echo "Looks kind of like an extended USG system, but we'll see..."
4394 echo "Looks kind of like a USG system, but we'll see..."
4398 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
4399 echo "Looks kind of like a BSD system, but we'll see..."
4403 echo "Looks kind of like a Version 7 system, but we'll see..."
4406 case "$eunicefix" in
4409 There is, however, a strange, musty smell in the air that reminds me of
4410 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
4414 : it so happens the Eunice I know will not run shell scripts in Unix format
4418 echo "Congratulations. You aren't running Eunice."
4422 : Detect OS2. The p_ variable is set above in the Head.U unit.
4423 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
4424 : semicolon as a patch separator
4429 I have the feeling something is not exactly right, however...don't tell me...
4430 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
4431 (Or you may be running DOS with DJGPP.)
4436 if test -f /xenix; then
4437 echo "Actually, this looks more like a XENIX system..."
4442 echo "It's not Xenix..."
4447 if test -f /venix; then
4448 echo "Actually, this looks more like a VENIX system..."
4455 echo "Nor is it Venix..."
4458 chmod +x bsd usg v7 osf1 eunice xenix venix os2
4459 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
4462 : Check if we are using GNU gcc and what its version is
4464 echo "Checking for GNU cc in disguise and/or its version number..." >&4
4468 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
4470 printf("%s\n", __VERSION__);
4472 printf("%s\n", "1");
4478 if $cc -o try $ccflags $ldflags try.c; then
4479 gccversion=`$run ./try`
4480 case "$gccversion" in
4481 '') echo "You are not using GNU cc." ;;
4482 *) echo "You are using GNU cc $gccversion."
4488 echo "*** WHOA THERE!!! ***" >&4
4489 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
4490 case "$knowitall" in
4492 echo " You'd better start hunting for one and let me know about it." >&4
4498 case "$gccversion" in
4499 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
4501 case "$gccversion" in
4502 '') gccosandvers='' ;;
4503 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
4504 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
4506 case "$gccosandvers" in
4507 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
4508 $osname$osvers) ;; # looking good
4509 $osname*) cat <<EOM >&4
4511 *** WHOA THERE!!! ***
4513 Your gcc has not been compiled for the exact release of
4514 your operating system ($gccosandvers versus $osname$osvers).
4516 In general it is a good idea to keep gcc synchronized with
4517 the operating system because otherwise serious problems
4518 may ensue when trying to compile software, like Perl.
4520 I'm trying to be optimistic here, though, and will continue.
4521 If later during the configuration and build icky compilation
4522 problems appear (headerfile conflicts being the most common
4523 manifestation), I suggest reinstalling the gcc to match
4524 your operating system release.
4528 *) gccosandvers='' ;; # failed to parse, better be silent
4536 # gcc 3.* complain about adding -Idirectories that they already know about,
4537 # so we will take those off from locincpth.
4538 case "$gccversion" in
4540 echo "main(){}">try.c
4541 for incdir in $locincpth; do
4542 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
4543 grep '^c[cp]p*[01]: warning: changing search order '`
4544 if test "X$warn" != X; then
4545 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
4551 : What should the include directory be ?
4553 $echo $n "Hmm... $c"
4557 if $test -f /bin/mips && /bin/mips; then
4558 echo "Looks like a MIPS system..."
4559 $cat >usr.c <<'EOCP'
4560 #ifdef SYSTYPE_BSD43
4564 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4565 dflt='/bsd43/usr/include'
4569 mips_type='System V'
4571 $rm -f usr.c usr.out
4572 echo "and you're compiling with the $mips_type compiler and libraries."
4576 echo "Doesn't look like a MIPS system."
4586 case "$xxx_prompt" in
4589 rp='Where are the include files you want to use?'
4597 : see how we invoke the C preprocessor
4599 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4600 cat <<'EOT' >testcpp.c
4606 if test ! -f cppstdin; then
4607 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4608 # AIX cc -E doesn't show the absolute headerfile
4609 # locations but we'll cheat by using the -M flag.
4610 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
4612 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4615 echo "Keeping your $hint cppstdin wrapper."
4618 wrapper=`pwd`/cppstdin
4622 if $test "X$cppstdin" != "X" && \
4623 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4624 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4626 echo "You used to use $cppstdin $cppminus so we'll use that again."
4628 '') echo "But let's see if we can live without a wrapper..." ;;
4630 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4631 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4633 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4636 echo "(However, $cpprun $cpplast does not work, let's see...)"
4644 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4651 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4652 $cc -E <testcpp.c >testcpp.out 2>&1; \
4653 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4654 echo "Yup, it does."
4657 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4658 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4659 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4660 echo "Yup, it does."
4663 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4664 $cc -P <testcpp.c >testcpp.out 2>&1; \
4665 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4666 echo "Yipee, that works!"
4669 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4670 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4671 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4672 echo "At long last!"
4675 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4676 $cpp <testcpp.c >testcpp.out 2>&1; \
4677 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4681 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4682 $cpp - <testcpp.c >testcpp.out 2>&1; \
4683 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4684 echo "Hooray, it works! I was beginning to wonder."
4687 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4688 $wrapper <testcpp.c >testcpp.out 2>&1; \
4689 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4695 rp="No dice. I can't find a C preprocessor. Name one:"
4699 $x_cpp <testcpp.c >testcpp.out 2>&1
4700 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4701 echo "OK, that will do." >&4
4703 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4718 echo "Perhaps can we force $cc -E using a wrapper..."
4719 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4720 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4726 echo "Nope, we'll have to live without it..."
4740 "$wrapper"|'cppstdin') ;;
4741 *) $rm -f $wrapper;;
4743 $rm -f testcpp.c testcpp.out
4745 : Set private lib path
4748 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4753 '') dlist="$loclibpth $plibpth $glibpth";;
4754 *) dlist="$libpth";;
4757 : Now check and see which directories actually exist, avoiding duplicates
4761 if $test -d $xxx; then
4764 *) libpth="$libpth $xxx";;
4770 Some systems have incompatible or broken versions of libraries. Among
4771 the directories listed in the question below, please remove any you
4772 know not to be holding relevant libraries, and add any that are needed.
4773 Say "none" for none.
4784 rp="Directories to use for library searches?"
4791 : compute shared library extension
4794 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4804 On some systems, shared libraries may be available. Answer 'none' if
4805 you want to suppress searching of shared libraries for the remainder
4806 of this configuration.
4809 rp='What is the file extension used for shared libraries?'
4813 : Define several unixisms.
4814 : Hints files or command line option can be used to override them.
4815 : The convoluted testing is in case hints files set either the old
4818 '') case "$exe_ext" in
4820 *) _exe="$exe_ext" ;;
4825 '') case "$lib_ext" in
4832 '') case "$obj_ext" in
4839 '') case "$path_sep" in
4850 rm_try="$rm -f try try$_exe a.out .out try.[cho] try.$_o core core.try* try.core*"
4852 : Which makefile gets called first. This is used by make depend.
4853 case "$firstmakefile" in
4854 '') firstmakefile='makefile';;
4857 : Check for uselongdouble support
4859 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
4862 case "$uselongdouble" in
4863 $define|true|[yY]*) dflt='y';;
4868 Perl can be built to take advantage of long doubles which
4869 (if available) may give more accuracy and range for floating point numbers.
4871 If this doesn't make any sense to you, just accept the default '$dflt'.
4873 rp='Try to use long doubles if available?'
4876 y|Y) val="$define" ;;
4882 case "$uselongdouble" in
4883 true|[yY]*) uselongdouble="$define" ;;
4886 : Look for a hint-file generated 'call-back-unit'. If the
4887 : user has specified that long doubles should be used,
4888 : we may need to set or change some other defaults.
4889 if $test -f uselongdouble.cbu; then
4890 echo "Your platform has some specific hints regarding long doubles, using them..."
4891 . ./uselongdouble.cbu
4893 case "$uselongdouble" in
4896 (Your platform does not have any specific hints for long doubles.)
4902 : Looking for optional libraries
4904 echo "Checking for optional libraries..." >&4
4909 case "$libswanted" in
4910 '') libswanted='c_s';;
4913 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
4919 for thisdir in $libpth $xlibpth; do
4920 test -d $thisdir && libspath="$libspath $thisdir"
4922 for thislib in $libswanted; do
4923 for thisdir in $libspath; do
4925 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4926 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
4927 $test -f "$xxx" && eval $libscheck
4928 $test -f "$xxx" && libstyle=shared
4930 if test ! -f "$xxx"; then
4931 xxx=$thisdir/lib$thislib.$so
4932 $test -f "$xxx" && eval $libscheck
4933 $test -f "$xxx" && libstyle=shared
4935 if test ! -f "$xxx"; then
4936 xxx=$thisdir/lib$thislib$_a
4937 $test -f "$xxx" && eval $libscheck
4938 $test -f "$xxx" && libstyle=static
4940 if test ! -f "$xxx"; then
4941 xxx=$thisdir/$thislib$_a
4942 $test -f "$xxx" && eval $libscheck
4943 $test -f "$xxx" && libstyle=static
4945 if test ! -f "$xxx"; then
4946 xxx=$thisdir/lib${thislib}_s$_a
4947 $test -f "$xxx" && eval $libscheck
4948 $test -f "$xxx" && libstyle=static
4949 $test -f "$xxx" && thislib=${thislib}_s
4951 if test ! -f "$xxx"; then
4952 xxx=$thisdir/Slib$thislib$_a
4953 $test -f "$xxx" && eval $libscheck
4954 $test -f "$xxx" && libstyle=static
4956 if $test -f "$xxx"; then
4958 shared) echo "Found -l$thislib (shared)." ;;
4959 static) echo "Found -l$thislib." ;;
4960 *) echo "Found -l$thislib ($libstyle)." ;;
4964 *) dflt="$dflt -l$thislib"
4965 libsfound="$libsfound $xxx"
4967 libsfiles="$libsfiles $yyy"
4968 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
4969 case " $libsdirs " in
4971 *) libsdirs="$libsdirs $yyy" ;;
4978 if $test ! -f "$xxx"; then
4979 echo "No -l$thislib."
4990 ' '|'') dflt='none';;
4995 In order to compile $package on your machine, a number of libraries
4996 are usually needed. Include any other special libraries here as well.
4997 Say "none" for none. The default list is almost always right.
5001 rp="What libraries to use?"
5008 : determine optimization, if desired, or use for debug flag also
5010 ' '|$undef) dflt='none';;
5012 *) dflt="$optimize";;
5016 By default, $package compiles with the -O flag to use the optimizer.
5017 Alternately, you might want to use the symbolic debugger, which uses
5018 the -g flag (on traditional Unix systems). Either flag can be
5019 specified here. To use neither flag, specify the word "none".
5022 rp="What optimizer/debugger flag should be used?"
5026 'none') optimize=" ";;
5029 : Check what DEBUGGING is required from the command line
5030 : -DEBUGGING or -DDEBUGGING or
5031 : -DEBUGGING=both = -g + -DDEBUGGING
5032 : -DEBUGGING=-g or -Doptimize=-g = -g
5033 : -DEBUGGING=none or -UDEBUGGING =
5034 : -DEBUGGING=old or -DEBUGGING=default = ? $optimize
5037 *) DEBUGGING=$EBUGGING ;;
5040 case "$DEBUGGING" in
5044 *) optimize="$optimize -g" ;;
5048 *-g*) set `echo "X $optimize " | sed 's/ -g / /'`
5056 case "$DEBUGGING" in
5057 both|$define) dflt='-DDEBUGGING'
5060 : argument order is deliberate, as the flag will start with - which set could
5061 : think is an option
5062 checkccflag='check=$1; flag=$2; callback=$3;
5064 echo "Checking if your compiler accepts $flag" 2>&1;
5065 echo "int main(void) { return 0; }" > gcctest.c;
5066 if $cc -O2 $flag -o gcctest gcctest.c 2>gcctest.out && ./gcctest; then
5067 echo "Yes, it does." 2>&1;
5068 if $test -s gcctest.out ; then
5069 echo "But your platform does not like it:";
5074 echo "Leaving current flags $ccflags alone." 2>&1
5076 *) dflt="$dflt $flag";
5082 echo "Nope, it does not, but that is ok." 2>&1;
5086 : We will not override a previous value, but we might want to
5087 : augment a hint file
5089 default|recommended)
5090 case "$gccversion" in
5091 1*) dflt="$dflt -fpcc-struct-return" ;;
5093 case "$optimize:$DEBUGGING" in
5094 *-g*:old) dflt="$dflt -DDEBUGGING";;
5096 case "$gccversion" in
5097 2*) if $test -d /etc/conf/kconfig.d &&
5098 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
5100 # Interactive Systems (ISC) POSIX mode.
5105 case "$gccversion" in
5108 ?*) set strict-aliasing -fno-strict-aliasing
5112 # For gcc, adding -pipe speeds up compilations for some, but apparently
5113 # some assemblers can't read from stdin. (It also slows down compilations
5114 # in other cases, but those are apparently rarer these days.) AD 5/2004.
5115 case "$gccversion" in
5121 # on x86_64 (at least) we require an extra library (libssp) in the
5122 # link command line. This library is not named, so I infer that it is
5123 # an implementation detail that may change. Hence the safest approach
5124 # is to add the flag to the flags passed to the compiler at link time,
5125 # as that way the compiler can do the right implementation dependant
5127 case "$gccversion" in
5128 ?*) set stack-protector -fstack-protector
5135 case "$mips_type" in
5136 *BSD*|'') inclwanted="$locincpth $usrinc";;
5137 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
5139 for thisincl in $inclwanted; do
5140 if $test -d $thisincl; then
5141 if $test x$thisincl != x$usrinc; then
5143 *" -I$thisincl "*);;
5144 *) dflt="$dflt -I$thisincl ";;
5150 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
5152 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
5160 *) dflt="$dflt -D$2";;
5164 set signal.h LANGUAGE_C; eval $inctest
5168 ccflags="$ccflags -DSOCKS"
5173 default|recommended) dflt="$ccflags $dflt" ;;
5174 *) dflt="$ccflags";;
5183 Your C compiler may want other flags. For this question you should include
5184 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
5185 but you should NOT include libraries or ld flags like -lwhatever. If you
5186 want $package to honor its debug switch, you should include -DDEBUGGING here.
5187 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
5189 To use no flags, specify the word "none".
5195 rp="Any additional cc flags?"
5202 : the following weeds options from ccflags that are of no interest to cpp
5204 '') cppflags="$ccflags" ;;
5205 *) cppflags="$cppflags $ccflags" ;;
5207 case "$gccversion" in
5208 1*) cppflags="$cppflags -D__GNUC__"
5210 case "$mips_type" in
5212 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
5218 echo "Let me guess what the preprocessor flags are..." >&4
5232 *) ftry="$previous $flag";;
5234 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
5235 >cpp1.out 2>/dev/null && \
5236 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
5237 >cpp2.out 2>/dev/null && \
5238 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
5239 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
5241 cppflags="$cppflags $ftry"
5251 *-*) echo "They appear to be: $cppflags";;
5253 $rm -f cpp.c cpp?.out
5257 : flags used in final linking phase
5259 '') if ./venix; then
5265 *-posix*) dflt="$dflt -posix" ;;
5268 *) dflt="$ldflags";;
5270 # See note above about -fstack-protector
5272 *-fstack-protector*)
5274 *-fstack-protector*) ;; # Don't add it again
5275 *) dflt="$dflt -fstack-protector" ;;
5280 : Try to guess additional flags to pick up local libraries.
5281 for thislibdir in $libpth; do
5282 case " $loclibpth " in
5285 *"-L$thislibdir "*) ;;
5286 *) dflt="$dflt -L$thislibdir" ;;
5298 Your C linker may need flags. For this question you should
5299 include -L/whatever and any other flags used by the C linker, but you
5300 should NOT include libraries like -lwhatever.
5302 Make sure you include the appropriate -L/path flags if your C linker
5303 does not normally search all of the directories you specified above,
5306 To use no flags, specify the word "none".
5310 rp="Any additional ld flags (NOT including libraries)?"
5316 rmlist="$rmlist pdp11"
5320 echo "Checking your choice of C compiler and flags for coherency..." >&4
5321 $cat > try.c <<'EOF'
5323 int main() { printf("Ok\n"); return(0); }
5325 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
5327 $cat >try.msg <<'EOM'
5328 I've tried to compile and run the following simple program:
5331 $cat try.c >> try.msg
5333 $cat >> try.msg <<EOM
5340 and I got the following output:
5344 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5345 if $sh -c "$run ./try " >>try.msg 2>&1; then
5349 *) echo 'The program compiled OK, but produced no output.' >> try.msg
5352 cat >> try.msg <<'EOQS'
5353 If $libs contains -lsfio, and sfio is mis-configured, then it
5354 sometimes (apparently) runs and exits with a 0 status, but with no
5355 output! It may have to do with sfio's use of _exit vs. exit.
5358 rp="You have a big problem. Shall I abort Configure"
5365 echo "The program compiled OK, but exited with status $?." >>try.msg
5366 rp="You have a problem. Shall I abort Configure"
5370 echo "I can't compile the test program." >>try.msg
5371 rp="You have a BIG problem. Shall I abort Configure"
5377 case "$knowitall" in
5379 echo "(The supplied flags or libraries might be incorrect.)"
5387 *) echo "Ok. Stopping Configure." >&4
5392 n) echo "OK, that should do.";;
5394 $rm_try gcctest gcctest.out
5396 : define a shorthand compile call
5400 case "$usedevel" in $define|true|[yY]*) if $test ! -f "${mc_file}.c"; then
5401 echo "Internal Configure script bug - compiler test file ${mc_file}.c is missing. Please report this to perlbug@perl.org" >&4;
5405 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5406 : define a shorthand compile call for compilations that should be ok.
5410 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5412 : determine filename position in cpp output
5414 echo "Computing filename position in cpp output for #include directives..." >&4
5416 vos) testaccess=-e ;;
5419 echo '#include <stdio.h>' > foo.c
5422 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5423 $grep '^[ ]*#.*stdio\.h' | \
5424 while read cline; do
5427 while $test \$# -gt 0; do
5428 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5433 pos=\`expr \$pos + 1\`
5445 *) pos="${fieldn}th";;
5447 echo "Your cpp writes the filename in the $pos field of the line."
5450 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
5451 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
5454 : locate header file
5459 for usrincdir in $usrinc
5461 if test -f \$usrincdir/\$wanted; then
5462 echo "\$usrincdir/\$wanted"
5466 awkprg='{ print \$$fieldn }'
5467 echo "#include <\$wanted>" > foo\$\$.c
5468 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5469 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5470 while read cline; do
5471 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5473 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5474 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5479 # status = 0: grep returned 0 lines, case statement not executed
5480 # status = 1: headerfile found
5481 # status = 2: while loop executed, no headerfile found
5485 if test \$status -eq 1; then
5492 : define an alternate in-header-list? function
5493 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5494 cont=true; xxf="echo \"<\$1> found.\" >&4";
5495 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5496 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5498 case $# in 4) instead=instead;; *) instead="at last";; esac;
5499 while $test "$cont"; do
5501 var=$2; eval "was=\$$2";
5502 if $test "$xxx" && $test -r "$xxx";
5504 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5507 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5508 set $yyy; shift; shift; yyy=$@;
5509 case $# in 0) cont="";;
5510 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5511 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5512 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5513 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5517 do set $yyy; var=$2; eval "was=\$$2";
5518 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5519 set $yyy; shift; shift; yyy=$@;
5522 : see if stdlib is available
5523 set stdlib.h i_stdlib
5526 : check for lengths of integral types
5530 echo "Checking to see how big your integers are..." >&4
5539 printf("intsize=%d;\n", (int)sizeof(int));
5540 printf("longsize=%d;\n", (int)sizeof(long));
5541 printf("shortsize=%d;\n", (int)sizeof(short));
5546 if eval $compile_ok && $run ./try > /dev/null; then
5548 echo "Your integers are $intsize bytes long."
5549 echo "Your long integers are $longsize bytes long."
5550 echo "Your short integers are $shortsize bytes long."
5554 Help! I can't compile and run the intsize test program: please enlighten me!
5555 (This is probably a misconfiguration in your system or libraries, and
5556 you really ought to fix it. Still, I'll try anyway.)
5560 rp="What is the size of an integer (in bytes)?"
5564 rp="What is the size of a long integer (in bytes)?"
5568 rp="What is the size of a short integer (in bytes)?"
5576 : check for long long
5578 echo "Checking to see if you have long long..." >&4
5579 echo 'int main() { long long x = 7; return 0; }' > try.c
5581 if eval $compile; then
5583 echo "You have long long."
5586 echo "You do not have long long."
5592 : check for length of long long
5593 case "${d_longlong}${longlongsize}" in
5596 echo "Checking to see how big your long longs are..." >&4
5597 $cat >try.c <<'EOCP'
5601 printf("%d\n", (int)sizeof(long long));
5606 if eval $compile_ok; then
5607 longlongsize=`$run ./try`
5608 echo "Your long longs are $longlongsize bytes long."
5612 echo "(I can't seem to compile the test program. Guessing...)"
5613 rp="What is the size of a long long (in bytes)?"
5617 if $test "X$longsize" = "X$longlongsize"; then
5618 echo "(That isn't any different from an ordinary long.)"
5624 : see if inttypes.h is available
5625 : we want a real compile instead of Inhdr because some systems
5626 : have an inttypes.h which includes non-existent headers
5629 #include <inttypes.h>
5631 static int32_t foo32 = 0x12345678;
5635 if eval $compile; then
5636 echo "<inttypes.h> found." >&4
5639 echo "<inttypes.h> NOT found." >&4
5648 echo "Checking to see if you have int64_t..." >&4
5650 #include <sys/types.h>
5651 #$i_inttypes I_INTTYPES
5653 #include <inttypes.h>
5655 int main() { int64_t x = 7; }
5658 if eval $compile; then
5660 echo "You have int64_t."
5663 echo "You do not have int64_t."
5669 : Check if 64bit ints have a quad type
5671 echo "Checking which 64-bit integer type we could use..." >&4
5677 val='"unsigned int"'
5682 *) case "$longsize" in
5686 val='"unsigned long"'
5691 *) case "$d_longlong:$longlongsize" in
5696 val='"unsigned long long"'
5701 *) case "$d_int64_t" in
5720 '') echo "Alas, no 64-bit integer types in sight." >&4
5723 *) echo "We could use '$quadtype' for 64-bit integers." >&4
5728 : Do we want 64bit support
5729 case "$uselonglong" in
5730 "$define"|true|[yY]*)
5733 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
5735 use64bitint="$define"
5738 case "$use64bits" in
5739 "$define"|true|[yY]*)
5742 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
5744 use64bitint="$define"
5747 case "$use64bitints" in
5748 "$define"|true|[yY]*)
5751 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
5753 use64bitint="$define"
5756 case "$use64bitsint" in
5757 "$define"|true|[yY]*)
5760 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
5762 use64bitint="$define"
5765 case "$uselonglongs" in
5766 "$define"|true|[yY]*)
5769 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
5771 use64bitint="$define"
5774 case "$use64bitsall" in
5775 "$define"|true|[yY]*)
5778 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
5780 use64bitall="$define"
5785 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
5787 case "$use64bitall" in
5788 "$define"|true|[yY]*) use64bitint="$define" ;;
5794 You have natively 64-bit long integers.
5798 *) case "$use64bitint" in
5799 "$define"|true|[yY]*) dflt='y';;
5808 Perl can be built to take advantage of 64-bit integer types
5809 on some systems. To do so, Configure can be run with -Duse64bitint.
5810 Choosing this option will most probably introduce binary incompatibilities.
5812 If this doesn't make any sense to you, just accept the default '$dflt'.
5813 (The default has been chosen based on your configuration.)
5815 rp='Try to use 64-bit integers, if available?'
5818 [yY]*) val="$define" ;;
5826 case "$use64bitall" in
5827 "$define"|true|[yY]*) dflt='y' ;;
5828 *) case "$longsize" in
5836 You may also choose to try maximal 64-bitness. It means using as much
5837 64-bitness as possible on the platform. This in turn means even more
5838 binary incompatibilities. On the other hand, your platform may not
5839 have any more 64-bitness available than what you already have chosen.
5841 If this doesn't make any sense to you, just accept the default '$dflt'.
5842 (The default has been chosen based on your configuration.)
5844 rp='Try to use maximal 64-bit support, if available?'
5847 [yY]*) val="$define" ;;
5852 case "$use64bitall" in
5854 case "$use64bitint" in
5858 Since you have chosen a maximally 64-bit build, I'm also turning on
5859 the use of 64-bit integers.
5861 use64bitint="$define" ;;
5866 : Look for a hint-file generated 'call-back-unit'. If the
5867 : user has specified that a 64-bit perl is to be built,
5868 : we may need to set or change some other defaults.
5869 if $test -f use64bitint.cbu; then
5870 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
5873 case "$use64bitint" in
5874 "$define"|true|[yY]*)
5876 4) case "$archname64" in
5877 '') archname64=64int ;;
5884 : Look for a hint-file generated 'call-back-unit'. If the
5885 : user has specified that a maximally 64-bit perl is to be built,
5886 : we may need to set or change some other defaults.
5887 if $test -f use64bitall.cbu; then
5888 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
5891 case "$use64bitall" in
5892 "$define"|true|[yY]*)
5894 4) case "$archname64" in
5895 ''|64int) archname64=64all ;;
5902 case "$d_quad:$use64bitint" in
5906 *** You have chosen to use 64-bit integers,
5907 *** but none can be found.
5908 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
5909 *** Cannot continue, aborting.
5916 : check for length of double
5918 case "$doublesize" in
5920 echo "Checking to see how big your double precision numbers are..." >&4
5929 printf("%d\n", (int)sizeof(double));
5934 if eval $compile_ok; then
5935 doublesize=`$run ./try`
5936 echo "Your double is $doublesize bytes long."
5939 echo "(I can't seem to compile the test program. Guessing...)"
5940 rp="What is the size of a double precision number (in bytes)?"
5948 : check for long doubles
5950 echo "Checking to see if you have long double..." >&4
5951 echo 'int main() { long double x = 7.0; }' > try.c
5953 if eval $compile; then
5955 echo "You have long double."
5958 echo "You do not have long double."
5964 : check for length of long double
5965 case "${d_longdbl}${longdblsize}" in
5968 echo "Checking to see how big your long doubles are..." >&4
5969 $cat >try.c <<'EOCP'
5973 printf("%d\n", sizeof(long double));
5978 if eval $compile; then
5979 longdblsize=`$run ./try`
5980 echo "Your long doubles are $longdblsize bytes long."
5984 echo "(I can't seem to compile the test program. Guessing...)" >&4
5985 rp="What is the size of a long double (in bytes)?"
5989 if $test "X$doublesize" = "X$longdblsize"; then
5990 echo "That isn't any different from an ordinary double."
5991 echo "I'll keep your setting anyway, but you may see some"
5992 echo "harmless compilation warnings."
5998 : determine the architecture name
6000 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
6001 tarch=`arch`"-$osname"
6002 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
6003 if uname -m > tmparch 2>&1 ; then
6004 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
6005 -e 's/$/'"-$osname/" tmparch`
6013 case "$myarchname" in
6016 echo "(Your architecture name used to be $myarchname.)"
6020 case "$targetarch" in
6022 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
6027 *) dflt="$archname";;
6029 rp='What is your architecture name'
6032 case "$usethreads" in
6034 echo "Threads selected." >&4
6036 *-thread*) echo "...and architecture name already has -thread." >&4
6038 *) archname="$archname-thread"
6039 echo "...setting architecture name to $archname." >&4
6044 case "$usemultiplicity" in
6046 echo "Multiplicity selected." >&4
6048 *-multi*) echo "...and architecture name already has -multi." >&4
6050 *) archname="$archname-multi"
6051 echo "...setting architecture name to $archname." >&4
6056 case "$use64bitint$use64bitall" in
6058 case "$archname64" in
6060 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
6063 case "$use64bitint" in
6064 "$define") echo "64 bit integers selected." >&4 ;;
6066 case "$use64bitall" in
6067 "$define") echo "Maximal 64 bitness selected." >&4 ;;
6070 *-$archname64*) echo "...and architecture name already has $archname64." >&4
6072 *) archname="$archname-$archname64"
6073 echo "...setting architecture name to $archname." >&4
6079 case "$uselongdouble" in
6081 echo "Long doubles selected." >&4
6082 case "$longdblsize" in
6084 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
6088 *-ld*) echo "...and architecture name already has -ld." >&4
6090 *) archname="$archname-ld"
6091 echo "...setting architecture name to $archname." >&4
6098 case "$useperlio" in
6100 echo "Perlio selected." >&4
6103 echo "Perlio not selected, using stdio." >&4
6105 *-stdio*) echo "...and architecture name already has -stdio." >&4
6107 *) archname="$archname-stdio"
6108 echo "...setting architecture name to $archname." >&4
6113 if $test -f archname.cbu; then
6114 echo "Your platform has some specific hints for architecture name, using them..."
6118 : set the prefixit variable, to compute a suitable default value
6119 prefixit='case "$3" in
6121 case "$oldprefix" in
6122 "") eval "$1=\"\$$2\"";;
6129 ""|" ") eval "$1=\"\$$2\"";;
6135 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
6137 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
6138 /*-$oldprefix/*|\~*-$oldprefix/*)
6139 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
6140 *) eval "$1=\"\$$2\"";;
6144 : determine installation style
6145 : For now, try to deduce it from prefix unless it is already set.
6146 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
6147 case "$installstyle" in
6148 '') case "$prefix" in
6149 *perl*) dflt='lib';;
6150 *) dflt='lib/perl5' ;;
6153 *) dflt="$installstyle" ;;
6155 : Probably not worth prompting for this since we prompt for all
6156 : the directories individually, and the prompt would be too long and
6160 : determine where public executables go
6165 rp='Pathname where the public executables will reside?'
6167 if $test "X$ansexp" != "X$binexp"; then
6171 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
6172 : XXX If this is fixed, also fix the "start perl" hunk below, which relies on
6173 : this via initialinstalllocation
6176 case "$userelocatableinc" in
6177 $define|true|[yY]*) dflt='y' ;;
6182 Would you like to build Perl so that the installation is relocatable, so that
6183 library paths in @INC are determined relative to the path of the perl binary?
6184 This is not advised for system Perl installs, or if you need to run setid
6185 scripts or scripts under taint mode.
6187 If this doesn't make any sense to you, just accept the default '$dflt'.
6189 rp='Use relocatable @INC?'
6192 y|Y) val="$define" ;;
6195 set userelocatableinc
6198 initialinstalllocation="$binexp"
6199 : Default prefix is now "up one level from where the binaries are"
6200 case "$userelocatableinc" in
6206 installprefixexp=".../.."
6210 : determine where private library files go
6211 : Usual default is /usr/local/lib/perl5/$version.
6212 : Also allow things like /opt/perl/lib/$version, since
6213 : /opt/perl/lib/perl5... would be redundant.
6214 : The default "style" setting is made in installstyle.U
6215 case "$installstyle" in
6216 *lib/perl5*) set dflt privlib lib/$package/$version ;;
6217 *) set dflt privlib lib/$version ;;
6222 There are some auxiliary files for $package that need to be put into a
6223 private library directory that is accessible by everyone.
6228 rp='Pathname where the private library files will reside?'
6233 : set the prefixup variable, to restore leading tilda escape
6234 prefixup='case "$prefixexp" in
6236 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
6239 : determine where public architecture dependent libraries go
6242 : privlib default is /usr/local/lib/$package/$version
6243 : archlib default is /usr/local/lib/$package/$version/$archname
6244 : privlib may have an optional trailing /share.
6245 tdflt=`echo $privlib | $sed 's,/share$,,'`
6246 tdflt=$tdflt/$archname
6255 $spackage contains architecture-dependent library files. If you are
6256 sharing libraries in a heterogeneous environment, you might store
6257 these files in a separate location. Otherwise, you can just include
6258 them with the rest of the public library files.
6263 rp='Where do you want to put the public architecture-dependent libraries?'
6267 if $test X"$archlib" = X"$privlib"; then
6273 : see if setuid scripts can be secure
6276 Some kernels have a bug that prevents setuid #! scripts from being
6277 secure. Some sites have disabled setuid #! scripts because of this.
6279 First let's decide if your kernel supports secure setuid #! scripts.
6280 (If setuid #! scripts would be secure but have been disabled anyway,
6281 don't say that they are secure if asked.)
6286 if $test -d /dev/fd; then
6287 echo "#!$ls" >reflect
6288 chmod +x,u+s reflect
6289 ./reflect >flect 2>&1
6290 if $contains "/dev/fd" flect >/dev/null; then
6291 echo "Congratulations, your kernel has secure setuid scripts!" >&4
6295 If you are not sure if they are secure, I can check but I'll need a
6296 username and password different from the one you are using right now.
6297 If you don't have such a username or don't want me to test, simply
6301 rp='Other username to test security of setuid scripts with?'
6306 case "$d_suidsafe" in
6307 '') echo "I'll assume setuid scripts are *not* secure." >&4
6310 echo "Well, the $hint value is *not* secure." >&4
6312 *) echo "Well, the $hint value *is* secure." >&4
6317 $rm -f reflect flect
6318 echo "#!$ls" >reflect
6319 chmod +x,u+s reflect
6322 echo '"su" will (probably) prompt you for '"$ans's password."
6323 su $ans -c './reflect >flect'
6324 if $contains "/dev/fd" flect >/dev/null; then
6325 echo "Okay, it looks like setuid scripts are secure." >&4
6328 echo "I don't think setuid scripts are secure." >&4
6333 rp='Does your kernel have *secure* setuid scripts?'
6336 [yY]*) val="$define";;
6341 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
6342 echo "(That's for file descriptors, not floppy disks.)"
6348 $rm -f reflect flect
6350 : now see if they want to do setuid emulation
6353 case "$d_suidsafe" in
6356 echo "No need to emulate SUID scripts since they are secure here." >&4
6360 Some systems have disabled setuid scripts, especially systems where
6361 setuid scripts cannot be secure. On systems where setuid scripts have
6362 been disabled, the setuid/setgid bits on scripts are currently
6363 useless. It is possible for $package to detect those bits and emulate
6364 setuid/setgid in a secure fashion. This emulation will only work if
6365 setuid scripts have been disabled in your kernel.
6369 "$define") dflt=y ;;
6372 rp="Do you want to do setuid/setgid emulation?"
6375 [yY]*) val="$define";;
6383 : Find perl5.005 or later.
6384 echo "Looking for a previously installed perl5.005 or later... "
6386 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
6387 : Check if this perl is recent and can load a simple module
6388 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6391 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6401 '') echo "None found. That's ok.";;
6402 *) echo "Using $perl5." ;;
6405 : Set the siteprefix variables
6408 After $package is installed, you may wish to install various
6409 add-on modules and utilities. Typically, these add-ons will
6410 be installed under $prefix with the rest
6411 of this package. However, you may wish to install such add-ons
6412 elsewhere under a different prefix.
6414 If you do not wish to put everything under a single prefix, that's
6415 ok. You will be prompted for the individual locations; this siteprefix
6416 is only used to suggest the defaults.
6418 The default should be fine for most people.
6422 rp='Installation prefix to use for add-on modules and utilities?'
6423 : XXX Here might be another good place for an installstyle setting.
6424 case "$siteprefix" in
6426 *) dflt=$siteprefix ;;
6429 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6431 case "$siteprefix" in
6435 *) oldsiteprefix="$prefix";;
6440 siteprefixexp="$ansexp"
6442 : determine where site specific libraries go.
6443 : Usual default is /usr/local/lib/perl5/site_perl/$version
6444 : The default "style" setting is made in installstyle.U
6445 : XXX No longer works with Prefixit stuff.
6446 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6448 '') case "$installstyle" in
6449 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
6450 *) dflt=$siteprefix/lib/site_$prog/$version ;;
6458 The installation process will create a directory for
6459 site-specific extensions and modules. Most users find it convenient
6460 to place all site-specific files in this directory rather than in the
6461 main distribution directory.
6465 rp='Pathname for the site-specific library files?'
6469 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6471 : Determine list of previous versions to include in @INC
6472 $cat > getverlist <<EOPL
6475 \$api_versionstring = "$api_versionstring";
6476 \$version = "$version";
6477 \$stem = "$sitelib_stem";
6478 \$archname = "$archname";
6480 $cat >> getverlist <<'EOPL'
6481 # The list found is store twice for each entry: the original name, and
6482 # the binary broken down version as pack "sss", so sorting is easy and
6483 # unambiguous. This will work for all versions that have a maximum of
6484 # three digit groups, separate by '.'s or '_'s. Names are extended with
6485 # ".0.0" to ensure at least three elements for the pack.
6486 # -- H.Merijn Brand (m)'06 23-10-2006
6488 # Can't have leading @ because metaconfig interprets it as a command!
6489 ;@inc_version_list=();
6490 # XXX Redo to do opendir/readdir?
6493 ;@candidates = map {
6494 [ $_, pack "sss", split m/[._]/, "$_.0.0" ] } glob("5.*");
6500 ($pversion, $aversion, $vsn5005) = map {
6501 pack "sss", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005";
6502 foreach $d (@candidates) {
6503 if ($d->[1] lt $pversion) {
6504 if ($d->[1] ge $aversion) {
6505 unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]);
6507 elsif ($d->[1] ge $vsn5005) {
6508 unshift(@inc_version_list, grep { -d } $d->[0]);
6512 # Skip newer version. I.e. don't look in
6513 # 5.7.0 if we're installing 5.6.1.
6517 if (@inc_version_list) {
6518 print join(' ', @inc_version_list);
6521 # Blank space to preserve value for next Configure run.
6526 case "$inc_version_list" in
6527 '') if test -x "$perl5$exe_ext"; then
6528 dflt=`$perl5 getverlist`
6533 $undef) dflt='none' ;;
6534 *) eval dflt=\"$inc_version_list\" ;;
6537 ''|' ') dflt=none ;;
6544 In order to ease the process of upgrading, this version of perl
6545 can be configured to use modules built and installed with earlier
6546 versions of perl that were installed under $prefix. Specify here
6547 the list of earlier versions that this version of perl should check.
6548 If Configure detected no earlier versions of perl installed under
6549 $prefix, then the list will be empty. Answer 'none' to tell perl
6550 to not search earlier versions.
6552 The default should almost always be sensible, so if you're not sure,
6553 just accept the default.
6556 rp='List of earlier versions to include in @INC?'
6559 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
6560 *) inc_version_list="$ans" ;;
6562 case "$inc_version_list" in
6564 inc_version_list_init='0'
6565 d_inc_version_list="$undef"
6567 *) inc_version_list_init=`echo $inc_version_list |
6568 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
6569 d_inc_version_list="$define"
6574 : see if malloc/malloc.h has to be included
6575 set malloc/malloc.h i_mallocmalloc
6578 : see if this is a malloc.h system
6579 : we want a real compile instead of Inhdr because some systems have a
6580 : malloc.h that just gives a compile error saying to use stdlib.h instead
6585 #$i_mallocmalloc I_MALLOCMALLOC
6586 #ifdef I_MALLOCMALLOC
6587 # include <malloc/malloc.h>
6590 int main () { return 0; }
6593 if eval $compile; then
6594 echo "<malloc.h> found." >&4
6597 echo "<malloc.h> NOT found." >&4
6604 : check for void type
6606 echo "Checking to see how well your C compiler groks the void type..." >&4
6607 case "$voidflags" in
6619 extern void moo(); /* function returning void */
6620 void (*goo)(); /* ptr to func returning void */
6622 void *hue; /* generic ptr */
6635 int main() { sub(); }
6637 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
6638 voidflags=$defvoidused
6639 echo "Good. It appears to support void to the level $package wants.">&4
6640 if $contains warning .out >/dev/null 2>&1; then
6641 echo "However, you might get some warnings that look like this:"
6645 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
6646 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
6647 echo "It supports 1..."
6648 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
6649 echo "It also supports 2..."
6650 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
6652 echo "And it supports 4 but not 8 definitely."
6654 echo "It doesn't support 4..."
6655 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
6657 echo "But it supports 8."
6660 echo "Neither does it support 8."
6664 echo "It does not support 2..."
6665 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
6667 echo "But it supports 4 and 8."
6669 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
6671 echo "And it supports 4 but has not heard about 8."
6673 echo "However it supports 8 but not 4."
6678 echo "There is no support at all for void."
6683 case "$voidflags" in
6686 Support flag bits are:
6687 1: basic void declarations.
6688 2: arrays of pointers to functions returning void.
6689 4: operations between pointers to and addresses of void functions.
6690 8: generic void pointers.
6693 rp="Your void support flags add up to what?"
6700 : check for length of pointer
6704 echo "Checking to see how big your pointers are..." >&4
6705 if test "$voidflags" -gt 7; then
6706 echo '#define VOID_PTR char *' > try.c
6708 echo '#define VOID_PTR void *' > try.c
6718 printf("%d\n", (int)sizeof(VOID_PTR));
6723 if eval $compile_ok; then
6724 ptrsize=`$run ./try`
6725 echo "Your pointers are $ptrsize bytes long."
6728 echo "(I can't seem to compile the test program. Guessing...)" >&4
6729 rp="What is the size of a pointer (in bytes)?"
6736 case "$use64bitall" in
6737 "$define"|true|[yY]*)
6741 *** You have chosen a maximally 64-bit build,
6742 *** but your pointers are only 4 bytes wide.
6743 *** Please rerun Configure without -Duse64bitall.
6748 *** Since you have quads, you could possibly try with -Duse64bitint.
6753 *** Cannot continue, aborting.
6764 : determine whether to use malloc wrapping
6766 case "$usemallocwrap" in
6767 [yY]*|true|$define) dflt='y' ;;
6768 [nN]*|false|$undef) dflt='n' ;;
6769 *) case "$usedevel" in
6770 [yY]*|true|$define) dflt='y' ;;
6775 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
6777 usemallocwrap="$ans"
6780 usemallocwrap="$define" ;;
6782 usemallocwrap="$undef" ;;
6785 : determine which malloc to compile in
6787 case "$usemymalloc" in
6788 [yY]*|true|$define) dflt='y' ;;
6789 [nN]*|false|$undef) dflt='n' ;;
6790 *) case "$ptrsize" in
6796 rp="Do you wish to attempt to use the malloc that comes with $package?"
6802 mallocsrc='malloc.c'
6803 mallocobj="malloc$_o"
6804 d_mymalloc="$define"
6807 : Remove malloc from list of libraries to use
6808 echo "Removing unneeded -lmalloc from library list" >&4
6809 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
6812 echo "libs = $libs" >&4
6824 : compute the return types of malloc and free
6826 $cat >malloc.c <<END
6830 #include <sys/types.h>
6844 case "$malloctype" in
6846 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
6853 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
6857 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
6864 echo "Your system uses $freetype free(), it would seem." >&4
6866 : determine where site specific architecture-dependent libraries go.
6867 : sitelib default is /usr/local/lib/perl5/site_perl/$version
6868 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6869 : sitelib may have an optional trailing /share.
6871 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
6872 dflt="$dflt/$archname"
6877 set sitearch sitearch none
6881 The installation process will also create a directory for
6882 architecture-dependent site-specific extensions and modules.
6886 rp='Pathname for the site-specific architecture-dependent library files?'
6890 if $test X"$sitearch" = X"$sitelib"; then
6893 d_sitearch="$define"
6896 : Set the vendorprefix variables
6899 The installation process will also create a directory for
6900 vendor-supplied add-ons. Vendors who supply perl with their system
6901 may find it convenient to place all vendor-supplied files in this
6902 directory rather than in the main distribution directory. This will
6903 ease upgrades between binary-compatible maintenance versions of perl.
6905 Of course you may also use these directories in whatever way you see
6906 fit. For example, you might use them to access modules shared over a
6907 company-wide network.
6909 The default answer should be fine for most people.
6910 This causes further questions about vendor add-ons to be skipped
6911 and no vendor-specific directories will be configured for perl.
6914 rp='Do you want to configure vendor-specific add-on directories?'
6915 case "$usevendorprefix" in
6916 define|true|[yY]*) dflt=y ;;
6917 *) : User may have set vendorprefix directly on Configure command line.
6918 case "$vendorprefix" in
6927 rp='Installation prefix to use for vendor-supplied add-ons?'
6928 case "$vendorprefix" in
6930 *) dflt=$vendorprefix ;;
6933 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6935 case "$vendorprefix" in
6939 *) oldvendorprefix="$prefix";;
6943 usevendorprefix="$define"
6945 vendorprefixexp="$ansexp"
6947 *) usevendorprefix="$undef"
6953 : Set the vendorlib variables
6954 case "$vendorprefix" in
6955 '') d_vendorlib="$undef"
6959 *) d_vendorlib="$define"
6960 : determine where vendor-supplied modules go.
6961 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
6962 case "$vendorlib" in
6964 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6965 case "$installstyle" in
6966 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
6967 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
6970 *) dflt="$vendorlib"
6974 rp='Pathname for the vendor-supplied library files?'
6977 vendorlibexp="$ansexp"
6980 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
6984 : Set the vendorarch variables
6985 case "$vendorprefix" in
6986 '') d_vendorarch="$undef"
6990 *) d_vendorarch="$define"
6991 : determine where vendor-supplied architecture-dependent libraries go.
6992 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
6993 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
6994 : vendorlib may have an optional trailing /share.
6995 case "$vendorarch" in
6996 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
6997 dflt="$dflt/$archname"
6999 *) dflt="$vendorarch" ;;
7002 rp='Pathname for vendor-supplied architecture-dependent files?'
7005 vendorarchexp="$ansexp"
7008 prefixvar=vendorarch
7011 : Final catch-all directories to search
7014 Lastly, you can have perl look in other directories for extensions and
7015 modules in addition to those already specified.
7016 These directories will be searched after
7020 test X"$vendorlib" != "X" && echo ' ' $vendorlib
7021 test X"$vendorarch" != "X" && echo ' ' $vendorarch
7023 case "$otherlibdirs" in
7024 ''|' ') dflt='none' ;;
7025 *) dflt="$otherlibdirs" ;;
7028 Enter a colon-separated set of extra paths to include in perl's @INC
7029 search path, or enter 'none' for no extra paths.
7033 rp='Colon-separated list of additional directories for perl to search?'
7036 ' '|''|none) otherlibdirs=' ' ;;
7037 *) otherlibdirs="$ans" ;;
7039 case "$otherlibdirs" in
7043 set d_perl_otherlibdirs
7046 : Cruising for prototypes
7048 echo "Checking out function prototypes..." >&4
7049 $cat >prototype.c <<EOCP
7054 int main(int argc, char *argv[]) {
7057 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
7058 echo "Your C compiler appears to support function prototypes."
7061 echo "Your C compiler doesn't seem to understand function prototypes."
7068 : Check if ansi2knr is required
7069 case "$prototype" in
7071 *) ansi2knr='ansi2knr'
7076 This version of $package can only be compiled by a compiler that
7077 understands function prototypes. Unfortunately, your C compiler
7079 doesn't seem to understand them. Sorry about that.
7081 If GNU cc is available for your system, perhaps you could try that instead.
7083 Eventually, we hope to support building Perl with pre-ANSI compilers.
7084 If you would like to help in that effort, please contact <perlbug@perl.org>.
7086 Aborting Configure now.
7093 dflt_dtrace='/usr/sbin/dtrace'
7096 Perl can be built to support DTrace on platforms that support it.
7097 DTrace is a diagnosis and performance analysis tool from Sun.
7099 If this doesn't make any sense to you, just accept the default '$dflt'.
7103 case "$usedtrace" in
7109 dflt_dtrace=$usedtrace
7116 rp='Support DTrace if available?'
7119 y|Y) val="$define" ;;
7125 test "X$usedtrace" != "X$define" && break
7128 rp='Where is the dtrace executable?'
7137 if $dtrace -h -s ../perldtrace.d \
7138 -o perldtrace.tmp >/dev/null 2>&1 \
7139 && rm -f perldtrace.tmp
7142 echo "Good: your $dtrace knows about the -h flag."
7146 *** $me: Fatal Error: $dtrace doesn't support -h flag
7148 *** Your installed dtrace doesn't support the -h switch to compile a D
7149 *** program into a C header. Can't continue.
7161 *** $me: Fatal Error: $dtrace not found.
7168 echo "*** $dtrace was not found."
7174 : See if we want extra modules installed
7181 Perl can be built with extra modules or bundles of modules which
7182 will be fetched from the CPAN and installed alongside Perl.
7184 Notice that you will need access to the CPAN; either via the Internet,
7185 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
7186 be asked later to configure the CPAN.pm module which will in turn do
7187 the installation of the rest of the extra modules or bundles.)
7189 Notice also that if the modules require any external software such as
7190 libraries and headers (the libz library and the zlib.h header for the
7191 Compress::Zlib module, for example) you MUST have any such software
7192 already installed, this configuration process will NOT install such
7195 If this doesn't make any sense to you, just accept the default '$dflt'.
7197 rp='Install any extra modules (y or n)?'
7203 Please list any extra modules or bundles to be installed from CPAN,
7204 with spaces between the names. The names can be in any format the
7205 'install' command of CPAN.pm will understand. (Answer 'none',
7206 without the quotes, to install no extra modules or bundles.)
7216 $rm -f ../extras.lst
7218 *) echo "(Saving the list of extras for later...)"
7219 echo "$extras" > ../extras.lst
7227 : determine where html pages for programs go
7228 set html1dir html1dir none
7232 If you wish to install html files for programs in $spackage, indicate
7233 the appropriate directory here. To skip installing html files,
7237 ''|none|$undef|' ') dflt=none ;;
7238 *) dflt=$html1dir ;;
7241 rp="Directory for the main $spackage html pages?"
7245 : Use ' ' for none so value is preserved next time through Configure
7246 $test X"$html1dir" = "X" && html1dir=' '
7248 : determine where html pages for libraries and modules go
7249 set html3dir html3dir none
7253 If you wish to install html files for modules associated with $spackage,
7254 indicate the appropriate directory here. To skip installing html files,
7257 : There is no obvious default. If they have specified html1dir, then
7258 : try to key off that, possibly changing .../html1 into .../html3.
7260 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
7261 *) dflt=$html3dir ;;
7264 rp="Directory for the $spackage module html pages?"
7268 : Use ' ' for none so value is preserved next time through Configure
7269 $test X"$html3dir" = "X" && html3dir=' '
7271 : determine whether to install perl also as /usr/bin/perl
7274 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
7276 Many scripts expect perl to be installed as /usr/bin/perl.
7278 If you want to, I can install the perl you are about to compile
7279 as /usr/bin/perl (in addition to $bin/perl).
7281 if test -f /usr/bin/perl; then
7284 However, please note that because you already have a /usr/bin/perl,
7285 overwriting that with a new Perl would very probably cause problems.
7286 Therefore I'm assuming you don't want to do that (unless you insist).
7289 case "$installusrbinperl" in
7290 "$define"|[yY]*) dflt='y';;
7296 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
7299 case "$installusrbinperl" in
7300 "$undef"|[nN]*) dflt='n';;
7304 rp="Do you want to install perl as /usr/bin/perl?"
7307 [yY]*) val="$define";;
7313 set installusrbinperl
7316 : Check if we are using the GNU C library
7318 echo "Checking for GNU C Library..." >&4
7320 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
7321 alone are insufficient to distinguish different versions, such as
7322 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
7323 libc version 2.1.0. A. Dougherty, June 3, 2002.
7329 # ifdef __GLIBC_MINOR__
7330 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus)
7331 # include <gnu/libc-version.h>
7332 printf("%s\n", gnu_get_libc_version());
7334 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
7337 printf("%d\n", __GLIBC__);
7346 if eval $compile_ok && $run ./try > glibc.ver; then
7348 gnulibc_version=`$cat glibc.ver`
7349 echo "You are using the GNU C Library version $gnulibc_version"
7353 echo "You are not using the GNU C Library"
7359 : see if nm is to be used to determine whether a symbol is defined or not
7363 case "$d_gnulibc" in
7366 echo "nm probably won't work on the GNU C Library." >&4
7372 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
7374 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
7375 echo "'nm' won't be sufficient on this sytem." >&4
7381 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
7382 if $test $dflt -gt 20; then
7392 true|$define) dflt=y;;
7399 I can use $nm to extract the symbols from your C libraries. This
7400 is a time consuming task which may generate huge output on the disk (up
7401 to 3 megabytes) but that should make the symbols extraction faster. The
7402 alternative is to skip the 'nm' extraction part and to compile a small
7403 test program instead to determine whether each symbol is present. If
7404 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
7405 this may be the best solution.
7407 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
7410 rp="Shall I use $nm to extract C symbols from the libraries?"
7413 [Nn]*) usenm=false;;
7422 : nm options which may be necessary
7424 '') if $test -f /mach_boot; then
7426 elif $test -d /usr/ccs/lib; then
7427 nm_opt='-p' # Solaris (and SunOS?)
7428 elif $test -f /dgux; then
7430 elif $test -f /lib64/rld; then
7431 nm_opt='-p' # 64-bit Irix
7437 : nm options which may be necessary for shared libraries but illegal
7438 : for archive libraries. Thank you, Linux.
7439 case "$nm_so_opt" in
7440 '') case "$myuname" in
7442 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
7443 nm_so_opt='--dynamic'
7450 : Figure out where the libc is located
7453 : get list of predefined functions in a handy place
7458 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
7464 *) for thislib in $libs; do
7467 : Handle C library specially below.
7470 thislib=`echo $thislib | $sed -e 's/^-l//'`
7471 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
7473 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
7475 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
7477 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
7479 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
7481 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
7483 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
7488 libnames="$libnames $try"
7490 *) libnames="$libnames $thislib" ;;
7499 for xxx in $libpth; do
7500 $test -r $1 || set $xxx/libc.$so
7501 : The messy sed command sorts on library version numbers.
7503 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
7504 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
7506 s/[0-9][0-9]*/0000&/g
7507 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
7510 $sort | $sed -e 's/^.* //'`
7513 $test -r $1 || set /usr/ccs/lib/libc.$so
7514 $test -r $1 || set /lib/libsys_s$_a
7520 if $test -r "$1"; then
7521 echo "Your (shared) C library seems to be in $1."
7523 elif $test -r /lib/libc && $test -r /lib/clib; then
7524 echo "Your C library seems to be in both /lib/clib and /lib/libc."
7526 libc='/lib/clib /lib/libc'
7527 if $test -r /lib/syslib; then
7528 echo "(Your math library is in /lib/syslib.)"
7529 libc="$libc /lib/syslib"
7531 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7532 echo "Your C library seems to be in $libc, as you said before."
7533 elif $test -r $incpath/usr/lib/libc$_a; then
7534 libc=$incpath/usr/lib/libc$_a;
7535 echo "Your C library seems to be in $libc. That's fine."
7536 elif $test -r /lib/libc$_a; then
7538 echo "Your C library seems to be in $libc. You're normal."
7540 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
7542 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
7543 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
7544 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
7546 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7548 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7551 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
7553 if $test -r "$tans"; then
7554 echo "Your C library seems to be in $tans, of all places."
7560 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7564 If the guess above is wrong (which it might be if you're using a strange
7565 compiler, or your machine supports multiple models), you can override it here.
7570 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
7572 I can't seem to find your C library. I've looked in the following places:
7575 $sed 's/^/ /' libpath
7578 None of these seems to contain your C library. I need to get its name...
7583 rp='Where is your C library?'
7588 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
7589 set X `cat libnames`
7592 case $# in 1) xxx=file; esac
7593 echo "Extracting names from the following $xxx for later perusal:" >&4
7595 $sed 's/^/ /' libnames >&4
7597 $echo $n "This may take a while...$c" >&4
7601 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
7602 *) $nm $nm_opt $file 2>/dev/null;;
7607 $grep fprintf libc.tmp > libc.ptf
7608 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
7609 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
7611 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
7613 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7615 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
7617 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7619 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
7621 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7623 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
7625 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7627 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
7629 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7631 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
7633 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7635 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
7636 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
7638 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7640 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
7642 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7644 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
7646 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7648 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
7650 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7652 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
7654 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7656 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
7658 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7660 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
7662 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7664 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
7666 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7669 $nm -p $* 2>/dev/null >libc.tmp
7670 $grep fprintf libc.tmp > libc.ptf
7671 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
7672 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
7678 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
7680 if $ar t $libc > libc.tmp && \
7681 $contains '^fprintf$' libc.tmp >/dev/null 2>&1
7683 for thisname in $libnames $libc; do
7684 $ar t $thisname >>libc.tmp
7686 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
7688 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
7689 for thisname in $libnames $libc; do
7690 $ar tv $thisname >>libc.tmp
7691 emximp -o tmp.imp $thisname \
7693 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
7694 < tmp.imp >>libc.tmp
7697 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
7700 echo "$ar didn't seem to work right." >&4
7701 echo "Maybe this is a Cray...trying bld instead..." >&4
7703 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list &&
7706 for thisname in $libnames; do
7708 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
7709 $ar t $thisname >>libc.tmp
7713 echo "That didn't work either. Giving up." >&4
7723 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
7724 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
7726 *) if $test -f /lib/syscalls.exp; then
7728 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
7729 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' \
7730 /lib/syscalls.exp >>libc.list
7736 $rm -f libnames libpath
7738 : see if dld is available
7742 : Check if we are using C++
7744 echo "Checking for C++..." >&4
7745 $cat >try.c <<'EOCP'
7757 if eval $compile_ok && $run ./try; then
7759 echo "You are using a C++ compiler."
7762 echo "You are not using a C++ compiler."
7768 : is a C symbol defined?
7771 -v) tf=libc.tmp; tdc="";;
7772 -a) tf=libc.tmp; tdc="[]";;
7773 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
7776 case "$reuseval-$4" in
7778 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
7783 case "$d_cplusplus" in
7784 $define) extern_C=\"C\";;
7786 if $test "$runnm" = true; then
7787 if $contains $tlook $tf >/dev/null 2>&1; then
7789 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
7790 echo "extern $extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7791 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
7792 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
7796 echo "extern $extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7797 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
7803 $define) tval=true;;
7810 : define an is-in-libc? function
7811 inlibc='echo " "; td=$define; tu=$undef;
7812 sym=$1; var=$2; eval "was=\$$2";
7814 case "$reuseval$was" in
7824 echo "$sym() found." >&4;
7825 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
7827 echo "$sym() NOT found." >&4;
7828 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
7832 $define) echo "$sym() found." >&4;;
7833 *) echo "$sym() NOT found." >&4;;
7837 : see if dlopen exists
7839 xxx_ccflags="$ccflags"
7841 : with g++ one needs -shared to get is-in-libc to work for dlopen
7842 case "$gccversion" in
7844 *) case "$d_cplusplus" in
7845 "$define") ccflags="$ccflags -shared" ;;
7852 ccflags="$xxx_ccflags"
7854 : see if this is a unistd.h system
7855 set unistd.h i_unistd
7858 : determine which dynamic loading, if any, to compile in
7860 dldir="ext/DynaLoader"
7873 $define) dflt='y' ;;
7876 $define) dflt='y' ;;
7878 : Does a dl_xxx.xs file exist for this operating system
7879 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
7882 rp="Do you wish to use dynamic loading?"
7889 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
7890 dflt="$dldir/dl_${osname}.xs"
7891 elif $test "$d_dlopen" = "$define" ; then
7892 dflt="$dldir/dl_dlopen.xs"
7893 elif $test "$i_dld" = "$define" ; then
7894 dflt="$dldir/dl_dld.xs"
7899 *) dflt="$dldir/$dlsrc"
7902 echo "The following dynamic loading files are available:"
7903 : Can not go over to $dldir because getfile has path hard-coded in.
7904 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
7905 rp="Source file to use for dynamic loading"
7911 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
7915 Some systems may require passing special flags to $cc -c to
7916 compile modules that will be used to create a shared library.
7917 To use no flags, say "none".
7920 case "$cccdlflags" in
7921 '') case "$gccversion" in
7922 '') case "$osname" in
7924 next) dflt='none' ;;
7925 irix*) dflt='-KPIC' ;;
7926 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
7927 sunos) dflt='-pic' ;;
7931 *) case "$osname" in
7932 darwin) dflt='none' ;;
7933 linux*|svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
7938 *) dflt="$cccdlflags" ;;
7940 rp="Any special flags to pass to $cc -c to compile shared library modules?"
7943 none) cccdlflags=' ' ;;
7944 *) cccdlflags="$ans" ;;
7949 Some systems use ld to create libraries that can be dynamically loaded,
7950 while other systems (such as those using ELF) use $cc.
7954 '') $cat >try.c <<EOM
7955 /* Test for whether ELF binaries are produced */
7967 int i = open("a.out",O_RDONLY);
7970 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
7971 exit(0); /* succeed (yes, it's ELF) */
7976 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
7978 You appear to have ELF support. I'll use $cc to build dynamic libraries.
7982 echo "I'll use ld to build dynamic libraries."
7991 rp="What command should be used to create dynamic libraries?"
7997 Some systems may require passing special flags to $ld to create a
7998 library that can be dynamically loaded. If your ld flags include
7999 -L/other/path options to locate libraries outside your loader's normal
8000 search path, you may need to specify those -L options here as well. To
8001 use no flags, say "none".
8004 case "$lddlflags" in
8005 '') case "$osname" in
8006 beos) dflt='-nostart' ;;
8008 case "$gccversion" in
8009 '') dflt="$dflt +vnocompatwarnings" ;;
8012 linux|irix*|gnu*) dflt="-shared $optimize" ;;
8013 next) dflt='none' ;;
8014 solaris) dflt='-G' ;;
8015 sunos) dflt='-assert nodefinitions' ;;
8016 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
8020 *) dflt="$lddlflags" ;;
8023 : Try to guess additional flags to pick up local libraries.
8024 : Be careful not to append to a plain 'none'
8028 for thisflag in $ldflags; do
8033 *) dflt="$dflt $thisflag" ;;
8040 ''|' ') dflt='none' ;;
8044 *-fstack-protector*)
8046 *-fstack-protector*) ;; # Don't add it again
8047 *) dflt="$dflt -fstack-protector" ;;
8053 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
8056 none) lddlflags=' ' ;;
8057 *) lddlflags="$ans" ;;
8062 Some systems may require passing special flags to $cc to indicate that
8063 the resulting executable will use dynamic linking. To use no flags,
8067 case "$ccdlflags" in
8068 '') case "$osname" in
8069 linux|hpux|gnu*) dflt='-Wl,-E' ;;
8070 next|sunos) dflt='none' ;;
8074 *) dflt="$ccdlflags" ;;
8076 rp="Any special flags to pass to $cc to use dynamic linking?"
8079 none) ccdlflags=' ' ;;
8080 *) ccdlflags="$ans" ;;
8091 : Do we want a shared libperl?
8095 # No dynamic loading being used, so don't bother even to prompt.
8098 *) case "$useshrplib" in
8099 '') case "$osname" in
8100 svr4*|nonstopux|dgux|dynixptx|esix|powerux|beos|cygwin*)
8102 also='Building a shared libperl is required for dynamic loading to work on your system.'
8107 also='Building a shared libperl is needed for MAB support.'
8125 The perl executable is normally obtained by linking perlmain.c with
8126 libperl${_a}, any static extensions (usually just DynaLoader), and
8127 any other libraries needed on this system (such as -lm, etc.). Since
8128 your system supports dynamic loading, it is probably possible to build
8129 a shared libperl.$so. If you will have more than one executable linked
8130 to libperl.$so, this will significantly reduce the size of each
8131 executable, but it may have a noticeable effect on performance. The
8132 default is probably sensible for your system.
8136 rp="Build a shared libperl.$so (y/n)"
8140 useshrplib='true' ;;
8141 *) useshrplib='false' ;;
8146 case "$useshrplib" in
8150 # Figure out a good name for libperl.so. Since it gets stored in
8151 # a version-specific architecture-dependent library, the version
8152 # number isn't really that important, except for making cc/ld happy.
8154 # A name such as libperl.so.3.1
8155 majmin="libperl.$so.$patchlevel.$subversion"
8156 # A name such as libperl.so.301
8157 majonly=`echo $patchlevel $subversion |
8158 $awk '{printf "%d%02d", $1, $2}'`
8159 majonly=libperl.$so.$majonly
8160 # I'd prefer to keep the os-specific stuff here to a minimum, and
8161 # rely on figuring it out from the naming of libc.
8162 case "${osname}${osvers}" in
8165 # XXX How handle the --version stuff for MAB?
8167 linux*|gnu*) # ld won't link with a bare -lperl otherwise.
8170 cygwin*) # ld links against an importlib
8171 dflt=libperl$lib_ext
8173 *) # Try to guess based on whether libc has major.minor.
8175 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
8176 *libc.$so.[0-9]*) dflt=$majonly ;;
8177 *) dflt=libperl.$so ;;
8187 I need to select a good name for the shared libperl. If your system uses
8188 library names with major and minor numbers, then you might want something
8189 like $majmin. Alternatively, if your system uses a single version
8190 number for shared libraries, then you might want to use $majonly.
8191 Or, your system might be quite happy with a simple libperl.$so.
8193 Since the shared libperl will get installed into a version-specific
8194 architecture-dependent directory, the version number of the shared perl
8195 library probably isn't important, so the default should be o.k.
8198 rp='What name do you want to give to the shared libperl?'
8201 echo "Ok, I'll use $libperl"
8204 libperl="libperl${_a}"
8208 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
8212 WARNING: Use of the shrpdir variable for the installation location of
8213 the shared $libperl is not supported. It was never documented and
8214 will not work in this version. Let me (perlbug@perl.org)
8215 know of any problems this may cause.
8221 But your current setting of $shrpdir is
8222 the default anyway, so it's harmless.
8227 Further, your current attempted setting of $shrpdir
8228 conflicts with the value of $archlibexp/CORE
8229 that installperl will use.
8236 # How will the perl executable find the installed shared $libperl?
8237 # Add $xxx to ccdlflags.
8238 # If we can't figure out a command-line option, use $shrpenv to
8239 # set env LD_RUN_PATH. The main perl makefile uses this.
8240 shrpdir=$archlibexp/CORE
8243 if "$useshrplib"; then
8246 # We'll set it in Makefile.SH...
8251 freebsd|netbsd|openbsd|interix|dragonfly)
8252 xxx="-Wl,-R$shrpdir"
8254 bsdos|linux|irix*|dec_osf|gnu*)
8255 xxx="-Wl,-rpath,$shrpdir"
8258 # next doesn't like the default...
8261 # beos doesn't like the default, either.
8264 # hpux doesn't like the default, either.
8265 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
8268 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
8274 # Only add $xxx if it isn't already in ccdlflags.
8275 case " $ccdlflags " in
8277 *) ccdlflags="$ccdlflags $xxx"
8280 Adding $xxx to the flags
8281 passed to $ld so that the perl executable will find the
8282 installed shared $libperl.
8290 # Fix ccdlflags in AIX for building external extensions.
8291 # (For building Perl itself bare -bE:perl.exp is needed,
8292 # Makefile.SH takes care of this.)
8294 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8296 # Respect a hint or command-line value.
8298 '') shrpenv="$tmp_shrpenv" ;;
8300 case "$ldlibpthname" in
8301 '') ldlibpthname=LD_LIBRARY_PATH ;;
8302 none) ldlibpthname='' ;;
8305 : determine where manual pages are on this system
8309 syspath='/usr/share/man/man1 /usr/man/man1'
8310 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8311 syspath="$syspath /usr/man/u_man/man1"
8312 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8313 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8314 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8315 sysman=`./loc . /usr/man/man1 $syspath`
8318 if $test -d "$sysman"; then
8319 echo "System manual is in $sysman." >&4
8321 echo "Could not find manual pages in source form." >&4
8324 : determine where manual pages go
8325 set man1dir man1dir none
8329 $spackage has manual pages available in source form.
8333 echo "However, you don't have nroff, so they're probably useless to you."
8335 '') man1dir="none";;
8338 echo "If you don't want the manual sources installed, answer 'none'."
8343 lookpath="$prefixexp/share/man/man1"
8344 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8345 lookpath="$lookpath $prefixexp/man/p_man/man1"
8346 lookpath="$lookpath $prefixexp/man/u_man/man1"
8347 lookpath="$lookpath $prefixexp/man/man.1"
8349 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8350 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8360 rp="Where do the main $spackage manual pages (source) go?"
8362 if $test "X$man1direxp" != "X$ansexp"; then
8373 : What suffix to use on installed man pages
8380 rp="What suffix should be used for the main $spackage man pages?"
8382 '') case "$man1dir" in
8396 *) dflt="$man1ext";;
8403 : see if we can have long filenames
8405 first=123456789abcdef
8407 if (echo hi >$first) 2>/dev/null; then
8408 if $test -f 123456789abcde; then
8409 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8412 echo 'You can have filenames longer than 14 characters.'>&4
8417 You can't have filenames longer than 14 chars.
8418 You can't even think about them!
8424 $rm -rf 123456789abcde*
8426 : determine where library module manual pages go
8427 set man3dir man3dir none
8431 $spackage has manual pages for many of the library modules.
8437 However, you don't have nroff, so they're probably useless to you.
8440 '') man3dir="none";;
8444 case "$d_flexfnam" in
8447 However, your system can't handle the long file names like File::Basename.3.
8450 '') man3dir="none";;
8454 echo "If you don't want the manual sources installed, answer 'none'."
8455 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8457 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
8458 if $test -d "$privlib/man/man3"; then
8461 WARNING: Previous versions of perl installed man3 pages into
8462 $privlib/man/man3. This version will suggest a
8463 new default of $dflt.
8467 rp='Do you wish to preserve the old behavior?(y/n)'
8470 y*) dflt="$privlib/man/man3" ;;
8475 *) dflt="$man3dir" ;;
8482 rp="Where do the $package library man pages (source) go?"
8492 : What suffix to use on installed man pages
8498 rp="What suffix should be used for the $package library man pages?"
8500 '') case "$man3dir" in
8514 *) dflt="$man3ext";;
8521 : see if we have to deal with yellow pages, now NIS.
8522 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
8523 if $test -f /usr/etc/nibindd; then
8525 echo "I'm fairly confident you're on a NeXT."
8527 rp='Do you get the hosts file via NetInfo?'
8536 y*) hostcat='nidump hosts .';;
8537 *) case "$hostcat" in
8538 nidump*) hostcat='';;
8548 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
8556 rp='Are you getting the hosts file via yellow pages?'
8559 y*) hostcat='ypcat hosts';;
8560 *) hostcat='cat /etc/hosts';;
8566 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
8569 '') test -f /etc/group && groupcat='cat /etc/group';;
8572 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
8575 : now get the host name
8577 echo "Figuring out host name..." >&4
8578 case "$myhostname" in
8580 echo 'Maybe "hostname" will work...'
8581 if tans=`sh -c hostname 2>&1` ; then
8589 if $test "$cont"; then
8591 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
8592 if tans=`cat /etc/systemid 2>&1` ; then
8594 phostname='cat /etc/systemid'
8595 echo "Whadyaknow. Xenix always was a bit strange..."
8598 elif $test -r /etc/systemid; then
8599 echo "(What is a non-Xenix system doing with /etc/systemid?)"
8602 if $test "$cont"; then
8603 echo 'No, maybe "uuname -l" will work...'
8604 if tans=`sh -c 'uuname -l' 2>&1` ; then
8606 phostname='uuname -l'
8608 echo 'Strange. Maybe "uname -n" will work...'
8609 if tans=`sh -c 'uname -n' 2>&1` ; then
8611 phostname='uname -n'
8613 echo 'Oh well, maybe I can mine it out of whoami.h...'
8614 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
8615 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
8616 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
8618 case "$myhostname" in
8619 '') echo "Does this machine have an identity crisis or something?"
8622 echo "Well, you said $myhostname before..."
8623 phostname='echo $myhostname';;
8629 case "$myhostname" in
8630 '') myhostname=noname ;;
8632 : you do not want to know about this
8637 if $test "$myhostname" ; then
8639 rp='Your host name appears to be "'$myhostname'".'" Right?"
8647 : bad guess or no guess
8648 while $test "X$myhostname" = X ; do
8650 rp="Please type the (one word) name of your host:"
8655 : translate upper to lower if necessary
8656 case "$myhostname" in
8658 echo "(Normalizing case in your host name)"
8659 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
8663 case "$myhostname" in
8665 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
8666 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
8667 echo "(Trimming domain name from host name--host name is now $myhostname)"
8669 *) case "$mydomain" in
8672 test "X$hostcat" = "Xypcat hosts" &&
8673 ypmatch "$myhostname" hosts 2>/dev/null |\
8674 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
8677 test "X$hostcat" != "X" &&
8678 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
8679 /[ ]$myhostname[ . ]/p" > hosts
8682 if $test -f hosts; then
8683 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
8684 END { print sum }" hosts` = x1 || tmp_re="[ ]"
8685 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
8686 hosts | $sort | $uniq | \
8687 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
8688 case `$echo X$dflt` in
8689 X*\ *) echo "(Several hosts in the database matched hostname)"
8692 X.) echo "(You do not have fully-qualified names in the hosts database)"
8696 echo "(I cannot locate a hosts database anywhere)"
8701 tans=`./loc resolv.conf X /etc /usr/etc`
8702 if $test -f "$tans"; then
8703 echo "(Attempting domain name extraction from $tans)"
8704 dflt=.`$sed -n -e 's/ / /g' \
8705 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
8708 .) dflt=.`$sed -n -e 's/ / /g' \
8709 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
8717 .) echo "(No help from resolv.conf either -- attempting clever guess)"
8718 dflt=.`sh -c domainname 2>/dev/null`
8721 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
8725 case "$dflt$osname" in
8726 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
8727 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
8731 .) echo "(Lost all hope -- silly guess then)"
8737 *) dflt="$mydomain";;
8741 rp="What is your domain name?"
8751 : translate upper to lower if necessary
8754 echo "(Normalizing case in your domain name)"
8755 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
8759 : a little sanity check here
8760 case "$phostname" in
8763 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
8764 $myhostname$mydomain|$myhostname) ;;
8766 case "$phostname" in
8768 echo "(That doesn't agree with your whoami.h file, by the way.)"
8771 echo "(That doesn't agree with your $phostname command, by the way.)"
8779 : determine the e-mail address of the user who is running us
8782 I need to get your e-mail address in Internet format if possible, i.e.
8783 something like user@host.domain. Please answer accurately since I have
8784 no easy means to double check it. The default value provided below
8785 is most probably close to reality but may not be valid from outside
8786 your organization...
8790 while test "$cont"; do
8792 '') dflt="$cf_by@$myhostname$mydomain";;
8793 *) dflt="$cf_email";;
8795 rp='What is your e-mail address?'
8801 rp='Address does not look like an Internet one. Use it anyway?'
8815 : Ask e-mail of administrator
8818 If you or somebody else will be maintaining perl at your site, please
8819 fill in the correct e-mail address here so that they may be contacted
8820 if necessary. Currently, the "perlbug" program included with perl
8821 will send mail to this address in addition to perlbug@perl.org. You may
8822 enter "none" for no administrator.
8825 case "$perladmin" in
8826 '') dflt="$cf_email";;
8827 *) dflt="$perladmin";;
8829 rp='Perl administrator e-mail address'
8833 : determine whether to only install version-specific parts.
8836 Do you want to install only the version-specific parts of the perl
8837 distribution? Usually you do *not* want to do this.
8839 case "$versiononly" in
8840 "$define"|[Yy]*|true) dflt='y' ;;
8843 rp="Do you want to install only the version-specific parts of perl?"
8846 [yY]*) val="$define";;
8852 case "$versiononly" in
8853 "$define") inc_version_list=''
8854 inc_version_list_init=0
8858 : figure out how to guarantee perl startup
8859 : XXX Note that this currently takes advantage of the bug that binexp ignores
8860 : the Configure -Dinstallprefix setting, which in turn means that under
8861 : relocatable @INC, initialinstalllocation is what binexp started as.
8862 case "$startperl" in
8864 case "$sharpbang" in
8868 I can use the #! construct to start perl on your system. This will
8869 make startup of perl scripts faster, but may cause problems if you
8870 want to share those scripts and perl is not in a standard place
8871 ($initialinstalllocation/perl) on all your platforms. The alternative
8872 is to force a shell by starting the script with a single ':' character.
8875 case "$versiononly" in
8876 "$define") dflt="$initialinstalllocation/perl$version";;
8877 *) dflt="$initialinstalllocation/perl";;
8879 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
8882 none) startperl=": # use perl";;
8883 *) startperl="#!$ans"
8884 if $test 30 -lt `echo "$ans" | wc -c`; then
8887 WARNING: Some systems limit the #! command to 32 characters.
8888 If you experience difficulty running Perl scripts with #!, try
8889 installing Perl in a directory with a shorter pathname.
8895 *) startperl=": # use perl"
8900 echo "I'll use $startperl to start perl scripts."
8902 : figure best path for perl in scripts
8905 case "$versiononly" in
8906 "$define") perlpath="$initialinstalllocation/perl$version";;
8907 *) perlpath="$initialinstalllocation/perl";;
8909 case "$startperl" in
8914 I will use the "eval 'exec'" idiom to start Perl on your system.
8915 I can use the full path of your Perl binary for this purpose, but
8916 doing so may cause problems if you want to share those scripts and
8917 Perl is not always in a standard place ($initialinstalllocation/perl).
8920 dflt="$initialinstalllocation/perl"
8921 rp="What path shall I use in \"eval 'exec'\"?"
8928 case "$startperl" in
8930 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
8933 : determine where public executable scripts go
8934 set scriptdir scriptdir
8936 case "$scriptdir" in
8939 : guess some guesses
8940 $test -d /usr/share/scripts && dflt=/usr/share/scripts
8941 $test -d /usr/share/bin && dflt=/usr/share/bin
8942 $test -d /usr/local/script && dflt=/usr/local/script
8943 $test -d /usr/local/scripts && dflt=/usr/local/scripts
8944 $test -d $prefixexp/script && dflt=$prefixexp/script
8948 *) dflt="$scriptdir"
8953 Some installations have a separate directory just for executable scripts so
8954 that they can mount it across multiple architectures but keep the scripts in
8955 one spot. You might, for example, have a subdirectory of /usr/share for this.
8956 Or you might just lump your scripts in with all your other executables.
8960 rp='Where do you keep publicly executable scripts?'
8962 if $test "X$ansexp" != "X$scriptdirexp"; then
8968 : A little fix up for an irregularly named variable.
8969 installscript="$installscriptdir"
8971 : determine where add-on public executables go
8973 '') dflt=$siteprefix/bin ;;
8977 rp='Pathname where the add-on public executables should be installed?'
8982 : determine where add-on html pages go
8983 : There is no standard location, so try to copy the previously-selected
8984 : directory structure for the core html pages.
8985 case "$sitehtml1dir" in
8986 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
8987 *) dflt=$sitehtml1dir ;;
8990 ''|' ') dflt=none ;;
8993 rp='Pathname where the site-specific html pages should be installed?'
8995 prefixvar=sitehtml1dir
8998 : determine where add-on library html pages go
8999 : There is no standard location, so try to copy the previously-selected
9000 : directory structure for the core html pages.
9001 case "$sitehtml3dir" in
9002 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9003 *) dflt=$sitehtml3dir ;;
9006 ''|' ') dflt=none ;;
9009 rp='Pathname where the site-specific library html pages should be installed?'
9011 prefixvar=sitehtml3dir
9014 : determine where add-on manual pages go
9015 case "$siteman1dir" in
9016 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
9017 *) dflt=$siteman1dir ;;
9020 ''|' ') dflt=none ;;
9023 rp='Pathname where the site-specific manual pages should be installed?'
9025 prefixvar=siteman1dir
9028 : determine where add-on library man pages go
9029 case "$siteman3dir" in
9030 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
9031 *) dflt=$siteman3dir ;;
9034 ''|' ') dflt=none ;;
9037 rp='Pathname where the site-specific library manual pages should be installed?'
9039 prefixvar=siteman3dir
9042 : determine where add-on public executable scripts go
9043 case "$sitescript" in
9044 '') dflt=$siteprefix/script
9045 $test -d $dflt || dflt=$sitebin ;;
9046 *) dflt="$sitescript" ;;
9049 rp='Pathname where add-on public executable scripts should be installed?'
9051 prefixvar=sitescript
9054 : Check if faststdio is requested and available
9055 case "$usefaststdio" in
9056 $define|true|[yY]*|'')
9057 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
9067 Perl can be built to use 'fast stdio', which means using the stdio
9068 library but also directly manipulating the stdio buffers to enable
9069 faster I/O. Using stdio is better for backward compatibility (especially
9070 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
9071 interface has been preferred instead of stdio.
9073 If this doesn't make any sense to you, just accept the default '$dflt'.
9075 rp='Use the "fast stdio" if available?'
9078 y|Y) val="$define" ;;
9085 : define an is-a-typedef? function
9086 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9088 "") inclist="sys/types.h";;
9090 eval "varval=\$$var";
9094 for inc in $inclist; do
9095 echo "#include <$inc>" >>temp.c;
9097 echo "#ifdef $type" >> temp.c;
9098 echo "printf(\"We have $type\");" >> temp.c;
9099 echo "#endif" >> temp.c;
9100 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9101 if $contains $type temp.E >/dev/null 2>&1; then
9107 *) eval "$var=\$varval";;
9110 : define an is-a-typedef? function that prompts if the type is not available.
9111 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9113 "") inclist="sys/types.h";;
9115 eval "varval=\$$var";
9119 for inc in $inclist; do
9120 echo "#include <$inc>" >>temp.c;
9122 echo "#ifdef $type" >> temp.c;
9123 echo "printf(\"We have $type\");" >> temp.c;
9124 echo "#endif" >> temp.c;
9125 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9127 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
9128 if $contains $type temp.E >/dev/null 2>&1; then
9129 echo "$type found." >&4;
9132 echo "$type NOT found." >&4;
9138 *) eval "$var=\$varval";;
9141 : see what type lseek is declared as in the kernel
9142 rp="What is the type used for lseek's offset on this system?"
9143 set off_t lseektype long stdio.h sys/types.h
9147 echo "Checking to see how big your file offsets are..." >&4
9149 #include <sys/types.h>
9153 printf("%d\n", (int)sizeof($lseektype));
9158 if eval $compile_ok; then
9159 lseeksize=`$run ./try`
9160 echo "Your file offsets are $lseeksize bytes long."
9164 echo "(I can't seem to compile the test program. Guessing...)"
9165 rp="What is the size of your file offsets (in bytes)?"
9171 : see what type file positions are declared as in the library
9172 rp="What is the type for file position used by fsetpos()?"
9173 set fpos_t fpostype long stdio.h sys/types.h
9176 : Check size for Fpos_t
9179 *_t) zzz="$fpostype" ;;
9182 echo "Checking the size of $zzz..." >&4
9184 #include <sys/types.h>
9191 printf("%d\n", (int)sizeof($fpostype));
9196 if eval $compile_ok; then
9200 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9203 echo "Your $zzz is $fpossize bytes long."
9209 echo "(I can't compile the test program. Guessing...)" >&4
9210 rp="What is the size of your file positions (in bytes)?"
9215 : Check for large file support
9216 # Backward compatibility (uselfs is deprecated).
9218 "$define"|true|[yY]*)
9221 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
9223 uselargefiles="$define"
9227 case "$lseeksize:$fpossize" in
9230 You can have files larger than 2 gigabytes.
9233 *) case "$uselargefiles" in
9234 "$undef"|false|[nN]*) dflt='n' ;;
9239 Perl can be built to understand large files (files larger than 2 gigabytes)
9240 on some systems. To do so, Configure can be run with -Duselargefiles.
9242 If this doesn't make any sense to you, just accept the default '$dflt'.
9244 rp='Try to understand large files, if available?'
9247 y|Y) val="$define" ;;
9254 : Look for a hint-file generated 'call-back-unit'. If the
9255 : user has specified that a large files perl is to be built,
9256 : we may need to set or change some other defaults.
9257 if $test -f uselargefiles.cbu; then
9258 echo "Your platform has some specific hints regarding large file builds, using them..."
9259 . ./uselargefiles.cbu
9261 case "$uselargefiles" in
9263 if $test -f uselargefiles.cbu; then
9265 echo "Rechecking to see how big your file offsets are..." >&4
9267 #include <sys/types.h>
9271 printf("%d\n", (int)sizeof($lseektype));
9276 if eval $compile_ok; then
9277 lseeksize=`$run ./try`
9278 $echo "Your file offsets are now $lseeksize bytes long."
9282 echo "(I can't seem to compile the test program. Guessing...)"
9283 rp="What is the size of your file offsets (in bytes)?"
9288 *_t) zzz="$fpostype" ;;
9291 $echo $n "Rechecking the size of $zzz...$c" >&4
9293 #include <sys/types.h>
9300 printf("%d\n", (int)sizeof($fpostype));
9305 if eval $compile_ok; then
9310 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9313 echo " $fpossize bytes." >&4
9319 echo "(I can't compile the test program. Guessing...)" >&4
9320 rp="What is the size of your file positions (in bytes)?"
9329 : Set the vendorbin variables
9330 case "$vendorprefix" in
9331 '') d_vendorbin="$undef"
9335 *) d_vendorbin="$define"
9336 : determine where vendor-supplied executables go.
9337 case "$vendorbin" in
9338 '') dflt=$vendorprefix/bin ;;
9339 *) dflt="$vendorbin" ;;
9342 rp='Pathname for the vendor-supplied executables directory?'
9345 vendorbinexp="$ansexp"
9351 : Set the vendorhtml1dir variables
9352 case "$vendorprefix" in
9353 '') vendorhtml1dir=''
9354 vendorhtml1direxp=''
9356 *) : determine where vendor-supplied html pages go.
9357 : There is no standard location, so try to copy the previously-selected
9358 : directory structure for the core html pages.
9359 : XXX Better default suggestions would be welcome.
9360 case "$vendorhtml1dir" in
9361 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9362 *) dflt=$vendorhtml1dir ;;
9365 ''|' ') dflt=none ;;
9368 rp='Pathname for the vendor-supplied html pages?'
9370 vendorhtml1dir="$ans"
9371 vendorhtml1direxp="$ansexp"
9374 : Use ' ' for none so value is preserved next time through Configure
9375 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9376 prefixvar=vendorhtml1dir
9379 : Set the vendorhtml3dir variables
9380 case "$vendorprefix" in
9381 '') vendorhtml3dir=''
9382 vendorhtml3direxp=''
9384 *) : determine where vendor-supplied module html pages go.
9385 : There is no standard location, so try to copy the previously-selected
9386 : directory structure for the core html pages.
9387 : XXX Better default suggestions would be welcome.
9388 case "$vendorhtml3dir" in
9389 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9390 *) dflt=$vendorhtml3dir ;;
9393 ''|' ') dflt=none ;;
9396 rp='Pathname for the vendor-supplied html pages?'
9398 vendorhtml3dir="$ans"
9399 vendorhtml3direxp="$ansexp"
9402 : Use ' ' for none so value is preserved next time through Configure
9403 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9404 prefixvar=vendorhtml3dir
9407 : Set the vendorman1dir variables
9408 case "$vendorprefix" in
9409 '') vendorman1dir=''
9412 *) : determine where vendor-supplied manual pages go.
9413 case "$vendorman1dir" in
9414 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9415 *) dflt=$vendorman1dir ;;
9418 ''|' ') dflt=none ;;
9421 rp='Pathname for the vendor-supplied manual section 1 pages?'
9423 vendorman1dir="$ans"
9424 vendorman1direxp="$ansexp"
9427 : Use ' ' for none so value is preserved next time through Configure
9428 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
9429 prefixvar=vendorman1dir
9432 : Set the vendorman3dir variables
9433 case "$vendorprefix" in
9434 '') vendorman3dir=''
9437 *) : determine where vendor-supplied module manual pages go.
9438 case "$vendorman3dir" in
9439 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9440 *) dflt=$vendorman3dir ;;
9443 ''|' ') dflt=none ;;
9446 rp='Pathname for the vendor-supplied manual section 3 pages?'
9448 vendorman3dir="$ans"
9449 vendorman3direxp="$ansexp"
9452 : Use ' ' for none so value is preserved next time through Configure
9453 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
9454 prefixvar=vendorman3dir
9457 : Set the vendorscript variables
9458 case "$vendorprefix" in
9459 '') d_vendorscript="$undef"
9463 *) d_vendorscript="$define"
9464 : determine where vendor-supplied scripts go.
9465 case "$vendorscript" in
9466 '') dflt=$vendorprefix/script
9467 $test -d $dflt || dflt=$vendorbin ;;
9468 *) dflt="$vendorscript" ;;
9472 The installation process will create a directory for
9473 vendor-supplied scripts.
9477 rp='Pathname for the vendor-supplied scripts directory?'
9480 vendorscriptexp="$ansexp"
9483 prefixvar=vendorscript
9486 : see if qgcvt exists
9490 : Check print/scan long double stuff
9493 if $test X"$d_longdbl" = X"$define"; then
9495 echo "Checking how to print long doubles..." >&4
9497 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
9498 $cat >try.c <<'EOCP'
9499 #include <sys/types.h>
9503 printf("%.3f\n", d);
9507 if eval $compile; then
9511 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
9512 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
9513 echo "We will use %f."
9519 if $test X"$sPRIfldbl" = X; then
9520 $cat >try.c <<'EOCP'
9521 #include <sys/types.h>
9524 long double d = 123.456;
9525 printf("%.3Lf\n", d);
9529 if eval $compile; then
9533 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
9534 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
9535 echo "We will use %Lf."
9541 if $test X"$sPRIfldbl" = X; then
9542 $cat >try.c <<'EOCP'
9543 #include <sys/types.h>
9546 long double d = 123.456;
9547 printf("%.3llf\n", d);
9551 if eval $compile; then
9555 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
9556 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
9557 echo "We will use %llf."
9563 if $test X"$sPRIfldbl" = X; then
9564 $cat >try.c <<'EOCP'
9565 #include <sys/types.h>
9568 long double d = 123.456;
9569 printf("%.3lf\n", d);
9573 if eval $compile; then
9577 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
9578 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
9579 echo "We will use %lf."
9585 if $test X"$sPRIfldbl" = X; then
9586 echo "Cannot figure out how to print long doubles." >&4
9588 sSCNfldbl=$sPRIfldbl # expect consistency
9595 case "$sPRIfldbl" in
9596 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
9597 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
9598 d_SCNfldbl="$undef";
9600 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
9601 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
9602 d_SCNfldbl="$define";
9606 : Check how to convert floats to strings.
9608 if test "X$d_Gconvert" = X; then
9611 echo "Checking for an efficient way to convert floats to strings."
9613 case "$uselongdouble" in
9614 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
9616 case "$d_longdbl" in
9617 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
9619 case "$d_PRIgldbl" in
9620 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
9624 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
9625 char *myname = "gconvert";
9628 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
9629 char *myname = "gcvt";
9632 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
9633 char *myname = "qgcvt";
9634 #define DOUBLETYPE long double
9637 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9639 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
9641 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
9644 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
9646 char *myname = "sprintf";
9650 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9651 #define DOUBLETYPE long double
9653 #define DOUBLETYPE double
9659 #define I_STDLIB $i_stdlib
9665 checkit(expect, got)
9669 if (strcmp(expect, got)) {
9670 printf("%s oddity: Expected %s, got %s\n",
9671 myname, expect, got);
9681 /* This must be 1st test on (which?) platform */
9682 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
9683 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
9684 checkit("0.1", buf);
9686 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
9687 checkit("0.01", buf);
9689 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
9690 checkit("0.001", buf);
9692 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
9693 checkit("0.0001", buf);
9695 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
9696 if (strlen(buf) > 5)
9697 checkit("9e-005", buf); /* for Microsoft ?? */
9699 checkit("9e-05", buf);
9701 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
9704 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
9705 checkit("1.1", buf);
9707 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
9708 checkit("1.01", buf);
9710 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
9711 checkit("1.001", buf);
9713 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
9714 checkit("1.0001", buf);
9716 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
9717 checkit("1.00001", buf);
9719 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
9720 checkit("1.000001", buf);
9722 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
9725 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
9728 /* Some Linux gcvt's give 1.e+5 here. */
9729 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
9730 checkit("100000", buf);
9732 /* Some Linux gcvt's give -1.e+5 here. */
9733 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
9734 checkit("-100000", buf);
9736 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
9737 checkit("123.456", buf);
9739 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
9740 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
9741 /* 34 should be enough to scare even long double
9742 * places into using the e notation. */
9743 if (strlen(buf) > 5)
9744 checkit("1e+034", buf); /* for Microsoft */
9746 checkit("1e+34", buf);
9748 /* For Perl, if you add additional tests here, also add them to
9749 * t/base/num.t for benefit of platforms not using Configure or
9750 * overriding d_Gconvert */
9755 : first add preferred functions to our list
9757 for xxx_convert in $gconvert_preference; do
9758 case $xxx_convert in
9759 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
9760 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
9763 : then add any others
9764 for xxx_convert in gconvert gcvt sprintf; do
9767 *) xxx_list="$xxx_list $xxx_convert" ;;
9771 case "$d_longdbl$uselongdouble" in
9773 : again, add prefered functions to our list first
9775 for xxx_convert in $gconvert_ld_preference; do
9776 case $xxx_convert in
9777 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9778 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
9781 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
9782 for xxx_convert in qgcvt sprintf $xxx_list; do
9783 case "$xxx_ld_list" in
9784 $xxx_convert*|*" $xxx_convert"*) ;;
9785 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9788 : if sprintf cannot do long doubles, move it to the end
9789 if test "$d_PRIgldbl" != "$define"; then
9790 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
9792 : if no qgcvt, remove it
9793 if test "$d_qgcvt" != "$define"; then
9794 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
9797 xxx_list="$xxx_ld_list"
9801 for xxx_convert in $xxx_list; do
9802 echo "Trying $xxx_convert..."
9803 $rm -f try try$_o core
9804 set try -DTRY_$xxx_convert
9805 if eval $compile; then
9806 echo "$xxx_convert() found." >&4
9808 echo "I'll use $xxx_convert to convert floats into a string." >&4
9811 echo "...But $xxx_convert didn't work as I expected."
9815 echo "$xxx_convert NOT found." >&4
9819 if test X$xxx_convert = X; then
9820 echo "*** WHOA THERE!!! ***" >&4
9821 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
9825 case "$xxx_convert" in
9826 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
9827 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
9828 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
9829 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
9830 "$define$define$define")
9831 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
9832 "$define$define$undef")
9833 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
9834 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
9842 : see if _fwalk exists
9846 : Initialize h_fcntl
9849 : Initialize h_sysfile
9852 : access call always available on UNIX
9856 : locate the flags for 'access()'
9860 $cat >access.c <<EOCP
9861 #include <sys/types.h>
9866 #include <sys/file.h>
9879 : check sys/file.h first, no particular reason here
9880 if $test `./findhdr sys/file.h` && \
9881 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
9883 echo "<sys/file.h> defines the *_OK access constants." >&4
9884 elif $test `./findhdr fcntl.h` && \
9885 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
9887 echo "<fcntl.h> defines the *_OK access constants." >&4
9888 elif $test `./findhdr unistd.h` && \
9889 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
9890 echo "<unistd.h> defines the *_OK access constants." >&4
9892 echo "I can't find the four *_OK access constants--I'll use mine." >&4
9898 : see if accessx exists
9899 set accessx d_accessx
9902 : see if aintl exists
9906 : see if alarm exists
9910 : see if POSIX threads are available
9911 set pthread.h i_pthread
9914 : define a fucntion to check prototypes
9915 $cat > protochk <<EOSH
9918 optimize="$optimize"
9920 prototype="$prototype"
9923 usethreads=$usethreads
9924 i_pthread=$i_pthread
9925 pthread_h_first=$pthread_h_first
9928 $cat >> protochk <<'EOSH'
9933 while test $# -ge 2; do
9935 $define) echo "#include <$2>" >> try.c ;;
9936 literal) echo "$2" >> try.c ;;
9938 # Extra magic for the benefit of systems that need pthread.h
9939 # to be included early to correctly detect threadsafe functions.
9940 # Such functions must guarantee themselves, though, that the usethreads
9941 # and i_pthread have been defined, before calling protochk.
9942 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
9943 echo "#include <pthread.h>" >> try.c
9948 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
9949 cat >> try.c <<'EOCP'
9950 #ifdef CAN_PROTOTYPE
9951 #define _(args) args
9956 echo "$foo" >> try.c
9957 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
9958 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
9966 : Define hasproto macro for Configure internal use
9967 hasproto='varname=$1; func=$2; shift; shift;
9968 while $test $# -ge 2; do
9970 $define) echo "#include <$2>";;
9974 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
9975 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
9976 echo "$func() prototype found.";
9979 echo "$func() prototype NOT found.";
9986 : see if sys/types.h has to be included
9987 set sys/types.h i_systypes
9990 : see if sys/select.h has to be included
9991 set sys/select.h i_sysselct
9994 : Define hasfield macro for Configure internal use
9995 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
9996 while $test $# -ge 2; do
9998 $define) echo "#include <$2>";;
10002 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
10004 if eval $compile; then
10013 : see if we should include time.h, sys/time.h, or both
10015 if test "X$timeincl" = X; then
10016 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
10017 $echo $n "I'm now running the test program...$c"
10019 #include <sys/types.h>
10024 #ifdef SYSTIMEKERNEL
10027 #include <sys/time.h>
10030 #include <sys/select.h>
10032 #$i_stdlib I_STDLIB
10034 #include <stdlib.h>
10040 struct timeval bar;
10043 struct timezone tzp;
10045 if (foo.tm_sec == foo.tm_sec)
10048 if (bar.tv_sec == bar.tv_sec)
10055 for s_timezone in '-DS_TIMEZONE' ''; do
10057 for s_timeval in '-DS_TIMEVAL' ''; do
10058 for i_systimek in '' '-DSYSTIMEKERNEL'; do
10059 for i_time in '' '-DI_TIME'; do
10060 for i_systime in '-DI_SYSTIME' ''; do
10063 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
10064 if eval $compile; then
10065 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
10069 $echo $n "Succeeded with $flags$c"
10081 *SYSTIMEKERNEL*) i_systimek="$define"
10082 timeincl=`./findhdr sys/time.h`
10083 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
10084 *) i_systimek="$undef";;
10087 *I_TIME*) i_time="$define"
10088 timeincl=`./findhdr time.h`" $timeincl"
10089 echo "We'll include <time.h>." >&4;;
10090 *) i_time="$undef";;
10093 *I_SYSTIME*) i_systime="$define"
10094 timeincl=`./findhdr sys/time.h`" $timeincl"
10095 echo "We'll include <sys/time.h>." >&4;;
10096 *) i_systime="$undef";;
10100 : see if struct tm knows about tm_zone
10101 case "$i_systime$i_time" in
10104 echo "Checking to see if your struct tm has tm_zone field..." >&4
10105 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
10113 case "$d_tm_tm_zone" in
10114 "$define") echo "Yes, it does." ;;
10115 *) echo "No, it doesn't." ;;
10117 : see if struct tm knows about tm_gmtoff
10118 case "$i_systime$i_time" in
10121 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
10122 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
10130 case "$d_tm_tm_gmtoff" in
10131 "$define") echo "Yes, it does." ;;
10132 *) echo "No, it doesn't." ;;
10135 : see if asctime_r exists
10136 set asctime_r d_asctime_r
10138 case "$d_asctime_r" in
10140 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10141 case "$d_asctime_r_proto:$usethreads" in
10142 ":define") d_asctime_r_proto=define
10143 set d_asctime_r_proto asctime_r $hdrs
10147 case "$d_asctime_r_proto" in
10149 case "$asctime_r_proto" in
10150 ''|0) try='char* asctime_r(const struct tm*, char*);'
10151 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SB ;;
10153 case "$asctime_r_proto" in
10154 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
10155 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SBI ;;
10157 case "$asctime_r_proto" in
10158 ''|0) try='int asctime_r(const struct tm*, char*);'
10159 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SB ;;
10161 case "$asctime_r_proto" in
10162 ''|0) try='int asctime_r(const struct tm*, char*, int);'
10163 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SBI ;;
10165 case "$asctime_r_proto" in
10166 ''|0) d_asctime_r=undef
10168 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
10169 * ) case "$asctime_r_proto" in
10170 REENTRANT_PROTO*) ;;
10171 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
10173 echo "Prototype: $try" ;;
10176 *) case "$usethreads" in
10177 define) echo "asctime_r has no prototype, not using it." >&4 ;;
10184 *) asctime_r_proto=0
10188 : see if atolf exists
10192 : see if atoll exists
10196 : Look for GCC-style attribute format
10197 case "$d_attribute_format" in
10200 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
10201 $cat >attrib.c <<'EOCP'
10203 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
10205 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10206 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10207 echo "Your C compiler doesn't support __attribute__((format))."
10210 echo "Your C compiler supports __attribute__((format))."
10214 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10218 *) val="$d_attribute_format" ;;
10220 set d_attribute_format
10224 : Look for GCC-style attribute format with null format allowed
10225 case "$d_printf_format_null" in
10226 '') case "$d_attribute_format" in
10229 echo "Checking whether your compiler allows __printf__ format to be null ..." >&4
10230 $cat >attrib.c <<EOCP
10232 #$i_stdlib I_STDLIB
10234 #include <stdlib.h>
10236 int null_printf (char* pat,...) __attribute__((__format__(__printf__,1,2)));
10237 int null_printf (char* pat,...) { return (int)pat; }
10238 int main () { exit(null_printf(NULL)); }
10240 if $cc $ccflags -o attrib attrib.c >attrib.out 2>&1 ; then
10241 : run the executable in case it produces a run-time warning
10242 if $run ./attrib >>attrib.out 2>&1; then
10243 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10244 echo "Your C compiler doesn't allow __printf__ format to be null."
10247 echo "Your C compiler allows __printf__ format to be null."
10251 echo "Your C compiler executable failed with __printf__ format null."
10255 echo "Your C compiler fails with __printf__ format null."
10262 *) val="$d_printf_format_null" ;;
10264 set d_printf_format_null
10268 : Look for GCC-style attribute malloc
10269 case "$d_attribute_malloc" in
10272 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
10273 $cat >attrib.c <<'EOCP'
10275 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
10277 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10278 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10279 echo "Your C compiler doesn't support __attribute__((malloc))."
10282 echo "Your C compiler supports __attribute__((malloc))."
10286 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10290 *) val="$d_attribute_malloc" ;;
10292 set d_attribute_malloc
10296 : Look for GCC-style attribute nonnull
10297 case "$d_attribute_nonnull" in
10300 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
10301 $cat >attrib.c <<'EOCP'
10303 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
10305 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10306 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10307 echo "Your C compiler doesn't support __attribute__((nonnull))."
10310 echo "Your C compiler supports __attribute__((nonnull))."
10314 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10318 *) val="$d_attribute_nonnull" ;;
10320 set d_attribute_nonnull
10324 : Look for GCC-style attribute noreturn
10325 case "$d_attribute_noreturn" in
10328 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
10329 $cat >attrib.c <<'EOCP'
10331 void fall_over_dead( void ) __attribute__((noreturn));
10333 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10334 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10335 echo "Your C compiler doesn't support __attribute__((noreturn))."
10338 echo "Your C compiler supports __attribute__((noreturn))."
10342 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10346 *) val="$d_attribute_noreturn" ;;
10348 set d_attribute_noreturn
10352 : Look for GCC-style attribute pure
10353 case "$d_attribute_pure" in
10356 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
10357 $cat >attrib.c <<'EOCP'
10359 int square( int n ) __attribute__((pure));
10361 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10362 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10363 echo "Your C compiler doesn't support __attribute__((pure))."
10366 echo "Your C compiler supports __attribute__((pure))."
10370 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10374 *) val="$d_attribute_pure" ;;
10376 set d_attribute_pure
10380 : Look for GCC-style attribute unused
10381 case "$d_attribute_unused" in
10384 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
10385 $cat >attrib.c <<'EOCP'
10387 int do_something( int dummy __attribute__((unused)), int n );
10389 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10390 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10391 echo "Your C compiler doesn't support __attribute__((unused))."
10394 echo "Your C compiler supports __attribute__((unused))."
10398 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10402 *) val="$d_attribute_unused" ;;
10404 set d_attribute_unused
10408 : Look for GCC-style attribute warn_unused_result
10409 case "$d_attribute_warn_unused_result" in
10412 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
10413 $cat >attrib.c <<'EOCP'
10415 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
10417 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10418 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10419 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
10422 echo "Your C compiler supports __attribute__((warn_unused_result))."
10426 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10430 *) val="$d_attribute_warn_unused_result" ;;
10432 set d_attribute_warn_unused_result
10436 : see if bcmp exists
10440 : see if bcopy exists
10444 : see if getpgrp exists
10445 set getpgrp d_getpgrp
10448 case "$d_getpgrp" in
10451 echo "Checking to see which flavor of getpgrp is in use..."
10453 #$i_unistd I_UNISTD
10454 #include <sys/types.h>
10456 # include <unistd.h>
10458 #$i_stdlib I_STDLIB
10460 #include <stdlib.h>
10464 if (getuid() == 0) {
10465 printf("(I see you are running Configure as super-user...)\n");
10468 #ifdef TRY_BSD_PGRP
10469 if (getpgrp(1) == 0)
10478 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10479 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
10481 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10482 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
10485 echo "I can't seem to compile and run the test program."
10487 xxx="a USG one, i.e. you use getpgrp()."
10489 # SVR4 systems can appear rather BSD-ish.
10490 case "$i_unistd" in
10492 xxx="a BSD one, i.e. you use getpgrp(pid)."
10496 xxx="probably a USG one, i.e. you use getpgrp()."
10501 echo "Assuming your getpgrp is $xxx" >&4
10510 : see if setpgrp exists
10511 set setpgrp d_setpgrp
10514 case "$d_setpgrp" in
10517 echo "Checking to see which flavor of setpgrp is in use..."
10519 #$i_unistd I_UNISTD
10520 #include <sys/types.h>
10522 # include <unistd.h>
10524 #$i_stdlib I_STDLIB
10526 #include <stdlib.h>
10530 if (getuid() == 0) {
10531 printf("(I see you are running Configure as super-user...)\n");
10534 #ifdef TRY_BSD_PGRP
10535 if (-1 == setpgrp(1, 1))
10538 if (setpgrp() != -1)
10544 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10545 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
10547 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10548 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
10551 echo "(I can't seem to compile and run the test program.)"
10553 xxx="a USG one, i.e. you use setpgrp()."
10555 # SVR4 systems can appear rather BSD-ish.
10556 case "$i_unistd" in
10558 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
10562 xxx="probably a USG one, i.e. you use setpgrp()."
10567 echo "Assuming your setpgrp is $xxx" >&4
10576 : Look for GCC-style __builtin_choose_expr
10577 case "$d_builtin_choose_expr" in
10580 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
10581 $cat >try.c <<'EOCP'
10582 #include <assert.h>
10583 #include <stdlib.h>
10586 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
10589 assert( SYRINX(1) == 2112 );
10590 assert( SYRINX(1) != 5150 );
10591 assert( SYRINX(0) == 5150 );
10592 assert( SYRINX(0) != 2112 );
10593 puts( "All good!" );
10599 if eval $compile && $run ./try; then
10600 echo "Your C compiler supports __builtin_choose_expr."
10603 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
10607 *) val="$d_builtin_choose_expr" ;;
10610 set d_builtin_choose_expr
10614 : Look for GCC-style __builtin_expect
10615 case "$d_builtin_expect" in
10618 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
10619 $cat >try.c <<'EOCP'
10622 if ( __builtin_expect(n, 0) ) n = 1;
10623 /* Remember shell exit code truth is 0, C truth is non-zero */
10628 if eval $compile && $run ./try; then
10629 echo "Your C compiler supports __builtin_expect."
10632 echo "Your C compiler doesn't seem to understand __builtin_expect."
10636 *) val="$d_builtin_expect" ;;
10639 set d_builtin_expect
10643 : see if bzero exists
10647 : see if stdarg is available
10649 if $test `./findhdr stdarg.h`; then
10650 echo "<stdarg.h> found." >&4
10653 echo "<stdarg.h> NOT found." >&4
10657 : see if varags is available
10659 if $test `./findhdr varargs.h`; then
10660 echo "<varargs.h> found." >&4
10662 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
10665 : set up the varargs testing programs
10666 $cat > varargs.c <<EOP
10668 #include <stdarg.h>
10671 #include <varargs.h>
10675 int f(char *p, ...)
10689 p = va_arg(ap, char *);
10695 $cat > varargs <<EOP
10697 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
10706 : now check which varargs header should be included
10711 if `./varargs I_STDARG`; then
10713 elif `./varargs I_VARARGS`; then
10718 if `./varargs I_VARARGS`; then
10725 echo "I could not find the definition for va_dcl... You have problems..." >&4
10726 val="$undef"; set i_stdarg; eval $setvar
10727 val="$undef"; set i_varargs; eval $setvar
10732 case "$i_varhdr" in
10734 val="$define"; set i_stdarg; eval $setvar
10735 val="$undef"; set i_varargs; eval $setvar
10738 val="$undef"; set i_stdarg; eval $setvar
10739 val="$define"; set i_varargs; eval $setvar
10742 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
10746 : see if the Compiler supports C99 variadic macros
10747 case "$i_stdarg$i_stdlib" in
10749 echo "You have <stdarg.h> and <stdlib.h>, so checking for C99 variadic macros." >&4
10752 #include <stdarg.h>
10754 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
10758 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
10764 if eval $compile && $run ./try 2>&1 >/dev/null; then
10765 case "`$run ./try`" in
10767 echo "You have C99 variadic macros." >&4
10768 d_c99_variadic_macros="$define"
10771 echo "You don't have functional C99 variadic macros." >&4
10772 d_c99_variadic_macros="$undef"
10776 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
10777 d_c99_variadic_macros="$undef"
10782 echo "You don't have <stdarg.h> and <stdlib.h>, so not checking for C99 variadic macros." >&4
10783 d_c99_variadic_macros="$undef"
10787 : see if signal is declared as pointer to function returning int or void
10789 xxx=`./findhdr signal.h`
10790 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
10791 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10792 echo "You have int (*signal())() instead of void." >&4
10794 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10795 echo "You have void (*signal())()." >&4
10797 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
10798 echo "You have int (*signal())() instead of void." >&4
10800 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
10801 echo "You have void (*signal())()." >&4
10804 case "$d_voidsig" in
10806 echo "I can't determine whether signal handler returns void or int..." >&4
10808 rp="What type does your signal handler return?"
10811 v*) val="$define";;
10815 echo "As you already told me, signal handler returns void." >&4
10818 *) echo "As you already told me, signal handler returns int." >&4
10825 case "$d_voidsig" in
10826 "$define") signal_t="void";;
10827 *) signal_t="int";;
10831 : check for ability to cast large floats to 32-bit ints.
10833 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
10834 if $test "$intsize" -ge 4; then
10841 #$i_stdlib I_STDLIB
10843 #include <stdlib.h>
10845 #include <sys/types.h>
10846 #include <signal.h>
10847 $signal_t blech(int s) { exit(3); }
10854 signal(SIGFPE, blech);
10856 /* Don't let compiler optimize the test away. Store the number
10857 in a writable string for gcc to pass to sscanf under HP/UX.
10859 sprintf(str, "2147483647");
10860 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
10864 /* x86 processors will probably give 0x8000 0000, which is a
10865 sign change. We don't want that. We want to mimic SPARC
10866 behavior here, which is to preserve the sign and give
10869 if (i32 != ($xxx) f)
10875 if eval $compile_ok; then
10879 echo "(I can't seem to compile the test program--assuming it can't)"
10884 echo "Yup, it can."
10887 echo "Nope, it can't."
10894 : check for ability to cast negative floats to unsigned
10896 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
10899 #$i_stdlib I_STDLIB
10901 #include <stdlib.h>
10903 #include <sys/types.h>
10904 #include <signal.h>
10905 $signal_t blech(int s) { exit(7); }
10906 $signal_t blech_in_list(int s) { exit(4); }
10907 unsigned long dummy_long(unsigned long p) { return p; }
10908 unsigned int dummy_int(unsigned int p) { return p; }
10909 unsigned short dummy_short(unsigned short p) { return p; }
10913 unsigned long along;
10915 unsigned short ashort;
10919 /* Frustrate gcc-2.7.2's optimizer which failed this test with
10920 a direct f = -123. assignment. gcc-2.8.0 reportedly
10921 optimized the whole file away
10923 /* Store the number in a writable string for gcc to pass to
10924 sscanf under HP/UX.
10926 sprintf(str, "-123");
10927 sscanf(str, "%lf", &f); /* f = -123.; */
10929 signal(SIGFPE, blech);
10930 along = (unsigned long)f;
10931 aint = (unsigned int)f;
10932 ashort = (unsigned short)f;
10933 if (along != (unsigned long)-123)
10935 if (aint != (unsigned int)-123)
10937 if (ashort != (unsigned short)-123)
10939 sprintf(str, "1073741824.");
10940 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
10943 along = (unsigned long)f;
10944 if (along != 0x80000000)
10948 along = (unsigned long)f;
10949 if (along != 0x7fffffff)
10953 along = (unsigned long)f;
10954 if (along != 0x80000001)
10958 signal(SIGFPE, blech_in_list);
10959 sprintf(str, "123.");
10960 sscanf(str, "%lf", &f); /* f = 123.; */
10961 along = dummy_long((unsigned long)f);
10962 aint = dummy_int((unsigned int)f);
10963 ashort = dummy_short((unsigned short)f);
10964 if (along != (unsigned long)123)
10966 if (aint != (unsigned int)123)
10968 if (ashort != (unsigned short)123)
10975 if eval $compile_ok; then
10979 echo "(I can't seem to compile the test program--assuming it can't)"
10982 case "$castflags" in
10984 echo "Yup, it can."
10987 echo "Nope, it can't."
10994 : see if vprintf exists
10996 if set vprintf val -f d_vprintf; eval $csym; $val; then
10997 echo 'vprintf() found.' >&4
11000 #$i_stdarg I_STDARG /* Only one of these can be defined by i_varhrd */
11001 #$i_varargs I_VARARGS
11003 #$i_stdlib I_STDLIB
11004 #$i_unistd I_UNISTD
11007 # include <stdarg.h>
11008 #else /* I_VARARGS */
11009 # include <varargs.h>
11013 # include <unistd.h>
11017 # include <stdlib.h>
11020 #include <stdio.h> /* vsprintf prototype */
11023 void xxx(int n, ...)
11028 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11030 int main() { xxx(1, "foo"); }
11032 #else /* I_VARARGS */
11040 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11042 int main() { xxx("foo"); }
11048 if eval $compile_ok; then
11049 if $run ./try; then
11050 echo "Your vsprintf() returns (int)." >&4
11053 echo "Your vsprintf() returns (char*)." >&4
11057 echo 'I am unable to compile the vsprintf() test program.' >&4
11058 # We shouldn't get here. If we do, assume the standard signature,
11059 # not the old BSD one.
11060 echo 'Guessing that vsprintf() returns (int).' >&4
11064 echo 'vprintf() NOT found.' >&4
11075 : see if chown exists
11079 : see if chroot exists
11080 set chroot d_chroot
11083 : see if chsize exists
11084 set chsize d_chsize
11087 : see if class exists
11091 : see if clearenv exists
11092 set clearenv d_clearenv
11095 : Define hasstruct macro for Configure internal use
11096 hasstruct='varname=$1; struct=$2; shift; shift;
11097 while $test $# -ge 2; do
11099 $define) echo "#include <$2>";;
11103 echo "int main () { struct $struct foo; }" >> try.c;
11105 if eval $compile; then
11114 : see whether socket exists
11118 $echo $n "Hmm... $c" >&4
11119 if set socket val -f d_socket; eval $csym; $val; then
11120 echo "Looks like you have Berkeley networking support." >&4
11122 if set setsockopt val -f; eval $csym; $val; then
11125 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
11126 d_oldsock="$define"
11129 if $contains socklib libc.list >/dev/null 2>&1; then
11130 echo "Looks like you have Berkeley networking support." >&4
11132 : we will have to assume that it supports the 4.2 BSD interface
11135 echo "You don't have Berkeley networking in libc$_a..." >&4
11136 if test "X$d_socket" = "X$define"; then
11137 echo "...but you seem to believe that you have sockets." >&4
11139 for net in net socket
11141 if test -f /usr/lib/lib$net$_a; then
11142 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
11143 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
11144 if $contains socket libc.list >/dev/null 2>&1; then
11149 echo "...but the Wollongong group seems to have hacked it in." >&4
11150 sockethdr="-I/usr/netinclude"
11153 echo "Found Berkeley sockets interface in lib$net." >&4
11154 if $contains setsockopt libc.list >/dev/null 2>&1; then
11157 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
11158 d_oldsock="$define"
11164 if test "X$d_socket" != "X$define"; then
11165 echo "or anywhere else I see." >&4
11173 : see if socketpair exists
11174 set socketpair d_sockpair
11179 echo "Checking the availability of certain socket constants..." >&4
11180 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
11181 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
11183 #include <sys/types.h>
11184 #include <sys/socket.h>
11190 set try; if eval $compile; then
11193 set d_${enum}; eval $setvar
11197 : see if this is a sys/uio.h system
11198 set sys/uio.h i_sysuio
11201 : Check for cmsghdr support
11203 echo "Checking to see if your system supports struct cmsghdr..." >&4
11204 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
11206 case "$d_cmsghdr_s" in
11207 "$define") echo "Yes, it does." ;;
11208 *) echo "No, it doesn't." ;;
11212 : check for const keyword
11214 echo 'Checking to see if your C compiler knows about "const"...' >&4
11215 $cat >const.c <<'EOCP'
11216 typedef struct spug { int drokk; } spug;
11220 const spug y = { 0 };
11223 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
11225 echo "Yup, it does."
11228 echo "Nope, it doesn't."
11233 : see if copysignl exists
11234 set copysignl d_copysignl
11237 : see if crypt exists
11242 $define) cryptlib='' ;;
11243 *) if set crypt val -f d_crypt; eval $csym; $val; then
11244 echo 'crypt() found.' >&4
11248 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
11249 if $test -z "$cryptlib"; then
11250 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
11254 if $test -z "$cryptlib"; then
11255 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
11259 if $test -z "$cryptlib"; then
11260 cryptlib=`./loc libcrypt$_a "" $libpth`
11264 if $test -z "$cryptlib"; then
11265 echo 'crypt() NOT found.' >&4
11276 : see if this is a crypt.h system
11277 set crypt.h i_crypt
11280 : see if crypt_r exists
11281 set crypt_r d_crypt_r
11283 case "$d_crypt_r" in
11285 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
11286 case "$d_crypt_r_proto:$usethreads" in
11287 ":define") d_crypt_r_proto=define
11288 set d_crypt_r_proto crypt_r $hdrs
11292 case "$d_crypt_r_proto" in
11294 case "$crypt_r_proto" in
11295 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
11296 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCS ;;
11298 case "$crypt_r_proto" in
11299 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
11300 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCD ;;
11302 case "$crypt_r_proto" in
11303 ''|0) d_crypt_r=undef
11305 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
11306 * ) case "$crypt_r_proto" in
11307 REENTRANT_PROTO*) ;;
11308 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
11310 echo "Prototype: $try" ;;
11313 *) case "$usethreads" in
11314 define) echo "crypt_r has no prototype, not using it." >&4 ;;
11325 : get csh whereabouts
11327 'csh') val="$undef" ;;
11328 *) val="$define" ;;
11332 : Respect a hint or command line value for full_csh.
11333 case "$full_csh" in
11334 '') full_csh=$csh ;;
11337 : see if ctermid exists
11338 set ctermid d_ctermid
11341 : see if ctermid_r exists
11342 set ctermid_r d_ctermid_r
11344 case "$d_ctermid_r" in
11346 hdrs="$i_systypes sys/types.h define stdio.h "
11347 case "$d_ctermid_r_proto:$usethreads" in
11348 ":define") d_ctermid_r_proto=define
11349 set d_ctermid_r_proto ctermid_r $hdrs
11353 case "$d_ctermid_r_proto" in
11355 case "$ctermid_r_proto" in
11356 ''|0) try='char* ctermid_r(char*);'
11357 ./protochk "extern $try" $hdrs && ctermid_r_proto=B_B ;;
11359 case "$ctermid_r_proto" in
11360 ''|0) d_ctermid_r=undef
11362 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
11363 * ) case "$ctermid_r_proto" in
11364 REENTRANT_PROTO*) ;;
11365 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
11367 echo "Prototype: $try" ;;
11370 *) case "$usethreads" in
11371 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
11378 *) ctermid_r_proto=0
11382 : see if ctime_r exists
11383 set ctime_r d_ctime_r
11385 case "$d_ctime_r" in
11387 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
11388 case "$d_ctime_r_proto:$usethreads" in
11389 ":define") d_ctime_r_proto=define
11390 set d_ctime_r_proto ctime_r $hdrs
11394 case "$d_ctime_r_proto" in
11396 case "$ctime_r_proto" in
11397 ''|0) try='char* ctime_r(const time_t*, char*);'
11398 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SB ;;
11400 case "$ctime_r_proto" in
11401 ''|0) try='char* ctime_r(const time_t*, char*, int);'
11402 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SBI ;;
11404 case "$ctime_r_proto" in
11405 ''|0) try='int ctime_r(const time_t*, char*);'
11406 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SB ;;
11408 case "$ctime_r_proto" in
11409 ''|0) try='int ctime_r(const time_t*, char*, int);'
11410 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SBI ;;
11412 case "$ctime_r_proto" in
11413 ''|0) d_ctime_r=undef
11415 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
11416 * ) case "$ctime_r_proto" in
11417 REENTRANT_PROTO*) ;;
11418 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
11420 echo "Prototype: $try" ;;
11423 *) case "$usethreads" in
11424 define) echo "ctime_r has no prototype, not using it." >&4 ;;
11435 : see if cuserid exists
11436 set cuserid d_cuserid
11439 : see if this is a limits.h system
11440 set limits.h i_limits
11443 : see if this is a float.h system
11444 set float.h i_float
11447 : See if number of significant digits in a double precision number is known
11449 $cat >dbl_dig.c <<EOM
11450 #$i_limits I_LIMITS
11453 #include <limits.h>
11459 printf("Contains DBL_DIG");
11462 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
11463 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
11464 echo "DBL_DIG found." >&4
11467 echo "DBL_DIG NOT found." >&4
11474 : see if dbm.h is available
11475 : see if dbmclose exists
11476 set dbmclose d_dbmclose
11479 case "$d_dbmclose" in
11489 *) set rpcsvc/dbm.h i_rpcsvcdbm
11494 *) echo "We won't be including <dbm.h>"
11504 : see if prototype for dbminit is available
11506 set d_dbminitproto dbminit $i_dbm dbm.h
11509 : see if difftime exists
11510 set difftime d_difftime
11513 : see if this is a dirent system
11515 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
11517 echo "<dirent.h> found." >&4
11520 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
11521 echo "<sys/dir.h> found." >&4
11524 xinc=`./findhdr sys/ndir.h`
11526 echo "<dirent.h> NOT found." >&4
11531 : Look for type of directory structure.
11533 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11535 case "$direntrytype" in
11537 case "$i_dirent" in
11538 $define) guess1='struct dirent' ;;
11539 *) guess1='struct direct' ;;
11542 *) guess1="$direntrytype"
11547 'struct dirent') guess2='struct direct' ;;
11548 *) guess2='struct dirent' ;;
11551 if $contains "$guess1" try.c >/dev/null 2>&1; then
11552 direntrytype="$guess1"
11553 echo "Your directory entries are $direntrytype." >&4
11554 elif $contains "$guess2" try.c >/dev/null 2>&1; then
11555 direntrytype="$guess2"
11556 echo "Your directory entries seem to be $direntrytype." >&4
11558 echo "I don't recognize your system's directory entries." >&4
11559 rp="What type is used for directory entries on this system?"
11562 direntrytype="$ans"
11566 : see if the directory entry stores field length
11568 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11569 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
11570 echo "Good, your directory entry keeps length information in d_namlen." >&4
11573 echo "Your directory entry does not know about the d_namlen field." >&4
11580 : Look for DIR.dd_fd
11581 case "$i_dirent" in
11583 echo "Checking to see if DIR has a dd_fd member variable" >&4
11585 #$i_stdlib I_STDLIB
11587 #include <stdlib.h>
11589 #include <dirent.h>
11599 if eval $compile; then
11600 echo "Yes, it does."
11603 echo "No, it does not."
11608 echo "You don't have a <dirent.h>, so not checking for dd_fd." >&4
11616 : see if this is an sysdir system
11617 set sys/dir.h i_sysdir
11620 : see if this is an sysndir system
11621 set sys/ndir.h i_sysndir
11626 $cat >dirfd.c <<EOM
11628 #$i_stdlib I_STDLIB
11630 #include <stdlib.h>
11632 #$i_dirent I_DIRENT /**/
11633 #$i_sysdir I_SYS_DIR /**/
11634 #$i_sysndir I_SYS_NDIR /**/
11635 #$i_systypes I_SYS_TYPES /**/
11636 #if defined(I_SYS_TYPES)
11637 #include <sys/types.h>
11639 #if defined(I_DIRENT)
11640 #include <dirent.h>
11641 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
11642 #include <sys/dir.h>
11646 #include <sys/ndir.h>
11650 #include <ndir.h> /* may be wrong in the future */
11652 #include <sys/dir.h>
11658 DIR *dirp = opendir(".");
11659 if (dirfd(dirp) >= 0)
11667 if eval $compile; then
11671 $define) echo "dirfd() found." >&4 ;;
11672 *) echo "dirfd() NOT found." >&4 ;;
11678 : see if dlerror exists
11681 set dlerror d_dlerror
11685 : see if dlfcn is available
11686 set dlfcn.h i_dlfcn
11689 : Check what extension to use for shared libs
11694 On a few systems, the dynamically loaded modules that perl generates and uses
11695 will need a different extension than shared libs. The default will probably
11701 *) dflt="$dlext" ;;
11703 rp='What is the extension of dynamically loaded modules'
11712 : Check if dlsym need a leading underscore
11718 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
11719 $cat >dyna.c <<'EOM'
11726 #$i_stdlib I_STDLIB
11728 #include <stdlib.h>
11732 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
11734 #include <sys/types.h>
11739 extern int fred() ;
11748 int mode = RTLD_LAZY ;
11750 handle = dlopen("./dyna.$dlext", mode) ;
11751 if (handle == NULL) {
11756 symbol = dlsym(handle, "fred") ;
11757 if (symbol == NULL) {
11758 /* try putting a leading underscore */
11759 symbol = dlsym(handle, "_fred") ;
11760 if (symbol == NULL) {
11773 : Call the object file tmp-dyna.o in case dlext=o.
11774 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
11775 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
11776 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
11777 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
11780 1) echo "Test program failed using dlopen." >&4
11781 echo "Perhaps you should not use dynamic loading." >&4;;
11782 2) echo "Test program failed using dlsym." >&4
11783 echo "Perhaps you should not use dynamic loading." >&4;;
11784 3) echo "dlsym needs a leading underscore" >&4
11786 4) echo "dlsym doesn't need a leading underscore." >&4;;
11789 echo "I can't compile and run the test program." >&4
11790 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
11795 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
11800 : see if drand48_r exists
11801 set drand48_r d_drand48_r
11803 case "$d_drand48_r" in
11805 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
11806 case "$d_drand48_r_proto:$usethreads" in
11807 ":define") d_drand48_r_proto=define
11808 set d_drand48_r_proto drand48_r $hdrs
11812 case "$d_drand48_r_proto" in
11814 case "$drand48_r_proto" in
11815 ''|0) try='int drand48_r(struct drand48_data*, double*);'
11816 ./protochk "extern $try" $hdrs && drand48_r_proto=I_ST ;;
11818 case "$drand48_r_proto" in
11819 ''|0) d_drand48_r=undef
11821 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
11822 * ) case "$drand48_r_proto" in
11823 REENTRANT_PROTO*) ;;
11824 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
11826 echo "Prototype: $try" ;;
11829 *) case "$usethreads" in
11830 define) echo "drand48_r has no prototype, not using it." >&4 ;;
11837 *) drand48_r_proto=0
11841 : see if prototype for drand48 is available
11843 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
11846 : see if dup2 exists
11850 : see if eaccess exists
11851 set eaccess d_eaccess
11854 : see if endgrent exists
11855 set endgrent d_endgrent
11858 : see if this is an grp system
11864 xxx=`./findhdr grp.h`
11865 $cppstdin $cppflags $cppminus < $xxx >$$.h
11867 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
11879 set d_grpasswd; eval $setvar
11883 : see if endgrent_r exists
11884 set endgrent_r d_endgrent_r
11886 case "$d_endgrent_r" in
11888 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
11889 case "$d_endgrent_r_proto:$usethreads" in
11890 ":define") d_endgrent_r_proto=define
11891 set d_endgrent_r_proto endgrent_r $hdrs
11895 case "$d_endgrent_r_proto" in
11897 case "$endgrent_r_proto" in
11898 ''|0) try='int endgrent_r(FILE**);'
11899 ./protochk "extern $try" $hdrs && endgrent_r_proto=I_H ;;
11901 case "$endgrent_r_proto" in
11902 ''|0) try='void endgrent_r(FILE**);'
11903 ./protochk "extern $try" $hdrs && endgrent_r_proto=V_H ;;
11905 case "$endgrent_r_proto" in
11906 ''|0) d_endgrent_r=undef
11908 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
11909 * ) case "$endgrent_r_proto" in
11910 REENTRANT_PROTO*) ;;
11911 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
11913 echo "Prototype: $try" ;;
11916 *) case "$usethreads" in
11917 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
11924 *) endgrent_r_proto=0
11928 : see if endhostent exists
11929 set endhostent d_endhent
11932 : see if this is a netdb.h system
11933 set netdb.h i_netdb
11936 : see if endhostent_r exists
11937 set endhostent_r d_endhostent_r
11939 case "$d_endhostent_r" in
11941 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11942 case "$d_endhostent_r_proto:$usethreads" in
11943 ":define") d_endhostent_r_proto=define
11944 set d_endhostent_r_proto endhostent_r $hdrs
11948 case "$d_endhostent_r_proto" in
11950 case "$endhostent_r_proto" in
11951 ''|0) try='int endhostent_r(struct hostent_data*);'
11952 ./protochk "extern $try" $hdrs && endhostent_r_proto=I_D ;;
11954 case "$endhostent_r_proto" in
11955 ''|0) try='void endhostent_r(struct hostent_data*);'
11956 ./protochk "extern $try" $hdrs && endhostent_r_proto=V_D ;;
11958 case "$endhostent_r_proto" in
11959 ''|0) d_endhostent_r=undef
11960 endhostent_r_proto=0
11961 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
11962 * ) case "$endhostent_r_proto" in
11963 REENTRANT_PROTO*) ;;
11964 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
11966 echo "Prototype: $try" ;;
11969 *) case "$usethreads" in
11970 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
11972 d_endhostent_r=undef
11973 endhostent_r_proto=0
11977 *) endhostent_r_proto=0
11981 : see if endnetent exists
11982 set endnetent d_endnent
11985 : see if endnetent_r exists
11986 set endnetent_r d_endnetent_r
11988 case "$d_endnetent_r" in
11990 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11991 case "$d_endnetent_r_proto:$usethreads" in
11992 ":define") d_endnetent_r_proto=define
11993 set d_endnetent_r_proto endnetent_r $hdrs
11997 case "$d_endnetent_r_proto" in
11999 case "$endnetent_r_proto" in
12000 ''|0) try='int endnetent_r(struct netent_data*);'
12001 ./protochk "extern $try" $hdrs && endnetent_r_proto=I_D ;;
12003 case "$endnetent_r_proto" in
12004 ''|0) try='void endnetent_r(struct netent_data*);'
12005 ./protochk "extern $try" $hdrs && endnetent_r_proto=V_D ;;
12007 case "$endnetent_r_proto" in
12008 ''|0) d_endnetent_r=undef
12009 endnetent_r_proto=0
12010 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
12011 * ) case "$endnetent_r_proto" in
12012 REENTRANT_PROTO*) ;;
12013 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
12015 echo "Prototype: $try" ;;
12018 *) case "$usethreads" in
12019 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
12021 d_endnetent_r=undef
12022 endnetent_r_proto=0
12026 *) endnetent_r_proto=0
12030 : see if endprotoent exists
12031 set endprotoent d_endpent
12034 : see if endprotoent_r exists
12035 set endprotoent_r d_endprotoent_r
12037 case "$d_endprotoent_r" in
12039 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12040 case "$d_endprotoent_r_proto:$usethreads" in
12041 ":define") d_endprotoent_r_proto=define
12042 set d_endprotoent_r_proto endprotoent_r $hdrs
12046 case "$d_endprotoent_r_proto" in
12048 case "$endprotoent_r_proto" in
12049 ''|0) try='int endprotoent_r(struct protoent_data*);'
12050 ./protochk "extern $try" $hdrs && endprotoent_r_proto=I_D ;;
12052 case "$endprotoent_r_proto" in
12053 ''|0) try='void endprotoent_r(struct protoent_data*);'
12054 ./protochk "extern $try" $hdrs && endprotoent_r_proto=V_D ;;
12056 case "$endprotoent_r_proto" in
12057 ''|0) d_endprotoent_r=undef
12058 endprotoent_r_proto=0
12059 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
12060 * ) case "$endprotoent_r_proto" in
12061 REENTRANT_PROTO*) ;;
12062 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
12064 echo "Prototype: $try" ;;
12067 *) case "$usethreads" in
12068 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
12070 d_endprotoent_r=undef
12071 endprotoent_r_proto=0
12075 *) endprotoent_r_proto=0
12079 : see if endpwent exists
12080 set endpwent d_endpwent
12083 : see if this is a pwd.h system
12089 xxx=`./findhdr pwd.h`
12090 $cppstdin $cppflags $cppminus < $xxx >$$.h
12092 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
12100 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
12108 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
12116 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
12124 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
12132 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
12140 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
12148 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
12160 set d_pwquota; eval $setvar
12161 set d_pwage; eval $setvar
12162 set d_pwchange; eval $setvar
12163 set d_pwclass; eval $setvar
12164 set d_pwexpire; eval $setvar
12165 set d_pwcomment; eval $setvar
12166 set d_pwgecos; eval $setvar
12167 set d_pwpasswd; eval $setvar
12171 : see if endpwent_r exists
12172 set endpwent_r d_endpwent_r
12174 case "$d_endpwent_r" in
12176 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
12177 case "$d_endpwent_r_proto:$usethreads" in
12178 ":define") d_endpwent_r_proto=define
12179 set d_endpwent_r_proto endpwent_r $hdrs
12183 case "$d_endpwent_r_proto" in
12185 case "$endpwent_r_proto" in
12186 ''|0) try='int endpwent_r(FILE**);'
12187 ./protochk "extern $try" $hdrs && endpwent_r_proto=I_H ;;
12189 case "$endpwent_r_proto" in
12190 ''|0) try='void endpwent_r(FILE**);'
12191 ./protochk "extern $try" $hdrs && endpwent_r_proto=V_H ;;
12193 case "$endpwent_r_proto" in
12194 ''|0) d_endpwent_r=undef
12196 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
12197 * ) case "$endpwent_r_proto" in
12198 REENTRANT_PROTO*) ;;
12199 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
12201 echo "Prototype: $try" ;;
12204 *) case "$usethreads" in
12205 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
12212 *) endpwent_r_proto=0
12216 : see if endservent exists
12217 set endservent d_endsent
12220 : see if endservent_r exists
12221 set endservent_r d_endservent_r
12223 case "$d_endservent_r" in
12225 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12226 case "$d_endservent_r_proto:$usethreads" in
12227 ":define") d_endservent_r_proto=define
12228 set d_endservent_r_proto endservent_r $hdrs
12232 case "$d_endservent_r_proto" in
12234 case "$endservent_r_proto" in
12235 ''|0) try='int endservent_r(struct servent_data*);'
12236 ./protochk "extern $try" $hdrs && endservent_r_proto=I_D ;;
12238 case "$endservent_r_proto" in
12239 ''|0) try='void endservent_r(struct servent_data*);'
12240 ./protochk "extern $try" $hdrs && endservent_r_proto=V_D ;;
12242 case "$endservent_r_proto" in
12243 ''|0) d_endservent_r=undef
12244 endservent_r_proto=0
12245 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
12246 * ) case "$endservent_r_proto" in
12247 REENTRANT_PROTO*) ;;
12248 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
12250 echo "Prototype: $try" ;;
12253 *) case "$usethreads" in
12254 define) echo "endservent_r has no prototype, not using it." >&4 ;;
12256 d_endservent_r=undef
12257 endservent_r_proto=0
12261 *) endservent_r_proto=0
12265 : Locate the flags for 'open()'
12268 #include <sys/types.h>
12273 #include <sys/file.h>
12275 #$i_stdlib I_STDLIB
12277 #include <stdlib.h>
12288 : check sys/file.h first to get FREAD on Sun
12289 if $test `./findhdr sys/file.h` && \
12290 set try -DI_SYS_FILE && eval $compile; then
12292 echo "<sys/file.h> defines the O_* constants..." >&4
12293 if $run ./try; then
12294 echo "and you have the 3 argument form of open()." >&4
12297 echo "but not the 3 argument form of open(). Oh, well." >&4
12300 elif $test `./findhdr fcntl.h` && \
12301 set try -DI_FCNTL && eval $compile; then
12303 echo "<fcntl.h> defines the O_* constants..." >&4
12304 if $run ./try; then
12305 echo "and you have the 3 argument form of open()." >&4
12308 echo "but not the 3 argument form of open(). Oh, well." >&4
12313 echo "I can't find the O_* constant definitions! You got problems." >&4
12319 : script used to emit important warnings
12322 if test \$# -gt 0; then
12327 echo "*** WARNING:" >&4
12328 sed -e 's/^/*** /' <msg >&4
12330 cat msg >>config.msg
12331 echo " " >>config.msg
12337 : see which of string.h or strings.h is needed
12339 strings=`./findhdr string.h`
12340 if $test "$strings" && $test -r "$strings"; then
12341 echo "Using <string.h> instead of <strings.h>." >&4
12345 strings=`./findhdr strings.h`
12346 if $test "$strings" && $test -r "$strings"; then
12347 echo "Using <strings.h> instead of <string.h>." >&4
12349 ./warn "No string header found -- You'll surely have problems."
12354 case "$i_string" in
12355 "$undef") strings=`./findhdr strings.h`;;
12356 *) strings=`./findhdr string.h`;;
12359 : see if this is a sys/file.h system
12364 : do we need to include sys/file.h ?
12368 if $h_sysfile; then
12370 echo "We'll be including <sys/file.h>." >&4
12373 echo "We won't be including <sys/file.h>." >&4
12383 : see if fcntl.h is there
12388 : see if we can include fcntl.h
12394 echo "We'll be including <fcntl.h>." >&4
12397 if $h_sysfile; then
12398 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
12400 echo "We won't be including <fcntl.h>." >&4
12412 : see if fork exists
12416 : see if pipe exists
12420 : check for non-blocking I/O stuff
12421 case "$h_sysfile" in
12422 true) echo "#include <sys/file.h>" > head.c;;
12425 true) echo "#include <fcntl.h>" > head.c;;
12426 *) echo "#include <sys/fcntl.h>" > head.c;;
12431 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
12432 case "$o_nonblock" in
12434 $cat head.c > try.c
12435 $cat >>try.c <<EOCP
12437 #$i_stdlib I_STDLIB
12439 #include <stdlib.h>
12447 printf("O_NONBLOCK\n");
12451 printf("O_NDELAY\n");
12455 printf("FNDELAY\n");
12462 if eval $compile_ok; then
12463 o_nonblock=`$run ./try`
12464 case "$o_nonblock" in
12465 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
12466 *) echo "Seems like we can use $o_nonblock.";;
12469 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
12472 *) echo "Using $hint value $o_nonblock.";;
12477 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
12480 case "$d_fork:$d_pipe" in
12482 $cat head.c > try.c
12483 $cat >>try.c <<EOCP
12485 #include <sys/types.h>
12486 #include <signal.h>
12488 #$i_stdlib I_STDLIB
12490 #include <stdlib.h>
12496 #define MY_O_NONBLOCK $o_nonblock
12497 #ifndef errno /* XXX need better Configure test */
12500 #$i_unistd I_UNISTD
12502 #include <unistd.h>
12504 #$i_string I_STRING
12506 #include <string.h>
12508 #include <strings.h>
12510 $signal_t blech(int x) { exit(3); }
12512 $cat >> try.c <<'EOCP'
12520 pipe(pd); /* Down: child -> parent */
12521 pipe(pu); /* Up: parent -> child */
12524 close(pd[1]); /* Parent reads from pd[0] */
12525 close(pu[0]); /* Parent writes (blocking) to pu[1] */
12527 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
12532 signal(SIGALRM, blech);
12534 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
12536 sprintf(string, "%d\n", ret);
12537 write(2, string, strlen(string));
12540 if (errno == EAGAIN) {
12541 printf("EAGAIN\n");
12546 if (errno == EWOULDBLOCK)
12547 printf("EWOULDBLOCK\n");
12550 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
12551 sleep(2); /* Give it time to close our pipe */
12553 ret = read(pd[0], buf, 1); /* Should read EOF */
12555 sprintf(string, "%d\n", ret);
12556 write(4, string, strlen(string));
12560 close(pd[0]); /* We write to pd[1] */
12561 close(pu[1]); /* We read from pu[0] */
12562 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
12563 close(pd[1]); /* Pipe pd is now fully closed! */
12564 exit(0); /* Bye bye, thank you for playing! */
12568 if eval $compile_ok; then
12569 echo "$startsh" >mtry
12570 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
12572 ./mtry >/dev/null 2>&1
12574 0) eagain=`$cat try.out`;;
12575 1) echo "Could not perform non-blocking setting!";;
12576 2) echo "I did a successful read() for something that was not there!";;
12577 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
12578 4) echo "Could not find F_SETFL!";;
12579 *) echo "Something terribly wrong happened during testing.";;
12581 rd_nodata=`$cat try.ret`
12582 echo "A read() system call with no data present returns $rd_nodata."
12583 case "$rd_nodata" in
12586 echo "(That's peculiar, fixing that to be -1.)"
12592 echo "Forcing errno EAGAIN on read() with no data available."
12596 echo "Your read() sets errno to $eagain when no data is available."
12599 status=`$cat try.err`
12601 0) echo "And it correctly returns 0 to signal EOF.";;
12602 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
12603 *) echo "However, your read() returns '$status' on EOF??";;
12606 if test "$status" = "$rd_nodata"; then
12607 echo "WARNING: you can't distinguish between EOF and no data!"
12611 echo "I can't compile the test program--assuming errno EAGAIN will do."
12615 *) echo "Can't figure out how to test this--assuming errno EAGAIN will do."
12624 echo "Using $hint value $eagain."
12625 echo "Your read() returns $rd_nodata when no data is present."
12626 case "$d_eofnblk" in
12627 "$define") echo "And you can see EOF because read() returns 0.";;
12628 "$undef") echo "But you can't see EOF status from read() returned value.";;
12630 echo "(Assuming you can't see EOF status from read anyway.)"
12636 $rm_try head.c mtry
12638 : see if _ptr and _cnt from stdio act std
12641 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
12642 echo "(Looks like you have stdio.h from BSD.)"
12643 case "$stdio_ptr" in
12644 '') stdio_ptr='((fp)->_p)'
12647 *) ptr_lval=$d_stdio_ptr_lval;;
12649 case "$stdio_cnt" in
12650 '') stdio_cnt='((fp)->_r)'
12653 *) cnt_lval=$d_stdio_cnt_lval;;
12655 case "$stdio_base" in
12656 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
12658 case "$stdio_bufsiz" in
12659 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
12661 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
12662 echo "(Looks like you have stdio.h from Linux.)"
12663 case "$stdio_ptr" in
12664 '') stdio_ptr='((fp)->_IO_read_ptr)'
12667 *) ptr_lval=$d_stdio_ptr_lval;;
12669 case "$stdio_cnt" in
12670 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
12673 *) cnt_lval=$d_stdio_cnt_lval;;
12675 case "$stdio_base" in
12676 '') stdio_base='((fp)->_IO_read_base)';;
12678 case "$stdio_bufsiz" in
12679 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
12682 case "$stdio_ptr" in
12683 '') stdio_ptr='((fp)->_ptr)'
12686 *) ptr_lval=$d_stdio_ptr_lval;;
12688 case "$stdio_cnt" in
12689 '') stdio_cnt='((fp)->_cnt)'
12692 *) cnt_lval=$d_stdio_cnt_lval;;
12694 case "$stdio_base" in
12695 '') stdio_base='((fp)->_base)';;
12697 case "$stdio_bufsiz" in
12698 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
12702 : test whether _ptr and _cnt really work
12703 echo "Checking how std your stdio is..." >&4
12706 #$i_stdlib I_STDLIB
12708 #include <stdlib.h>
12710 #define FILE_ptr(fp) $stdio_ptr
12711 #define FILE_cnt(fp) $stdio_cnt
12713 FILE *fp = fopen("try.c", "r");
12716 18 <= FILE_cnt(fp) &&
12717 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12725 if eval $compile && $to try.c; then
12726 if $run ./try; then
12727 echo "Your stdio acts pretty std."
12730 echo "Your stdio isn't very std."
12733 echo "Your stdio doesn't appear very std."
12737 # glibc 2.2.90 and above apparently change stdio streams so Perl's
12738 # direct buffer manipulation no longer works. The Configure tests
12739 # should be changed to correctly detect this, but until then,
12740 # the following check should at least let perl compile and run.
12741 # (This quick fix should be updated before 5.8.1.)
12742 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
12743 # A. Dougherty, June 3, 2002.
12744 case "$d_gnulibc" in
12746 case "$gnulibc_version" in
12750 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
12759 : Can _ptr be used as an lvalue?
12760 case "$d_stdstdio$ptr_lval" in
12761 $define$define) val=$define ;;
12764 set d_stdio_ptr_lval
12767 : Can _cnt be used as an lvalue?
12768 case "$d_stdstdio$cnt_lval" in
12769 $define$define) val=$define ;;
12772 set d_stdio_cnt_lval
12776 : test whether setting _ptr sets _cnt as a side effect
12777 d_stdio_ptr_lval_sets_cnt="$undef"
12778 d_stdio_ptr_lval_nochange_cnt="$undef"
12779 case "$d_stdio_ptr_lval$d_stdstdio" in
12781 echo "Checking to see what happens if we set the stdio ptr..." >&4
12784 /* Can we scream? */
12785 /* Eat dust sed :-) */
12786 /* In the buffer space, no one can hear you scream. */
12787 #$i_stdlib I_STDLIB
12789 #include <stdlib.h>
12791 #define FILE_ptr(fp) $stdio_ptr
12792 #define FILE_cnt(fp) $stdio_cnt
12793 #include <sys/types.h>
12795 FILE *fp = fopen("try.c", "r");
12800 puts("Fail even to read");
12803 c = getc(fp); /* Read away the first # */
12805 puts("Fail even to read");
12809 18 <= FILE_cnt(fp) &&
12810 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12812 puts("Fail even to read");
12815 ptr = (char*) FILE_ptr(fp);
12816 cnt = (size_t)FILE_cnt(fp);
12818 FILE_ptr(fp) += 42;
12820 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
12821 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
12824 if (FILE_cnt(fp) <= 20) {
12825 printf ("Fail (<20 chars to test)");
12828 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
12829 puts("Fail compare");
12832 if (cnt == FILE_cnt(fp)) {
12833 puts("Pass_unchanged");
12836 if (FILE_cnt(fp) == (cnt - 42)) {
12837 puts("Pass_changed");
12840 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
12846 if eval $compile && $to try.c; then
12847 case `$run ./try` in
12849 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
12850 d_stdio_ptr_lval_sets_cnt="$define" ;;
12852 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
12853 d_stdio_ptr_lval_nochange_cnt="$define" ;;
12855 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
12857 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
12860 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
12866 : see if _base is also standard
12868 case "$d_stdstdio" in
12872 #$i_stdlib I_STDLIB
12874 #include <stdlib.h>
12876 #define FILE_base(fp) $stdio_base
12877 #define FILE_bufsiz(fp) $stdio_bufsiz
12879 FILE *fp = fopen("try.c", "r");
12882 19 <= FILE_bufsiz(fp) &&
12883 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
12890 if eval $compile && $to try.c; then
12891 if $run ./try; then
12892 echo "And its _base field acts std."
12895 echo "But its _base field isn't std."
12898 echo "However, it seems to be lacking the _base field."
12906 : see if fast_stdio exists
12908 case "$d_stdstdio:$d_stdio_ptr_lval" in
12910 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
12912 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
12923 : see if fchdir exists
12924 set fchdir d_fchdir
12927 : see if fchmod exists
12928 set fchmod d_fchmod
12931 : see if fchown exists
12932 set fchown d_fchown
12935 : see if this is an fcntl system
12939 : See if fcntl-based locking works.
12942 #$i_stdlib I_STDLIB
12944 #include <stdlib.h>
12946 #include <unistd.h>
12948 #include <signal.h>
12949 $signal_t blech(int x) { exit(3); }
12951 #if defined(F_SETLK) && defined(F_SETLKW)
12952 struct flock flock;
12954 fd = open("try.c", O_RDONLY);
12955 flock.l_type = F_RDLCK;
12956 flock.l_whence = SEEK_SET;
12957 flock.l_start = flock.l_len = 0;
12958 signal(SIGALRM, blech);
12960 retval = fcntl(fd, F_SETLK, &flock);
12962 (retval < 0 ? exit(2) : exit(0));
12968 echo "Checking if fcntl-based file locking works... "
12972 if eval $compile_ok; then
12973 if $run ./try; then
12974 echo "Yes, it seems to work."
12977 echo "Nope, it didn't work."
12982 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
12983 *** This is (almost) impossible.
12984 *** If your NFS lock daemons are not feeling well, something like
12985 *** this may happen, please investigate. Cannot continue, aborting.
12993 echo "I'm unable to compile the test program, so I'll assume not."
12998 echo "Nope, since you don't even have fcntl()."
13001 set d_fcntl_can_lock
13005 : check for fd_set items
13008 Checking to see how well your C compiler handles fd_set and friends ...
13011 #$i_stdlib I_STDLIB
13013 #include <stdlib.h>
13015 #$i_systime I_SYS_TIME
13016 #$i_sysselct I_SYS_SELECT
13017 #$d_socket HAS_SOCKET
13018 #include <sys/types.h>
13020 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
13023 #include <sys/time.h>
13025 #ifdef I_SYS_SELECT
13026 #include <sys/select.h>
13035 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
13043 if eval $compile; then
13044 d_fds_bits="$define"
13046 echo "Well, your system knows about the normal fd_set typedef..." >&4
13047 if $run ./try; then
13048 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
13049 d_fd_macros="$define"
13052 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
13054 d_fd_macros="$undef"
13058 Hmm, your compiler has some difficulty with fd_set. Checking further...
13061 if eval $compile; then
13062 d_fds_bits="$undef"
13064 echo "Well, your system has some sort of fd_set available..." >&4
13065 if $run ./try; then
13066 echo "and you have the normal fd_set macros." >&4
13067 d_fd_macros="$define"
13070 but not the normal fd_set macros! Gross! More work for me...
13072 d_fd_macros="$undef"
13075 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
13077 d_fds_bits="$undef"
13078 d_fd_macros="$undef"
13083 : see if fgetpos exists
13084 set fgetpos d_fgetpos
13087 : see if finite exists
13088 set finite d_finite
13091 : see if finitel exists
13092 set finitel d_finitel
13095 : see if flock exists
13099 : see if prototype for flock is available
13101 set d_flockproto flock $i_sysfile sys/file.h
13104 : see if fp_class exists
13105 set fp_class d_fp_class
13108 : see if pathconf exists
13109 set pathconf d_pathconf
13112 : see if fpathconf exists
13113 set fpathconf d_fpathconf
13116 : see if fpclass exists
13117 set fpclass d_fpclass
13120 : see if fpclassify exists
13121 set fpclassify d_fpclassify
13124 : see if fpclassl exists
13125 set fpclassl d_fpclassl
13128 : check for fpos64_t
13130 echo "Checking to see if you have fpos64_t..." >&4
13133 int main() { fpos64_t x = 7; }
13136 if eval $compile; then
13138 echo "You have fpos64_t."
13141 echo "You do not have fpos64_t."
13142 case "$fpossize" in
13143 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
13150 : see if frexpl exists
13151 set frexpl d_frexpl
13154 : see if this is a sys/param system
13155 set sys/param.h i_sysparam
13158 : see if this is a sys/mount.h system
13159 set sys/mount.h i_sysmount
13162 : Check for fs_data_s
13164 echo "Checking to see if your system supports struct fs_data..." >&4
13165 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
13167 case "$d_fs_data_s" in
13168 "$define") echo "Yes, it does." ;;
13169 *) echo "No, it doesn't." ;;
13172 : see if fseeko exists
13173 set fseeko d_fseeko
13175 case "$longsize" in
13176 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
13179 : see if fsetpos exists
13180 set fsetpos d_fsetpos
13183 : see if fstatfs exists
13184 set fstatfs d_fstatfs
13187 : see if statvfs exists
13188 set statvfs d_statvfs
13191 : see if fstatvfs exists
13192 set fstatvfs d_fstatvfs
13196 : see if fsync exists
13200 : see if ftello exists
13201 set ftello d_ftello
13203 case "$longsize" in
13204 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
13207 : check for a working futimes
13210 echo "Checking if you have a working futimes()" >&4
13213 #include <sys/time.h>
13220 fd = open ("try.c", O_RDWR);
13221 if (-1 == fd) exit (1);
13222 rv = futimes (fd, NULL);
13223 exit (rv == -1 ? errno : 0);
13227 if eval $compile; then
13231 0) echo "Yes, you have" >&4
13232 d_futimes="$define"
13234 *) echo "No, you have futimes, but it isn't working ($rc) (probably harmless)" >&4
13238 echo "No, it does not (probably harmless)" >&4
13242 : see if getcwd exists
13243 set getcwd d_getcwd
13246 : see if getespwnam exists
13247 set getespwnam d_getespwnam
13250 : see if getfsstat exists
13251 set getfsstat d_getfsstat
13254 : see if getgrent exists
13255 set getgrent d_getgrent
13258 : see if getgrent_r exists
13259 set getgrent_r d_getgrent_r
13261 case "$d_getgrent_r" in
13263 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13264 case "$d_getgrent_r_proto:$usethreads" in
13265 ":define") d_getgrent_r_proto=define
13266 set d_getgrent_r_proto getgrent_r $hdrs
13270 case "$d_getgrent_r_proto" in
13272 case "$getgrent_r_proto" in
13273 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
13274 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBWR ;;
13276 case "$getgrent_r_proto" in
13277 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
13278 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIR ;;
13280 case "$getgrent_r_proto" in
13281 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
13282 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBW ;;
13284 case "$getgrent_r_proto" in
13285 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
13286 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBI ;;
13288 case "$getgrent_r_proto" in
13289 ''|0) try='int getgrent_r(struct group*, char*, int);'
13290 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBI ;;
13292 case "$getgrent_r_proto" in
13293 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
13294 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIH ;;
13296 case "$getgrent_r_proto" in
13297 ''|0) d_getgrent_r=undef
13299 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
13300 * ) case "$getgrent_r_proto" in
13301 REENTRANT_PROTO*) ;;
13302 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
13304 echo "Prototype: $try" ;;
13307 *) case "$usethreads" in
13308 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
13315 *) getgrent_r_proto=0
13319 : see if getgrgid_r exists
13320 set getgrgid_r d_getgrgid_r
13322 case "$d_getgrgid_r" in
13324 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13325 case "$d_getgrgid_r_proto:$usethreads" in
13326 ":define") d_getgrgid_r_proto=define
13327 set d_getgrgid_r_proto getgrgid_r $hdrs
13331 case "$d_getgrgid_r_proto" in
13333 case "$getgrgid_r_proto" in
13334 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
13335 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
13337 case "$getgrgid_r_proto" in
13338 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
13339 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
13341 case "$getgrgid_r_proto" in
13342 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
13343 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
13345 case "$getgrgid_r_proto" in
13346 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
13347 ./protochk "extern $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
13349 case "$getgrgid_r_proto" in
13350 ''|0) d_getgrgid_r=undef
13352 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
13353 * ) case "$getgrgid_r_proto" in
13354 REENTRANT_PROTO*) ;;
13355 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
13357 echo "Prototype: $try" ;;
13360 *) case "$usethreads" in
13361 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
13368 *) getgrgid_r_proto=0
13372 : see if getgrnam_r exists
13373 set getgrnam_r d_getgrnam_r
13375 case "$d_getgrnam_r" in
13377 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13378 case "$d_getgrnam_r_proto:$usethreads" in
13379 ":define") d_getgrnam_r_proto=define
13380 set d_getgrnam_r_proto getgrnam_r $hdrs
13384 case "$d_getgrnam_r_proto" in
13386 case "$getgrnam_r_proto" in
13387 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
13388 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
13390 case "$getgrnam_r_proto" in
13391 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
13392 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
13394 case "$getgrnam_r_proto" in
13395 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
13396 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CBI ;;
13398 case "$getgrnam_r_proto" in
13399 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
13400 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
13402 case "$getgrnam_r_proto" in
13403 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
13404 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
13406 case "$getgrnam_r_proto" in
13407 ''|0) d_getgrnam_r=undef
13409 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
13410 * ) case "$getgrnam_r_proto" in
13411 REENTRANT_PROTO*) ;;
13412 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
13414 echo "Prototype: $try" ;;
13417 *) case "$usethreads" in
13418 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
13425 *) getgrnam_r_proto=0
13429 : see if gethostbyaddr exists
13430 set gethostbyaddr d_gethbyaddr
13433 : see if gethostbyname exists
13434 set gethostbyname d_gethbyname
13437 : see if gethostent exists
13438 set gethostent d_gethent
13441 : see how we will look up host name
13444 if set gethostname val -f d_gethname; eval $csym; $val; then
13445 echo 'gethostname() found.' >&4
13446 d_gethname="$define"
13449 if set uname val -f d_uname; eval $csym; $val; then
13452 uname() was found, but you're running xenix, and older versions of xenix
13453 have a broken uname(). If you don't really know whether your xenix is old
13454 enough to have a broken system call, use the default answer.
13459 "$define") dflt=n;;
13461 rp='Is your uname() broken?'
13464 n*) d_uname="$define"; call=uname;;
13467 echo 'uname() found.' >&4
13474 case "$d_gethname" in
13475 '') d_gethname="$undef";;
13478 '') d_uname="$undef";;
13480 case "$d_uname$d_gethname" in
13485 Every now and then someone has a $call() that lies about the hostname
13486 but can't be fixed for political or economic reasons. If you wish, I can
13487 pretend $call() isn't there and maybe compute hostname at run-time
13488 thanks to the '$phostname' command.
13491 rp="Shall I ignore $call() from now on?"
13494 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
13497 case "$phostname" in
13498 '') aphostname='';;
13499 *) case "$aphostname" in
13501 *) set X $phostname
13505 file=`./loc $file $file $pth`
13506 aphostname=`echo $file $*`
13511 case "$d_uname$d_gethname" in
13514 case "$phostname" in
13516 echo "There will be no way for $package to get your hostname." >&4;;
13518 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
13522 case "$d_phostname" in
13523 '') d_phostname="$undef";;
13526 : see if gethostbyaddr_r exists
13527 set gethostbyaddr_r d_gethostbyaddr_r
13529 case "$d_gethostbyaddr_r" in
13531 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13532 case "$d_gethostbyaddr_r_proto:$usethreads" in
13533 ":define") d_gethostbyaddr_r_proto=define
13534 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
13538 case "$d_gethostbyaddr_r_proto" in
13540 case "$gethostbyaddr_r_proto" in
13541 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13542 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
13544 case "$gethostbyaddr_r_proto" in
13545 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
13546 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
13548 case "$gethostbyaddr_r_proto" in
13549 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
13550 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
13552 case "$gethostbyaddr_r_proto" in
13553 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
13554 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
13556 case "$gethostbyaddr_r_proto" in
13557 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
13558 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
13560 case "$gethostbyaddr_r_proto" in
13561 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
13562 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
13564 case "$gethostbyaddr_r_proto" in
13565 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
13566 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
13568 case "$gethostbyaddr_r_proto" in
13569 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
13570 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
13572 case "$gethostbyaddr_r_proto" in
13573 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
13574 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
13576 case "$gethostbyaddr_r_proto" in
13577 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
13578 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
13580 case "$gethostbyaddr_r_proto" in
13581 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13582 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
13584 case "$gethostbyaddr_r_proto" in
13585 ''|0) d_gethostbyaddr_r=undef
13586 gethostbyaddr_r_proto=0
13587 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
13588 * ) case "$gethostbyaddr_r_proto" in
13589 REENTRANT_PROTO*) ;;
13590 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
13592 echo "Prototype: $try" ;;
13595 *) case "$usethreads" in
13596 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
13598 d_gethostbyaddr_r=undef
13599 gethostbyaddr_r_proto=0
13603 *) gethostbyaddr_r_proto=0
13607 : see if gethostbyname_r exists
13608 set gethostbyname_r d_gethostbyname_r
13610 case "$d_gethostbyname_r" in
13612 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13613 case "$d_gethostbyname_r_proto:$usethreads" in
13614 ":define") d_gethostbyname_r_proto=define
13615 set d_gethostbyname_r_proto gethostbyname_r $hdrs
13619 case "$d_gethostbyname_r_proto" in
13621 case "$gethostbyname_r_proto" in
13622 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
13623 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
13625 case "$gethostbyname_r_proto" in
13626 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
13627 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
13629 case "$gethostbyname_r_proto" in
13630 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
13631 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
13633 case "$gethostbyname_r_proto" in
13634 ''|0) d_gethostbyname_r=undef
13635 gethostbyname_r_proto=0
13636 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
13637 * ) case "$gethostbyname_r_proto" in
13638 REENTRANT_PROTO*) ;;
13639 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
13641 echo "Prototype: $try" ;;
13644 *) case "$usethreads" in
13645 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
13647 d_gethostbyname_r=undef
13648 gethostbyname_r_proto=0
13652 *) gethostbyname_r_proto=0
13656 : see if gethostent_r exists
13657 set gethostent_r d_gethostent_r
13659 case "$d_gethostent_r" in
13661 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13662 case "$d_gethostent_r_proto:$usethreads" in
13663 ":define") d_gethostent_r_proto=define
13664 set d_gethostent_r_proto gethostent_r $hdrs
13668 case "$d_gethostent_r_proto" in
13670 case "$gethostent_r_proto" in
13671 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
13672 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
13674 case "$gethostent_r_proto" in
13675 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
13676 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBIE ;;
13678 case "$gethostent_r_proto" in
13679 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
13680 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBIE ;;
13682 case "$gethostent_r_proto" in
13683 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
13684 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBI ;;
13686 case "$gethostent_r_proto" in
13687 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
13688 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBI ;;
13690 case "$gethostent_r_proto" in
13691 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
13692 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SD ;;
13694 case "$gethostent_r_proto" in
13695 ''|0) d_gethostent_r=undef
13696 gethostent_r_proto=0
13697 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
13698 * ) case "$gethostent_r_proto" in
13699 REENTRANT_PROTO*) ;;
13700 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
13702 echo "Prototype: $try" ;;
13705 *) case "$usethreads" in
13706 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
13708 d_gethostent_r=undef
13709 gethostent_r_proto=0
13713 *) gethostent_r_proto=0
13717 : see if prototypes for various gethostxxx netdb.h functions are available
13719 set d_gethostprotos gethostent $i_netdb netdb.h
13722 : see if getitimer exists
13723 set getitimer d_getitimer
13726 : see if getlogin exists
13727 set getlogin d_getlogin
13730 : see if getlogin_r exists
13731 set getlogin_r d_getlogin_r
13733 case "$d_getlogin_r" in
13735 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
13736 case "$d_getlogin_r_proto:$usethreads" in
13737 ":define") d_getlogin_r_proto=define
13738 set d_getlogin_r_proto getlogin_r $hdrs
13742 case "$d_getlogin_r_proto" in
13744 case "$getlogin_r_proto" in
13745 ''|0) try='int getlogin_r(char*, size_t);'
13746 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BW ;;
13748 case "$getlogin_r_proto" in
13749 ''|0) try='int getlogin_r(char*, int);'
13750 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BI ;;
13752 case "$getlogin_r_proto" in
13753 ''|0) try='char* getlogin_r(char*, size_t);'
13754 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BW ;;
13756 case "$getlogin_r_proto" in
13757 ''|0) try='char* getlogin_r(char*, int);'
13758 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BI ;;
13760 case "$getlogin_r_proto" in
13761 ''|0) d_getlogin_r=undef
13763 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
13764 * ) case "$getlogin_r_proto" in
13765 REENTRANT_PROTO*) ;;
13766 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
13768 echo "Prototype: $try" ;;
13771 *) case "$usethreads" in
13772 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
13779 *) getlogin_r_proto=0
13783 : see if getmnt exists
13784 set getmnt d_getmnt
13787 : see if getmntent exists
13788 set getmntent d_getmntent
13791 : see if getnetbyaddr exists
13792 set getnetbyaddr d_getnbyaddr
13795 : see if getnetbyname exists
13796 set getnetbyname d_getnbyname
13799 : see if getnetent exists
13800 set getnetent d_getnent
13803 : see if getnetbyaddr_r exists
13804 set getnetbyaddr_r d_getnetbyaddr_r
13806 case "$d_getnetbyaddr_r" in
13808 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13809 case "$d_getnetbyaddr_r_proto:$usethreads" in
13810 ":define") d_getnetbyaddr_r_proto=define
13811 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
13815 case "$d_getnetbyaddr_r_proto" in
13817 case "$getnetbyaddr_r_proto" in
13818 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
13819 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
13821 case "$getnetbyaddr_r_proto" in
13822 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
13823 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
13825 case "$getnetbyaddr_r_proto" in
13826 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
13827 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
13829 case "$getnetbyaddr_r_proto" in
13830 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
13831 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
13833 case "$getnetbyaddr_r_proto" in
13834 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
13835 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
13837 case "$getnetbyaddr_r_proto" in
13838 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
13839 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
13841 case "$getnetbyaddr_r_proto" in
13842 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
13843 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
13845 case "$getnetbyaddr_r_proto" in
13846 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
13847 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
13849 case "$getnetbyaddr_r_proto" in
13850 ''|0) d_getnetbyaddr_r=undef
13851 getnetbyaddr_r_proto=0
13852 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
13853 * ) case "$getnetbyaddr_r_proto" in
13854 REENTRANT_PROTO*) ;;
13855 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
13857 echo "Prototype: $try" ;;
13860 *) case "$usethreads" in
13861 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
13863 d_getnetbyaddr_r=undef
13864 getnetbyaddr_r_proto=0
13868 *) getnetbyaddr_r_proto=0
13872 : see if getnetbyname_r exists
13873 set getnetbyname_r d_getnetbyname_r
13875 case "$d_getnetbyname_r" in
13877 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13878 case "$d_getnetbyname_r_proto:$usethreads" in
13879 ":define") d_getnetbyname_r_proto=define
13880 set d_getnetbyname_r_proto getnetbyname_r $hdrs
13884 case "$d_getnetbyname_r_proto" in
13886 case "$getnetbyname_r_proto" in
13887 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
13888 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
13890 case "$getnetbyname_r_proto" in
13891 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
13892 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
13894 case "$getnetbyname_r_proto" in
13895 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
13896 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
13898 case "$getnetbyname_r_proto" in
13899 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
13900 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
13902 case "$getnetbyname_r_proto" in
13903 ''|0) d_getnetbyname_r=undef
13904 getnetbyname_r_proto=0
13905 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
13906 * ) case "$getnetbyname_r_proto" in
13907 REENTRANT_PROTO*) ;;
13908 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
13910 echo "Prototype: $try" ;;
13913 *) case "$usethreads" in
13914 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
13916 d_getnetbyname_r=undef
13917 getnetbyname_r_proto=0
13921 *) getnetbyname_r_proto=0
13925 : see if getnetent_r exists
13926 set getnetent_r d_getnetent_r
13928 case "$d_getnetent_r" in
13930 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13931 case "$d_getnetent_r_proto:$usethreads" in
13932 ":define") d_getnetent_r_proto=define
13933 set d_getnetent_r_proto getnetent_r $hdrs
13937 case "$d_getnetent_r_proto" in
13939 case "$getnetent_r_proto" in
13940 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
13941 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
13943 case "$getnetent_r_proto" in
13944 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
13945 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBIE ;;
13947 case "$getnetent_r_proto" in
13948 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
13949 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBIE ;;
13951 case "$getnetent_r_proto" in
13952 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
13953 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBI ;;
13955 case "$getnetent_r_proto" in
13956 ''|0) try='int getnetent_r(struct netent*, char*, int);'
13957 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBI ;;
13959 case "$getnetent_r_proto" in
13960 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
13961 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SD ;;
13963 case "$getnetent_r_proto" in
13964 ''|0) d_getnetent_r=undef
13965 getnetent_r_proto=0
13966 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
13967 * ) case "$getnetent_r_proto" in
13968 REENTRANT_PROTO*) ;;
13969 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
13971 echo "Prototype: $try" ;;
13974 *) case "$usethreads" in
13975 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
13977 d_getnetent_r=undef
13978 getnetent_r_proto=0
13982 *) getnetent_r_proto=0
13986 : see if prototypes for various getnetxxx netdb.h functions are available
13988 set d_getnetprotos getnetent $i_netdb netdb.h
13991 : see if getpagesize exists
13992 set getpagesize d_getpagsz
13995 : Optional checks for getprotobyname and getprotobynumber
13997 : see if getprotobyname exists
13998 set getprotobyname d_getpbyname
14001 : see if getprotobynumber exists
14002 set getprotobynumber d_getpbynumber
14005 : see if getprotoent exists
14006 set getprotoent d_getpent
14009 : see if getpgid exists
14010 set getpgid d_getpgid
14013 : see if getpgrp2 exists
14014 set getpgrp2 d_getpgrp2
14017 : see if getppid exists
14018 set getppid d_getppid
14021 : see if getpriority exists
14022 set getpriority d_getprior
14025 : see if getprotobyname_r exists
14026 set getprotobyname_r d_getprotobyname_r
14028 case "$d_getprotobyname_r" in
14030 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14031 case "$d_getprotobyname_r_proto:$usethreads" in
14032 ":define") d_getprotobyname_r_proto=define
14033 set d_getprotobyname_r_proto getprotobyname_r $hdrs
14037 case "$d_getprotobyname_r_proto" in
14039 case "$getprotobyname_r_proto" in
14040 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
14041 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
14043 case "$getprotobyname_r_proto" in
14044 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
14045 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
14047 case "$getprotobyname_r_proto" in
14048 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
14049 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
14051 case "$getprotobyname_r_proto" in
14052 ''|0) d_getprotobyname_r=undef
14053 getprotobyname_r_proto=0
14054 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
14055 * ) case "$getprotobyname_r_proto" in
14056 REENTRANT_PROTO*) ;;
14057 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
14059 echo "Prototype: $try" ;;
14062 *) case "$usethreads" in
14063 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
14065 d_getprotobyname_r=undef
14066 getprotobyname_r_proto=0
14070 *) getprotobyname_r_proto=0
14074 : see if getprotobynumber_r exists
14075 set getprotobynumber_r d_getprotobynumber_r
14077 case "$d_getprotobynumber_r" in
14079 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14080 case "$d_getprotobynumber_r_proto:$usethreads" in
14081 ":define") d_getprotobynumber_r_proto=define
14082 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
14086 case "$d_getprotobynumber_r_proto" in
14088 case "$getprotobynumber_r_proto" in
14089 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
14090 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
14092 case "$getprotobynumber_r_proto" in
14093 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
14094 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
14096 case "$getprotobynumber_r_proto" in
14097 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
14098 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
14100 case "$getprotobynumber_r_proto" in
14101 ''|0) d_getprotobynumber_r=undef
14102 getprotobynumber_r_proto=0
14103 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
14104 * ) case "$getprotobynumber_r_proto" in
14105 REENTRANT_PROTO*) ;;
14106 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
14108 echo "Prototype: $try" ;;
14111 *) case "$usethreads" in
14112 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
14114 d_getprotobynumber_r=undef
14115 getprotobynumber_r_proto=0
14119 *) getprotobynumber_r_proto=0
14123 : see if getprotoent_r exists
14124 set getprotoent_r d_getprotoent_r
14126 case "$d_getprotoent_r" in
14128 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14129 case "$d_getprotoent_r_proto:$usethreads" in
14130 ":define") d_getprotoent_r_proto=define
14131 set d_getprotoent_r_proto getprotoent_r $hdrs
14135 case "$d_getprotoent_r_proto" in
14137 case "$getprotoent_r_proto" in
14138 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
14139 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
14141 case "$getprotoent_r_proto" in
14142 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
14143 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBI ;;
14145 case "$getprotoent_r_proto" in
14146 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
14147 ./protochk "extern $try" $hdrs && getprotoent_r_proto=S_SBI ;;
14149 case "$getprotoent_r_proto" in
14150 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
14151 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SD ;;
14153 case "$getprotoent_r_proto" in
14154 ''|0) d_getprotoent_r=undef
14155 getprotoent_r_proto=0
14156 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
14157 * ) case "$getprotoent_r_proto" in
14158 REENTRANT_PROTO*) ;;
14159 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
14161 echo "Prototype: $try" ;;
14164 *) case "$usethreads" in
14165 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
14167 d_getprotoent_r=undef
14168 getprotoent_r_proto=0
14172 *) getprotoent_r_proto=0
14176 : see if prototypes for various getprotoxxx netdb.h functions are available
14178 set d_getprotoprotos getprotoent $i_netdb netdb.h
14181 : see if getprpwnam exists
14182 set getprpwnam d_getprpwnam
14185 : see if getpwent exists
14186 set getpwent d_getpwent
14189 : see if getpwent_r exists
14190 set getpwent_r d_getpwent_r
14192 case "$d_getpwent_r" in
14194 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14195 case "$d_getpwent_r_proto:$usethreads" in
14196 ":define") d_getpwent_r_proto=define
14197 set d_getpwent_r_proto getpwent_r $hdrs
14201 case "$d_getpwent_r_proto" in
14203 case "$getpwent_r_proto" in
14204 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
14205 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBWR ;;
14207 case "$getpwent_r_proto" in
14208 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
14209 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIR ;;
14211 case "$getpwent_r_proto" in
14212 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
14213 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBW ;;
14215 case "$getpwent_r_proto" in
14216 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
14217 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBI ;;
14219 case "$getpwent_r_proto" in
14220 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
14221 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBI ;;
14223 case "$getpwent_r_proto" in
14224 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
14225 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIH ;;
14227 case "$getpwent_r_proto" in
14228 ''|0) d_getpwent_r=undef
14230 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
14231 * ) case "$getpwent_r_proto" in
14232 REENTRANT_PROTO*) ;;
14233 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
14235 echo "Prototype: $try" ;;
14238 *) case "$usethreads" in
14239 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
14246 *) getpwent_r_proto=0
14250 : see if getpwnam_r exists
14251 set getpwnam_r d_getpwnam_r
14253 case "$d_getpwnam_r" in
14255 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14256 case "$d_getpwnam_r_proto:$usethreads" in
14257 ":define") d_getpwnam_r_proto=define
14258 set d_getpwnam_r_proto getpwnam_r $hdrs
14262 case "$d_getpwnam_r_proto" in
14264 case "$getpwnam_r_proto" in
14265 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
14266 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
14268 case "$getpwnam_r_proto" in
14269 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
14270 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
14272 case "$getpwnam_r_proto" in
14273 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
14274 ./protochk "extern $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
14276 case "$getpwnam_r_proto" in
14277 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
14278 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
14280 case "$getpwnam_r_proto" in
14281 ''|0) d_getpwnam_r=undef
14283 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
14284 * ) case "$getpwnam_r_proto" in
14285 REENTRANT_PROTO*) ;;
14286 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
14288 echo "Prototype: $try" ;;
14291 *) case "$usethreads" in
14292 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
14299 *) getpwnam_r_proto=0
14303 : see if getpwuid_r exists
14304 set getpwuid_r d_getpwuid_r
14306 case "$d_getpwuid_r" in
14308 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14309 case "$d_getpwuid_r_proto:$usethreads" in
14310 ":define") d_getpwuid_r_proto=define
14311 set d_getpwuid_r_proto getpwuid_r $hdrs
14315 case "$d_getpwuid_r_proto" in
14317 case "$getpwuid_r_proto" in
14318 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
14319 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
14321 case "$getpwuid_r_proto" in
14322 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
14323 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
14325 case "$getpwuid_r_proto" in
14326 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
14327 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
14329 case "$getpwuid_r_proto" in
14330 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
14331 ./protochk "extern $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
14333 case "$getpwuid_r_proto" in
14334 ''|0) d_getpwuid_r=undef
14336 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
14337 * ) case "$getpwuid_r_proto" in
14338 REENTRANT_PROTO*) ;;
14339 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
14341 echo "Prototype: $try" ;;
14344 *) case "$usethreads" in
14345 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
14352 *) getpwuid_r_proto=0
14356 : Optional checks for getsbyname and getsbyport
14358 : see if getservbyname exists
14359 set getservbyname d_getsbyname
14362 : see if getservbyport exists
14363 set getservbyport d_getsbyport
14366 : see if getservent exists
14367 set getservent d_getsent
14370 : see if getservbyname_r exists
14371 set getservbyname_r d_getservbyname_r
14373 case "$d_getservbyname_r" in
14375 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14376 case "$d_getservbyname_r_proto:$usethreads" in
14377 ":define") d_getservbyname_r_proto=define
14378 set d_getservbyname_r_proto getservbyname_r $hdrs
14382 case "$d_getservbyname_r_proto" in
14384 case "$getservbyname_r_proto" in
14385 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
14386 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
14388 case "$getservbyname_r_proto" in
14389 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
14390 ./protochk "extern $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
14392 case "$getservbyname_r_proto" in
14393 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
14394 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
14396 case "$getservbyname_r_proto" in
14397 ''|0) d_getservbyname_r=undef
14398 getservbyname_r_proto=0
14399 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
14400 * ) case "$getservbyname_r_proto" in
14401 REENTRANT_PROTO*) ;;
14402 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
14404 echo "Prototype: $try" ;;
14407 *) case "$usethreads" in
14408 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
14410 d_getservbyname_r=undef
14411 getservbyname_r_proto=0
14415 *) getservbyname_r_proto=0
14419 : see if getservbyport_r exists
14420 set getservbyport_r d_getservbyport_r
14422 case "$d_getservbyport_r" in
14424 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14425 case "$d_getservbyport_r_proto:$usethreads" in
14426 ":define") d_getservbyport_r_proto=define
14427 set d_getservbyport_r_proto getservbyport_r $hdrs
14431 case "$d_getservbyport_r_proto" in
14433 case "$getservbyport_r_proto" in
14434 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
14435 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
14437 case "$getservbyport_r_proto" in
14438 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
14439 ./protochk "extern $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
14441 case "$getservbyport_r_proto" in
14442 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
14443 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
14445 case "$getservbyport_r_proto" in
14446 ''|0) d_getservbyport_r=undef
14447 getservbyport_r_proto=0
14448 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
14449 * ) case "$getservbyport_r_proto" in
14450 REENTRANT_PROTO*) ;;
14451 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
14453 echo "Prototype: $try" ;;
14456 *) case "$usethreads" in
14457 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
14459 d_getservbyport_r=undef
14460 getservbyport_r_proto=0
14464 *) getservbyport_r_proto=0
14468 : see if getservent_r exists
14469 set getservent_r d_getservent_r
14471 case "$d_getservent_r" in
14473 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14474 case "$d_getservent_r_proto:$usethreads" in
14475 ":define") d_getservent_r_proto=define
14476 set d_getservent_r_proto getservent_r $hdrs
14480 case "$d_getservent_r_proto" in
14482 case "$getservent_r_proto" in
14483 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
14484 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBWR ;;
14486 case "$getservent_r_proto" in
14487 ''|0) try='int getservent_r(struct servent*, char*, int);'
14488 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBI ;;
14490 case "$getservent_r_proto" in
14491 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
14492 ./protochk "extern $try" $hdrs && getservent_r_proto=S_SBI ;;
14494 case "$getservent_r_proto" in
14495 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
14496 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SD ;;
14498 case "$getservent_r_proto" in
14499 ''|0) d_getservent_r=undef
14500 getservent_r_proto=0
14501 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
14502 * ) case "$getservent_r_proto" in
14503 REENTRANT_PROTO*) ;;
14504 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
14506 echo "Prototype: $try" ;;
14509 *) case "$usethreads" in
14510 define) echo "getservent_r has no prototype, not using it." >&4 ;;
14512 d_getservent_r=undef
14513 getservent_r_proto=0
14517 *) getservent_r_proto=0
14521 : see if prototypes for various getservxxx netdb.h functions are available
14523 set d_getservprotos getservent $i_netdb netdb.h
14526 : see if getspnam exists
14527 set getspnam d_getspnam
14530 : see if this is a shadow.h system
14531 set shadow.h i_shadow
14534 : see if getspnam_r exists
14535 set getspnam_r d_getspnam_r
14537 case "$d_getspnam_r" in
14539 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
14540 case "$d_getspnam_r_proto:$usethreads" in
14541 ":define") d_getspnam_r_proto=define
14542 set d_getspnam_r_proto getspnam_r $hdrs
14546 case "$d_getspnam_r_proto" in
14548 case "$getspnam_r_proto" in
14549 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
14550 ./protochk "extern $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
14552 case "$getspnam_r_proto" in
14553 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
14554 ./protochk "extern $try" $hdrs && getspnam_r_proto=S_CSBI ;;
14556 case "$getspnam_r_proto" in
14557 ''|0) d_getspnam_r=undef
14559 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
14560 * ) case "$getspnam_r_proto" in
14561 REENTRANT_PROTO*) ;;
14562 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
14564 echo "Prototype: $try" ;;
14567 *) case "$usethreads" in
14568 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
14575 *) getspnam_r_proto=0
14579 : see if gettimeofday or ftime exists
14580 set gettimeofday d_gettimeod
14582 case "$d_gettimeod" in
14588 val="$undef"; set d_ftime; eval $setvar
14591 case "$d_gettimeod$d_ftime" in
14594 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
14598 : see if gmtime_r exists
14599 set gmtime_r d_gmtime_r
14601 case "$d_gmtime_r" in
14603 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14604 case "$d_gmtime_r_proto:$usethreads" in
14605 ":define") d_gmtime_r_proto=define
14606 set d_gmtime_r_proto gmtime_r $hdrs
14610 case "$d_gmtime_r_proto" in
14612 case "$gmtime_r_proto" in
14613 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
14614 ./protochk "extern $try" $hdrs && gmtime_r_proto=S_TS ;;
14616 case "$gmtime_r_proto" in
14617 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
14618 ./protochk "extern $try" $hdrs && gmtime_r_proto=I_TS ;;
14620 case "$gmtime_r_proto" in
14621 ''|0) d_gmtime_r=undef
14623 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
14624 * ) case "$gmtime_r_proto" in
14625 REENTRANT_PROTO*) ;;
14626 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
14628 echo "Prototype: $try" ;;
14631 *) case "$usethreads" in
14632 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
14639 *) gmtime_r_proto=0
14643 : see if hasmntopt exists
14644 set hasmntopt d_hasmntopt
14647 : see if this is a netinet/in.h or sys/in.h system
14648 set netinet/in.h i_niin sys/in.h i_sysin
14651 : see if arpa/inet.h has to be included
14652 set arpa/inet.h i_arpainet
14655 : see if htonl --and friends-- exists
14660 : Maybe they are macros.
14663 $cat >htonl.c <<EOM
14665 #include <sys/types.h>
14666 #$i_niin I_NETINET_IN
14668 #$i_arpainet I_ARPA_INET
14669 #ifdef I_NETINET_IN
14670 #include <netinet/in.h>
14673 #include <sys/in.h>
14676 #include <arpa/inet.h>
14679 printf("Defined as a macro.");
14682 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
14683 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
14685 echo "But it seems to be defined as a macro." >&4
14693 : see if ilogbl exists
14694 set ilogbl d_ilogbl
14699 if set index val -f; eval $csym; $val; then
14700 if set strchr val -f d_strchr; eval $csym; $val; then
14701 if $contains strchr "$strings" >/dev/null 2>&1 ; then
14704 echo "strchr() found." >&4
14708 echo "index() found." >&4
14713 echo "index() found." >&4
14716 if set strchr val -f d_strchr; eval $csym; $val; then
14719 echo "strchr() found." >&4
14721 echo "No index() or strchr() found!" >&4
14726 set d_strchr; eval $setvar
14728 set d_index; eval $setvar
14730 : check whether inet_aton exists
14731 set inet_aton d_inetaton
14736 $cat >isascii.c <<EOCP
14739 #$i_stdlib I_STDLIB
14741 #include <stdlib.h>
14752 if eval $compile; then
14753 echo "isascii() found." >&4
14756 echo "isascii() NOT found." >&4
14763 : see if isfinite exists
14764 set isfinite d_isfinite
14767 : see if isinf exists
14771 : see if isnan exists
14775 : see if isnanl exists
14776 set isnanl d_isnanl
14779 : see if killpg exists
14780 set killpg d_killpg
14783 : see if lchown exists
14785 $cat > try.c <<'EOCP'
14786 /* System header to define __stub macros and hopefully few prototypes,
14787 which can conflict with char lchown(); below. */
14788 #include <assert.h>
14789 /* Override any gcc2 internal prototype to avoid an error. */
14790 /* We use char because int might match the return type of a gcc2
14791 builtin and then its argument prototype would still apply. */
14794 /* The GNU C library defines this for functions which it implements
14795 to always fail with ENOSYS. Some functions are actually named
14796 something starting with __ and the normal name is an alias. */
14797 #if defined (__stub_lchown) || defined (__stub___lchown)
14805 if eval $compile; then
14806 $echo "lchown() found." >&4
14809 $echo "lchown() NOT found." >&4
14815 : See if number of significant digits in a double precision number is known
14817 $cat >ldbl_dig.c <<EOM
14818 #$i_limits I_LIMITS
14821 #include <limits.h>
14827 printf("Contains LDBL_DIG");
14830 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
14831 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
14832 echo "LDBL_DIG found." >&4
14835 echo "LDBL_DIG NOT found." >&4
14842 : see if this is a math.h system
14846 : check to see if math.h defines _LIB_VERSION
14847 d_libm_lib_version="$undef"
14851 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
14853 #include <unistd.h>
14855 int main (int argc, char *argv[])
14857 printf ("%d\n", _LIB_VERSION);
14862 if eval $compile; then
14864 echo "Yes, it does ($foo)" >&4
14865 d_libm_lib_version="$define"
14867 echo "No, it does not (probably harmless)" >&4
14874 : see if link exists
14878 : see if localtime_r exists
14879 set localtime_r d_localtime_r
14881 case "$d_localtime_r" in
14883 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14884 case "$d_localtime_r_proto:$usethreads" in
14885 ":define") d_localtime_r_proto=define
14886 set d_localtime_r_proto localtime_r $hdrs
14890 case "$d_localtime_r_proto" in
14892 case "$localtime_r_proto" in
14893 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
14894 ./protochk "extern $try" $hdrs && localtime_r_proto=S_TS ;;
14896 case "$localtime_r_proto" in
14897 ''|0) try='int localtime_r(const time_t*, struct tm*);'
14898 ./protochk "extern $try" $hdrs && localtime_r_proto=I_TS ;;
14900 case "$localtime_r_proto" in
14901 ''|0) d_localtime_r=undef
14902 localtime_r_proto=0
14903 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
14904 * ) case "$localtime_r_proto" in
14905 REENTRANT_PROTO*) ;;
14906 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
14908 echo "Prototype: $try" ;;
14911 *) case "$usethreads" in
14912 define) echo "localtime_r has no prototype, not using it." >&4 ;;
14914 d_localtime_r=undef
14915 localtime_r_proto=0
14919 *) localtime_r_proto=0
14923 : see if localtime_r calls tzset
14924 case "$localtime_r_proto" in
14927 /* Does our libc's localtime_r call tzset ?
14928 * return 0 if so, 1 otherwise.
14930 #include <sys/types.h>
14931 #include <unistd.h>
14933 #include <string.h>
14934 #include <malloc.h>
14937 time_t t = time(0L);
14938 char w_tz[]="TZ" "=GMT+5",
14939 e_tz[]="TZ" "=GMT-5",
14940 *tz_e = (char*)malloc(16),
14941 *tz_w = (char*)malloc(16);
14942 struct tm tm_e, tm_w;
14943 memset(&tm_e,'\0',sizeof(struct tm));
14944 memset(&tm_w,'\0',sizeof(struct tm));
14949 localtime_r(&t, &tm_e);
14952 localtime_r(&t, &tm_w);
14954 if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 )
14960 if eval $compile; then
14961 if $run ./try; then
14962 d_localtime_r_needs_tzset=undef;
14964 d_localtime_r_needs_tzset=define;
14967 d_localtime_r_needs_tzset=undef;
14971 d_localtime_r_needs_tzset=undef;
14976 : see if localeconv exists
14977 set localeconv d_locconv
14980 : see if lockf exists
14984 : see if prototype for lseek is available
14986 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
14989 : see if lstat exists
14993 : see if madvise exists
14994 set madvise d_madvise
14997 : see if malloc_size exists
14998 set malloc_size d_malloc_size
15001 : see if malloc_size_good exists
15002 set malloc_good_size d_malloc_good_size
15005 : see if mblen exists
15009 : see if mbstowcs exists
15010 set mbstowcs d_mbstowcs
15013 : see if mbtowc exists
15014 set mbtowc d_mbtowc
15017 : see if memchr exists
15018 set memchr d_memchr
15021 : see if memcmp exists
15022 set memcmp d_memcmp
15025 : see if memcpy exists
15026 set memcpy d_memcpy
15029 : see if memmove exists
15030 set memmove d_memmove
15033 : see if memset exists
15034 set memset d_memset
15037 : see if mkdir exists
15041 : see if mkdtemp exists
15042 set mkdtemp d_mkdtemp
15045 : see if mkfifo exists
15046 set mkfifo d_mkfifo
15049 : see if mkstemp exists
15050 set mkstemp d_mkstemp
15053 : see if mkstemps exists
15054 set mkstemps d_mkstemps
15057 : see if mktime exists
15058 set mktime d_mktime
15061 : see if this is a sys/mman.h system
15062 set sys/mman.h i_sysmman
15065 : see if mmap exists
15068 : see what shmat returns
15069 : default to something harmless
15071 case "$i_sysmman$d_mmap" in
15073 $cat >mmap.c <<'END'
15074 #include <sys/mman.h>
15077 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
15082 echo "and it returns ($mmaptype)." >&4
15088 : see if sqrtl exists
15092 : see if scalbnl exists
15093 set scalbnl d_scalbnl
15096 : see if modfl exists
15100 : see if prototype for modfl is available
15102 set d_modflproto modfl $i_math math.h
15105 d_modfl_pow32_bug="$undef"
15107 case "$d_longdbl$d_modfl" in
15110 Checking to see whether your modfl() is okay for large values...
15116 if $test "X$d_modflproto" != "X$define"; then
15117 $cat >>try.c <<EOCP
15118 /* Sigh. many current glibcs provide the function, but do not prototype it. */
15119 long double modfl (long double, long double *);
15122 $cat >>try.c <<EOCP
15124 long double nv = 4294967303.15;
15130 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
15134 case "$osname:$gccversion" in
15135 aix:) saveccflags="$ccflags"
15136 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
15139 if eval $compile; then
15142 *" 4294967303.150000 1.150000 4294967302.000000")
15143 echo >&4 "Your modfl() is broken for large values."
15144 d_modfl_pow32_bug="$define"
15146 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
15150 *" 4294967303.150000 0.150000 4294967303.000000")
15151 echo >&4 "Your modfl() seems okay for large values."
15153 *) echo >&4 "I don't understand your modfl() at all."
15159 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
15162 case "$osname:$gccversion" in
15163 aix:) ccflags="$saveccflags" ;; # restore
15168 if $test "$uselongdouble" = "$define"; then
15170 if $test "$d_sqrtl" != "$define"; then
15171 message="$message sqrtl"
15173 if $test "$d_modfl" != "$define"; then
15174 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
15175 echo "You have both aintl and copysignl, so I can emulate modfl."
15177 message="$message modfl"
15180 if $test "$d_frexpl" != "$define"; then
15181 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
15182 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
15184 message="$message frexpl"
15188 if $test "$message" != ""; then
15191 *** You requested the use of long doubles but you do not seem to have
15192 *** the following mathematical functions needed for long double support:
15194 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
15195 *** Cannot continue, aborting.
15203 : see if mprotect exists
15204 set mprotect d_mprotect
15207 : see if msgctl exists
15208 set msgctl d_msgctl
15211 : see if msgget exists
15212 set msgget d_msgget
15215 : see if msgsnd exists
15216 set msgsnd d_msgsnd
15219 : see if msgrcv exists
15220 set msgrcv d_msgrcv
15223 : see how much of the 'msg*(2)' library is present.
15226 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
15227 *"$undef"*) h_msg=false;;
15231 case "`ipcs 2>&1`" in
15232 "SVID messages"*"not configured"*)
15233 echo "Your $osname does not have the msg*(2) configured." >&4
15236 set msgctl d_msgctl
15238 set msgget d_msgget
15240 set msgsnd d_msgsnd
15242 set msgrcv d_msgrcv
15248 : we could also check for sys/ipc.h ...
15249 if $h_msg && $test `./findhdr sys/msg.h`; then
15250 echo "You have the full msg*(2) library." >&4
15253 echo "You don't have the full msg*(2) library." >&4
15259 : Check for msghdr_s
15261 echo "Checking to see if your system supports struct msghdr..." >&4
15262 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
15264 case "$d_msghdr_s" in
15265 "$define") echo "Yes, it does." ;;
15266 *) echo "No, it doesn't." ;;
15270 : see if msync exists
15274 : see if munmap exists
15275 set munmap d_munmap
15278 : see if nice exists
15282 : see if this is a langinfo.h system
15283 set langinfo.h i_langinfo
15286 : see if nl_langinfo exists
15287 set nl_langinfo d_nl_langinfo
15290 : check for volatile keyword
15292 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
15293 $cat >try.c <<'EOCP'
15296 typedef struct _goo_struct goo_struct;
15297 goo_struct * volatile goo = ((goo_struct *)0);
15298 struct _goo_struct {
15303 typedef unsigned short foo_t;
15304 char *volatile foo;
15306 volatile foo_t blech;
15310 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
15312 echo "Yup, it does."
15315 echo "Nope, it doesn't."
15321 : Check basic sizes
15323 $echo "Choosing the C types to be used for Perl's internal types..." >&4
15325 case "$use64bitint:$d_quad:$quadtype" in
15328 uvtype="$uquadtype"
15333 uvtype="unsigned long"
15339 case "$uselongdouble:$d_longdbl" in
15341 nvtype="long double"
15342 nvsize=$longdblsize
15349 $echo "(IV will be "$ivtype", $ivsize bytes)"
15350 $echo "(UV will be "$uvtype", $uvsize bytes)"
15351 $echo "(NV will be "$nvtype", $nvsize bytes)"
15354 #$i_inttypes I_INTTYPES
15356 #include <inttypes.h>
15361 int8_t i = INT8_MAX;
15362 uint8_t u = UINT8_MAX;
15363 printf("int8_t\n");
15366 int16_t i = INT16_MAX;
15367 uint16_t i = UINT16_MAX;
15368 printf("int16_t\n");
15371 int32_t i = INT32_MAX;
15372 uint32_t u = UINT32_MAX;
15373 printf("int32_t\n");
15378 i8type="signed char"
15379 u8type="unsigned char"
15384 '') case "$shortsize" in
15386 u16type="unsigned short"
15394 '') set try -DINT16
15395 if eval $compile; then
15396 case "`$run ./try`" in
15408 '') if $test $shortsize -ge 2; then
15410 u16type="unsigned short"
15418 '') case "$longsize" in
15420 u32type="unsigned long"
15424 *) case "$intsize" in
15426 u32type="unsigned int"
15436 '') set try -DINT32
15437 if eval $compile; then
15438 case "`$run ./try`" in
15450 '') if $test $intsize -ge 4; then
15452 u32type="unsigned int"
15460 '') case "$d_quad:$quadtype" in
15462 i64type="$quadtype"
15463 u64type="$uquadtype"
15471 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
15472 : volatile so that the compiler has to store it out to memory.
15473 if test X"$d_volatile" = X"$define"; then
15478 #$i_stdlib I_STDLIB
15480 #include <stdlib.h>
15482 #include <sys/types.h>
15483 #include <signal.h>
15485 $volatile int bletched = 0;
15486 $signal_t blech(int s) { bletched = 1; }
15491 int n = 8 * $uvsize;
15494 signal(SIGFPE, blech);
15497 for (i = 0; i < n; i++) {
15498 u = u << 1 | ($uvtype)1;
15500 if (($uvtype)d != u)
15504 d = ($nvtype)(u - 1);
15505 if (($uvtype)d != (u - 1))
15512 printf("%d\n", ((i == n) ? -n : i));
15518 d_nv_preserves_uv="$undef"
15519 if eval $compile; then
15520 nv_preserves_uv_bits="`$run ./try`"
15522 case "$nv_preserves_uv_bits" in
15524 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
15525 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
15526 d_nv_preserves_uv="$define"
15528 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
15529 d_nv_preserves_uv="$undef" ;;
15530 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
15531 nv_preserves_uv_bits="0" ;;
15535 $echo "Checking to find the largest integer value your NVs can hold..." >&4
15536 : volatile so that the compiler has to store it out to memory.
15537 if test X"$d_volatile" = X"$define"; then
15543 typedef $nvtype NV;
15550 while(count < 256) {
15551 $volatile NV up = value + 1.0;
15552 $volatile NV negated = -value;
15553 $volatile NV down = negated - 1.0;
15554 $volatile NV got_up = up - value;
15555 int up_good = got_up == 1.0;
15556 int got_down = down - negated;
15557 int down_good = got_down == -1.0;
15559 if (down_good != up_good) {
15561 "Inconsistency - up %d %f; down %d %f; for 2**%d (%.20f)\n",
15562 up_good, (double) got_up, down_good, (double) got_down,
15563 count, (double) value);
15570 fputs("256.0", stdout);
15573 fputs("2.0", stdout);
15579 fputs("*", stdout);
15585 fprintf(stderr, "Cannot overflow integer range, even at 2**%d (%.20f)\n",
15586 count, (double) value);
15592 nv_overflows_integers_at='0'
15593 if eval $compile; then
15599 The largest integer your NVs can preserve is equal to $xxx
15601 nv_overflows_integers_at="$xxx"
15604 Cannot determine the largest integer value your NVs can hold, unexpected output
15611 Cannot determine the largest integer value your NVs can hold
15618 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
15619 : volatile so that the compiler has to store it out to memory.
15620 if test X"$d_volatile" = X"$define"; then
15625 #$i_stdlib I_STDLIB
15627 #include <stdlib.h>
15629 #$i_string I_STRING
15631 # include <string.h>
15633 # include <strings.h>
15635 #include <sys/types.h>
15636 #include <signal.h>
15638 $volatile int bletched = 0;
15639 $signal_t blech(int s) { bletched = 1; }
15642 int checkit($nvtype d, char *where) {
15643 unsigned char *p = (char *)&d;
15644 unsigned char *end = p + sizeof(d);
15654 printf("No - %s: 0x", where);
15656 printf ("%02X", *p++);
15661 int main(int argc, char **argv) {
15664 fail += checkit(d, "0.0");
15666 /* The compiler shouldn't be assuming that bletched is 0 */
15669 fail += checkit(d, "bleched");
15672 signal(SIGFPE, blech);
15675 /* Paranoia - the compiler should have no way of knowing that ANSI says
15676 that argv[argc] will always be NULL. Actually, if it did assume this it
15677 would be buggy, as this is C and main() can be called from elsewhere in
15679 d = argv[argc] ? 1 : 0;
15682 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
15685 fail += checkit(d, "ternary");
15687 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
15690 printf("No - memset doesn't give 0.0\n");
15691 /* This might just blow up: */
15692 printf("(gives %g)\n", d);
15698 printf("No - something bleched\n");
15703 printf("No - %d fail(s)\n", fail);
15712 d_nv_zero_is_allbits_zero="$undef"
15713 if eval $compile; then
15719 0.0 is represented as all bits zero in memory
15721 d_nv_zero_is_allbits_zero="$define"
15724 0.0 is not represented as all bits zero in memory
15726 d_nv_zero_is_allbits_zero="$undef"
15731 0.0 is not represented as all bits zero in memory
15733 d_nv_zero_is_allbits_zero="$undef"
15739 : check for off64_t
15741 echo "Checking to see if you have off64_t..." >&4
15743 #include <sys/types.h>
15744 #include <unistd.h>
15745 int main() { off64_t x = 7; }
15748 if eval $compile; then
15750 echo "You have off64_t."
15753 echo "You do not have off64_t."
15754 case "$lseeksize" in
15755 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
15762 : how to create joinable pthreads
15763 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
15765 echo "Checking what constant to use for creating joinable pthreads..." >&4
15766 $cat >try.c <<'EOCP'
15767 #include <pthread.h>
15769 int detachstate = JOINABLE;
15772 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
15773 if eval $compile; then
15774 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
15775 val="$undef" # Yes, undef.
15776 set d_old_pthread_create_joinable
15779 set old_pthread_create_joinable
15782 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
15783 if eval $compile; then
15784 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
15786 set d_old_pthread_create_joinable
15788 val=PTHREAD_CREATE_UNDETACHED
15789 set old_pthread_create_joinable
15792 set try -DJOINABLE=__UNDETACHED
15793 if eval $compile; then
15794 echo "You seem to use __UNDETACHED." >&4
15796 set d_old_pthread_create_joinable
15799 set old_pthread_create_joinable
15802 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
15804 set d_old_pthread_create_joinable
15807 set old_pthread_create_joinable
15814 d_old_pthread_create_joinable="$undef"
15815 old_pthread_create_joinable=""
15818 : see if pause exists
15822 : see if poll exists
15826 : see if readlink exists
15827 set readlink d_readlink
15830 : Check if exe is symlink to abs path of executing program
15834 case "$d_readlink" in
15836 if $issymlink /proc/self/exe ; then
15837 $ls -l /proc/self/exe > reflect
15838 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
15839 echo "You have Linux-like /proc/self/exe."
15840 procselfexe='"/proc/self/exe"'
15844 if $issymlink /proc/curproc/file ; then
15845 $ls -l /proc/curproc/file > reflect
15846 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
15847 echo "You have BSD-like /proc/curproc/file."
15848 procselfexe='"/proc/curproc/file"'
15858 : backward compatibility for d_hvfork
15859 if test X$d_hvfork != X; then
15860 d_vfork="$d_hvfork"
15863 : see if there is a vfork
15868 d_pseudofork=$undef
15870 : Ok, but do we want to use it. vfork is reportedly unreliable in
15871 : perl on Solaris 2.x, and probably elsewhere.
15875 case "$usevfork" in
15881 Perl can only use a vfork() that doesn't suffer from strict
15882 restrictions on calling functions or modifying global data in
15883 the child. For example, glibc-2.1 contains such a vfork()
15884 that is unsuitable. If your system provides a proper fork()
15885 call, chances are that you do NOT want perl to use vfork().
15888 rp="Do you still want to use vfork()?"
15893 echo "Ok, we won't use vfork()."
15902 $define) usevfork='true';;
15903 *) usevfork='false';;
15906 : see whether the pthread_atfork exists
15908 #include <pthread.h>
15911 #ifdef PTHREAD_ATFORK
15912 pthread_atfork(NULL,NULL,NULL);
15917 : see if pthread_atfork exists
15918 set try -DPTHREAD_ATFORK
15919 if eval $compile; then
15924 case "$usethreads" in
15927 $define) echo 'pthread_atfork found.' >&4 ;;
15928 *) echo 'pthread_atfork NOT found.' >&4 ;;
15931 set d_pthread_atfork
15934 : see if pthread_attr_setscope exists
15935 set pthread_attr_setscope d_pthread_attr_setscope
15938 : see whether the various POSIXish _yields exist
15940 #include <pthread.h>
15946 #ifdef PTHREAD_YIELD
15949 #ifdef PTHREAD_YIELD_NULL
15950 pthread_yield(NULL);
15956 : see if sched_yield exists
15957 set try -DSCHED_YIELD
15958 if eval $compile; then
15960 sched_yield='sched_yield()'
15964 case "$usethreads" in
15967 $define) echo 'sched_yield() found.' >&4 ;;
15968 *) echo 'sched_yield() NOT found.' >&4 ;;
15974 : see if pthread_yield exists
15975 set try -DPTHREAD_YIELD
15976 if eval $compile; then
15978 case "$sched_yield" in
15979 '') sched_yield='pthread_yield()' ;;
15982 set try -DPTHREAD_YIELD_NULL
15983 if eval $compile; then
15985 case "$sched_yield" in
15986 '') sched_yield='pthread_yield(NULL)' ;;
15992 case "$usethreads" in
15995 $define) echo 'pthread_yield() found.' >&4 ;;
15996 *) echo 'pthread_yield() NOT found.' >&4 ;;
16000 set d_pthread_yield
16002 case "$sched_yield" in
16003 '') sched_yield=undef ;;
16007 : see if random_r exists
16008 set random_r d_random_r
16010 case "$d_random_r" in
16012 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
16013 case "$d_random_r_proto:$usethreads" in
16014 ":define") d_random_r_proto=define
16015 set d_random_r_proto random_r $hdrs
16019 case "$d_random_r_proto" in
16021 case "$random_r_proto" in
16022 ''|0) try='int random_r(int*, struct random_data*);'
16023 ./protochk "extern $try" $hdrs && random_r_proto=I_iS ;;
16025 case "$random_r_proto" in
16026 ''|0) try='int random_r(long*, struct random_data*);'
16027 ./protochk "extern $try" $hdrs && random_r_proto=I_lS ;;
16029 case "$random_r_proto" in
16030 ''|0) try='int random_r(struct random_data*, int32_t*);'
16031 ./protochk "extern $try" $hdrs && random_r_proto=I_St ;;
16033 case "$random_r_proto" in
16034 ''|0) d_random_r=undef
16036 echo "Disabling random_r, cannot determine prototype." >&4 ;;
16037 * ) case "$random_r_proto" in
16038 REENTRANT_PROTO*) ;;
16039 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
16041 echo "Prototype: $try" ;;
16044 *) case "$usethreads" in
16045 define) echo "random_r has no prototype, not using it." >&4 ;;
16052 *) random_r_proto=0
16056 : see if readdir and friends exist
16057 set readdir d_readdir
16059 set seekdir d_seekdir
16061 set telldir d_telldir
16063 set rewinddir d_rewinddir
16066 : see if readdir64_r exists
16067 set readdir64_r d_readdir64_r
16069 case "$d_readdir64_r" in
16071 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
16072 case "$d_readdir64_r_proto:$usethreads" in
16073 ":define") d_readdir64_r_proto=define
16074 set d_readdir64_r_proto readdir64_r $hdrs
16078 case "$d_readdir64_r_proto" in
16080 case "$readdir64_r_proto" in
16081 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
16082 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TSR ;;
16084 case "$readdir64_r_proto" in
16085 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
16086 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TS ;;
16088 case "$readdir64_r_proto" in
16089 ''|0) d_readdir64_r=undef
16090 readdir64_r_proto=0
16091 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
16092 * ) case "$readdir64_r_proto" in
16093 REENTRANT_PROTO*) ;;
16094 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
16096 echo "Prototype: $try" ;;
16099 *) case "$usethreads" in
16100 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
16102 d_readdir64_r=undef
16103 readdir64_r_proto=0
16107 *) readdir64_r_proto=0
16111 : see if readdir_r exists
16112 set readdir_r d_readdir_r
16114 case "$d_readdir_r" in
16116 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
16117 case "$d_readdir_r_proto:$usethreads" in
16118 ":define") d_readdir_r_proto=define
16119 set d_readdir_r_proto readdir_r $hdrs
16123 case "$d_readdir_r_proto" in
16125 case "$readdir_r_proto" in
16126 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
16127 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TSR ;;
16129 case "$readdir_r_proto" in
16130 ''|0) try='int readdir_r(DIR*, struct dirent*);'
16131 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TS ;;
16133 case "$readdir_r_proto" in
16134 ''|0) d_readdir_r=undef
16136 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
16137 * ) case "$readdir_r_proto" in
16138 REENTRANT_PROTO*) ;;
16139 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
16141 echo "Prototype: $try" ;;
16144 *) case "$usethreads" in
16145 define) echo "readdir_r has no prototype, not using it." >&4 ;;
16152 *) readdir_r_proto=0
16156 : see if readv exists
16160 : see if recvmsg exists
16161 set recvmsg d_recvmsg
16164 : see if rename exists
16165 set rename d_rename
16168 : see if rmdir exists
16172 : see if memory.h is available.
16177 : See if it conflicts with string.h
16183 $cppstdin $cppflags $cppminus < $strings > mem.h
16184 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
16186 echo "We won't be including <memory.h>."
16196 : can bcopy handle overlapping blocks?
16199 case "$d_memmove" in
16200 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
16201 *) case "$d_bcopy" in
16203 echo "Checking to see if bcopy() can do overlapping copies..." >&4
16205 #$i_memory I_MEMORY
16206 #$i_stdlib I_STDLIB
16207 #$i_string I_STRING
16208 #$i_unistd I_UNISTD
16210 $cat >>try.c <<'EOCP'
16213 # include <memory.h>
16216 # include <stdlib.h>
16219 # include <string.h>
16221 # include <strings.h>
16224 # include <unistd.h> /* Needed for NetBSD */
16228 char buf[128], abc[128];
16234 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16235 try to store the string in read-only memory. */
16236 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
16238 for (align = 7; align >= 0; align--) {
16239 for (len = 36; len; len--) {
16241 bcopy(abc, b, len);
16242 for (off = 1; off <= len; off++) {
16243 bcopy(b, b+off, len);
16244 bcopy(b+off, b, len);
16245 if (bcmp(b, abc, len))
16254 if eval $compile_ok; then
16255 if $run ./try 2>/dev/null; then
16256 echo "Yes, it can."
16259 echo "It can't, sorry."
16262 echo "(I can't compile the test program, so we'll assume not...)"
16272 : can memcpy handle overlapping blocks?
16275 case "$d_memmove" in
16276 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
16277 *) case "$d_memcpy" in
16279 echo "Checking to see if memcpy() can do overlapping copies..." >&4
16281 #$i_memory I_MEMORY
16282 #$i_stdlib I_STDLIB
16283 #$i_string I_STRING
16284 #$i_unistd I_UNISTD
16286 $cat >>try.c <<'EOCP'
16289 # include <memory.h>
16292 # include <stdlib.h>
16295 # include <string.h>
16297 # include <strings.h>
16300 # include <unistd.h> /* Needed for NetBSD */
16304 char buf[128], abc[128];
16310 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16311 try to store the string in read-only memory. */
16312 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
16314 for (align = 7; align >= 0; align--) {
16315 for (len = 36; len; len--) {
16317 memcpy(b, abc, len);
16318 for (off = 1; off <= len; off++) {
16319 memcpy(b+off, b, len);
16320 memcpy(b, b+off, len);
16321 if (memcmp(b, abc, len))
16330 if eval $compile_ok; then
16331 if $run ./try 2>/dev/null; then
16332 echo "Yes, it can."
16335 echo "It can't, sorry."
16338 echo "(I can't compile the test program, so we'll assume not...)"
16348 : can memcmp be trusted to compare relative magnitude?
16350 case "$d_memcmp" in
16353 echo "Checking if your memcmp() can compare relative magnitude..." >&4
16355 #$i_memory I_MEMORY
16356 #$i_stdlib I_STDLIB
16357 #$i_string I_STRING
16358 #$i_unistd I_UNISTD
16360 $cat >>try.c <<'EOCP'
16363 # include <memory.h>
16366 # include <stdlib.h>
16369 # include <string.h>
16371 # include <strings.h>
16374 # include <unistd.h> /* Needed for NetBSD */
16380 if ((a < b) && memcmp(&a, &b, 1) < 0)
16386 if eval $compile_ok; then
16387 if $run ./try 2>/dev/null; then
16388 echo "Yes, it can."
16391 echo "No, it can't (it uses signed chars)."
16394 echo "(I can't compile the test program, so we'll assume not...)"
16402 : see if prototype for sbrk is available
16404 set d_sbrkproto sbrk $i_unistd unistd.h
16407 : see if select exists
16408 set select d_select
16411 : see if semctl exists
16412 set semctl d_semctl
16415 : see if semget exists
16416 set semget d_semget
16419 : see if semop exists
16423 : see how much of the 'sem*(2)' library is present.
16426 case "$d_semctl$d_semget$d_semop" in
16427 *"$undef"*) h_sem=false;;
16431 case "`ipcs 2>&1`" in
16432 "SVID messages"*"not configured"*)
16433 echo "Your $osname does not have the sem*(2) configured." >&4
16436 set semctl d_semctl
16438 set semget d_semget
16446 : we could also check for sys/ipc.h ...
16447 if $h_sem && $test `./findhdr sys/sem.h`; then
16448 echo "You have the full sem*(2) library." >&4
16451 echo "You don't have the full sem*(2) library." >&4
16457 : see whether sys/sem.h defines union semun
16459 $cat > try.c <<'END'
16460 #include <sys/types.h>
16461 #include <sys/ipc.h>
16462 #include <sys/sem.h>
16463 int main () { union semun semun; semun.buf = 0; }
16466 if eval $compile; then
16467 echo "You have union semun in <sys/sem.h>." >&4
16470 echo "You do not have union semun in <sys/sem.h>." >&4
16477 : see how to do semctl IPC_STAT
16481 $cat > tryh.h <<END
16484 # define S_IRUSR S_IREAD
16485 # define S_IWUSR S_IWRITE
16486 # define S_IXUSR S_IEXEC
16488 # define S_IRUSR 0400
16489 # define S_IWUSR 0200
16490 # define S_IXUSR 0100
16492 # define S_IRGRP (S_IRUSR>>3)
16493 # define S_IWGRP (S_IWUSR>>3)
16494 # define S_IXGRP (S_IXUSR>>3)
16495 # define S_IROTH (S_IRUSR>>6)
16496 # define S_IWOTH (S_IWUSR>>6)
16497 # define S_IXOTH (S_IXUSR>>6)
16500 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
16501 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
16502 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
16505 : see whether semctl IPC_STAT can use union semun
16506 case "$d_semctl_semun" in
16510 #include <sys/types.h>
16511 #include <sys/ipc.h>
16512 #include <sys/sem.h>
16513 #include <sys/stat.h>
16520 #$d_union_semun HAS_UNION_SEMUN
16523 #ifndef HAS_UNION_SEMUN
16526 struct semid_ds *buf;
16527 unsigned short *array;
16533 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16534 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16536 struct semid_ds argbuf;
16539 st = semctl(sem, 0, IPC_STAT, arg);
16543 # endif /* IPC_STAT */
16544 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16546 if (semctl(sem, 0, IPC_RMID, arg) != 0)
16547 # endif /* IPC_RMID */
16548 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16550 #endif /* IPC_PRIVATE && ... */
16551 printf("semget failed: errno = %d\n", errno);
16556 if eval $compile; then
16559 semun) val="$define" ;;
16567 case "$d_semctl_semun" in
16569 echo "You can use union semun for semctl IPC_STAT." >&4
16572 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
16577 : see whether semctl IPC_STAT can use struct semid_ds pointer
16578 case "$d_semctl_semid_ds" in
16581 $cat > try.c <<'END'
16582 #include <sys/types.h>
16583 #include <sys/ipc.h>
16584 #include <sys/sem.h>
16585 #include <sys/stat.h>
16593 struct semid_ds arg;
16596 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16597 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16600 st = semctl(sem, 0, IPC_STAT, &arg);
16602 printf("semid_ds\n");
16604 # endif /* IPC_STAT */
16605 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16607 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
16608 # endif /* IPC_RMID */
16609 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16611 #endif /* IPC_PRIVATE && ... */
16612 printf("semget failed: errno = %d\n", errno);
16618 if eval $compile; then
16621 semid_ds) val="$define" ;;
16625 set d_semctl_semid_ds
16629 case "$d_semctl_semid_ds" in
16631 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
16633 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
16639 # We do not have the full sem*(2) library, so assume we can not
16645 set d_semctl_semid_ds
16651 : see if sendmsg exists
16652 set sendmsg d_sendmsg
16655 : see if setegid exists
16656 set setegid d_setegid
16659 : see if seteuid exists
16660 set seteuid d_seteuid
16663 : see if setgrent exists
16664 set setgrent d_setgrent
16667 : see if setgrent_r exists
16668 set setgrent_r d_setgrent_r
16670 case "$d_setgrent_r" in
16672 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
16673 case "$d_setgrent_r_proto:$usethreads" in
16674 ":define") d_setgrent_r_proto=define
16675 set d_setgrent_r_proto setgrent_r $hdrs
16679 case "$d_setgrent_r_proto" in
16681 case "$setgrent_r_proto" in
16682 ''|0) try='int setgrent_r(FILE**);'
16683 ./protochk "extern $try" $hdrs && setgrent_r_proto=I_H ;;
16685 case "$setgrent_r_proto" in
16686 ''|0) try='void setgrent_r(FILE**);'
16687 ./protochk "extern $try" $hdrs && setgrent_r_proto=V_H ;;
16689 case "$setgrent_r_proto" in
16690 ''|0) d_setgrent_r=undef
16692 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
16693 * ) case "$setgrent_r_proto" in
16694 REENTRANT_PROTO*) ;;
16695 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
16697 echo "Prototype: $try" ;;
16700 *) case "$usethreads" in
16701 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
16708 *) setgrent_r_proto=0
16712 : see if sethostent exists
16713 set sethostent d_sethent
16716 : see if sethostent_r exists
16717 set sethostent_r d_sethostent_r
16719 case "$d_sethostent_r" in
16721 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16722 case "$d_sethostent_r_proto:$usethreads" in
16723 ":define") d_sethostent_r_proto=define
16724 set d_sethostent_r_proto sethostent_r $hdrs
16728 case "$d_sethostent_r_proto" in
16730 case "$sethostent_r_proto" in
16731 ''|0) try='int sethostent_r(int, struct hostent_data*);'
16732 ./protochk "extern $try" $hdrs && sethostent_r_proto=I_ID ;;
16734 case "$sethostent_r_proto" in
16735 ''|0) try='void sethostent_r(int, struct hostent_data*);'
16736 ./protochk "extern $try" $hdrs && sethostent_r_proto=V_ID ;;
16738 case "$sethostent_r_proto" in
16739 ''|0) d_sethostent_r=undef
16740 sethostent_r_proto=0
16741 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
16742 * ) case "$sethostent_r_proto" in
16743 REENTRANT_PROTO*) ;;
16744 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
16746 echo "Prototype: $try" ;;
16749 *) case "$usethreads" in
16750 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
16752 d_sethostent_r=undef
16753 sethostent_r_proto=0
16757 *) sethostent_r_proto=0
16761 : see if setitimer exists
16762 set setitimer d_setitimer
16765 : see if setlinebuf exists
16766 set setlinebuf d_setlinebuf
16769 : see if setlocale exists
16770 set setlocale d_setlocale
16773 : see if locale.h is available
16774 set locale.h i_locale
16777 : see if setlocale_r exists
16778 set setlocale_r d_setlocale_r
16780 case "$d_setlocale_r" in
16782 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
16783 case "$d_setlocale_r_proto:$usethreads" in
16784 ":define") d_setlocale_r_proto=define
16785 set d_setlocale_r_proto setlocale_r $hdrs
16789 case "$d_setlocale_r_proto" in
16791 case "$setlocale_r_proto" in
16792 ''|0) try='int setlocale_r(int, const char*, char*, int);'
16793 ./protochk "extern $try" $hdrs && setlocale_r_proto=I_ICBI ;;
16795 case "$setlocale_r_proto" in
16796 ''|0) d_setlocale_r=undef
16797 setlocale_r_proto=0
16798 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
16799 * ) case "$setlocale_r_proto" in
16800 REENTRANT_PROTO*) ;;
16801 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
16803 echo "Prototype: $try" ;;
16806 *) case "$usethreads" in
16807 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
16809 d_setlocale_r=undef
16810 setlocale_r_proto=0
16814 *) setlocale_r_proto=0
16818 : see if setnetent exists
16819 set setnetent d_setnent
16822 : see if setnetent_r exists
16823 set setnetent_r d_setnetent_r
16825 case "$d_setnetent_r" in
16827 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16828 case "$d_setnetent_r_proto:$usethreads" in
16829 ":define") d_setnetent_r_proto=define
16830 set d_setnetent_r_proto setnetent_r $hdrs
16834 case "$d_setnetent_r_proto" in
16836 case "$setnetent_r_proto" in
16837 ''|0) try='int setnetent_r(int, struct netent_data*);'
16838 ./protochk "extern $try" $hdrs && setnetent_r_proto=I_ID ;;
16840 case "$setnetent_r_proto" in
16841 ''|0) try='void setnetent_r(int, struct netent_data*);'
16842 ./protochk "extern $try" $hdrs && setnetent_r_proto=V_ID ;;
16844 case "$setnetent_r_proto" in
16845 ''|0) d_setnetent_r=undef
16846 setnetent_r_proto=0
16847 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
16848 * ) case "$setnetent_r_proto" in
16849 REENTRANT_PROTO*) ;;
16850 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
16852 echo "Prototype: $try" ;;
16855 *) case "$usethreads" in
16856 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
16858 d_setnetent_r=undef
16859 setnetent_r_proto=0
16863 *) setnetent_r_proto=0
16867 : see if setprotoent exists
16868 set setprotoent d_setpent
16871 : see if setpgid exists
16872 set setpgid d_setpgid
16875 : see if setpgrp2 exists
16876 set setpgrp2 d_setpgrp2
16879 : see if setpriority exists
16880 set setpriority d_setprior
16883 : see if setproctitle exists
16884 set setproctitle d_setproctitle
16887 : see if setprotoent_r exists
16888 set setprotoent_r d_setprotoent_r
16890 case "$d_setprotoent_r" in
16892 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16893 case "$d_setprotoent_r_proto:$usethreads" in
16894 ":define") d_setprotoent_r_proto=define
16895 set d_setprotoent_r_proto setprotoent_r $hdrs
16899 case "$d_setprotoent_r_proto" in
16901 case "$setprotoent_r_proto" in
16902 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
16903 ./protochk "extern $try" $hdrs && setprotoent_r_proto=I_ID ;;
16905 case "$setprotoent_r_proto" in
16906 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
16907 ./protochk "extern $try" $hdrs && setprotoent_r_proto=V_ID ;;
16909 case "$setprotoent_r_proto" in
16910 ''|0) d_setprotoent_r=undef
16911 setprotoent_r_proto=0
16912 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
16913 * ) case "$setprotoent_r_proto" in
16914 REENTRANT_PROTO*) ;;
16915 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
16917 echo "Prototype: $try" ;;
16920 *) case "$usethreads" in
16921 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
16923 d_setprotoent_r=undef
16924 setprotoent_r_proto=0
16928 *) setprotoent_r_proto=0
16932 : see if setpwent exists
16933 set setpwent d_setpwent
16936 : see if setpwent_r exists
16937 set setpwent_r d_setpwent_r
16939 case "$d_setpwent_r" in
16941 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
16942 case "$d_setpwent_r_proto:$usethreads" in
16943 ":define") d_setpwent_r_proto=define
16944 set d_setpwent_r_proto setpwent_r $hdrs
16948 case "$d_setpwent_r_proto" in
16950 case "$setpwent_r_proto" in
16951 ''|0) try='int setpwent_r(FILE**);'
16952 ./protochk "extern $try" $hdrs && setpwent_r_proto=I_H ;;
16954 case "$setpwent_r_proto" in
16955 ''|0) try='void setpwent_r(FILE**);'
16956 ./protochk "extern $try" $hdrs && setpwent_r_proto=V_H ;;
16958 case "$setpwent_r_proto" in
16959 ''|0) d_setpwent_r=undef
16961 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
16962 * ) case "$setpwent_r_proto" in
16963 REENTRANT_PROTO*) ;;
16964 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
16966 echo "Prototype: $try" ;;
16969 *) case "$usethreads" in
16970 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
16977 *) setpwent_r_proto=0
16981 : see if setregid exists
16982 set setregid d_setregid
16984 set setresgid d_setresgid
16987 : see if setreuid exists
16988 set setreuid d_setreuid
16990 set setresuid d_setresuid
16993 : see if setrgid exists
16994 set setrgid d_setrgid
16997 : see if setruid exists
16998 set setruid d_setruid
17001 : see if setservent exists
17002 set setservent d_setsent
17005 : see if setservent_r exists
17006 set setservent_r d_setservent_r
17008 case "$d_setservent_r" in
17010 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17011 case "$d_setservent_r_proto:$usethreads" in
17012 ":define") d_setservent_r_proto=define
17013 set d_setservent_r_proto setservent_r $hdrs
17017 case "$d_setservent_r_proto" in
17019 case "$setservent_r_proto" in
17020 ''|0) try='int setservent_r(int, struct servent_data*);'
17021 ./protochk "extern $try" $hdrs && setservent_r_proto=I_ID ;;
17023 case "$setservent_r_proto" in
17024 ''|0) try='void setservent_r(int, struct servent_data*);'
17025 ./protochk "extern $try" $hdrs && setservent_r_proto=V_ID ;;
17027 case "$setservent_r_proto" in
17028 ''|0) d_setservent_r=undef
17029 setservent_r_proto=0
17030 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
17031 * ) case "$setservent_r_proto" in
17032 REENTRANT_PROTO*) ;;
17033 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
17035 echo "Prototype: $try" ;;
17038 *) case "$usethreads" in
17039 define) echo "setservent_r has no prototype, not using it." >&4 ;;
17041 d_setservent_r=undef
17042 setservent_r_proto=0
17046 *) setservent_r_proto=0
17050 : see if setsid exists
17051 set setsid d_setsid
17054 : see if setvbuf exists
17055 set setvbuf d_setvbuf
17058 : see if sfio.h is available
17062 : see if sfio library is available
17073 : Ok, but do we want to use it.
17077 true|$define|[yY]*) dflt='y';;
17080 echo "$package can use the sfio library, but it is experimental."
17081 case "$useperlio" in
17083 echo "For sfio also the PerlIO abstraction layer is needed."
17084 echo "Earlier you said you wouldn't want that."
17087 rp="You seem to have sfio available, do you want to try using it?"
17090 y|Y) echo "Ok, turning on both sfio and PerlIO, then."
17091 useperlio="$define"
17094 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
17099 *) case "$usesfio" in
17100 true|$define|[yY]*)
17101 echo "Sorry, cannot find sfio on this machine." >&4
17102 echo "Ignoring your setting of usesfio=$usesfio." >&4
17111 $define) usesfio='true';;
17112 *) usesfio='false';;
17116 *) : Remove sfio from list of libraries to use
17119 echo "Removing unneeded -lsfio from library list" >&4
17120 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
17123 echo "libs = $libs" >&4
17130 : see if shmctl exists
17131 set shmctl d_shmctl
17134 : see if shmget exists
17135 set shmget d_shmget
17138 : see if shmat exists
17141 : see what shmat returns
17144 $cat >shmat.c <<'END'
17145 #include <sys/shm.h>
17148 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
17153 echo "and it returns ($shmattype)." >&4
17154 : see if a prototype for shmat is available
17155 xxx=`./findhdr sys/shm.h`
17156 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
17157 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
17168 set d_shmatprototype
17171 : see if shmdt exists
17175 : see how much of the 'shm*(2)' library is present.
17178 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
17179 *"$undef"*) h_shm=false;;
17183 case "`ipcs 2>&1`" in
17184 "SVID shared memory"*"not configured"*)
17185 echo "Your $osname does not have the shm*(2) configured." >&4
17188 set shmctl d_shmctl
17190 set shmget d_shmget
17200 : we could also check for sys/ipc.h ...
17201 if $h_shm && $test `./findhdr sys/shm.h`; then
17202 echo "You have the full shm*(2) library." >&4
17205 echo "You don't have the full shm*(2) library." >&4
17211 : see if we have sigaction
17213 if set sigaction val -f d_sigaction; eval $csym; $val; then
17214 echo 'sigaction() found.' >&4
17217 #include <sys/types.h>
17218 #include <signal.h>
17219 #$i_stdlib I_STDLIB
17221 #include <stdlib.h>
17225 struct sigaction act, oact;
17227 oact.sa_handler = 0;
17228 /* so that act and oact are used */
17229 exit(act.sa_flags == 0 && oact.sa_handler == 0);
17233 if eval $compile_ok; then
17236 echo "But you don't seem to have a useable struct sigaction." >&4
17240 echo 'sigaction NOT found.' >&4
17243 set d_sigaction; eval $setvar
17246 : see if this is a sunmath.h system
17247 set sunmath.h i_sunmath
17250 : see if signbit exists
17251 $echo $n "Checking to see if you have signbit() available to work on $nvtype... $c" >&4
17254 #$i_sunmath I_SUNMATH
17258 #ifdef I_SUNMATH /* Solaris special math library */
17259 # include <sunmath.h>
17262 int main(int argc, char **argv)
17266 if ((signbit(x) == 0) && (signbit(y) != 0))
17274 if eval $compile; then
17275 if $run ./try; then
17279 $echo "Signbit seems to be available, but doesn't work as I expected."
17280 $echo "I won't use it." >&4
17291 : see if sigprocmask exists
17292 set sigprocmask d_sigprocmask
17295 : see if sigsetjmp exists
17297 case "$d_sigsetjmp" in
17300 #include <setjmp.h>
17301 #$i_stdlib I_STDLIB
17303 #include <stdlib.h>
17309 if (sigsetjmp(env,1))
17312 siglongjmp(env, 1);
17317 if eval $compile; then
17318 if $run ./try >/dev/null 2>&1; then
17319 echo "POSIX sigsetjmp found." >&4
17323 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
17329 echo "sigsetjmp not found." >&4
17333 *) val="$d_sigsetjmp"
17334 case "$d_sigsetjmp" in
17335 $define) echo "POSIX sigsetjmp found." >&4;;
17336 $undef) echo "sigsetjmp not found." >&4;;
17344 : see if snprintf exists
17345 set snprintf d_snprintf
17348 : see if vsnprintf exists
17349 set vsnprintf d_vsnprintf
17352 case "$d_snprintf-$d_vsnprintf" in
17355 Checking whether your snprintf() and vsnprintf() work okay...
17357 $cat >try.c <<'EOCP'
17358 /* v?snprintf testing logic courtesy of Russ Allbery.
17359 * According to C99:
17360 * - if the buffer is too short it still must be \0-terminated
17361 * - if the buffer is too short the potentially required length
17362 * must be returned and not -1
17363 * - if the buffer is NULL the potentially required length
17364 * must be returned and not -1 or core dump
17367 #include <stdarg.h>
17371 int test (char *format, ...)
17376 va_start (args, format);
17377 count = vsnprintf (buf, sizeof buf, format, args);
17384 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
17385 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
17389 if eval $compile; then
17392 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
17394 Your snprintf() and snprintf() don't seem to be working okay.
17396 d_snprintf="$undef"
17397 d_vsnprintf="$undef"
17401 echo "(I can't seem to compile the test program--assuming they don't)"
17402 d_snprintf="$undef"
17403 d_vsnprintf="$undef"
17409 : see if sockatmark exists
17410 set sockatmark d_sockatmark
17413 : see if prototype for sockatmark is available
17415 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
17418 : see if socks5_init exists
17419 set socks5_init d_socks5_init
17422 : see if sprintf returns the length of the string in the buffer as per ANSI
17423 $echo "Checking whether sprintf returns the length of the string..." >&4
17426 #$i_stdlib I_STDLIB
17428 #include <stdlib.h>
17430 #$i_string I_STRING
17432 # include <string.h>
17434 # include <strings.h>
17443 int check (size_t expect, int test) {
17444 size_t got = strlen(buffer);
17448 printf("expected %ld, got %ld in test %d '%s'\n", (long) expect, (long) got,
17453 int main(int argc, char **argv) {
17456 check(sprintf(buffer, ""), ++test);
17457 check(sprintf(buffer, "%s %s", "perl", "rules"), ++test);
17458 check(sprintf(buffer, "I like %g", atan2(0,-1)), ++test);
17465 if eval $compile; then
17469 sprintf returns the length of the string (as ANSI says it should)
17471 d_sprintf_returns_strlen="$define"
17474 sprintf does not return the length of the string (how old is this system?)
17476 d_sprintf_returns_strlen="$undef"
17480 echo "(I can't seem to compile the test program--assuming it doesn't)" >&4
17481 d_sprintf_returns_strlen="$undef"
17485 : see if srand48_r exists
17486 set srand48_r d_srand48_r
17488 case "$d_srand48_r" in
17490 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17491 case "$d_srand48_r_proto:$usethreads" in
17492 ":define") d_srand48_r_proto=define
17493 set d_srand48_r_proto srand48_r $hdrs
17497 case "$d_srand48_r_proto" in
17499 case "$srand48_r_proto" in
17500 ''|0) try='int srand48_r(long, struct drand48_data*);'
17501 ./protochk "extern $try" $hdrs && srand48_r_proto=I_LS ;;
17503 case "$srand48_r_proto" in
17504 ''|0) d_srand48_r=undef
17506 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
17507 * ) case "$srand48_r_proto" in
17508 REENTRANT_PROTO*) ;;
17509 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
17511 echo "Prototype: $try" ;;
17514 *) case "$usethreads" in
17515 define) echo "srand48_r has no prototype, not using it." >&4 ;;
17522 *) srand48_r_proto=0
17526 : see if srandom_r exists
17527 set srandom_r d_srandom_r
17529 case "$d_srandom_r" in
17531 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17532 case "$d_srandom_r_proto:$usethreads" in
17533 ":define") d_srandom_r_proto=define
17534 set d_srandom_r_proto srandom_r $hdrs
17538 case "$d_srandom_r_proto" in
17540 case "$srandom_r_proto" in
17541 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
17542 ./protochk "extern $try" $hdrs && srandom_r_proto=I_TS ;;
17544 case "$srandom_r_proto" in
17545 ''|0) d_srandom_r=undef
17547 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
17548 * ) case "$srandom_r_proto" in
17549 REENTRANT_PROTO*) ;;
17550 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
17552 echo "Prototype: $try" ;;
17555 *) case "$usethreads" in
17556 define) echo "srandom_r has no prototype, not using it." >&4 ;;
17563 *) srandom_r_proto=0
17567 : see if prototype for setresgid is available
17569 set d_sresgproto setresgid $i_unistd unistd.h
17572 : see if prototype for setresuid is available
17574 set d_sresuproto setresuid $i_unistd unistd.h
17577 : see if sys/stat.h is available
17578 set sys/stat.h i_sysstat
17581 : see if stat knows about block sizes
17583 echo "Checking to see if your struct stat has st_blocks field..." >&4
17584 set d_statblks stat st_blocks $i_sysstat sys/stat.h
17587 : see if this is a sys/vfs.h system
17588 set sys/vfs.h i_sysvfs
17591 : see if this is a sys/statfs.h system
17592 set sys/statfs.h i_sysstatfs
17595 : Check for statfs_s
17597 echo "Checking to see if your system supports struct statfs..." >&4
17598 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
17600 case "$d_statfs_s" in
17601 "$define") echo "Yes, it does." ;;
17602 *) echo "No, it doesn't." ;;
17606 : see if struct statfs knows about f_flags
17607 case "$d_statfs_s" in
17610 echo "Checking to see if your struct statfs has f_flags field..." >&4
17611 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
17615 set d_statfs_f_flags
17619 case "$d_statfs_f_flags" in
17620 "$define") echo "Yes, it does." ;;
17621 *) echo "No, it doesn't." ;;
17624 : Check stream access
17626 Checking how to access stdio streams by file descriptor number...
17628 case "$stdio_stream_array" in
17629 '') $cat >try.c <<EOCP
17632 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
17636 for s in _iob __iob __sF
17638 set try -DSTDIO_STREAM_ARRAY=$s
17639 if eval $compile; then
17640 case "`$run ./try`" in
17641 yes) stdio_stream_array=$s; break ;;
17647 case "$stdio_stream_array" in
17649 I can't figure out how to access stdio streams by file descriptor number.
17651 d_stdio_stream_array="$undef"
17654 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
17656 d_stdio_stream_array="$define"
17660 : see if strcoll exists
17661 set strcoll d_strcoll
17664 : check for structure copying
17666 echo "Checking to see if your C compiler can copy structs..." >&4
17667 $cat >try.c <<'EOCP'
17677 if $cc -c try.c >/dev/null 2>&1 ; then
17679 echo "Yup, it can."
17682 echo "Nope, it can't."
17688 : see if strerror and/or sys_errlist[] exist
17690 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
17691 if set strerror val -f d_strerror; eval $csym; $val; then
17692 echo 'strerror() found.' >&4
17693 d_strerror="$define"
17694 d_strerrm='strerror(e)'
17695 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17696 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
17697 d_syserrlst="$define"
17699 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
17700 d_syserrlst="$undef"
17702 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
17703 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
17704 echo 'strerror() found in string header.' >&4
17705 d_strerror="$define"
17706 d_strerrm='strerror(e)'
17707 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17708 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
17709 d_syserrlst="$define"
17711 echo "(You don't appear to have any sys_errlist[], how can this be?)"
17712 d_syserrlst="$undef"
17714 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17715 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
17716 d_strerror="$undef"
17717 d_syserrlst="$define"
17718 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
17720 echo 'strerror() and sys_errlist[] NOT found.' >&4
17721 d_strerror="$undef"
17722 d_syserrlst="$undef"
17723 d_strerrm='"unknown"'
17727 : see if strerror_r exists
17728 set strerror_r d_strerror_r
17730 case "$d_strerror_r" in
17732 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
17733 case "$d_strerror_r_proto:$usethreads" in
17734 ":define") d_strerror_r_proto=define
17735 set d_strerror_r_proto strerror_r $hdrs
17739 case "$d_strerror_r_proto" in
17741 case "$strerror_r_proto" in
17742 ''|0) try='int strerror_r(int, char*, size_t);'
17743 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBW ;;
17745 case "$strerror_r_proto" in
17746 ''|0) try='int strerror_r(int, char*, int);'
17747 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBI ;;
17749 case "$strerror_r_proto" in
17750 ''|0) try='char* strerror_r(int, char*, size_t);'
17751 ./protochk "extern $try" $hdrs && strerror_r_proto=B_IBW ;;
17753 case "$strerror_r_proto" in
17754 ''|0) d_strerror_r=undef
17756 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
17757 * ) case "$strerror_r_proto" in
17758 REENTRANT_PROTO*) ;;
17759 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
17761 echo "Prototype: $try" ;;
17764 *) case "$usethreads" in
17765 define) echo "strerror_r has no prototype, not using it." >&4 ;;
17772 *) strerror_r_proto=0
17776 : see if strftime exists
17777 set strftime d_strftime
17780 : see if strlcat exists
17781 set strlcat d_strlcat
17784 : see if strlcpy exists
17785 set strlcpy d_strlcpy
17788 : see if strtod exists
17789 set strtod d_strtod
17792 : see if strtol exists
17793 set strtol d_strtol
17796 : see if strtold exists
17797 set strtold d_strtold
17800 : see if strtoll exists
17801 set strtoll d_strtoll
17804 case "$d_longlong-$d_strtoll" in
17807 Checking whether your strtoll() works okay...
17809 $cat >try.c <<'EOCP'
17812 #define strtoll __strtoll
17815 #define strtoll _strtoll
17818 extern long long int strtoll(char *s, char **, int);
17819 static int bad = 0;
17820 int check(char *s, long long ell, int een) {
17823 gll = strtoll(s, 0, 10);
17824 if (!((gll == ell) && (errno == een)))
17828 check(" 1", 1LL, 0);
17829 check(" 0", 0LL, 0);
17830 check("-1", -1LL, 0);
17831 check("-9223372036854775808", -9223372036854775808LL, 0);
17832 check("-9223372036854775808", -9223372036854775808LL, 0);
17833 check(" 9223372036854775807", 9223372036854775807LL, 0);
17834 check("-9223372036854775808", -9223372036854775808LL, 0);
17835 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
17836 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
17842 if eval $compile; then
17845 ok) echo "Your strtoll() seems to be working okay." ;;
17847 Your strtoll() doesn't seem to be working okay.
17853 echo "(I can't seem to compile the test program--assuming it doesn't)"
17859 : see if strtoq exists
17860 set strtoq d_strtoq
17863 : see if strtoul exists
17864 set strtoul d_strtoul
17867 case "$d_strtoul" in
17870 Checking whether your strtoul() works okay...
17872 $cat >try.c <<'EOCP'
17875 extern unsigned long int strtoul(char *s, char **, int);
17876 static int bad = 0;
17877 void check(char *s, unsigned long eul, int een) {
17880 gul = strtoul(s, 0, 10);
17881 if (!((gul == eul) && (errno == een)))
17885 check(" 1", 1L, 0);
17886 check(" 0", 0L, 0);
17888 case "$longsize" in
17890 $cat >>try.c <<'EOCP'
17891 check("18446744073709551615", 18446744073709551615UL, 0);
17892 check("18446744073709551616", 18446744073709551615UL, ERANGE);
17893 #if 0 /* strtoul() for /^-/ strings is undefined. */
17894 check("-1", 18446744073709551615UL, 0);
17895 check("-18446744073709551614", 2, 0);
17896 check("-18446744073709551615", 1, 0);
17897 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
17898 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
17903 $cat >>try.c <<'EOCP'
17904 check("4294967295", 4294967295UL, 0);
17905 check("4294967296", 4294967295UL, ERANGE);
17906 #if 0 /* strtoul() for /^-/ strings is undefined. */
17907 check("-1", 4294967295UL, 0);
17908 check("-4294967294", 2, 0);
17909 check("-4294967295", 1, 0);
17910 check("-4294967296", 4294967295UL, ERANGE);
17911 check("-4294967297", 4294967295UL, ERANGE);
17916 : Should we write these tests to be more portable by sprintf-ing
17917 : ~0 and then manipulating that char string as input for strtol?
17920 $cat >>try.c <<'EOCP'
17927 if eval $compile; then
17928 case "`$run ./try`" in
17929 ok) echo "Your strtoul() seems to be working okay." ;;
17931 Your strtoul() doesn't seem to be working okay.
17937 echo "(I can't seem to compile the test program--assuming it doesn't)"
17943 : see if strtoull exists
17944 set strtoull d_strtoull
17947 case "$d_longlong-$d_strtoull" in
17950 Checking whether your strtoull() works okay...
17952 $cat >try.c <<'EOCP'
17955 #define strtoull __strtoull
17958 extern unsigned long long int strtoull(char *s, char **, int);
17959 static int bad = 0;
17960 int check(char *s, long long eull, int een) {
17963 gull = strtoull(s, 0, 10);
17964 if (!((gull == eull) && (errno == een)))
17968 check(" 1", 1LL, 0);
17969 check(" 0", 0LL, 0);
17970 check("18446744073709551615", 18446744073709551615ULL, 0);
17971 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
17972 #if 0 /* strtoull() for /^-/ strings is undefined. */
17973 check("-1", 18446744073709551615ULL, 0);
17974 check("-18446744073709551614", 2LL, 0);
17975 check("-18446744073709551615", 1LL, 0);
17976 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
17977 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
17984 if eval $compile; then
17985 case "`$run ./try`" in
17986 ok) echo "Your strtoull() seems to be working okay." ;;
17988 Your strtoull() doesn't seem to be working okay.
17990 d_strtoull="$undef"
17994 echo "(I can't seem to compile the test program--assuming it doesn't)"
17995 d_strtoull="$undef"
18000 : see if strtouq exists
18001 set strtouq d_strtouq
18004 case "$d_strtouq" in
18007 Checking whether your strtouq() works okay...
18009 $cat >try.c <<'EOCP'
18012 extern unsigned long long int strtouq(char *s, char **, int);
18013 static int bad = 0;
18014 void check(char *s, unsigned long long eull, int een) {
18015 unsigned long long gull;
18017 gull = strtouq(s, 0, 10);
18018 if (!((gull == eull) && (errno == een)))
18022 check(" 1", 1LL, 0);
18023 check(" 0", 0LL, 0);
18024 check("18446744073709551615", 18446744073709551615ULL, 0);
18025 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
18026 #if 0 /* strtouq() for /^-/ strings is undefined. */
18027 check("-1", 18446744073709551615ULL, 0);
18028 check("-18446744073709551614", 2LL, 0);
18029 check("-18446744073709551615", 1LL, 0);
18030 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
18031 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
18039 if eval $compile; then
18040 case "`$run ./try`" in
18041 ok) echo "Your strtouq() seems to be working okay." ;;
18043 Your strtouq() doesn't seem to be working okay.
18049 echo "(I can't seem to compile the test program--assuming it doesn't)"
18055 : see if strxfrm exists
18056 set strxfrm d_strxfrm
18059 : see if symlink exists
18060 set symlink d_symlink
18063 : see if syscall exists
18064 set syscall d_syscall
18067 : see if prototype for syscall is available
18069 set d_syscallproto syscall $i_unistd unistd.h
18072 : see if sysconf exists
18073 set sysconf d_sysconf
18076 : see if system exists
18077 set system d_system
18080 : see if tcgetpgrp exists
18081 set tcgetpgrp d_tcgetpgrp
18084 : see if tcsetpgrp exists
18085 set tcsetpgrp d_tcsetpgrp
18088 : see if prototype for telldir is available
18090 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
18093 : see if time exists
18095 if test "X$d_time" = X -o X"$timetype" = X; then
18096 if set time val -f d_time; eval $csym; $val; then
18097 echo 'time() found.' >&4
18099 rp="What is the type returned by time() on this system?"
18100 set time_t timetype long stdio.h sys/types.h
18103 echo 'time() not found, hope that will do.' >&4
18111 : see if timegm exists
18112 set timegm d_timegm
18115 : see if this is a sys/times.h system
18116 set sys/times.h i_systimes
18119 : see if times exists
18121 if set times val -f d_times; eval $csym; $val; then
18122 echo 'times() found.' >&4
18125 case "$i_systimes" in
18126 "$define") inc='sys/times.h';;
18128 rp="What is the type returned by times() on this system?"
18129 set clock_t clocktype long stdio.h sys/types.h $inc
18132 echo 'times() NOT found, hope that will do.' >&4
18137 : see if tmpnam_r exists
18138 set tmpnam_r d_tmpnam_r
18140 case "$d_tmpnam_r" in
18142 hdrs="$i_systypes sys/types.h define stdio.h "
18143 case "$d_tmpnam_r_proto:$usethreads" in
18144 ":define") d_tmpnam_r_proto=define
18145 set d_tmpnam_r_proto tmpnam_r $hdrs
18149 case "$d_tmpnam_r_proto" in
18151 case "$tmpnam_r_proto" in
18152 ''|0) try='char* tmpnam_r(char*);'
18153 ./protochk "extern $try" $hdrs && tmpnam_r_proto=B_B ;;
18155 case "$tmpnam_r_proto" in
18156 ''|0) d_tmpnam_r=undef
18158 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
18159 * ) case "$tmpnam_r_proto" in
18160 REENTRANT_PROTO*) ;;
18161 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
18163 echo "Prototype: $try" ;;
18166 *) case "$usethreads" in
18167 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
18174 *) tmpnam_r_proto=0
18178 : see if truncate exists
18179 set truncate d_truncate
18182 : see if ttyname_r exists
18183 set ttyname_r d_ttyname_r
18185 case "$d_ttyname_r" in
18187 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
18188 case "$d_ttyname_r_proto:$usethreads" in
18189 ":define") d_ttyname_r_proto=define
18190 set d_ttyname_r_proto ttyname_r $hdrs
18194 case "$d_ttyname_r_proto" in
18196 case "$ttyname_r_proto" in
18197 ''|0) try='int ttyname_r(int, char*, size_t);'
18198 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBW ;;
18200 case "$ttyname_r_proto" in
18201 ''|0) try='int ttyname_r(int, char*, int);'
18202 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBI ;;
18204 case "$ttyname_r_proto" in
18205 ''|0) try='char* ttyname_r(int, char*, int);'
18206 ./protochk "extern $try" $hdrs && ttyname_r_proto=B_IBI ;;
18208 case "$ttyname_r_proto" in
18209 ''|0) d_ttyname_r=undef
18211 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
18212 * ) case "$ttyname_r_proto" in
18213 REENTRANT_PROTO*) ;;
18214 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
18216 echo "Prototype: $try" ;;
18219 *) case "$usethreads" in
18220 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
18227 *) ttyname_r_proto=0
18231 : see if tzname[] exists
18233 if set tzname val -a d_tzname; eval $csym; $val; then
18235 echo 'tzname[] found.' >&4
18238 echo 'tzname[] NOT found.' >&4
18243 : Check if is a multiplatform env
18245 next|rhapsody|darwin) multiarch="$define" ;;
18247 case "$multiarch" in
18248 ''|[nN]*) multiarch="$undef" ;;
18251 : check for ordering of bytes in a UV
18253 case "$usecrosscompile$multiarch" in
18256 You seem to be either cross-compiling or doing a multiarchitecture build,
18257 skipping the byteorder check.
18263 case "$byteorder" in
18266 In the following, larger digits indicate more significance. A big-endian
18267 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
18268 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
18269 machines may have weird orders like 3412. A Cray will report 87654321,
18270 an Alpha will report 12345678. If the test program works the default is
18272 I'm now running the test program...
18276 #$i_stdlib I_STDLIB
18278 #include <stdlib.h>
18280 #include <sys/types.h>
18281 typedef $uvtype UV;
18291 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
18293 u.l = (UV)0x04030201;
18294 for (i = 0; i < $uvsize; i++)
18295 printf("%c", u.c[i]+'0');
18302 if eval $compile && $run ./try > /dev/null; then
18305 [1-4][1-4][1-4][1-4]|12345678|87654321)
18306 echo "(The test program ran ok.)"
18307 echo "byteorder=$dflt"
18310 ????|????????) echo "(The test program ran ok.)" ;;
18311 *) echo "(The test program didn't run right for some reason.)" ;;
18316 (I can't seem to compile the test program. Guessing big-endian...)
18319 case "$xxx_prompt" in
18321 rp="What is the order of bytes in $uvtype?"
18334 : Checking 32bit aligndness
18337 Checking to see whether you can access character data unalignedly...
18339 case "$d_u32align" in
18340 '') $cat >try.c <<EOCP
18342 #$i_stdlib I_STDLIB
18344 #include <stdlib.h>
18346 #define U32 $u32type
18347 #define BYTEORDER 0x$byteorder
18349 #include <signal.h>
18351 $signal_t bletch(int s) { exit(4); }
18354 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
18359 if (sizeof(U32) != 4) {
18360 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
18367 signal(SIGBUS, bletch);
18379 for (i = 0; i < 4; i++) {
18380 up = (U32*)(buf + i);
18381 if (! ((*up == 1 << (8*i)) || /* big-endian */
18382 (*up == 1 << (8*(3-i))) /* little-endian */
18386 printf("read failed (%x)\n", *up);
18392 for (i = 0; i < 4; i++) {
18393 up = (U32*)(buf + i);
18395 if (*up != 0xBeef) {
18396 printf("write failed (%x)\n", *up);
18410 if eval $compile_ok; then
18411 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
18412 $run ./try 2>&1 >/dev/null
18415 You can access character data pretty unalignedly.
18417 d_u32align="$undef"
18420 It seems that you must access character data in an aligned manner.
18422 d_u32align="$define"
18426 rp='Can you access character data at unaligned addresses?'
18430 [yY]*) d_u32align="$undef" ;;
18431 *) d_u32align="$define" ;;
18438 : see if ualarm exists
18439 set ualarm d_ualarm
18442 : see if umask exists
18446 : see if unordered exists
18447 set unordered d_unordered
18450 : see if unsetenv exists
18451 set unsetenv d_unsetenv
18454 : see if usleep exists
18455 set usleep d_usleep
18458 : see if prototype for usleep is available
18460 set d_usleepproto usleep $i_unistd unistd.h
18463 : see if ustat exists
18467 : see if closedir exists
18468 set closedir d_closedir
18471 case "$d_closedir" in
18474 echo "Checking whether closedir() returns a status..." >&4
18476 #$i_dirent I_DIRENT /**/
18477 #$i_sysdir I_SYS_DIR /**/
18478 #$i_sysndir I_SYS_NDIR /**/
18479 #$i_systypes I_SYS_TYPES /**/
18481 #if defined(I_SYS_TYPES)
18482 #include <sys/types.h>
18484 #if defined(I_DIRENT)
18485 #include <dirent.h>
18486 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
18487 #include <sys/dir.h>
18491 #include <sys/ndir.h>
18495 #include <ndir.h> /* may be wrong in the future */
18497 #include <sys/dir.h>
18502 int main() { return closedir(opendir(".")); }
18505 if eval $compile_ok; then
18506 if $run ./try > /dev/null 2>&1 ; then
18507 echo "Yes, it does."
18510 echo "No, it doesn't."
18514 echo "(I can't seem to compile the test program--assuming it doesn't)"
18522 set d_void_closedir
18526 : see if there is a wait4
18530 : see if waitpid exists
18531 set waitpid d_waitpid
18534 : see if wcstombs exists
18535 set wcstombs d_wcstombs
18538 : see if wctomb exists
18539 set wctomb d_wctomb
18542 : see if writev exists
18543 set writev d_writev
18546 : preserve RCS keywords in files with variable substitution, grrr
18551 Revision='$Revision'
18553 : check for alignment requirements
18555 case "$usecrosscompile$multiarch" in
18558 You seem to be either cross-compiling or doing a multiarchitecture build,
18559 skipping the memory alignment check.
18562 case "$alignbytes" in
18563 '') alignbytes=8 ;;
18567 case "$alignbytes" in
18568 '') echo "Checking alignment constraints..." >&4
18569 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
18570 $cat >try.c <<'EOCP'
18571 typedef long double NV;
18574 $cat >try.c <<'EOCP'
18578 $cat >>try.c <<'EOCP'
18586 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
18591 if eval $compile_ok; then
18595 echo "(I can't seem to compile the test program...)"
18598 *) dflt="$alignbytes"
18601 rp="Doubles must be aligned on a how-many-byte boundary?"
18609 : set the base revision
18612 : how do we concatenate cpp tokens here?
18614 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
18615 $cat >cpp_stuff.c <<'EOCP'
18616 #define RCAT(a,b)a/**/b
18617 #define ACAT(a,b)a ## b
18621 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
18622 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
18623 echo "Oh! Smells like ANSI's been here." >&4
18624 echo "We can catify or stringify, separately or together!"
18626 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
18627 echo "Ah, yes! The good old days!" >&4
18628 echo "However, in the good old days we don't know how to stringify and"
18629 echo "catify at the same time."
18633 Hmm, I don't seem to be able to concatenate tokens with your cpp.
18634 You're going to have to edit the values of CAT[2-5] in config.h...
18636 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
18640 : see if this is a db.h system
18646 : Check db version.
18648 echo "Checking Berkeley DB version ..." >&4
18654 #include <sys/types.h>
18656 #$i_stdlib I_STDLIB
18658 #include <stdlib.h>
18661 int main(int argc, char *argv[])
18663 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
18664 int Major, Minor, Patch ;
18665 unsigned long Version ;
18666 (void)db_version(&Major, &Minor, &Patch) ;
18668 printf("%d %d %d %d %d %d\n",
18669 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
18670 Major, Minor, Patch);
18673 printf("You have Berkeley DB Version 2 or greater.\n");
18675 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
18676 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
18677 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
18678 Major, Minor, Patch) ;
18680 /* check that db.h & libdb are compatible */
18681 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
18682 printf("db.h and libdb are incompatible.\n") ;
18686 printf("db.h and libdb are compatible.\n") ;
18688 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
18689 + DB_VERSION_PATCH ;
18691 /* needs to be >= 2.3.4 */
18692 if (Version < 2003004) {
18693 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
18694 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
18700 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
18705 printf("You have Berkeley DB Version 1.\n");
18706 exit(0); /* DB version < 2: the coast is clear. */
18708 exit(1); /* <db.h> not Berkeley DB? */
18714 if eval $compile_ok && $run ./try; then
18715 echo 'Looks OK.' >&4
18717 db_version_major=$1
18718 db_version_minor=$2
18719 db_version_patch=$3
18721 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
18725 : Remove db from list of libraries to use
18726 echo "Removing unusable -ldb from library list" >&4
18727 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
18730 echo "libs = $libs" >&4
18740 : Check the return type needed for hash
18742 echo "Checking return type needed for hash for Berkeley DB ..." >&4
18748 #include <sys/types.h>
18751 #ifndef DB_VERSION_MAJOR
18752 u_int32_t hash_cb (ptr, size)
18760 info.hash = hash_cb;
18764 if $cc $ccflags -c try.c >try.out 2>&1 ; then
18765 if $contains warning try.out >>/dev/null 2>&1 ; then
18768 db_hashtype='u_int32_t'
18771 : XXX Maybe we should just give up here.
18772 db_hashtype=u_int32_t
18774 echo "Help: I can't seem to compile the db test program." >&4
18775 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
18778 echo "Your version of Berkeley DB uses $db_hashtype for hash."
18780 *) db_hashtype=u_int32_t
18785 : Check the return type needed for prefix
18787 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
18793 #include <sys/types.h>
18796 #ifndef DB_VERSION_MAJOR
18797 size_t prefix_cb (key1, key2)
18805 info.prefix = prefix_cb;
18809 if $cc $ccflags -c try.c >try.out 2>&1 ; then
18810 if $contains warning try.out >>/dev/null 2>&1 ; then
18811 db_prefixtype='int'
18813 db_prefixtype='size_t'
18816 db_prefixtype='size_t'
18817 : XXX Maybe we should just give up here.
18819 echo "Help: I can't seem to compile the db test program." >&4
18820 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
18823 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
18825 *) db_prefixtype='size_t'
18829 : How can we generate normalized random numbers ?
18831 echo "Looking for a random number function..." >&4
18832 case "$randfunc" in
18834 if set drand48 val -f; eval $csym; $val; then
18836 echo "Good, found drand48()." >&4
18837 elif set random val -f; eval $csym; $val; then
18839 echo "OK, found random()." >&4
18842 echo "Yick, looks like I have to use rand()." >&4
18853 *-Dmy_rand=*|*-Dmy_srand=*)
18854 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
18855 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
18856 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
18857 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
18861 while $test "$cont"; do
18862 rp="Use which function to generate random numbers?"
18864 if $test "$ans" = "$dflt"; then
18870 if set $ans val -f; eval $csym; $val; then
18874 rp="I cannot find function $ans. Use that name anyway?"
18883 case "$randfunc" in
18885 drand01="drand48()"
18891 case "$randbits" in
18893 echo "Checking to see how many bits your $randfunc() function produces..." >&4
18895 #$i_unistd I_UNISTD
18896 #$i_stdlib I_STDLIB
18899 # include <unistd.h>
18902 # include <stdlib.h>
18907 register unsigned long tmp;
18908 register unsigned long max = 0L;
18910 for (i = 1000; i; i--) {
18911 tmp = (unsigned long) $randfunc();
18912 if (tmp > max) max = tmp;
18914 for (i = 0; max; i++)
18920 if eval $compile_ok; then
18924 echo "(I can't seem to compile the test program...)"
18931 rp="How many bits does your $randfunc() function produce?"
18935 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
18936 seedfunc="s$randfunc"
18937 randseedtype=unsigned
18941 rp="How many bits does your $randfunc() function produce?"
18944 seedfunc="s$randfunc"
18945 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
18946 if set $seedfunc val -f; eval $csym; $val; then
18947 echo "(Using $seedfunc() to seed random generator)"
18949 echo "(Warning: no $seedfunc() to seed random generator)"
18952 randseedtype=unsigned
18959 : Determine if this is an EBCDIC system
18961 echo "Determining whether or not we are on an EBCDIC system..." >&4
18962 $cat >try.c <<'EOM'
18965 if ('M'==0xd4) return 0;
18972 if eval $compile_ok; then
18973 if $run ./try; then
18974 echo "You seem to speak EBCDIC." >&4
18977 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
18980 echo "I'm unable to compile the test program." >&4
18981 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
18987 : Check how to flush
18990 Checking how to flush all pending stdio output...
18992 # I only know how to find the first 32 possibly open files on SunOS.
18993 # See also hints/sunos_4_1.sh and util.c --AD
18995 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
18997 $cat >>try.c <<EOCP
18999 #$i_stdlib I_STDLIB
19001 #include <stdlib.h>
19003 #$i_unistd I_UNISTD
19005 # include <unistd.h>
19007 #$d_sysconf HAS_SYSCONF
19008 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
19009 #ifdef HAS_STDIO_STREAM_ARRAY
19010 # define STDIO_STREAM_ARRAY $stdio_stream_array
19015 p = fopen("try.out", "w");
19019 # ifdef TRY_FPRINTF
19023 #ifdef TRY_FFLUSH_NULL
19026 #ifdef TRY_FFLUSH_ALL
19028 long open_max = -1;
19029 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
19030 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
19032 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
19033 open_max = sysconf(_SC_OPEN_MAX);
19036 open_max = FOPEN_MAX;
19039 open_max = OPEN_MAX;
19048 # ifdef HAS_STDIO_STREAM_ARRAY
19049 if (open_max > 0) {
19051 for (i = 0; i < open_max; i++)
19052 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
19053 STDIO_STREAM_ARRAY[i]._file < open_max &&
19054 STDIO_STREAM_ARRAY[i]._flag)
19055 fflush(&STDIO_STREAM_ARRAY[i]);
19063 : first we have to find out how _not_ to flush
19065 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
19067 set try -DTRY_FPUTC
19068 if eval $compile; then
19069 $run ./try 2>/dev/null
19072 if $test ! -s try.out -a "X$code" = X42; then
19078 set try -DTRY_FPRINTF
19079 if eval $compile; then
19080 $run ./try 2>/dev/null
19083 if $test ! -s try.out -a "X$code" = X42; then
19084 output=-DTRY_FPRINTF
19090 : check for fflush NULL behaviour
19091 case "$fflushNULL" in
19092 '') set try -DTRY_FFLUSH_NULL $output
19093 if eval $compile; then
19094 $run ./try 2>/dev/null
19097 if $test -s try.out -a "X$code" = X42; then
19098 fflushNULL="`$cat try.out`"
19100 if $test "X$code" != X42; then
19102 (If this test failed, don't worry, we'll try another method shortly.)
19107 $rm -f core try.core core.try.*
19108 case "$fflushNULL" in
19110 Your fflush(NULL) works okay for output streams.
19111 Let's see if it clobbers input pipes...
19113 # As of mid-March 2000 all versions of Solaris appear to have a stdio
19114 # bug that improperly flushes the input end of pipes. So we avoid the
19115 # autoflush on fork/system/exec support for now. :-(
19116 $cat >tryp.c <<EOCP
19119 main(int argc, char **argv)
19125 while ((i = getc(stdin)) != -1
19126 && (*bp++ = i) != '\n'
19127 && bp < &buf[1024])
19130 fprintf(stdout, "%s", buf);
19138 fflushNULL="$define"
19140 if eval $compile; then
19142 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
19143 if cmp tryp.c tryp.out >/dev/null 2>&1; then
19145 fflush(NULL) seems to behave okay with input streams.
19147 fflushNULL="$define"
19150 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
19152 fflushNULL="$undef"
19155 $rm -f core tryp.c tryp.core core.tryp.*
19158 Your fflush(NULL) isn't working (contrary to ANSI C).
19160 fflushNULL="$undef"
19163 Cannot figure out whether your fflush(NULL) works or not.
19164 I'm assuming it doesn't (contrary to ANSI C).
19166 fflushNULL="$undef"
19170 $define|true|[yY]*)
19171 fflushNULL="$define"
19174 fflushNULL="$undef"
19177 : check explicit looping only if NULL did not work, and if the pipe
19178 : bug does not show up on an explicit flush too
19179 case "$fflushNULL" in
19181 $cat >tryp.c <<EOCP
19184 main(int argc, char **argv)
19190 while ((i = getc(stdin)) != -1
19191 && (*bp++ = i) != '\n'
19192 && bp < &buf[1024])
19195 fprintf(stdout, "%s", buf);
19204 if eval $compile; then
19206 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
19207 if cmp tryp.c tryp.out >/dev/null 2>&1; then
19209 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
19211 : now check for fflushall behaviour
19212 case "$fflushall" in
19213 '') set try -DTRY_FFLUSH_ALL $output
19214 if eval $compile; then
19216 (Now testing the other method--but note that this also may fail.)
19218 $run ./try 2>/dev/null
19221 if $test -s try.out -a "X$code" = X42; then
19222 fflushall="`$cat try.out`"
19226 case "$fflushall" in
19228 Whew. Flushing explicitly all the stdio streams works.
19230 fflushall="$define"
19233 Sigh. Flushing explicitly all the stdio streams doesn't work.
19238 Cannot figure out whether flushing stdio streams explicitly works or not.
19239 I'm assuming it doesn't.
19245 "$define"|true|[yY]*)
19246 fflushall="$define"
19254 All is futile. Even fflush(stdin) clobbers input pipes!
19261 $rm -f core tryp.c tryp.core core.tryp.*
19263 *) fflushall="$undef"
19267 case "$fflushNULL$fflushall" in
19270 OK, I give up. I cannot figure out how to flush pending stdio output.
19271 We won't be flushing handles at all before fork/exec/popen.
19277 : Store the full pathname to the ar program for use in the C program
19278 : Respect a hint or command line value for full_ar.
19283 : Store the full pathname to the sed program for use in the C program
19286 : see what type gids are declared as in the kernel
19288 echo "Looking for the type for group ids returned by getgid()."
19289 set gid_t gidtype xxx stdio.h sys/types.h
19293 xxx=`./findhdr sys/user.h`
19294 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
19296 unsigned) dflt="$1 $2" ;;
19300 *) dflt="$gidtype";;
19303 gid_t) echo "gid_t found." ;;
19304 *) rp="What is the type for group ids returned by getgid()?"
19310 : Check the size of GID
19313 *_t) zzz="$gidtype" ;;
19316 echo "Checking the size of $zzz..." >&4
19318 #include <sys/types.h>
19320 #$i_stdlib I_STDLIB
19322 #include <stdlib.h>
19325 printf("%d\n", (int)sizeof($gidtype));
19330 if eval $compile_ok; then
19334 echo "(I can't execute the test program--guessing $gidsize.)" >&4
19337 echo "Your $zzz is $gidsize bytes long."
19342 echo "(I can't compile the test program--guessing $gidsize.)" >&4
19346 : Check if GID is signed
19349 *_t) zzz="$gidtype" ;;
19352 echo "Checking the sign of $zzz..." >&4
19354 #include <sys/types.h>
19365 if eval $compile; then
19369 echo "(I can't execute the test program--guessing unsigned.)" >&4
19373 1) echo "Your $zzz is unsigned." ;;
19374 -1) echo "Your $zzz is signed." ;;
19380 echo "(I can't compile the test program--guessing unsigned.)" >&4
19384 : Check 64bit sizes
19387 if $test X"$quadtype" != X; then
19389 echo "Checking how to print 64-bit integers..." >&4
19391 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
19392 $cat >try.c <<'EOCP'
19393 #include <sys/types.h>
19396 int q = 12345678901;
19397 printf("%ld\n", q);
19401 if eval $compile; then
19405 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
19406 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
19407 echo "We will use %d."
19413 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
19414 $cat >try.c <<'EOCP'
19415 #include <sys/types.h>
19418 long q = 12345678901;
19419 printf("%ld\n", q);
19423 if eval $compile; then
19427 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
19428 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
19429 echo "We will use %ld."
19435 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
19436 $cat >try.c <<'EOCP'
19437 #include <sys/types.h>
19438 #include <inttypes.h>
19441 int64_t q = 12345678901;
19442 printf("%" PRId64 "\n", q);
19446 if eval $compile; then
19450 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
19451 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
19452 echo "We will use the C9X style."
19458 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
19460 #include <sys/types.h>
19463 $quadtype q = 12345678901;
19464 printf("%Ld\n", q);
19468 if eval $compile; then
19472 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
19473 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
19474 echo "We will use %Ld."
19480 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
19481 $cat >try.c <<'EOCP'
19482 #include <sys/types.h>
19485 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
19486 printf("%lld\n", q);
19490 if eval $compile; then
19494 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
19495 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
19496 echo "We will use the %lld style."
19502 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
19504 #include <sys/types.h>
19507 $quadtype q = 12345678901;
19508 printf("%qd\n", q);
19512 if eval $compile; then
19516 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
19517 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
19518 echo "We will use %qd."
19524 if $test X"$sPRId64" = X; then
19525 echo "Cannot figure out how to print 64-bit integers." >&4
19532 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
19533 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
19535 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
19536 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
19540 : Check format strings for internal types
19542 $echo "Checking the format strings to be used for Perl's internal types..." >&4
19544 if $test X"$ivsize" = X8; then
19545 ivdformat="$sPRId64"
19546 uvuformat="$sPRIu64"
19547 uvoformat="$sPRIo64"
19548 uvxformat="$sPRIx64"
19549 uvXUformat="$sPRIXU64"
19551 if $test X"$ivsize" = X"$longsize"; then
19558 if $test X"$ivsize" = X"$intsize"; then
19566 if $test X"$ivsize" = X"$shortsize"; then
19577 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
19578 nveformat="$sPRIeldbl"
19579 nvfformat="$sPRIfldbl"
19580 nvgformat="$sPRIgldbl"
19581 nvEUformat="$sPRIEUldbl"
19582 nvFUformat="$sPRIFUldbl"
19583 nvGUformat="$sPRIGUldbl"
19593 case "$ivdformat" in
19594 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
19599 : Check format string for GID
19602 $echo "Checking the format string to be used for gids..." >&4
19605 -1) if $test X"$gidsize" = X"$ivsize"; then
19606 gidformat="$ivdformat"
19608 if $test X"$gidsize" = X"$longsize"; then
19611 if $test X"$gidsize" = X"$intsize"; then
19614 if $test X"$gidsize" = X"$shortsize"; then
19621 *) if $test X"$gidsize" = X"$uvsize"; then
19622 gidformat="$uvuformat"
19624 if $test X"$gidsize" = X"$longsize"; then
19627 if $test X"$gidsize" = X"$intsize"; then
19630 if $test X"$gidsize" = X"$shortsize"; then
19639 : see if getgroups exists
19640 set getgroups d_getgrps
19643 : see if setgroups exists
19644 set setgroups d_setgrps
19647 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
19649 case "$d_getgrps$d_setgrps" in
19651 case "$groupstype" in
19652 '') dflt="$gidtype" ;;
19653 *) dflt="$groupstype" ;;
19656 What type of pointer is the second argument to getgroups() and setgroups()?
19657 Usually this is the same as group ids, $gidtype, but not always.
19660 rp='What type pointer is the second argument to getgroups() and setgroups()?'
19664 *) groupstype="$gidtype";;
19667 : MAD = Misc Attribute Definition
19669 if $test $patchlevel -lt 9; then
19670 : MAD is not available in 5.8.x or earlier.
19674 $define|true|[yY]*) dflt='y' ;;
19679 Would you like to build with Misc Attribute Decoration? This is development
19680 work leading to a Perl 5 to Perl 6 convertor, which imposes a space and speed
19681 overhead on the interpreter.
19683 If this doesn't make any sense to you, just accept the default '$dflt'.
19685 rp='Build Perl with MAD?'
19690 madlyh='madly.h madly.act madly.tab'
19692 madlyobj="madly$_o" ;;
19701 : check whether make sets MAKE
19703 echo "Checking if your $make program sets \$(MAKE)..." >&4
19704 case "$make_set_make" in
19706 $sed 's/^X //' > testmake.mak << 'EOF'
19708 X @echo 'maketemp="$(MAKE)"'
19710 case "`$make -f testmake.mak 2>/dev/null`" in
19711 *maketemp=*) make_set_make='#' ;;
19712 *) make_set_make="MAKE=$make" ;;
19714 $rm -f testmake.mak
19717 case "$make_set_make" in
19718 '#') echo "Yup, it does.";;
19719 *) echo "Nope, it doesn't.";;
19722 : see what type is used for mode_t
19723 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
19724 set mode_t modetype int stdio.h sys/types.h
19727 : see if we need va_copy
19729 case "$i_stdarg" in
19732 #include <stdarg.h>
19734 #$i_stdlib I_STDLIB
19736 #include <stdlib.h>
19738 #include <signal.h>
19741 ivfprintf(FILE *f, const char *fmt, va_list *valp)
19743 return vfprintf(f, fmt, *valp);
19747 myvfprintf(FILE *f, const char *fmt, va_list val)
19749 return ivfprintf(f, fmt, &val);
19753 myprintf(char *fmt, ...)
19756 va_start(val, fmt);
19757 return myvfprintf(stdout, fmt, val);
19761 main(int ac, char **av)
19763 signal(SIGSEGV, exit);
19765 myprintf("%s%cs all right, then\n", "that", '\'');
19770 if eval $compile && $run ./try 2>&1 >/dev/null; then
19771 case "`$run ./try`" in
19772 "that's all right, then")
19778 yes) echo "It seems that you don't need va_copy()." >&4
19779 need_va_copy="$undef"
19781 *) echo "It seems that va_copy() or similar will be needed." >&4
19782 need_va_copy="$define"
19787 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
19791 : see what type is used for size_t
19792 rp="What is the type used for the length parameter for string functions?"
19793 set size_t sizetype 'unsigned int' stdio.h sys/types.h
19796 : check for type of arguments to gethostbyaddr.
19797 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
19798 case "$d_gethbyaddr" in
19802 Checking to see what type of arguments are accepted by gethostbyaddr().
19804 hdrs="$define sys/types.h
19805 $d_socket sys/socket.h
19806 $i_niin netinet/in.h
19808 $i_unistd unistd.h"
19809 : The first arg can 'char *' or 'void *'
19810 : The second arg is some of integral type
19811 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
19812 for yyy in size_t long int; do
19813 case "$netdb_host_type" in
19814 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
19815 if ./protochk "$try" $hdrs; then
19816 echo "Your system accepts $xxx for the first arg."
19817 echo "...and $yyy for the second arg."
19818 netdb_host_type="$xxx"
19819 netdb_hlen_type="$yyy"
19825 : In case none of those worked, prompt the user.
19826 case "$netdb_host_type" in
19827 '') rp='What is the type for the 1st argument to gethostbyaddr?'
19830 netdb_host_type=$ans
19831 rp='What is the type for the 2nd argument to gethostbyaddr?'
19834 netdb_hlen_type=$ans
19838 *) : no gethostbyaddr, so pick harmless defaults
19839 netdb_host_type='char *'
19840 netdb_hlen_type="$sizetype"
19843 # Remove the "const" if needed. -- but then we'll have a
19845 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
19848 : check for type of argument to gethostbyname.
19849 if test "X$netdb_name_type" = X ; then
19850 case "$d_gethbyname" in
19854 Checking to see what type of argument is accepted by gethostbyname().
19856 hdrs="$define sys/types.h
19857 $d_socket sys/socket.h
19858 $i_niin netinet/in.h
19860 $i_unistd unistd.h"
19861 for xxx in "const char *" "char *"; do
19862 case "$netdb_name_type" in
19863 '') try="extern struct hostent *gethostbyname($xxx);"
19864 if ./protochk "$try" $hdrs; then
19865 echo "Your system accepts $xxx."
19866 netdb_name_type="$xxx"
19871 : In case none of those worked, prompt the user.
19872 case "$netdb_name_type" in
19873 '') rp='What is the type for the 1st argument to gethostbyname?'
19876 netdb_name_type=$ans
19880 *) : no gethostbyname, so pick harmless default
19881 netdb_name_type='char *'
19886 : check for type of 1st argument to getnetbyaddr.
19887 if test "X$netdb_net_type" = X ; then
19888 case "$d_getnbyaddr" in
19892 Checking to see what type of 1st argument is accepted by getnetbyaddr().
19894 hdrs="$define sys/types.h
19895 $d_socket sys/socket.h
19896 $i_niin netinet/in.h
19898 $i_unistd unistd.h"
19899 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
19900 case "$netdb_net_type" in
19901 '') try="extern struct netent *getnetbyaddr($xxx, int);"
19902 if ./protochk "$try" $hdrs; then
19903 echo "Your system accepts $xxx."
19904 netdb_net_type="$xxx"
19909 : In case none of those worked, prompt the user.
19910 case "$netdb_net_type" in
19911 '') rp='What is the type for the 1st argument to getnetbyaddr?'
19914 netdb_net_type=$ans
19918 *) : no getnetbyaddr, so pick harmless default
19919 netdb_net_type='long'
19923 : locate the preferred pager for this system
19930 [a-zA-Z]:/*) dflt=$pg;;
19934 [a-zA-Z]:/*) dflt=$more;;
19938 [a-zA-Z]:/*) dflt=$less;;
19941 '') dflt=/usr/ucb/more;;
19949 rp='What pager is used on your system?'
19953 : see what type pids are declared as in the kernel
19954 rp="What is the type of process ids on this system?"
19955 set pid_t pidtype int stdio.h sys/types.h
19958 : see if ar generates random libraries by itself
19960 echo "Checking how to generate random libraries on your machine..." >&4
19961 echo 'int bar1() { return bar2(); }' > bar1.c
19962 echo 'int bar2() { return 2; }' > bar2.c
19964 #$i_stdlib I_STDLIB
19966 #include <stdlib.h>
19968 int main() { printf("%d\n", bar1()); exit(0); }
19970 $cc $ccflags -c bar1.c >/dev/null 2>&1
19971 $cc $ccflags -c bar2.c >/dev/null 2>&1
19972 $cc $ccflags -c foo.c >/dev/null 2>&1
19973 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
19974 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19975 $run ./foobar >/dev/null 2>&1; then
19976 echo "$ar appears to generate random libraries itself."
19978 if [ "X$ranlib" = "X" ]; then
19981 elif $ar s bar$_a >/dev/null 2>&1 &&
19982 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19983 $run ./foobar >/dev/null 2>&1; then
19984 echo "a table of contents needs to be added with '$ar s'."
19987 elif $ar ts bar$_a >/dev/null 2>&1 &&
19988 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19989 $run ./foobar >/dev/null 2>&1; then
19990 echo "a table of contents needs to be added with '$ar ts'."
19997 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
19998 $test -f $ranlib || ranlib=''
20001 if $test -n "$ranlib"; then
20002 echo "your system has '$ranlib'; we'll use that."
20005 echo "your system doesn't seem to support random libraries"
20006 echo "so we'll use lorder and tsort to order the libraries."
20013 : see if this is a values.h system
20014 set values.h i_values
20017 : Check the max offset that gmtime accepts
20018 echo "Checking max offsets that gmtime () accepts"
20021 define) yyy="#include <values.h>" ;;
20026 #include <sys/types.h>
20035 void gm_check (time_t t)
20038 if (tmp == NULL || tmp->tm_year < -1900)
20049 gm_check (MAXLONG);
20051 if (tmp == NULL || tmp->tm_year < 0) {
20052 for (i = 63; i >= 0; i--) {
20053 time_t x = pt | ((time_t)1 << i);
20054 if (x < 0) continue;
20058 printf ("sGMTIME_max=%ld\n", pt);
20067 gm_check (MINLONG);
20070 for (i = 36; i >= 0; i--) {
20071 time_t x = pt - ((time_t)1 << i);
20072 if (x > 0) continue;
20076 printf ("sGMTIME_min=%ld\n", pt);
20080 int main (int argc, char *argv[])
20082 fprintf (stderr, "Sizeof time_t = %ld\n", sizeof (time_t));
20089 if eval $compile; then
20093 echo "Cannot determine sGMTIME_max and sGMTIME_min." >&4
20097 : check for type of arguments to select.
20098 case "$selecttype" in
20099 '') case "$d_select" in
20103 Checking to see what type of arguments are accepted by select().
20105 hdrs="$define sys/types.h
20106 $i_systime sys/time.h
20107 $i_sysselct sys/select.h
20108 $d_socket sys/socket.h"
20109 : The first arg can be int, unsigned, or size_t
20110 : The last arg may or may not be 'const'
20112 : void pointer has been seen but using that
20113 : breaks the selectminbits test
20114 for xxx in 'fd_set *' 'int *'; do
20115 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
20116 for tmo in 'struct timeval *' 'const struct timeval *'; do
20118 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
20119 if ./protochk "$try" $hdrs; then
20120 echo "Your system accepts $xxx."
20129 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
20130 case "$d_fd_set" in
20131 $define) dflt="fd_set *" ;;
20140 *) : no select, so pick a harmless default
20147 : check for the select 'width'
20148 case "$selectminbits" in
20149 '') safebits=`expr $ptrsize \* 8`
20150 case "$d_select" in
20154 Checking to see on how many bits at a time your select() operates...
20157 #include <sys/types.h>
20159 #$i_systime I_SYS_TIME
20160 #$i_systimek I_SYS_TIME_KERNEL
20165 # ifdef I_SYS_TIME_KERNEL
20168 # include <sys/time.h>
20169 # ifdef I_SYS_TIME_KERNEL
20173 #$i_sysselct I_SYS_SELECT
20174 #ifdef I_SYS_SELECT
20175 #include <sys/select.h>
20177 #$d_socket HAS_SOCKET
20179 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
20182 #$i_stdlib I_STDLIB
20184 #include <stdlib.h>
20187 #define S sizeof(*(b))
20189 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
20190 #define NBITS (NBYTES * 8)
20192 char *s = (char *)malloc(NBYTES);
20201 fp = fopen("try.c", "r");
20207 b = ($selecttype)s;
20208 for (i = 0; i < NBITS; i++)
20212 select(fd + 1, b, 0, 0, &t);
20213 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
20215 printf("%d\n", i + 1);
20220 if eval $compile_ok; then
20221 selectminbits=`$run ./try`
20222 case "$selectminbits" in
20224 Cannot figure out on how many bits at a time your select() operates.
20225 I'll play safe and guess it is $safebits bits.
20227 selectminbits=$safebits
20228 bits="$safebits bits"
20231 *) bits="$selectminbits bits" ;;
20233 echo "Your select() operates on $bits at a time." >&4
20235 rp='What is the minimum number of bits your select() operates on?'
20236 case "$byteorder" in
20237 12345678) dflt=64 ;;
20243 selectminbits="$val"
20247 *) : no select, so pick a harmless default
20248 selectminbits=$safebits
20254 : Trace out the files included by signal.h, then look for SIGxxx names.
20255 if [ "X$fieldn" = X ]; then
20256 : Just make some guesses. We check them later.
20257 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
20259 xxx=`echo '#include <signal.h>' |
20260 $cppstdin $cppminus $cppflags 2>/dev/null |
20261 $grep '^[ ]*#.*include' |
20262 $awk "{print \\$$fieldn}" | $sed 's!"!!g' |\
20263 $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
20266 for xx in $xxx /dev/null ; do
20267 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
20269 case "$xxxfiles" in
20270 '') xxxfiles=`./findhdr signal.h` ;;
20273 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
20274 print substr($2, 4, 20)
20276 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
20277 print substr($3, 4, 20)
20279 : Append some common names just in case the awk scan failed.
20280 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
20281 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
20282 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
20283 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
20284 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
20286 : generate a few handy files for later
20287 $cat > signal.c <<EOCP
20288 #include <sys/types.h>
20289 #include <signal.h>
20290 #$i_stdlib I_STDLIB
20292 #include <stdlib.h>
20297 /* Strange style to avoid deeply-nested #if/#else/#endif */
20300 # define NSIG (_NSIG)
20306 # define NSIG (SIGMAX+1)
20312 # define NSIG (SIG_MAX+1)
20318 # define NSIG (_SIG_MAX+1)
20324 # define NSIG (MAXSIG+1)
20330 # define NSIG (MAX_SIG+1)
20335 # ifdef SIGARRAYSIZE
20336 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
20342 # define NSIG (_sys_nsig) /* Solaris 2.5 */
20346 /* Default to some arbitrary number that's big enough to get most
20347 of the common signals.
20353 printf("NSIG %d\n", NSIG);
20359 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
20361 printf "#ifdef SIG"; printf $1; printf "\n"
20362 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
20363 printf $1; printf ");\n"
20367 printf "#endif /* JUST_NSIG */\n";
20368 printf "exit(0);\n}\n";
20371 $cat >signal.awk <<'EOP'
20372 BEGIN { ndups = 0 }
20373 $1 ~ /^NSIG$/ { nsig = $2 }
20374 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
20375 if ($2 > maxsig) { maxsig = $2 }
20376 if (sig_name[$2]) {
20377 dup_name[ndups] = $1
20378 dup_num[ndups] = $2
20390 printf("NSIG %d\n", nsig);
20391 for (n = 1; n < nsig; n++) {
20393 printf("%s %d\n", sig_name[n], sig_num[n])
20396 printf("NUM%d %d\n", n, n)
20399 for (n = 0; n < ndups; n++) {
20400 printf("%s %d\n", dup_name[n], dup_num[n])
20404 $cat >signal_cmd <<EOS
20406 if $test -s signal.lst; then
20407 echo "Using your existing signal.lst file"
20412 $cat >>signal_cmd <<'EOS'
20415 if eval $compile_ok; then
20416 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) |\
20417 $uniq | $awk -f signal.awk >signal.lst
20419 echo "(I can't seem be able to compile the whole test program)" >&4
20420 echo "(I'll try it in little pieces.)" >&4
20421 set signal -DJUST_NSIG
20422 if eval $compile_ok; then
20423 $run ./signal$_exe > signal.nsg
20426 echo "I can't seem to figure out how many signals you have." >&4
20427 echo "Guessing 50." >&4
20428 echo 'NSIG 50' > signal.nsg
20430 : Now look at all the signal names, one at a time.
20431 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
20432 $cat > signal.c <<EOCP
20433 #include <sys/types.h>
20434 #include <signal.h>
20437 printf("$xx %d\n", SIG${xx});
20442 if eval $compile; then
20443 echo "SIG${xx} found."
20444 $run ./signal$_exe >> signal.ls1
20446 echo "SIG${xx} NOT found."
20449 if $test -s signal.ls1; then
20450 $cat signal.nsg signal.ls1 |
20451 $sort -n | $uniq | $awk -f signal.awk >signal.lst
20455 if $test -s signal.lst; then
20458 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
20459 echo 'kill -l' >signal
20460 set X `csh -f <signal`
20464 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
20466 echo $@ | $tr ' ' $trnl | \
20467 $awk '{ printf "%s %d\n", $1, ++s; }
20468 END { printf "NSIG %d\n", ++s }' >signal.lst
20470 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
20472 chmod a+x signal_cmd
20473 $eunicefix signal_cmd
20475 : generate list of signal names
20477 case "$sig_name_init" in
20479 *) case "$sig_num_init" in
20480 ''|*,*) doinit=yes ;;
20485 echo "Generating a list of signal names and numbers..." >&4
20487 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
20488 sig_name=`$awk 'BEGIN { printf "ZERO " }
20489 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
20490 sig_num=`$awk 'BEGIN { printf "0 " }
20491 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
20492 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
20493 !/^NSIG/ { printf "\"%s\", ", $1 }
20494 END { printf "0\n" }' signal.lst`
20495 sig_num_init=`$awk 'BEGIN { printf "0, " }
20496 !/^NSIG/ { printf "%d, ", $2}
20497 END { printf "0\n"}' signal.lst`
20500 echo "The following $sig_count signals are available:"
20502 echo $sig_name | $awk \
20503 'BEGIN { linelen = 0 }
20505 for (i = 1; i <= NF; i++) {
20506 name = "SIG" $i " "
20507 linelen = linelen + length(name)
20508 if (linelen > 70) {
20510 linelen = length(name)
20516 sig_size=`echo $sig_name | awk '{print NF}'`
20517 $rm -f signal signal.c signal.awk signal.lst signal_cmd
20519 : Check size of size
20521 case "$sizetype" in
20522 *_t) zzz="$sizetype" ;;
20523 *) zzz="filesize" ;;
20525 echo "Checking the size of $zzz..." >&4
20527 #include <sys/types.h>
20529 #$i_stdlib I_STDLIB
20531 #include <stdlib.h>
20534 printf("%d\n", (int)sizeof($sizetype));
20539 if eval $compile_ok; then
20543 echo "(I can't execute the test program--guessing $sizesize.)" >&4
20546 echo "Your $zzz size is $sizesize bytes."
20551 echo "(I can't compile the test program--guessing $sizesize.)" >&4
20555 : check for socklen_t
20557 echo "Checking to see if you have socklen_t..." >&4
20559 #include <sys/types.h>
20560 #$d_socket HAS_SOCKET
20562 #include <sys/socket.h>
20564 int main() { socklen_t x = 16; }
20567 if eval $compile; then
20569 echo "You have socklen_t."
20572 echo "You do not have socklen_t."
20573 case "$sizetype" in
20574 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
20581 : see if this is a socks.h system
20582 set socks.h i_socks
20585 : check for type of the size argument to socket calls
20586 case "$d_socket" in
20590 Checking to see what type is the last argument of accept().
20593 case "$d_socklen_t" in
20594 "$define") yyy="$yyy socklen_t"
20596 yyy="$yyy $sizetype int long unsigned"
20597 for xxx in $yyy; do
20598 case "$socksizetype" in
20599 '') try="extern int accept(int, struct sockaddr *, $xxx *);"
20600 case "$usesocks" in
20602 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
20603 echo "Your system accepts '$xxx *' for the last argument of accept()."
20604 socksizetype="$xxx"
20607 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
20608 echo "Your system accepts '$xxx *' for the last argument of accept()."
20609 socksizetype="$xxx"
20616 : In case none of those worked, prompt the user.
20617 case "$socksizetype" in
20618 '') rp='What is the type for socket address structure sizes?'
20625 *) : no sockets, so pick relatively harmless default
20630 : see what type is used for signed size_t
20631 set ssize_t ssizetype int stdio.h sys/types.h
20636 #$i_stdlib I_STDLIB
20638 #include <stdlib.h>
20640 #include <sys/types.h>
20641 #define Size_t $sizetype
20642 #define SSize_t $dflt
20645 if (sizeof(Size_t) == sizeof(SSize_t))
20647 else if (sizeof(Size_t) == sizeof(int))
20656 if eval $compile_ok && $run ./try > /dev/null; then
20657 ssizetype=`$run ./try`
20658 echo "I'll be using $ssizetype for functions returning a byte count." >&4
20661 Help! I can't compile and run the ssize_t test program: please enlighten me!
20662 (This is probably a misconfiguration in your system or libraries, and
20663 you really ought to fix it. Still, I'll try anyway.)
20665 I need a type that is the same size as $sizetype, but is guaranteed to
20666 be signed. Common values are ssize_t, int and long.
20669 rp="What signed type is the same size as $sizetype?"
20675 : see what type of char stdio uses.
20677 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
20678 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
20679 echo "Your stdio uses unsigned chars." >&4
20680 stdchar="unsigned char"
20682 echo "Your stdio uses signed chars." >&4
20687 : see what type uids are declared as in the kernel
20689 echo "Looking for the type for user ids returned by getuid()."
20690 set uid_t uidtype xxx stdio.h sys/types.h
20694 xxx=`./findhdr sys/user.h`
20695 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
20697 unsigned) dflt="$1 $2" ;;
20701 *) dflt="$uidtype";;
20704 uid_t) echo "uid_t found." ;;
20705 *) rp="What is the type for user ids returned by getuid()?"
20711 : Check size of UID
20714 *_t) zzz="$uidtype" ;;
20717 echo "Checking the size of $zzz..." >&4
20719 #include <sys/types.h>
20721 #$i_stdlib I_STDLIB
20723 #include <stdlib.h>
20726 printf("%d\n", (int)sizeof($uidtype));
20731 if eval $compile_ok; then
20735 echo "(I can't execute the test program--guessing $uidsize.)" >&4
20738 echo "Your $zzz is $uidsize bytes long."
20743 echo "(I can't compile the test program--guessing $uidsize.)" >&4
20746 : Check if UID is signed
20749 *_t) zzz="$uidtype" ;;
20752 echo "Checking the sign of $zzz..." >&4
20754 #include <sys/types.h>
20765 if eval $compile; then
20769 echo "(I can't execute the test program--guessing unsigned.)" >&4
20773 1) echo "Your $zzz is unsigned." ;;
20774 -1) echo "Your $zzz is signed." ;;
20780 echo "(I can't compile the test program--guessing unsigned.)" >&4
20784 : Check format string for UID
20786 $echo "Checking the format string to be used for uids..." >&4
20789 -1) if $test X"$uidsize" = X"$ivsize"; then
20790 uidformat="$ivdformat"
20792 if $test X"$uidsize" = X"$longsize"; then
20795 if $test X"$uidsize" = X"$intsize"; then
20798 if $test X"$uidsize" = X"$shortsize"; then
20805 *) if $test X"$uidsize" = X"$uvsize"; then
20806 uidformat="$uvuformat"
20808 if $test X"$uidsize" = X"$longsize"; then
20811 if $test X"$uidsize" = X"$intsize"; then
20814 if $test X"$uidsize" = X"$shortsize"; then
20823 : Check if site customization support was requested
20824 case "$usesitecustomize" in
20825 $define|true|[Yy]*)
20826 usesitecustomize="$define"
20829 usesitecustomize="$undef"
20833 : determine compiler compiler
20842 if $test -f "$byacc$_exe"; then
20844 comp="byacc or $comp"
20846 if $test -f "$bison$_exe"; then
20847 comp="$comp or bison -y"
20849 rp="Which compiler compiler ($comp) shall I use?"
20858 echo "(Adding -y option to bison to get yacc-compatible behaviour.)"
20864 : see if this is a assert.h system
20865 set assert.h i_assert
20868 : see if this is a fp.h system
20872 : see if this is a fp_class.h system
20873 set fp_class.h i_fp_class
20876 : see if gdbm.h is available
20881 : see if gdbm_open exists
20882 set gdbm_open d_gdbm_open
20884 case "$d_gdbm_open" in
20887 echo "We won't be including <gdbm.h>"
20896 : see if ndbm.h is available
20899 : Compatibility location for RedHat 7.1
20900 set gdbm/ndbm.h i_gdbmndbm
20902 : Compatibility location for Debian 4.0
20903 set gdbm-ndbm.h i_gdbm_ndbm
20906 if $test "$i_ndbm" = "$define" -o "$i_gdbmndbm" = "$define" -o "$i_gdbm_ndbm" = "$define"; then
20907 : see if dbm_open exists
20908 set dbm_open d_dbm_open
20910 case "$d_dbm_open" in
20913 i_gdbmndbm="$undef"
20914 i_gdbm_ndbm="$undef"
20915 echo "We won't be including <ndbm.h>"
20925 : see if this is a ieeefp.h system
20926 case "$i_ieeefp" in
20927 '' ) set ieeefp.h i_ieeefp
20932 : see if this is a libutil.h system
20933 set libutil.h i_libutil
20936 : see if mach cthreads are available
20937 if test "X$usethreads" = "X$define"; then
20938 set mach/cthreads.h i_machcthr
20941 i_machcthr="$undef"
20944 : see if this is a mntent.h system
20945 set mntent.h i_mntent
20948 : see if net/errno.h is available
20950 set net/errno.h val
20953 : Unfortunately, it causes problems on some systems. Arrgh.
20956 cat > try.c <<'EOM'
20959 #include <net/errno.h>
20965 if $cc $ccflags -c try.c >/dev/null 2>&1; then
20966 echo "We'll be including <net/errno.h>." >&4
20968 echo "We won't be including <net/errno.h>." >&4
20977 : see if netinet/tcp.h is available
20978 set netinet/tcp.h i_netinettcp
20981 : see if this is a poll.h system
20985 : see if this is a prot.h system
20989 : Preprocessor symbols
20991 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
20992 $cat <<'EOSH' > Cppsym.know
20993 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
20994 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
20995 alliant alpha am29000 AM29000 AMD64 amd64 amiga AMIGAOS AMIX
20996 ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
20997 BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
20998 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
20999 bull c cadmus clipper CMU COFF COMPILER_VERSION
21000 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
21001 CYGWIN DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
21002 Dynix DynixPTX ELF encore EPI EXTENSIONS FAVOR_BSD
21003 FILE_OFFSET_BITS FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
21005 GNU_SOURCE GNUC GNUC_MINOR GNU_LIBRARY GO32 gould GOULD_PN
21006 H3050R H3050RX hbullx20 hcx host_mips
21007 hp200 hp300 hp700 HP700 hp800 hp9000
21008 hp9000s200 hp9000s300 hp9000s400 hp9000s500
21009 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
21010 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
21011 IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
21012 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
21013 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
21014 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
21015 LIBCATAMOUNT Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
21016 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
21017 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
21018 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
21019 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
21020 MATH_HAS_NO_SIDE_EFFECTS
21021 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
21022 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
21023 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
21024 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
21025 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
21026 NetBSD news1500 news1700 news1800 news1900 news3700
21027 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
21028 ns32016 ns32332 ns32k nsc32000
21029 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
21030 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
21031 pc532 pdp11 PGC PIC plexus PORTAR posix
21032 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
21033 POSIX_C_SOURCE POSIX_SOURCE POWER
21034 PROTOTYPES PWB pyr QNX QK_USER R3000 REENTRANT RES Rhapsody RISC6000
21035 riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
21036 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
21037 sony sony_news sonyrisc sparc sparclite spectrum
21038 stardent stdc STDC_EXT stratos sun sun3 sun386
21039 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
21040 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
21041 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
21042 sysV68 sysV88 Tek4132 Tek4300 titan
21043 TM3200 TM5400 TM5600
21044 tower tower32 tower32_200 tower32_600 tower32_700
21045 tower32_800 tower32_850 tss
21046 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
21047 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
21048 unix UNIX95 UNIX99 unixpc unos
21049 USE_BSD USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE USE_LARGEFILE64
21050 USE_MISC USE_POSIX USE_POSIX199309 USE_POSIX199506 USE_POSIX2
21051 USE_REENTRANT USE_SVID USE_UNIX98 USE_XOPEN USE_XOPEN_EXTENDED
21053 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms x86_64 xenix Xenix286
21054 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
21055 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
21058 # Maybe put other stuff here too.
21059 cat <<EOSH >>Cppsym.know
21062 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
21063 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
21064 $cat Cppsym.know > Cppsym.c
21065 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
21066 $rm -f Cppsym.a Cppsym.b Cppsym.c
21067 cat <<EOSH > Cppsym
21069 if $test \$# -gt 0; then
21070 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
21071 if $test -s Cppsym.got; then
21078 $tr " " "$trnl" | ./Cppsym.try
21084 cat <<EOSH > Cppsym.try
21086 cat <<'EOCP' > try.c
21089 #define STRINGIFY(a) "a"
21091 #if cpp_stuff == 42
21092 #define StGiFy(a) #a
21093 #define STRINGIFY(a) StGiFy(a)
21095 #if $cpp_stuff != 1 && $cpp_stuff != 42
21096 # include "Bletch: How does this C preprocessor stringify macros?"
21102 cat <<'EOSH' >> Cppsym.try
21104 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
21105 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
21106 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
21107 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
21109 echo 'return 0;}' >> try.c
21111 cat <<EOSH >> Cppsym.try
21113 case "$osname-$gccversion" in
21114 irix-) ccflags="\$ccflags -woff 1178" ;;
21115 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
21117 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs && $run ./try | $sed 's/ /\\\\ /g'
21119 chmod +x Cppsym.try
21120 $eunicefix Cppsym.try
21121 ./Cppsym < Cppsym.know > Cppsym.true
21122 : Add in any linux cpp "predefined macros":
21123 case "$osname::$gccversion" in
21126 rm -f $tHdrH'.h' $tHdrH
21128 if cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
21129 sed 's/#define[\ \ ]*//;s/[\ \ ].*$//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
21130 if [ -s $tHdrH'_cppsym.real' ]; then
21131 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
21134 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
21137 : now check the C compiler for additional symbols
21138 postprocess_cc_v=''
21140 aix) postprocess_cc_v="|$tr , ' '" ;;
21147 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
21150 -D*) echo "\$i" | $sed 's/^-D//';;
21151 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
21156 postprocess_cc_v=''
21159 ./ccsym > ccsym1.raw
21160 if $test -s ccsym1.raw; then
21161 $sort ccsym1.raw | $uniq >ccsym.raw
21163 mv ccsym1.raw ccsym.raw
21166 $awk '/\=/ { print $0; next }
21167 { print $0"=1" }' ccsym.raw >ccsym.list
21168 $comm -13 Cppsym.true ccsym.list >ccsym.own
21169 $comm -12 Cppsym.true ccsym.list >ccsym.com
21170 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
21172 if $test -z ccsym.raw; then
21173 echo "Your C compiler doesn't seem to define any symbols!" >&4
21175 echo "However, your C preprocessor defines the following symbols:"
21178 cppsymbols=`$cat Cppsym.true`
21179 cppsymbols=`echo $cppsymbols`
21180 cppccsymbols="$cppsymbols"
21182 if $test -s ccsym.com; then
21183 echo "Your C compiler and pre-processor define these symbols:"
21184 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
21187 cppccsymbols=`$cat ccsym.com`
21188 cppccsymbols=`echo $cppccsymbols`
21189 $test "$silent" || sleep 1
21191 if $test -s ccsym.cpp; then
21192 $test "$also" && echo " "
21193 echo "Your C pre-processor ${also}defines the following symbols:"
21194 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
21196 cppsymbols=`$cat ccsym.cpp`
21197 cppsymbols=`echo $cppsymbols`
21198 $test "$silent" || sleep 1
21200 if $test -s ccsym.own; then
21201 $test "$also" && echo " "
21202 echo "Your C compiler ${also}defines the following cpp symbols:"
21203 $sed -e 's/\(..*\)=1/\1/' ccsym.own
21204 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
21205 ccsymbols=`$cat ccsym.own`
21206 ccsymbols=`echo $ccsymbols`
21207 $test "$silent" || sleep 1
21211 : see if this is a termio system
21215 if $test `./findhdr termios.h`; then
21216 set tcsetattr i_termios
21222 "$define") echo "You have POSIX termios.h... good!" >&4;;
21223 *) if ./Cppsym pyr; then
21224 case "`/bin/universe`" in
21225 ucb) if $test `./findhdr sgtty.h`; then
21227 echo "<sgtty.h> found." >&4
21229 echo "System is pyramid with BSD universe."
21230 ./warn "<sgtty.h> not found--you could have problems."
21232 *) if $test `./findhdr termio.h`; then
21234 echo "<termio.h> found." >&4
21236 echo "System is pyramid with USG universe."
21237 ./warn "<termio.h> not found--you could have problems."
21241 if $test `./findhdr termio.h`; then
21242 echo "<termio.h> found." >&4
21244 elif $test `./findhdr sgtty.h`; then
21245 echo "<sgtty.h> found." >&4
21248 ./warn "Neither <termio.h> nor <sgtty.h> found--cross fingers!"
21251 if $test `./findhdr sgtty.h`; then
21252 echo "<sgtty.h> found." >&4
21254 elif $test `./findhdr termio.h`; then
21255 echo "<termio.h> found." >&4
21258 ./warn "Neither <sgtty.h> nor <termio.h> found--cross fingers!"
21262 set i_termio; eval $setvar
21263 val=$val2; set i_sgtty; eval $setvar
21264 val=$val3; set i_termios; eval $setvar
21266 : see if stddef is available
21267 set stddef.h i_stddef
21270 : see if sys/access.h is available
21271 set sys/access.h i_sysaccess
21274 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
21275 set sys/filio.h i_sysfilio
21278 if $test `./findhdr sys/ioctl.h`; then
21280 echo '<sys/ioctl.h> found.' >&4
21283 if $test $i_sysfilio = "$define"; then
21284 echo '<sys/ioctl.h> NOT found.' >&4
21286 $test $i_sgtty = "$define" && xxx="sgtty.h"
21287 $test $i_termio = "$define" && xxx="termio.h"
21288 $test $i_termios = "$define" && xxx="termios.h"
21289 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
21295 : see if socket ioctl defs are in sys/sockio.h
21297 xxx=`./findhdr sys/sockio.h`
21298 if $test "$xxx"; then
21299 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
21301 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
21304 echo "No socket ioctls found in <sys/sockio.h>." >&4
21309 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
21315 : see if this is a syslog.h system
21316 set syslog.h i_syslog
21319 : see if this is a sys/mode.h system
21320 set sys/mode.h i_sysmode
21323 : see if there is a sys/poll.h file
21324 set sys/poll.h i_syspoll
21327 : see if sys/resource.h has to be included
21328 set sys/resource.h i_sysresrc
21331 : see if sys/security.h is available
21332 set sys/security.h i_syssecrt
21335 : see if this is a sys/statvfs.h system
21336 set sys/statvfs.h i_sysstatvfs
21339 : see if this is a sys/un.h system
21340 set sys/un.h i_sysun
21343 : see if this is a sys/utsname.h system
21344 set sys/utsname.h i_sysutsname
21347 : see if this is a syswait system
21348 set sys/wait.h i_syswait
21351 : see if this is a ustat.h system
21352 set ustat.h i_ustat
21355 : see if this is an utime system
21356 set utime.h i_utime
21359 : see if this is a vfork system
21362 set vfork.h i_vfork
21372 echo "Looking for extensions..." >&4
21373 : If we are using the old config.sh, known_extensions may contain
21374 : old or inaccurate or duplicate values.
21375 known_extensions=''
21376 nonxs_extensions=''
21377 : We do not use find because it might not be available.
21378 : We do not just use MANIFEST because the user may have dropped
21379 : some additional extensions into the source tree and expect them
21382 : Function to recursively find available extensions, ignoring DynaLoader
21383 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
21387 DynaLoader|dynaload) ;;
21389 if $test -f $xxx/$xxx.xs -o -f $xxx/$xxx.c; then
21390 known_extensions="$known_extensions $1$xxx";
21391 elif $test -f $xxx/Makefile.PL; then
21392 nonxs_extensions="$nonxs_extensions $1$xxx";
21394 if $test -d $xxx -a $# -lt 10; then
21397 eval $find_extensions;
21409 eval $find_extensions
21410 # Special case: Add in modules that nest beyond the first level.
21411 # Currently threads/shared and Hash/Util/FieldHash, since they are
21412 # not picked up by the recursive find above (and adding in general
21413 # recursive finding breaks SDBM_File/sdbm).
21414 # A.D. 20011025 (SDBM), ajgough 20071008 (FieldHash)
21415 known_extensions="$known_extensions threads/shared Hash/Util/FieldHash"
21416 set X $known_extensions
21418 known_extensions="$*"
21419 set X $nonxs_extensions
21421 nonxs_extensions="$*"
21424 : Now see which are supported on this system.
21426 for xxx in $known_extensions ; do
21430 $define) avail_ext="$avail_ext $xxx" ;;
21433 GDBM_File|gdbm_fil)
21435 $define) avail_ext="$avail_ext $xxx" ;;
21438 I18N/Langinfo|i18n_lan)
21439 case "$i_langinfo$d_nl_langinfo" in
21440 $define$define) avail_ext="$avail_ext $xxx" ;;
21444 : XXX Do we need a useipcsysv variable here
21445 case "${d_msg}${d_sem}${d_shm}" in
21446 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
21449 NDBM_File|ndbm_fil)
21452 case "$osname-$use64bitint" in
21455 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
21458 *) avail_ext="$avail_ext $xxx" ;;
21463 ODBM_File|odbm_fil)
21464 case "${i_dbm}${i_rpcsvcdbm}" in
21466 case "$d_cplusplus" in
21467 define) ;; # delete as a function name will not work
21468 *) case "$osname-$use64bitint" in
21471 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
21474 *) avail_ext="$avail_ext $xxx" ;;
21482 case "$useopcode" in
21483 true|define|y) avail_ext="$avail_ext $xxx" ;;
21487 case "$useposix" in
21488 true|define|y) avail_ext="$avail_ext $xxx" ;;
21492 case "$d_socket" in
21495 beos) ;; # not unless BONE
21496 *) avail_ext="$avail_ext $xxx" ;;
21501 Sys/Syslog|sys/syslog)
21502 : XXX syslog requires socket
21503 case "$d_socket" in
21504 true|$define|y) avail_ext="$avail_ext $xxx" ;;
21508 case "$usethreads" in
21510 case "$use5005threads" in
21511 $define|true|[yY]*) avail_ext="$avail_ext $xxx" ;;
21515 threads|threads/shared)
21516 # threads and threads::shared are special cases.
21517 # To stop people from asking "Perl 5.8.0 was supposed
21518 # to have this new fancy threads implementation but my
21519 # perl doesn't have it" and from people trying to
21520 # (re)install the threads module using CPAN.pm and
21521 # CPAN.pm then offering to reinstall Perl 5.8.0,
21522 # the threads.pm and threads/shared.pm will always be
21523 # there, croaking informatively ("you need to rebuild
21524 # all of Perl with threads, sorry") when threads haven't
21525 # been compiled in.
21527 avail_ext="$avail_ext $xxx"
21531 cygwin) avail_ext="$avail_ext $xxx" ;;
21534 XS/APItest|xs/apitest)
21535 # This is just for testing. Skip it unless we have dynamic loading.
21538 $define) avail_ext="$avail_ext $xxx" ;;
21541 XS/Typemap|xs/typemap)
21542 # This is just for testing. Skip it unless we have dynamic loading.
21544 $define) avail_ext="$avail_ext $xxx" ;;
21547 *) avail_ext="$avail_ext $xxx"
21556 case "$onlyextensions" in
21558 *) keepextensions=''
21559 echo "You have requested that only certains extensions be included..." >&4
21560 for i in $onlyextensions; do
21561 case " $avail_ext " in
21563 echo "Keeping extension $i."
21564 keepextensions="$keepextensions $i"
21566 *) echo "Ignoring extension $i." ;;
21569 avail_ext="$keepextensions"
21573 case "$noextensions" in
21575 *) keepextensions=''
21576 echo "You have requested that certain extensions be ignored..." >&4
21577 for i in $avail_ext; do
21578 case " $noextensions " in
21579 *" $i "*) echo "Ignoring extension $i." ;;
21580 *) echo "Keeping extension $i.";
21581 keepextensions="$keepextensions $i"
21585 avail_ext="$keepextensions"
21589 : Now see which nonxs extensions are supported on this system.
21590 : For now assume all are.
21592 for xxx in $nonxs_extensions ; do
21594 *) nonxs_ext="$nonxs_ext $xxx"
21606 A number of extensions are supplied with $package. You may choose to
21607 compile these extensions for dynamic loading (the default), compile
21608 them into the $package executable (static loading), or not include
21609 them at all. Answer "none" to include no extensions.
21610 Note that DynaLoader is always built and need not be mentioned here.
21613 case "$dynamic_ext" in
21615 : Exclude those listed in static_ext
21617 for xxx in $avail_ext; do
21618 case " $static_ext " in
21620 *) dflt="$dflt $xxx" ;;
21627 *) dflt="$dynamic_ext"
21628 # Perhaps we are reusing an old out-of-date config.sh.
21631 if test X"$dynamic_ext" != X"$avail_ext"; then
21633 NOTICE: Your previous config.sh list may be incorrect.
21634 The extensions now available to you are
21636 but the default list from your previous config.sh is
21648 rp="What extensions do you wish to load dynamically?"
21651 none) dynamic_ext=' ' ;;
21652 *) dynamic_ext="$ans" ;;
21655 case "$static_ext" in
21657 : Exclude those already listed in dynamic linking
21659 for xxx in $avail_ext; do
21660 case " $dynamic_ext " in
21662 *) dflt="$dflt $xxx" ;;
21669 *) dflt="$static_ext"
21676 rp="What extensions do you wish to load statically?"
21679 none) static_ext=' ' ;;
21680 *) static_ext="$ans" ;;
21685 A number of extensions are supplied with $package. Answer "none"
21686 to include no extensions.
21687 Note that DynaLoader is always built and need not be mentioned here.
21690 case "$static_ext" in
21691 '') dflt="$avail_ext" ;;
21692 *) dflt="$static_ext"
21693 # Perhaps we are reusing an old out-of-date config.sh.
21696 if test X"$static_ext" != X"$avail_ext"; then
21698 NOTICE: Your previous config.sh list may be incorrect.
21699 The extensions now available to you are
21701 but the default list from your previous config.sh is
21710 : Exclude those that are not xs extensions
21714 rp="What extensions do you wish to include?"
21717 none) static_ext=' ' ;;
21718 *) static_ext="$ans" ;;
21723 # Encode is a special case. If we are building Encode as a static
21724 # extension, we need to explicitly list its subextensions as well.
21725 # For other nested extensions, this is handled automatically by
21726 # the appropriate Makefile.PL.
21727 case " $static_ext " in
21728 *" Encode "*) # Add the subextensions of Encode
21730 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
21731 static_ext="$static_ext Encode/$xxx"
21737 set X $dynamic_ext $static_ext $nonxs_ext
21741 # Sanity check: We require an extension suitable for use with
21742 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
21743 # should show up as failures in the test suite, but it's helpful to
21744 # catch them now.) The 'extensions' list is normally sorted
21745 # alphabetically, so we need to accept either
21746 # DB_File ... Fcntl ... IO ....
21747 # or something like
21748 # Fcntl ... NDBM_File ... IO ....
21749 case " $extensions" in
21750 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
21751 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
21752 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
21753 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
21754 echo "WARNING: The Perl you are building will be quite crippled." >& 4
21758 : Remove libraries needed only for extensions
21759 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
21760 : The exception is SunOS 4.x, which needs them.
21761 case "${osname}X${osvers}" in
21765 *) case "$usedl" in
21766 $define|true|[yY]*)
21767 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -lgdbm_compat @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
21771 *) perllibs="$libs"
21777 : Remove build directory name from cppstdin so it can be used from
21778 : either the present location or the final installed location.
21780 : Get out of the UU directory to get correct path name.
21782 case "$cppstdin" in
21784 echo "Stripping down cppstdin path name"
21790 : end of configuration questions
21792 echo "End of configuration questions."
21795 : back to where it started
21796 if test -d ../UU; then
21800 : configuration may be unconditionally patched via a 'config.arch' file
21801 if $test -f config.arch; then
21802 echo "I see a config.arch file, loading it." >&4
21806 : configuration may be patched via a 'config.over' file
21807 if $test -f config.over; then
21810 rp='I see a config.over file. Do you wish to load it?'
21813 n*) echo "OK, I'll ignore it.";;
21815 echo "Configuration override changes have been loaded."
21820 : in case they want portability, strip down executable paths
21821 case "$d_portable" in
21824 echo "Stripping down executable paths..." >&4
21825 for file in $loclist $trylist; do
21827 eval $file=`basename $temp`
21832 : create config.sh file
21834 echo "Creating config.sh..." >&4
21835 $spitshell <<EOT >config.sh
21838 # This file was produced by running the Configure script. It holds all the
21839 # definitions figured out by Configure. Should you modify one of these values,
21840 # do not forget to propagate your changes by running "Configure -der". You may
21841 # instead choose to run each of the .SH files by yourself, or "Configure -S".
21844 # Package name : $package
21845 # Source directory : $src
21846 # Configuration time: $cf_time
21847 # Configured by : $cf_by
21848 # Target system : $myuname
21851 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
21852 $spitshell <<EOT >>config.sh
21861 Revision='$Revision'
21869 alignbytes='$alignbytes'
21870 ansi2knr='$ansi2knr'
21871 aphostname='$aphostname'
21872 api_revision='$api_revision'
21873 api_subversion='$api_subversion'
21874 api_version='$api_version'
21875 api_versionstring='$api_versionstring'
21878 archlibexp='$archlibexp'
21879 archname64='$archname64'
21880 archname='$archname'
21881 archobjs='$archobjs'
21882 asctime_r_proto='$asctime_r_proto'
21890 byteorder='$byteorder'
21892 castflags='$castflags'
21895 cccdlflags='$cccdlflags'
21896 ccdlflags='$ccdlflags'
21898 ccflags_uselargefiles='$ccflags_uselargefiles'
21900 ccsymbols='$ccsymbols'
21901 ccversion='$ccversion'
21903 cf_email='$cf_email'
21908 clocktype='$clocktype'
21910 compress='$compress'
21911 contains='$contains'
21915 cpp_stuff='$cpp_stuff'
21916 cppccsymbols='$cppccsymbols'
21917 cppflags='$cppflags'
21919 cppminus='$cppminus'
21921 cppstdin='$cppstdin'
21922 cppsymbols='$cppsymbols'
21923 crypt_r_proto='$crypt_r_proto'
21924 cryptlib='$cryptlib'
21926 ctermid_r_proto='$ctermid_r_proto'
21927 ctime_r_proto='$ctime_r_proto'
21928 d_Gconvert='$d_Gconvert'
21929 d_PRIEUldbl='$d_PRIEUldbl'
21930 d_PRIFUldbl='$d_PRIFUldbl'
21931 d_PRIGUldbl='$d_PRIGUldbl'
21932 d_PRIXU64='$d_PRIXU64'
21933 d_PRId64='$d_PRId64'
21934 d_PRIeldbl='$d_PRIeldbl'
21935 d_PRIfldbl='$d_PRIfldbl'
21936 d_PRIgldbl='$d_PRIgldbl'
21937 d_PRIi64='$d_PRIi64'
21938 d_PRIo64='$d_PRIo64'
21939 d_PRIu64='$d_PRIu64'
21940 d_PRIx64='$d_PRIx64'
21941 d_SCNfldbl='$d_SCNfldbl'
21942 d__fwalk='$d__fwalk'
21943 d_access='$d_access'
21944 d_accessx='$d_accessx'
21947 d_archlib='$d_archlib'
21948 d_asctime_r='$d_asctime_r'
21951 d_attribute_format='$d_attribute_format'
21952 d_attribute_malloc='$d_attribute_malloc'
21953 d_attribute_nonnull='$d_attribute_nonnull'
21954 d_attribute_noreturn='$d_attribute_noreturn'
21955 d_attribute_pure='$d_attribute_pure'
21956 d_attribute_unused='$d_attribute_unused'
21957 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
21961 d_bsdgetpgrp='$d_bsdgetpgrp'
21962 d_bsdsetpgrp='$d_bsdsetpgrp'
21963 d_builtin_choose_expr='$d_builtin_choose_expr'
21964 d_builtin_expect='$d_builtin_expect'
21966 d_c99_variadic_macros='$d_c99_variadic_macros'
21967 d_casti32='$d_casti32'
21968 d_castneg='$d_castneg'
21969 d_charvspr='$d_charvspr'
21971 d_chroot='$d_chroot'
21972 d_chsize='$d_chsize'
21974 d_clearenv='$d_clearenv'
21975 d_closedir='$d_closedir'
21976 d_cmsghdr_s='$d_cmsghdr_s'
21978 d_copysignl='$d_copysignl'
21979 d_cplusplus='$d_cplusplus'
21981 d_crypt_r='$d_crypt_r'
21983 d_ctermid='$d_ctermid'
21984 d_ctermid_r='$d_ctermid_r'
21985 d_ctime_r='$d_ctime_r'
21986 d_cuserid='$d_cuserid'
21987 d_dbl_dig='$d_dbl_dig'
21988 d_dbminitproto='$d_dbminitproto'
21989 d_difftime='$d_difftime'
21990 d_dir_dd_fd='$d_dir_dd_fd'
21992 d_dirnamlen='$d_dirnamlen'
21993 d_dlerror='$d_dlerror'
21994 d_dlopen='$d_dlopen'
21995 d_dlsymun='$d_dlsymun'
21996 d_dosuid='$d_dosuid'
21997 d_drand48_r='$d_drand48_r'
21998 d_drand48proto='$d_drand48proto'
22000 d_eaccess='$d_eaccess'
22001 d_endgrent='$d_endgrent'
22002 d_endgrent_r='$d_endgrent_r'
22003 d_endhent='$d_endhent'
22004 d_endhostent_r='$d_endhostent_r'
22005 d_endnent='$d_endnent'
22006 d_endnetent_r='$d_endnetent_r'
22007 d_endpent='$d_endpent'
22008 d_endprotoent_r='$d_endprotoent_r'
22009 d_endpwent='$d_endpwent'
22010 d_endpwent_r='$d_endpwent_r'
22011 d_endsent='$d_endsent'
22012 d_endservent_r='$d_endservent_r'
22013 d_eofnblk='$d_eofnblk'
22014 d_eunice='$d_eunice'
22015 d_faststdio='$d_faststdio'
22016 d_fchdir='$d_fchdir'
22017 d_fchmod='$d_fchmod'
22018 d_fchown='$d_fchown'
22020 d_fcntl_can_lock='$d_fcntl_can_lock'
22021 d_fd_macros='$d_fd_macros'
22022 d_fd_set='$d_fd_set'
22023 d_fds_bits='$d_fds_bits'
22024 d_fgetpos='$d_fgetpos'
22025 d_finite='$d_finite'
22026 d_finitel='$d_finitel'
22027 d_flexfnam='$d_flexfnam'
22029 d_flockproto='$d_flockproto'
22031 d_fp_class='$d_fp_class'
22032 d_fpathconf='$d_fpathconf'
22033 d_fpclass='$d_fpclass'
22034 d_fpclassify='$d_fpclassify'
22035 d_fpclassl='$d_fpclassl'
22036 d_fpos64_t='$d_fpos64_t'
22037 d_frexpl='$d_frexpl'
22038 d_fs_data_s='$d_fs_data_s'
22039 d_fseeko='$d_fseeko'
22040 d_fsetpos='$d_fsetpos'
22041 d_fstatfs='$d_fstatfs'
22042 d_fstatvfs='$d_fstatvfs'
22044 d_ftello='$d_ftello'
22046 d_futimes='$d_futimes'
22047 d_getcwd='$d_getcwd'
22048 d_getespwnam='$d_getespwnam'
22049 d_getfsstat='$d_getfsstat'
22050 d_getgrent='$d_getgrent'
22051 d_getgrent_r='$d_getgrent_r'
22052 d_getgrgid_r='$d_getgrgid_r'
22053 d_getgrnam_r='$d_getgrnam_r'
22054 d_getgrps='$d_getgrps'
22055 d_gethbyaddr='$d_gethbyaddr'
22056 d_gethbyname='$d_gethbyname'
22057 d_gethent='$d_gethent'
22058 d_gethname='$d_gethname'
22059 d_gethostbyaddr_r='$d_gethostbyaddr_r'
22060 d_gethostbyname_r='$d_gethostbyname_r'
22061 d_gethostent_r='$d_gethostent_r'
22062 d_gethostprotos='$d_gethostprotos'
22063 d_getitimer='$d_getitimer'
22064 d_getlogin='$d_getlogin'
22065 d_getlogin_r='$d_getlogin_r'
22066 d_getmnt='$d_getmnt'
22067 d_getmntent='$d_getmntent'
22068 d_getnbyaddr='$d_getnbyaddr'
22069 d_getnbyname='$d_getnbyname'
22070 d_getnent='$d_getnent'
22071 d_getnetbyaddr_r='$d_getnetbyaddr_r'
22072 d_getnetbyname_r='$d_getnetbyname_r'
22073 d_getnetent_r='$d_getnetent_r'
22074 d_getnetprotos='$d_getnetprotos'
22075 d_getpagsz='$d_getpagsz'
22076 d_getpbyname='$d_getpbyname'
22077 d_getpbynumber='$d_getpbynumber'
22078 d_getpent='$d_getpent'
22079 d_getpgid='$d_getpgid'
22080 d_getpgrp2='$d_getpgrp2'
22081 d_getpgrp='$d_getpgrp'
22082 d_getppid='$d_getppid'
22083 d_getprior='$d_getprior'
22084 d_getprotobyname_r='$d_getprotobyname_r'
22085 d_getprotobynumber_r='$d_getprotobynumber_r'
22086 d_getprotoent_r='$d_getprotoent_r'
22087 d_getprotoprotos='$d_getprotoprotos'
22088 d_getprpwnam='$d_getprpwnam'
22089 d_getpwent='$d_getpwent'
22090 d_getpwent_r='$d_getpwent_r'
22091 d_getpwnam_r='$d_getpwnam_r'
22092 d_getpwuid_r='$d_getpwuid_r'
22093 d_getsbyname='$d_getsbyname'
22094 d_getsbyport='$d_getsbyport'
22095 d_getsent='$d_getsent'
22096 d_getservbyname_r='$d_getservbyname_r'
22097 d_getservbyport_r='$d_getservbyport_r'
22098 d_getservent_r='$d_getservent_r'
22099 d_getservprotos='$d_getservprotos'
22100 d_getspnam='$d_getspnam'
22101 d_getspnam_r='$d_getspnam_r'
22102 d_gettimeod='$d_gettimeod'
22103 d_gmtime_r='$d_gmtime_r'
22104 d_gnulibc='$d_gnulibc'
22105 d_grpasswd='$d_grpasswd'
22106 d_hasmntopt='$d_hasmntopt'
22108 d_ilogbl='$d_ilogbl'
22109 d_inc_version_list='$d_inc_version_list'
22111 d_inetaton='$d_inetaton'
22112 d_int64_t='$d_int64_t'
22113 d_isascii='$d_isascii'
22114 d_isfinite='$d_isfinite'
22117 d_isnanl='$d_isnanl'
22118 d_killpg='$d_killpg'
22119 d_lchown='$d_lchown'
22120 d_ldbl_dig='$d_ldbl_dig'
22121 d_libm_lib_version='$d_libm_lib_version'
22123 d_localtime_r='$d_localtime_r'
22124 d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset'
22125 d_locconv='$d_locconv'
22127 d_longdbl='$d_longdbl'
22128 d_longlong='$d_longlong'
22129 d_lseekproto='$d_lseekproto'
22131 d_madvise='$d_madvise'
22132 d_malloc_good_size='$d_malloc_good_size'
22133 d_malloc_size='$d_malloc_size'
22135 d_mbstowcs='$d_mbstowcs'
22136 d_mbtowc='$d_mbtowc'
22137 d_memchr='$d_memchr'
22138 d_memcmp='$d_memcmp'
22139 d_memcpy='$d_memcpy'
22140 d_memmove='$d_memmove'
22141 d_memset='$d_memset'
22143 d_mkdtemp='$d_mkdtemp'
22144 d_mkfifo='$d_mkfifo'
22145 d_mkstemp='$d_mkstemp'
22146 d_mkstemps='$d_mkstemps'
22147 d_mktime='$d_mktime'
22150 d_modfl_pow32_bug='$d_modfl_pow32_bug'
22151 d_modflproto='$d_modflproto'
22152 d_mprotect='$d_mprotect'
22154 d_msg_ctrunc='$d_msg_ctrunc'
22155 d_msg_dontroute='$d_msg_dontroute'
22156 d_msg_oob='$d_msg_oob'
22157 d_msg_peek='$d_msg_peek'
22158 d_msg_proxy='$d_msg_proxy'
22159 d_msgctl='$d_msgctl'
22160 d_msgget='$d_msgget'
22161 d_msghdr_s='$d_msghdr_s'
22162 d_msgrcv='$d_msgrcv'
22163 d_msgsnd='$d_msgsnd'
22165 d_munmap='$d_munmap'
22166 d_mymalloc='$d_mymalloc'
22169 d_nl_langinfo='$d_nl_langinfo'
22170 d_nv_preserves_uv='$d_nv_preserves_uv'
22171 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
22172 d_off64_t='$d_off64_t'
22173 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
22174 d_oldpthreads='$d_oldpthreads'
22175 d_oldsock='$d_oldsock'
22177 d_pathconf='$d_pathconf'
22179 d_perl_otherlibdirs='$d_perl_otherlibdirs'
22180 d_phostname='$d_phostname'
22183 d_portable='$d_portable'
22184 d_printf_format_null='$d_printf_format_null'
22185 d_procselfexe='$d_procselfexe'
22186 d_pseudofork='$d_pseudofork'
22187 d_pthread_atfork='$d_pthread_atfork'
22188 d_pthread_attr_setscope='$d_pthread_attr_setscope'
22189 d_pthread_yield='$d_pthread_yield'
22191 d_pwchange='$d_pwchange'
22192 d_pwclass='$d_pwclass'
22193 d_pwcomment='$d_pwcomment'
22194 d_pwexpire='$d_pwexpire'
22195 d_pwgecos='$d_pwgecos'
22196 d_pwpasswd='$d_pwpasswd'
22197 d_pwquota='$d_pwquota'
22200 d_random_r='$d_random_r'
22201 d_readdir64_r='$d_readdir64_r'
22202 d_readdir='$d_readdir'
22203 d_readdir_r='$d_readdir_r'
22204 d_readlink='$d_readlink'
22206 d_recvmsg='$d_recvmsg'
22207 d_rename='$d_rename'
22208 d_rewinddir='$d_rewinddir'
22210 d_safebcpy='$d_safebcpy'
22211 d_safemcpy='$d_safemcpy'
22212 d_sanemcmp='$d_sanemcmp'
22213 d_sbrkproto='$d_sbrkproto'
22214 d_scalbnl='$d_scalbnl'
22215 d_sched_yield='$d_sched_yield'
22216 d_scm_rights='$d_scm_rights'
22217 d_seekdir='$d_seekdir'
22218 d_select='$d_select'
22220 d_semctl='$d_semctl'
22221 d_semctl_semid_ds='$d_semctl_semid_ds'
22222 d_semctl_semun='$d_semctl_semun'
22223 d_semget='$d_semget'
22225 d_sendmsg='$d_sendmsg'
22226 d_setegid='$d_setegid'
22227 d_seteuid='$d_seteuid'
22228 d_setgrent='$d_setgrent'
22229 d_setgrent_r='$d_setgrent_r'
22230 d_setgrps='$d_setgrps'
22231 d_sethent='$d_sethent'
22232 d_sethostent_r='$d_sethostent_r'
22233 d_setitimer='$d_setitimer'
22234 d_setlinebuf='$d_setlinebuf'
22235 d_setlocale='$d_setlocale'
22236 d_setlocale_r='$d_setlocale_r'
22237 d_setnent='$d_setnent'
22238 d_setnetent_r='$d_setnetent_r'
22239 d_setpent='$d_setpent'
22240 d_setpgid='$d_setpgid'
22241 d_setpgrp2='$d_setpgrp2'
22242 d_setpgrp='$d_setpgrp'
22243 d_setprior='$d_setprior'
22244 d_setproctitle='$d_setproctitle'
22245 d_setprotoent_r='$d_setprotoent_r'
22246 d_setpwent='$d_setpwent'
22247 d_setpwent_r='$d_setpwent_r'
22248 d_setregid='$d_setregid'
22249 d_setresgid='$d_setresgid'
22250 d_setresuid='$d_setresuid'
22251 d_setreuid='$d_setreuid'
22252 d_setrgid='$d_setrgid'
22253 d_setruid='$d_setruid'
22254 d_setsent='$d_setsent'
22255 d_setservent_r='$d_setservent_r'
22256 d_setsid='$d_setsid'
22257 d_setvbuf='$d_setvbuf'
22261 d_shmatprototype='$d_shmatprototype'
22262 d_shmctl='$d_shmctl'
22264 d_shmget='$d_shmget'
22265 d_sigaction='$d_sigaction'
22266 d_signbit='$d_signbit'
22267 d_sigprocmask='$d_sigprocmask'
22268 d_sigsetjmp='$d_sigsetjmp'
22269 d_sitearch='$d_sitearch'
22270 d_snprintf='$d_snprintf'
22271 d_sockatmark='$d_sockatmark'
22272 d_sockatmarkproto='$d_sockatmarkproto'
22273 d_socket='$d_socket'
22274 d_socklen_t='$d_socklen_t'
22275 d_sockpair='$d_sockpair'
22276 d_socks5_init='$d_socks5_init'
22277 d_sprintf_returns_strlen='$d_sprintf_returns_strlen'
22279 d_srand48_r='$d_srand48_r'
22280 d_srandom_r='$d_srandom_r'
22281 d_sresgproto='$d_sresgproto'
22282 d_sresuproto='$d_sresuproto'
22283 d_statblks='$d_statblks'
22284 d_statfs_f_flags='$d_statfs_f_flags'
22285 d_statfs_s='$d_statfs_s'
22286 d_statvfs='$d_statvfs'
22287 d_stdio_cnt_lval='$d_stdio_cnt_lval'
22288 d_stdio_ptr_lval='$d_stdio_ptr_lval'
22289 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
22290 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
22291 d_stdio_stream_array='$d_stdio_stream_array'
22292 d_stdiobase='$d_stdiobase'
22293 d_stdstdio='$d_stdstdio'
22294 d_strchr='$d_strchr'
22295 d_strcoll='$d_strcoll'
22296 d_strctcpy='$d_strctcpy'
22297 d_strerrm='$d_strerrm'
22298 d_strerror='$d_strerror'
22299 d_strerror_r='$d_strerror_r'
22300 d_strftime='$d_strftime'
22301 d_strlcat='$d_strlcat'
22302 d_strlcpy='$d_strlcpy'
22303 d_strtod='$d_strtod'
22304 d_strtol='$d_strtol'
22305 d_strtold='$d_strtold'
22306 d_strtoll='$d_strtoll'
22307 d_strtoq='$d_strtoq'
22308 d_strtoul='$d_strtoul'
22309 d_strtoull='$d_strtoull'
22310 d_strtouq='$d_strtouq'
22311 d_strxfrm='$d_strxfrm'
22312 d_suidsafe='$d_suidsafe'
22313 d_symlink='$d_symlink'
22314 d_syscall='$d_syscall'
22315 d_syscallproto='$d_syscallproto'
22316 d_sysconf='$d_sysconf'
22317 d_sysernlst='$d_sysernlst'
22318 d_syserrlst='$d_syserrlst'
22319 d_system='$d_system'
22320 d_tcgetpgrp='$d_tcgetpgrp'
22321 d_tcsetpgrp='$d_tcsetpgrp'
22322 d_telldir='$d_telldir'
22323 d_telldirproto='$d_telldirproto'
22325 d_timegm='$d_timegm'
22327 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
22328 d_tm_tm_zone='$d_tm_tm_zone'
22329 d_tmpnam_r='$d_tmpnam_r'
22330 d_truncate='$d_truncate'
22331 d_ttyname_r='$d_ttyname_r'
22332 d_tzname='$d_tzname'
22333 d_u32align='$d_u32align'
22334 d_ualarm='$d_ualarm'
22337 d_union_semun='$d_union_semun'
22338 d_unordered='$d_unordered'
22339 d_unsetenv='$d_unsetenv'
22340 d_usleep='$d_usleep'
22341 d_usleepproto='$d_usleepproto'
22343 d_vendorarch='$d_vendorarch'
22344 d_vendorbin='$d_vendorbin'
22345 d_vendorlib='$d_vendorlib'
22346 d_vendorscript='$d_vendorscript'
22348 d_void_closedir='$d_void_closedir'
22349 d_voidsig='$d_voidsig'
22350 d_voidtty='$d_voidtty'
22351 d_volatile='$d_volatile'
22352 d_vprintf='$d_vprintf'
22353 d_vsnprintf='$d_vsnprintf'
22355 d_waitpid='$d_waitpid'
22356 d_wcstombs='$d_wcstombs'
22357 d_wctomb='$d_wctomb'
22358 d_writev='$d_writev'
22361 db_hashtype='$db_hashtype'
22362 db_prefixtype='$db_prefixtype'
22363 db_version_major='$db_version_major'
22364 db_version_minor='$db_version_minor'
22365 db_version_patch='$db_version_patch'
22366 defvoidused='$defvoidused'
22367 direntrytype='$direntrytype'
22370 doublesize='$doublesize'
22372 drand48_r_proto='$drand48_r_proto'
22374 dynamic_ext='$dynamic_ext'
22380 endgrent_r_proto='$endgrent_r_proto'
22381 endhostent_r_proto='$endhostent_r_proto'
22382 endnetent_r_proto='$endnetent_r_proto'
22383 endprotoent_r_proto='$endprotoent_r_proto'
22384 endpwent_r_proto='$endpwent_r_proto'
22385 endservent_r_proto='$endservent_r_proto'
22386 eunicefix='$eunicefix'
22389 extensions='$extensions'
22391 fflushNULL='$fflushNULL'
22392 fflushall='$fflushall'
22394 firstmakefile='$firstmakefile'
22396 fpossize='$fpossize'
22397 fpostype='$fpostype'
22398 freetype='$freetype'
22401 full_csh='$full_csh'
22402 full_sed='$full_sed'
22403 gccansipedantic='$gccansipedantic'
22404 gccosandvers='$gccosandvers'
22405 gccversion='$gccversion'
22406 getgrent_r_proto='$getgrent_r_proto'
22407 getgrgid_r_proto='$getgrgid_r_proto'
22408 getgrnam_r_proto='$getgrnam_r_proto'
22409 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
22410 gethostbyname_r_proto='$gethostbyname_r_proto'
22411 gethostent_r_proto='$gethostent_r_proto'
22412 getlogin_r_proto='$getlogin_r_proto'
22413 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
22414 getnetbyname_r_proto='$getnetbyname_r_proto'
22415 getnetent_r_proto='$getnetent_r_proto'
22416 getprotobyname_r_proto='$getprotobyname_r_proto'
22417 getprotobynumber_r_proto='$getprotobynumber_r_proto'
22418 getprotoent_r_proto='$getprotoent_r_proto'
22419 getpwent_r_proto='$getpwent_r_proto'
22420 getpwnam_r_proto='$getpwnam_r_proto'
22421 getpwuid_r_proto='$getpwuid_r_proto'
22422 getservbyname_r_proto='$getservbyname_r_proto'
22423 getservbyport_r_proto='$getservbyport_r_proto'
22424 getservent_r_proto='$getservent_r_proto'
22425 getspnam_r_proto='$getspnam_r_proto'
22426 gidformat='$gidformat'
22432 gmtime_r_proto='$gmtime_r_proto'
22433 gnulibc_version='$gnulibc_version'
22435 groupcat='$groupcat'
22436 groupstype='$groupstype'
22439 h_sysfile='$h_sysfile'
22442 html1dir='$html1dir'
22443 html1direxp='$html1direxp'
22444 html3dir='$html3dir'
22445 html3direxp='$html3direxp'
22454 i_arpainet='$i_arpainet'
22455 i_assert='$i_assert'
22456 i_bsdioctl='$i_bsdioctl'
22460 i_dirent='$i_dirent'
22466 i_fp_class='$i_fp_class'
22468 i_gdbm_ndbm='$i_gdbm_ndbm'
22469 i_gdbmndbm='$i_gdbmndbm'
22471 i_ieeefp='$i_ieeefp'
22472 i_inttypes='$i_inttypes'
22473 i_langinfo='$i_langinfo'
22474 i_libutil='$i_libutil'
22475 i_limits='$i_limits'
22476 i_locale='$i_locale'
22477 i_machcthr='$i_machcthr'
22478 i_malloc='$i_malloc'
22479 i_mallocmalloc='$i_mallocmalloc'
22481 i_memory='$i_memory'
22482 i_mntent='$i_mntent'
22485 i_neterrno='$i_neterrno'
22486 i_netinettcp='$i_netinettcp'
22490 i_pthread='$i_pthread'
22492 i_rpcsvcdbm='$i_rpcsvcdbm'
22495 i_shadow='$i_shadow'
22497 i_stdarg='$i_stdarg'
22498 i_stddef='$i_stddef'
22499 i_stdlib='$i_stdlib'
22500 i_string='$i_string'
22501 i_sunmath='$i_sunmath'
22502 i_sysaccess='$i_sysaccess'
22503 i_sysdir='$i_sysdir'
22504 i_sysfile='$i_sysfile'
22505 i_sysfilio='$i_sysfilio'
22507 i_sysioctl='$i_sysioctl'
22508 i_syslog='$i_syslog'
22509 i_sysmman='$i_sysmman'
22510 i_sysmode='$i_sysmode'
22511 i_sysmount='$i_sysmount'
22512 i_sysndir='$i_sysndir'
22513 i_sysparam='$i_sysparam'
22514 i_syspoll='$i_syspoll'
22515 i_sysresrc='$i_sysresrc'
22516 i_syssecrt='$i_syssecrt'
22517 i_sysselct='$i_sysselct'
22518 i_syssockio='$i_syssockio'
22519 i_sysstat='$i_sysstat'
22520 i_sysstatfs='$i_sysstatfs'
22521 i_sysstatvfs='$i_sysstatvfs'
22522 i_systime='$i_systime'
22523 i_systimek='$i_systimek'
22524 i_systimes='$i_systimes'
22525 i_systypes='$i_systypes'
22526 i_sysuio='$i_sysuio'
22528 i_sysutsname='$i_sysutsname'
22529 i_sysvfs='$i_sysvfs'
22530 i_syswait='$i_syswait'
22531 i_termio='$i_termio'
22532 i_termios='$i_termios'
22534 i_unistd='$i_unistd'
22537 i_values='$i_values'
22538 i_varargs='$i_varargs'
22539 i_varhdr='$i_varhdr'
22541 ignore_versioned_solibs='$ignore_versioned_solibs'
22542 inc_version_list='$inc_version_list'
22543 inc_version_list_init='$inc_version_list_init'
22546 initialinstalllocation='$initialinstalllocation'
22547 installarchlib='$installarchlib'
22548 installbin='$installbin'
22549 installhtml1dir='$installhtml1dir'
22550 installhtml3dir='$installhtml3dir'
22551 installman1dir='$installman1dir'
22552 installman3dir='$installman3dir'
22553 installprefix='$installprefix'
22554 installprefixexp='$installprefixexp'
22555 installprivlib='$installprivlib'
22556 installscript='$installscript'
22557 installsitearch='$installsitearch'
22558 installsitebin='$installsitebin'
22559 installsitehtml1dir='$installsitehtml1dir'
22560 installsitehtml3dir='$installsitehtml3dir'
22561 installsitelib='$installsitelib'
22562 installsiteman1dir='$installsiteman1dir'
22563 installsiteman3dir='$installsiteman3dir'
22564 installsitescript='$installsitescript'
22565 installstyle='$installstyle'
22566 installusrbinperl='$installusrbinperl'
22567 installvendorarch='$installvendorarch'
22568 installvendorbin='$installvendorbin'
22569 installvendorhtml1dir='$installvendorhtml1dir'
22570 installvendorhtml3dir='$installvendorhtml3dir'
22571 installvendorlib='$installvendorlib'
22572 installvendorman1dir='$installvendorman1dir'
22573 installvendorman3dir='$installvendorman3dir'
22574 installvendorscript='$installvendorscript'
22576 issymlink='$issymlink'
22577 ivdformat='$ivdformat'
22580 known_extensions='$known_extensions'
22583 lddlflags='$lddlflags'
22585 ldflags_uselargefiles='$ldflags_uselargefiles'
22586 ldlibpthname='$ldlibpthname'
22593 libsdirs='$libsdirs'
22594 libsfiles='$libsfiles'
22595 libsfound='$libsfound'
22596 libspath='$libspath'
22597 libswanted='$libswanted'
22598 libswanted_uselargefiles='$libswanted_uselargefiles'
22604 localtime_r_proto='$localtime_r_proto'
22605 locincpth='$locincpth'
22606 loclibpth='$loclibpth'
22607 longdblsize='$longdblsize'
22608 longlongsize='$longlongsize'
22609 longsize='$longsize'
22613 lseeksize='$lseeksize'
22614 lseektype='$lseektype'
22617 madlyobj='$madlyobj'
22618 madlysrc='$madlysrc'
22622 make_set_make='$make_set_make'
22623 mallocobj='$mallocobj'
22624 mallocsrc='$mallocsrc'
22625 malloctype='$malloctype'
22627 man1direxp='$man1direxp'
22630 man3direxp='$man3direxp'
22632 mips_type='$mips_type'
22633 mistrustnm='$mistrustnm'
22635 mmaptype='$mmaptype'
22636 modetype='$modetype'
22638 multiarch='$multiarch'
22640 myarchname='$myarchname'
22641 mydomain='$mydomain'
22642 myhostname='$myhostname'
22645 need_va_copy='$need_va_copy'
22646 netdb_hlen_type='$netdb_hlen_type'
22647 netdb_host_type='$netdb_host_type'
22648 netdb_name_type='$netdb_name_type'
22649 netdb_net_type='$netdb_net_type'
22652 nm_so_opt='$nm_so_opt'
22653 nonxs_ext='$nonxs_ext'
22655 nvEUformat='$nvEUformat'
22656 nvFUformat='$nvFUformat'
22657 nvGUformat='$nvGUformat'
22658 nv_overflows_integers_at='$nv_overflows_integers_at'
22659 nv_preserves_uv_bits='$nv_preserves_uv_bits'
22660 nveformat='$nveformat'
22661 nvfformat='$nvfformat'
22662 nvgformat='$nvgformat'
22665 o_nonblock='$o_nonblock'
22667 old_pthread_create_joinable='$old_pthread_create_joinable'
22668 optimize='$optimize'
22669 orderlib='$orderlib'
22672 otherlibdirs='$otherlibdirs'
22676 patchlevel='$patchlevel'
22677 path_sep='$path_sep'
22680 perl_patchlevel='$perl_patchlevel'
22681 perladmin='$perladmin'
22682 perllibs='$perllibs'
22683 perlpath='$perlpath'
22685 phostname='$phostname'
22691 prefixexp='$prefixexp'
22693 privlibexp='$privlibexp'
22694 procselfexe='$procselfexe'
22695 prototype='$prototype'
22697 quadkind='$quadkind'
22698 quadtype='$quadtype'
22699 randbits='$randbits'
22700 randfunc='$randfunc'
22701 random_r_proto='$random_r_proto'
22702 randseedtype='$randseedtype'
22704 rd_nodata='$rd_nodata'
22705 readdir64_r_proto='$readdir64_r_proto'
22706 readdir_r_proto='$readdir_r_proto'
22707 revision='$revision'
22713 sGMTIME_max='$sGMTIME_max'
22714 sGMTIME_min='$sGMTIME_min'
22715 sPRIEUldbl='$sPRIEUldbl'
22716 sPRIFUldbl='$sPRIFUldbl'
22717 sPRIGUldbl='$sPRIGUldbl'
22718 sPRIXU64='$sPRIXU64'
22720 sPRIeldbl='$sPRIeldbl'
22721 sPRIfldbl='$sPRIfldbl'
22722 sPRIgldbl='$sPRIgldbl'
22727 sSCNfldbl='$sSCNfldbl'
22728 sched_yield='$sched_yield'
22729 scriptdir='$scriptdir'
22730 scriptdirexp='$scriptdirexp'
22732 seedfunc='$seedfunc'
22733 selectminbits='$selectminbits'
22734 selecttype='$selecttype'
22735 sendmail='$sendmail'
22736 setgrent_r_proto='$setgrent_r_proto'
22737 sethostent_r_proto='$sethostent_r_proto'
22738 setlocale_r_proto='$setlocale_r_proto'
22739 setnetent_r_proto='$setnetent_r_proto'
22740 setprotoent_r_proto='$setprotoent_r_proto'
22741 setpwent_r_proto='$setpwent_r_proto'
22742 setservent_r_proto='$setservent_r_proto'
22745 sharpbang='$sharpbang'
22746 shmattype='$shmattype'
22747 shortsize='$shortsize'
22750 sig_count='$sig_count'
22751 sig_name='$sig_name'
22752 sig_name_init='$sig_name_init'
22754 sig_num_init='$sig_num_init'
22755 sig_size='$sig_size'
22756 signal_t='$signal_t'
22757 sitearch='$sitearch'
22758 sitearchexp='$sitearchexp'
22760 sitebinexp='$sitebinexp'
22761 sitehtml1dir='$sitehtml1dir'
22762 sitehtml1direxp='$sitehtml1direxp'
22763 sitehtml3dir='$sitehtml3dir'
22764 sitehtml3direxp='$sitehtml3direxp'
22766 sitelib_stem='$sitelib_stem'
22767 sitelibexp='$sitelibexp'
22768 siteman1dir='$siteman1dir'
22769 siteman1direxp='$siteman1direxp'
22770 siteman3dir='$siteman3dir'
22771 siteman3direxp='$siteman3direxp'
22772 siteprefix='$siteprefix'
22773 siteprefixexp='$siteprefixexp'
22774 sitescript='$sitescript'
22775 sitescriptexp='$sitescriptexp'
22776 sizesize='$sizesize'
22777 sizetype='$sizetype'
22781 sockethdr='$sockethdr'
22782 socketlib='$socketlib'
22783 socksizetype='$socksizetype'
22785 spackage='$spackage'
22786 spitshell='$spitshell'
22787 srand48_r_proto='$srand48_r_proto'
22788 srandom_r_proto='$srandom_r_proto'
22790 ssizetype='$ssizetype'
22791 startperl='$startperl'
22793 static_ext='$static_ext'
22795 stdio_base='$stdio_base'
22796 stdio_bufsiz='$stdio_bufsiz'
22797 stdio_cnt='$stdio_cnt'
22798 stdio_filbuf='$stdio_filbuf'
22799 stdio_ptr='$stdio_ptr'
22800 stdio_stream_array='$stdio_stream_array'
22801 strerror_r_proto='$strerror_r_proto'
22804 subversion='$subversion'
22808 targetarch='$targetarch'
22812 timeincl='$timeincl'
22813 timetype='$timetype'
22814 tmpnam_r_proto='$tmpnam_r_proto'
22820 ttyname_r_proto='$ttyname_r_proto'
22829 uidformat='$uidformat'
22835 uquadtype='$uquadtype'
22836 use5005threads='$use5005threads'
22837 use64bitall='$use64bitall'
22838 use64bitint='$use64bitint'
22839 usecrosscompile='$usecrosscompile'
22841 usedtrace='$usedtrace'
22842 usefaststdio='$usefaststdio'
22843 useithreads='$useithreads'
22844 uselargefiles='$uselargefiles'
22845 uselongdouble='$uselongdouble'
22846 usemallocwrap='$usemallocwrap'
22847 usemorebits='$usemorebits'
22848 usemultiplicity='$usemultiplicity'
22849 usemymalloc='$usemymalloc'
22851 useopcode='$useopcode'
22852 useperlio='$useperlio'
22853 useposix='$useposix'
22854 usereentrant='$usereentrant'
22855 userelocatableinc='$userelocatableinc'
22857 useshrplib='$useshrplib'
22858 usesitecustomize='$usesitecustomize'
22859 usesocks='$usesocks'
22860 usethreads='$usethreads'
22861 usevendorprefix='$usevendorprefix'
22862 usevfork='$usevfork'
22865 uvXUformat='$uvXUformat'
22866 uvoformat='$uvoformat'
22869 uvuformat='$uvuformat'
22870 uvxformat='$uvxformat'
22871 vendorarch='$vendorarch'
22872 vendorarchexp='$vendorarchexp'
22873 vendorbin='$vendorbin'
22874 vendorbinexp='$vendorbinexp'
22875 vendorhtml1dir='$vendorhtml1dir'
22876 vendorhtml1direxp='$vendorhtml1direxp'
22877 vendorhtml3dir='$vendorhtml3dir'
22878 vendorhtml3direxp='$vendorhtml3direxp'
22879 vendorlib='$vendorlib'
22880 vendorlib_stem='$vendorlib_stem'
22881 vendorlibexp='$vendorlibexp'
22882 vendorman1dir='$vendorman1dir'
22883 vendorman1direxp='$vendorman1direxp'
22884 vendorman3dir='$vendorman3dir'
22885 vendorman3direxp='$vendorman3direxp'
22886 vendorprefix='$vendorprefix'
22887 vendorprefixexp='$vendorprefixexp'
22888 vendorscript='$vendorscript'
22889 vendorscriptexp='$vendorscriptexp'
22891 version_patchlevel_string='$version_patchlevel_string'
22892 versiononly='$versiononly'
22894 voidflags='$voidflags'
22897 yaccflags='$yaccflags'
22902 : Add in command line options if available
22903 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
22905 : add special variables
22906 $test -f $src/patchlevel.h && \
22907 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
22908 echo "PERL_PATCHLEVEL=$perl_patchlevel" >>config.sh
22909 echo "PERL_CONFIG_SH=true" >>config.sh
22911 : propagate old symbols
22912 if $test -f UU/config.sh; then
22913 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
22914 $sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' \
22915 config.sh config.sh UU/oldconfig.sh |\
22916 $sort | $uniq -u >UU/oldsyms
22917 set X `cat UU/oldsyms`
22923 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
22925 echo ": Variables propagated from previous config.sh file." >>config.sh
22926 for sym in `cat UU/oldsyms`; do
22927 echo " Propagating $hint variable "'$'"$sym..."
22928 eval 'tmp="$'"${sym}"'"'
22930 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
22936 : Finish up by extracting the .SH files
22940 echo "Extraction done."
22950 If you'd like to make any changes to the config.sh file before I begin
22951 to configure things, do it as a shell escape now (e.g. !vi config.sh).
22954 rp="Press return or use a shell escape to edit config.sh:"
22959 *) : in case they cannot read
22960 sh 1>&4 -c "$ans";;
22965 : if this fails, just run all the .SH files by hand
22974 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
22981 Now you need to generate make dependencies by running "$make depend".
22982 You might prefer to run it in background: "$make depend > makedepend.out &"
22983 It can take a while, so you might not want to run it right now.
22988 rp="Run $make depend now?"
22992 $make depend && echo "Now you must run '$make'."
22995 echo "You must run '$make depend' then '$make'."
22998 elif test -f [Mm]akefile; then
23000 echo "Now you must run a $make."
23002 echo "Configure done."
23005 if $test -f Policy.sh; then
23008 If you compile $package on a different machine or from a different object
23009 directory, copy the Policy.sh file from this object directory to the
23010 new one before you run Configure -- this will help you with most of
23011 the policy defaults.
23015 if $test -f config.msg; then
23016 echo "Hmm. I also noted the following information while running:"
23018 $cat config.msg >&4
23021 $rm -f kit*isdone ark*isdone