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 Wed May 6 14:01:08 CEST 2009 [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
337 initialinstalllocation=''
364 d_attribute_deprecated=''
365 d_attribute_format=''
366 d_attribute_malloc=''
367 d_attribute_nonnull=''
368 d_attribute_noreturn=''
370 d_attribute_unused=''
371 d_attribute_warn_unused_result=''
372 d_printf_format_null=''
375 d_builtin_choose_expr=''
378 d_c99_variadic_macros=''
425 endhostent_r_proto=''
431 endprotoent_r_proto=''
437 endservent_r_proto=''
490 gethostbyaddr_r_proto=''
492 gethostbyname_r_proto=''
494 gethostent_r_proto=''
507 getnetbyaddr_r_proto=''
509 getnetbyname_r_proto=''
523 d_getprotobyname_r=''
524 getprotobyname_r_proto=''
525 d_getprotobynumber_r=''
526 getprotobynumber_r_proto=''
528 getprotoent_r_proto=''
540 getservbyname_r_proto=''
542 getservbyport_r_proto=''
544 getservent_r_proto=''
570 d_libm_lib_version=''
573 d_localtime_r_needs_tzset=''
584 d_malloc_good_size=''
626 d_old_pthread_create_joinable=''
627 old_pthread_create_joinable=''
629 d_pthread_attr_setscope=''
668 sethostent_r_proto=''
685 setprotoent_r_proto=''
697 setservent_r_proto=''
731 d_sprintf_returns_strlen=''
746 d_stdio_ptr_lval_nochange_cnt=''
747 d_stdio_ptr_lval_sets_cnt=''
890 d_gdbm_ndbm_h_uses_prototypes=''
891 d_gdbmndbm_h_uses_prototypes=''
893 d_ndbm_h_uses_prototypes=''
967 d_inc_version_list=''
969 inc_version_list_init=''
988 ignore_versioned_solibs=''
1052 d_perl_otherlibdirs=''
1060 api_versionstring=''
1066 version_patchlevel_string=''
1070 d_nv_preserves_uv=''
1071 d_nv_zero_is_allbits_zero=''
1082 nv_overflows_integers_at=''
1083 nv_preserves_uv_bits=''
1155 installsitehtml1dir=''
1158 installsitehtml3dir=''
1165 installsiteman1dir=''
1168 installsiteman3dir=''
1173 installsitescript=''
1188 d_stdio_stream_array=''
1189 stdio_stream_array=''
1206 ccflags_uselargefiles=''
1207 ldflags_uselargefiles=''
1208 libswanted_uselargefiles=''
1228 installvendorarch=''
1235 installvendorhtml1dir=''
1237 vendorhtml1direxp=''
1238 installvendorhtml3dir=''
1240 vendorhtml3direxp=''
1246 installvendorman1dir=''
1249 installvendorman3dir=''
1256 installvendorscript=''
1269 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1272 : We must find out about Eunice early
1274 if test -f /etc/unixtovms; then
1275 eunicefix=/etc/unixtovms
1277 if test -f /etc/unixtovms.exe; then
1278 eunicefix=/etc/unixtovms.exe
1281 : Set executable suffix now -- needed before hints available
1282 if test -f "/libs/version.library"; then
1285 elif test -f "/system/gnu_library/bin/ar.pm"; then
1288 elif test -n "$DJGPP"; then
1291 elif test -d c:/. -o -n "$is_os2" ; then
1298 : Trailing extension. Override this in a hint file, if needed.
1299 : Extra object files, if any, needed on this platform.
1303 : change the next line if compiling for Xenix/286 on Xenix/386
1304 xlibpth='/usr/lib/386 /lib/386'
1305 : Possible local library directories to search.
1306 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1307 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1309 : general looking path for locating libraries
1310 glibpth="/lib /usr/lib $xlibpth"
1311 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1312 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1313 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1314 test -d /usr/lib64 && glibpth="$glibpth /lib64 /usr/lib64 /usr/local/lib64"
1316 : Private path used by Configure to find libraries. Its value
1317 : is prepended to libpth. This variable takes care of special
1318 : machines, like the mips. Usually, it should be empty.
1321 : default library list
1323 : some systems want to use only the non-versioned libso:s
1324 ignore_versioned_solibs=''
1325 : set usethreads on the Configure command line to enable threads.
1326 usereentrant='undef'
1327 : full support for void wanted by default
1330 : Possible local include directories to search.
1331 : Set locincpth to "" in a hint file to defeat local include searches.
1332 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1333 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1335 : no include file wanted by default
1338 : Enable -DEBUGGING and -DDEBUGGING from the command line
1345 : set useposix=false in your hint file to disable the POSIX extension.
1347 : set useopcode=false in your hint file to disable the Opcode extension.
1350 ccflags_uselargefiles=''
1351 ldflags_uselargefiles=''
1352 libswanted_uselargefiles=''
1353 : set usemultiplicity on the Configure command line to enable multiplicity.
1354 : set usesocks on the Configure command line to enable socks.
1355 : List of libraries we want.
1356 : If anyone needs extra -lxxx, put those in a hint file.
1357 libswanted="sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun"
1358 libswanted="$libswanted m crypt sec util c cposix posix ucb bsd BSD"
1359 : We probably want to search /usr/shlib before most other libraries.
1360 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1361 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1362 glibpth="/usr/shlib $glibpth"
1363 : Do not use vfork unless overridden by a hint file.
1366 : Find the basic shell for Bourne shell scripts
1370 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1373 if test -f "$xxx"; then
1376 : Build up a list and do a single loop so we can 'break' out.
1377 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1378 for xxx in sh bash ksh pdksh ash; do
1380 try="$try ${p}/${xxx}"
1384 if test -f "$xxx"; then
1387 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1390 elif test -f "$xxx.exe"; then
1401 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1403 Usually it's in /bin/sh. How did you even get this far?
1404 Please contact me (Perl Maintainers) at perlbug@perl.org and
1405 we'll try to straighten this all out.
1411 : see if sh knows # comments
1412 if `$sh -c '#' >/dev/null 2>&1`; then
1416 test -f $xcat$_exe || xcat=/usr/bin/cat
1417 if test ! -f $xcat$_exe; then
1418 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1419 if test -f $p/cat$_exe; then
1424 if test ! -f $xcat$_exe; then
1425 echo "Can't find cat anywhere!"
1429 echo "#!$xcat" >sharp
1432 ./sharp > today 2>/dev/null
1433 if test -s today; then
1436 echo "#! $xcat" > sharp
1439 ./sharp > today 2>/dev/null
1440 if test -s today; then
1448 echo "Your $sh doesn't grok # comments--I will strip them later on."
1451 echo "exec grep -v '^[ ]*#'" >spitshell
1453 $eunicefix spitshell
1454 spitshell=`pwd`/spitshell
1456 echo "I presume that if # doesn't work, #! won't work either!"
1461 : figure out how to guarantee sh startup
1463 '') startsh=${sharpbang}${sh} ;;
1475 : echo "Yup, it does."
1477 echo "Hmm... '$startsh' does not guarantee sh startup..."
1478 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1482 : Save command line options in file UU/cmdline.opt for later use in
1483 : generating config.sh.
1484 cat > cmdline.opt <<EOSH
1485 : Configure command line arguments.
1494 cat >>cmdline.opt <<EOSH
1495 config_arg$argn='$arg'
1497 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1500 arg_exp=`cat cmdl.opt`
1501 args_exp="$args_exp$args_sep'$arg_exp'"
1502 argn=`expr $argn + 1`
1507 : produce awk script to parse command line options
1508 cat >options.awk <<'EOF'
1510 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1512 len = length(optstr);
1513 for (i = 1; i <= len; i++) {
1514 c = substr(optstr, i, 1);
1515 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1526 if (substr(str, 1, 1) != "-") {
1527 printf("'%s'\n", str);
1531 for (i = 2; i <= len; i++) {
1532 c = substr(str, i, 1);
1534 printf("-%s\n", substr(str, i));
1540 printf("'%s'\n", substr(str, i + 1));
1553 : process the command line options
1554 set X `for arg in "$@"; do echo "X$arg"; done |
1555 sed -e s/X// | awk -f options.awk`
1560 : set up default values
1570 rm -f optdef.sh posthint.sh
1571 cat >optdef.sh <<EOS
1577 while test $# -gt 0; do
1579 -d) shift; fastread=yes;;
1580 -e) shift; alldone=cont;;
1584 if test -r "$1"; then
1587 echo "$me: cannot read config file $1." >&2
1593 -h) shift; error=true;;
1594 -r) shift; reuseval=true;;
1595 -s) shift; silent=true; realsilent=true;;
1596 -E) shift; alldone=exit;;
1597 -K) shift; knowitall=true;;
1598 -O) shift; override=true;;
1599 -S) shift; silent=true; extractsh=true;;
1604 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1605 echo "$me: ignoring -D $1" >&2
1608 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1609 *) echo "$1='define'" >> optdef.sh;;
1616 *=) echo "$1" >> optdef.sh;;
1618 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1619 echo "$me: ignoring -U $1" >&2
1621 *) echo "$1='undef'" >> optdef.sh;;
1632 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1636 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1637 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1643 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1644 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1645 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1646 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1647 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1648 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1654 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1656 echo "$yyy=''" >> posthint.sh ;;
1661 echo "$yyy='$zzz'" >> posthint.sh ;;
1663 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1665 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1670 echo "$yyy=$zzz" >> posthint.sh ;;
1671 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1675 -V) echo "$me generated by metaconfig 3.5 PL0." >&2
1678 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1686 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1687 [-U symbol] [-U symbol=] [-A command:symbol...]
1688 -d : use defaults for all answers.
1689 -e : go on without questioning past the production of config.sh.
1690 -f : specify an alternate default configuration file.
1691 -h : print this help message and exit (with an error status).
1692 -r : reuse C symbols value if possible (skips costly nm extraction).
1693 -s : silent mode, only echoes questions and essential information.
1694 -D : define symbol to have some value:
1695 -D symbol symbol gets the value 'define'
1696 -D symbol=value symbol gets the value 'value'
1697 common used examples (see INSTALL for more info):
1698 -Duse64bitint use 64bit integers
1699 -Duse64bitall use 64bit integers and pointers
1700 -Dusethreads use thread support
1701 -Dinc_version_list=none do not include older perl trees in @INC
1702 -DEBUGGING=none DEBUGGING options
1703 -Dcc=gcc choose your compiler
1704 -Dprefix=/opt/perl5 choose your destination
1705 -E : stop at the end of questions, after having produced config.sh.
1706 -K : do not use unless you know what you are doing.
1707 -O : let -D and -U override definitions from loaded configuration file.
1708 -S : perform variable substitutions on all .SH files (can mix with -f)
1709 -U : undefine symbol:
1710 -U symbol symbol gets the value 'undef'
1711 -U symbol= symbol gets completely empty
1713 -A : manipulate symbol after the platform specific hints have been applied:
1714 -A append:symbol=value append value to symbol
1715 -A symbol=value like append:, but with a separating space
1716 -A define:symbol=value define symbol to have value
1717 -A clear:symbol define symbol to be ''
1718 -A define:symbol define symbol to be 'define'
1719 -A eval:symbol=value define symbol to be eval of value
1720 -A prepend:symbol=value prepend value to symbol
1721 -A undef:symbol define symbol to be 'undef'
1722 -A undef:symbol= define symbol to be ''
1723 e.g.: -A prepend:libswanted='cl pthread '
1724 -A ccflags=-DSOME_MACRO
1725 -V : print version number and exit (with a zero status).
1732 case "$fastread$alldone" in
1735 case "$extractsh" in
1738 if test ! -t 0; then
1739 echo "Say 'sh Configure', not 'sh <Configure'"
1749 true) exec 1>/dev/null;;
1752 : run the defines and the undefines, if any, but leave the file out there...
1755 : create the posthint manipulation script and leave the file out there...
1760 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1761 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1762 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1763 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1764 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1767 : Some greps do not return status, grrr.
1768 echo "grimblepritz" >grimble
1769 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1771 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1777 : the following should work in any shell
1781 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1782 cat >contains <<'EOSS'
1783 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1788 : Find the path to the source tree
1791 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1795 *) src=`cd ../$src && pwd` ;;
1808 if test -f $rsrc/Configure && \
1809 $contains "^package='$package'\$" $rsrc/Configure >/dev/null 2>&1
1811 : found it, so we are ok.
1814 for src in . .. ../.. ../../.. ../../../..; do
1815 if test -f ../$src/Configure && \
1816 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1827 Sorry, I can't seem to locate the source dir for $package. Please start
1828 Configure with an explicit path -- i.e. /some/path/Configure.
1836 echo "Sources for $package found in \"$src\"." >&4
1840 : script used to extract .SH files with variable substitutions
1841 cat >extract <<'EOS'
1843 echo "Doing variable substitutions on .SH files..."
1844 if test -f MANIFEST; then
1845 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1847 echo "(Looking for .SH files under the source directory.)"
1848 set x `(cd "$src"; find . -name "*.SH" -print)`
1852 0) set x `(cd "$src"; echo *.SH)`; shift;;
1854 if test ! -f "$src/$1"; then
1860 while test $name; do
1861 if test ! -d "$name"; then
1862 create="$name $create";
1863 name=`echo $name | sed -e "s|^[^/]*$||"`;
1864 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1869 for file in $create; do
1878 dir=`expr X$file : 'X\(.*\)/'`
1879 file=`expr X$file : 'X.*/\(.*\)'`
1880 (cd "$dir" && . ./$file)
1890 dir=`expr X$file : 'X\(.*\)/'`
1891 file=`expr X$file : 'X.*/\(.*\)'`
1892 (set x $dir; shift; eval $mkdir_p)
1893 sh <"$src/$dir/$file"
1902 if test -f "$src/config_h.SH"; then
1903 if test ! -f config.h; then
1904 : oops, they left it out of MANIFEST, probably, so do it anyway.
1905 . "$src/config_h.SH"
1910 : extract files and exit if asked to do so
1911 case "$extractsh" in
1913 case "$realsilent" in
1917 case "$config_sh" in
1918 '') config_sh='config.sh';;
1921 echo "Fetching answers from $config_sh..."
1924 test "$override" && . ./optdef.sh
1928 echo "Extraction done."
1933 : Eunice requires " " instead of "", can you believe it
1936 echo "Beginning of configuration questions for $package."
1938 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1940 : first determine how to suppress newline on echo command
1942 echo "Checking echo to see how to suppress newlines..."
1943 (echo "hi there\c" ; echo " ") >.echotmp
1944 if $contains c .echotmp >/dev/null 2>&1 ; then
1955 echo $n "The star should be here-->$c"
1959 : Now test for existence of everything in MANIFEST
1961 if test -f "$rsrc/MANIFEST"; then
1962 echo "First let's make sure your kit is complete. Checking..." >&4
1963 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | \
1964 (split -l 50 2>/dev/null || split -50)
1967 for filelist in x??; do
1968 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` \
1969 >/dev/null 2>>"$tmppwd/missing")
1971 if test -s missing; then
1975 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1977 You have the option of continuing the configuration process, despite the
1978 distinct possibility that your kit is damaged, by typing 'y'es. If you
1979 do, don't blame me if something goes wrong. I advise you to type 'n'o
1980 and contact the author (perlbug@perl.org).
1983 echo $n "Continue? [n] $c" >&4
1987 echo "Continuing..." >&4
1991 echo "ABORTING..." >&4
1996 echo "Looks good..."
1999 echo "There is no MANIFEST file. I hope your kit is complete !"
2003 : Find the appropriate value for a newline for tr
2005 if test -n "$DJGPP"; then
2008 if test X"$trnl" = X; then
2009 case "`echo foo|tr '\n' x 2>/dev/null`" in
2013 if test X"$trnl" = X; then
2014 case "`echo foo|tr '\012' x 2>/dev/null`" in
2015 foox) trnl='\012' ;;
2018 if test X"$trnl" = X; then
2019 case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
2020 fooxy) trnl='\n\r' ;;
2023 if test X"$trnl" = X; then
2026 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
2032 : compute the number of columns on the terminal for proper question formatting
2037 : set up the echo used in my read
2038 myecho="case \"\$xxxm\" in
2039 '') echo $n \"\$rp $c\" >&4;;
2041 '') echo $n \"[\$xxxm] $c\";;
2043 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
2045 echo $n \"[\$xxxm] $c\" >&4
2047 echo $n \"\$rp [\$xxxm] $c\" >&4
2053 : now set up to do reads with possible shell escape and default assignment
2059 case "\$fastread" in
2060 yes) case "\$dflt" in
2063 case "\$silent-\$rp" in
2068 *) case "\$silent" in
2069 true) case "\$rp" in
2074 while expr "X\$ans" : "X!" >/dev/null; do
2078 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2086 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2095 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2100 echo "(OK, I'll run with -d after this question.)" >&4
2103 echo "*** Sorry, \$1 not supported yet." >&4
2113 echo "*** Substitution done -- please confirm."
2115 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2120 echo "*** Error -- try again."
2127 case "\$ans\$xxxm\$nostick" in
2139 : create .config dir to save info across Configure sessions
2140 test -d ../.config || mkdir ../.config
2141 cat >../.config/README <<EOF
2142 This directory created by Configure to save information that should
2143 persist across sessions for $package.
2145 You may safely delete it if you wish.
2148 : See if we are using a devel version and want that
2149 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2152 usedevel="$define" ;;
2153 *) case "$xversion" in
2156 *** WHOA THERE!!! ***
2158 This is an UNSTABLE DEVELOPMENT release.
2159 The version of this $package distribution is $xversion, that is, odd,
2160 (as opposed to even) and that signifies a development release.
2161 If you want a maintenance release, you want an even-numbered version.
2163 Do ***NOT*** install this into production use.
2164 Data corruption and crashes are possible.
2166 It is most seriously suggested that you do not continue any further
2167 unless you want to help in developing and debugging Perl.
2169 If you *still* want to build perl, you can answer 'y' now,
2170 or pass -Dusedevel to Configure.
2173 rp='Do you really want to continue?'
2177 [yY]) echo >&4 "Okay, continuing."
2178 usedevel="$define" ;;
2179 *) echo >&4 "Okay, bye."
2190 case "$versiononly" in
2191 '') versiononly="$define" ;;
2193 case "$installusrbinperl" in
2194 '') installusrbinperl="$undef" ;;
2199 : general instructions
2202 user=`(logname) 2>/dev/null`
2204 '') user=`whoami 2>&1`;;
2206 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2209 rp='Would you like to see the instructions?'
2220 This installation shell script will examine your system and ask you questions
2221 to determine how the perl5 package should be installed. If you get
2222 stuck on a question, you may use a ! shell escape to start a subshell or
2223 execute a command. Many of the questions will have default answers in square
2224 brackets; typing carriage return will give you the default.
2226 On some of the questions which ask for file or directory names you are allowed
2227 to use the ~name construct to specify the login directory belonging to "name",
2228 even if you don't have a shell which knows about that. Questions where this is
2229 allowed will be marked "(~name ok)".
2233 dflt='Type carriage return to continue'
2237 The prompter used in this script allows you to use shell variables and
2238 backticks in your answers. You may use $1, $2, etc... to refer to the words
2239 in the default answer, as if the default line was a set of arguments given to a
2240 script shell. This means you may also use $* to repeat the whole default line,
2241 so you do not have to re-type everything to add something to the default.
2243 Everytime there is a substitution, you will have to confirm. If there is an
2244 error (e.g. an unmatched backtick), the default answer will remain unchanged
2245 and you will be prompted again.
2247 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2248 the questions and use the computed defaults (or the previous answers if there
2249 was already a config.sh file). Type 'Configure -h' for a list of options.
2250 You may also start interactively and then answer '& -d' at any prompt to turn
2251 on the non-interactive behaviour for the remainder of the execution.
2257 Much effort has been expended to ensure that this shell script will run on any
2258 Unix system. If despite that it blows up on yours, your best bet is to edit
2259 Configure and run it again. If you can't run Configure for some reason,
2260 you'll have to generate a config.sh file by hand. Whatever problems you
2261 have, let me (perlbug@perl.org) know how I blew it.
2263 This installation script affects things in two ways:
2265 1) it may do direct variable substitutions on some of the files included
2267 2) it builds a config.h file for inclusion in C programs. You may edit
2268 any of these files as the need arises after running this script.
2270 If you make a mistake on a question, there is no easy way to back up to it
2271 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2272 files. Configure will offer to let you do this before it runs the SH files.
2275 dflt='Type carriage return to continue'
2277 case "$firsttime" in
2278 true) echo $user >>../.config/instruct;;
2282 : find out where common programs are
2284 echo "Locating common programs..." >&4
2297 if test -d \$dir/\$thing; then
2303 for thisthing in \$dir/\$thing; do
2304 : just loop through to pick last item
2306 if test -f \$thisthing; then
2309 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2312 elif test -f \$dir/\$thing.exe; then
2313 if test -n "$DJGPP"; then
2314 echo \$dir/\$thing.exe
2315 elif test "$eunicefix" != ":"; then
2316 : on Eunice apparently
2368 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2369 pth="$pth /lib /usr/lib"
2370 for file in $loclist; do
2374 if test -f "$xxx"; then
2377 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2378 xxx=`./loc $file $file $pth`
2381 '') xxx=`./loc $file $file $pth`;;
2382 *) xxx=`./loc $xxx $xxx $pth`;;
2384 eval $file=$xxx$_exe
2388 echo $file is in $xxx.
2391 echo $file is in $xxx.
2394 echo "I don't know where '$file' is, and my life depends on it." >&4
2395 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2401 echo "Don't worry if any of the following aren't found..."
2403 for file in $trylist; do
2407 if test -f "$xxx"; then
2410 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2411 xxx=`./loc $file $file $pth`
2414 '') xxx=`./loc $file $file $pth`;;
2415 *) xxx=`./loc $xxx $xxx $pth`;;
2417 eval $file=$xxx$_exe
2421 echo $file is in $xxx.
2424 echo $file is in $xxx.
2427 echo "I don't see $file out there, $say."
2434 echo "Substituting grep for egrep."
2441 echo "Substituting cp for ln."
2450 echo "I can't find make or gmake, and my life depends on it." >&4
2451 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2459 *) # We can't have osname yet.
2460 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2461 # Assume that gmake, if found, is definitely GNU make
2462 # and prefer it over the system make.
2463 echo "Substituting gmake for make."
2471 echo "Hopefully test is built into your sh."
2474 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2475 echo "Using the test built into your sh."
2483 echo "Hopefully echo is built into your sh."
2488 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2489 $echo $n "hi there$c" >foo1
2490 echo $n "hi there$c" >foo2
2491 if cmp foo1 foo2 >/dev/null 2>&1; then
2492 echo "They are compatible. In fact, they may be identical."
2499 They are not compatible! You are probably running ksh on a non-USG system.
2500 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2501 have echo built in and we may have to run some Bourne shell scripts. That
2502 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2505 $echo $n "The star should be here-->$c"
2512 # This question was auctioned at YAPC::Europe-2007 in Vienna
2513 # I never promised you could answer it. I only auctioned the question.
2515 The following message is sponsored by
2517 Dresden.pm<--The stars should be here.
2519 Dear Perl user, system administrator or package
2520 maintainer, the Perl community sends greetings to
2521 you. Do you (emblematical) greet back [Y/n]? n
2525 : Check what type of C compiler we use
2529 cat <<'EOSC' >>trygcc
2534 int main(int argc, char *argv[]) {
2538 if $cc -o try $ccflags $ldflags try.c; then
2541 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2547 # Skip this test because it gives a false match on output like:
2548 # ./trygcc: line 23: cc: command not found
2549 # case "`$cc -v -c try.c 2>&1`" in
2550 # *gcc*) trygcc=no ;;
2552 if $test X"$trygcc" = Xyes; then
2553 if gcc -o try -c try.c; then
2555 echo "You seem to have a working gcc, though." >&4
2556 # Switching compilers may undo the work of hints files.
2557 # The most common problem is -D_REENTRANT for threads.
2558 # This heuristic catches that case, but gets false positives
2559 # if -Dusethreads was not actually specified. Better to
2560 # bail out here with a useful message than fail
2561 # mysteriously later. Should we perhaps just try to
2562 # re-invoke Configure -Dcc=gcc config_args ?
2563 if $test -f usethreads.cbu; then
2566 *** However, any setting of the C compiler flags (e.g. for thread support)
2567 *** will be lost. It may be necessary for you to restart Configure and
2568 *** add -Dcc=gcc to your Configure command line.
2571 rp="Would you like to go ahead and try gcc anyway?"
2574 rp="Would you like to use it?"
2577 if $test -f myread; then
2580 if $test -f UU/myread; then
2583 echo "Cannot find myread, sorry. Aborting." >&2
2588 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2601 cat <<'EOSC' >>checkcc
2606 int main(int argc, char *argv[]) {
2610 if $cc -o try $ccflags $ldflags try.c; then
2613 if $test X"$despair" = Xyes; then
2614 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2617 You need to find a working C compiler.
2618 Either (purchase and) install the C compiler supplied by your OS vendor,
2619 or for a free C compiler try http://gcc.gnu.org/
2620 I cannot continue any further, aborting.
2629 : determine whether symbolic links are supported
2632 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2633 echo "Symbolic links are supported." >&4
2636 echo "Symbolic links are NOT supported." >&4
2641 : determine whether symbolic links are supported
2645 echo "Checking how to test for symbolic links..." >&4
2647 if $test "X$issymlink" = X; then
2649 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2650 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2652 if test $? = 0; then
2655 echo "Your builtin 'test -h' may be broken." >&4
2658 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2661 if test -f "$p/$test"; then
2670 echo "Trying external '$test -h'." >&4
2671 issymlink="$test -h"
2672 if $test ! -h sym >/dev/null 2>&1; then
2673 echo "External '$test -h' is broken, too." >&4
2681 if $test "X$issymlink" = X; then
2682 if $test -L sym 2>/dev/null; then
2683 issymlink="$test -L"
2684 echo "The builtin '$test -L' worked." >&4
2687 if $test "X$issymlink" != X; then
2688 echo "You can test for symbolic links with '$issymlink'." >&4
2690 echo "I do not know how you can test for symbolic links." >&4
2694 *) echo "No symbolic links, so not testing for their testing..." >&4
2699 : Make symlinks util
2700 case "$mksymlinks" in
2703 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2706 *) case "$lns:$issymlink" in
2707 *"ln"*" -s:"*"test -"?)
2708 echo "Creating the symbolic links..." >&4
2709 echo "(First creating the subdirectories...)" >&4
2711 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2713 test -z "$directory" && break
2717 if test ! -d t/base; then
2718 echo "Failed to create the subdirectories. Aborting." >&4
2721 echo "(Then creating the symlinks...)" >&4
2722 awk '{print $1}' $src/MANIFEST | while true; do
2724 test -z "$filename" && break
2725 if test -f $filename; then
2726 if $issymlink $filename; then
2730 if test -f $filename; then
2731 echo "$filename already exists, not symlinking."
2733 ln -s $src/$filename $filename
2737 if test ! -f t/base/lex.t; then
2738 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2743 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2751 : Check for Cross-Compilation
2752 case "$usecrosscompile" in
2754 $echo "Cross-compiling..."
2757 *-*-gcc) # A cross-compiling gcc, probably.
2758 targetarch=`$echo $cc|$sed 's/-gcc$//'`
2760 # leave out ld, choosing it is more complex
2762 ranlib=$targetarch-ranlib
2763 $echo 'extern int foo;' > try.c
2764 set X `$cc -v -E try.c 2>&1 | $awk '/^#include </,/^End of search /'|$grep '/include'`
2766 if $test $# -gt 0; then
2768 incpth="`$echo $incpth|$sed 's/^ //'`"
2769 echo "Guessing incpth '$incpth'." >&4
2771 j="`$echo $i|$sed 's,/include$,/lib,'`"
2772 if $test -d $j; then
2776 libpth="`$echo $libpth|$sed 's/^ //'`"
2777 echo "Guessing libpth '$libpth'." >&4
2782 case "$targetarch" in
2783 '') echo "Targetarch not defined." >&4; croak=y ;;
2784 *) echo "Using targetarch $targetarch." >&4 ;;
2787 '') echo "Incpth not defined." >&4; croak=y ;;
2788 *) echo "Using incpth '$incpth'." >&4 ;;
2791 '') echo "Libpth not defined." >&4; croak=y ;;
2792 *) echo "Using libpth '$libpth'." >&4 ;;
2795 '') for i in $incpth; do
2796 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
2798 echo "Guessing usrinc $usrinc." >&4
2803 '') echo "Usrinc not defined." >&4; croak=y ;;
2806 *) echo "Using usrinc $usrinc." >&4 ;;
2808 case "$targethost" in
2809 '') echo "Targethost not defined." >&4; croak=y ;;
2810 *) echo "Using targethost $targethost." >&4
2815 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2818 /*) run=$src/Cross/run
2819 targetmkdir=$src/Cross/mkdir
2821 from=$src/Cross/from
2823 *) pwd=`$test -f ../Configure & cd ..; pwd`
2825 targetmkdir=$pwd/Cross/mkdir
2827 from=$pwd/Cross/from
2830 case "$targetrun" in
2831 '') targetrun=ssh ;;
2836 case "$targetfrom" in
2837 '') targetfrom=scp ;;
2841 from=$from-$targetfrom
2842 case "$targetdir" in
2844 echo "Guessing targetdir $targetdir." >&4
2847 case "$targetuser" in
2849 echo "Guessing targetuser $targetuser." >&4
2852 case "$targetfrom" in
2856 case "$targetrun" in
2868 '') cwd=$targetdir ;;
2872 if $test ! -f \$exe.xok; then
2876 $targetrun -l $targetuser $targethost "cd \$cwd && ./\$exe \$@"
2879 *) echo "Unknown targetrun '$targetrun'" >&4
2883 case "$targetmkdir" in
2885 cat >$targetmkdir <<EOF
2887 $targetrun -l $targetuser $targethost "mkdir -p \$@"
2889 $chmod a+rx $targetmkdir
2891 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
2903 $targetmkdir \`dirname \$f\`
2904 $targetto $q \$f $targetuser@$targethost:\$f || exit 1
2907 $targetmkdir $targetdir/\`dirname \$f\`
2908 $targetto $q \$f $targetuser@$targethost:$targetdir/\$f || exit 1
2921 $mkdir -p $targetdir/\`dirname \$f\`
2922 $cp \$f $targetdir/\$f || exit 1
2925 $targetmkdir $targetdir/\`dirname \$f\`
2926 $cp \$f $targetdir/\$f || exit 1
2933 *) echo "Unknown targetto '$targetto'" >&4
2937 case "$targetfrom" in
2944 $targetfrom $q $targetuser@$targethost:$targetdir/\$f . || exit 1
2949 cp) cat >$from <<EOF
2954 cp $targetdir/\$f . || exit 1
2959 *) echo "Unknown targetfrom '$targetfrom'" >&4
2963 if $test ! -f $run; then
2964 echo "Target 'run' script '$run' not found." >&4
2968 if $test ! -f $to; then
2969 echo "Target 'to' script '$to' not found." >&4
2973 if $test ! -f $from; then
2974 echo "Target 'from' script '$from' not found." >&4
2978 if $test ! -f $run -o ! -f $to -o ! -f $from; then
2982 Using '$run' for remote execution,
2983 and '$from' and '$to'
2984 for remote file transfer.
2990 usecrosscompile='undef'
2995 : see whether [:lower:] and [:upper:] are supported character classes
2997 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2999 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
3003 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
3004 # (0xd9 and 0xe2), therefore that is a nice testing point.
3005 if test "X$up" = X -o "X$low" = X; then
3006 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
3012 if test "X$up" = X -o "X$low" = X; then
3013 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
3019 if test "X$up" = X -o "X$low" = X; then
3020 case "`echo RS | od -x 2>/dev/null`" in
3022 echo "Hey, this might be EBCDIC." >&4
3023 if test "X$up" = X -o "X$low" = X; then
3024 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
3025 rs) up='[A-IJ-RS-Z]'
3030 if test "X$up" = X -o "X$low" = X; then
3031 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
3041 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
3043 echo "Using $up and $low to convert case." >&4
3046 echo "I don't know how to translate letters from upper to lower case." >&4
3047 echo "Your tr is not acting any way I know of." >&4
3051 : set up the translation script tr, must be called with ./tr of course
3055 '[A-Z][a-z]') exec $tr '$up' '$low';;
3056 '[a-z][A-Z]') exec $tr '$low' '$up';;
3063 : Try to determine whether config.sh was made on this system
3064 case "$config_sh" in
3066 myuname=`$uname -a 2>/dev/null`
3067 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
3068 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
3069 # because the A-Z/a-z are not consecutive.
3070 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e "s,['/],,g" | \
3071 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
3072 newmyuname="$myuname"
3074 case "$knowitall" in
3076 if test -f ../config.sh; then
3077 if $contains myuname= ../config.sh >/dev/null 2>&1; then
3078 eval "`grep myuname= ../config.sh`"
3080 if test "X$myuname" = "X$newmyuname"; then
3088 : Get old answers from old config file if Configure was run on the
3089 : same system, otherwise use the hints.
3092 if test -f config.sh; then
3094 rp="I see a config.sh file. Shall I use it to set the defaults?"
3097 n*|N*) echo "OK, I'll ignore it."
3098 mv config.sh config.sh.old
3099 myuname="$newmyuname"
3101 *) echo "Fetching default answers from your old config.sh file..." >&4
3109 : Older versions did not always set $sh. Catch re-use of such
3119 if test ! -f config.sh; then
3122 First time through, eh? I have some defaults handy for some systems
3123 that need some extra help getting the Configure answers right:
3126 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3128 : Half the following guesses are probably wrong... If you have better
3129 : tests or hints, please send them to perlbug@perl.org
3130 : The metaconfig authors would also appreciate a copy...
3131 $test -f /irix && osname=irix
3132 $test -f /xenix && osname=sco_xenix
3133 $test -f /dynix && osname=dynix
3134 $test -f /dnix && osname=dnix
3135 $test -f /lynx.os && osname=lynxos
3136 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3137 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3138 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3139 $test -f /bin/mips && /bin/mips && osname=mips
3140 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
3141 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
3142 $test -d /usr/apollo/bin && osname=apollo
3143 $test -f /etc/saf/_sactab && osname=svr4
3144 $test -d /usr/include/minix && osname=minix
3145 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3146 if $test -d /MachTen -o -d /MachTen_Folder; then
3148 if $test -x /sbin/version; then
3149 osvers=`/sbin/version | $awk '{print $2}' |
3150 $sed -e 's/[A-Za-z]$//'`
3151 elif $test -x /usr/etc/version; then
3152 osvers=`/usr/etc/version | $awk '{print $2}' |
3153 $sed -e 's/[A-Za-z]$//'`
3159 $test -f /sys/posix.dll &&
3160 $test -f /usr/bin/what &&
3161 set X `/usr/bin/what /sys/posix.dll` &&
3162 $test "$3" = UWIN &&
3166 if $test -f $uname; then
3174 umips) osname=umips ;;
3177 [23]100) osname=mips ;;
3178 next*) osname=next ;;
3180 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3181 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3184 elif $test -f /etc/kconfig; then
3186 if test "$lns" = "$ln -s"; then
3188 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3190 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3197 if test -n "$DJGPP"; then
3206 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3208 # oslevel can fail with:
3209 # oslevel: Unable to acquire lock.
3210 *not\ found) osvers="$4"."$3" ;;
3211 '<3240'|'<>3240') osvers=3.2.0 ;;
3212 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3213 '=3250'|'>3250') osvers=3.2.5 ;;
3217 bsd386) osname=bsd386
3220 cygwin*) osname=cygwin
3223 *dc.osx) osname=dcosx
3229 domainos) osname=apollo
3235 dragonfly) osname=dragonfly
3238 dynixptx*) osname=dynixptx
3239 osvers=`echo "$4"|sed 's/^v//'`
3241 freebsd) osname=freebsd
3243 genix) osname=genix ;;
3247 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3263 netbsd*) osname=netbsd
3266 news-os) osvers="$3"
3268 4*) osname=newsos4 ;;
3272 next*) osname=next ;;
3273 nonstop-ux) osname=nonstopux ;;
3274 openbsd) osname=openbsd
3280 POSIX-BC | posix-bc ) osname=posix-bc
3283 powerux | power_ux | powermax_os | powermaxos | \
3284 powerunix | power_unix) osname=powerux
3290 solaris) osname=solaris
3292 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3299 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3303 titanos) osname=titanos
3312 ultrix) osname=ultrix
3315 osf1|mls+) case "$5" in
3318 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3321 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3324 hp*) osname=hp_osf1 ;;
3325 mips) osname=mips_osf1 ;;
3328 # UnixWare 7.1.2 is known as Open UNIX 8
3329 openunix|unixware) osname=svr5
3337 $2) case "$osname" in
3341 : svr4.x or possibly later
3351 if test -f /stand/boot ; then
3352 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3353 if test -n "$INITPROG" -a -f "$INITPROG"; then
3354 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3355 if test -n "$isesix"; then
3363 *) if test -f /etc/systemid; then
3365 set `echo $3 | $sed 's/\./ /g'` $4
3366 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3368 elif $test -f $src/hints/sco_$1_$2.sh; then
3370 elif $test -f $src/hints/sco_$1.sh; then
3375 '') : Still unknown. Probably a generic Sys V.
3384 *) case "$osname" in
3385 '') : Still unknown. Probably a generic BSD.
3393 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3394 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3395 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3398 $rm -f UU/kernel.what
3399 elif test -d c:/. -o -n "$is_os2" ; then
3406 case "$targetarch" in
3409 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3414 : Now look for a hint file osname_osvers, unless one has been
3415 : specified already.
3418 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3419 : Also try without trailing minor version numbers.
3420 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3421 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3422 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3423 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3426 *) case "$osvers" in
3429 *) if $test -f $src/hints/$file.sh ; then
3431 elif $test -f $src/hints/$xfile.sh ; then
3433 elif $test -f $src/hints/$xxfile.sh ; then
3435 elif $test -f $src/hints/$xxxfile.sh ; then
3437 elif $test -f $src/hints/$xxxxfile.sh ; then
3439 elif $test -f "$src/hints/${osname}.sh" ; then
3448 if $test -f Policy.sh ; then
3451 none) dflt="Policy" ;;
3452 *) dflt="Policy $dflt" ;;
3457 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3461 if $test -f Policy.sh ; then
3464 There's also a Policy hint file available, which should make the
3465 site-specific (policy) questions easier to answer.
3472 You may give one or more space-separated answers, or "none" if appropriate.
3473 If you have a handcrafted Policy.sh file or a Policy.sh file generated by a
3474 previous run of Configure, you may specify it as well as or instead of
3475 OS-specific hints. If hints are provided for your OS, you should use them:
3476 although Perl can probably be built without hints on many platforms, using
3477 hints often improve performance and may enable features that Configure can't
3478 set up on its own. If there are no hints that match your OS, specify "none";
3479 DO NOT give a wrong version or a wrong OS.
3483 rp="Which of these apply, if any?"
3486 for file in $tans; do
3487 if $test X$file = XPolicy -a -f Policy.sh; then
3489 $cat Policy.sh >> UU/config.sh
3490 elif $test -f $src/hints/$file.sh; then
3491 . $src/hints/$file.sh
3492 $cat $src/hints/$file.sh >> UU/config.sh
3493 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3496 : Give one chance to correct a possible typo.
3497 echo "$file.sh does not exist"
3499 rp="hint to use instead?"
3501 for file in $ans; do
3502 if $test -f "$src/hints/$file.sh"; then
3503 . $src/hints/$file.sh
3504 $cat $src/hints/$file.sh >> UU/config.sh
3505 elif $test X$ans = X -o X$ans = Xnone ; then
3508 echo "$file.sh does not exist -- ignored."
3515 : Remember our hint file for later.
3516 if $test -f "$src/hints/$file.sh" ; then
3526 echo "Fetching default answers from $config_sh..." >&4
3530 cp $config_sh config.sh 2>/dev/null
3540 test "$override" && . ./optdef.sh
3542 : Restore computed paths
3543 for file in $loclist $trylist; do
3544 eval $file="\$_$file"
3549 Configure uses the operating system name and version to set some defaults.
3550 The default value is probably right if the name rings a bell. Otherwise,
3551 since spelling matters for me, either accept the default or answer "none"
3558 ''|' '|none) dflt=none ;;
3559 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3562 *) dflt="$osname" ;;
3564 rp="Operating system name?"
3568 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3574 ''|' '|none) dflt=none ;;
3575 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3576 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3578 ''|' ') dflt=none ;;
3583 *) dflt="$osvers" ;;
3585 rp="Operating system version?"
3595 : who configured the system
3596 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3599 cf_by=`(logname) 2>/dev/null`
3602 cf_by=`(whoami) 2>/dev/null`
3604 "") cf_by=unknown ;;
3609 : decide how portable to be. Allow command line overrides.
3610 case "$d_portable" in
3612 *) d_portable="$define" ;;
3615 : set up shell script to do ~ expansion
3621 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3624 if $test -f /bin/csh; then
3625 /bin/csh -f -c "glob \$1"
3630 name=\`$expr x\$1 : '..\([^/]*\)'\`
3631 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3632 if $test ! -d "\$dir"; then
3634 echo "\$me: can't locate home directory for: \$name" >&2
3639 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3655 : now set up to get a file name
3659 cat <<'EOSC' >>getfile
3675 : getfile will accept an answer from the comma-separated list
3676 : enclosed in parentheses even if it does not meet other criteria.
3677 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3678 fn=`echo $fn | sed 's/(.*)//'`
3684 loc_file=`expr $fn : '.*:\(.*\)'`
3685 fn=`expr $fn : '\(.*\):.*'`
3693 */*) fullpath=true;;
3702 *e*) exp_file=true;;
3705 *p*) nopath_ok=true;;
3710 *d*) type='Directory';;
3711 *l*) type='Locate';;
3716 Locate) what='File';;
3721 case "$d_portable" in
3729 while test "$type"; do
3734 true) rp="$rp (~name ok)";;
3737 if test -f UU/getfile.ok && \
3738 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3757 value=`UU/filexp $ans`
3760 if test "$ans" != "$value"; then
3761 echo "(That expands to $value on this system.)"
3775 /*) value="$ansexp" ;;
3776 [a-zA-Z]:/*) value="$ansexp" ;;
3781 echo "I shall only accept a full path name, as in /bin/ls." >&4
3782 echo "Use a ! shell escape if you wish to check pathnames." >&4
3785 echo "Please give a full path name, starting with slash." >&4
3788 echo "Note that using ~name is ok provided it expands well." >&4
3801 for fp in $gfpth; do
3802 if test "X$fp" = X.; then
3807 if test -f "$pf"; then
3809 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3811 echo "($value is not a plain file, but that's ok.)"
3814 if test X"$type" = X; then
3821 for fp in $gfpth; do
3822 if test "X$fp" = X.; then
3827 direxp="$fp/$ansexp"
3829 if test -d "$direxp"; then
3837 if test -d "$ansexp"; then
3838 echo "(Looking for $loc_file in directory $value.)"
3839 value="$value/$loc_file"
3840 ansexp="$ansexp/$loc_file"
3842 if test -f "$ansexp"; then
3845 case "$nopath_ok" in
3846 true) case "$value" in
3848 *) echo "Assuming $value will be in people's path."
3864 if test "$fastread" = yes; then
3869 rp="$what $value doesn't exist. Use that name anyway?"
3888 test "X$gfpthkeep" != Xy && gfpth=""
3891 : determine root of directory hierarchy where package will be installed.
3894 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
3897 dflt=`echo "$prefix" | sed 's/.$//'`
3905 By default, $package will be installed in $dflt/bin, manual pages
3906 under $dflt/man, etc..., i.e. with $dflt as prefix for all
3907 installation directories. Typically this is something like /usr/local.
3908 If you wish to have binaries under /usr/bin but other parts of the
3909 installation under /usr/local, that's ok: you will be prompted
3910 separately for each of the installation directories, the prefix being
3911 only used to set the defaults.
3915 rp='Installation prefix to use?'
3923 *) oldprefix="$prefix";;
3930 : allow them to override the AFS root
3933 *) afsroot=$afsroot ;;
3939 $define|true) afs=true ;;
3940 $undef|false) afs=false ;;
3941 *) if $test -d $afsroot; then
3949 echo "AFS may be running... I'll be extra cautious then..." >&4
3951 echo "AFS does not seem to be running..." >&4
3954 : determine installation prefix for where package is to be installed.
3958 Since you are running AFS, I need to distinguish the directory in which
3959 files will reside from the directory in which they are installed (and from
3960 which they are presumably copied to the former directory by occult means).
3963 case "$installprefix" in
3964 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
3965 *) dflt="$installprefix";;
3970 In some special cases, particularly when building $package for distribution,
3971 it is convenient to distinguish the directory in which files should be
3972 installed from the directory ($prefix) in which they will
3973 eventually reside. For most users, these two directories are the same.
3976 case "$installprefix" in
3978 *) dflt=$installprefix;;
3982 rp='What installation prefix should I use for installing files?'
3984 installprefix="$ans"
3985 installprefixexp="$ansexp"
3987 : Perform the prefixexp/installprefixexp correction if necessary
3988 cat <<EOS >installprefix
3991 cat <<'EOSC' >>installprefix
3992 : Change installation prefix, if necessary.
3993 if $test X"$prefix" != X"$installprefix"; then
3994 eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`"
3996 eval "install${prefixvar}=\"\$${prefixvar}exp\""
3999 chmod +x installprefix
4000 $eunicefix installprefix
4002 : Set variables such as privlib and privlibexp from the output of ./getfile
4003 : performing the prefixexp/installprefixexp correction if necessary.
4004 cat <<EOS >setprefixvar
4007 cat <<'EOSC' >>setprefixvar
4008 eval "${prefixvar}=\"\$ans\""
4009 eval "${prefixvar}exp=\"\$ansexp\""
4012 chmod +x setprefixvar
4013 $eunicefix setprefixvar
4015 : set up the script used to warn in case of inconsistency
4024 '') echo "The $hint value for \$$var on this machine was \"$was\"!" >&4
4026 *) echo "Hmm. Based on the hints in hints/$hintfile.sh, " >&4
4027 echo "the $hint value for \$$var on this machine was \"$was\"!" >&4
4032 echo "*** WHOA THERE!!! ***" >&4
4033 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
4036 rp=" Keep the $hint value?"
4039 y) td=$was; tu=$was;;
4043 : function used to set '$1' to '$val'
4044 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
4046 $define$undef) . ./whoa; eval "$var=\$td";;
4047 $undef$define) . ./whoa; eval "$var=\$tu";;
4048 *) eval "$var=$val";;
4051 : Check is we will use socks
4053 $define|true|[yY]*) dflt='y';;
4058 Perl can be built to use the SOCKS proxy protocol library. To do so,
4059 Configure must be run with -Dusesocks. If you use SOCKS you also need
4060 to use the PerlIO abstraction layer, this will be implicitly selected.
4062 If this doesn't make any sense to you, just accept the default '$dflt'.
4064 rp='Build Perl for SOCKS?'
4067 y|Y) val="$define" ;;
4074 $define|true|[yY]*) useperlio="$define";;
4077 : Check if we want perlio
4078 case "$useperlio" in
4079 $define|true|[yY]*|'') dflt='y';;
4084 Previous version of $package used the standard IO mechanisms as
4085 defined in <stdio.h>. Versions 5.003_02 and later of $package allow
4086 alternate IO mechanisms via the PerlIO abstraction layer, but the
4087 stdio mechanism is still available if needed. The abstraction layer
4088 can use AT&T's sfio (if you already have sfio installed) or regular stdio.
4089 Using PerlIO with sfio may cause problems with some extension modules.
4091 If this doesn't make any sense to you, just accept the default '$dflt'.
4093 rp='Use the PerlIO abstraction layer?'
4100 echo "Ok, doing things the stdio way."
4109 case "$useperlio" in
4110 $define|true|[yY]*) ;;
4113 You are using the SOCKS proxy protocol library which means that you
4114 should also use the PerlIO layer. You may be headed for trouble.
4122 : get the patchlevel
4124 echo "Getting the current patchlevel..." >&4
4125 if $test -r $rsrc/patchlevel.h;then
4126 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
4127 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
4128 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4129 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
4130 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
4131 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4132 perl_patchlevel=`egrep ',"(MAINT|SMOKE)[0-9][0-9]*"' $rsrc/patchlevel.h|tail -1|sed 's/[^0-9]//g'`
4141 $echo "(You do not have patchlevel.h. Eek.)"
4143 if $test -r $rsrc/.patch ; then
4144 if $test "X$perl_patchlevel" = "X" || $test "`cat $rsrc/.patch`" -gt "$perl_patchlevel" ; then
4145 perl_patchlevel=`cat $rsrc/.patch`
4148 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
4149 version_patchlevel_string="version $patchlevel subversion $subversion"
4150 case "$perl_patchlevel" in
4152 *) perl_patchlevel=`echo $perl_patchlevel | sed 's/.* //'`
4153 version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel"
4157 $echo "(You have $package $version_patchlevel_string.)"
4161 : XXX Should be a Configure test for double-dots in filenames.
4162 version=`echo $revision $patchlevel $subversion | \
4163 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4164 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4165 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4168 version=`echo $revision $patchlevel $subversion | \
4169 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4170 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4171 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4174 : Special case the 5.005_xx maintenance series, which used 5.005
4175 : without any subversion label as a subdirectory in $sitelib
4176 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
4177 api_versionstring='5.005'
4180 : Do we want threads support and if so, what type
4181 case "$usethreads" in
4182 $define|true|[yY]*) dflt='y';;
4183 *) # Catch case where user specified ithreads or 5005threads but
4184 # forgot -Dusethreads (A.D. 4/2002)
4185 case "$useithreads$use5005threads" in
4187 case "$useperlio" in
4188 "$define") dflt='y' ;;
4198 Perl can be built to take advantage of threads on some systems.
4199 To do so, Configure can be run with -Dusethreads.
4201 Note that Perl built with threading support runs slightly slower
4202 and uses more memory than plain Perl. The current implementation
4203 is believed to be stable, but it is fairly new, and so should be
4204 treated with caution.
4206 If this doesn't make any sense to you, just accept the default '$dflt'.
4208 rp='Build a threading Perl?'
4211 y|Y) val="$define" ;;
4217 if $test $patchlevel -lt 9; then
4218 case "$usethreads" in
4222 Since release 5.6, Perl has had two different threading implementations,
4223 the newer interpreter-based version (ithreads) with one interpreter per
4224 thread, and the older 5.005 version (5005threads).
4225 The 5005threads version is effectively unmaintained and will probably be
4226 removed in Perl 5.10, so there should be no need to build a Perl using it
4227 unless needed for backwards compatibility with some existing 5.005threads
4231 : Default to ithreads unless overridden on command line or with
4234 case "$use5005threads" in
4235 $define|true|[yY]*) dflt='n';;
4237 case "$useithreads" in
4238 $undef|false|[nN]*) dflt='n';;
4240 rp='Use the newer interpreter-based ithreads?'
4243 y|Y) val="$define" ;;
4248 : Now set use5005threads to the opposite value.
4249 case "$useithreads" in
4250 $define) val="$undef" ;;
4257 useithreads="$undef"
4258 use5005threads="$undef"
4262 case "$useithreads$use5005threads" in
4266 You cannot have both the ithreads and the 5.005 threads enabled
4267 at the same time. Disabling the 5.005 threads since they are
4268 much less stable than the ithreads.
4271 use5005threads="$undef"
4276 : perl-5.9.x and later
4278 if test X"$usethreads" = "X$define"; then
4279 case "$use5005threads" in
4283 5.005 threads has been removed for 5.10. Perl will be built using ithreads.
4290 use5005threads="$undef"
4291 useithreads="$usethreads"
4294 if test X"$usethreads" = "X$define" -a "X$useperlio" = "Xundef"; then
4297 *** To build with ithreads you must also use the PerlIO layer.
4298 *** Cannot continue, aborting.
4304 case "$d_oldpthreads" in
4305 '') : Configure tests would be welcome here. For now, assume undef.
4307 *) val="$d_oldpthreads" ;;
4313 : Look for a hint-file generated 'call-back-unit'. If the
4314 : user has specified that a threading perl is to be built,
4315 : we may need to set or change some other defaults.
4316 if $test -f usethreads.cbu; then
4317 echo "Your platform has some specific hints regarding threaded builds, using them..."
4320 case "$usethreads" in
4321 "$define"|true|[yY]*)
4323 (Your platform does not have any specific hints for threaded builds.
4324 Assuming POSIX threads, then.)
4330 : Check if multiplicity is required
4333 Perl can be built so that multiple Perl interpreters can coexist
4334 within the same Perl executable.
4337 case "$useithreads" in
4340 This multiple interpreter support is required for interpreter-based threads.
4344 *) case "$usemultiplicity" in
4345 $define|true|[yY]*) dflt='y';;
4349 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
4350 rp='Build Perl for multiplicity?'
4353 y|Y) val="$define" ;;
4361 : Check if morebits is requested
4362 case "$usemorebits" in
4363 "$define"|true|[yY]*)
4364 use64bitint="$define"
4365 uselongdouble="$define"
4366 usemorebits="$define"
4368 *) usemorebits="$undef"
4372 : Determine the C compiler to be used
4378 rp="Use which C compiler?"
4382 : See whether they have no cc but they do have gcc
4384 if $test -f cc.cbu; then
4389 : make some quick guesses about what we are up against
4391 $echo $n "Hmm... $c"
4401 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
4402 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
4404 echo "Looks kind of like an OSF/1 system, but we'll see..."
4406 elif test `echo abc | $tr a-z A-Z` = Abc ; then
4407 xxx=`./loc addbib blurfl $pth`
4408 if $test -f $xxx; then
4409 echo "Looks kind of like a USG system with BSD features, but we'll see..."
4413 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
4414 echo "Looks kind of like an extended USG system, but we'll see..."
4416 echo "Looks kind of like a USG system, but we'll see..."
4420 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
4421 echo "Looks kind of like a BSD system, but we'll see..."
4425 echo "Looks kind of like a Version 7 system, but we'll see..."
4428 case "$eunicefix" in
4431 There is, however, a strange, musty smell in the air that reminds me of
4432 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
4436 : it so happens the Eunice I know will not run shell scripts in Unix format
4440 echo "Congratulations. You aren't running Eunice."
4444 : Detect OS2. The p_ variable is set above in the Head.U unit.
4445 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
4446 : semicolon as a patch separator
4451 I have the feeling something is not exactly right, however...don't tell me...
4452 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
4453 (Or you may be running DOS with DJGPP.)
4458 if test -f /xenix; then
4459 echo "Actually, this looks more like a XENIX system..."
4464 echo "It's not Xenix..."
4469 if test -f /venix; then
4470 echo "Actually, this looks more like a VENIX system..."
4477 echo "Nor is it Venix..."
4480 chmod +x bsd usg v7 osf1 eunice xenix venix os2
4481 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
4484 : Check if we are using GNU gcc and what its version is
4486 echo "Checking for GNU cc in disguise and/or its version number..." >&4
4490 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
4492 printf("%s\n", __VERSION__);
4494 printf("%s\n", "1");
4500 if $cc -o try $ccflags $ldflags try.c; then
4501 gccversion=`$run ./try`
4502 case "$gccversion" in
4503 '') echo "You are not using GNU cc." ;;
4504 *) echo "You are using GNU cc $gccversion."
4510 echo "*** WHOA THERE!!! ***" >&4
4511 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
4512 case "$knowitall" in
4514 echo " You'd better start hunting for one and let me know about it." >&4
4520 case "$gccversion" in
4521 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
4523 case "$gccversion" in
4524 '') gccosandvers='' ;;
4525 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
4526 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
4528 case "$gccosandvers" in
4529 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
4530 $osname$osvers) ;; # looking good
4531 $osname*) cat <<EOM >&4
4533 *** WHOA THERE!!! ***
4535 Your gcc has not been compiled for the exact release of
4536 your operating system ($gccosandvers versus $osname$osvers).
4538 In general it is a good idea to keep gcc synchronized with
4539 the operating system because otherwise serious problems
4540 may ensue when trying to compile software, like Perl.
4542 I'm trying to be optimistic here, though, and will continue.
4543 If later during the configuration and build icky compilation
4544 problems appear (headerfile conflicts being the most common
4545 manifestation), I suggest reinstalling the gcc to match
4546 your operating system release.
4550 *) gccosandvers='' ;; # failed to parse, better be silent
4558 # gcc 3.* complain about adding -Idirectories that they already know about,
4559 # so we will take those off from locincpth.
4560 case "$gccversion" in
4562 echo "main(){}">try.c
4563 for incdir in $locincpth; do
4564 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
4565 grep '^c[cp]p*[01]: warning: changing search order '`
4566 if test "X$warn" != X; then
4567 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
4573 : What should the include directory be ?
4575 $echo $n "Hmm... $c"
4579 if $test -f /bin/mips && /bin/mips; then
4580 echo "Looks like a MIPS system..."
4581 $cat >usr.c <<'EOCP'
4582 #ifdef SYSTYPE_BSD43
4586 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4587 dflt='/bsd43/usr/include'
4591 mips_type='System V'
4593 $rm -f usr.c usr.out
4594 echo "and you're compiling with the $mips_type compiler and libraries."
4598 echo "Doesn't look like a MIPS system."
4608 case "$xxx_prompt" in
4611 rp='Where are the include files you want to use?'
4619 : see how we invoke the C preprocessor
4621 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4622 cat <<'EOT' >testcpp.c
4628 if test ! -f cppstdin; then
4629 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4630 # AIX cc -E doesn't show the absolute headerfile
4631 # locations but we'll cheat by using the -M flag.
4632 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
4634 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4637 echo "Keeping your $hint cppstdin wrapper."
4640 wrapper=`pwd`/cppstdin
4644 if $test "X$cppstdin" != "X" && \
4645 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4646 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4648 echo "You used to use $cppstdin $cppminus so we'll use that again."
4650 '') echo "But let's see if we can live without a wrapper..." ;;
4652 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4653 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4655 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4658 echo "(However, $cpprun $cpplast does not work, let's see...)"
4666 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4673 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4674 $cc -E <testcpp.c >testcpp.out 2>&1; \
4675 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4676 echo "Yup, it does."
4679 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4680 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4681 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4682 echo "Yup, it does."
4685 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4686 $cc -P <testcpp.c >testcpp.out 2>&1; \
4687 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4688 echo "Yipee, that works!"
4691 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4692 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4693 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4694 echo "At long last!"
4697 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4698 $cpp <testcpp.c >testcpp.out 2>&1; \
4699 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4703 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4704 $cpp - <testcpp.c >testcpp.out 2>&1; \
4705 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4706 echo "Hooray, it works! I was beginning to wonder."
4709 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4710 $wrapper <testcpp.c >testcpp.out 2>&1; \
4711 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4717 rp="No dice. I can't find a C preprocessor. Name one:"
4721 $x_cpp <testcpp.c >testcpp.out 2>&1
4722 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4723 echo "OK, that will do." >&4
4725 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4740 echo "Perhaps can we force $cc -E using a wrapper..."
4741 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4742 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4748 echo "Nope, we'll have to live without it..."
4762 "$wrapper"|'cppstdin') ;;
4763 *) $rm -f $wrapper;;
4765 $rm -f testcpp.c testcpp.out
4767 : Set private lib path
4770 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4775 '') dlist="$loclibpth $plibpth $glibpth";;
4776 *) dlist="$libpth";;
4779 : Now check and see which directories actually exist, avoiding duplicates
4783 if $test -d $xxx; then
4786 *) libpth="$libpth $xxx";;
4792 Some systems have incompatible or broken versions of libraries. Among
4793 the directories listed in the question below, please remove any you
4794 know not to be holding relevant libraries, and add any that are needed.
4795 Say "none" for none.
4806 rp="Directories to use for library searches?"
4813 : compute shared library extension
4816 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4826 On some systems, shared libraries may be available. Answer 'none' if
4827 you want to suppress searching of shared libraries for the remainder
4828 of this configuration.
4831 rp='What is the file extension used for shared libraries?'
4835 : Define several unixisms.
4836 : Hints files or command line option can be used to override them.
4837 : The convoluted testing is in case hints files set either the old
4840 '') case "$exe_ext" in
4842 *) _exe="$exe_ext" ;;
4847 '') case "$lib_ext" in
4854 '') case "$obj_ext" in
4861 '') case "$path_sep" in
4872 rm_try="$rm -f try try$_exe a.out .out try.[cho] try.$_o core core.try* try.core*"
4874 : Which makefile gets called first. This is used by make depend.
4875 case "$firstmakefile" in
4876 '') firstmakefile='makefile';;
4879 : Check for uselongdouble support
4881 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
4884 case "$uselongdouble" in
4885 $define|true|[yY]*) dflt='y';;
4890 Perl can be built to take advantage of long doubles which
4891 (if available) may give more accuracy and range for floating point numbers.
4893 If this doesn't make any sense to you, just accept the default '$dflt'.
4895 rp='Try to use long doubles if available?'
4898 y|Y) val="$define" ;;
4904 case "$uselongdouble" in
4905 true|[yY]*) uselongdouble="$define" ;;
4908 : Look for a hint-file generated 'call-back-unit'. If the
4909 : user has specified that long doubles should be used,
4910 : we may need to set or change some other defaults.
4911 if $test -f uselongdouble.cbu; then
4912 echo "Your platform has some specific hints regarding long doubles, using them..."
4913 . ./uselongdouble.cbu
4915 case "$uselongdouble" in
4918 (Your platform does not have any specific hints for long doubles.)
4924 : Looking for optional libraries
4926 echo "Checking for optional libraries..." >&4
4931 case "$libswanted" in
4932 '') libswanted='c_s';;
4935 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
4941 for thisdir in $libpth $xlibpth; do
4942 test -d $thisdir && libspath="$libspath $thisdir"
4944 for thislib in $libswanted; do
4945 for thisdir in $libspath; do
4947 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4948 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
4949 $test -f "$xxx" && eval $libscheck
4950 $test -f "$xxx" && libstyle=shared
4952 if test ! -f "$xxx"; then
4953 xxx=$thisdir/lib$thislib.$so
4954 $test -f "$xxx" && eval $libscheck
4955 $test -f "$xxx" && libstyle=shared
4957 if test ! -f "$xxx"; then
4958 xxx=$thisdir/lib$thislib$_a
4959 $test -f "$xxx" && eval $libscheck
4960 $test -f "$xxx" && libstyle=static
4962 if test ! -f "$xxx"; then
4963 xxx=$thisdir/$thislib$_a
4964 $test -f "$xxx" && eval $libscheck
4965 $test -f "$xxx" && libstyle=static
4967 if test ! -f "$xxx"; then
4968 xxx=$thisdir/lib${thislib}_s$_a
4969 $test -f "$xxx" && eval $libscheck
4970 $test -f "$xxx" && libstyle=static
4971 $test -f "$xxx" && thislib=${thislib}_s
4973 if test ! -f "$xxx"; then
4974 xxx=$thisdir/Slib$thislib$_a
4975 $test -f "$xxx" && eval $libscheck
4976 $test -f "$xxx" && libstyle=static
4978 if $test -f "$xxx"; then
4980 shared) echo "Found -l$thislib (shared)." ;;
4981 static) echo "Found -l$thislib." ;;
4982 *) echo "Found -l$thislib ($libstyle)." ;;
4986 *) dflt="$dflt -l$thislib"
4987 libsfound="$libsfound $xxx"
4989 libsfiles="$libsfiles $yyy"
4990 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
4991 case " $libsdirs " in
4993 *) libsdirs="$libsdirs $yyy" ;;
5000 if $test ! -f "$xxx"; then
5001 echo "No -l$thislib."
5012 ' '|'') dflt='none';;
5017 In order to compile $package on your machine, a number of libraries
5018 are usually needed. Include any other special libraries here as well.
5019 Say "none" for none. The default list is almost always right.
5023 rp="What libraries to use?"
5030 : determine optimization, if desired, or use for debug flag also
5032 ' '|$undef) dflt='none';;
5034 *) dflt="$optimize";;
5038 By default, $package compiles with the -O flag to use the optimizer.
5039 Alternately, you might want to use the symbolic debugger, which uses
5040 the -g flag (on traditional Unix systems). Either flag can be
5041 specified here. To use neither flag, specify the word "none".
5044 rp="What optimizer/debugger flag should be used?"
5048 'none') optimize=" ";;
5051 : Check what DEBUGGING is required from the command line
5052 : -DEBUGGING or -DDEBUGGING or
5053 : -DEBUGGING=both = -g + -DDEBUGGING
5054 : -DEBUGGING=-g or -Doptimize=-g = -g
5055 : -DEBUGGING=none or -UDEBUGGING =
5056 : -DEBUGGING=old or -DEBUGGING=default = ? $optimize
5059 *) DEBUGGING=$EBUGGING ;;
5062 case "$DEBUGGING" in
5066 *) optimize="$optimize -g" ;;
5070 *-g*) set `echo "X $optimize " | sed 's/ -g / /'`
5078 case "$DEBUGGING" in
5079 both|$define) dflt='-DDEBUGGING'
5082 : argument order is deliberate, as the flag will start with - which set could
5083 : think is an option
5084 checkccflag='check=$1; flag=$2; callback=$3;
5086 echo "Checking if your compiler accepts $flag" 2>&1;
5087 echo "int main(void) { return 0; }" > gcctest.c;
5088 if $cc -O2 $flag -o gcctest gcctest.c 2>gcctest.out && ./gcctest; then
5089 echo "Yes, it does." 2>&1;
5090 if $test -s gcctest.out ; then
5091 echo "But your platform does not like it:";
5096 echo "Leaving current flags $ccflags alone." 2>&1
5098 *) dflt="$dflt $flag";
5104 echo "Nope, it does not, but that is ok." 2>&1;
5108 : We will not override a previous value, but we might want to
5109 : augment a hint file
5111 default|recommended)
5112 case "$gccversion" in
5113 1*) dflt="$dflt -fpcc-struct-return" ;;
5115 case "$optimize:$DEBUGGING" in
5116 *-g*:old) dflt="$dflt -DDEBUGGING";;
5118 case "$gccversion" in
5119 2*) if $test -d /etc/conf/kconfig.d &&
5120 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
5122 # Interactive Systems (ISC) POSIX mode.
5127 case "$gccversion" in
5130 ?*) set strict-aliasing -fno-strict-aliasing
5134 # For gcc, adding -pipe speeds up compilations for some, but apparently
5135 # some assemblers can't read from stdin. (It also slows down compilations
5136 # in other cases, but those are apparently rarer these days.) AD 5/2004.
5137 case "$gccversion" in
5143 # on x86_64 (at least) we require an extra library (libssp) in the
5144 # link command line. This library is not named, so I infer that it is
5145 # an implementation detail that may change. Hence the safest approach
5146 # is to add the flag to the flags passed to the compiler at link time,
5147 # as that way the compiler can do the right implementation dependant
5149 case "$gccversion" in
5150 ?*) set stack-protector -fstack-protector
5157 case "$mips_type" in
5158 *BSD*|'') inclwanted="$locincpth $usrinc";;
5159 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
5161 for thisincl in $inclwanted; do
5162 if $test -d $thisincl; then
5163 if $test x$thisincl != x$usrinc; then
5165 *" -I$thisincl "*);;
5166 *) dflt="$dflt -I$thisincl ";;
5172 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
5174 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
5182 *) dflt="$dflt -D$2";;
5186 set signal.h LANGUAGE_C; eval $inctest
5190 ccflags="$ccflags -DSOCKS"
5195 default|recommended) dflt="$ccflags $dflt" ;;
5196 *) dflt="$ccflags";;
5205 Your C compiler may want other flags. For this question you should include
5206 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
5207 but you should NOT include libraries or ld flags like -lwhatever. If you
5208 want $package to honor its debug switch, you should include -DDEBUGGING here.
5209 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
5211 To use no flags, specify the word "none".
5217 rp="Any additional cc flags?"
5224 : the following weeds options from ccflags that are of no interest to cpp
5226 '') cppflags="$ccflags" ;;
5227 *) cppflags="$cppflags $ccflags" ;;
5229 case "$gccversion" in
5230 1*) cppflags="$cppflags -D__GNUC__"
5232 case "$mips_type" in
5234 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
5240 echo "Let me guess what the preprocessor flags are..." >&4
5254 *) ftry="$previous $flag";;
5256 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
5257 >cpp1.out 2>/dev/null && \
5258 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
5259 >cpp2.out 2>/dev/null && \
5260 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
5261 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
5263 cppflags="$cppflags $ftry"
5273 *-*) echo "They appear to be: $cppflags";;
5275 $rm -f cpp.c cpp?.out
5279 : flags used in final linking phase
5281 '') if ./venix; then
5287 *-posix*) dflt="$dflt -posix" ;;
5290 *) dflt="$ldflags";;
5292 # See note above about -fstack-protector
5294 *-fstack-protector*)
5296 *-fstack-protector*) ;; # Don't add it again
5297 *) dflt="$dflt -fstack-protector" ;;
5302 : Try to guess additional flags to pick up local libraries.
5303 for thislibdir in $libpth; do
5304 case " $loclibpth " in
5307 *"-L$thislibdir "*) ;;
5308 *) dflt="$dflt -L$thislibdir" ;;
5320 Your C linker may need flags. For this question you should
5321 include -L/whatever and any other flags used by the C linker, but you
5322 should NOT include libraries like -lwhatever.
5324 Make sure you include the appropriate -L/path flags if your C linker
5325 does not normally search all of the directories you specified above,
5328 To use no flags, specify the word "none".
5332 rp="Any additional ld flags (NOT including libraries)?"
5338 rmlist="$rmlist pdp11"
5342 echo "Checking your choice of C compiler and flags for coherency..." >&4
5343 $cat > try.c <<'EOF'
5345 int main() { printf("Ok\n"); return(0); }
5347 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
5349 $cat >try.msg <<'EOM'
5350 I've tried to compile and run the following simple program:
5353 $cat try.c >> try.msg
5355 $cat >> try.msg <<EOM
5362 and I got the following output:
5366 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5367 if $sh -c "$run ./try " >>try.msg 2>&1; then
5371 *) echo 'The program compiled OK, but produced no output.' >> try.msg
5374 cat >> try.msg <<'EOQS'
5375 If $libs contains -lsfio, and sfio is mis-configured, then it
5376 sometimes (apparently) runs and exits with a 0 status, but with no
5377 output! It may have to do with sfio's use of _exit vs. exit.
5380 rp="You have a big problem. Shall I abort Configure"
5387 echo "The program compiled OK, but exited with status $?." >>try.msg
5388 rp="You have a problem. Shall I abort Configure"
5392 echo "I can't compile the test program." >>try.msg
5393 rp="You have a BIG problem. Shall I abort Configure"
5399 case "$knowitall" in
5401 echo "(The supplied flags or libraries might be incorrect.)"
5409 *) echo "Ok. Stopping Configure." >&4
5414 n) echo "OK, that should do.";;
5416 $rm_try gcctest gcctest.out
5418 : define a shorthand compile call
5422 case "$usedevel" in $define|true|[yY]*) if $test ! -f "${mc_file}.c"; then
5423 echo "Internal Configure script bug - compiler test file ${mc_file}.c is missing. Please report this to perlbug@perl.org" >&4;
5427 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5428 : define a shorthand compile call for compilations that should be ok.
5432 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5434 : determine filename position in cpp output
5436 echo "Computing filename position in cpp output for #include directives..." >&4
5438 vos) testaccess=-e ;;
5441 echo '#include <stdio.h>' > foo.c
5444 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5445 $grep '^[ ]*#.*stdio\.h' | \
5446 while read cline; do
5449 while $test \$# -gt 0; do
5450 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5455 pos=\`expr \$pos + 1\`
5467 *) pos="${fieldn}th";;
5469 echo "Your cpp writes the filename in the $pos field of the line."
5472 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
5473 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
5476 : locate header file
5481 for usrincdir in $usrinc
5483 if test -f \$usrincdir/\$wanted; then
5484 echo "\$usrincdir/\$wanted"
5488 awkprg='{ print \$$fieldn }'
5489 echo "#include <\$wanted>" > foo\$\$.c
5490 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5491 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5492 while read cline; do
5493 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5495 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5496 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5501 # status = 0: grep returned 0 lines, case statement not executed
5502 # status = 1: headerfile found
5503 # status = 2: while loop executed, no headerfile found
5507 if test \$status -eq 1; then
5514 : define an alternate in-header-list? function
5515 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5516 cont=true; xxf="echo \"<\$1> found.\" >&4";
5517 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5518 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5520 case $# in 4) instead=instead;; *) instead="at last";; esac;
5521 while $test "$cont"; do
5523 var=$2; eval "was=\$$2";
5524 if $test "$xxx" && $test -r "$xxx";
5526 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5529 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5530 set $yyy; shift; shift; yyy=$@;
5531 case $# in 0) cont="";;
5532 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5533 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5534 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5535 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5539 do set $yyy; var=$2; eval "was=\$$2";
5540 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5541 set $yyy; shift; shift; yyy=$@;
5544 : see if stdlib is available
5545 set stdlib.h i_stdlib
5548 : check for lengths of integral types
5552 echo "Checking to see how big your integers are..." >&4
5561 printf("intsize=%d;\n", (int)sizeof(int));
5562 printf("longsize=%d;\n", (int)sizeof(long));
5563 printf("shortsize=%d;\n", (int)sizeof(short));
5568 if eval $compile_ok && $run ./try > /dev/null; then
5570 echo "Your integers are $intsize bytes long."
5571 echo "Your long integers are $longsize bytes long."
5572 echo "Your short integers are $shortsize bytes long."
5576 Help! I can't compile and run the intsize test program: please enlighten me!
5577 (This is probably a misconfiguration in your system or libraries, and
5578 you really ought to fix it. Still, I'll try anyway.)
5582 rp="What is the size of an integer (in bytes)?"
5586 rp="What is the size of a long integer (in bytes)?"
5590 rp="What is the size of a short integer (in bytes)?"
5598 : check for long long
5600 echo "Checking to see if you have long long..." >&4
5601 echo 'int main() { long long x = 7; return 0; }' > try.c
5603 if eval $compile; then
5605 echo "You have long long."
5608 echo "You do not have long long."
5614 : check for length of long long
5615 case "${d_longlong}${longlongsize}" in
5618 echo "Checking to see how big your long longs are..." >&4
5619 $cat >try.c <<'EOCP'
5623 printf("%d\n", (int)sizeof(long long));
5628 if eval $compile_ok; then
5629 longlongsize=`$run ./try`
5630 echo "Your long longs are $longlongsize bytes long."
5634 echo "(I can't seem to compile the test program. Guessing...)"
5635 rp="What is the size of a long long (in bytes)?"
5639 if $test "X$longsize" = "X$longlongsize"; then
5640 echo "(That isn't any different from an ordinary long.)"
5646 : see if inttypes.h is available
5647 : we want a real compile instead of Inhdr because some systems
5648 : have an inttypes.h which includes non-existent headers
5651 #include <inttypes.h>
5653 static int32_t foo32 = 0x12345678;
5657 if eval $compile; then
5658 echo "<inttypes.h> found." >&4
5661 echo "<inttypes.h> NOT found." >&4
5670 echo "Checking to see if you have int64_t..." >&4
5672 #include <sys/types.h>
5673 #$i_inttypes I_INTTYPES
5675 #include <inttypes.h>
5677 int main() { int64_t x = 7; }
5680 if eval $compile; then
5682 echo "You have int64_t."
5685 echo "You do not have int64_t."
5691 : Check if 64bit ints have a quad type
5693 echo "Checking which 64-bit integer type we could use..." >&4
5699 val='"unsigned int"'
5704 *) case "$longsize" in
5708 val='"unsigned long"'
5713 *) case "$d_longlong:$longlongsize" in
5718 val='"unsigned long long"'
5723 *) case "$d_int64_t" in
5742 '') echo "Alas, no 64-bit integer types in sight." >&4
5745 *) echo "We could use '$quadtype' for 64-bit integers." >&4
5750 : Do we want 64bit support
5751 case "$uselonglong" in
5752 "$define"|true|[yY]*)
5755 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
5757 use64bitint="$define"
5760 case "$use64bits" in
5761 "$define"|true|[yY]*)
5764 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
5766 use64bitint="$define"
5769 case "$use64bitints" in
5770 "$define"|true|[yY]*)
5773 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
5775 use64bitint="$define"
5778 case "$use64bitsint" in
5779 "$define"|true|[yY]*)
5782 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
5784 use64bitint="$define"
5787 case "$uselonglongs" in
5788 "$define"|true|[yY]*)
5791 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
5793 use64bitint="$define"
5796 case "$use64bitsall" in
5797 "$define"|true|[yY]*)
5800 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
5802 use64bitall="$define"
5807 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
5809 case "$use64bitall" in
5810 "$define"|true|[yY]*) use64bitint="$define" ;;
5816 You have natively 64-bit long integers.
5820 *) case "$use64bitint" in
5821 "$define"|true|[yY]*) dflt='y';;
5830 Perl can be built to take advantage of 64-bit integer types
5831 on some systems. To do so, Configure can be run with -Duse64bitint.
5832 Choosing this option will most probably introduce binary incompatibilities.
5834 If this doesn't make any sense to you, just accept the default '$dflt'.
5835 (The default has been chosen based on your configuration.)
5837 rp='Try to use 64-bit integers, if available?'
5840 [yY]*) val="$define" ;;
5848 case "$use64bitall" in
5849 "$define"|true|[yY]*) dflt='y' ;;
5850 *) case "$longsize" in
5858 You may also choose to try maximal 64-bitness. It means using as much
5859 64-bitness as possible on the platform. This in turn means even more
5860 binary incompatibilities. On the other hand, your platform may not
5861 have any more 64-bitness available than what you already have chosen.
5863 If this doesn't make any sense to you, just accept the default '$dflt'.
5864 (The default has been chosen based on your configuration.)
5866 rp='Try to use maximal 64-bit support, if available?'
5869 [yY]*) val="$define" ;;
5874 case "$use64bitall" in
5876 case "$use64bitint" in
5880 Since you have chosen a maximally 64-bit build, I'm also turning on
5881 the use of 64-bit integers.
5883 use64bitint="$define" ;;
5888 : Look for a hint-file generated 'call-back-unit'. If the
5889 : user has specified that a 64-bit perl is to be built,
5890 : we may need to set or change some other defaults.
5891 if $test -f use64bitint.cbu; then
5892 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
5895 case "$use64bitint" in
5896 "$define"|true|[yY]*)
5898 4) case "$archname64" in
5899 '') archname64=64int ;;
5906 : Look for a hint-file generated 'call-back-unit'. If the
5907 : user has specified that a maximally 64-bit perl is to be built,
5908 : we may need to set or change some other defaults.
5909 if $test -f use64bitall.cbu; then
5910 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
5913 case "$use64bitall" in
5914 "$define"|true|[yY]*)
5916 4) case "$archname64" in
5917 ''|64int) archname64=64all ;;
5924 case "$d_quad:$use64bitint" in
5928 *** You have chosen to use 64-bit integers,
5929 *** but none can be found.
5930 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
5931 *** Cannot continue, aborting.
5938 : check for length of double
5940 case "$doublesize" in
5942 echo "Checking to see how big your double precision numbers are..." >&4
5951 printf("%d\n", (int)sizeof(double));
5956 if eval $compile_ok; then
5957 doublesize=`$run ./try`
5958 echo "Your double is $doublesize bytes long."
5961 echo "(I can't seem to compile the test program. Guessing...)"
5962 rp="What is the size of a double precision number (in bytes)?"
5970 : check for long doubles
5972 echo "Checking to see if you have long double..." >&4
5973 echo 'int main() { long double x = 7.0; }' > try.c
5975 if eval $compile; then
5977 echo "You have long double."
5980 echo "You do not have long double."
5986 : check for length of long double
5987 case "${d_longdbl}${longdblsize}" in
5990 echo "Checking to see how big your long doubles are..." >&4
5991 $cat >try.c <<'EOCP'
5995 printf("%d\n", sizeof(long double));
6000 if eval $compile; then
6001 longdblsize=`$run ./try`
6002 echo "Your long doubles are $longdblsize bytes long."
6006 echo "(I can't seem to compile the test program. Guessing...)" >&4
6007 rp="What is the size of a long double (in bytes)?"
6011 if $test "X$doublesize" = "X$longdblsize"; then
6012 echo "That isn't any different from an ordinary double."
6013 echo "I'll keep your setting anyway, but you may see some"
6014 echo "harmless compilation warnings."
6020 : determine the architecture name
6022 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
6023 tarch=`arch`"-$osname"
6024 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
6025 if uname -m > tmparch 2>&1 ; then
6026 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
6027 -e 's/$/'"-$osname/" tmparch`
6035 case "$myarchname" in
6038 echo "(Your architecture name used to be $myarchname.)"
6042 case "$targetarch" in
6044 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
6049 *) dflt="$archname";;
6051 rp='What is your architecture name'
6054 case "$usethreads" in
6056 echo "Threads selected." >&4
6058 *-thread*) echo "...and architecture name already has -thread." >&4
6060 *) archname="$archname-thread"
6061 echo "...setting architecture name to $archname." >&4
6066 case "$usemultiplicity" in
6068 echo "Multiplicity selected." >&4
6070 *-multi*) echo "...and architecture name already has -multi." >&4
6072 *) archname="$archname-multi"
6073 echo "...setting architecture name to $archname." >&4
6078 case "$use64bitint$use64bitall" in
6080 case "$archname64" in
6082 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
6085 case "$use64bitint" in
6086 "$define") echo "64 bit integers selected." >&4 ;;
6088 case "$use64bitall" in
6089 "$define") echo "Maximal 64 bitness selected." >&4 ;;
6092 *-$archname64*) echo "...and architecture name already has $archname64." >&4
6094 *) archname="$archname-$archname64"
6095 echo "...setting architecture name to $archname." >&4
6101 case "$uselongdouble" in
6103 echo "Long doubles selected." >&4
6104 case "$longdblsize" in
6106 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
6110 *-ld*) echo "...and architecture name already has -ld." >&4
6112 *) archname="$archname-ld"
6113 echo "...setting architecture name to $archname." >&4
6120 case "$useperlio" in
6122 echo "Perlio selected." >&4
6125 echo "Perlio not selected, using stdio." >&4
6127 *-stdio*) echo "...and architecture name already has -stdio." >&4
6129 *) archname="$archname-stdio"
6130 echo "...setting architecture name to $archname." >&4
6135 if $test -f archname.cbu; then
6136 echo "Your platform has some specific hints for architecture name, using them..."
6140 : set the prefixit variable, to compute a suitable default value
6141 prefixit='case "$3" in
6143 case "$oldprefix" in
6144 "") eval "$1=\"\$$2\"";;
6151 ""|" ") eval "$1=\"\$$2\"";;
6157 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
6159 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
6160 /*-$oldprefix/*|\~*-$oldprefix/*)
6161 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
6162 *) eval "$1=\"\$$2\"";;
6166 : determine installation style
6167 : For now, try to deduce it from prefix unless it is already set.
6168 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
6169 case "$installstyle" in
6170 '') case "$prefix" in
6171 *perl*) dflt='lib';;
6172 *) dflt='lib/perl5' ;;
6175 *) dflt="$installstyle" ;;
6177 : Probably not worth prompting for this since we prompt for all
6178 : the directories individually, and the prompt would be too long and
6182 : determine where public executables go
6187 rp='Pathname where the public executables will reside?'
6189 if $test "X$ansexp" != "X$binexp"; then
6193 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
6194 : XXX If this is fixed, also fix the "start perl" hunk below, which relies on
6195 : this via initialinstalllocation
6198 case "$userelocatableinc" in
6199 $define|true|[yY]*) dflt='y' ;;
6204 Would you like to build Perl so that the installation is relocatable, so that
6205 library paths in @INC are determined relative to the path of the perl binary?
6206 This is not advised for system Perl installs, or if you need to run setid
6207 scripts or scripts under taint mode.
6209 If this doesn't make any sense to you, just accept the default '$dflt'.
6211 rp='Use relocatable @INC?'
6214 y|Y) val="$define" ;;
6217 set userelocatableinc
6220 initialinstalllocation="$binexp"
6221 : Default prefix is now "up one level from where the binaries are"
6222 case "$userelocatableinc" in
6228 installprefixexp=".../.."
6232 : determine where private library files go
6233 : Usual default is /usr/local/lib/perl5/$version.
6234 : Also allow things like /opt/perl/lib/$version, since
6235 : /opt/perl/lib/perl5... would be redundant.
6236 : The default "style" setting is made in installstyle.U
6237 case "$installstyle" in
6238 *lib/perl5*) set dflt privlib lib/$package/$version ;;
6239 *) set dflt privlib lib/$version ;;
6244 There are some auxiliary files for $package that need to be put into a
6245 private library directory that is accessible by everyone.
6250 rp='Pathname where the private library files will reside?'
6255 : set the prefixup variable, to restore leading tilda escape
6256 prefixup='case "$prefixexp" in
6258 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
6261 : determine where public architecture dependent libraries go
6264 : privlib default is /usr/local/lib/$package/$version
6265 : archlib default is /usr/local/lib/$package/$version/$archname
6266 : privlib may have an optional trailing /share.
6267 tdflt=`echo $privlib | $sed 's,/share$,,'`
6268 tdflt=$tdflt/$archname
6277 $spackage contains architecture-dependent library files. If you are
6278 sharing libraries in a heterogeneous environment, you might store
6279 these files in a separate location. Otherwise, you can just include
6280 them with the rest of the public library files.
6285 rp='Where do you want to put the public architecture-dependent libraries?'
6289 if $test X"$archlib" = X"$privlib"; then
6295 : see if setuid scripts can be secure
6298 Some kernels have a bug that prevents setuid #! scripts from being
6299 secure. Some sites have disabled setuid #! scripts because of this.
6301 First let's decide if your kernel supports secure setuid #! scripts.
6302 (If setuid #! scripts would be secure but have been disabled anyway,
6303 don't say that they are secure if asked.)
6308 if $test -d /dev/fd; then
6309 echo "#!$ls" >reflect
6310 chmod +x,u+s reflect
6311 ./reflect >flect 2>&1
6312 if $contains "/dev/fd" flect >/dev/null; then
6313 echo "Congratulations, your kernel has secure setuid scripts!" >&4
6317 If you are not sure if they are secure, I can check but I'll need a
6318 username and password different from the one you are using right now.
6319 If you don't have such a username or don't want me to test, simply
6323 rp='Other username to test security of setuid scripts with?'
6328 case "$d_suidsafe" in
6329 '') echo "I'll assume setuid scripts are *not* secure." >&4
6332 echo "Well, the $hint value is *not* secure." >&4
6334 *) echo "Well, the $hint value *is* secure." >&4
6339 $rm -f reflect flect
6340 echo "#!$ls" >reflect
6341 chmod +x,u+s reflect
6344 echo '"su" will (probably) prompt you for '"$ans's password."
6345 su $ans -c './reflect >flect'
6346 if $contains "/dev/fd" flect >/dev/null; then
6347 echo "Okay, it looks like setuid scripts are secure." >&4
6350 echo "I don't think setuid scripts are secure." >&4
6355 rp='Does your kernel have *secure* setuid scripts?'
6358 [yY]*) val="$define";;
6363 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
6364 echo "(That's for file descriptors, not floppy disks.)"
6370 $rm -f reflect flect
6372 : now see if they want to do setuid emulation
6373 if $test $patchlevel -lt 11; then
6376 case "$d_suidsafe" in
6379 echo "No need to emulate SUID scripts since they are secure here." >&4
6383 Some systems have disabled setuid scripts, especially systems where
6384 setuid scripts cannot be secure. On systems where setuid scripts have
6385 been disabled, the setuid/setgid bits on scripts are currently
6386 useless. It is possible for $package to detect those bits and emulate
6387 setuid/setgid in a secure fashion. This emulation will only work if
6388 setuid scripts have been disabled in your kernel.
6392 "$define") dflt=y ;;
6395 rp="Do you want to do setuid/setgid emulation?"
6398 [yY]*) val="$define";;
6410 SUID emulation has been removed for 5.12
6411 Please re-run Configure without -Dd_dosuid
6420 : Find perl5.005 or later.
6421 echo "Looking for a previously installed perl5.005 or later... "
6423 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
6424 : Check if this perl is recent and can load a simple module
6425 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6428 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6438 '') echo "None found. That's ok.";;
6439 *) echo "Using $perl5." ;;
6442 : Set the siteprefix variables
6445 After $package is installed, you may wish to install various
6446 add-on modules and utilities. Typically, these add-ons will
6447 be installed under $prefix with the rest
6448 of this package. However, you may wish to install such add-ons
6449 elsewhere under a different prefix.
6451 If you do not wish to put everything under a single prefix, that's
6452 ok. You will be prompted for the individual locations; this siteprefix
6453 is only used to suggest the defaults.
6455 The default should be fine for most people.
6459 rp='Installation prefix to use for add-on modules and utilities?'
6460 : XXX Here might be another good place for an installstyle setting.
6461 case "$siteprefix" in
6463 *) dflt=$siteprefix ;;
6466 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6468 case "$siteprefix" in
6472 *) oldsiteprefix="$prefix";;
6477 siteprefixexp="$ansexp"
6479 : determine where site specific libraries go.
6480 : Usual default is /usr/local/lib/perl5/site_perl/$version
6481 : The default "style" setting is made in installstyle.U
6482 : XXX No longer works with Prefixit stuff.
6483 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6485 '') case "$installstyle" in
6486 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
6487 *) dflt=$siteprefix/lib/site_$prog/$version ;;
6495 The installation process will create a directory for
6496 site-specific extensions and modules. Most users find it convenient
6497 to place all site-specific files in this directory rather than in the
6498 main distribution directory.
6502 rp='Pathname for the site-specific library files?'
6506 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6508 : Determine list of previous versions to include in @INC
6509 $cat > getverlist <<EOPL
6512 \$api_versionstring = "$api_versionstring";
6513 \$version = "$version";
6514 \$stem = "$sitelib_stem";
6515 \$archname = "$archname";
6517 $cat >> getverlist <<'EOPL'
6518 # The list found is store twice for each entry: the original name, and
6519 # the binary broken down version as pack "sss", so sorting is easy and
6520 # unambiguous. This will work for all versions that have a maximum of
6521 # three digit groups, separate by '.'s or '_'s. Names are extended with
6522 # ".0.0" to ensure at least three elements for the pack.
6523 # -- H.Merijn Brand (m)'06 23-10-2006
6525 # Can't have leading @ because metaconfig interprets it as a command!
6526 ;@inc_version_list=();
6527 # XXX Redo to do opendir/readdir?
6530 ;@candidates = map {
6531 [ $_, pack "sss", split m/[._]/, "$_.0.0" ] } glob("5.*");
6537 ($pversion, $aversion, $vsn5005) = map {
6538 pack "sss", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005";
6539 foreach $d (@candidates) {
6540 if ($d->[1] lt $pversion) {
6541 if ($d->[1] ge $aversion) {
6542 unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]);
6544 elsif ($d->[1] ge $vsn5005) {
6545 unshift(@inc_version_list, grep { -d } $d->[0]);
6549 # Skip newer version. I.e. don't look in
6550 # 5.7.0 if we're installing 5.6.1.
6554 if (@inc_version_list) {
6555 print join(' ', @inc_version_list);
6558 # Blank space to preserve value for next Configure run.
6563 case "$inc_version_list" in
6564 '') if test -x "$perl5$exe_ext"; then
6565 dflt=`$perl5 getverlist`
6570 $undef) dflt='none' ;;
6571 *) eval dflt=\"$inc_version_list\" ;;
6574 ''|' ') dflt=none ;;
6581 In order to ease the process of upgrading, this version of perl
6582 can be configured to use modules built and installed with earlier
6583 versions of perl that were installed under $prefix. Specify here
6584 the list of earlier versions that this version of perl should check.
6585 If Configure detected no earlier versions of perl installed under
6586 $prefix, then the list will be empty. Answer 'none' to tell perl
6587 to not search earlier versions.
6589 The default should almost always be sensible, so if you're not sure,
6590 just accept the default.
6593 rp='List of earlier versions to include in @INC?'
6596 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
6597 *) inc_version_list="$ans" ;;
6599 case "$inc_version_list" in
6601 inc_version_list_init='0'
6602 d_inc_version_list="$undef"
6604 *) inc_version_list_init=`echo $inc_version_list |
6605 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
6606 d_inc_version_list="$define"
6611 : see if malloc/malloc.h has to be included
6612 set malloc/malloc.h i_mallocmalloc
6615 : see if this is a malloc.h system
6616 : we want a real compile instead of Inhdr because some systems have a
6617 : malloc.h that just gives a compile error saying to use stdlib.h instead
6622 #$i_mallocmalloc I_MALLOCMALLOC
6623 #ifdef I_MALLOCMALLOC
6624 # include <malloc/malloc.h>
6627 int main () { return 0; }
6630 if eval $compile; then
6631 echo "<malloc.h> found." >&4
6634 echo "<malloc.h> NOT found." >&4
6641 : check for void type
6643 echo "Checking to see how well your C compiler groks the void type..." >&4
6644 case "$voidflags" in
6656 extern void moo(); /* function returning void */
6657 void (*goo)(); /* ptr to func returning void */
6659 void *hue; /* generic ptr */
6672 int main() { sub(); }
6674 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
6675 voidflags=$defvoidused
6676 echo "Good. It appears to support void to the level $package wants.">&4
6677 if $contains warning .out >/dev/null 2>&1; then
6678 echo "However, you might get some warnings that look like this:"
6682 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
6683 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
6684 echo "It supports 1..."
6685 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
6686 echo "It also supports 2..."
6687 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
6689 echo "And it supports 4 but not 8 definitely."
6691 echo "It doesn't support 4..."
6692 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
6694 echo "But it supports 8."
6697 echo "Neither does it support 8."
6701 echo "It does not support 2..."
6702 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
6704 echo "But it supports 4 and 8."
6706 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
6708 echo "And it supports 4 but has not heard about 8."
6710 echo "However it supports 8 but not 4."
6715 echo "There is no support at all for void."
6720 case "$voidflags" in
6723 Support flag bits are:
6724 1: basic void declarations.
6725 2: arrays of pointers to functions returning void.
6726 4: operations between pointers to and addresses of void functions.
6727 8: generic void pointers.
6730 rp="Your void support flags add up to what?"
6737 : check for length of pointer
6741 echo "Checking to see how big your pointers are..." >&4
6742 if test "$voidflags" -gt 7; then
6743 echo '#define VOID_PTR char *' > try.c
6745 echo '#define VOID_PTR void *' > try.c
6755 printf("%d\n", (int)sizeof(VOID_PTR));
6760 if eval $compile_ok; then
6761 ptrsize=`$run ./try`
6762 echo "Your pointers are $ptrsize bytes long."
6765 echo "(I can't seem to compile the test program. Guessing...)" >&4
6766 rp="What is the size of a pointer (in bytes)?"
6773 case "$use64bitall" in
6774 "$define"|true|[yY]*)
6778 *** You have chosen a maximally 64-bit build,
6779 *** but your pointers are only 4 bytes wide.
6780 *** Please rerun Configure without -Duse64bitall.
6785 *** Since you have quads, you could possibly try with -Duse64bitint.
6790 *** Cannot continue, aborting.
6801 : determine whether to use malloc wrapping
6803 case "$usemallocwrap" in
6804 [yY]*|true|$define) dflt='y' ;;
6805 [nN]*|false|$undef) dflt='n' ;;
6806 *) case "$usedevel" in
6807 [yY]*|true|$define) dflt='y' ;;
6812 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
6814 usemallocwrap="$ans"
6817 usemallocwrap="$define" ;;
6819 usemallocwrap="$undef" ;;
6822 : determine which malloc to compile in
6824 case "$usemymalloc" in
6825 [yY]*|true|$define) dflt='y' ;;
6826 [nN]*|false|$undef) dflt='n' ;;
6827 *) case "$ptrsize" in
6833 rp="Do you wish to attempt to use the malloc that comes with $package?"
6839 mallocsrc='malloc.c'
6840 mallocobj="malloc$_o"
6841 d_mymalloc="$define"
6844 : Remove malloc from list of libraries to use
6845 echo "Removing unneeded -lmalloc from library list" >&4
6846 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
6849 echo "libs = $libs" >&4
6861 : compute the return types of malloc and free
6863 $cat >malloc.c <<END
6867 #include <sys/types.h>
6881 case "$malloctype" in
6883 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
6890 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
6894 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
6901 echo "Your system uses $freetype free(), it would seem." >&4
6903 : determine where site specific architecture-dependent libraries go.
6904 : sitelib default is /usr/local/lib/perl5/site_perl/$version
6905 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6906 : sitelib may have an optional trailing /share.
6908 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
6909 dflt="$dflt/$archname"
6914 set sitearch sitearch none
6918 The installation process will also create a directory for
6919 architecture-dependent site-specific extensions and modules.
6923 rp='Pathname for the site-specific architecture-dependent library files?'
6927 if $test X"$sitearch" = X"$sitelib"; then
6930 d_sitearch="$define"
6933 : Set the vendorprefix variables
6936 The installation process will also create a directory for
6937 vendor-supplied add-ons. Vendors who supply perl with their system
6938 may find it convenient to place all vendor-supplied files in this
6939 directory rather than in the main distribution directory. This will
6940 ease upgrades between binary-compatible maintenance versions of perl.
6942 Of course you may also use these directories in whatever way you see
6943 fit. For example, you might use them to access modules shared over a
6944 company-wide network.
6946 The default answer should be fine for most people.
6947 This causes further questions about vendor add-ons to be skipped
6948 and no vendor-specific directories will be configured for perl.
6951 rp='Do you want to configure vendor-specific add-on directories?'
6952 case "$usevendorprefix" in
6953 define|true|[yY]*) dflt=y ;;
6954 *) : User may have set vendorprefix directly on Configure command line.
6955 case "$vendorprefix" in
6964 rp='Installation prefix to use for vendor-supplied add-ons?'
6965 case "$vendorprefix" in
6967 *) dflt=$vendorprefix ;;
6970 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6972 case "$vendorprefix" in
6976 *) oldvendorprefix="$prefix";;
6980 usevendorprefix="$define"
6982 vendorprefixexp="$ansexp"
6984 *) usevendorprefix="$undef"
6990 : Set the vendorlib variables
6991 case "$vendorprefix" in
6992 '') d_vendorlib="$undef"
6996 *) d_vendorlib="$define"
6997 : determine where vendor-supplied modules go.
6998 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
6999 case "$vendorlib" in
7001 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7002 case "$installstyle" in
7003 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
7004 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
7007 *) dflt="$vendorlib"
7011 rp='Pathname for the vendor-supplied library files?'
7014 vendorlibexp="$ansexp"
7017 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
7021 : Set the vendorarch variables
7022 case "$vendorprefix" in
7023 '') d_vendorarch="$undef"
7027 *) d_vendorarch="$define"
7028 : determine where vendor-supplied architecture-dependent libraries go.
7029 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
7030 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
7031 : vendorlib may have an optional trailing /share.
7032 case "$vendorarch" in
7033 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
7034 dflt="$dflt/$archname"
7036 *) dflt="$vendorarch" ;;
7039 rp='Pathname for vendor-supplied architecture-dependent files?'
7042 vendorarchexp="$ansexp"
7045 prefixvar=vendorarch
7047 if $test X"$vendorarch" = X"$vendorlib"; then
7048 d_vendorarch="$undef"
7050 d_vendorarch="$define"
7053 : Final catch-all directories to search
7056 Lastly, you can have perl look in other directories for extensions and
7057 modules in addition to those already specified.
7058 These directories will be searched after
7062 test X"$vendorlib" != "X" && echo ' ' $vendorlib
7063 test X"$vendorarch" != "X" && echo ' ' $vendorarch
7065 case "$otherlibdirs" in
7066 ''|' ') dflt='none' ;;
7067 *) dflt="$otherlibdirs" ;;
7070 Enter a colon-separated set of extra paths to include in perl's @INC
7071 search path, or enter 'none' for no extra paths.
7075 rp='Colon-separated list of additional directories for perl to search?'
7078 ' '|''|none) otherlibdirs=' ' ;;
7079 *) otherlibdirs="$ans" ;;
7081 case "$otherlibdirs" in
7085 set d_perl_otherlibdirs
7088 : Cruising for prototypes
7090 echo "Checking out function prototypes..." >&4
7091 $cat >prototype.c <<EOCP
7096 int main(int argc, char *argv[]) {
7099 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
7100 echo "Your C compiler appears to support function prototypes."
7103 echo "Your C compiler doesn't seem to understand function prototypes."
7110 : Check if ansi2knr is required
7111 case "$prototype" in
7113 *) ansi2knr='ansi2knr'
7118 This version of $package can only be compiled by a compiler that
7119 understands function prototypes. Unfortunately, your C compiler
7121 doesn't seem to understand them. Sorry about that.
7123 If GNU cc is available for your system, perhaps you could try that instead.
7125 Eventually, we hope to support building Perl with pre-ANSI compilers.
7126 If you would like to help in that effort, please contact <perlbug@perl.org>.
7128 Aborting Configure now.
7135 dflt_dtrace='/usr/sbin/dtrace'
7138 Perl can be built to support DTrace on platforms that support it.
7139 DTrace is a diagnosis and performance analysis tool from Sun.
7141 If this doesn't make any sense to you, just accept the default '$dflt'.
7145 case "$usedtrace" in
7151 dflt_dtrace=$usedtrace
7158 rp='Support DTrace if available?'
7161 y|Y) val="$define" ;;
7167 test "X$usedtrace" != "X$define" && break
7170 rp='Where is the dtrace executable?'
7179 if $dtrace -h -s ../perldtrace.d \
7180 -o perldtrace.tmp >/dev/null 2>&1 \
7181 && rm -f perldtrace.tmp
7184 echo "Good: your $dtrace knows about the -h flag."
7188 *** $me: Fatal Error: $dtrace doesn't support -h flag
7190 *** Your installed dtrace doesn't support the -h switch to compile a D
7191 *** program into a C header. Can't continue.
7203 *** $me: Fatal Error: $dtrace not found.
7210 echo "*** $dtrace was not found."
7216 : See if we want extra modules installed
7223 Perl can be built with extra modules or bundles of modules which
7224 will be fetched from the CPAN and installed alongside Perl.
7226 Notice that you will need access to the CPAN; either via the Internet,
7227 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
7228 be asked later to configure the CPAN.pm module which will in turn do
7229 the installation of the rest of the extra modules or bundles.)
7231 Notice also that if the modules require any external software such as
7232 libraries and headers (the libz library and the zlib.h header for the
7233 Compress::Zlib module, for example) you MUST have any such software
7234 already installed, this configuration process will NOT install such
7237 If this doesn't make any sense to you, just accept the default '$dflt'.
7239 rp='Install any extra modules (y or n)?'
7245 Please list any extra modules or bundles to be installed from CPAN,
7246 with spaces between the names. The names can be in any format the
7247 'install' command of CPAN.pm will understand. (Answer 'none',
7248 without the quotes, to install no extra modules or bundles.)
7258 $rm -f ../extras.lst
7260 *) echo "(Saving the list of extras for later...)"
7261 echo "$extras" > ../extras.lst
7269 : determine where html pages for programs go
7270 set html1dir html1dir none
7274 If you wish to install html files for programs in $spackage, indicate
7275 the appropriate directory here. To skip installing html files,
7279 ''|none|$undef|' ') dflt=none ;;
7280 *) dflt=$html1dir ;;
7283 rp="Directory for the main $spackage html pages?"
7287 : Use ' ' for none so value is preserved next time through Configure
7288 $test X"$html1dir" = "X" && html1dir=' '
7290 : determine where html pages for libraries and modules go
7291 set html3dir html3dir none
7295 If you wish to install html files for modules associated with $spackage,
7296 indicate the appropriate directory here. To skip installing html files,
7299 : There is no obvious default. If they have specified html1dir, then
7300 : try to key off that, possibly changing .../html1 into .../html3.
7302 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
7303 *) dflt=$html3dir ;;
7306 rp="Directory for the $spackage module html pages?"
7310 : Use ' ' for none so value is preserved next time through Configure
7311 $test X"$html3dir" = "X" && html3dir=' '
7313 : determine whether to install perl also as /usr/bin/perl
7316 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
7318 Many scripts expect perl to be installed as /usr/bin/perl.
7320 If you want to, I can install the perl you are about to compile
7321 as /usr/bin/perl (in addition to $bin/perl).
7323 if test -f /usr/bin/perl; then
7326 However, please note that because you already have a /usr/bin/perl,
7327 overwriting that with a new Perl would very probably cause problems.
7328 Therefore I'm assuming you don't want to do that (unless you insist).
7331 case "$installusrbinperl" in
7332 "$define"|[yY]*) dflt='y';;
7338 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
7341 case "$installusrbinperl" in
7342 "$undef"|[nN]*) dflt='n';;
7346 rp="Do you want to install perl as /usr/bin/perl?"
7349 [yY]*) val="$define";;
7355 set installusrbinperl
7358 : Check if we are using the GNU C library
7360 echo "Checking for GNU C Library..." >&4
7362 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
7363 alone are insufficient to distinguish different versions, such as
7364 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
7365 libc version 2.1.0. A. Dougherty, June 3, 2002.
7371 # ifdef __GLIBC_MINOR__
7372 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus)
7373 # include <gnu/libc-version.h>
7374 printf("%s\n", gnu_get_libc_version());
7376 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
7379 printf("%d\n", __GLIBC__);
7388 if eval $compile_ok && $run ./try > glibc.ver; then
7390 gnulibc_version=`$cat glibc.ver`
7391 echo "You are using the GNU C Library version $gnulibc_version"
7395 echo "You are not using the GNU C Library"
7401 : see if nm is to be used to determine whether a symbol is defined or not
7405 case "$d_gnulibc" in
7408 echo "nm probably won't work on the GNU C Library." >&4
7414 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
7416 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
7417 echo "'nm' won't be sufficient on this sytem." >&4
7423 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
7424 if $test $dflt -gt 20; then
7434 true|$define) dflt=y;;
7441 I can use $nm to extract the symbols from your C libraries. This
7442 is a time consuming task which may generate huge output on the disk (up
7443 to 3 megabytes) but that should make the symbols extraction faster. The
7444 alternative is to skip the 'nm' extraction part and to compile a small
7445 test program instead to determine whether each symbol is present. If
7446 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
7447 this may be the best solution.
7449 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
7452 rp="Shall I use $nm to extract C symbols from the libraries?"
7455 [Nn]*) usenm=false;;
7464 : nm options which may be necessary
7466 '') if $test -f /mach_boot; then
7468 elif $test -d /usr/ccs/lib; then
7469 nm_opt='-p' # Solaris (and SunOS?)
7470 elif $test -f /dgux; then
7472 elif $test -f /lib64/rld; then
7473 nm_opt='-p' # 64-bit Irix
7479 : nm options which may be necessary for shared libraries but illegal
7480 : for archive libraries. Thank you, Linux.
7481 case "$nm_so_opt" in
7482 '') case "$myuname" in
7484 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
7485 nm_so_opt='--dynamic'
7492 : Figure out where the libc is located
7495 : get list of predefined functions in a handy place
7500 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
7506 *) for thislib in $libs; do
7509 : Handle C library specially below.
7512 thislib=`echo $thislib | $sed -e 's/^-l//'`
7513 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
7515 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
7517 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
7519 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
7521 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
7523 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
7525 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
7530 libnames="$libnames $try"
7532 *) libnames="$libnames $thislib" ;;
7541 for xxx in $libpth; do
7542 $test -r $1 || set $xxx/libc.$so
7543 : The messy sed command sorts on library version numbers.
7545 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
7546 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
7548 s/[0-9][0-9]*/0000&/g
7549 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
7552 $sort | $sed -e 's/^.* //'`
7555 $test -r $1 || set /usr/ccs/lib/libc.$so
7556 $test -r $1 || set /lib/libsys_s$_a
7562 if $test -r "$1"; then
7563 echo "Your (shared) C library seems to be in $1."
7565 elif $test -r /lib/libc && $test -r /lib/clib; then
7566 echo "Your C library seems to be in both /lib/clib and /lib/libc."
7568 libc='/lib/clib /lib/libc'
7569 if $test -r /lib/syslib; then
7570 echo "(Your math library is in /lib/syslib.)"
7571 libc="$libc /lib/syslib"
7573 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7574 echo "Your C library seems to be in $libc, as you said before."
7575 elif $test -r $incpath/usr/lib/libc$_a; then
7576 libc=$incpath/usr/lib/libc$_a;
7577 echo "Your C library seems to be in $libc. That's fine."
7578 elif $test -r /lib/libc$_a; then
7580 echo "Your C library seems to be in $libc. You're normal."
7582 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
7584 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
7585 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
7586 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
7588 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7590 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7593 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
7595 if $test -r "$tans"; then
7596 echo "Your C library seems to be in $tans, of all places."
7602 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7606 If the guess above is wrong (which it might be if you're using a strange
7607 compiler, or your machine supports multiple models), you can override it here.
7612 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
7614 I can't seem to find your C library. I've looked in the following places:
7617 $sed 's/^/ /' libpath
7620 None of these seems to contain your C library. I need to get its name...
7625 rp='Where is your C library?'
7630 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
7631 set X `cat libnames`
7634 case $# in 1) xxx=file; esac
7635 echo "Extracting names from the following $xxx for later perusal:" >&4
7637 $sed 's/^/ /' libnames >&4
7639 $echo $n "This may take a while...$c" >&4
7643 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
7644 *) $nm $nm_opt $file 2>/dev/null;;
7649 $grep fprintf libc.tmp > libc.ptf
7650 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
7651 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
7653 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
7655 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7657 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
7659 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7661 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
7663 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7665 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
7667 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7669 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
7671 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7673 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
7675 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7677 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
7678 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
7680 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7682 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
7684 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7686 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
7688 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7690 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
7692 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7694 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
7696 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7698 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
7700 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7702 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
7704 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7706 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
7708 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7711 $nm -p $* 2>/dev/null >libc.tmp
7712 $grep fprintf libc.tmp > libc.ptf
7713 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
7714 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
7720 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
7722 if $ar t $libc > libc.tmp && \
7723 $contains '^fprintf$' libc.tmp >/dev/null 2>&1
7725 for thisname in $libnames $libc; do
7726 $ar t $thisname >>libc.tmp
7728 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
7730 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
7731 for thisname in $libnames $libc; do
7732 $ar tv $thisname >>libc.tmp
7733 emximp -o tmp.imp $thisname \
7735 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
7736 < tmp.imp >>libc.tmp
7739 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
7742 echo "$ar didn't seem to work right." >&4
7743 echo "Maybe this is a Cray...trying bld instead..." >&4
7745 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list &&
7748 for thisname in $libnames; do
7750 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
7751 $ar t $thisname >>libc.tmp
7755 echo "That didn't work either. Giving up." >&4
7765 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
7766 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
7768 *) if $test -f /lib/syscalls.exp; then
7770 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
7771 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' \
7772 /lib/syscalls.exp >>libc.list
7778 $rm -f libnames libpath
7780 : see if dld is available
7784 : Check if we are using C++
7786 echo "Checking for C++..." >&4
7787 $cat >try.c <<'EOCP'
7799 if eval $compile_ok && $run ./try; then
7801 echo "You are using a C++ compiler."
7804 echo "You are not using a C++ compiler."
7810 : is a C symbol defined?
7813 -v) tf=libc.tmp; tdc="";;
7814 -a) tf=libc.tmp; tdc="[]";;
7815 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
7817 case "$d_cplusplus" in
7818 $define) extern_C="extern \"C\"" ;;
7819 *) extern_C="extern" ;;
7822 case "$reuseval-$4" in
7824 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
7829 if $test "$runnm" = true; then
7830 if $contains $tlook $tf >/dev/null 2>&1; then
7832 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
7833 echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7834 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
7835 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
7839 echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7840 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
7846 $define) tval=true;;
7853 : define an is-in-libc? function
7854 inlibc='echo " "; td=$define; tu=$undef;
7855 sym=$1; var=$2; eval "was=\$$2";
7857 case "$reuseval$was" in
7867 echo "$sym() found." >&4;
7868 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
7870 echo "$sym() NOT found." >&4;
7871 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
7875 $define) echo "$sym() found." >&4;;
7876 *) echo "$sym() NOT found." >&4;;
7880 : see if dlopen exists
7882 xxx_ccflags="$ccflags"
7884 : with g++ one needs -shared to get is-in-libc to work for dlopen
7885 case "$gccversion" in
7887 *) case "$d_cplusplus" in
7888 "$define") ccflags="$ccflags -shared" ;;
7895 ccflags="$xxx_ccflags"
7897 : see if this is a unistd.h system
7898 set unistd.h i_unistd
7901 : determine which dynamic loading, if any, to compile in
7903 dldir="ext/DynaLoader"
7916 $define) dflt='y' ;;
7919 $define) dflt='y' ;;
7921 : Does a dl_xxx.xs file exist for this operating system
7922 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
7925 rp="Do you wish to use dynamic loading?"
7932 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
7933 dflt="$dldir/dl_${osname}.xs"
7934 elif $test "$d_dlopen" = "$define" ; then
7935 dflt="$dldir/dl_dlopen.xs"
7936 elif $test "$i_dld" = "$define" ; then
7937 dflt="$dldir/dl_dld.xs"
7942 *) dflt="$dldir/$dlsrc"
7945 echo "The following dynamic loading files are available:"
7946 : Can not go over to $dldir because getfile has path hard-coded in.
7947 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
7948 rp="Source file to use for dynamic loading"
7954 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
7958 Some systems may require passing special flags to $cc -c to
7959 compile modules that will be used to create a shared library.
7960 To use no flags, say "none".
7963 case "$cccdlflags" in
7964 '') case "$gccversion" in
7965 '') case "$osname" in
7967 next) dflt='none' ;;
7968 irix*) dflt='-KPIC' ;;
7969 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
7970 sunos) dflt='-pic' ;;
7974 *) case "$osname" in
7975 darwin) dflt='none' ;;
7976 linux*|svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
7981 *) dflt="$cccdlflags" ;;
7983 rp="Any special flags to pass to $cc -c to compile shared library modules?"
7986 none) cccdlflags=' ' ;;
7987 *) cccdlflags="$ans" ;;
7992 Some systems use ld to create libraries that can be dynamically loaded,
7993 while other systems (such as those using ELF) use $cc.
7997 '') $cat >try.c <<EOM
7998 /* Test for whether ELF binaries are produced */
8010 int i = open("a.out",O_RDONLY);
8013 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
8014 exit(0); /* succeed (yes, it's ELF) */
8019 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
8021 You appear to have ELF support. I'll use $cc to build dynamic libraries.
8025 echo "I'll use ld to build dynamic libraries."
8034 rp="What command should be used to create dynamic libraries?"
8040 Some systems may require passing special flags to $ld to create a
8041 library that can be dynamically loaded. If your ld flags include
8042 -L/other/path options to locate libraries outside your loader's normal
8043 search path, you may need to specify those -L options here as well. To
8044 use no flags, say "none".
8047 case "$lddlflags" in
8048 '') case "$osname" in
8049 beos) dflt='-nostart' ;;
8050 haiku) dflt='-shared' ;;
8052 case "$gccversion" in
8053 '') dflt="$dflt +vnocompatwarnings" ;;
8056 linux|irix*|gnu*) dflt="-shared $optimize" ;;
8057 next) dflt='none' ;;
8058 solaris) dflt='-G' ;;
8059 sunos) dflt='-assert nodefinitions' ;;
8060 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
8064 *) dflt="$lddlflags" ;;
8067 : Try to guess additional flags to pick up local libraries.
8068 : Be careful not to append to a plain 'none'
8072 for thisflag in $ldflags; do
8077 *) dflt="$dflt $thisflag" ;;
8084 ''|' ') dflt='none' ;;
8088 *-fstack-protector*)
8090 *-fstack-protector*) ;; # Don't add it again
8091 *) dflt="$dflt -fstack-protector" ;;
8097 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
8100 none) lddlflags=' ' ;;
8101 *) lddlflags="$ans" ;;
8106 Some systems may require passing special flags to $cc to indicate that
8107 the resulting executable will use dynamic linking. To use no flags,
8111 case "$ccdlflags" in
8112 '') case "$osname" in
8113 linux|hpux|gnu*) dflt='-Wl,-E' ;;
8114 next|sunos) dflt='none' ;;
8118 *) dflt="$ccdlflags" ;;
8120 rp="Any special flags to pass to $cc to use dynamic linking?"
8123 none) ccdlflags=' ' ;;
8124 *) ccdlflags="$ans" ;;
8135 : Do we want a shared libperl?
8139 # No dynamic loading being used, so don't bother even to prompt.
8142 *) case "$useshrplib" in
8143 '') case "$osname" in
8144 svr4*|nonstopux|dgux|dynixptx|esix|powerux|beos|haiku|cygwin*)
8146 also='Building a shared libperl is required for dynamic loading to work on your system.'
8151 also='Building a shared libperl is needed for MAB support.'
8169 The perl executable is normally obtained by linking perlmain.c with
8170 libperl${_a}, any static extensions (usually just DynaLoader), and
8171 any other libraries needed on this system (such as -lm, etc.). Since
8172 your system supports dynamic loading, it is probably possible to build
8173 a shared libperl.$so. If you will have more than one executable linked
8174 to libperl.$so, this will significantly reduce the size of each
8175 executable, but it may have a noticeable effect on performance. The
8176 default is probably sensible for your system.
8180 rp="Build a shared libperl.$so (y/n)"
8184 useshrplib='true' ;;
8185 *) useshrplib='false' ;;
8190 case "$useshrplib" in
8192 case "$userelocatableinc" in
8194 echo "Cannot build with both -Duserelocatableinc and -Duseshrplib" >&4
8195 echo "See INSTALL for an explanation why that won't work." >&4
8201 # Figure out a good name for libperl.so. Since it gets stored in
8202 # a version-specific architecture-dependent library, the version
8203 # number isn't really that important, except for making cc/ld happy.
8205 # A name such as libperl.so.10.1
8206 majmin="libperl.$so.$patchlevel.$subversion"
8207 # A name such as libperl.so.100
8208 majonly=`echo $patchlevel $subversion |
8209 $awk '{printf "%d%02d", $1, $2}'`
8210 majonly=libperl.$so.$majonly
8211 # I'd prefer to keep the os-specific stuff here to a minimum, and
8212 # rely on figuring it out from the naming of libc.
8213 case "${osname}${osvers}" in
8216 # XXX How handle the --version stuff for MAB?
8218 linux*|gnu*) # ld won't link with a bare -lperl otherwise.
8221 cygwin*) # ld links now against the dll directly
8222 majmin="cygperl5_${patchlevel}_${subversion}.${so}"
8223 majonly=`echo $patchlevel $subversion |
8224 $awk '{printf "%03d%03d", $1, $2}'`
8225 majonly=cygperl5.$majonly.$so
8228 *) # Try to guess based on whether libc has major.minor.
8230 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
8231 *libc.$so.[0-9]*) dflt=$majonly ;;
8232 *) dflt=libperl.$so ;;
8242 I need to select a good name for the shared libperl. If your system uses
8243 library names with major and minor numbers, then you might want something
8244 like $majmin. Alternatively, if your system uses a single version
8245 number for shared libraries, then you might want to use $majonly.
8246 Or, your system might be quite happy with a simple libperl.$so.
8248 Since the shared libperl will get installed into a version-specific
8249 architecture-dependent directory, the version number of the shared perl
8250 library probably isn't important, so the default should be o.k.
8253 rp='What name do you want to give to the shared libperl?'
8256 echo "Ok, I'll use $libperl"
8259 libperl="libperl${_a}"
8263 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
8267 WARNING: Use of the shrpdir variable for the installation location of
8268 the shared $libperl is not supported. It was never documented and
8269 will not work in this version. Let me (perlbug@perl.org)
8270 know of any problems this may cause.
8276 But your current setting of $shrpdir is
8277 the default anyway, so it's harmless.
8282 Further, your current attempted setting of $shrpdir
8283 conflicts with the value of $archlibexp/CORE
8284 that installperl will use.
8291 # How will the perl executable find the installed shared $libperl?
8292 # Add $xxx to ccdlflags.
8293 # If we can't figure out a command-line option, use $shrpenv to
8294 # set env LD_RUN_PATH. The main perl makefile uses this.
8295 shrpdir=$archlibexp/CORE
8298 if "$useshrplib"; then
8301 # We'll set it in Makefile.SH...
8306 freebsd|netbsd|openbsd|interix|dragonfly)
8307 xxx="-Wl,-R$shrpdir"
8309 bsdos|linux|irix*|dec_osf|gnu*)
8310 xxx="-Wl,-rpath,$shrpdir"
8313 # next doesn't like the default...
8316 # beos doesn't like the default, either.
8319 # Haiku doesn't like the default, either.
8322 # hpux doesn't like the default, either.
8323 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
8326 # cygwin needs only ldlibpth
8329 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
8335 # Only add $xxx if it isn't already in ccdlflags.
8336 case " $ccdlflags " in
8338 *) ccdlflags="$ccdlflags $xxx"
8341 Adding $xxx to the flags
8342 passed to $ld so that the perl executable will find the
8343 installed shared $libperl.
8351 # Fix ccdlflags in AIX for building external extensions.
8352 # (For building Perl itself bare -bE:perl.exp is needed,
8353 # Makefile.SH takes care of this.)
8355 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8357 # Respect a hint or command-line value.
8359 '') shrpenv="$tmp_shrpenv" ;;
8361 case "$ldlibpthname" in
8362 '') ldlibpthname=LD_LIBRARY_PATH ;;
8363 none) ldlibpthname='' ;;
8366 : determine where manual pages are on this system
8370 syspath='/usr/share/man/man1 /usr/man/man1'
8371 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8372 syspath="$syspath /usr/man/u_man/man1"
8373 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8374 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8375 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8376 sysman=`./loc . /usr/man/man1 $syspath`
8379 if $test -d "$sysman"; then
8380 echo "System manual is in $sysman." >&4
8382 echo "Could not find manual pages in source form." >&4
8385 : determine where manual pages go
8386 set man1dir man1dir none
8390 $spackage has manual pages available in source form.
8394 echo "However, you don't have nroff, so they're probably useless to you."
8396 '') man1dir="none";;
8399 echo "If you don't want the manual sources installed, answer 'none'."
8404 lookpath="$prefixexp/share/man/man1"
8405 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8406 lookpath="$lookpath $prefixexp/man/p_man/man1"
8407 lookpath="$lookpath $prefixexp/man/u_man/man1"
8408 lookpath="$lookpath $prefixexp/man/man.1"
8410 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8411 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8421 rp="Where do the main $spackage manual pages (source) go?"
8423 if $test "X$man1direxp" != "X$ansexp"; then
8434 : What suffix to use on installed man pages
8441 rp="What suffix should be used for the main $spackage man pages?"
8443 '') case "$man1dir" in
8457 *) dflt="$man1ext";;
8464 : see if we can have long filenames
8466 first=123456789abcdef
8468 if (echo hi >$first) 2>/dev/null; then
8469 if $test -f 123456789abcde; then
8470 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8473 echo 'You can have filenames longer than 14 characters.'>&4
8478 You can't have filenames longer than 14 chars.
8479 You can't even think about them!
8485 $rm -rf 123456789abcde*
8487 : determine where library module manual pages go
8488 set man3dir man3dir none
8492 $spackage has manual pages for many of the library modules.
8498 However, you don't have nroff, so they're probably useless to you.
8501 '') man3dir="none";;
8505 case "$d_flexfnam" in
8508 However, your system can't handle the long file names like File::Basename.3.
8511 '') man3dir="none";;
8515 echo "If you don't want the manual sources installed, answer 'none'."
8516 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8518 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
8519 if $test -d "$privlib/man/man3"; then
8522 WARNING: Previous versions of perl installed man3 pages into
8523 $privlib/man/man3. This version will suggest a
8524 new default of $dflt.
8528 rp='Do you wish to preserve the old behavior?(y/n)'
8531 y*) dflt="$privlib/man/man3" ;;
8536 *) dflt="$man3dir" ;;
8543 rp="Where do the $package library man pages (source) go?"
8553 : What suffix to use on installed man pages
8559 rp="What suffix should be used for the $package library man pages?"
8561 '') case "$man3dir" in
8575 *) dflt="$man3ext";;
8582 : see if we have to deal with yellow pages, now NIS.
8583 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
8584 if $test -f /usr/etc/nibindd; then
8586 echo "I'm fairly confident you're on a NeXT."
8588 rp='Do you get the hosts file via NetInfo?'
8597 y*) hostcat='nidump hosts .';;
8598 *) case "$hostcat" in
8599 nidump*) hostcat='';;
8609 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
8617 rp='Are you getting the hosts file via yellow pages?'
8620 y*) hostcat='ypcat hosts';;
8621 *) hostcat='cat /etc/hosts';;
8627 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
8630 '') test -f /etc/group && groupcat='cat /etc/group';;
8633 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
8636 : now get the host name
8638 echo "Figuring out host name..." >&4
8639 case "$myhostname" in
8641 echo 'Maybe "hostname" will work...'
8642 if tans=`sh -c hostname 2>&1` ; then
8650 if $test "$cont"; then
8652 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
8653 if tans=`cat /etc/systemid 2>&1` ; then
8655 phostname='cat /etc/systemid'
8656 echo "Whadyaknow. Xenix always was a bit strange..."
8659 elif $test -r /etc/systemid; then
8660 echo "(What is a non-Xenix system doing with /etc/systemid?)"
8663 if $test "$cont"; then
8664 echo 'No, maybe "uuname -l" will work...'
8665 if tans=`sh -c 'uuname -l' 2>&1` ; then
8667 phostname='uuname -l'
8669 echo 'Strange. Maybe "uname -n" will work...'
8670 if tans=`sh -c 'uname -n' 2>&1` ; then
8672 phostname='uname -n'
8674 echo 'Oh well, maybe I can mine it out of whoami.h...'
8675 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
8676 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
8677 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
8679 case "$myhostname" in
8680 '') echo "Does this machine have an identity crisis or something?"
8683 echo "Well, you said $myhostname before..."
8684 phostname='echo $myhostname';;
8690 case "$myhostname" in
8691 '') myhostname=noname ;;
8693 : you do not want to know about this
8698 if $test "$myhostname" ; then
8700 rp='Your host name appears to be "'$myhostname'".'" Right?"
8708 : bad guess or no guess
8709 while $test "X$myhostname" = X ; do
8711 rp="Please type the (one word) name of your host:"
8716 : translate upper to lower if necessary
8717 case "$myhostname" in
8719 echo "(Normalizing case in your host name)"
8720 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
8724 case "$myhostname" in
8726 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
8727 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
8728 echo "(Trimming domain name from host name--host name is now $myhostname)"
8730 *) case "$mydomain" in
8733 test "X$hostcat" = "Xypcat hosts" &&
8734 ypmatch "$myhostname" hosts 2>/dev/null |\
8735 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
8738 test "X$hostcat" != "X" &&
8739 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
8740 /[ ]$myhostname[ . ]/p" > hosts
8743 if $test -f hosts; then
8744 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
8745 END { print sum }" hosts` = x1 || tmp_re="[ ]"
8746 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
8747 hosts | $sort | $uniq | \
8748 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
8749 case `$echo X$dflt` in
8750 X*\ *) echo "(Several hosts in the database matched hostname)"
8753 X.) echo "(You do not have fully-qualified names in the hosts database)"
8757 echo "(I cannot locate a hosts database anywhere)"
8762 tans=`./loc resolv.conf X /etc /usr/etc`
8763 if $test -f "$tans"; then
8764 echo "(Attempting domain name extraction from $tans)"
8765 dflt=.`$sed -n -e 's/ / /g' \
8766 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
8769 .) dflt=.`$sed -n -e 's/ / /g' \
8770 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
8778 .) echo "(No help from resolv.conf either -- attempting clever guess)"
8779 dflt=.`sh -c domainname 2>/dev/null`
8782 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
8786 case "$dflt$osname" in
8787 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
8788 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
8792 .) echo "(Lost all hope -- silly guess then)"
8798 *) dflt="$mydomain";;
8802 rp="What is your domain name?"
8812 : translate upper to lower if necessary
8815 echo "(Normalizing case in your domain name)"
8816 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
8820 : a little sanity check here
8821 case "$phostname" in
8824 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
8825 $myhostname$mydomain|$myhostname) ;;
8827 case "$phostname" in
8829 echo "(That doesn't agree with your whoami.h file, by the way.)"
8832 echo "(That doesn't agree with your $phostname command, by the way.)"
8840 : determine the e-mail address of the user who is running us
8843 I need to get your e-mail address in Internet format if possible, i.e.
8844 something like user@host.domain. Please answer accurately since I have
8845 no easy means to double check it. The default value provided below
8846 is most probably close to reality but may not be valid from outside
8847 your organization...
8851 while test "$cont"; do
8853 '') dflt="$cf_by@$myhostname$mydomain";;
8854 *) dflt="$cf_email";;
8856 rp='What is your e-mail address?'
8862 rp='Address does not look like an Internet one. Use it anyway?'
8876 : Ask e-mail of administrator
8879 If you or somebody else will be maintaining perl at your site, please
8880 fill in the correct e-mail address here so that they may be contacted
8881 if necessary. Currently, the "perlbug" program included with perl
8882 will send mail to this address in addition to perlbug@perl.org. You may
8883 enter "none" for no administrator.
8886 case "$perladmin" in
8887 '') dflt="$cf_email";;
8888 *) dflt="$perladmin";;
8890 rp='Perl administrator e-mail address'
8894 : determine whether to only install version-specific parts.
8897 Do you want to install only the version-specific parts of the perl
8898 distribution? Usually you do *not* want to do this.
8900 case "$versiononly" in
8901 "$define"|[Yy]*|true) dflt='y' ;;
8904 rp="Do you want to install only the version-specific parts of perl?"
8907 [yY]*) val="$define";;
8913 case "$versiononly" in
8914 "$define") inc_version_list=''
8915 inc_version_list_init=0
8919 : figure out how to guarantee perl startup
8920 : XXX Note that this currently takes advantage of the bug that binexp ignores
8921 : the Configure -Dinstallprefix setting, which in turn means that under
8922 : relocatable @INC, initialinstalllocation is what binexp started as.
8923 case "$startperl" in
8925 case "$sharpbang" in
8929 I can use the #! construct to start perl on your system. This will
8930 make startup of perl scripts faster, but may cause problems if you
8931 want to share those scripts and perl is not in a standard place
8932 ($initialinstalllocation/perl) on all your platforms. The alternative
8933 is to force a shell by starting the script with a single ':' character.
8936 case "$versiononly" in
8937 "$define") dflt="$initialinstalllocation/perl$version";;
8938 *) dflt="$initialinstalllocation/perl";;
8940 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
8943 none) startperl=": # use perl";;
8944 *) startperl="#!$ans"
8945 if $test 30 -lt `echo "$ans" | wc -c`; then
8948 WARNING: Some systems limit the #! command to 32 characters.
8949 If you experience difficulty running Perl scripts with #!, try
8950 installing Perl in a directory with a shorter pathname.
8956 *) startperl=": # use perl"
8961 echo "I'll use $startperl to start perl scripts."
8963 : figure best path for perl in scripts
8966 case "$versiononly" in
8967 "$define") perlpath="$initialinstalllocation/perl$version";;
8968 *) perlpath="$initialinstalllocation/perl";;
8970 case "$startperl" in
8975 I will use the "eval 'exec'" idiom to start Perl on your system.
8976 I can use the full path of your Perl binary for this purpose, but
8977 doing so may cause problems if you want to share those scripts and
8978 Perl is not always in a standard place ($initialinstalllocation/perl).
8981 dflt="$initialinstalllocation/perl"
8982 rp="What path shall I use in \"eval 'exec'\"?"
8989 case "$startperl" in
8991 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
8994 : determine where public executable scripts go
8995 set scriptdir scriptdir
8997 case "$scriptdir" in
9000 : guess some guesses
9001 $test -d /usr/share/scripts && dflt=/usr/share/scripts
9002 $test -d /usr/share/bin && dflt=/usr/share/bin
9003 $test -d /usr/local/script && dflt=/usr/local/script
9004 $test -d /usr/local/scripts && dflt=/usr/local/scripts
9005 $test -d $prefixexp/script && dflt=$prefixexp/script
9009 *) dflt="$scriptdir"
9014 Some installations have a separate directory just for executable scripts so
9015 that they can mount it across multiple architectures but keep the scripts in
9016 one spot. You might, for example, have a subdirectory of /usr/share for this.
9017 Or you might just lump your scripts in with all your other executables.
9021 rp='Where do you keep publicly executable scripts?'
9023 if $test "X$ansexp" != "X$scriptdirexp"; then
9029 : A little fix up for an irregularly named variable.
9030 installscript="$installscriptdir"
9032 : determine where add-on public executables go
9034 '') dflt=$siteprefix/bin ;;
9038 rp='Pathname where the add-on public executables should be installed?'
9043 : determine where add-on html pages go
9044 : There is no standard location, so try to copy the previously-selected
9045 : directory structure for the core html pages.
9046 case "$sitehtml1dir" in
9047 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9048 *) dflt=$sitehtml1dir ;;
9051 ''|' ') dflt=none ;;
9054 rp='Pathname where the site-specific html pages should be installed?'
9056 prefixvar=sitehtml1dir
9059 : determine where add-on library html pages go
9060 : There is no standard location, so try to copy the previously-selected
9061 : directory structure for the core html pages.
9062 case "$sitehtml3dir" in
9063 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9064 *) dflt=$sitehtml3dir ;;
9067 ''|' ') dflt=none ;;
9070 rp='Pathname where the site-specific library html pages should be installed?'
9072 prefixvar=sitehtml3dir
9075 : determine where add-on manual pages go
9076 case "$siteman1dir" in
9077 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
9078 *) dflt=$siteman1dir ;;
9081 ''|' ') dflt=none ;;
9084 rp='Pathname where the site-specific manual pages should be installed?'
9086 prefixvar=siteman1dir
9089 : determine where add-on library man pages go
9090 case "$siteman3dir" in
9091 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
9092 *) dflt=$siteman3dir ;;
9095 ''|' ') dflt=none ;;
9098 rp='Pathname where the site-specific library manual pages should be installed?'
9100 prefixvar=siteman3dir
9103 : determine where add-on public executable scripts go
9104 case "$sitescript" in
9105 '') dflt=$siteprefix/script
9106 $test -d $dflt || dflt=$sitebin ;;
9107 *) dflt="$sitescript" ;;
9110 rp='Pathname where add-on public executable scripts should be installed?'
9112 prefixvar=sitescript
9115 : Check if faststdio is requested and available
9116 case "$usefaststdio" in
9117 $define|true|[yY]*|'')
9118 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
9128 Perl can be built to use 'fast stdio', which means using the stdio
9129 library but also directly manipulating the stdio buffers to enable
9130 faster I/O. Using stdio is better for backward compatibility (especially
9131 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
9132 interface has been preferred instead of stdio.
9134 If this doesn't make any sense to you, just accept the default '$dflt'.
9136 rp='Use the "fast stdio" if available?'
9139 y|Y) val="$define" ;;
9146 : define an is-a-typedef? function
9147 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9149 "") inclist="sys/types.h";;
9151 eval "varval=\$$var";
9155 for inc in $inclist; do
9156 echo "#include <$inc>" >>temp.c;
9158 echo "#ifdef $type" >> temp.c;
9159 echo "printf(\"We have $type\");" >> temp.c;
9160 echo "#endif" >> temp.c;
9161 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9162 if $contains $type temp.E >/dev/null 2>&1; then
9168 *) eval "$var=\$varval";;
9171 : define an is-a-typedef? function that prompts if the type is not available.
9172 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9174 "") inclist="sys/types.h";;
9176 eval "varval=\$$var";
9180 for inc in $inclist; do
9181 echo "#include <$inc>" >>temp.c;
9183 echo "#ifdef $type" >> temp.c;
9184 echo "printf(\"We have $type\");" >> temp.c;
9185 echo "#endif" >> temp.c;
9186 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9188 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
9189 if $contains $type temp.E >/dev/null 2>&1; then
9190 echo "$type found." >&4;
9193 echo "$type NOT found." >&4;
9199 *) eval "$var=\$varval";;
9202 : see what type lseek is declared as in the kernel
9203 rp="What is the type used for lseek's offset on this system?"
9204 set off_t lseektype long stdio.h sys/types.h
9208 echo "Checking to see how big your file offsets are..." >&4
9210 #include <sys/types.h>
9214 printf("%d\n", (int)sizeof($lseektype));
9219 if eval $compile_ok; then
9220 lseeksize=`$run ./try`
9221 echo "Your file offsets are $lseeksize bytes long."
9225 echo "(I can't seem to compile the test program. Guessing...)"
9226 rp="What is the size of your file offsets (in bytes)?"
9232 : see what type file positions are declared as in the library
9233 rp="What is the type for file position used by fsetpos()?"
9234 set fpos_t fpostype long stdio.h sys/types.h
9237 : Check size for Fpos_t
9240 *_t) zzz="$fpostype" ;;
9243 echo "Checking the size of $zzz..." >&4
9245 #include <sys/types.h>
9252 printf("%d\n", (int)sizeof($fpostype));
9257 if eval $compile_ok; then
9261 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9264 echo "Your $zzz is $fpossize bytes long."
9270 echo "(I can't compile the test program. Guessing...)" >&4
9271 rp="What is the size of your file positions (in bytes)?"
9276 : Check for large file support
9277 # Backward compatibility (uselfs is deprecated).
9279 "$define"|true|[yY]*)
9282 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
9284 uselargefiles="$define"
9288 case "$lseeksize:$fpossize" in
9291 You can have files larger than 2 gigabytes.
9294 *) case "$uselargefiles" in
9295 "$undef"|false|[nN]*) dflt='n' ;;
9300 Perl can be built to understand large files (files larger than 2 gigabytes)
9301 on some systems. To do so, Configure can be run with -Duselargefiles.
9303 If this doesn't make any sense to you, just accept the default '$dflt'.
9305 rp='Try to understand large files, if available?'
9308 y|Y) val="$define" ;;
9315 : Look for a hint-file generated 'call-back-unit'. If the
9316 : user has specified that a large files perl is to be built,
9317 : we may need to set or change some other defaults.
9318 if $test -f uselargefiles.cbu; then
9319 echo "Your platform has some specific hints regarding large file builds, using them..."
9320 . ./uselargefiles.cbu
9322 case "$uselargefiles" in
9324 if $test -f uselargefiles.cbu; then
9326 echo "Rechecking to see how big your file offsets are..." >&4
9328 #include <sys/types.h>
9332 printf("%d\n", (int)sizeof($lseektype));
9337 if eval $compile_ok; then
9338 lseeksize=`$run ./try`
9339 $echo "Your file offsets are now $lseeksize bytes long."
9343 echo "(I can't seem to compile the test program. Guessing...)"
9344 rp="What is the size of your file offsets (in bytes)?"
9349 *_t) zzz="$fpostype" ;;
9352 $echo $n "Rechecking the size of $zzz...$c" >&4
9354 #include <sys/types.h>
9361 printf("%d\n", (int)sizeof($fpostype));
9366 if eval $compile_ok; then
9371 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9374 echo " $fpossize bytes." >&4
9380 echo "(I can't compile the test program. Guessing...)" >&4
9381 rp="What is the size of your file positions (in bytes)?"
9390 : Set the vendorbin variables
9391 case "$vendorprefix" in
9392 '') d_vendorbin="$undef"
9396 *) d_vendorbin="$define"
9397 : determine where vendor-supplied executables go.
9398 case "$vendorbin" in
9399 '') dflt=$vendorprefix/bin ;;
9400 *) dflt="$vendorbin" ;;
9403 rp='Pathname for the vendor-supplied executables directory?'
9406 vendorbinexp="$ansexp"
9412 : Set the vendorhtml1dir variables
9413 case "$vendorprefix" in
9414 '') vendorhtml1dir=''
9415 vendorhtml1direxp=''
9417 *) : determine where vendor-supplied html pages go.
9418 : There is no standard location, so try to copy the previously-selected
9419 : directory structure for the core html pages.
9420 : XXX Better default suggestions would be welcome.
9421 case "$vendorhtml1dir" in
9422 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9423 *) dflt=$vendorhtml1dir ;;
9426 ''|' ') dflt=none ;;
9429 rp='Pathname for the vendor-supplied html pages?'
9431 vendorhtml1dir="$ans"
9432 vendorhtml1direxp="$ansexp"
9435 : Use ' ' for none so value is preserved next time through Configure
9436 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9437 prefixvar=vendorhtml1dir
9440 : Set the vendorhtml3dir variables
9441 case "$vendorprefix" in
9442 '') vendorhtml3dir=''
9443 vendorhtml3direxp=''
9445 *) : determine where vendor-supplied module html pages go.
9446 : There is no standard location, so try to copy the previously-selected
9447 : directory structure for the core html pages.
9448 : XXX Better default suggestions would be welcome.
9449 case "$vendorhtml3dir" in
9450 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9451 *) dflt=$vendorhtml3dir ;;
9454 ''|' ') dflt=none ;;
9457 rp='Pathname for the vendor-supplied html pages?'
9459 vendorhtml3dir="$ans"
9460 vendorhtml3direxp="$ansexp"
9463 : Use ' ' for none so value is preserved next time through Configure
9464 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9465 prefixvar=vendorhtml3dir
9468 : Set the vendorman1dir variables
9469 case "$vendorprefix" in
9470 '') vendorman1dir=''
9473 *) : determine where vendor-supplied manual pages go.
9474 case "$vendorman1dir" in
9475 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9476 *) dflt=$vendorman1dir ;;
9479 ''|' ') dflt=none ;;
9482 rp='Pathname for the vendor-supplied manual section 1 pages?'
9484 vendorman1dir="$ans"
9485 vendorman1direxp="$ansexp"
9488 : Use ' ' for none so value is preserved next time through Configure
9489 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
9490 prefixvar=vendorman1dir
9493 : Set the vendorman3dir variables
9494 case "$vendorprefix" in
9495 '') vendorman3dir=''
9498 *) : determine where vendor-supplied module manual pages go.
9499 case "$vendorman3dir" in
9500 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9501 *) dflt=$vendorman3dir ;;
9504 ''|' ') dflt=none ;;
9507 rp='Pathname for the vendor-supplied manual section 3 pages?'
9509 vendorman3dir="$ans"
9510 vendorman3direxp="$ansexp"
9513 : Use ' ' for none so value is preserved next time through Configure
9514 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
9515 prefixvar=vendorman3dir
9518 : Set the vendorscript variables
9519 case "$vendorprefix" in
9520 '') d_vendorscript="$undef"
9524 *) d_vendorscript="$define"
9525 : determine where vendor-supplied scripts go.
9526 case "$vendorscript" in
9527 '') dflt=$vendorprefix/script
9528 $test -d $dflt || dflt=$vendorbin ;;
9529 *) dflt="$vendorscript" ;;
9533 The installation process will create a directory for
9534 vendor-supplied scripts.
9538 rp='Pathname for the vendor-supplied scripts directory?'
9541 vendorscriptexp="$ansexp"
9544 prefixvar=vendorscript
9547 : script used to emit important warnings
9550 if test \$# -gt 0; then
9555 echo "*** WARNING:" >&4
9556 sed -e 's/^/*** /' <msg >&4
9558 cat msg >>config.msg
9559 echo " " >>config.msg
9565 : see which of string.h or strings.h is needed
9567 strings=`./findhdr string.h`
9568 if $test "$strings" && $test -r "$strings"; then
9569 echo "Using <string.h> instead of <strings.h>." >&4
9573 strings=`./findhdr strings.h`
9574 if $test "$strings" && $test -r "$strings"; then
9575 echo "Using <strings.h> instead of <string.h>." >&4
9577 ./warn "No string header found -- You'll surely have problems."
9583 "$undef") strings=`./findhdr strings.h`;;
9584 *) strings=`./findhdr string.h`;;
9587 : see if qgcvt exists
9591 : Check print/scan long double stuff
9594 if $test X"$d_longdbl" = X"$define"; then
9596 echo "Checking how to print long doubles..." >&4
9598 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
9599 $cat >try.c <<'EOCP'
9600 #include <sys/types.h>
9604 printf("%.3f\n", d);
9608 if eval $compile; then
9612 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
9613 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
9614 echo "We will use %f."
9620 if $test X"$sPRIfldbl" = X; then
9621 $cat >try.c <<'EOCP'
9622 #include <sys/types.h>
9625 long double d = 123.456;
9626 printf("%.3Lf\n", d);
9630 if eval $compile; then
9634 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
9635 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
9636 echo "We will use %Lf."
9642 if $test X"$sPRIfldbl" = X; then
9643 $cat >try.c <<'EOCP'
9644 #include <sys/types.h>
9647 long double d = 123.456;
9648 printf("%.3llf\n", d);
9652 if eval $compile; then
9656 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
9657 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
9658 echo "We will use %llf."
9664 if $test X"$sPRIfldbl" = X; then
9665 $cat >try.c <<'EOCP'
9666 #include <sys/types.h>
9669 long double d = 123.456;
9670 printf("%.3lf\n", d);
9674 if eval $compile; then
9678 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
9679 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
9680 echo "We will use %lf."
9686 if $test X"$sPRIfldbl" = X; then
9687 echo "Cannot figure out how to print long doubles." >&4
9689 sSCNfldbl=$sPRIfldbl # expect consistency
9696 case "$sPRIfldbl" in
9697 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
9698 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
9699 d_SCNfldbl="$undef";
9701 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
9702 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
9703 d_SCNfldbl="$define";
9707 : Check how to convert floats to strings.
9709 if test "X$d_Gconvert" = X; then
9712 echo "Checking for an efficient way to convert floats to strings."
9714 case "$uselongdouble" in
9715 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
9717 case "$d_longdbl" in
9718 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
9720 case "$d_PRIgldbl" in
9721 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
9725 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
9726 char *myname = "gconvert";
9729 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
9730 char *myname = "gcvt";
9733 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
9734 char *myname = "qgcvt";
9735 #define DOUBLETYPE long double
9738 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9740 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
9742 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
9745 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
9747 char *myname = "sprintf";
9751 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9752 #define DOUBLETYPE long double
9754 #define DOUBLETYPE double
9766 # include <string.h>
9768 # include <strings.h>
9771 int checkit(char *expect, char *got)
9773 if (strcmp(expect, got)) {
9774 printf("%s oddity: Expected %s, got %s\n",
9775 myname, expect, got);
9785 /* This must be 1st test on (which?) platform */
9786 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
9787 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
9788 checkit("0.1", buf);
9790 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
9791 checkit("0.01", buf);
9793 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
9794 checkit("0.001", buf);
9796 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
9797 checkit("0.0001", buf);
9799 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
9800 if (strlen(buf) > 5)
9801 checkit("9e-005", buf); /* for Microsoft ?? */
9803 checkit("9e-05", buf);
9805 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
9808 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
9809 checkit("1.1", buf);
9811 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
9812 checkit("1.01", buf);
9814 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
9815 checkit("1.001", buf);
9817 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
9818 checkit("1.0001", buf);
9820 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
9821 checkit("1.00001", buf);
9823 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
9824 checkit("1.000001", buf);
9826 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
9829 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
9832 /* Some Linux gcvt's give 1.e+5 here. */
9833 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
9834 checkit("100000", buf);
9836 /* Some Linux gcvt's give -1.e+5 here. */
9837 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
9838 checkit("-100000", buf);
9840 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
9841 checkit("123.456", buf);
9843 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
9844 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
9845 /* 34 should be enough to scare even long double
9846 * places into using the e notation. */
9847 if (strlen(buf) > 5)
9848 checkit("1e+034", buf); /* for Microsoft */
9850 checkit("1e+34", buf);
9852 /* For Perl, if you add additional tests here, also add them to
9853 * t/base/num.t for benefit of platforms not using Configure or
9854 * overriding d_Gconvert */
9859 : first add preferred functions to our list
9861 for xxx_convert in $gconvert_preference; do
9862 case $xxx_convert in
9863 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
9864 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
9867 : then add any others
9868 for xxx_convert in gconvert gcvt sprintf; do
9871 *) xxx_list="$xxx_list $xxx_convert" ;;
9875 case "$d_longdbl$uselongdouble" in
9877 : again, add prefered functions to our list first
9879 for xxx_convert in $gconvert_ld_preference; do
9880 case $xxx_convert in
9881 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9882 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
9885 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
9886 for xxx_convert in qgcvt sprintf $xxx_list; do
9887 case "$xxx_ld_list" in
9888 $xxx_convert*|*" $xxx_convert"*) ;;
9889 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9892 : if sprintf cannot do long doubles, move it to the end
9893 if test "$d_PRIgldbl" != "$define"; then
9894 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
9896 : if no qgcvt, remove it
9897 if test "$d_qgcvt" != "$define"; then
9898 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
9901 xxx_list="$xxx_ld_list"
9905 for xxx_convert in $xxx_list; do
9906 echo "Trying $xxx_convert..."
9907 $rm -f try try$_o core
9908 set try -DTRY_$xxx_convert
9909 if eval $compile; then
9910 echo "$xxx_convert() found." >&4
9912 echo "I'll use $xxx_convert to convert floats into a string." >&4
9915 echo "...But $xxx_convert didn't work as I expected."
9919 echo "$xxx_convert NOT found." >&4
9923 if test X$xxx_convert = X; then
9924 echo "*** WHOA THERE!!! ***" >&4
9925 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
9929 case "$xxx_convert" in
9930 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
9931 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
9932 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
9933 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
9934 "$define$define$define")
9935 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
9936 "$define$define$undef")
9937 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
9938 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
9946 : see if _fwalk exists
9950 : Initialize h_fcntl
9953 : Initialize h_sysfile
9956 : access call always available on UNIX
9960 : locate the flags for 'access()'
9964 $cat >access.c <<EOCP
9965 #include <sys/types.h>
9970 #include <sys/file.h>
9983 : check sys/file.h first, no particular reason here
9984 if $test `./findhdr sys/file.h` && \
9985 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
9987 echo "<sys/file.h> defines the *_OK access constants." >&4
9988 elif $test `./findhdr fcntl.h` && \
9989 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
9991 echo "<fcntl.h> defines the *_OK access constants." >&4
9992 elif $test `./findhdr unistd.h` && \
9993 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
9994 echo "<unistd.h> defines the *_OK access constants." >&4
9996 echo "I can't find the four *_OK access constants--I'll use mine." >&4
10002 : see if accessx exists
10003 set accessx d_accessx
10006 : see if aintl exists
10010 : see if alarm exists
10014 : see if 64bit time functions exists
10016 set ctime64 d_ctime64
10019 set localtime64 d_localtime64
10022 set gmtime64 d_gmtime64
10025 set mktime64 d_mktime64
10028 set difftime64 d_difftime64
10031 set asctime64 d_asctime64
10034 : see if POSIX threads are available
10035 set pthread.h i_pthread
10038 : define a fucntion to check prototypes
10039 $cat > protochk <<EOSH
10042 optimize="$optimize"
10044 prototype="$prototype"
10047 usethreads=$usethreads
10048 i_pthread=$i_pthread
10049 pthread_h_first=$pthread_h_first
10052 $cat >> protochk <<'EOSH'
10057 while test $# -ge 2; do
10059 $define) echo "#include <$2>" >> try.c ;;
10060 literal) echo "$2" >> try.c ;;
10062 # Extra magic for the benefit of systems that need pthread.h
10063 # to be included early to correctly detect threadsafe functions.
10064 # Such functions must guarantee themselves, though, that the usethreads
10065 # and i_pthread have been defined, before calling protochk.
10066 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
10067 echo "#include <pthread.h>" >> try.c
10072 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
10073 cat >> try.c <<'EOCP'
10074 #ifdef CAN_PROTOTYPE
10075 #define _(args) args
10080 echo "$foo" >> try.c
10081 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
10082 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
10088 $eunicefix protochk
10090 : Define hasproto macro for Configure internal use
10091 hasproto='varname=$1; func=$2; shift; shift;
10092 while $test $# -ge 2; do
10094 $define) echo "#include <$2>";;
10098 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
10099 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
10100 echo "$func() prototype found.";
10103 echo "$func() prototype NOT found.";
10110 : see if sys/types.h has to be included
10111 set sys/types.h i_systypes
10114 : see if sys/select.h has to be included
10115 set sys/select.h i_sysselct
10118 : Define hasfield macro for Configure internal use
10119 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
10120 while $test $# -ge 2; do
10122 $define) echo "#include <$2>";;
10126 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
10128 if eval $compile; then
10137 : see if we should include time.h, sys/time.h, or both
10139 if test "X$timeincl" = X; then
10140 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
10141 $echo $n "I'm now running the test program...$c"
10143 #include <sys/types.h>
10148 #ifdef SYSTIMEKERNEL
10151 #include <sys/time.h>
10154 #include <sys/select.h>
10156 #$i_stdlib I_STDLIB
10158 #include <stdlib.h>
10164 struct timeval bar;
10167 struct timezone tzp;
10169 if (foo.tm_sec == foo.tm_sec)
10172 if (bar.tv_sec == bar.tv_sec)
10179 for s_timezone in '-DS_TIMEZONE' ''; do
10181 for s_timeval in '-DS_TIMEVAL' ''; do
10182 for i_systimek in '' '-DSYSTIMEKERNEL'; do
10183 for i_time in '' '-DI_TIME'; do
10184 for i_systime in '-DI_SYSTIME' ''; do
10187 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
10188 if eval $compile; then
10189 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
10193 $echo $n "Succeeded with $flags$c"
10205 *SYSTIMEKERNEL*) i_systimek="$define"
10206 timeincl=`./findhdr sys/time.h`
10207 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
10208 *) i_systimek="$undef";;
10211 *I_TIME*) i_time="$define"
10212 timeincl=`./findhdr time.h`" $timeincl"
10213 echo "We'll include <time.h>." >&4;;
10214 *) i_time="$undef";;
10217 *I_SYSTIME*) i_systime="$define"
10218 timeincl=`./findhdr sys/time.h`" $timeincl"
10219 echo "We'll include <sys/time.h>." >&4;;
10220 *) i_systime="$undef";;
10224 : see if struct tm knows about tm_zone
10225 case "$i_systime$i_time" in
10228 echo "Checking to see if your struct tm has tm_zone field..." >&4
10229 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
10237 case "$d_tm_tm_zone" in
10238 "$define") echo "Yes, it does." ;;
10239 *) echo "No, it doesn't." ;;
10241 : see if struct tm knows about tm_gmtoff
10242 case "$i_systime$i_time" in
10245 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
10246 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
10254 case "$d_tm_tm_gmtoff" in
10255 "$define") echo "Yes, it does." ;;
10256 *) echo "No, it doesn't." ;;
10259 : see if asctime_r exists
10260 set asctime_r d_asctime_r
10262 case "$d_asctime_r" in
10264 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10265 case "$d_asctime_r_proto:$usethreads" in
10266 ":define") d_asctime_r_proto=define
10267 set d_asctime_r_proto asctime_r $hdrs
10271 case "$d_asctime_r_proto" in
10273 case "$asctime_r_proto" in
10274 ''|0) try='char* asctime_r(const struct tm*, char*);'
10275 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SB ;;
10277 case "$asctime_r_proto" in
10278 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
10279 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SBI ;;
10281 case "$asctime_r_proto" in
10282 ''|0) try='int asctime_r(const struct tm*, char*);'
10283 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SB ;;
10285 case "$asctime_r_proto" in
10286 ''|0) try='int asctime_r(const struct tm*, char*, int);'
10287 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SBI ;;
10289 case "$asctime_r_proto" in
10290 ''|0) d_asctime_r=undef
10292 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
10293 * ) case "$asctime_r_proto" in
10294 REENTRANT_PROTO*) ;;
10295 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
10297 echo "Prototype: $try" ;;
10300 *) case "$usethreads" in
10301 define) echo "asctime_r has no prototype, not using it." >&4 ;;
10308 *) asctime_r_proto=0
10312 : see if atolf exists
10316 : see if atoll exists
10320 : Look for GCC-style attribute format
10321 case "$d_attribute_format" in
10324 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
10325 $cat >attrib.c <<'EOCP'
10327 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
10329 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10330 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10331 echo "Your C compiler doesn't support __attribute__((format))."
10334 echo "Your C compiler supports __attribute__((format))."
10338 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10342 *) val="$d_attribute_format" ;;
10344 set d_attribute_format
10348 : Look for GCC-style attribute format with null format allowed
10349 case "$d_printf_format_null" in
10350 '') case "$d_attribute_format" in
10353 echo "Checking whether your compiler allows __printf__ format to be null ..." >&4
10354 $cat >attrib.c <<EOCP
10356 #$i_stdlib I_STDLIB
10358 #include <stdlib.h>
10360 int null_printf (char* pat,...) __attribute__((__format__(__printf__,1,2)));
10361 int null_printf (char* pat,...) { return (int)pat; }
10362 int main () { exit(null_printf(NULL)); }
10364 if $cc $ccflags -o attrib attrib.c >attrib.out 2>&1 ; then
10365 : run the executable in case it produces a run-time warning
10366 if $run ./attrib >>attrib.out 2>&1; then
10367 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10368 echo "Your C compiler doesn't allow __printf__ format to be null."
10371 echo "Your C compiler allows __printf__ format to be null."
10375 echo "Your C compiler executable failed with __printf__ format null."
10379 echo "Your C compiler fails with __printf__ format null."
10386 *) val="$d_printf_format_null" ;;
10388 set d_printf_format_null
10392 : Look for GCC-style attribute malloc
10393 case "$d_attribute_malloc" in
10396 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
10397 $cat >attrib.c <<'EOCP'
10399 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
10401 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10402 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10403 echo "Your C compiler doesn't support __attribute__((malloc))."
10406 echo "Your C compiler supports __attribute__((malloc))."
10410 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10414 *) val="$d_attribute_malloc" ;;
10416 set d_attribute_malloc
10420 : Look for GCC-style attribute nonnull
10421 case "$d_attribute_nonnull" in
10424 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
10425 $cat >attrib.c <<'EOCP'
10427 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
10429 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10430 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10431 echo "Your C compiler doesn't support __attribute__((nonnull))."
10434 echo "Your C compiler supports __attribute__((nonnull))."
10438 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10442 *) val="$d_attribute_nonnull" ;;
10444 set d_attribute_nonnull
10448 : Look for GCC-style attribute noreturn
10449 case "$d_attribute_noreturn" in
10452 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
10453 $cat >attrib.c <<'EOCP'
10455 void fall_over_dead( void ) __attribute__((noreturn));
10457 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10458 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10459 echo "Your C compiler doesn't support __attribute__((noreturn))."
10462 echo "Your C compiler supports __attribute__((noreturn))."
10466 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10470 *) val="$d_attribute_noreturn" ;;
10472 set d_attribute_noreturn
10476 : Look for GCC-style attribute pure
10477 case "$d_attribute_pure" in
10480 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
10481 $cat >attrib.c <<'EOCP'
10483 int square( int n ) __attribute__((pure));
10485 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10486 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10487 echo "Your C compiler doesn't support __attribute__((pure))."
10490 echo "Your C compiler supports __attribute__((pure))."
10494 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10498 *) val="$d_attribute_pure" ;;
10500 set d_attribute_pure
10504 : Look for GCC-style attribute unused
10505 case "$d_attribute_unused" in
10508 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
10509 $cat >attrib.c <<'EOCP'
10511 int do_something( int dummy __attribute__((unused)), int n );
10513 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10514 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10515 echo "Your C compiler doesn't support __attribute__((unused))."
10518 echo "Your C compiler supports __attribute__((unused))."
10522 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10526 *) val="$d_attribute_unused" ;;
10528 set d_attribute_unused
10532 : Look for GCC-style attribute deprecated
10533 case "$d_attribute_deprecated" in
10536 echo "Checking whether your compiler can handle __attribute__((deprecated)) ..." >&4
10537 $cat >attrib.c <<'EOCP'
10539 int I_am_deprecated(void) __attribute__((deprecated));
10541 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10542 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10543 echo "Your C compiler doesn't support __attribute__((deprecated))."
10546 echo "Your C compiler supports __attribute__((deprecated))."
10550 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10554 *) val="$d_attribute_deprecated" ;;
10556 set d_attribute_deprecated
10560 : Look for GCC-style attribute warn_unused_result
10561 case "$d_attribute_warn_unused_result" in
10564 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
10565 $cat >attrib.c <<'EOCP'
10567 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
10569 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10570 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10571 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
10574 echo "Your C compiler supports __attribute__((warn_unused_result))."
10578 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10582 *) val="$d_attribute_warn_unused_result" ;;
10584 set d_attribute_warn_unused_result
10588 : see if bcmp exists
10592 : see if bcopy exists
10596 : see if getpgrp exists
10597 set getpgrp d_getpgrp
10600 case "$d_getpgrp" in
10603 echo "Checking to see which flavor of getpgrp is in use..."
10605 #$i_unistd I_UNISTD
10606 #include <sys/types.h>
10608 # include <unistd.h>
10610 #$i_stdlib I_STDLIB
10612 #include <stdlib.h>
10616 if (getuid() == 0) {
10617 printf("(I see you are running Configure as super-user...)\n");
10620 #ifdef TRY_BSD_PGRP
10621 if (getpgrp(1) == 0)
10630 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10631 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
10633 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10634 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
10637 echo "I can't seem to compile and run the test program."
10639 xxx="a USG one, i.e. you use getpgrp()."
10641 # SVR4 systems can appear rather BSD-ish.
10642 case "$i_unistd" in
10644 xxx="a BSD one, i.e. you use getpgrp(pid)."
10648 xxx="probably a USG one, i.e. you use getpgrp()."
10653 echo "Assuming your getpgrp is $xxx" >&4
10662 : see if setpgrp exists
10663 set setpgrp d_setpgrp
10666 case "$d_setpgrp" in
10669 echo "Checking to see which flavor of setpgrp is in use..."
10671 #$i_unistd I_UNISTD
10672 #include <sys/types.h>
10674 # include <unistd.h>
10676 #$i_stdlib I_STDLIB
10678 #include <stdlib.h>
10682 if (getuid() == 0) {
10683 printf("(I see you are running Configure as super-user...)\n");
10686 #ifdef TRY_BSD_PGRP
10687 if (-1 == setpgrp(1, 1))
10690 if (setpgrp() != -1)
10696 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10697 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
10699 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10700 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
10703 echo "(I can't seem to compile and run the test program.)"
10705 xxx="a USG one, i.e. you use setpgrp()."
10707 # SVR4 systems can appear rather BSD-ish.
10708 case "$i_unistd" in
10710 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
10714 xxx="probably a USG one, i.e. you use setpgrp()."
10719 echo "Assuming your setpgrp is $xxx" >&4
10728 : Look for GCC-style __builtin_choose_expr
10729 case "$d_builtin_choose_expr" in
10732 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
10733 $cat >try.c <<'EOCP'
10734 #include <assert.h>
10735 #include <stdlib.h>
10738 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
10741 assert( SYRINX(1) == 2112 );
10742 assert( SYRINX(1) != 5150 );
10743 assert( SYRINX(0) == 5150 );
10744 assert( SYRINX(0) != 2112 );
10745 puts( "All good!" );
10751 if eval $compile && $run ./try; then
10752 echo "Your C compiler supports __builtin_choose_expr."
10755 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
10759 *) val="$d_builtin_choose_expr" ;;
10762 set d_builtin_choose_expr
10766 : Look for GCC-style __builtin_expect
10767 case "$d_builtin_expect" in
10770 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
10771 $cat >try.c <<'EOCP'
10774 if ( __builtin_expect(n, 0) ) n = 1;
10775 /* Remember shell exit code truth is 0, C truth is non-zero */
10780 if eval $compile && $run ./try; then
10781 echo "Your C compiler supports __builtin_expect."
10784 echo "Your C compiler doesn't seem to understand __builtin_expect."
10788 *) val="$d_builtin_expect" ;;
10791 set d_builtin_expect
10795 : see if bzero exists
10799 : see if stdarg is available
10801 if $test `./findhdr stdarg.h`; then
10802 echo "<stdarg.h> found." >&4
10805 echo "<stdarg.h> NOT found." >&4
10809 : see if varags is available
10811 if $test `./findhdr varargs.h`; then
10812 echo "<varargs.h> found." >&4
10814 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
10817 : set up the varargs testing programs
10818 $cat > varargs.c <<EOP
10820 #include <stdarg.h>
10823 #include <varargs.h>
10827 int f(char *p, ...)
10841 p = va_arg(ap, char *);
10847 $cat > varargs <<EOP
10849 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
10858 : now check which varargs header should be included
10863 if `./varargs I_STDARG`; then
10865 elif `./varargs I_VARARGS`; then
10870 if `./varargs I_VARARGS`; then
10877 echo "I could not find the definition for va_dcl... You have problems..." >&4
10878 val="$undef"; set i_stdarg; eval $setvar
10879 val="$undef"; set i_varargs; eval $setvar
10884 case "$i_varhdr" in
10886 val="$define"; set i_stdarg; eval $setvar
10887 val="$undef"; set i_varargs; eval $setvar
10890 val="$undef"; set i_stdarg; eval $setvar
10891 val="$define"; set i_varargs; eval $setvar
10894 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
10898 : see if the Compiler supports C99 variadic macros
10899 case "$i_stdarg$i_stdlib" in
10901 echo "You have <stdarg.h> and <stdlib.h>, so checking for C99 variadic macros." >&4
10904 #include <stdarg.h>
10906 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
10910 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
10916 if eval $compile && $run ./try 2>&1 >/dev/null; then
10917 case "`$run ./try`" in
10919 echo "You have C99 variadic macros." >&4
10920 d_c99_variadic_macros="$define"
10923 echo "You don't have functional C99 variadic macros." >&4
10924 d_c99_variadic_macros="$undef"
10928 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
10929 d_c99_variadic_macros="$undef"
10934 echo "You don't have <stdarg.h> and <stdlib.h>, so not checking for C99 variadic macros." >&4
10935 d_c99_variadic_macros="$undef"
10939 : see if signal is declared as pointer to function returning int or void
10941 xxx=`./findhdr signal.h`
10942 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
10943 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10944 echo "You have int (*signal())() instead of void." >&4
10946 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10947 echo "You have void (*signal())()." >&4
10949 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
10950 echo "You have int (*signal())() instead of void." >&4
10952 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
10953 echo "You have void (*signal())()." >&4
10956 case "$d_voidsig" in
10958 echo "I can't determine whether signal handler returns void or int..." >&4
10960 rp="What type does your signal handler return?"
10963 v*) val="$define";;
10967 echo "As you already told me, signal handler returns void." >&4
10970 *) echo "As you already told me, signal handler returns int." >&4
10977 case "$d_voidsig" in
10978 "$define") signal_t="void";;
10979 *) signal_t="int";;
10983 : check for ability to cast large floats to 32-bit ints.
10985 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
10986 if $test "$intsize" -ge 4; then
10993 #$i_stdlib I_STDLIB
10995 #include <stdlib.h>
10997 #include <sys/types.h>
10998 #include <signal.h>
10999 $signal_t blech(int s) { exit(3); }
11006 signal(SIGFPE, blech);
11008 /* Don't let compiler optimize the test away. Store the number
11009 in a writable string for gcc to pass to sscanf under HP/UX.
11011 sprintf(str, "2147483647");
11012 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
11016 /* x86 processors will probably give 0x8000 0000, which is a
11017 sign change. We don't want that. We want to mimic SPARC
11018 behavior here, which is to preserve the sign and give
11021 if (i32 != ($xxx) f)
11027 if eval $compile_ok; then
11031 echo "(I can't seem to compile the test program--assuming it can't)"
11036 echo "Yup, it can."
11039 echo "Nope, it can't."
11046 : check for ability to cast negative floats to unsigned
11048 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
11051 #$i_stdlib I_STDLIB
11053 #include <stdlib.h>
11055 #include <sys/types.h>
11056 #include <signal.h>
11057 $signal_t blech(int s) { exit(7); }
11058 $signal_t blech_in_list(int s) { exit(4); }
11059 unsigned long dummy_long(unsigned long p) { return p; }
11060 unsigned int dummy_int(unsigned int p) { return p; }
11061 unsigned short dummy_short(unsigned short p) { return p; }
11065 unsigned long along;
11067 unsigned short ashort;
11071 /* Frustrate gcc-2.7.2's optimizer which failed this test with
11072 a direct f = -123. assignment. gcc-2.8.0 reportedly
11073 optimized the whole file away
11075 /* Store the number in a writable string for gcc to pass to
11076 sscanf under HP/UX.
11078 sprintf(str, "-123");
11079 sscanf(str, "%lf", &f); /* f = -123.; */
11081 signal(SIGFPE, blech);
11082 along = (unsigned long)f;
11083 aint = (unsigned int)f;
11084 ashort = (unsigned short)f;
11085 if (along != (unsigned long)-123)
11087 if (aint != (unsigned int)-123)
11089 if (ashort != (unsigned short)-123)
11091 sprintf(str, "1073741824.");
11092 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
11095 along = (unsigned long)f;
11096 if (along != 0x80000000)
11100 along = (unsigned long)f;
11101 if (along != 0x7fffffff)
11105 along = (unsigned long)f;
11106 if (along != 0x80000001)
11110 signal(SIGFPE, blech_in_list);
11111 sprintf(str, "123.");
11112 sscanf(str, "%lf", &f); /* f = 123.; */
11113 along = dummy_long((unsigned long)f);
11114 aint = dummy_int((unsigned int)f);
11115 ashort = dummy_short((unsigned short)f);
11116 if (along != (unsigned long)123)
11118 if (aint != (unsigned int)123)
11120 if (ashort != (unsigned short)123)
11127 if eval $compile_ok; then
11131 echo "(I can't seem to compile the test program--assuming it can't)"
11134 case "$castflags" in
11136 echo "Yup, it can."
11139 echo "Nope, it can't."
11146 : see if vprintf exists
11148 if set vprintf val -f d_vprintf; eval $csym; $val; then
11149 echo 'vprintf() found.' >&4
11152 #$i_stdarg I_STDARG /* Only one of these can be defined by i_varhrd */
11153 #$i_varargs I_VARARGS
11155 #$i_stdlib I_STDLIB
11156 #$i_unistd I_UNISTD
11159 # include <stdarg.h>
11160 #else /* I_VARARGS */
11161 # include <varargs.h>
11165 # include <unistd.h>
11169 # include <stdlib.h>
11172 #include <stdio.h> /* vsprintf prototype */
11175 void xxx(int n, ...)
11180 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11182 int main() { xxx(1, "foo"); }
11184 #else /* I_VARARGS */
11192 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11194 int main() { xxx("foo"); }
11200 if eval $compile_ok; then
11201 if $run ./try; then
11202 echo "Your vsprintf() returns (int)." >&4
11205 echo "Your vsprintf() returns (char*)." >&4
11209 echo 'I am unable to compile the vsprintf() test program.' >&4
11210 # We shouldn't get here. If we do, assume the standard signature,
11211 # not the old BSD one.
11212 echo 'Guessing that vsprintf() returns (int).' >&4
11216 echo 'vprintf() NOT found.' >&4
11227 : see if chown exists
11231 : see if chroot exists
11232 set chroot d_chroot
11235 : see if chsize exists
11236 set chsize d_chsize
11239 : see if class exists
11243 : see if clearenv exists
11244 set clearenv d_clearenv
11247 : Define hasstruct macro for Configure internal use
11248 hasstruct='varname=$1; struct=$2; shift; shift;
11249 while $test $# -ge 2; do
11251 $define) echo "#include <$2>";;
11255 echo "int main () { struct $struct foo; }" >> try.c;
11257 if eval $compile; then
11266 : see whether socket exists
11270 $echo $n "Hmm... $c" >&4
11271 if set socket val -f d_socket; eval $csym; $val; then
11272 echo "Looks like you have Berkeley networking support." >&4
11274 if set setsockopt val -f; eval $csym; $val; then
11277 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
11278 d_oldsock="$define"
11281 if $contains socklib libc.list >/dev/null 2>&1; then
11282 echo "Looks like you have Berkeley networking support." >&4
11284 : we will have to assume that it supports the 4.2 BSD interface
11287 echo "You don't have Berkeley networking in libc$_a..." >&4
11288 if test "X$d_socket" = "X$define"; then
11289 echo "...but you seem to believe that you have sockets." >&4
11291 for net in net socket
11293 if test -f /usr/lib/lib$net$_a; then
11294 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
11295 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
11296 if $contains socket libc.list >/dev/null 2>&1; then
11301 echo "...but the Wollongong group seems to have hacked it in." >&4
11302 sockethdr="-I/usr/netinclude"
11305 echo "Found Berkeley sockets interface in lib$net." >&4
11306 if $contains setsockopt libc.list >/dev/null 2>&1; then
11309 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
11310 d_oldsock="$define"
11316 if test "X$d_socket" != "X$define"; then
11317 echo "or anywhere else I see." >&4
11325 : see if socketpair exists
11326 set socketpair d_sockpair
11331 echo "Checking the availability of certain socket constants..." >&4
11332 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
11333 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
11335 #include <sys/types.h>
11336 #include <sys/socket.h>
11342 set try; if eval $compile; then
11345 set d_${enum}; eval $setvar
11349 : see if this is a sys/uio.h system
11350 set sys/uio.h i_sysuio
11353 : Check for cmsghdr support
11355 echo "Checking to see if your system supports struct cmsghdr..." >&4
11356 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
11358 case "$d_cmsghdr_s" in
11359 "$define") echo "Yes, it does." ;;
11360 *) echo "No, it doesn't." ;;
11364 : check for const keyword
11366 echo 'Checking to see if your C compiler knows about "const"...' >&4
11367 $cat >const.c <<'EOCP'
11368 typedef struct spug { int drokk; } spug;
11372 const spug y = { 0 };
11375 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
11377 echo "Yup, it does."
11380 echo "Nope, it doesn't."
11385 : see if copysignl exists
11386 set copysignl d_copysignl
11389 : see if crypt exists
11394 $define) cryptlib='' ;;
11395 *) if set crypt val -f d_crypt; eval $csym; $val; then
11396 echo 'crypt() found.' >&4
11400 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
11401 if $test -z "$cryptlib"; then
11402 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
11406 if $test -z "$cryptlib"; then
11407 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
11411 if $test -z "$cryptlib"; then
11412 cryptlib=`./loc libcrypt$_a "" $libpth`
11416 if $test -z "$cryptlib"; then
11417 echo 'crypt() NOT found.' >&4
11428 : see if this is a crypt.h system
11429 set crypt.h i_crypt
11432 : see if crypt_r exists
11433 set crypt_r d_crypt_r
11435 case "$d_crypt_r" in
11437 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
11438 case "$d_crypt_r_proto:$usethreads" in
11439 ":define") d_crypt_r_proto=define
11440 set d_crypt_r_proto crypt_r $hdrs
11444 case "$d_crypt_r_proto" in
11446 case "$crypt_r_proto" in
11447 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
11448 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCS ;;
11450 case "$crypt_r_proto" in
11451 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
11452 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCD ;;
11454 case "$crypt_r_proto" in
11455 ''|0) d_crypt_r=undef
11457 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
11458 * ) case "$crypt_r_proto" in
11459 REENTRANT_PROTO*) ;;
11460 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
11462 echo "Prototype: $try" ;;
11465 *) case "$usethreads" in
11466 define) echo "crypt_r has no prototype, not using it." >&4 ;;
11477 : get csh whereabouts
11479 'csh') val="$undef" ;;
11480 *) val="$define" ;;
11484 : Respect a hint or command line value for full_csh.
11485 case "$full_csh" in
11486 '') full_csh=$csh ;;
11489 : see if ctermid exists
11490 set ctermid d_ctermid
11493 : see if ctermid_r exists
11494 set ctermid_r d_ctermid_r
11496 case "$d_ctermid_r" in
11498 hdrs="$i_systypes sys/types.h define stdio.h "
11499 case "$d_ctermid_r_proto:$usethreads" in
11500 ":define") d_ctermid_r_proto=define
11501 set d_ctermid_r_proto ctermid_r $hdrs
11505 case "$d_ctermid_r_proto" in
11507 case "$ctermid_r_proto" in
11508 ''|0) try='char* ctermid_r(char*);'
11509 ./protochk "$extern_C $try" $hdrs && ctermid_r_proto=B_B ;;
11511 case "$ctermid_r_proto" in
11512 ''|0) d_ctermid_r=undef
11514 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
11515 * ) case "$ctermid_r_proto" in
11516 REENTRANT_PROTO*) ;;
11517 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
11519 echo "Prototype: $try" ;;
11522 *) case "$usethreads" in
11523 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
11530 *) ctermid_r_proto=0
11534 : see if ctime_r exists
11535 set ctime_r d_ctime_r
11537 case "$d_ctime_r" in
11539 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
11540 case "$d_ctime_r_proto:$usethreads" in
11541 ":define") d_ctime_r_proto=define
11542 set d_ctime_r_proto ctime_r $hdrs
11546 case "$d_ctime_r_proto" in
11548 case "$ctime_r_proto" in
11549 ''|0) try='char* ctime_r(const time_t*, char*);'
11550 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SB ;;
11552 case "$ctime_r_proto" in
11553 ''|0) try='char* ctime_r(const time_t*, char*, int);'
11554 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SBI ;;
11556 case "$ctime_r_proto" in
11557 ''|0) try='int ctime_r(const time_t*, char*);'
11558 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SB ;;
11560 case "$ctime_r_proto" in
11561 ''|0) try='int ctime_r(const time_t*, char*, int);'
11562 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SBI ;;
11564 case "$ctime_r_proto" in
11565 ''|0) d_ctime_r=undef
11567 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
11568 * ) case "$ctime_r_proto" in
11569 REENTRANT_PROTO*) ;;
11570 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
11572 echo "Prototype: $try" ;;
11575 *) case "$usethreads" in
11576 define) echo "ctime_r has no prototype, not using it." >&4 ;;
11587 : see if cuserid exists
11588 set cuserid d_cuserid
11591 : see if this is a limits.h system
11592 set limits.h i_limits
11595 : see if this is a float.h system
11596 set float.h i_float
11599 : See if number of significant digits in a double precision number is known
11601 $cat >dbl_dig.c <<EOM
11602 #$i_limits I_LIMITS
11605 #include <limits.h>
11611 printf("Contains DBL_DIG");
11614 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
11615 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
11616 echo "DBL_DIG found." >&4
11619 echo "DBL_DIG NOT found." >&4
11626 : see if dbm.h is available
11627 : see if dbmclose exists
11628 set dbmclose d_dbmclose
11631 case "$d_dbmclose" in
11641 *) set rpcsvc/dbm.h i_rpcsvcdbm
11646 *) echo "We won't be including <dbm.h>"
11656 : see if prototype for dbminit is available
11658 set d_dbminitproto dbminit $i_dbm dbm.h
11661 : see if difftime exists
11662 set difftime d_difftime
11665 : see if this is a dirent system
11667 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
11669 echo "<dirent.h> found." >&4
11672 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
11673 echo "<sys/dir.h> found." >&4
11676 xinc=`./findhdr sys/ndir.h`
11678 echo "<dirent.h> NOT found." >&4
11683 : Look for type of directory structure.
11685 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11687 case "$direntrytype" in
11689 case "$i_dirent" in
11690 $define) guess1='struct dirent' ;;
11691 *) guess1='struct direct' ;;
11694 *) guess1="$direntrytype"
11699 'struct dirent') guess2='struct direct' ;;
11700 *) guess2='struct dirent' ;;
11703 if $contains "$guess1" try.c >/dev/null 2>&1; then
11704 direntrytype="$guess1"
11705 echo "Your directory entries are $direntrytype." >&4
11706 elif $contains "$guess2" try.c >/dev/null 2>&1; then
11707 direntrytype="$guess2"
11708 echo "Your directory entries seem to be $direntrytype." >&4
11710 echo "I don't recognize your system's directory entries." >&4
11711 rp="What type is used for directory entries on this system?"
11714 direntrytype="$ans"
11718 : see if the directory entry stores field length
11720 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11721 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
11722 echo "Good, your directory entry keeps length information in d_namlen." >&4
11725 echo "Your directory entry does not know about the d_namlen field." >&4
11732 : Look for DIR.dd_fd
11733 case "$i_dirent" in
11735 echo "Checking to see if DIR has a dd_fd member variable" >&4
11737 #$i_stdlib I_STDLIB
11739 #include <stdlib.h>
11741 #include <dirent.h>
11751 if eval $compile; then
11752 echo "Yes, it does."
11755 echo "No, it does not."
11760 echo "You don't have a <dirent.h>, so not checking for dd_fd." >&4
11768 : see if this is an sysdir system
11769 set sys/dir.h i_sysdir
11772 : see if this is an sysndir system
11773 set sys/ndir.h i_sysndir
11778 $cat >dirfd.c <<EOM
11780 #$i_stdlib I_STDLIB
11782 #include <stdlib.h>
11784 #$i_dirent I_DIRENT /**/
11785 #$i_sysdir I_SYS_DIR /**/
11786 #$i_sysndir I_SYS_NDIR /**/
11787 #$i_systypes I_SYS_TYPES /**/
11788 #if defined(I_SYS_TYPES)
11789 #include <sys/types.h>
11791 #if defined(I_DIRENT)
11792 #include <dirent.h>
11793 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
11794 #include <sys/dir.h>
11798 #include <sys/ndir.h>
11802 #include <ndir.h> /* may be wrong in the future */
11804 #include <sys/dir.h>
11810 DIR *dirp = opendir(".");
11811 if (dirfd(dirp) >= 0)
11819 if eval $compile; then
11823 $define) echo "dirfd() found." >&4 ;;
11824 *) echo "dirfd() NOT found." >&4 ;;
11830 : see if dlerror exists
11833 set dlerror d_dlerror
11837 : see if dlfcn is available
11838 set dlfcn.h i_dlfcn
11841 : Check what extension to use for shared libs
11846 On a few systems, the dynamically loaded modules that perl generates and uses
11847 will need a different extension than shared libs. The default will probably
11853 *) dflt="$dlext" ;;
11855 rp='What is the extension of dynamically loaded modules'
11864 : Check if dlsym need a leading underscore
11870 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
11871 $cat >dyna.c <<'EOM'
11878 #$i_stdlib I_STDLIB
11880 #include <stdlib.h>
11884 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
11886 #include <sys/types.h>
11891 extern int fred() ;
11900 int mode = RTLD_LAZY ;
11902 handle = dlopen("./dyna.$dlext", mode) ;
11903 if (handle == NULL) {
11908 symbol = dlsym(handle, "fred") ;
11909 if (symbol == NULL) {
11910 /* try putting a leading underscore */
11911 symbol = dlsym(handle, "_fred") ;
11912 if (symbol == NULL) {
11925 : Call the object file tmp-dyna.o in case dlext=o.
11926 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
11927 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
11928 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
11929 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
11932 1) echo "Test program failed using dlopen." >&4
11933 echo "Perhaps you should not use dynamic loading." >&4;;
11934 2) echo "Test program failed using dlsym." >&4
11935 echo "Perhaps you should not use dynamic loading." >&4;;
11936 3) echo "dlsym needs a leading underscore" >&4
11938 4) echo "dlsym doesn't need a leading underscore." >&4;;
11941 echo "I can't compile and run the test program." >&4
11942 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
11947 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
11952 : see if drand48_r exists
11953 set drand48_r d_drand48_r
11955 case "$d_drand48_r" in
11957 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
11958 case "$d_drand48_r_proto:$usethreads" in
11959 ":define") d_drand48_r_proto=define
11960 set d_drand48_r_proto drand48_r $hdrs
11964 case "$d_drand48_r_proto" in
11966 case "$drand48_r_proto" in
11967 ''|0) try='int drand48_r(struct drand48_data*, double*);'
11968 ./protochk "$extern_C $try" $hdrs && drand48_r_proto=I_ST ;;
11970 case "$drand48_r_proto" in
11971 ''|0) d_drand48_r=undef
11973 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
11974 * ) case "$drand48_r_proto" in
11975 REENTRANT_PROTO*) ;;
11976 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
11978 echo "Prototype: $try" ;;
11981 *) case "$usethreads" in
11982 define) echo "drand48_r has no prototype, not using it." >&4 ;;
11989 *) drand48_r_proto=0
11993 : see if prototype for drand48 is available
11995 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
11998 : see if dup2 exists
12002 : see if eaccess exists
12003 set eaccess d_eaccess
12006 : see if endgrent exists
12007 set endgrent d_endgrent
12010 : see if this is an grp system
12016 xxx=`./findhdr grp.h`
12017 $cppstdin $cppflags $cppminus < $xxx >$$.h
12019 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
12031 set d_grpasswd; eval $setvar
12035 : see if endgrent_r exists
12036 set endgrent_r d_endgrent_r
12038 case "$d_endgrent_r" in
12040 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12041 case "$d_endgrent_r_proto:$usethreads" in
12042 ":define") d_endgrent_r_proto=define
12043 set d_endgrent_r_proto endgrent_r $hdrs
12047 case "$d_endgrent_r_proto" in
12049 case "$endgrent_r_proto" in
12050 ''|0) try='int endgrent_r(FILE**);'
12051 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=I_H ;;
12053 case "$endgrent_r_proto" in
12054 ''|0) try='void endgrent_r(FILE**);'
12055 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=V_H ;;
12057 case "$endgrent_r_proto" in
12058 ''|0) d_endgrent_r=undef
12060 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
12061 * ) case "$endgrent_r_proto" in
12062 REENTRANT_PROTO*) ;;
12063 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
12065 echo "Prototype: $try" ;;
12068 *) case "$usethreads" in
12069 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
12076 *) endgrent_r_proto=0
12080 : see if endhostent exists
12081 set endhostent d_endhent
12084 : see if this is a netdb.h system
12085 set netdb.h i_netdb
12088 : see if endhostent_r exists
12089 set endhostent_r d_endhostent_r
12091 case "$d_endhostent_r" in
12093 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12094 case "$d_endhostent_r_proto:$usethreads" in
12095 ":define") d_endhostent_r_proto=define
12096 set d_endhostent_r_proto endhostent_r $hdrs
12100 case "$d_endhostent_r_proto" in
12102 case "$endhostent_r_proto" in
12103 ''|0) try='int endhostent_r(struct hostent_data*);'
12104 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=I_D ;;
12106 case "$endhostent_r_proto" in
12107 ''|0) try='void endhostent_r(struct hostent_data*);'
12108 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=V_D ;;
12110 case "$endhostent_r_proto" in
12111 ''|0) d_endhostent_r=undef
12112 endhostent_r_proto=0
12113 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
12114 * ) case "$endhostent_r_proto" in
12115 REENTRANT_PROTO*) ;;
12116 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
12118 echo "Prototype: $try" ;;
12121 *) case "$usethreads" in
12122 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
12124 d_endhostent_r=undef
12125 endhostent_r_proto=0
12129 *) endhostent_r_proto=0
12133 : see if endnetent exists
12134 set endnetent d_endnent
12137 : see if endnetent_r exists
12138 set endnetent_r d_endnetent_r
12140 case "$d_endnetent_r" in
12142 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12143 case "$d_endnetent_r_proto:$usethreads" in
12144 ":define") d_endnetent_r_proto=define
12145 set d_endnetent_r_proto endnetent_r $hdrs
12149 case "$d_endnetent_r_proto" in
12151 case "$endnetent_r_proto" in
12152 ''|0) try='int endnetent_r(struct netent_data*);'
12153 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=I_D ;;
12155 case "$endnetent_r_proto" in
12156 ''|0) try='void endnetent_r(struct netent_data*);'
12157 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=V_D ;;
12159 case "$endnetent_r_proto" in
12160 ''|0) d_endnetent_r=undef
12161 endnetent_r_proto=0
12162 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
12163 * ) case "$endnetent_r_proto" in
12164 REENTRANT_PROTO*) ;;
12165 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
12167 echo "Prototype: $try" ;;
12170 *) case "$usethreads" in
12171 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
12173 d_endnetent_r=undef
12174 endnetent_r_proto=0
12178 *) endnetent_r_proto=0
12182 : see if endprotoent exists
12183 set endprotoent d_endpent
12186 : see if endprotoent_r exists
12187 set endprotoent_r d_endprotoent_r
12189 case "$d_endprotoent_r" in
12191 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12192 case "$d_endprotoent_r_proto:$usethreads" in
12193 ":define") d_endprotoent_r_proto=define
12194 set d_endprotoent_r_proto endprotoent_r $hdrs
12198 case "$d_endprotoent_r_proto" in
12200 case "$endprotoent_r_proto" in
12201 ''|0) try='int endprotoent_r(struct protoent_data*);'
12202 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=I_D ;;
12204 case "$endprotoent_r_proto" in
12205 ''|0) try='void endprotoent_r(struct protoent_data*);'
12206 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=V_D ;;
12208 case "$endprotoent_r_proto" in
12209 ''|0) d_endprotoent_r=undef
12210 endprotoent_r_proto=0
12211 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
12212 * ) case "$endprotoent_r_proto" in
12213 REENTRANT_PROTO*) ;;
12214 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
12216 echo "Prototype: $try" ;;
12219 *) case "$usethreads" in
12220 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
12222 d_endprotoent_r=undef
12223 endprotoent_r_proto=0
12227 *) endprotoent_r_proto=0
12231 : see if endpwent exists
12232 set endpwent d_endpwent
12235 : see if this is a pwd.h system
12241 xxx=`./findhdr pwd.h`
12242 $cppstdin $cppflags $cppminus < $xxx >$$.h
12244 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
12252 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
12260 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
12268 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
12276 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
12284 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
12292 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
12300 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
12312 set d_pwquota; eval $setvar
12313 set d_pwage; eval $setvar
12314 set d_pwchange; eval $setvar
12315 set d_pwclass; eval $setvar
12316 set d_pwexpire; eval $setvar
12317 set d_pwcomment; eval $setvar
12318 set d_pwgecos; eval $setvar
12319 set d_pwpasswd; eval $setvar
12323 : see if endpwent_r exists
12324 set endpwent_r d_endpwent_r
12326 case "$d_endpwent_r" in
12328 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
12329 case "$d_endpwent_r_proto:$usethreads" in
12330 ":define") d_endpwent_r_proto=define
12331 set d_endpwent_r_proto endpwent_r $hdrs
12335 case "$d_endpwent_r_proto" in
12337 case "$endpwent_r_proto" in
12338 ''|0) try='int endpwent_r(FILE**);'
12339 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=I_H ;;
12341 case "$endpwent_r_proto" in
12342 ''|0) try='void endpwent_r(FILE**);'
12343 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=V_H ;;
12345 case "$endpwent_r_proto" in
12346 ''|0) d_endpwent_r=undef
12348 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
12349 * ) case "$endpwent_r_proto" in
12350 REENTRANT_PROTO*) ;;
12351 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
12353 echo "Prototype: $try" ;;
12356 *) case "$usethreads" in
12357 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
12364 *) endpwent_r_proto=0
12368 : see if endservent exists
12369 set endservent d_endsent
12372 : see if endservent_r exists
12373 set endservent_r d_endservent_r
12375 case "$d_endservent_r" in
12377 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12378 case "$d_endservent_r_proto:$usethreads" in
12379 ":define") d_endservent_r_proto=define
12380 set d_endservent_r_proto endservent_r $hdrs
12384 case "$d_endservent_r_proto" in
12386 case "$endservent_r_proto" in
12387 ''|0) try='int endservent_r(struct servent_data*);'
12388 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=I_D ;;
12390 case "$endservent_r_proto" in
12391 ''|0) try='void endservent_r(struct servent_data*);'
12392 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=V_D ;;
12394 case "$endservent_r_proto" in
12395 ''|0) d_endservent_r=undef
12396 endservent_r_proto=0
12397 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
12398 * ) case "$endservent_r_proto" in
12399 REENTRANT_PROTO*) ;;
12400 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
12402 echo "Prototype: $try" ;;
12405 *) case "$usethreads" in
12406 define) echo "endservent_r has no prototype, not using it." >&4 ;;
12408 d_endservent_r=undef
12409 endservent_r_proto=0
12413 *) endservent_r_proto=0
12417 : Locate the flags for 'open()'
12420 #include <sys/types.h>
12425 #include <sys/file.h>
12427 #$i_stdlib I_STDLIB
12429 #include <stdlib.h>
12440 : check sys/file.h first to get FREAD on Sun
12441 if $test `./findhdr sys/file.h` && \
12442 set try -DI_SYS_FILE && eval $compile; then
12444 echo "<sys/file.h> defines the O_* constants..." >&4
12445 if $run ./try; then
12446 echo "and you have the 3 argument form of open()." >&4
12449 echo "but not the 3 argument form of open(). Oh, well." >&4
12452 elif $test `./findhdr fcntl.h` && \
12453 set try -DI_FCNTL && eval $compile; then
12455 echo "<fcntl.h> defines the O_* constants..." >&4
12456 if $run ./try; then
12457 echo "and you have the 3 argument form of open()." >&4
12460 echo "but not the 3 argument form of open(). Oh, well." >&4
12465 echo "I can't find the O_* constant definitions! You got problems." >&4
12471 : see if this is a sys/file.h system
12476 : do we need to include sys/file.h ?
12480 if $h_sysfile; then
12482 echo "We'll be including <sys/file.h>." >&4
12485 echo "We won't be including <sys/file.h>." >&4
12495 : see if fcntl.h is there
12500 : see if we can include fcntl.h
12506 echo "We'll be including <fcntl.h>." >&4
12509 if $h_sysfile; then
12510 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
12512 echo "We won't be including <fcntl.h>." >&4
12524 : see if fork exists
12528 : see if pipe exists
12532 : check for non-blocking I/O stuff
12533 case "$h_sysfile" in
12534 true) echo "#include <sys/file.h>" > head.c;;
12537 true) echo "#include <fcntl.h>" > head.c;;
12538 *) echo "#include <sys/fcntl.h>" > head.c;;
12543 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
12544 case "$o_nonblock" in
12546 $cat head.c > try.c
12547 $cat >>try.c <<EOCP
12549 #$i_stdlib I_STDLIB
12551 #include <stdlib.h>
12559 printf("O_NONBLOCK\n");
12563 printf("O_NDELAY\n");
12567 printf("FNDELAY\n");
12574 if eval $compile_ok; then
12575 o_nonblock=`$run ./try`
12576 case "$o_nonblock" in
12577 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
12578 *) echo "Seems like we can use $o_nonblock.";;
12581 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
12584 *) echo "Using $hint value $o_nonblock.";;
12589 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
12592 case "$d_fork:$d_pipe" in
12594 $cat head.c > try.c
12595 $cat >>try.c <<EOCP
12597 #include <sys/types.h>
12598 #include <signal.h>
12600 #$i_stdlib I_STDLIB
12602 #include <stdlib.h>
12608 #define MY_O_NONBLOCK $o_nonblock
12609 #ifndef errno /* XXX need better Configure test */
12612 #$i_unistd I_UNISTD
12614 #include <unistd.h>
12616 #$i_string I_STRING
12618 #include <string.h>
12620 #include <strings.h>
12622 $signal_t blech(int x) { exit(3); }
12624 $cat >> try.c <<'EOCP'
12632 pipe(pd); /* Down: child -> parent */
12633 pipe(pu); /* Up: parent -> child */
12636 close(pd[1]); /* Parent reads from pd[0] */
12637 close(pu[0]); /* Parent writes (blocking) to pu[1] */
12639 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
12644 signal(SIGALRM, blech);
12646 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
12648 sprintf(string, "%d\n", ret);
12649 write(2, string, strlen(string));
12652 if (errno == EAGAIN) {
12653 printf("EAGAIN\n");
12658 if (errno == EWOULDBLOCK)
12659 printf("EWOULDBLOCK\n");
12662 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
12663 sleep(2); /* Give it time to close our pipe */
12665 ret = read(pd[0], buf, 1); /* Should read EOF */
12667 sprintf(string, "%d\n", ret);
12668 write(4, string, strlen(string));
12672 close(pd[0]); /* We write to pd[1] */
12673 close(pu[1]); /* We read from pu[0] */
12674 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
12675 close(pd[1]); /* Pipe pd is now fully closed! */
12676 exit(0); /* Bye bye, thank you for playing! */
12680 if eval $compile_ok; then
12681 echo "$startsh" >mtry
12682 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
12684 ./mtry >/dev/null 2>&1
12686 0) eagain=`$cat try.out`;;
12687 1) echo "Could not perform non-blocking setting!";;
12688 2) echo "I did a successful read() for something that was not there!";;
12689 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
12690 4) echo "Could not find F_SETFL!";;
12691 *) echo "Something terribly wrong happened during testing.";;
12693 rd_nodata=`$cat try.ret`
12694 echo "A read() system call with no data present returns $rd_nodata."
12695 case "$rd_nodata" in
12698 echo "(That's peculiar, fixing that to be -1.)"
12704 echo "Forcing errno EAGAIN on read() with no data available."
12708 echo "Your read() sets errno to $eagain when no data is available."
12711 status=`$cat try.err`
12713 0) echo "And it correctly returns 0 to signal EOF.";;
12714 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
12715 *) echo "However, your read() returns '$status' on EOF??";;
12718 if test "$status" = "$rd_nodata"; then
12719 echo "WARNING: you can't distinguish between EOF and no data!"
12723 echo "I can't compile the test program--assuming errno EAGAIN will do."
12727 *) echo "Can't figure out how to test this--assuming errno EAGAIN will do."
12736 echo "Using $hint value $eagain."
12737 echo "Your read() returns $rd_nodata when no data is present."
12738 case "$d_eofnblk" in
12739 "$define") echo "And you can see EOF because read() returns 0.";;
12740 "$undef") echo "But you can't see EOF status from read() returned value.";;
12742 echo "(Assuming you can't see EOF status from read anyway.)"
12748 $rm_try head.c mtry
12750 : see if _ptr and _cnt from stdio act std
12753 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
12754 echo "(Looks like you have stdio.h from BSD.)"
12755 case "$stdio_ptr" in
12756 '') stdio_ptr='((fp)->_p)'
12759 *) ptr_lval=$d_stdio_ptr_lval;;
12761 case "$stdio_cnt" in
12762 '') stdio_cnt='((fp)->_r)'
12765 *) cnt_lval=$d_stdio_cnt_lval;;
12767 case "$stdio_base" in
12768 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
12770 case "$stdio_bufsiz" in
12771 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
12773 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
12774 echo "(Looks like you have stdio.h from Linux.)"
12775 case "$stdio_ptr" in
12776 '') stdio_ptr='((fp)->_IO_read_ptr)'
12779 *) ptr_lval=$d_stdio_ptr_lval;;
12781 case "$stdio_cnt" in
12782 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
12785 *) cnt_lval=$d_stdio_cnt_lval;;
12787 case "$stdio_base" in
12788 '') stdio_base='((fp)->_IO_read_base)';;
12790 case "$stdio_bufsiz" in
12791 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
12794 case "$stdio_ptr" in
12795 '') stdio_ptr='((fp)->_ptr)'
12798 *) ptr_lval=$d_stdio_ptr_lval;;
12800 case "$stdio_cnt" in
12801 '') stdio_cnt='((fp)->_cnt)'
12804 *) cnt_lval=$d_stdio_cnt_lval;;
12806 case "$stdio_base" in
12807 '') stdio_base='((fp)->_base)';;
12809 case "$stdio_bufsiz" in
12810 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
12814 : test whether _ptr and _cnt really work
12815 echo "Checking how std your stdio is..." >&4
12818 #$i_stdlib I_STDLIB
12820 #include <stdlib.h>
12822 #define FILE_ptr(fp) $stdio_ptr
12823 #define FILE_cnt(fp) $stdio_cnt
12825 FILE *fp = fopen("try.c", "r");
12828 18 <= FILE_cnt(fp) &&
12829 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12837 if eval $compile && $to try.c; then
12838 if $run ./try; then
12839 echo "Your stdio acts pretty std."
12842 echo "Your stdio isn't very std."
12845 echo "Your stdio doesn't appear very std."
12849 # glibc 2.2.90 and above apparently change stdio streams so Perl's
12850 # direct buffer manipulation no longer works. The Configure tests
12851 # should be changed to correctly detect this, but until then,
12852 # the following check should at least let perl compile and run.
12853 # (This quick fix should be updated before 5.8.1.)
12854 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
12855 # A. Dougherty, June 3, 2002.
12856 case "$d_gnulibc" in
12858 case "$gnulibc_version" in
12862 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
12871 : Can _ptr be used as an lvalue?
12872 case "$d_stdstdio$ptr_lval" in
12873 $define$define) val=$define ;;
12876 set d_stdio_ptr_lval
12879 : Can _cnt be used as an lvalue?
12880 case "$d_stdstdio$cnt_lval" in
12881 $define$define) val=$define ;;
12884 set d_stdio_cnt_lval
12888 : test whether setting _ptr sets _cnt as a side effect
12889 d_stdio_ptr_lval_sets_cnt="$undef"
12890 d_stdio_ptr_lval_nochange_cnt="$undef"
12891 case "$d_stdio_ptr_lval$d_stdstdio" in
12893 echo "Checking to see what happens if we set the stdio ptr..." >&4
12896 /* Can we scream? */
12897 /* Eat dust sed :-) */
12898 /* In the buffer space, no one can hear you scream. */
12899 #$i_stdlib I_STDLIB
12901 #include <stdlib.h>
12903 #define FILE_ptr(fp) $stdio_ptr
12904 #define FILE_cnt(fp) $stdio_cnt
12905 #include <sys/types.h>
12907 FILE *fp = fopen("try.c", "r");
12912 puts("Fail even to read");
12915 c = getc(fp); /* Read away the first # */
12917 puts("Fail even to read");
12921 18 <= FILE_cnt(fp) &&
12922 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12924 puts("Fail even to read");
12927 ptr = (char*) FILE_ptr(fp);
12928 cnt = (size_t)FILE_cnt(fp);
12930 FILE_ptr(fp) += 42;
12932 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
12933 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
12936 if (FILE_cnt(fp) <= 20) {
12937 printf ("Fail (<20 chars to test)");
12940 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
12941 puts("Fail compare");
12944 if (cnt == FILE_cnt(fp)) {
12945 puts("Pass_unchanged");
12948 if (FILE_cnt(fp) == (cnt - 42)) {
12949 puts("Pass_changed");
12952 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
12958 if eval $compile && $to try.c; then
12959 case `$run ./try` in
12961 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
12962 d_stdio_ptr_lval_sets_cnt="$define" ;;
12964 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
12965 d_stdio_ptr_lval_nochange_cnt="$define" ;;
12967 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
12969 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
12972 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
12978 : see if _base is also standard
12980 case "$d_stdstdio" in
12984 #$i_stdlib I_STDLIB
12986 #include <stdlib.h>
12988 #define FILE_base(fp) $stdio_base
12989 #define FILE_bufsiz(fp) $stdio_bufsiz
12991 FILE *fp = fopen("try.c", "r");
12994 19 <= FILE_bufsiz(fp) &&
12995 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
13002 if eval $compile && $to try.c; then
13003 if $run ./try; then
13004 echo "And its _base field acts std."
13007 echo "But its _base field isn't std."
13010 echo "However, it seems to be lacking the _base field."
13018 : see if fast_stdio exists
13020 case "$d_stdstdio:$d_stdio_ptr_lval" in
13022 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
13024 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
13035 : see if fchdir exists
13036 set fchdir d_fchdir
13039 : see if fchmod exists
13040 set fchmod d_fchmod
13043 : see if fchown exists
13044 set fchown d_fchown
13047 : see if this is an fcntl system
13051 : See if fcntl-based locking works.
13054 #$i_stdlib I_STDLIB
13056 #include <stdlib.h>
13058 #include <unistd.h>
13060 #include <signal.h>
13061 $signal_t blech(int x) { exit(3); }
13063 #if defined(F_SETLK) && defined(F_SETLKW)
13064 struct flock flock;
13066 fd = open("try.c", O_RDONLY);
13067 flock.l_type = F_RDLCK;
13068 flock.l_whence = SEEK_SET;
13069 flock.l_start = flock.l_len = 0;
13070 signal(SIGALRM, blech);
13072 retval = fcntl(fd, F_SETLK, &flock);
13074 (retval < 0 ? exit(2) : exit(0));
13080 echo "Checking if fcntl-based file locking works... "
13084 if eval $compile_ok; then
13085 if $run ./try; then
13086 echo "Yes, it seems to work."
13089 echo "Nope, it didn't work."
13094 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
13095 *** This is (almost) impossible.
13096 *** If your NFS lock daemons are not feeling well, something like
13097 *** this may happen, please investigate. Cannot continue, aborting.
13105 echo "I'm unable to compile the test program, so I'll assume not."
13110 echo "Nope, since you don't even have fcntl()."
13113 set d_fcntl_can_lock
13117 : check for fd_set items
13120 Checking to see how well your C compiler handles fd_set and friends ...
13123 #$i_stdlib I_STDLIB
13125 #include <stdlib.h>
13127 #$i_systime I_SYS_TIME
13128 #$i_sysselct I_SYS_SELECT
13129 #$d_socket HAS_SOCKET
13130 #include <sys/types.h>
13132 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
13135 #include <sys/time.h>
13137 #ifdef I_SYS_SELECT
13138 #include <sys/select.h>
13147 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
13155 if eval $compile; then
13156 d_fds_bits="$define"
13158 echo "Well, your system knows about the normal fd_set typedef..." >&4
13159 if $run ./try; then
13160 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
13161 d_fd_macros="$define"
13164 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
13166 d_fd_macros="$undef"
13170 Hmm, your compiler has some difficulty with fd_set. Checking further...
13173 if eval $compile; then
13174 d_fds_bits="$undef"
13176 echo "Well, your system has some sort of fd_set available..." >&4
13177 if $run ./try; then
13178 echo "and you have the normal fd_set macros." >&4
13179 d_fd_macros="$define"
13182 but not the normal fd_set macros! Gross! More work for me...
13184 d_fd_macros="$undef"
13187 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
13189 d_fds_bits="$undef"
13190 d_fd_macros="$undef"
13195 : see if fgetpos exists
13196 set fgetpos d_fgetpos
13199 : see if finite exists
13200 set finite d_finite
13203 : see if finitel exists
13204 set finitel d_finitel
13207 : see if flock exists
13211 : see if prototype for flock is available
13213 set d_flockproto flock $i_sysfile sys/file.h
13216 : see if fp_class exists
13217 set fp_class d_fp_class
13220 : see if pathconf exists
13221 set pathconf d_pathconf
13224 : see if fpathconf exists
13225 set fpathconf d_fpathconf
13228 : see if fpclass exists
13229 set fpclass d_fpclass
13232 : see if fpclassify exists
13233 set fpclassify d_fpclassify
13236 : see if fpclassl exists
13237 set fpclassl d_fpclassl
13240 : check for fpos64_t
13242 echo "Checking to see if you have fpos64_t..." >&4
13245 int main() { fpos64_t x = 7; }
13248 if eval $compile; then
13250 echo "You have fpos64_t."
13253 echo "You do not have fpos64_t."
13254 case "$fpossize" in
13255 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
13262 : see if frexpl exists
13263 set frexpl d_frexpl
13266 : see if this is a sys/param system
13267 set sys/param.h i_sysparam
13270 : see if this is a sys/mount.h system
13271 set sys/mount.h i_sysmount
13274 : Check for fs_data_s
13276 echo "Checking to see if your system supports struct fs_data..." >&4
13277 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
13279 case "$d_fs_data_s" in
13280 "$define") echo "Yes, it does." ;;
13281 *) echo "No, it doesn't." ;;
13284 : see if fseeko exists
13285 set fseeko d_fseeko
13287 case "$longsize" in
13288 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
13291 : see if fsetpos exists
13292 set fsetpos d_fsetpos
13295 : see if fstatfs exists
13296 set fstatfs d_fstatfs
13299 : see if statvfs exists
13300 set statvfs d_statvfs
13303 : see if fstatvfs exists
13304 set fstatvfs d_fstatvfs
13308 : see if fsync exists
13312 : see if ftello exists
13313 set ftello d_ftello
13315 case "$longsize" in
13316 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
13319 : check for a working futimes
13322 echo "Checking if you have a working futimes()" >&4
13325 #include <sys/time.h>
13332 fd = open ("try.c", O_RDWR);
13333 if (-1 == fd) exit (1);
13334 rv = futimes (fd, NULL);
13335 exit (rv == -1 ? errno : 0);
13339 if eval $compile; then
13343 0) echo "Yes, you have" >&4
13344 d_futimes="$define"
13346 *) echo "No, you have futimes, but it isn't working ($rc) (probably harmless)" >&4
13350 echo "No, it does not (probably harmless)" >&4
13354 : see if ndbm.h is available
13357 : Compatibility location for RedHat 7.1
13358 set gdbm/ndbm.h i_gdbmndbm
13360 : Compatibility location for Debian 4.0
13361 set gdbm-ndbm.h i_gdbm_ndbm
13365 if $test "$i_ndbm" = "$define" -o "$i_gdbmndbm" = "$define" -o "$i_gdbm_ndbm" = "$define"; then
13366 : see if dbm_open exists
13367 set dbm_open d_dbm_open
13369 case "$d_dbm_open" in
13372 i_gdbmndbm="$undef"
13373 i_gdbm_ndbm="$undef"
13374 echo "We won't be including <ndbm.h>"
13384 ndbm_hdr_protochk='name=$1; hdr=$2;
13385 eval "ihdr=\$""i_$name";
13387 if $test "$ihdr" = "$define"; then
13388 $echo "Checking if your <$hdr> uses prototypes..." >&4;
13389 case "$d_cplusplus" in
13390 $define) ./protochk "$extern_C void dbm_close(DBM *);" literal "extern \"C\" {" $ihdr $hdr literal "}" && val="$define" ;;
13391 *) ./protochk "$extern_C void dbm_close(int, int);" $ihdr $hdr || val="$define" ;;
13394 $define) $echo "Your <$hdr> seems to have prototypes";;
13395 *) $echo "Your <$hdr> does not seem to have prototypes";;
13398 set "d_${name}_h_uses_prototypes";
13402 eval $ndbm_hdr_protochk
13403 set gdbmndbm gdbm/ndbm.h
13404 eval $ndbm_hdr_protochk
13405 set gdbm_ndbm gdbm-ndbm.h
13406 eval $ndbm_hdr_protochk
13408 : see if getaddrinfo exists
13409 set getaddrinfo d_getaddrinfo
13412 : see if getcwd exists
13413 set getcwd d_getcwd
13416 : see if getespwnam exists
13417 set getespwnam d_getespwnam
13420 : see if getfsstat exists
13421 set getfsstat d_getfsstat
13424 : see if getgrent exists
13425 set getgrent d_getgrent
13428 : see if getgrent_r exists
13429 set getgrent_r d_getgrent_r
13431 case "$d_getgrent_r" in
13433 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13434 case "$d_getgrent_r_proto:$usethreads" in
13435 ":define") d_getgrent_r_proto=define
13436 set d_getgrent_r_proto getgrent_r $hdrs
13440 case "$d_getgrent_r_proto" in
13442 case "$getgrent_r_proto" in
13443 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
13444 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBWR ;;
13446 case "$getgrent_r_proto" in
13447 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
13448 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIR ;;
13450 case "$getgrent_r_proto" in
13451 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
13452 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBW ;;
13454 case "$getgrent_r_proto" in
13455 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
13456 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBI ;;
13458 case "$getgrent_r_proto" in
13459 ''|0) try='int getgrent_r(struct group*, char*, int);'
13460 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBI ;;
13462 case "$getgrent_r_proto" in
13463 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
13464 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIH ;;
13466 case "$getgrent_r_proto" in
13467 ''|0) d_getgrent_r=undef
13469 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
13470 * ) case "$getgrent_r_proto" in
13471 REENTRANT_PROTO*) ;;
13472 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
13474 echo "Prototype: $try" ;;
13477 *) case "$usethreads" in
13478 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
13485 *) getgrent_r_proto=0
13489 : see if getgrgid_r exists
13490 set getgrgid_r d_getgrgid_r
13492 case "$d_getgrgid_r" in
13494 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13495 case "$d_getgrgid_r_proto:$usethreads" in
13496 ":define") d_getgrgid_r_proto=define
13497 set d_getgrgid_r_proto getgrgid_r $hdrs
13501 case "$d_getgrgid_r_proto" in
13503 case "$getgrgid_r_proto" in
13504 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
13505 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
13507 case "$getgrgid_r_proto" in
13508 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
13509 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
13511 case "$getgrgid_r_proto" in
13512 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
13513 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
13515 case "$getgrgid_r_proto" in
13516 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
13517 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
13519 case "$getgrgid_r_proto" in
13520 ''|0) d_getgrgid_r=undef
13522 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
13523 * ) case "$getgrgid_r_proto" in
13524 REENTRANT_PROTO*) ;;
13525 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
13527 echo "Prototype: $try" ;;
13530 *) case "$usethreads" in
13531 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
13538 *) getgrgid_r_proto=0
13542 : see if getgrnam_r exists
13543 set getgrnam_r d_getgrnam_r
13545 case "$d_getgrnam_r" in
13547 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13548 case "$d_getgrnam_r_proto:$usethreads" in
13549 ":define") d_getgrnam_r_proto=define
13550 set d_getgrnam_r_proto getgrnam_r $hdrs
13554 case "$d_getgrnam_r_proto" in
13556 case "$getgrnam_r_proto" in
13557 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
13558 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
13560 case "$getgrnam_r_proto" in
13561 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
13562 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
13564 case "$getgrnam_r_proto" in
13565 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
13566 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CBI ;;
13568 case "$getgrnam_r_proto" in
13569 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
13570 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
13572 case "$getgrnam_r_proto" in
13573 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
13574 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
13576 case "$getgrnam_r_proto" in
13577 ''|0) d_getgrnam_r=undef
13579 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
13580 * ) case "$getgrnam_r_proto" in
13581 REENTRANT_PROTO*) ;;
13582 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
13584 echo "Prototype: $try" ;;
13587 *) case "$usethreads" in
13588 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
13595 *) getgrnam_r_proto=0
13599 : see if gethostbyaddr exists
13600 set gethostbyaddr d_gethbyaddr
13603 : see if gethostbyname exists
13604 set gethostbyname d_gethbyname
13607 : see if gethostent exists
13608 set gethostent d_gethent
13611 : see how we will look up host name
13614 if set gethostname val -f d_gethname; eval $csym; $val; then
13615 echo 'gethostname() found.' >&4
13616 d_gethname="$define"
13619 if set uname val -f d_uname; eval $csym; $val; then
13622 uname() was found, but you're running xenix, and older versions of xenix
13623 have a broken uname(). If you don't really know whether your xenix is old
13624 enough to have a broken system call, use the default answer.
13629 "$define") dflt=n;;
13631 rp='Is your uname() broken?'
13634 n*) d_uname="$define"; call=uname;;
13637 echo 'uname() found.' >&4
13644 case "$d_gethname" in
13645 '') d_gethname="$undef";;
13648 '') d_uname="$undef";;
13650 case "$d_uname$d_gethname" in
13655 Every now and then someone has a $call() that lies about the hostname
13656 but can't be fixed for political or economic reasons. If you wish, I can
13657 pretend $call() isn't there and maybe compute hostname at run-time
13658 thanks to the '$phostname' command.
13661 rp="Shall I ignore $call() from now on?"
13664 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
13667 case "$phostname" in
13668 '') aphostname='';;
13669 *) case "$aphostname" in
13671 *) set X $phostname
13675 file=`./loc $file $file $pth`
13676 aphostname=`echo $file $*`
13681 case "$d_uname$d_gethname" in
13684 case "$phostname" in
13686 echo "There will be no way for $package to get your hostname." >&4;;
13688 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
13692 case "$d_phostname" in
13693 '') d_phostname="$undef";;
13696 : see if gethostbyaddr_r exists
13697 set gethostbyaddr_r d_gethostbyaddr_r
13699 case "$d_gethostbyaddr_r" in
13701 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13702 case "$d_gethostbyaddr_r_proto:$usethreads" in
13703 ":define") d_gethostbyaddr_r_proto=define
13704 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
13708 case "$d_gethostbyaddr_r_proto" in
13710 case "$gethostbyaddr_r_proto" in
13711 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13712 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
13714 case "$gethostbyaddr_r_proto" in
13715 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
13716 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
13718 case "$gethostbyaddr_r_proto" in
13719 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
13720 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
13722 case "$gethostbyaddr_r_proto" in
13723 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
13724 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
13726 case "$gethostbyaddr_r_proto" in
13727 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
13728 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
13730 case "$gethostbyaddr_r_proto" in
13731 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
13732 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
13734 case "$gethostbyaddr_r_proto" in
13735 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
13736 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
13738 case "$gethostbyaddr_r_proto" in
13739 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
13740 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
13742 case "$gethostbyaddr_r_proto" in
13743 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
13744 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
13746 case "$gethostbyaddr_r_proto" in
13747 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
13748 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
13750 case "$gethostbyaddr_r_proto" in
13751 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13752 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
13754 case "$gethostbyaddr_r_proto" in
13755 ''|0) d_gethostbyaddr_r=undef
13756 gethostbyaddr_r_proto=0
13757 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
13758 * ) case "$gethostbyaddr_r_proto" in
13759 REENTRANT_PROTO*) ;;
13760 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
13762 echo "Prototype: $try" ;;
13765 *) case "$usethreads" in
13766 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
13768 d_gethostbyaddr_r=undef
13769 gethostbyaddr_r_proto=0
13773 *) gethostbyaddr_r_proto=0
13777 : see if gethostbyname_r exists
13778 set gethostbyname_r d_gethostbyname_r
13780 case "$d_gethostbyname_r" in
13782 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13783 case "$d_gethostbyname_r_proto:$usethreads" in
13784 ":define") d_gethostbyname_r_proto=define
13785 set d_gethostbyname_r_proto gethostbyname_r $hdrs
13789 case "$d_gethostbyname_r_proto" in
13791 case "$gethostbyname_r_proto" in
13792 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
13793 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
13795 case "$gethostbyname_r_proto" in
13796 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
13797 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
13799 case "$gethostbyname_r_proto" in
13800 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
13801 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
13803 case "$gethostbyname_r_proto" in
13804 ''|0) d_gethostbyname_r=undef
13805 gethostbyname_r_proto=0
13806 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
13807 * ) case "$gethostbyname_r_proto" in
13808 REENTRANT_PROTO*) ;;
13809 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
13811 echo "Prototype: $try" ;;
13814 *) case "$usethreads" in
13815 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
13817 d_gethostbyname_r=undef
13818 gethostbyname_r_proto=0
13822 *) gethostbyname_r_proto=0
13826 : see if gethostent_r exists
13827 set gethostent_r d_gethostent_r
13829 case "$d_gethostent_r" in
13831 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13832 case "$d_gethostent_r_proto:$usethreads" in
13833 ":define") d_gethostent_r_proto=define
13834 set d_gethostent_r_proto gethostent_r $hdrs
13838 case "$d_gethostent_r_proto" in
13840 case "$gethostent_r_proto" in
13841 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
13842 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
13844 case "$gethostent_r_proto" in
13845 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
13846 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBIE ;;
13848 case "$gethostent_r_proto" in
13849 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
13850 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBIE ;;
13852 case "$gethostent_r_proto" in
13853 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
13854 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBI ;;
13856 case "$gethostent_r_proto" in
13857 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
13858 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBI ;;
13860 case "$gethostent_r_proto" in
13861 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
13862 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SD ;;
13864 case "$gethostent_r_proto" in
13865 ''|0) d_gethostent_r=undef
13866 gethostent_r_proto=0
13867 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
13868 * ) case "$gethostent_r_proto" in
13869 REENTRANT_PROTO*) ;;
13870 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
13872 echo "Prototype: $try" ;;
13875 *) case "$usethreads" in
13876 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
13878 d_gethostent_r=undef
13879 gethostent_r_proto=0
13883 *) gethostent_r_proto=0
13887 : see if prototypes for various gethostxxx netdb.h functions are available
13889 set d_gethostprotos gethostent $i_netdb netdb.h
13892 : see if getitimer exists
13893 set getitimer d_getitimer
13896 : see if getlogin exists
13897 set getlogin d_getlogin
13900 : see if getlogin_r exists
13901 set getlogin_r d_getlogin_r
13903 case "$d_getlogin_r" in
13905 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
13906 case "$d_getlogin_r_proto:$usethreads" in
13907 ":define") d_getlogin_r_proto=define
13908 set d_getlogin_r_proto getlogin_r $hdrs
13912 case "$d_getlogin_r_proto" in
13914 case "$getlogin_r_proto" in
13915 ''|0) try='int getlogin_r(char*, size_t);'
13916 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BW ;;
13918 case "$getlogin_r_proto" in
13919 ''|0) try='int getlogin_r(char*, int);'
13920 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BI ;;
13922 case "$getlogin_r_proto" in
13923 ''|0) try='char* getlogin_r(char*, size_t);'
13924 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BW ;;
13926 case "$getlogin_r_proto" in
13927 ''|0) try='char* getlogin_r(char*, int);'
13928 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BI ;;
13930 case "$getlogin_r_proto" in
13931 ''|0) d_getlogin_r=undef
13933 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
13934 * ) case "$getlogin_r_proto" in
13935 REENTRANT_PROTO*) ;;
13936 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
13938 echo "Prototype: $try" ;;
13941 *) case "$usethreads" in
13942 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
13949 *) getlogin_r_proto=0
13953 : see if getmnt exists
13954 set getmnt d_getmnt
13957 : see if getmntent exists
13958 set getmntent d_getmntent
13961 : see if getnameinfo exists
13962 set getnameinfo d_getnameinfo
13965 : see if getnetbyaddr exists
13966 set getnetbyaddr d_getnbyaddr
13969 : see if getnetbyname exists
13970 set getnetbyname d_getnbyname
13973 : see if getnetent exists
13974 set getnetent d_getnent
13977 : see if getnetbyaddr_r exists
13978 set getnetbyaddr_r d_getnetbyaddr_r
13980 case "$d_getnetbyaddr_r" in
13982 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13983 case "$d_getnetbyaddr_r_proto:$usethreads" in
13984 ":define") d_getnetbyaddr_r_proto=define
13985 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
13989 case "$d_getnetbyaddr_r_proto" in
13991 case "$getnetbyaddr_r_proto" in
13992 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
13993 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
13995 case "$getnetbyaddr_r_proto" in
13996 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
13997 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
13999 case "$getnetbyaddr_r_proto" in
14000 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
14001 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
14003 case "$getnetbyaddr_r_proto" in
14004 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
14005 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
14007 case "$getnetbyaddr_r_proto" in
14008 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
14009 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
14011 case "$getnetbyaddr_r_proto" in
14012 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
14013 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
14015 case "$getnetbyaddr_r_proto" in
14016 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
14017 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
14019 case "$getnetbyaddr_r_proto" in
14020 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
14021 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
14023 case "$getnetbyaddr_r_proto" in
14024 ''|0) d_getnetbyaddr_r=undef
14025 getnetbyaddr_r_proto=0
14026 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
14027 * ) case "$getnetbyaddr_r_proto" in
14028 REENTRANT_PROTO*) ;;
14029 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
14031 echo "Prototype: $try" ;;
14034 *) case "$usethreads" in
14035 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
14037 d_getnetbyaddr_r=undef
14038 getnetbyaddr_r_proto=0
14042 *) getnetbyaddr_r_proto=0
14046 : see if getnetbyname_r exists
14047 set getnetbyname_r d_getnetbyname_r
14049 case "$d_getnetbyname_r" in
14051 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14052 case "$d_getnetbyname_r_proto:$usethreads" in
14053 ":define") d_getnetbyname_r_proto=define
14054 set d_getnetbyname_r_proto getnetbyname_r $hdrs
14058 case "$d_getnetbyname_r_proto" in
14060 case "$getnetbyname_r_proto" in
14061 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
14062 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
14064 case "$getnetbyname_r_proto" in
14065 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
14066 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
14068 case "$getnetbyname_r_proto" in
14069 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
14070 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
14072 case "$getnetbyname_r_proto" in
14073 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
14074 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
14076 case "$getnetbyname_r_proto" in
14077 ''|0) d_getnetbyname_r=undef
14078 getnetbyname_r_proto=0
14079 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
14080 * ) case "$getnetbyname_r_proto" in
14081 REENTRANT_PROTO*) ;;
14082 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
14084 echo "Prototype: $try" ;;
14087 *) case "$usethreads" in
14088 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
14090 d_getnetbyname_r=undef
14091 getnetbyname_r_proto=0
14095 *) getnetbyname_r_proto=0
14099 : see if getnetent_r exists
14100 set getnetent_r d_getnetent_r
14102 case "$d_getnetent_r" in
14104 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14105 case "$d_getnetent_r_proto:$usethreads" in
14106 ":define") d_getnetent_r_proto=define
14107 set d_getnetent_r_proto getnetent_r $hdrs
14111 case "$d_getnetent_r_proto" in
14113 case "$getnetent_r_proto" in
14114 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
14115 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
14117 case "$getnetent_r_proto" in
14118 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
14119 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBIE ;;
14121 case "$getnetent_r_proto" in
14122 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
14123 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBIE ;;
14125 case "$getnetent_r_proto" in
14126 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
14127 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBI ;;
14129 case "$getnetent_r_proto" in
14130 ''|0) try='int getnetent_r(struct netent*, char*, int);'
14131 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBI ;;
14133 case "$getnetent_r_proto" in
14134 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
14135 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SD ;;
14137 case "$getnetent_r_proto" in
14138 ''|0) d_getnetent_r=undef
14139 getnetent_r_proto=0
14140 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
14141 * ) case "$getnetent_r_proto" in
14142 REENTRANT_PROTO*) ;;
14143 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
14145 echo "Prototype: $try" ;;
14148 *) case "$usethreads" in
14149 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
14151 d_getnetent_r=undef
14152 getnetent_r_proto=0
14156 *) getnetent_r_proto=0
14160 : see if prototypes for various getnetxxx netdb.h functions are available
14162 set d_getnetprotos getnetent $i_netdb netdb.h
14165 : see if getpagesize exists
14166 set getpagesize d_getpagsz
14169 : Optional checks for getprotobyname and getprotobynumber
14171 : see if getprotobyname exists
14172 set getprotobyname d_getpbyname
14175 : see if getprotobynumber exists
14176 set getprotobynumber d_getpbynumber
14179 : see if getprotoent exists
14180 set getprotoent d_getpent
14183 : see if getpgid exists
14184 set getpgid d_getpgid
14187 : see if getpgrp2 exists
14188 set getpgrp2 d_getpgrp2
14191 : see if getppid exists
14192 set getppid d_getppid
14195 : see if getpriority exists
14196 set getpriority d_getprior
14199 : see if getprotobyname_r exists
14200 set getprotobyname_r d_getprotobyname_r
14202 case "$d_getprotobyname_r" in
14204 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14205 case "$d_getprotobyname_r_proto:$usethreads" in
14206 ":define") d_getprotobyname_r_proto=define
14207 set d_getprotobyname_r_proto getprotobyname_r $hdrs
14211 case "$d_getprotobyname_r_proto" in
14213 case "$getprotobyname_r_proto" in
14214 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
14215 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
14217 case "$getprotobyname_r_proto" in
14218 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
14219 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
14221 case "$getprotobyname_r_proto" in
14222 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
14223 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
14225 case "$getprotobyname_r_proto" in
14226 ''|0) d_getprotobyname_r=undef
14227 getprotobyname_r_proto=0
14228 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
14229 * ) case "$getprotobyname_r_proto" in
14230 REENTRANT_PROTO*) ;;
14231 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
14233 echo "Prototype: $try" ;;
14236 *) case "$usethreads" in
14237 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
14239 d_getprotobyname_r=undef
14240 getprotobyname_r_proto=0
14244 *) getprotobyname_r_proto=0
14248 : see if getprotobynumber_r exists
14249 set getprotobynumber_r d_getprotobynumber_r
14251 case "$d_getprotobynumber_r" in
14253 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14254 case "$d_getprotobynumber_r_proto:$usethreads" in
14255 ":define") d_getprotobynumber_r_proto=define
14256 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
14260 case "$d_getprotobynumber_r_proto" in
14262 case "$getprotobynumber_r_proto" in
14263 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
14264 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
14266 case "$getprotobynumber_r_proto" in
14267 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
14268 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
14270 case "$getprotobynumber_r_proto" in
14271 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
14272 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
14274 case "$getprotobynumber_r_proto" in
14275 ''|0) d_getprotobynumber_r=undef
14276 getprotobynumber_r_proto=0
14277 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
14278 * ) case "$getprotobynumber_r_proto" in
14279 REENTRANT_PROTO*) ;;
14280 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
14282 echo "Prototype: $try" ;;
14285 *) case "$usethreads" in
14286 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
14288 d_getprotobynumber_r=undef
14289 getprotobynumber_r_proto=0
14293 *) getprotobynumber_r_proto=0
14297 : see if getprotoent_r exists
14298 set getprotoent_r d_getprotoent_r
14300 case "$d_getprotoent_r" in
14302 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14303 case "$d_getprotoent_r_proto:$usethreads" in
14304 ":define") d_getprotoent_r_proto=define
14305 set d_getprotoent_r_proto getprotoent_r $hdrs
14309 case "$d_getprotoent_r_proto" in
14311 case "$getprotoent_r_proto" in
14312 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
14313 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
14315 case "$getprotoent_r_proto" in
14316 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
14317 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBI ;;
14319 case "$getprotoent_r_proto" in
14320 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
14321 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=S_SBI ;;
14323 case "$getprotoent_r_proto" in
14324 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
14325 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SD ;;
14327 case "$getprotoent_r_proto" in
14328 ''|0) d_getprotoent_r=undef
14329 getprotoent_r_proto=0
14330 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
14331 * ) case "$getprotoent_r_proto" in
14332 REENTRANT_PROTO*) ;;
14333 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
14335 echo "Prototype: $try" ;;
14338 *) case "$usethreads" in
14339 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
14341 d_getprotoent_r=undef
14342 getprotoent_r_proto=0
14346 *) getprotoent_r_proto=0
14350 : see if prototypes for various getprotoxxx netdb.h functions are available
14352 set d_getprotoprotos getprotoent $i_netdb netdb.h
14355 : see if getprpwnam exists
14356 set getprpwnam d_getprpwnam
14359 : see if getpwent exists
14360 set getpwent d_getpwent
14363 : see if getpwent_r exists
14364 set getpwent_r d_getpwent_r
14366 case "$d_getpwent_r" in
14368 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14369 case "$d_getpwent_r_proto:$usethreads" in
14370 ":define") d_getpwent_r_proto=define
14371 set d_getpwent_r_proto getpwent_r $hdrs
14375 case "$d_getpwent_r_proto" in
14377 case "$getpwent_r_proto" in
14378 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
14379 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBWR ;;
14381 case "$getpwent_r_proto" in
14382 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
14383 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIR ;;
14385 case "$getpwent_r_proto" in
14386 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
14387 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBW ;;
14389 case "$getpwent_r_proto" in
14390 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
14391 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBI ;;
14393 case "$getpwent_r_proto" in
14394 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
14395 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBI ;;
14397 case "$getpwent_r_proto" in
14398 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
14399 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIH ;;
14401 case "$getpwent_r_proto" in
14402 ''|0) d_getpwent_r=undef
14404 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
14405 * ) case "$getpwent_r_proto" in
14406 REENTRANT_PROTO*) ;;
14407 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
14409 echo "Prototype: $try" ;;
14412 *) case "$usethreads" in
14413 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
14420 *) getpwent_r_proto=0
14424 : see if getpwnam_r exists
14425 set getpwnam_r d_getpwnam_r
14427 case "$d_getpwnam_r" in
14429 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14430 case "$d_getpwnam_r_proto:$usethreads" in
14431 ":define") d_getpwnam_r_proto=define
14432 set d_getpwnam_r_proto getpwnam_r $hdrs
14436 case "$d_getpwnam_r_proto" in
14438 case "$getpwnam_r_proto" in
14439 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
14440 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
14442 case "$getpwnam_r_proto" in
14443 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
14444 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
14446 case "$getpwnam_r_proto" in
14447 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
14448 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
14450 case "$getpwnam_r_proto" in
14451 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
14452 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
14454 case "$getpwnam_r_proto" in
14455 ''|0) d_getpwnam_r=undef
14457 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
14458 * ) case "$getpwnam_r_proto" in
14459 REENTRANT_PROTO*) ;;
14460 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
14462 echo "Prototype: $try" ;;
14465 *) case "$usethreads" in
14466 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
14473 *) getpwnam_r_proto=0
14477 : see if getpwuid_r exists
14478 set getpwuid_r d_getpwuid_r
14480 case "$d_getpwuid_r" in
14482 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14483 case "$d_getpwuid_r_proto:$usethreads" in
14484 ":define") d_getpwuid_r_proto=define
14485 set d_getpwuid_r_proto getpwuid_r $hdrs
14489 case "$d_getpwuid_r_proto" in
14491 case "$getpwuid_r_proto" in
14492 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
14493 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
14495 case "$getpwuid_r_proto" in
14496 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
14497 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
14499 case "$getpwuid_r_proto" in
14500 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
14501 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
14503 case "$getpwuid_r_proto" in
14504 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
14505 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
14507 case "$getpwuid_r_proto" in
14508 ''|0) d_getpwuid_r=undef
14510 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
14511 * ) case "$getpwuid_r_proto" in
14512 REENTRANT_PROTO*) ;;
14513 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
14515 echo "Prototype: $try" ;;
14518 *) case "$usethreads" in
14519 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
14526 *) getpwuid_r_proto=0
14530 : Optional checks for getsbyname and getsbyport
14532 : see if getservbyname exists
14533 set getservbyname d_getsbyname
14536 : see if getservbyport exists
14537 set getservbyport d_getsbyport
14540 : see if getservent exists
14541 set getservent d_getsent
14544 : see if getservbyname_r exists
14545 set getservbyname_r d_getservbyname_r
14547 case "$d_getservbyname_r" in
14549 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14550 case "$d_getservbyname_r_proto:$usethreads" in
14551 ":define") d_getservbyname_r_proto=define
14552 set d_getservbyname_r_proto getservbyname_r $hdrs
14556 case "$d_getservbyname_r_proto" in
14558 case "$getservbyname_r_proto" in
14559 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
14560 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
14562 case "$getservbyname_r_proto" in
14563 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
14564 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
14566 case "$getservbyname_r_proto" in
14567 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
14568 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
14570 case "$getservbyname_r_proto" in
14571 ''|0) d_getservbyname_r=undef
14572 getservbyname_r_proto=0
14573 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
14574 * ) case "$getservbyname_r_proto" in
14575 REENTRANT_PROTO*) ;;
14576 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
14578 echo "Prototype: $try" ;;
14581 *) case "$usethreads" in
14582 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
14584 d_getservbyname_r=undef
14585 getservbyname_r_proto=0
14589 *) getservbyname_r_proto=0
14593 : see if getservbyport_r exists
14594 set getservbyport_r d_getservbyport_r
14596 case "$d_getservbyport_r" in
14598 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14599 case "$d_getservbyport_r_proto:$usethreads" in
14600 ":define") d_getservbyport_r_proto=define
14601 set d_getservbyport_r_proto getservbyport_r $hdrs
14605 case "$d_getservbyport_r_proto" in
14607 case "$getservbyport_r_proto" in
14608 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
14609 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
14611 case "$getservbyport_r_proto" in
14612 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
14613 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
14615 case "$getservbyport_r_proto" in
14616 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
14617 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
14619 case "$getservbyport_r_proto" in
14620 ''|0) d_getservbyport_r=undef
14621 getservbyport_r_proto=0
14622 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
14623 * ) case "$getservbyport_r_proto" in
14624 REENTRANT_PROTO*) ;;
14625 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
14627 echo "Prototype: $try" ;;
14630 *) case "$usethreads" in
14631 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
14633 d_getservbyport_r=undef
14634 getservbyport_r_proto=0
14638 *) getservbyport_r_proto=0
14642 : see if getservent_r exists
14643 set getservent_r d_getservent_r
14645 case "$d_getservent_r" in
14647 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14648 case "$d_getservent_r_proto:$usethreads" in
14649 ":define") d_getservent_r_proto=define
14650 set d_getservent_r_proto getservent_r $hdrs
14654 case "$d_getservent_r_proto" in
14656 case "$getservent_r_proto" in
14657 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
14658 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBWR ;;
14660 case "$getservent_r_proto" in
14661 ''|0) try='int getservent_r(struct servent*, char*, int);'
14662 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBI ;;
14664 case "$getservent_r_proto" in
14665 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
14666 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=S_SBI ;;
14668 case "$getservent_r_proto" in
14669 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
14670 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SD ;;
14672 case "$getservent_r_proto" in
14673 ''|0) d_getservent_r=undef
14674 getservent_r_proto=0
14675 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
14676 * ) case "$getservent_r_proto" in
14677 REENTRANT_PROTO*) ;;
14678 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
14680 echo "Prototype: $try" ;;
14683 *) case "$usethreads" in
14684 define) echo "getservent_r has no prototype, not using it." >&4 ;;
14686 d_getservent_r=undef
14687 getservent_r_proto=0
14691 *) getservent_r_proto=0
14695 : see if prototypes for various getservxxx netdb.h functions are available
14697 set d_getservprotos getservent $i_netdb netdb.h
14700 : see if getspnam exists
14701 set getspnam d_getspnam
14704 : see if this is a shadow.h system
14705 set shadow.h i_shadow
14708 : see if getspnam_r exists
14709 set getspnam_r d_getspnam_r
14711 case "$d_getspnam_r" in
14713 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
14714 case "$d_getspnam_r_proto:$usethreads" in
14715 ":define") d_getspnam_r_proto=define
14716 set d_getspnam_r_proto getspnam_r $hdrs
14720 case "$d_getspnam_r_proto" in
14722 case "$getspnam_r_proto" in
14723 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
14724 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
14726 case "$getspnam_r_proto" in
14727 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
14728 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=S_CSBI ;;
14730 case "$getspnam_r_proto" in
14731 ''|0) d_getspnam_r=undef
14733 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
14734 * ) case "$getspnam_r_proto" in
14735 REENTRANT_PROTO*) ;;
14736 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
14738 echo "Prototype: $try" ;;
14741 *) case "$usethreads" in
14742 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
14749 *) getspnam_r_proto=0
14753 : see if gettimeofday or ftime exists
14754 set gettimeofday d_gettimeod
14756 case "$d_gettimeod" in
14762 val="$undef"; set d_ftime; eval $setvar
14765 case "$d_gettimeod$d_ftime" in
14768 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
14772 : see if gmtime_r exists
14773 set gmtime_r d_gmtime_r
14775 case "$d_gmtime_r" in
14777 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14778 case "$d_gmtime_r_proto:$usethreads" in
14779 ":define") d_gmtime_r_proto=define
14780 set d_gmtime_r_proto gmtime_r $hdrs
14784 case "$d_gmtime_r_proto" in
14786 case "$gmtime_r_proto" in
14787 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
14788 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=S_TS ;;
14790 case "$gmtime_r_proto" in
14791 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
14792 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=I_TS ;;
14794 case "$gmtime_r_proto" in
14795 ''|0) d_gmtime_r=undef
14797 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
14798 * ) case "$gmtime_r_proto" in
14799 REENTRANT_PROTO*) ;;
14800 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
14802 echo "Prototype: $try" ;;
14805 *) case "$usethreads" in
14806 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
14813 *) gmtime_r_proto=0
14817 : see if hasmntopt exists
14818 set hasmntopt d_hasmntopt
14821 : see if this is a netinet/in.h or sys/in.h system
14822 set netinet/in.h i_niin sys/in.h i_sysin
14825 : see if arpa/inet.h has to be included
14826 set arpa/inet.h i_arpainet
14829 : see if htonl --and friends-- exists
14834 : Maybe they are macros.
14837 $cat >htonl.c <<EOM
14839 #include <sys/types.h>
14840 #$i_niin I_NETINET_IN
14842 #$i_arpainet I_ARPA_INET
14843 #ifdef I_NETINET_IN
14844 #include <netinet/in.h>
14847 #include <sys/in.h>
14850 #include <arpa/inet.h>
14853 printf("Defined as a macro.");
14856 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
14857 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
14859 echo "But it seems to be defined as a macro." >&4
14867 : see if ilogbl exists
14868 set ilogbl d_ilogbl
14873 if set index val -f; eval $csym; $val; then
14874 if set strchr val -f d_strchr; eval $csym; $val; then
14875 if $contains strchr "$strings" >/dev/null 2>&1 ; then
14878 echo "strchr() found." >&4
14882 echo "index() found." >&4
14887 echo "index() found." >&4
14890 if set strchr val -f d_strchr; eval $csym; $val; then
14893 echo "strchr() found." >&4
14895 echo "No index() or strchr() found!" >&4
14900 set d_strchr; eval $setvar
14902 set d_index; eval $setvar
14904 : check whether inet_aton exists
14905 set inet_aton d_inetaton
14908 : see if inet_ntop exists
14909 set inet_ntop d_inetntop
14912 : see if inet_pton exists
14913 set inet_pton d_inetpton
14918 $cat >isascii.c <<EOCP
14921 #$i_stdlib I_STDLIB
14923 #include <stdlib.h>
14934 if eval $compile; then
14935 echo "isascii() found." >&4
14938 echo "isascii() NOT found." >&4
14945 : see if isfinite exists
14946 set isfinite d_isfinite
14949 : see if isinf exists
14953 : see if isnan exists
14957 : see if isnanl exists
14958 set isnanl d_isnanl
14961 : see if killpg exists
14962 set killpg d_killpg
14965 : see if lchown exists
14967 $cat > try.c <<'EOCP'
14968 /* System header to define __stub macros and hopefully few prototypes,
14969 which can conflict with char lchown(); below. */
14970 #include <assert.h>
14971 /* Override any gcc2 internal prototype to avoid an error. */
14972 /* We use char because int might match the return type of a gcc2
14973 builtin and then its argument prototype would still apply. */
14976 /* The GNU C library defines this for functions which it implements
14977 to always fail with ENOSYS. Some functions are actually named
14978 something starting with __ and the normal name is an alias. */
14979 #if defined (__stub_lchown) || defined (__stub___lchown)
14987 if eval $compile; then
14988 $echo "lchown() found." >&4
14991 $echo "lchown() NOT found." >&4
14997 : See if number of significant digits in a double precision number is known
14999 $cat >ldbl_dig.c <<EOM
15000 #$i_limits I_LIMITS
15003 #include <limits.h>
15009 printf("Contains LDBL_DIG");
15012 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
15013 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
15014 echo "LDBL_DIG found." >&4
15017 echo "LDBL_DIG NOT found." >&4
15024 : see if this is a math.h system
15028 : check to see if math.h defines _LIB_VERSION
15029 d_libm_lib_version="$undef"
15033 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
15035 #include <unistd.h>
15037 int main (int argc, char *argv[])
15039 printf ("%d\n", _LIB_VERSION);
15044 if eval $compile; then
15046 echo "Yes, it does ($foo)" >&4
15047 d_libm_lib_version="$define"
15049 echo "No, it does not (probably harmless)" >&4
15056 : see if link exists
15060 : see if localtime_r exists
15061 set localtime_r d_localtime_r
15063 case "$d_localtime_r" in
15065 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
15066 case "$d_localtime_r_proto:$usethreads" in
15067 ":define") d_localtime_r_proto=define
15068 set d_localtime_r_proto localtime_r $hdrs
15072 case "$d_localtime_r_proto" in
15074 case "$localtime_r_proto" in
15075 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
15076 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=S_TS ;;
15078 case "$localtime_r_proto" in
15079 ''|0) try='int localtime_r(const time_t*, struct tm*);'
15080 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=I_TS ;;
15082 case "$localtime_r_proto" in
15083 ''|0) d_localtime_r=undef
15084 localtime_r_proto=0
15085 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
15086 * ) case "$localtime_r_proto" in
15087 REENTRANT_PROTO*) ;;
15088 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
15090 echo "Prototype: $try" ;;
15093 *) case "$usethreads" in
15094 define) echo "localtime_r has no prototype, not using it." >&4 ;;
15096 d_localtime_r=undef
15097 localtime_r_proto=0
15101 *) localtime_r_proto=0
15105 : see if localtime_r calls tzset
15106 case "$localtime_r_proto" in
15109 /* Does our libc's localtime_r call tzset ?
15110 * return 0 if so, 1 otherwise.
15112 #$i_systypes I_SYS_TYPES
15113 #$i_unistd I_UNISTD
15115 #$i_stdlib I_STDLIB
15116 #$i_string I_STRING
15117 #$i_malloc I_MALLOC
15119 # include <sys/types.h>
15122 # include <unistd.h>
15128 #include <stdlib.h>
15131 # include <string.h>
15133 # include <strings.h>
15136 # include <malloc.h>
15140 time_t t = time(0L);
15141 char w_tz[]="TZ" "=GMT+5",
15142 e_tz[]="TZ" "=GMT-5",
15143 *tz_e = (char*)malloc(16),
15144 *tz_w = (char*)malloc(16);
15145 struct tm tm_e, tm_w;
15146 memset(&tm_e,'\0',sizeof(struct tm));
15147 memset(&tm_w,'\0',sizeof(struct tm));
15152 localtime_r(&t, &tm_e);
15155 localtime_r(&t, &tm_w);
15157 if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 )
15163 if eval $compile; then
15164 if $run ./try; then
15165 d_localtime_r_needs_tzset=undef;
15167 d_localtime_r_needs_tzset=define;
15170 d_localtime_r_needs_tzset=undef;
15174 d_localtime_r_needs_tzset=undef;
15179 : see if localeconv exists
15180 set localeconv d_locconv
15183 : see if lockf exists
15187 : see if prototype for lseek is available
15189 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
15192 : see if lstat exists
15196 : see if madvise exists
15197 set madvise d_madvise
15200 : see if malloc_size exists
15201 set malloc_size d_malloc_size
15204 : see if malloc_size_good exists
15205 set malloc_good_size d_malloc_good_size
15208 : see if mblen exists
15212 : see if mbstowcs exists
15213 set mbstowcs d_mbstowcs
15216 : see if mbtowc exists
15217 set mbtowc d_mbtowc
15220 : see if memchr exists
15221 set memchr d_memchr
15224 : see if memcmp exists
15225 set memcmp d_memcmp
15228 : see if memcpy exists
15229 set memcpy d_memcpy
15232 : see if memmove exists
15233 set memmove d_memmove
15236 : see if memset exists
15237 set memset d_memset
15240 : see if mkdir exists
15244 : see if mkdtemp exists
15245 set mkdtemp d_mkdtemp
15248 : see if mkfifo exists
15249 set mkfifo d_mkfifo
15252 : see if mkstemp exists
15253 set mkstemp d_mkstemp
15256 : see if mkstemps exists
15257 set mkstemps d_mkstemps
15260 : see if mktime exists
15261 set mktime d_mktime
15264 : see if this is a sys/mman.h system
15265 set sys/mman.h i_sysmman
15268 : see if mmap exists
15271 : see what shmat returns
15272 : default to something harmless
15274 case "$i_sysmman$d_mmap" in
15276 $cat >mmap.c <<'END'
15277 #include <sys/mman.h>
15280 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
15285 echo "and it returns ($mmaptype)." >&4
15291 : see if sqrtl exists
15295 : see if scalbnl exists
15296 set scalbnl d_scalbnl
15299 : see if modfl exists
15303 : see if prototype for modfl is available
15305 set d_modflproto modfl $i_math math.h
15308 d_modfl_pow32_bug="$undef"
15310 case "$d_longdbl$d_modfl" in
15313 Checking to see whether your modfl() is okay for large values...
15319 if $test "X$d_modflproto" != "X$define"; then
15320 $cat >>try.c <<EOCP
15321 /* Sigh. many current glibcs provide the function, but do not prototype it. */
15322 long double modfl (long double, long double *);
15325 $cat >>try.c <<EOCP
15327 long double nv = 4294967303.15;
15333 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
15337 case "$osname:$gccversion" in
15338 aix:) saveccflags="$ccflags"
15339 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
15342 if eval $compile; then
15345 *" 4294967303.150000 1.150000 4294967302.000000")
15346 echo >&4 "Your modfl() is broken for large values."
15347 d_modfl_pow32_bug="$define"
15349 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
15353 *" 4294967303.150000 0.150000 4294967303.000000")
15354 echo >&4 "Your modfl() seems okay for large values."
15356 *) echo >&4 "I don't understand your modfl() at all."
15362 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
15365 case "$osname:$gccversion" in
15366 aix:) ccflags="$saveccflags" ;; # restore
15371 if $test "$uselongdouble" = "$define"; then
15373 if $test "$d_sqrtl" != "$define"; then
15374 message="$message sqrtl"
15376 if $test "$d_modfl" != "$define"; then
15377 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
15378 echo "You have both aintl and copysignl, so I can emulate modfl."
15380 message="$message modfl"
15383 if $test "$d_frexpl" != "$define"; then
15384 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
15385 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
15387 message="$message frexpl"
15391 if $test "$message" != ""; then
15394 *** You requested the use of long doubles but you do not seem to have
15395 *** the following mathematical functions needed for long double support:
15397 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
15398 *** Cannot continue, aborting.
15406 : see if mprotect exists
15407 set mprotect d_mprotect
15410 : see if msgctl exists
15411 set msgctl d_msgctl
15414 : see if msgget exists
15415 set msgget d_msgget
15418 : see if msgsnd exists
15419 set msgsnd d_msgsnd
15422 : see if msgrcv exists
15423 set msgrcv d_msgrcv
15426 : see how much of the 'msg*(2)' library is present.
15429 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
15430 *"$undef"*) h_msg=false;;
15434 case "`ipcs 2>&1`" in
15435 "SVID messages"*"not configured"*)
15436 echo "Your $osname does not have the msg*(2) configured." >&4
15439 set msgctl d_msgctl
15441 set msgget d_msgget
15443 set msgsnd d_msgsnd
15445 set msgrcv d_msgrcv
15451 : we could also check for sys/ipc.h ...
15452 if $h_msg && $test `./findhdr sys/msg.h`; then
15453 echo "You have the full msg*(2) library." >&4
15456 echo "You don't have the full msg*(2) library." >&4
15462 : Check for msghdr_s
15464 echo "Checking to see if your system supports struct msghdr..." >&4
15465 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
15467 case "$d_msghdr_s" in
15468 "$define") echo "Yes, it does." ;;
15469 *) echo "No, it doesn't." ;;
15473 : see if msync exists
15477 : see if munmap exists
15478 set munmap d_munmap
15481 : see if nice exists
15485 : see if this is a langinfo.h system
15486 set langinfo.h i_langinfo
15489 : see if nl_langinfo exists
15490 set nl_langinfo d_nl_langinfo
15493 : check for volatile keyword
15495 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
15496 $cat >try.c <<'EOCP'
15499 typedef struct _goo_struct goo_struct;
15500 goo_struct * volatile goo = ((goo_struct *)0);
15501 struct _goo_struct {
15506 typedef unsigned short foo_t;
15507 char *volatile foo;
15509 volatile foo_t blech;
15513 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
15515 echo "Yup, it does."
15518 echo "Nope, it doesn't."
15524 : Check basic sizes
15526 $echo "Choosing the C types to be used for Perl's internal types..." >&4
15528 case "$use64bitint:$d_quad:$quadtype" in
15531 uvtype="$uquadtype"
15536 uvtype="unsigned long"
15542 case "$uselongdouble:$d_longdbl" in
15544 nvtype="long double"
15545 nvsize=$longdblsize
15552 $echo "(IV will be "$ivtype", $ivsize bytes)"
15553 $echo "(UV will be "$uvtype", $uvsize bytes)"
15554 $echo "(NV will be "$nvtype", $nvsize bytes)"
15557 #$i_inttypes I_INTTYPES
15559 #include <inttypes.h>
15564 int8_t i = INT8_MAX;
15565 uint8_t u = UINT8_MAX;
15566 printf("int8_t\n");
15569 int16_t i = INT16_MAX;
15570 uint16_t i = UINT16_MAX;
15571 printf("int16_t\n");
15574 int32_t i = INT32_MAX;
15575 uint32_t u = UINT32_MAX;
15576 printf("int32_t\n");
15581 i8type="signed char"
15582 u8type="unsigned char"
15587 '') case "$shortsize" in
15589 u16type="unsigned short"
15597 '') set try -DINT16
15598 if eval $compile; then
15599 case "`$run ./try`" in
15611 '') if $test $shortsize -ge 2; then
15613 u16type="unsigned short"
15621 '') case "$longsize" in
15623 u32type="unsigned long"
15627 *) case "$intsize" in
15629 u32type="unsigned int"
15639 '') set try -DINT32
15640 if eval $compile; then
15641 case "`$run ./try`" in
15653 '') if $test $intsize -ge 4; then
15655 u32type="unsigned int"
15663 '') case "$d_quad:$quadtype" in
15665 i64type="$quadtype"
15666 u64type="$uquadtype"
15674 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
15675 : volatile so that the compiler has to store it out to memory.
15676 if test X"$d_volatile" = X"$define"; then
15681 #$i_stdlib I_STDLIB
15683 #include <stdlib.h>
15685 #include <sys/types.h>
15686 #include <signal.h>
15688 $volatile int bletched = 0;
15689 $signal_t blech(int s) { bletched = 1; }
15694 int n = 8 * $uvsize;
15697 signal(SIGFPE, blech);
15700 for (i = 0; i < n; i++) {
15701 u = u << 1 | ($uvtype)1;
15703 if (($uvtype)d != u)
15707 d = ($nvtype)(u - 1);
15708 if (($uvtype)d != (u - 1))
15715 printf("%d\n", ((i == n) ? -n : i));
15721 d_nv_preserves_uv="$undef"
15722 if eval $compile; then
15723 nv_preserves_uv_bits="`$run ./try`"
15725 case "$nv_preserves_uv_bits" in
15727 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
15728 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
15729 d_nv_preserves_uv="$define"
15731 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
15732 d_nv_preserves_uv="$undef" ;;
15733 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
15734 nv_preserves_uv_bits="0" ;;
15738 $echo "Checking to find the largest integer value your NVs can hold..." >&4
15739 : volatile so that the compiler has to store it out to memory.
15740 if test X"$d_volatile" = X"$define"; then
15746 typedef $nvtype NV;
15753 while(count < 256) {
15754 $volatile NV up = value + 1.0;
15755 $volatile NV negated = -value;
15756 $volatile NV down = negated - 1.0;
15757 $volatile NV got_up = up - value;
15758 int up_good = got_up == 1.0;
15759 int got_down = down - negated;
15760 int down_good = got_down == -1.0;
15762 if (down_good != up_good) {
15764 "Inconsistency - up %d %f; down %d %f; for 2**%d (%.20f)\n",
15765 up_good, (double) got_up, down_good, (double) got_down,
15766 count, (double) value);
15773 fputs("256.0", stdout);
15776 fputs("2.0", stdout);
15782 fputs("*", stdout);
15788 fprintf(stderr, "Cannot overflow integer range, even at 2**%d (%.20f)\n",
15789 count, (double) value);
15795 nv_overflows_integers_at='0'
15796 if eval $compile; then
15802 The largest integer your NVs can preserve is equal to $xxx
15804 nv_overflows_integers_at="$xxx"
15807 Cannot determine the largest integer value your NVs can hold, unexpected output
15814 Cannot determine the largest integer value your NVs can hold
15821 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
15822 : volatile so that the compiler has to store it out to memory.
15823 if test X"$d_volatile" = X"$define"; then
15828 #$i_stdlib I_STDLIB
15830 #include <stdlib.h>
15832 #$i_string I_STRING
15834 # include <string.h>
15836 # include <strings.h>
15838 #include <sys/types.h>
15839 #include <signal.h>
15841 $volatile int bletched = 0;
15842 $signal_t blech(int s) { bletched = 1; }
15845 int checkit($nvtype d, char *where) {
15846 unsigned char *p = (char *)&d;
15847 unsigned char *end = p + sizeof(d);
15857 printf("No - %s: 0x", where);
15859 printf ("%02X", *p++);
15864 int main(int argc, char **argv) {
15867 fail += checkit(d, "0.0");
15869 /* The compiler shouldn't be assuming that bletched is 0 */
15872 fail += checkit(d, "bleched");
15875 signal(SIGFPE, blech);
15878 /* Paranoia - the compiler should have no way of knowing that ANSI says
15879 that argv[argc] will always be NULL. Actually, if it did assume this it
15880 would be buggy, as this is C and main() can be called from elsewhere in
15882 d = argv[argc] ? 1 : 0;
15885 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
15888 fail += checkit(d, "ternary");
15890 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
15893 printf("No - memset doesn't give 0.0\n");
15894 /* This might just blow up: */
15895 printf("(gives %g)\n", d);
15901 printf("No - something bleched\n");
15906 printf("No - %d fail(s)\n", fail);
15915 d_nv_zero_is_allbits_zero="$undef"
15916 if eval $compile; then
15922 0.0 is represented as all bits zero in memory
15924 d_nv_zero_is_allbits_zero="$define"
15927 0.0 is not represented as all bits zero in memory
15929 d_nv_zero_is_allbits_zero="$undef"
15934 0.0 is not represented as all bits zero in memory
15936 d_nv_zero_is_allbits_zero="$undef"
15942 : check for off64_t
15944 echo "Checking to see if you have off64_t..." >&4
15946 #include <sys/types.h>
15947 #include <unistd.h>
15948 int main() { off64_t x = 7; }
15951 if eval $compile; then
15953 echo "You have off64_t."
15956 echo "You do not have off64_t."
15957 case "$lseeksize" in
15958 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
15965 : how to create joinable pthreads
15966 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
15968 echo "Checking what constant to use for creating joinable pthreads..." >&4
15969 $cat >try.c <<'EOCP'
15970 #include <pthread.h>
15972 int detachstate = JOINABLE;
15975 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
15976 if eval $compile; then
15977 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
15978 val="$undef" # Yes, undef.
15979 set d_old_pthread_create_joinable
15982 set old_pthread_create_joinable
15985 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
15986 if eval $compile; then
15987 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
15989 set d_old_pthread_create_joinable
15991 val=PTHREAD_CREATE_UNDETACHED
15992 set old_pthread_create_joinable
15995 set try -DJOINABLE=__UNDETACHED
15996 if eval $compile; then
15997 echo "You seem to use __UNDETACHED." >&4
15999 set d_old_pthread_create_joinable
16002 set old_pthread_create_joinable
16005 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
16007 set d_old_pthread_create_joinable
16010 set old_pthread_create_joinable
16017 d_old_pthread_create_joinable="$undef"
16018 old_pthread_create_joinable=""
16021 : see if pause exists
16025 : see if poll exists
16029 : see if readlink exists
16030 set readlink d_readlink
16033 : Check if exe is symlink to abs path of executing program
16037 case "$d_readlink" in
16039 if $issymlink /proc/self/exe ; then
16040 $ls -l /proc/self/exe > reflect
16041 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
16042 echo "You have Linux-like /proc/self/exe."
16043 procselfexe='"/proc/self/exe"'
16047 if $issymlink /proc/curproc/file ; then
16048 $ls -l /proc/curproc/file > reflect
16049 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
16050 echo "You have BSD-like /proc/curproc/file."
16051 procselfexe='"/proc/curproc/file"'
16061 : backward compatibility for d_hvfork
16062 if test X$d_hvfork != X; then
16063 d_vfork="$d_hvfork"
16066 : see if there is a vfork
16071 d_pseudofork=$undef
16073 : Ok, but do we want to use it. vfork is reportedly unreliable in
16074 : perl on Solaris 2.x, and probably elsewhere.
16078 case "$usevfork" in
16084 Perl can only use a vfork() that doesn't suffer from strict
16085 restrictions on calling functions or modifying global data in
16086 the child. For example, glibc-2.1 contains such a vfork()
16087 that is unsuitable. If your system provides a proper fork()
16088 call, chances are that you do NOT want perl to use vfork().
16091 rp="Do you still want to use vfork()?"
16096 echo "Ok, we won't use vfork()."
16105 $define) usevfork='true';;
16106 *) usevfork='false';;
16109 : see whether the pthread_atfork exists
16111 #include <pthread.h>
16114 #ifdef PTHREAD_ATFORK
16115 pthread_atfork(NULL,NULL,NULL);
16120 : see if pthread_atfork exists
16121 set try -DPTHREAD_ATFORK
16122 if eval $compile; then
16127 case "$usethreads" in
16130 $define) echo 'pthread_atfork found.' >&4 ;;
16131 *) echo 'pthread_atfork NOT found.' >&4 ;;
16134 set d_pthread_atfork
16137 : see if pthread_attr_setscope exists
16138 set pthread_attr_setscope d_pthread_attr_setscope
16141 : see whether the various POSIXish _yields exist
16143 #include <pthread.h>
16149 #ifdef PTHREAD_YIELD
16152 #ifdef PTHREAD_YIELD_NULL
16153 pthread_yield(NULL);
16159 : see if sched_yield exists
16160 set try -DSCHED_YIELD
16161 if eval $compile; then
16163 sched_yield='sched_yield()'
16167 case "$usethreads" in
16170 $define) echo 'sched_yield() found.' >&4 ;;
16171 *) echo 'sched_yield() NOT found.' >&4 ;;
16177 : see if pthread_yield exists
16178 set try -DPTHREAD_YIELD
16179 if eval $compile; then
16181 case "$sched_yield" in
16182 '') sched_yield='pthread_yield()' ;;
16185 set try -DPTHREAD_YIELD_NULL
16186 if eval $compile; then
16188 case "$sched_yield" in
16189 '') sched_yield='pthread_yield(NULL)' ;;
16195 case "$usethreads" in
16198 $define) echo 'pthread_yield() found.' >&4 ;;
16199 *) echo 'pthread_yield() NOT found.' >&4 ;;
16203 set d_pthread_yield
16205 case "$sched_yield" in
16206 '') sched_yield=undef ;;
16210 : see if random_r exists
16211 set random_r d_random_r
16213 case "$d_random_r" in
16215 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
16216 case "$d_random_r_proto:$usethreads" in
16217 ":define") d_random_r_proto=define
16218 set d_random_r_proto random_r $hdrs
16222 case "$d_random_r_proto" in
16224 case "$random_r_proto" in
16225 ''|0) try='int random_r(int*, struct random_data*);'
16226 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_iS ;;
16228 case "$random_r_proto" in
16229 ''|0) try='int random_r(long*, struct random_data*);'
16230 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_lS ;;
16232 case "$random_r_proto" in
16233 ''|0) try='int random_r(struct random_data*, int32_t*);'
16234 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_St ;;
16236 case "$random_r_proto" in
16237 ''|0) d_random_r=undef
16239 echo "Disabling random_r, cannot determine prototype." >&4 ;;
16240 * ) case "$random_r_proto" in
16241 REENTRANT_PROTO*) ;;
16242 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
16244 echo "Prototype: $try" ;;
16247 *) case "$usethreads" in
16248 define) echo "random_r has no prototype, not using it." >&4 ;;
16255 *) random_r_proto=0
16259 : see if readdir and friends exist
16260 set readdir d_readdir
16262 set seekdir d_seekdir
16264 set telldir d_telldir
16266 set rewinddir d_rewinddir
16269 : see if readdir64_r exists
16270 set readdir64_r d_readdir64_r
16272 case "$d_readdir64_r" in
16274 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
16275 case "$d_readdir64_r_proto:$usethreads" in
16276 ":define") d_readdir64_r_proto=define
16277 set d_readdir64_r_proto readdir64_r $hdrs
16281 case "$d_readdir64_r_proto" in
16283 case "$readdir64_r_proto" in
16284 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
16285 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TSR ;;
16287 case "$readdir64_r_proto" in
16288 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
16289 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TS ;;
16291 case "$readdir64_r_proto" in
16292 ''|0) d_readdir64_r=undef
16293 readdir64_r_proto=0
16294 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
16295 * ) case "$readdir64_r_proto" in
16296 REENTRANT_PROTO*) ;;
16297 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
16299 echo "Prototype: $try" ;;
16302 *) case "$usethreads" in
16303 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
16305 d_readdir64_r=undef
16306 readdir64_r_proto=0
16310 *) readdir64_r_proto=0
16314 : see if readdir_r exists
16315 set readdir_r d_readdir_r
16317 case "$d_readdir_r" in
16319 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
16320 case "$d_readdir_r_proto:$usethreads" in
16321 ":define") d_readdir_r_proto=define
16322 set d_readdir_r_proto readdir_r $hdrs
16326 case "$d_readdir_r_proto" in
16328 case "$readdir_r_proto" in
16329 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
16330 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TSR ;;
16332 case "$readdir_r_proto" in
16333 ''|0) try='int readdir_r(DIR*, struct dirent*);'
16334 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TS ;;
16336 case "$readdir_r_proto" in
16337 ''|0) d_readdir_r=undef
16339 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
16340 * ) case "$readdir_r_proto" in
16341 REENTRANT_PROTO*) ;;
16342 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
16344 echo "Prototype: $try" ;;
16347 *) case "$usethreads" in
16348 define) echo "readdir_r has no prototype, not using it." >&4 ;;
16355 *) readdir_r_proto=0
16359 : see if readv exists
16363 : see if recvmsg exists
16364 set recvmsg d_recvmsg
16367 : see if rename exists
16368 set rename d_rename
16371 : see if rmdir exists
16375 : see if memory.h is available.
16380 : See if it conflicts with string.h
16386 $cppstdin $cppflags $cppminus < $strings > mem.h
16387 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
16389 echo "We won't be including <memory.h>."
16399 : can bcopy handle overlapping blocks?
16402 case "$d_memmove" in
16403 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
16404 *) case "$d_bcopy" in
16406 echo "Checking to see if bcopy() can do overlapping copies..." >&4
16408 #$i_memory I_MEMORY
16409 #$i_stdlib I_STDLIB
16410 #$i_string I_STRING
16411 #$i_unistd I_UNISTD
16413 $cat >>try.c <<'EOCP'
16416 # include <memory.h>
16419 # include <stdlib.h>
16422 # include <string.h>
16424 # include <strings.h>
16427 # include <unistd.h> /* Needed for NetBSD */
16431 char buf[128], abc[128];
16437 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16438 try to store the string in read-only memory. */
16439 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
16441 for (align = 7; align >= 0; align--) {
16442 for (len = 36; len; len--) {
16444 bcopy(abc, b, len);
16445 for (off = 1; off <= len; off++) {
16446 bcopy(b, b+off, len);
16447 bcopy(b+off, b, len);
16448 if (bcmp(b, abc, len))
16457 if eval $compile_ok; then
16458 if $run ./try 2>/dev/null; then
16459 echo "Yes, it can."
16462 echo "It can't, sorry."
16465 echo "(I can't compile the test program, so we'll assume not...)"
16475 : can memcpy handle overlapping blocks?
16478 case "$d_memmove" in
16479 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
16480 *) case "$d_memcpy" in
16482 echo "Checking to see if memcpy() can do overlapping copies..." >&4
16484 #$i_memory I_MEMORY
16485 #$i_stdlib I_STDLIB
16486 #$i_string I_STRING
16487 #$i_unistd I_UNISTD
16489 $cat >>try.c <<'EOCP'
16492 # include <memory.h>
16495 # include <stdlib.h>
16498 # include <string.h>
16500 # include <strings.h>
16503 # include <unistd.h> /* Needed for NetBSD */
16507 char buf[128], abc[128];
16513 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16514 try to store the string in read-only memory. */
16515 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
16517 for (align = 7; align >= 0; align--) {
16518 for (len = 36; len; len--) {
16520 memcpy(b, abc, len);
16521 for (off = 1; off <= len; off++) {
16522 memcpy(b+off, b, len);
16523 memcpy(b, b+off, len);
16524 if (memcmp(b, abc, len))
16533 if eval $compile_ok; then
16534 if $run ./try 2>/dev/null; then
16535 echo "Yes, it can."
16538 echo "It can't, sorry."
16541 echo "(I can't compile the test program, so we'll assume not...)"
16551 : can memcmp be trusted to compare relative magnitude?
16553 case "$d_memcmp" in
16556 echo "Checking if your memcmp() can compare relative magnitude..." >&4
16558 #$i_memory I_MEMORY
16559 #$i_stdlib I_STDLIB
16560 #$i_string I_STRING
16561 #$i_unistd I_UNISTD
16563 $cat >>try.c <<'EOCP'
16566 # include <memory.h>
16569 # include <stdlib.h>
16572 # include <string.h>
16574 # include <strings.h>
16577 # include <unistd.h> /* Needed for NetBSD */
16583 if ((a < b) && memcmp(&a, &b, 1) < 0)
16589 if eval $compile_ok; then
16590 if $run ./try 2>/dev/null; then
16591 echo "Yes, it can."
16594 echo "No, it can't (it uses signed chars)."
16597 echo "(I can't compile the test program, so we'll assume not...)"
16605 : see if prototype for sbrk is available
16607 set d_sbrkproto sbrk $i_unistd unistd.h
16610 : see if select exists
16611 set select d_select
16614 : see if semctl exists
16615 set semctl d_semctl
16618 : see if semget exists
16619 set semget d_semget
16622 : see if semop exists
16626 : see how much of the 'sem*(2)' library is present.
16629 case "$d_semctl$d_semget$d_semop" in
16630 *"$undef"*) h_sem=false;;
16634 case "`ipcs 2>&1`" in
16635 "SVID messages"*"not configured"*)
16636 echo "Your $osname does not have the sem*(2) configured." >&4
16639 set semctl d_semctl
16641 set semget d_semget
16649 : we could also check for sys/ipc.h ...
16650 if $h_sem && $test `./findhdr sys/sem.h`; then
16651 echo "You have the full sem*(2) library." >&4
16654 echo "You don't have the full sem*(2) library." >&4
16660 : see whether sys/sem.h defines union semun
16662 $cat > try.c <<'END'
16663 #include <sys/types.h>
16664 #include <sys/ipc.h>
16665 #include <sys/sem.h>
16666 int main () { union semun semun; semun.buf = 0; }
16669 if eval $compile; then
16670 echo "You have union semun in <sys/sem.h>." >&4
16673 echo "You do not have union semun in <sys/sem.h>." >&4
16680 : see how to do semctl IPC_STAT
16684 $cat > tryh.h <<END
16687 # define S_IRUSR S_IREAD
16688 # define S_IWUSR S_IWRITE
16689 # define S_IXUSR S_IEXEC
16691 # define S_IRUSR 0400
16692 # define S_IWUSR 0200
16693 # define S_IXUSR 0100
16695 # define S_IRGRP (S_IRUSR>>3)
16696 # define S_IWGRP (S_IWUSR>>3)
16697 # define S_IXGRP (S_IXUSR>>3)
16698 # define S_IROTH (S_IRUSR>>6)
16699 # define S_IWOTH (S_IWUSR>>6)
16700 # define S_IXOTH (S_IXUSR>>6)
16703 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
16704 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
16705 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
16708 : see whether semctl IPC_STAT can use union semun
16709 case "$d_semctl_semun" in
16713 #include <sys/types.h>
16714 #include <sys/ipc.h>
16715 #include <sys/sem.h>
16716 #include <sys/stat.h>
16723 #$d_union_semun HAS_UNION_SEMUN
16726 #ifndef HAS_UNION_SEMUN
16729 struct semid_ds *buf;
16730 unsigned short *array;
16736 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16737 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16739 struct semid_ds argbuf;
16742 st = semctl(sem, 0, IPC_STAT, arg);
16746 # endif /* IPC_STAT */
16747 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16749 if (semctl(sem, 0, IPC_RMID, arg) != 0)
16750 # endif /* IPC_RMID */
16751 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16753 #endif /* IPC_PRIVATE && ... */
16754 printf("semget failed: errno = %d\n", errno);
16759 if eval $compile; then
16762 semun) val="$define" ;;
16770 case "$d_semctl_semun" in
16772 echo "You can use union semun for semctl IPC_STAT." >&4
16775 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
16780 : see whether semctl IPC_STAT can use struct semid_ds pointer
16781 case "$d_semctl_semid_ds" in
16784 $cat > try.c <<'END'
16785 #include <sys/types.h>
16786 #include <sys/ipc.h>
16787 #include <sys/sem.h>
16788 #include <sys/stat.h>
16796 struct semid_ds arg;
16799 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16800 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16803 st = semctl(sem, 0, IPC_STAT, &arg);
16805 printf("semid_ds\n");
16807 # endif /* IPC_STAT */
16808 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16810 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
16811 # endif /* IPC_RMID */
16812 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16814 #endif /* IPC_PRIVATE && ... */
16815 printf("semget failed: errno = %d\n", errno);
16821 if eval $compile; then
16824 semid_ds) val="$define" ;;
16828 set d_semctl_semid_ds
16832 case "$d_semctl_semid_ds" in
16834 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
16836 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
16842 # We do not have the full sem*(2) library, so assume we can not
16848 set d_semctl_semid_ds
16854 : see if sendmsg exists
16855 set sendmsg d_sendmsg
16858 : see if setegid exists
16859 set setegid d_setegid
16862 : see if seteuid exists
16863 set seteuid d_seteuid
16866 : see if setgrent exists
16867 set setgrent d_setgrent
16870 : see if setgrent_r exists
16871 set setgrent_r d_setgrent_r
16873 case "$d_setgrent_r" in
16875 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
16876 case "$d_setgrent_r_proto:$usethreads" in
16877 ":define") d_setgrent_r_proto=define
16878 set d_setgrent_r_proto setgrent_r $hdrs
16882 case "$d_setgrent_r_proto" in
16884 case "$setgrent_r_proto" in
16885 ''|0) try='int setgrent_r(FILE**);'
16886 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=I_H ;;
16888 case "$setgrent_r_proto" in
16889 ''|0) try='void setgrent_r(FILE**);'
16890 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=V_H ;;
16892 case "$setgrent_r_proto" in
16893 ''|0) d_setgrent_r=undef
16895 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
16896 * ) case "$setgrent_r_proto" in
16897 REENTRANT_PROTO*) ;;
16898 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
16900 echo "Prototype: $try" ;;
16903 *) case "$usethreads" in
16904 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
16911 *) setgrent_r_proto=0
16915 : see if sethostent exists
16916 set sethostent d_sethent
16919 : see if sethostent_r exists
16920 set sethostent_r d_sethostent_r
16922 case "$d_sethostent_r" in
16924 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16925 case "$d_sethostent_r_proto:$usethreads" in
16926 ":define") d_sethostent_r_proto=define
16927 set d_sethostent_r_proto sethostent_r $hdrs
16931 case "$d_sethostent_r_proto" in
16933 case "$sethostent_r_proto" in
16934 ''|0) try='int sethostent_r(int, struct hostent_data*);'
16935 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=I_ID ;;
16937 case "$sethostent_r_proto" in
16938 ''|0) try='void sethostent_r(int, struct hostent_data*);'
16939 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=V_ID ;;
16941 case "$sethostent_r_proto" in
16942 ''|0) d_sethostent_r=undef
16943 sethostent_r_proto=0
16944 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
16945 * ) case "$sethostent_r_proto" in
16946 REENTRANT_PROTO*) ;;
16947 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
16949 echo "Prototype: $try" ;;
16952 *) case "$usethreads" in
16953 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
16955 d_sethostent_r=undef
16956 sethostent_r_proto=0
16960 *) sethostent_r_proto=0
16964 : see if setitimer exists
16965 set setitimer d_setitimer
16968 : see if setlinebuf exists
16969 set setlinebuf d_setlinebuf
16972 : see if setlocale exists
16973 set setlocale d_setlocale
16976 : see if locale.h is available
16977 set locale.h i_locale
16980 : see if setlocale_r exists
16981 set setlocale_r d_setlocale_r
16983 case "$d_setlocale_r" in
16985 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
16986 case "$d_setlocale_r_proto:$usethreads" in
16987 ":define") d_setlocale_r_proto=define
16988 set d_setlocale_r_proto setlocale_r $hdrs
16992 case "$d_setlocale_r_proto" in
16994 case "$setlocale_r_proto" in
16995 ''|0) try='int setlocale_r(int, const char*, char*, int);'
16996 ./protochk "$extern_C $try" $hdrs && setlocale_r_proto=I_ICBI ;;
16998 case "$setlocale_r_proto" in
16999 ''|0) d_setlocale_r=undef
17000 setlocale_r_proto=0
17001 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
17002 * ) case "$setlocale_r_proto" in
17003 REENTRANT_PROTO*) ;;
17004 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
17006 echo "Prototype: $try" ;;
17009 *) case "$usethreads" in
17010 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
17012 d_setlocale_r=undef
17013 setlocale_r_proto=0
17017 *) setlocale_r_proto=0
17021 : see if setnetent exists
17022 set setnetent d_setnent
17025 : see if setnetent_r exists
17026 set setnetent_r d_setnetent_r
17028 case "$d_setnetent_r" in
17030 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17031 case "$d_setnetent_r_proto:$usethreads" in
17032 ":define") d_setnetent_r_proto=define
17033 set d_setnetent_r_proto setnetent_r $hdrs
17037 case "$d_setnetent_r_proto" in
17039 case "$setnetent_r_proto" in
17040 ''|0) try='int setnetent_r(int, struct netent_data*);'
17041 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=I_ID ;;
17043 case "$setnetent_r_proto" in
17044 ''|0) try='void setnetent_r(int, struct netent_data*);'
17045 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=V_ID ;;
17047 case "$setnetent_r_proto" in
17048 ''|0) d_setnetent_r=undef
17049 setnetent_r_proto=0
17050 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
17051 * ) case "$setnetent_r_proto" in
17052 REENTRANT_PROTO*) ;;
17053 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
17055 echo "Prototype: $try" ;;
17058 *) case "$usethreads" in
17059 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
17061 d_setnetent_r=undef
17062 setnetent_r_proto=0
17066 *) setnetent_r_proto=0
17070 : see if setprotoent exists
17071 set setprotoent d_setpent
17074 : see if setpgid exists
17075 set setpgid d_setpgid
17078 : see if setpgrp2 exists
17079 set setpgrp2 d_setpgrp2
17082 : see if setpriority exists
17083 set setpriority d_setprior
17086 : see if setproctitle exists
17087 set setproctitle d_setproctitle
17090 : see if setprotoent_r exists
17091 set setprotoent_r d_setprotoent_r
17093 case "$d_setprotoent_r" in
17095 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17096 case "$d_setprotoent_r_proto:$usethreads" in
17097 ":define") d_setprotoent_r_proto=define
17098 set d_setprotoent_r_proto setprotoent_r $hdrs
17102 case "$d_setprotoent_r_proto" in
17104 case "$setprotoent_r_proto" in
17105 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
17106 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=I_ID ;;
17108 case "$setprotoent_r_proto" in
17109 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
17110 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=V_ID ;;
17112 case "$setprotoent_r_proto" in
17113 ''|0) d_setprotoent_r=undef
17114 setprotoent_r_proto=0
17115 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
17116 * ) case "$setprotoent_r_proto" in
17117 REENTRANT_PROTO*) ;;
17118 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
17120 echo "Prototype: $try" ;;
17123 *) case "$usethreads" in
17124 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
17126 d_setprotoent_r=undef
17127 setprotoent_r_proto=0
17131 *) setprotoent_r_proto=0
17135 : see if setpwent exists
17136 set setpwent d_setpwent
17139 : see if setpwent_r exists
17140 set setpwent_r d_setpwent_r
17142 case "$d_setpwent_r" in
17144 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
17145 case "$d_setpwent_r_proto:$usethreads" in
17146 ":define") d_setpwent_r_proto=define
17147 set d_setpwent_r_proto setpwent_r $hdrs
17151 case "$d_setpwent_r_proto" in
17153 case "$setpwent_r_proto" in
17154 ''|0) try='int setpwent_r(FILE**);'
17155 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=I_H ;;
17157 case "$setpwent_r_proto" in
17158 ''|0) try='void setpwent_r(FILE**);'
17159 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=V_H ;;
17161 case "$setpwent_r_proto" in
17162 ''|0) d_setpwent_r=undef
17164 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
17165 * ) case "$setpwent_r_proto" in
17166 REENTRANT_PROTO*) ;;
17167 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
17169 echo "Prototype: $try" ;;
17172 *) case "$usethreads" in
17173 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
17180 *) setpwent_r_proto=0
17184 : see if setregid exists
17185 set setregid d_setregid
17187 set setresgid d_setresgid
17190 : see if setreuid exists
17191 set setreuid d_setreuid
17193 set setresuid d_setresuid
17196 : see if setrgid exists
17197 set setrgid d_setrgid
17200 : see if setruid exists
17201 set setruid d_setruid
17204 : see if setservent exists
17205 set setservent d_setsent
17208 : see if setservent_r exists
17209 set setservent_r d_setservent_r
17211 case "$d_setservent_r" in
17213 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17214 case "$d_setservent_r_proto:$usethreads" in
17215 ":define") d_setservent_r_proto=define
17216 set d_setservent_r_proto setservent_r $hdrs
17220 case "$d_setservent_r_proto" in
17222 case "$setservent_r_proto" in
17223 ''|0) try='int setservent_r(int, struct servent_data*);'
17224 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=I_ID ;;
17226 case "$setservent_r_proto" in
17227 ''|0) try='void setservent_r(int, struct servent_data*);'
17228 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=V_ID ;;
17230 case "$setservent_r_proto" in
17231 ''|0) d_setservent_r=undef
17232 setservent_r_proto=0
17233 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
17234 * ) case "$setservent_r_proto" in
17235 REENTRANT_PROTO*) ;;
17236 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
17238 echo "Prototype: $try" ;;
17241 *) case "$usethreads" in
17242 define) echo "setservent_r has no prototype, not using it." >&4 ;;
17244 d_setservent_r=undef
17245 setservent_r_proto=0
17249 *) setservent_r_proto=0
17253 : see if setsid exists
17254 set setsid d_setsid
17257 : see if setvbuf exists
17258 set setvbuf d_setvbuf
17261 : see if sfio.h is available
17265 : see if sfio library is available
17276 : Ok, but do we want to use it.
17280 true|$define|[yY]*) dflt='y';;
17283 echo "$package can use the sfio library, but it is experimental."
17284 case "$useperlio" in
17286 echo "For sfio also the PerlIO abstraction layer is needed."
17287 echo "Earlier you said you wouldn't want that."
17290 rp="You seem to have sfio available, do you want to try using it?"
17293 y|Y) echo "Ok, turning on both sfio and PerlIO, then."
17294 useperlio="$define"
17297 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
17302 *) case "$usesfio" in
17303 true|$define|[yY]*)
17304 echo "Sorry, cannot find sfio on this machine." >&4
17305 echo "Ignoring your setting of usesfio=$usesfio." >&4
17314 $define) usesfio='true';;
17315 *) usesfio='false';;
17319 *) : Remove sfio from list of libraries to use
17322 echo "Removing unneeded -lsfio from library list" >&4
17323 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
17326 echo "libs = $libs" >&4
17333 : see if shmctl exists
17334 set shmctl d_shmctl
17337 : see if shmget exists
17338 set shmget d_shmget
17341 : see if shmat exists
17344 : see what shmat returns
17347 $cat >shmat.c <<'END'
17348 #include <sys/shm.h>
17351 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
17356 echo "and it returns ($shmattype)." >&4
17357 : see if a prototype for shmat is available
17358 xxx=`./findhdr sys/shm.h`
17359 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
17360 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
17371 set d_shmatprototype
17374 : see if shmdt exists
17378 : see how much of the 'shm*(2)' library is present.
17381 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
17382 *"$undef"*) h_shm=false;;
17386 case "`ipcs 2>&1`" in
17387 "SVID shared memory"*"not configured"*)
17388 echo "Your $osname does not have the shm*(2) configured." >&4
17391 set shmctl d_shmctl
17393 set shmget d_shmget
17403 : we could also check for sys/ipc.h ...
17404 if $h_shm && $test `./findhdr sys/shm.h`; then
17405 echo "You have the full shm*(2) library." >&4
17408 echo "You don't have the full shm*(2) library." >&4
17414 : see if we have sigaction
17416 if set sigaction val -f d_sigaction; eval $csym; $val; then
17417 echo 'sigaction() found.' >&4
17420 #include <sys/types.h>
17421 #include <signal.h>
17422 #$i_stdlib I_STDLIB
17424 #include <stdlib.h>
17428 struct sigaction act, oact;
17430 oact.sa_handler = 0;
17431 /* so that act and oact are used */
17432 exit(act.sa_flags == 0 && oact.sa_handler == 0);
17436 if eval $compile_ok; then
17439 echo "But you don't seem to have a useable struct sigaction." >&4
17443 echo 'sigaction NOT found.' >&4
17446 set d_sigaction; eval $setvar
17449 : see if this is a sunmath.h system
17450 set sunmath.h i_sunmath
17453 : see if signbit exists
17454 $echo $n "Checking to see if you have signbit() available to work on $nvtype... $c" >&4
17457 #$i_sunmath I_SUNMATH
17461 #ifdef I_SUNMATH /* Solaris special math library */
17462 # include <sunmath.h>
17465 int main(int argc, char **argv)
17469 if ((signbit(x) == 0) && (signbit(y) != 0))
17477 if eval $compile; then
17478 if $run ./try; then
17482 $echo "Signbit seems to be available, but doesn't work as I expected."
17483 $echo "I won't use it." >&4
17494 : see if sigprocmask exists
17495 set sigprocmask d_sigprocmask
17498 : see if sigsetjmp exists
17500 case "$d_sigsetjmp" in
17503 #include <setjmp.h>
17504 #$i_stdlib I_STDLIB
17506 #include <stdlib.h>
17512 if (sigsetjmp(env,1))
17515 siglongjmp(env, 1);
17520 if eval $compile; then
17521 if $run ./try >/dev/null 2>&1; then
17522 echo "POSIX sigsetjmp found." >&4
17526 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
17532 echo "sigsetjmp not found." >&4
17536 *) val="$d_sigsetjmp"
17537 case "$d_sigsetjmp" in
17538 $define) echo "POSIX sigsetjmp found." >&4;;
17539 $undef) echo "sigsetjmp not found." >&4;;
17547 : see if snprintf exists
17548 set snprintf d_snprintf
17551 : see if vsnprintf exists
17552 set vsnprintf d_vsnprintf
17555 case "$d_snprintf-$d_vsnprintf" in
17558 Checking whether your snprintf() and vsnprintf() work okay...
17560 $cat >try.c <<'EOCP'
17561 /* v?snprintf testing logic courtesy of Russ Allbery.
17562 * According to C99:
17563 * - if the buffer is too short it still must be \0-terminated
17564 * - if the buffer is too short the potentially required length
17565 * must be returned and not -1
17566 * - if the buffer is NULL the potentially required length
17567 * must be returned and not -1 or core dump
17570 #include <stdarg.h>
17574 int test (char *format, ...)
17579 va_start (args, format);
17580 count = vsnprintf (buf, sizeof buf, format, args);
17587 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
17588 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
17592 if eval $compile; then
17595 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
17597 Your snprintf() and snprintf() don't seem to be working okay.
17599 d_snprintf="$undef"
17600 d_vsnprintf="$undef"
17604 echo "(I can't seem to compile the test program--assuming they don't)"
17605 d_snprintf="$undef"
17606 d_vsnprintf="$undef"
17612 : see if sockatmark exists
17613 set sockatmark d_sockatmark
17616 : see if prototype for sockatmark is available
17618 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
17621 : see if socks5_init exists
17622 set socks5_init d_socks5_init
17625 : see if sprintf returns the length of the string in the buffer as per ANSI
17626 $echo "Checking whether sprintf returns the length of the string..." >&4
17629 #$i_stdlib I_STDLIB
17631 #include <stdlib.h>
17633 #$i_string I_STRING
17635 # include <string.h>
17637 # include <strings.h>
17646 int check (size_t expect, int test) {
17647 size_t got = strlen(buffer);
17651 printf("expected %ld, got %ld in test %d '%s'\n", (long) expect, (long) got,
17656 int main(int argc, char **argv) {
17659 check(sprintf(buffer, ""), ++test);
17660 check(sprintf(buffer, "%s %s", "perl", "rules"), ++test);
17661 check(sprintf(buffer, "I like %g", atan2(0,-1)), ++test);
17668 if eval $compile; then
17672 sprintf returns the length of the string (as ANSI says it should)
17674 d_sprintf_returns_strlen="$define"
17677 sprintf does not return the length of the string (how old is this system?)
17679 d_sprintf_returns_strlen="$undef"
17683 echo "(I can't seem to compile the test program--assuming it doesn't)" >&4
17684 d_sprintf_returns_strlen="$undef"
17688 : see if srand48_r exists
17689 set srand48_r d_srand48_r
17691 case "$d_srand48_r" in
17693 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17694 case "$d_srand48_r_proto:$usethreads" in
17695 ":define") d_srand48_r_proto=define
17696 set d_srand48_r_proto srand48_r $hdrs
17700 case "$d_srand48_r_proto" in
17702 case "$srand48_r_proto" in
17703 ''|0) try='int srand48_r(long, struct drand48_data*);'
17704 ./protochk "$extern_C $try" $hdrs && srand48_r_proto=I_LS ;;
17706 case "$srand48_r_proto" in
17707 ''|0) d_srand48_r=undef
17709 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
17710 * ) case "$srand48_r_proto" in
17711 REENTRANT_PROTO*) ;;
17712 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
17714 echo "Prototype: $try" ;;
17717 *) case "$usethreads" in
17718 define) echo "srand48_r has no prototype, not using it." >&4 ;;
17725 *) srand48_r_proto=0
17729 : see if srandom_r exists
17730 set srandom_r d_srandom_r
17732 case "$d_srandom_r" in
17734 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17735 case "$d_srandom_r_proto:$usethreads" in
17736 ":define") d_srandom_r_proto=define
17737 set d_srandom_r_proto srandom_r $hdrs
17741 case "$d_srandom_r_proto" in
17743 case "$srandom_r_proto" in
17744 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
17745 ./protochk "$extern_C $try" $hdrs && srandom_r_proto=I_TS ;;
17747 case "$srandom_r_proto" in
17748 ''|0) d_srandom_r=undef
17750 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
17751 * ) case "$srandom_r_proto" in
17752 REENTRANT_PROTO*) ;;
17753 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
17755 echo "Prototype: $try" ;;
17758 *) case "$usethreads" in
17759 define) echo "srandom_r has no prototype, not using it." >&4 ;;
17766 *) srandom_r_proto=0
17770 : see if prototype for setresgid is available
17772 set d_sresgproto setresgid $i_unistd unistd.h
17775 : see if prototype for setresuid is available
17777 set d_sresuproto setresuid $i_unistd unistd.h
17780 : see if sys/stat.h is available
17781 set sys/stat.h i_sysstat
17784 : see if stat knows about block sizes
17786 echo "Checking to see if your struct stat has st_blocks field..." >&4
17787 set d_statblks stat st_blocks $i_sysstat sys/stat.h
17790 : see if this is a sys/vfs.h system
17791 set sys/vfs.h i_sysvfs
17794 : see if this is a sys/statfs.h system
17795 set sys/statfs.h i_sysstatfs
17798 : Check for statfs_s
17800 echo "Checking to see if your system supports struct statfs..." >&4
17801 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
17803 case "$d_statfs_s" in
17804 "$define") echo "Yes, it does." ;;
17805 *) echo "No, it doesn't." ;;
17809 : see if struct statfs knows about f_flags
17810 case "$d_statfs_s" in
17813 echo "Checking to see if your struct statfs has f_flags field..." >&4
17814 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
17818 set d_statfs_f_flags
17822 case "$d_statfs_f_flags" in
17823 "$define") echo "Yes, it does." ;;
17824 *) echo "No, it doesn't." ;;
17827 : Check stream access
17829 Checking how to access stdio streams by file descriptor number...
17831 case "$stdio_stream_array" in
17832 '') $cat >try.c <<EOCP
17835 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
17839 for s in _iob __iob __sF
17841 set try -DSTDIO_STREAM_ARRAY=$s
17842 if eval $compile; then
17843 case "`$run ./try`" in
17844 yes) stdio_stream_array=$s; break ;;
17850 case "$stdio_stream_array" in
17852 I can't figure out how to access stdio streams by file descriptor number.
17854 d_stdio_stream_array="$undef"
17857 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
17859 d_stdio_stream_array="$define"
17863 : see if strcoll exists
17864 set strcoll d_strcoll
17867 : check for structure copying
17869 echo "Checking to see if your C compiler can copy structs..." >&4
17870 $cat >try.c <<'EOCP'
17880 if $cc -c try.c >/dev/null 2>&1 ; then
17882 echo "Yup, it can."
17885 echo "Nope, it can't."
17891 : see if strerror and/or sys_errlist[] exist
17893 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
17894 if set strerror val -f d_strerror; eval $csym; $val; then
17895 echo 'strerror() found.' >&4
17896 d_strerror="$define"
17897 d_strerrm='strerror(e)'
17898 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17899 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
17900 d_syserrlst="$define"
17902 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
17903 d_syserrlst="$undef"
17905 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
17906 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
17907 echo 'strerror() found in string header.' >&4
17908 d_strerror="$define"
17909 d_strerrm='strerror(e)'
17910 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17911 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
17912 d_syserrlst="$define"
17914 echo "(You don't appear to have any sys_errlist[], how can this be?)"
17915 d_syserrlst="$undef"
17917 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17918 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
17919 d_strerror="$undef"
17920 d_syserrlst="$define"
17921 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
17923 echo 'strerror() and sys_errlist[] NOT found.' >&4
17924 d_strerror="$undef"
17925 d_syserrlst="$undef"
17926 d_strerrm='"unknown"'
17930 : see if strerror_r exists
17931 set strerror_r d_strerror_r
17933 case "$d_strerror_r" in
17935 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
17936 case "$d_strerror_r_proto:$usethreads" in
17937 ":define") d_strerror_r_proto=define
17938 set d_strerror_r_proto strerror_r $hdrs
17942 case "$d_strerror_r_proto" in
17944 case "$strerror_r_proto" in
17945 ''|0) try='int strerror_r(int, char*, size_t);'
17946 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBW ;;
17948 case "$strerror_r_proto" in
17949 ''|0) try='int strerror_r(int, char*, int);'
17950 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBI ;;
17952 case "$strerror_r_proto" in
17953 ''|0) try='char* strerror_r(int, char*, size_t);'
17954 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=B_IBW ;;
17956 case "$strerror_r_proto" in
17957 ''|0) d_strerror_r=undef
17959 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
17960 * ) case "$strerror_r_proto" in
17961 REENTRANT_PROTO*) ;;
17962 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
17964 echo "Prototype: $try" ;;
17967 *) case "$usethreads" in
17968 define) echo "strerror_r has no prototype, not using it." >&4 ;;
17975 *) strerror_r_proto=0
17979 : see if strftime exists
17980 set strftime d_strftime
17983 : see if strlcat exists
17984 set strlcat d_strlcat
17987 : see if strlcpy exists
17988 set strlcpy d_strlcpy
17991 : see if strtod exists
17992 set strtod d_strtod
17995 : see if strtol exists
17996 set strtol d_strtol
17999 : see if strtold exists
18000 set strtold d_strtold
18003 : see if strtoll exists
18004 set strtoll d_strtoll
18007 case "$d_longlong-$d_strtoll" in
18010 Checking whether your strtoll() works okay...
18012 $cat >try.c <<'EOCP'
18015 #define strtoll __strtoll
18018 #define strtoll _strtoll
18021 extern long long int strtoll(char *s, char **, int);
18022 static int bad = 0;
18023 int check(char *s, long long ell, int een) {
18026 gll = strtoll(s, 0, 10);
18027 if (!((gll == ell) && (errno == een)))
18031 check(" 1", 1LL, 0);
18032 check(" 0", 0LL, 0);
18033 check("-1", -1LL, 0);
18034 check("-9223372036854775808", -9223372036854775808LL, 0);
18035 check("-9223372036854775808", -9223372036854775808LL, 0);
18036 check(" 9223372036854775807", 9223372036854775807LL, 0);
18037 check("-9223372036854775808", -9223372036854775808LL, 0);
18038 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
18039 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
18045 if eval $compile; then
18048 ok) echo "Your strtoll() seems to be working okay." ;;
18050 Your strtoll() doesn't seem to be working okay.
18056 echo "(I can't seem to compile the test program--assuming it doesn't)"
18062 : see if strtoq exists
18063 set strtoq d_strtoq
18066 : see if strtoul exists
18067 set strtoul d_strtoul
18070 case "$d_strtoul" in
18073 Checking whether your strtoul() works okay...
18075 $cat >try.c <<'EOCP'
18078 extern unsigned long int strtoul(char *s, char **, int);
18079 static int bad = 0;
18080 void check(char *s, unsigned long eul, int een) {
18083 gul = strtoul(s, 0, 10);
18084 if (!((gul == eul) && (errno == een)))
18088 check(" 1", 1L, 0);
18089 check(" 0", 0L, 0);
18091 case "$longsize" in
18093 $cat >>try.c <<'EOCP'
18094 check("18446744073709551615", 18446744073709551615UL, 0);
18095 check("18446744073709551616", 18446744073709551615UL, ERANGE);
18096 #if 0 /* strtoul() for /^-/ strings is undefined. */
18097 check("-1", 18446744073709551615UL, 0);
18098 check("-18446744073709551614", 2, 0);
18099 check("-18446744073709551615", 1, 0);
18100 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
18101 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
18106 $cat >>try.c <<'EOCP'
18107 check("4294967295", 4294967295UL, 0);
18108 check("4294967296", 4294967295UL, ERANGE);
18109 #if 0 /* strtoul() for /^-/ strings is undefined. */
18110 check("-1", 4294967295UL, 0);
18111 check("-4294967294", 2, 0);
18112 check("-4294967295", 1, 0);
18113 check("-4294967296", 4294967295UL, ERANGE);
18114 check("-4294967297", 4294967295UL, ERANGE);
18119 : Should we write these tests to be more portable by sprintf-ing
18120 : ~0 and then manipulating that char string as input for strtol?
18123 $cat >>try.c <<'EOCP'
18130 if eval $compile; then
18131 case "`$run ./try`" in
18132 ok) echo "Your strtoul() seems to be working okay." ;;
18134 Your strtoul() doesn't seem to be working okay.
18140 echo "(I can't seem to compile the test program--assuming it doesn't)"
18146 : see if strtoull exists
18147 set strtoull d_strtoull
18150 case "$d_longlong-$d_strtoull" in
18153 Checking whether your strtoull() works okay...
18155 $cat >try.c <<'EOCP'
18158 #define strtoull __strtoull
18161 extern unsigned long long int strtoull(char *s, char **, int);
18162 static int bad = 0;
18163 int check(char *s, long long eull, int een) {
18166 gull = strtoull(s, 0, 10);
18167 if (!((gull == eull) && (errno == een)))
18171 check(" 1", 1LL, 0);
18172 check(" 0", 0LL, 0);
18173 check("18446744073709551615", 18446744073709551615ULL, 0);
18174 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
18175 #if 0 /* strtoull() for /^-/ strings is undefined. */
18176 check("-1", 18446744073709551615ULL, 0);
18177 check("-18446744073709551614", 2LL, 0);
18178 check("-18446744073709551615", 1LL, 0);
18179 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
18180 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
18187 if eval $compile; then
18188 case "`$run ./try`" in
18189 ok) echo "Your strtoull() seems to be working okay." ;;
18191 Your strtoull() doesn't seem to be working okay.
18193 d_strtoull="$undef"
18197 echo "(I can't seem to compile the test program--assuming it doesn't)"
18198 d_strtoull="$undef"
18203 : see if strtouq exists
18204 set strtouq d_strtouq
18207 case "$d_strtouq" in
18210 Checking whether your strtouq() works okay...
18212 $cat >try.c <<'EOCP'
18215 extern unsigned long long int strtouq(char *s, char **, int);
18216 static int bad = 0;
18217 void check(char *s, unsigned long long eull, int een) {
18218 unsigned long long gull;
18220 gull = strtouq(s, 0, 10);
18221 if (!((gull == eull) && (errno == een)))
18225 check(" 1", 1LL, 0);
18226 check(" 0", 0LL, 0);
18227 check("18446744073709551615", 18446744073709551615ULL, 0);
18228 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
18229 #if 0 /* strtouq() for /^-/ strings is undefined. */
18230 check("-1", 18446744073709551615ULL, 0);
18231 check("-18446744073709551614", 2LL, 0);
18232 check("-18446744073709551615", 1LL, 0);
18233 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
18234 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
18242 if eval $compile; then
18243 case "`$run ./try`" in
18244 ok) echo "Your strtouq() seems to be working okay." ;;
18246 Your strtouq() doesn't seem to be working okay.
18252 echo "(I can't seem to compile the test program--assuming it doesn't)"
18258 : see if strxfrm exists
18259 set strxfrm d_strxfrm
18262 : see if symlink exists
18263 set symlink d_symlink
18266 : see if syscall exists
18267 set syscall d_syscall
18270 : see if prototype for syscall is available
18272 set d_syscallproto syscall $i_unistd unistd.h
18275 : see if sysconf exists
18276 set sysconf d_sysconf
18279 : see if system exists
18280 set system d_system
18283 : see if tcgetpgrp exists
18284 set tcgetpgrp d_tcgetpgrp
18287 : see if tcsetpgrp exists
18288 set tcsetpgrp d_tcsetpgrp
18291 : see if prototype for telldir is available
18293 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
18296 : see if time exists
18298 if test "X$d_time" = X -o X"$timetype" = X; then
18299 if set time val -f d_time; eval $csym; $val; then
18300 echo 'time() found.' >&4
18302 rp="What is the type returned by time() on this system?"
18303 set time_t timetype long stdio.h sys/types.h
18306 echo 'time() not found, hope that will do.' >&4
18314 : see if timegm exists
18315 set timegm d_timegm
18318 : see if this is a sys/times.h system
18319 set sys/times.h i_systimes
18322 : see if times exists
18324 if set times val -f d_times; eval $csym; $val; then
18325 echo 'times() found.' >&4
18328 case "$i_systimes" in
18329 "$define") inc='sys/times.h';;
18331 rp="What is the type returned by times() on this system?"
18332 set clock_t clocktype long stdio.h sys/types.h $inc
18335 echo 'times() NOT found, hope that will do.' >&4
18340 : see if tmpnam_r exists
18341 set tmpnam_r d_tmpnam_r
18343 case "$d_tmpnam_r" in
18345 hdrs="$i_systypes sys/types.h define stdio.h "
18346 case "$d_tmpnam_r_proto:$usethreads" in
18347 ":define") d_tmpnam_r_proto=define
18348 set d_tmpnam_r_proto tmpnam_r $hdrs
18352 case "$d_tmpnam_r_proto" in
18354 case "$tmpnam_r_proto" in
18355 ''|0) try='char* tmpnam_r(char*);'
18356 ./protochk "$extern_C $try" $hdrs && tmpnam_r_proto=B_B ;;
18358 case "$tmpnam_r_proto" in
18359 ''|0) d_tmpnam_r=undef
18361 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
18362 * ) case "$tmpnam_r_proto" in
18363 REENTRANT_PROTO*) ;;
18364 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
18366 echo "Prototype: $try" ;;
18369 *) case "$usethreads" in
18370 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
18377 *) tmpnam_r_proto=0
18381 : see if truncate exists
18382 set truncate d_truncate
18385 : see if ttyname_r exists
18386 set ttyname_r d_ttyname_r
18388 case "$d_ttyname_r" in
18390 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
18391 case "$d_ttyname_r_proto:$usethreads" in
18392 ":define") d_ttyname_r_proto=define
18393 set d_ttyname_r_proto ttyname_r $hdrs
18397 case "$d_ttyname_r_proto" in
18399 case "$ttyname_r_proto" in
18400 ''|0) try='int ttyname_r(int, char*, size_t);'
18401 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBW ;;
18403 case "$ttyname_r_proto" in
18404 ''|0) try='int ttyname_r(int, char*, int);'
18405 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBI ;;
18407 case "$ttyname_r_proto" in
18408 ''|0) try='char* ttyname_r(int, char*, int);'
18409 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=B_IBI ;;
18411 case "$ttyname_r_proto" in
18412 ''|0) d_ttyname_r=undef
18414 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
18415 * ) case "$ttyname_r_proto" in
18416 REENTRANT_PROTO*) ;;
18417 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
18419 echo "Prototype: $try" ;;
18422 *) case "$usethreads" in
18423 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
18430 *) ttyname_r_proto=0
18434 : see if tzname[] exists
18436 if set tzname val -a d_tzname; eval $csym; $val; then
18438 echo 'tzname[] found.' >&4
18441 echo 'tzname[] NOT found.' >&4
18446 : Check if is a multiplatform env
18448 next|rhapsody|darwin) multiarch="$define" ;;
18450 case "$multiarch" in
18451 ''|[nN]*) multiarch="$undef" ;;
18454 : check for ordering of bytes in a UV
18456 case "$usecrosscompile$multiarch" in
18459 You seem to be either cross-compiling or doing a multiarchitecture build,
18460 skipping the byteorder check.
18466 case "$byteorder" in
18469 In the following, larger digits indicate more significance. A big-endian
18470 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
18471 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
18472 machines may have weird orders like 3412. A Cray will report 87654321,
18473 an Alpha will report 12345678. If the test program works the default is
18475 I'm now running the test program...
18479 #$i_stdlib I_STDLIB
18481 #include <stdlib.h>
18483 #include <sys/types.h>
18484 typedef $uvtype UV;
18494 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
18496 u.l = (UV)0x04030201;
18497 for (i = 0; i < $uvsize; i++)
18498 printf("%c", u.c[i]+'0');
18505 if eval $compile && $run ./try > /dev/null; then
18508 [1-4][1-4][1-4][1-4]|12345678|87654321)
18509 echo "(The test program ran ok.)"
18510 echo "byteorder=$dflt"
18513 ????|????????) echo "(The test program ran ok.)" ;;
18514 *) echo "(The test program didn't run right for some reason.)" ;;
18519 (I can't seem to compile the test program. Guessing big-endian...)
18522 case "$xxx_prompt" in
18524 rp="What is the order of bytes in $uvtype?"
18537 : Checking 32bit aligndness
18540 Checking to see whether you can access character data unalignedly...
18542 case "$d_u32align" in
18543 '') $cat >try.c <<EOCP
18545 #$i_stdlib I_STDLIB
18547 #include <stdlib.h>
18549 #define U32 $u32type
18550 #define BYTEORDER 0x$byteorder
18552 #include <signal.h>
18554 $signal_t bletch(int s) { exit(4); }
18557 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
18562 if (sizeof(U32) != 4) {
18563 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
18570 signal(SIGBUS, bletch);
18582 for (i = 0; i < 4; i++) {
18583 up = (U32*)(buf + i);
18584 if (! ((*up == 1 << (8*i)) || /* big-endian */
18585 (*up == 1 << (8*(3-i))) /* little-endian */
18589 printf("read failed (%x)\n", *up);
18595 for (i = 0; i < 4; i++) {
18596 up = (U32*)(buf + i);
18598 if (*up != 0xBeef) {
18599 printf("write failed (%x)\n", *up);
18613 if eval $compile_ok; then
18614 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
18615 $run ./try 2>&1 >/dev/null
18618 You can access character data pretty unalignedly.
18620 d_u32align="$undef"
18623 It seems that you must access character data in an aligned manner.
18625 d_u32align="$define"
18629 rp='Can you access character data at unaligned addresses?'
18633 [yY]*) d_u32align="$undef" ;;
18634 *) d_u32align="$define" ;;
18641 : see if ualarm exists
18642 set ualarm d_ualarm
18645 : see if umask exists
18649 : see if unordered exists
18650 set unordered d_unordered
18653 : see if unsetenv exists
18654 set unsetenv d_unsetenv
18657 : see if usleep exists
18658 set usleep d_usleep
18661 : see if prototype for usleep is available
18663 set d_usleepproto usleep $i_unistd unistd.h
18666 : see if ustat exists
18670 : see if closedir exists
18671 set closedir d_closedir
18674 case "$d_closedir" in
18677 echo "Checking whether closedir() returns a status..." >&4
18679 #$i_dirent I_DIRENT /**/
18680 #$i_sysdir I_SYS_DIR /**/
18681 #$i_sysndir I_SYS_NDIR /**/
18682 #$i_systypes I_SYS_TYPES /**/
18684 #if defined(I_SYS_TYPES)
18685 #include <sys/types.h>
18687 #if defined(I_DIRENT)
18688 #include <dirent.h>
18689 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
18690 #include <sys/dir.h>
18694 #include <sys/ndir.h>
18698 #include <ndir.h> /* may be wrong in the future */
18700 #include <sys/dir.h>
18705 int main() { return closedir(opendir(".")); }
18708 if eval $compile_ok; then
18709 if $run ./try > /dev/null 2>&1 ; then
18710 echo "Yes, it does."
18713 echo "No, it doesn't."
18717 echo "(I can't seem to compile the test program--assuming it doesn't)"
18725 set d_void_closedir
18729 : see if there is a wait4
18733 : see if waitpid exists
18734 set waitpid d_waitpid
18737 : see if wcstombs exists
18738 set wcstombs d_wcstombs
18741 : see if wctomb exists
18742 set wctomb d_wctomb
18745 : see if writev exists
18746 set writev d_writev
18749 : preserve RCS keywords in files with variable substitution, grrr
18754 Revision='$Revision'
18756 : check for alignment requirements
18758 case "$usecrosscompile$multiarch" in
18761 You seem to be either cross-compiling or doing a multiarchitecture build,
18762 skipping the memory alignment check.
18765 case "$alignbytes" in
18766 '') alignbytes=8 ;;
18770 case "$alignbytes" in
18771 '') echo "Checking alignment constraints..." >&4
18772 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
18773 $cat >try.c <<'EOCP'
18774 typedef long double NV;
18777 $cat >try.c <<'EOCP'
18781 $cat >>try.c <<'EOCP'
18789 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
18794 if eval $compile_ok; then
18798 echo "(I can't seem to compile the test program...)"
18801 *) dflt="$alignbytes"
18804 rp="Doubles must be aligned on a how-many-byte boundary?"
18812 : set the base revision
18815 : how do we concatenate cpp tokens here?
18817 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
18818 $cat >cpp_stuff.c <<'EOCP'
18819 #define RCAT(a,b)a/**/b
18820 #define ACAT(a,b)a ## b
18824 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
18825 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
18826 echo "Oh! Smells like ANSI's been here." >&4
18827 echo "We can catify or stringify, separately or together!"
18829 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
18830 echo "Ah, yes! The good old days!" >&4
18831 echo "However, in the good old days we don't know how to stringify and"
18832 echo "catify at the same time."
18836 Hmm, I don't seem to be able to concatenate tokens with your cpp.
18837 You're going to have to edit the values of CAT[2-5] in config.h...
18839 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
18843 : see if this is a db.h system
18849 : Check db version.
18851 echo "Checking Berkeley DB version ..." >&4
18857 #include <sys/types.h>
18859 #$i_stdlib I_STDLIB
18861 #include <stdlib.h>
18864 int main(int argc, char *argv[])
18866 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
18867 int Major, Minor, Patch ;
18868 unsigned long Version ;
18869 (void)db_version(&Major, &Minor, &Patch) ;
18871 printf("%d %d %d %d %d %d\n",
18872 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
18873 Major, Minor, Patch);
18876 printf("You have Berkeley DB Version 2 or greater.\n");
18878 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
18879 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
18880 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
18881 Major, Minor, Patch) ;
18883 /* check that db.h & libdb are compatible */
18884 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
18885 printf("db.h and libdb are incompatible.\n") ;
18889 printf("db.h and libdb are compatible.\n") ;
18891 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
18892 + DB_VERSION_PATCH ;
18894 /* needs to be >= 2.3.4 */
18895 if (Version < 2003004) {
18896 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
18897 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
18903 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
18908 printf("You have Berkeley DB Version 1.\n");
18909 exit(0); /* DB version < 2: the coast is clear. */
18911 exit(1); /* <db.h> not Berkeley DB? */
18917 if eval $compile_ok && $run ./try; then
18918 echo 'Looks OK.' >&4
18920 db_version_major=$1
18921 db_version_minor=$2
18922 db_version_patch=$3
18924 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
18928 : Remove db from list of libraries to use
18929 echo "Removing unusable -ldb from library list" >&4
18930 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
18933 echo "libs = $libs" >&4
18943 : Check the return type needed for hash
18945 echo "Checking return type needed for hash for Berkeley DB ..." >&4
18951 #include <sys/types.h>
18954 #ifndef DB_VERSION_MAJOR
18955 u_int32_t hash_cb (ptr, size)
18963 info.hash = hash_cb;
18967 if $cc $ccflags -c try.c >try.out 2>&1 ; then
18968 if $contains warning try.out >>/dev/null 2>&1 ; then
18971 db_hashtype='u_int32_t'
18974 : XXX Maybe we should just give up here.
18975 db_hashtype=u_int32_t
18977 echo "Help: I can't seem to compile the db test program." >&4
18978 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
18981 echo "Your version of Berkeley DB uses $db_hashtype for hash."
18983 *) db_hashtype=u_int32_t
18988 : Check the return type needed for prefix
18990 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
18996 #include <sys/types.h>
18999 #ifndef DB_VERSION_MAJOR
19000 size_t prefix_cb (key1, key2)
19008 info.prefix = prefix_cb;
19012 if $cc $ccflags -c try.c >try.out 2>&1 ; then
19013 if $contains warning try.out >>/dev/null 2>&1 ; then
19014 db_prefixtype='int'
19016 db_prefixtype='size_t'
19019 db_prefixtype='size_t'
19020 : XXX Maybe we should just give up here.
19022 echo "Help: I can't seem to compile the db test program." >&4
19023 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
19026 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
19028 *) db_prefixtype='size_t'
19032 : How can we generate normalized random numbers ?
19034 echo "Looking for a random number function..." >&4
19035 case "$randfunc" in
19037 if set drand48 val -f; eval $csym; $val; then
19039 echo "Good, found drand48()." >&4
19040 elif set random val -f; eval $csym; $val; then
19042 echo "OK, found random()." >&4
19045 echo "Yick, looks like I have to use rand()." >&4
19056 *-Dmy_rand=*|*-Dmy_srand=*)
19057 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
19058 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
19059 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
19060 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
19064 while $test "$cont"; do
19065 rp="Use which function to generate random numbers?"
19067 if $test "$ans" = "$dflt"; then
19073 if set $ans val -f; eval $csym; $val; then
19077 rp="I cannot find function $ans. Use that name anyway?"
19086 case "$randfunc" in
19088 drand01="drand48()"
19094 case "$randbits" in
19096 echo "Checking to see how many bits your $randfunc() function produces..." >&4
19098 #$i_unistd I_UNISTD
19099 #$i_stdlib I_STDLIB
19102 # include <unistd.h>
19105 # include <stdlib.h>
19110 register unsigned long tmp;
19111 register unsigned long max = 0L;
19113 for (i = 1000; i; i--) {
19114 tmp = (unsigned long) $randfunc();
19115 if (tmp > max) max = tmp;
19117 for (i = 0; max; i++)
19123 if eval $compile_ok; then
19127 echo "(I can't seem to compile the test program...)"
19134 rp="How many bits does your $randfunc() function produce?"
19138 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
19139 seedfunc="s$randfunc"
19140 randseedtype=unsigned
19144 rp="How many bits does your $randfunc() function produce?"
19147 seedfunc="s$randfunc"
19148 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
19149 if set $seedfunc val -f; eval $csym; $val; then
19150 echo "(Using $seedfunc() to seed random generator)"
19152 echo "(Warning: no $seedfunc() to seed random generator)"
19155 randseedtype=unsigned
19162 : Determine if this is an EBCDIC system
19164 echo "Determining whether or not we are on an EBCDIC system..." >&4
19165 $cat >try.c <<'EOM'
19168 if ('M'==0xd4) return 0;
19175 if eval $compile_ok; then
19176 if $run ./try; then
19177 echo "You seem to speak EBCDIC." >&4
19180 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
19183 echo "I'm unable to compile the test program." >&4
19184 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
19190 : Check how to flush
19193 Checking how to flush all pending stdio output...
19195 # I only know how to find the first 32 possibly open files on SunOS.
19196 # See also hints/sunos_4_1.sh and util.c --AD
19198 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
19200 $cat >>try.c <<EOCP
19202 #$i_stdlib I_STDLIB
19204 #include <stdlib.h>
19206 #$i_unistd I_UNISTD
19208 # include <unistd.h>
19210 #$d_sysconf HAS_SYSCONF
19211 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
19212 #ifdef HAS_STDIO_STREAM_ARRAY
19213 # define STDIO_STREAM_ARRAY $stdio_stream_array
19218 p = fopen("try.out", "w");
19222 # ifdef TRY_FPRINTF
19226 #ifdef TRY_FFLUSH_NULL
19229 #ifdef TRY_FFLUSH_ALL
19231 long open_max = -1;
19232 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
19233 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
19235 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
19236 open_max = sysconf(_SC_OPEN_MAX);
19239 open_max = FOPEN_MAX;
19242 open_max = OPEN_MAX;
19251 # ifdef HAS_STDIO_STREAM_ARRAY
19252 if (open_max > 0) {
19254 for (i = 0; i < open_max; i++)
19255 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
19256 STDIO_STREAM_ARRAY[i]._file < open_max &&
19257 STDIO_STREAM_ARRAY[i]._flag)
19258 fflush(&STDIO_STREAM_ARRAY[i]);
19266 : first we have to find out how _not_ to flush
19268 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
19270 set try -DTRY_FPUTC
19271 if eval $compile; then
19272 $run ./try 2>/dev/null
19275 if $test ! -s try.out -a "X$code" = X42; then
19281 set try -DTRY_FPRINTF
19282 if eval $compile; then
19283 $run ./try 2>/dev/null
19286 if $test ! -s try.out -a "X$code" = X42; then
19287 output=-DTRY_FPRINTF
19293 : check for fflush NULL behaviour
19294 case "$fflushNULL" in
19295 '') set try -DTRY_FFLUSH_NULL $output
19296 if eval $compile; then
19297 $run ./try 2>/dev/null
19300 if $test -s try.out -a "X$code" = X42; then
19301 fflushNULL="`$cat try.out`"
19303 if $test "X$code" != X42; then
19305 (If this test failed, don't worry, we'll try another method shortly.)
19310 $rm -f core try.core core.try.*
19311 case "$fflushNULL" in
19313 Your fflush(NULL) works okay for output streams.
19314 Let's see if it clobbers input pipes...
19316 # As of mid-March 2000 all versions of Solaris appear to have a stdio
19317 # bug that improperly flushes the input end of pipes. So we avoid the
19318 # autoflush on fork/system/exec support for now. :-(
19319 $cat >tryp.c <<EOCP
19322 main(int argc, char **argv)
19328 while ((i = getc(stdin)) != -1
19329 && (*bp++ = i) != '\n'
19330 && bp < &buf[1024])
19333 fprintf(stdout, "%s", buf);
19341 fflushNULL="$define"
19343 if eval $compile; then
19345 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
19346 if cmp tryp.c tryp.out >/dev/null 2>&1; then
19348 fflush(NULL) seems to behave okay with input streams.
19350 fflushNULL="$define"
19353 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
19355 fflushNULL="$undef"
19358 $rm -f core tryp.c tryp.core core.tryp.*
19361 Your fflush(NULL) isn't working (contrary to ANSI C).
19363 fflushNULL="$undef"
19366 Cannot figure out whether your fflush(NULL) works or not.
19367 I'm assuming it doesn't (contrary to ANSI C).
19369 fflushNULL="$undef"
19373 $define|true|[yY]*)
19374 fflushNULL="$define"
19377 fflushNULL="$undef"
19380 : check explicit looping only if NULL did not work, and if the pipe
19381 : bug does not show up on an explicit flush too
19382 case "$fflushNULL" in
19384 $cat >tryp.c <<EOCP
19387 main(int argc, char **argv)
19393 while ((i = getc(stdin)) != -1
19394 && (*bp++ = i) != '\n'
19395 && bp < &buf[1024])
19398 fprintf(stdout, "%s", buf);
19407 if eval $compile; then
19409 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
19410 if cmp tryp.c tryp.out >/dev/null 2>&1; then
19412 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
19414 : now check for fflushall behaviour
19415 case "$fflushall" in
19416 '') set try -DTRY_FFLUSH_ALL $output
19417 if eval $compile; then
19419 (Now testing the other method--but note that this also may fail.)
19421 $run ./try 2>/dev/null
19424 if $test -s try.out -a "X$code" = X42; then
19425 fflushall="`$cat try.out`"
19429 case "$fflushall" in
19431 Whew. Flushing explicitly all the stdio streams works.
19433 fflushall="$define"
19436 Sigh. Flushing explicitly all the stdio streams doesn't work.
19441 Cannot figure out whether flushing stdio streams explicitly works or not.
19442 I'm assuming it doesn't.
19448 "$define"|true|[yY]*)
19449 fflushall="$define"
19457 All is futile. Even fflush(stdin) clobbers input pipes!
19464 $rm -f core tryp.c tryp.core core.tryp.*
19466 *) fflushall="$undef"
19470 case "$fflushNULL$fflushall" in
19473 OK, I give up. I cannot figure out how to flush pending stdio output.
19474 We won't be flushing handles at all before fork/exec/popen.
19480 : Store the full pathname to the ar program for use in the C program
19481 : Respect a hint or command line value for full_ar.
19486 : Store the full pathname to the sed program for use in the C program
19489 : see what type gids are declared as in the kernel
19491 echo "Looking for the type for group ids returned by getgid()."
19492 set gid_t gidtype xxx stdio.h sys/types.h
19496 xxx=`./findhdr sys/user.h`
19497 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
19499 unsigned) dflt="$1 $2" ;;
19503 *) dflt="$gidtype";;
19506 gid_t) echo "gid_t found." ;;
19507 *) rp="What is the type for group ids returned by getgid()?"
19513 : Check the size of GID
19516 *_t) zzz="$gidtype" ;;
19519 echo "Checking the size of $zzz..." >&4
19521 #include <sys/types.h>
19523 #$i_stdlib I_STDLIB
19525 #include <stdlib.h>
19528 printf("%d\n", (int)sizeof($gidtype));
19533 if eval $compile_ok; then
19537 echo "(I can't execute the test program--guessing $gidsize.)" >&4
19540 echo "Your $zzz is $gidsize bytes long."
19545 echo "(I can't compile the test program--guessing $gidsize.)" >&4
19549 : Check if GID is signed
19552 *_t) zzz="$gidtype" ;;
19555 echo "Checking the sign of $zzz..." >&4
19557 #include <sys/types.h>
19568 if eval $compile; then
19572 echo "(I can't execute the test program--guessing unsigned.)" >&4
19576 1) echo "Your $zzz is unsigned." ;;
19577 -1) echo "Your $zzz is signed." ;;
19583 echo "(I can't compile the test program--guessing unsigned.)" >&4
19587 : Check 64bit sizes
19590 if $test X"$quadtype" != X; then
19592 echo "Checking how to print 64-bit integers..." >&4
19594 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
19595 $cat >try.c <<'EOCP'
19596 #include <sys/types.h>
19599 int q = 12345678901;
19600 printf("%ld\n", q);
19604 if eval $compile; then
19608 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
19609 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
19610 echo "We will use %d."
19616 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
19617 $cat >try.c <<'EOCP'
19618 #include <sys/types.h>
19621 long q = 12345678901;
19622 printf("%ld\n", q);
19626 if eval $compile; then
19630 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
19631 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
19632 echo "We will use %ld."
19638 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
19639 $cat >try.c <<'EOCP'
19640 #include <sys/types.h>
19641 #include <inttypes.h>
19644 int64_t q = 12345678901;
19645 printf("%" PRId64 "\n", q);
19649 if eval $compile; then
19653 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
19654 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
19655 echo "We will use the C9X style."
19661 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
19663 #include <sys/types.h>
19666 $quadtype q = 12345678901;
19667 printf("%Ld\n", q);
19671 if eval $compile; then
19675 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
19676 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
19677 echo "We will use %Ld."
19683 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
19684 $cat >try.c <<'EOCP'
19685 #include <sys/types.h>
19688 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
19689 printf("%lld\n", q);
19693 if eval $compile; then
19697 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
19698 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
19699 echo "We will use the %lld style."
19705 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
19707 #include <sys/types.h>
19710 $quadtype q = 12345678901;
19711 printf("%qd\n", q);
19715 if eval $compile; then
19719 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
19720 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
19721 echo "We will use %qd."
19727 if $test X"$sPRId64" = X; then
19728 echo "Cannot figure out how to print 64-bit integers." >&4
19735 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
19736 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
19738 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
19739 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
19743 : Check format strings for internal types
19745 $echo "Checking the format strings to be used for Perl's internal types..." >&4
19747 if $test X"$ivsize" = X8; then
19748 ivdformat="$sPRId64"
19749 uvuformat="$sPRIu64"
19750 uvoformat="$sPRIo64"
19751 uvxformat="$sPRIx64"
19752 uvXUformat="$sPRIXU64"
19754 if $test X"$ivsize" = X"$longsize"; then
19761 if $test X"$ivsize" = X"$intsize"; then
19769 if $test X"$ivsize" = X"$shortsize"; then
19780 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
19781 nveformat="$sPRIeldbl"
19782 nvfformat="$sPRIfldbl"
19783 nvgformat="$sPRIgldbl"
19784 nvEUformat="$sPRIEUldbl"
19785 nvFUformat="$sPRIFUldbl"
19786 nvGUformat="$sPRIGUldbl"
19796 case "$ivdformat" in
19797 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
19802 : Check format string for GID
19805 $echo "Checking the format string to be used for gids..." >&4
19808 -1) if $test X"$gidsize" = X"$ivsize"; then
19809 gidformat="$ivdformat"
19811 if $test X"$gidsize" = X"$longsize"; then
19814 if $test X"$gidsize" = X"$intsize"; then
19817 if $test X"$gidsize" = X"$shortsize"; then
19824 *) if $test X"$gidsize" = X"$uvsize"; then
19825 gidformat="$uvuformat"
19827 if $test X"$gidsize" = X"$longsize"; then
19830 if $test X"$gidsize" = X"$intsize"; then
19833 if $test X"$gidsize" = X"$shortsize"; then
19842 : see if getgroups exists
19843 set getgroups d_getgrps
19846 : see if setgroups exists
19847 set setgroups d_setgrps
19850 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
19852 case "$d_getgrps$d_setgrps" in
19854 case "$groupstype" in
19855 '') dflt="$gidtype" ;;
19856 *) dflt="$groupstype" ;;
19859 What type of pointer is the second argument to getgroups() and setgroups()?
19860 Usually this is the same as group ids, $gidtype, but not always.
19863 rp='What type pointer is the second argument to getgroups() and setgroups()?'
19867 *) groupstype="$gidtype";;
19870 : MAD = Misc Attribute Definition
19872 if $test $patchlevel -lt 9; then
19873 : MAD is not available in 5.8.x or earlier.
19877 $define|true|[yY]*) dflt='y' ;;
19882 Would you like to build with Misc Attribute Decoration? This is development
19883 work leading to a Perl 5 to Perl 6 convertor, which imposes a space and speed
19884 overhead on the interpreter.
19886 If this doesn't make any sense to you, just accept the default '$dflt'.
19888 rp='Build Perl with MAD?'
19893 madlyh='madly.h madly.act madly.tab'
19895 madlyobj="madly$_o" ;;
19904 : check whether make sets MAKE
19906 echo "Checking if your $make program sets \$(MAKE)..." >&4
19907 case "$make_set_make" in
19909 $sed 's/^X //' > testmake.mak << 'EOF'
19911 X @echo 'maketemp="$(MAKE)"'
19913 case "`$make -f testmake.mak 2>/dev/null`" in
19914 *maketemp=*) make_set_make='#' ;;
19915 *) make_set_make="MAKE=$make" ;;
19917 $rm -f testmake.mak
19920 case "$make_set_make" in
19921 '#') echo "Yup, it does.";;
19922 *) echo "Nope, it doesn't.";;
19925 : see what type is used for mode_t
19926 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
19927 set mode_t modetype int stdio.h sys/types.h
19930 : see if we need va_copy
19932 case "$i_stdarg" in
19935 #include <stdarg.h>
19937 #$i_stdlib I_STDLIB
19939 #include <stdlib.h>
19941 #include <signal.h>
19944 ivfprintf(FILE *f, const char *fmt, va_list *valp)
19946 return vfprintf(f, fmt, *valp);
19950 myvfprintf(FILE *f, const char *fmt, va_list val)
19952 return ivfprintf(f, fmt, &val);
19956 myprintf(char *fmt, ...)
19959 va_start(val, fmt);
19960 return myvfprintf(stdout, fmt, val);
19964 main(int ac, char **av)
19966 signal(SIGSEGV, exit);
19968 myprintf("%s%cs all right, then\n", "that", '\'');
19973 if eval $compile && $run ./try 2>&1 >/dev/null; then
19974 case "`$run ./try`" in
19975 "that's all right, then")
19981 yes) echo "It seems that you don't need va_copy()." >&4
19982 need_va_copy="$undef"
19984 *) echo "It seems that va_copy() or similar will be needed." >&4
19985 need_va_copy="$define"
19990 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
19994 : see what type is used for size_t
19995 rp="What is the type used for the length parameter for string functions?"
19996 set size_t sizetype 'unsigned int' stdio.h sys/types.h
19999 : check for type of arguments to gethostbyaddr.
20000 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
20001 case "$d_gethbyaddr" in
20005 Checking to see what type of arguments are accepted by gethostbyaddr().
20007 hdrs="$define sys/types.h
20008 $d_socket sys/socket.h
20009 $i_niin netinet/in.h
20011 $i_unistd unistd.h"
20012 : The first arg can 'char *' or 'void *'
20013 : The second arg is some of integral type
20014 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
20015 for yyy in size_t long int; do
20016 case "$netdb_host_type" in
20017 '') try="$extern_C struct hostent *gethostbyaddr($xxx, $yyy, int);"
20018 if ./protochk "$try" $hdrs; then
20019 echo "Your system accepts $xxx for the first arg."
20020 echo "...and $yyy for the second arg."
20021 netdb_host_type="$xxx"
20022 netdb_hlen_type="$yyy"
20028 : In case none of those worked, prompt the user.
20029 case "$netdb_host_type" in
20030 '') rp='What is the type for the 1st argument to gethostbyaddr?'
20033 netdb_host_type=$ans
20034 rp='What is the type for the 2nd argument to gethostbyaddr?'
20037 netdb_hlen_type=$ans
20041 *) : no gethostbyaddr, so pick harmless defaults
20042 netdb_host_type='char *'
20043 netdb_hlen_type="$sizetype"
20046 # Remove the "const" if needed. -- but then we'll have a
20048 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
20051 : check for type of argument to gethostbyname.
20052 if test "X$netdb_name_type" = X ; then
20053 case "$d_gethbyname" in
20057 Checking to see what type of argument is accepted by gethostbyname().
20059 hdrs="$define sys/types.h
20060 $d_socket sys/socket.h
20061 $i_niin netinet/in.h
20063 $i_unistd unistd.h"
20064 for xxx in "const char *" "char *"; do
20065 case "$netdb_name_type" in
20066 '') try="$extern_C struct hostent *gethostbyname($xxx);"
20067 if ./protochk "$try" $hdrs; then
20068 echo "Your system accepts $xxx."
20069 netdb_name_type="$xxx"
20074 : In case none of those worked, prompt the user.
20075 case "$netdb_name_type" in
20076 '') rp='What is the type for the 1st argument to gethostbyname?'
20079 netdb_name_type=$ans
20083 *) : no gethostbyname, so pick harmless default
20084 netdb_name_type='char *'
20089 : check for type of 1st argument to getnetbyaddr.
20090 if test "X$netdb_net_type" = X ; then
20091 case "$d_getnbyaddr" in
20095 Checking to see what type of 1st argument is accepted by getnetbyaddr().
20097 hdrs="$define sys/types.h
20098 $d_socket sys/socket.h
20099 $i_niin netinet/in.h
20101 $i_unistd unistd.h"
20102 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
20103 case "$netdb_net_type" in
20104 '') try="$extern_C struct netent *getnetbyaddr($xxx, int);"
20105 if ./protochk "$try" $hdrs; then
20106 echo "Your system accepts $xxx."
20107 netdb_net_type="$xxx"
20112 : In case none of those worked, prompt the user.
20113 case "$netdb_net_type" in
20114 '') rp='What is the type for the 1st argument to getnetbyaddr?'
20117 netdb_net_type=$ans
20121 *) : no getnetbyaddr, so pick harmless default
20122 netdb_net_type='long'
20126 : locate the preferred pager for this system
20133 [a-zA-Z]:/*) dflt=$pg;;
20137 [a-zA-Z]:/*) dflt=$more;;
20141 [a-zA-Z]:/*) dflt=$less;;
20144 '') dflt=/usr/ucb/more;;
20152 rp='What pager is used on your system?'
20156 : see what type pids are declared as in the kernel
20157 rp="What is the type of process ids on this system?"
20158 set pid_t pidtype int stdio.h sys/types.h
20161 : see if ar generates random libraries by itself
20163 echo "Checking how to generate random libraries on your machine..." >&4
20164 echo 'int bar1() { return bar2(); }' > bar1.c
20165 echo 'int bar2() { return 2; }' > bar2.c
20167 #$i_stdlib I_STDLIB
20169 #include <stdlib.h>
20171 int main() { printf("%d\n", bar1()); exit(0); }
20173 $cc $ccflags -c bar1.c >/dev/null 2>&1
20174 $cc $ccflags -c bar2.c >/dev/null 2>&1
20175 $cc $ccflags -c foo.c >/dev/null 2>&1
20176 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
20177 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20178 $run ./foobar >/dev/null 2>&1; then
20179 echo "$ar appears to generate random libraries itself."
20181 if [ "X$ranlib" = "X" ]; then
20184 elif $ar s bar$_a >/dev/null 2>&1 &&
20185 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20186 $run ./foobar >/dev/null 2>&1; then
20187 echo "a table of contents needs to be added with '$ar s'."
20190 elif $ar ts bar$_a >/dev/null 2>&1 &&
20191 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20192 $run ./foobar >/dev/null 2>&1; then
20193 echo "a table of contents needs to be added with '$ar ts'."
20200 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
20201 $test -f $ranlib || ranlib=''
20204 if $test -n "$ranlib"; then
20205 echo "your system has '$ranlib'; we'll use that."
20208 echo "your system doesn't seem to support random libraries"
20209 echo "so we'll use lorder and tsort to order the libraries."
20216 : see if this is a values.h system
20217 set values.h i_values
20220 : Check the max offset that gmtime and localtime accept
20221 echo "Checking max offsets that gmtime () accepts"
20224 define) yyy="#include <values.h>" ;;
20228 case "$sGMTIME_min/$sGMTIME_max" in
20231 #include <sys/types.h>
20240 void gm_check (time_t t, int min_year, int max_year)
20243 if ( tmp == NULL ||
20244 /* Check tm_year overflow */
20245 tmp->tm_year < min_year || tmp->tm_year > max_year)
20256 gm_check (MAXLONG, 69, 0x7fffffff);
20258 if (tmp == NULL || tmp->tm_year < 0) {
20259 for (i = 63; i >= 0; i--) {
20260 time_t x = pt | ((time_t)1 << i);
20261 if (x < 0 || x < pt) continue;
20262 gm_check (x, 69, 0x7fffffff);
20265 printf ("sGMTIME_max=%ld\n", pt);
20274 gm_check (MINLONG, -1900, 70);
20277 for (i = 36; i >= 0; i--) {
20278 time_t x = pt - ((time_t)1 << i);
20279 if (x > 0) continue;
20280 gm_check (x, -1900, 70);
20283 printf ("sGMTIME_min=%ld\n", pt);
20287 int main (int argc, char *argv[])
20289 fprintf (stderr, "Sizeof time_t = %ld\n", sizeof (time_t));
20296 if eval $compile; then
20299 echo "Cannot determine sGMTIME_max and sGMTIME_min." >&4
20305 echo "Checking max offsets that localtime () accepts"
20307 case "$sLOCALTIME_min/$sLOCALTIME_max" in
20310 #include <sys/types.h>
20319 void local_check (time_t t, int min_year, int max_year)
20321 if (sizeof (time_t) > 4 && t > 0x7ffffffffffff000LL)
20324 tmp = localtime (&t);
20325 if ( tmp == NULL ||
20326 /* Check tm_year overflow */
20327 tmp->tm_year < min_year || tmp->tm_year > max_year)
20331 } /* local_check */
20338 local_check (MAXLONG, 69, 0x7fffffff);
20340 if (tmp == NULL || tmp->tm_year < 0) {
20341 for (i = 63; i >= 0; i--) {
20342 time_t x = pt | ((time_t)1 << i);
20343 if (x < 0 || x < pt) continue;
20344 local_check (x, 69, 0x7fffffff);
20347 printf ("sLOCALTIME_max=%ld\n", pt);
20356 local_check (MINLONG, -1900, 70);
20359 for (i = 36; i >= 0; i--) {
20360 time_t x = pt - ((time_t)1 << i);
20361 if (x > 0) continue;
20362 local_check (x, -1900, 70);
20365 printf ("sLOCALTIME_min=%ld\n", pt);
20369 int main (int argc, char *argv[])
20377 if eval $compile; then
20380 echo "Cannot determine sLOCALTIME_max and sLOCALTIME_min." >&4
20386 : check for type of arguments to select.
20387 case "$selecttype" in
20388 '') case "$d_select" in
20392 Checking to see what type of arguments are accepted by select().
20394 hdrs="$define sys/types.h
20395 $i_systime sys/time.h
20396 $i_sysselct sys/select.h
20397 $d_socket sys/socket.h"
20398 : The first arg can be int, unsigned, or size_t
20399 : The last arg may or may not be 'const'
20401 : void pointer has been seen but using that
20402 : breaks the selectminbits test
20403 for xxx in 'fd_set *' 'int *'; do
20404 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
20405 for tmo in 'struct timeval *' 'const struct timeval *'; do
20407 '') try="$extern_C select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
20408 if ./protochk "$try" $hdrs; then
20409 echo "Your system accepts $xxx."
20418 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
20419 case "$d_fd_set" in
20420 $define) dflt="fd_set *" ;;
20429 *) : no select, so pick a harmless default
20436 : check for the select 'width'
20437 case "$selectminbits" in
20438 '') safebits=`expr $ptrsize \* 8`
20439 case "$d_select" in
20443 Checking to see on how many bits at a time your select() operates...
20446 #include <sys/types.h>
20448 #$i_systime I_SYS_TIME
20449 #$i_systimek I_SYS_TIME_KERNEL
20454 # ifdef I_SYS_TIME_KERNEL
20457 # include <sys/time.h>
20458 # ifdef I_SYS_TIME_KERNEL
20462 #$i_sysselct I_SYS_SELECT
20463 #ifdef I_SYS_SELECT
20464 #include <sys/select.h>
20466 #$d_socket HAS_SOCKET
20468 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
20471 #$i_stdlib I_STDLIB
20473 #include <stdlib.h>
20476 #define S sizeof(*(b))
20478 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
20479 #define NBITS (NBYTES * 8)
20481 char *s = (char *)malloc(NBYTES);
20490 fp = fopen("try.c", "r");
20496 b = ($selecttype)s;
20497 for (i = 0; i < NBITS; i++)
20501 select(fd + 1, b, 0, 0, &t);
20502 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
20504 printf("%d\n", i + 1);
20509 if eval $compile_ok; then
20510 selectminbits=`$run ./try`
20511 case "$selectminbits" in
20513 Cannot figure out on how many bits at a time your select() operates.
20514 I'll play safe and guess it is $safebits bits.
20516 selectminbits=$safebits
20517 bits="$safebits bits"
20520 *) bits="$selectminbits bits" ;;
20522 echo "Your select() operates on $bits at a time." >&4
20524 rp='What is the minimum number of bits your select() operates on?'
20525 case "$byteorder" in
20526 12345678) dflt=64 ;;
20532 selectminbits="$val"
20536 *) : no select, so pick a harmless default
20537 selectminbits=$safebits
20543 : Trace out the files included by signal.h, then look for SIGxxx names.
20544 if [ "X$fieldn" = X ]; then
20545 : Just make some guesses. We check them later.
20546 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
20548 xxx=`echo '#include <signal.h>' |
20549 $cppstdin $cppminus $cppflags 2>/dev/null |
20550 $grep '^[ ]*#.*include' |
20551 $awk "{print \\$$fieldn}" | $sed 's!"!!g' |\
20552 $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
20555 for xx in $xxx /dev/null ; do
20556 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
20558 case "$xxxfiles" in
20559 '') xxxfiles=`./findhdr signal.h` ;;
20562 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
20563 print substr($2, 4, 20)
20565 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
20566 print substr($3, 4, 20)
20568 : Append some common names just in case the awk scan failed.
20569 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
20570 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
20571 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
20572 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
20573 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
20575 : generate a few handy files for later
20576 $cat > signal.c <<EOCP
20577 #include <sys/types.h>
20578 #include <signal.h>
20579 #$i_stdlib I_STDLIB
20581 #include <stdlib.h>
20586 /* Strange style to avoid deeply-nested #if/#else/#endif */
20589 # define NSIG (_NSIG)
20595 # define NSIG (SIGMAX+1)
20601 # define NSIG (SIG_MAX+1)
20607 # define NSIG (_SIG_MAX+1)
20613 # define NSIG (MAXSIG+1)
20619 # define NSIG (MAX_SIG+1)
20624 # ifdef SIGARRAYSIZE
20625 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
20631 # define NSIG (_sys_nsig) /* Solaris 2.5 */
20635 /* Default to some arbitrary number that's big enough to get most
20636 of the common signals.
20642 printf("NSIG %d\n", NSIG);
20648 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
20650 printf "#ifdef SIG"; printf $1; printf "\n"
20651 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
20652 printf $1; printf ");\n"
20656 printf "#endif /* JUST_NSIG */\n";
20657 printf "exit(0);\n}\n";
20660 $cat >signal.awk <<'EOP'
20661 BEGIN { ndups = 0 }
20662 $1 ~ /^NSIG$/ { nsig = $2 }
20663 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
20664 if ($2 > maxsig) { maxsig = $2 }
20665 if (sig_name[$2]) {
20666 dup_name[ndups] = $1
20667 dup_num[ndups] = $2
20679 printf("NSIG %d\n", nsig);
20680 for (n = 1; n < nsig; n++) {
20682 printf("%s %d\n", sig_name[n], sig_num[n])
20685 printf("NUM%d %d\n", n, n)
20688 for (n = 0; n < ndups; n++) {
20689 printf("%s %d\n", dup_name[n], dup_num[n])
20693 $cat >signal_cmd <<EOS
20695 if $test -s signal.lst; then
20696 echo "Using your existing signal.lst file"
20701 $cat >>signal_cmd <<'EOS'
20704 if eval $compile_ok; then
20705 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) |\
20706 $uniq | $awk -f signal.awk >signal.lst
20708 echo "(I can't seem be able to compile the whole test program)" >&4
20709 echo "(I'll try it in little pieces.)" >&4
20710 set signal -DJUST_NSIG
20711 if eval $compile_ok; then
20712 $run ./signal$_exe > signal.nsg
20715 echo "I can't seem to figure out how many signals you have." >&4
20716 echo "Guessing 50." >&4
20717 echo 'NSIG 50' > signal.nsg
20719 : Now look at all the signal names, one at a time.
20720 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
20721 $cat > signal.c <<EOCP
20722 #include <sys/types.h>
20723 #include <signal.h>
20726 printf("$xx %d\n", SIG${xx});
20731 if eval $compile; then
20732 echo "SIG${xx} found."
20733 $run ./signal$_exe >> signal.ls1
20735 echo "SIG${xx} NOT found."
20738 if $test -s signal.ls1; then
20739 $cat signal.nsg signal.ls1 |
20740 $sort -n | $uniq | $awk -f signal.awk >signal.lst
20744 if $test -s signal.lst; then
20747 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
20748 echo 'kill -l' >signal
20749 set X `csh -f <signal`
20753 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
20755 echo $@ | $tr ' ' $trnl | \
20756 $awk '{ printf "%s %d\n", $1, ++s; }
20757 END { printf "NSIG %d\n", ++s }' >signal.lst
20759 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
20761 chmod a+x signal_cmd
20762 $eunicefix signal_cmd
20764 : generate list of signal names
20766 case "$sig_name_init" in
20768 *) case "$sig_num_init" in
20769 ''|*,*) doinit=yes ;;
20774 echo "Generating a list of signal names and numbers..." >&4
20776 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
20777 sig_name=`$awk 'BEGIN { printf "ZERO " }
20778 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
20779 sig_num=`$awk 'BEGIN { printf "0 " }
20780 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
20781 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
20782 !/^NSIG/ { printf "\"%s\", ", $1 }
20783 END { printf "0\n" }' signal.lst`
20784 sig_num_init=`$awk 'BEGIN { printf "0, " }
20785 !/^NSIG/ { printf "%d, ", $2}
20786 END { printf "0\n"}' signal.lst`
20789 echo "The following $sig_count signals are available:"
20791 echo $sig_name | $awk \
20792 'BEGIN { linelen = 0 }
20794 for (i = 1; i <= NF; i++) {
20795 name = "SIG" $i " "
20796 linelen = linelen + length(name)
20797 if (linelen > 70) {
20799 linelen = length(name)
20805 sig_size=`echo $sig_name | awk '{print NF}'`
20806 $rm -f signal signal.c signal.awk signal.lst signal_cmd
20808 : Check size of size
20810 case "$sizetype" in
20811 *_t) zzz="$sizetype" ;;
20812 *) zzz="filesize" ;;
20814 echo "Checking the size of $zzz..." >&4
20816 #include <sys/types.h>
20818 #$i_stdlib I_STDLIB
20820 #include <stdlib.h>
20823 printf("%d\n", (int)sizeof($sizetype));
20828 if eval $compile_ok; then
20832 echo "(I can't execute the test program--guessing $sizesize.)" >&4
20835 echo "Your $zzz size is $sizesize bytes."
20840 echo "(I can't compile the test program--guessing $sizesize.)" >&4
20844 : check for socklen_t
20846 echo "Checking to see if you have socklen_t..." >&4
20848 #include <sys/types.h>
20849 #$d_socket HAS_SOCKET
20851 #include <sys/socket.h>
20853 int main() { socklen_t x = 16; }
20856 if eval $compile; then
20858 echo "You have socklen_t."
20861 echo "You do not have socklen_t."
20862 case "$sizetype" in
20863 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
20870 : see if this is a socks.h system
20871 set socks.h i_socks
20874 : check for type of the size argument to socket calls
20875 case "$d_socket" in
20879 Checking to see what type is the last argument of accept().
20882 case "$d_socklen_t" in
20883 "$define") yyy="$yyy socklen_t"
20885 yyy="$yyy $sizetype int long unsigned"
20886 for xxx in $yyy; do
20887 case "$socksizetype" in
20888 '') try="$extern_C int accept(int, struct sockaddr *, $xxx *);"
20889 case "$usesocks" in
20891 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
20892 echo "Your system accepts '$xxx *' for the last argument of accept()."
20893 socksizetype="$xxx"
20896 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
20897 echo "Your system accepts '$xxx *' for the last argument of accept()."
20898 socksizetype="$xxx"
20905 : In case none of those worked, prompt the user.
20906 case "$socksizetype" in
20907 '') rp='What is the type for socket address structure sizes?'
20914 *) : no sockets, so pick relatively harmless default
20919 : see what type is used for signed size_t
20920 set ssize_t ssizetype int stdio.h sys/types.h
20925 #$i_stdlib I_STDLIB
20927 #include <stdlib.h>
20929 #include <sys/types.h>
20930 #define Size_t $sizetype
20931 #define SSize_t $dflt
20934 if (sizeof(Size_t) == sizeof(SSize_t))
20936 else if (sizeof(Size_t) == sizeof(int))
20945 if eval $compile_ok && $run ./try > /dev/null; then
20946 ssizetype=`$run ./try`
20947 echo "I'll be using $ssizetype for functions returning a byte count." >&4
20950 Help! I can't compile and run the ssize_t test program: please enlighten me!
20951 (This is probably a misconfiguration in your system or libraries, and
20952 you really ought to fix it. Still, I'll try anyway.)
20954 I need a type that is the same size as $sizetype, but is guaranteed to
20955 be signed. Common values are ssize_t, int and long.
20958 rp="What signed type is the same size as $sizetype?"
20964 : see what type of char stdio uses.
20966 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
20967 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
20968 echo "Your stdio uses unsigned chars." >&4
20969 stdchar="unsigned char"
20971 echo "Your stdio uses signed chars." >&4
20976 : see what type uids are declared as in the kernel
20978 echo "Looking for the type for user ids returned by getuid()."
20979 set uid_t uidtype xxx stdio.h sys/types.h
20983 xxx=`./findhdr sys/user.h`
20984 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
20986 unsigned) dflt="$1 $2" ;;
20990 *) dflt="$uidtype";;
20993 uid_t) echo "uid_t found." ;;
20994 *) rp="What is the type for user ids returned by getuid()?"
21000 : Check size of UID
21003 *_t) zzz="$uidtype" ;;
21006 echo "Checking the size of $zzz..." >&4
21008 #include <sys/types.h>
21010 #$i_stdlib I_STDLIB
21012 #include <stdlib.h>
21015 printf("%d\n", (int)sizeof($uidtype));
21020 if eval $compile_ok; then
21024 echo "(I can't execute the test program--guessing $uidsize.)" >&4
21027 echo "Your $zzz is $uidsize bytes long."
21032 echo "(I can't compile the test program--guessing $uidsize.)" >&4
21035 : Check if UID is signed
21038 *_t) zzz="$uidtype" ;;
21041 echo "Checking the sign of $zzz..." >&4
21043 #include <sys/types.h>
21054 if eval $compile; then
21058 echo "(I can't execute the test program--guessing unsigned.)" >&4
21062 1) echo "Your $zzz is unsigned." ;;
21063 -1) echo "Your $zzz is signed." ;;
21069 echo "(I can't compile the test program--guessing unsigned.)" >&4
21073 : Check format string for UID
21075 $echo "Checking the format string to be used for uids..." >&4
21078 -1) if $test X"$uidsize" = X"$ivsize"; then
21079 uidformat="$ivdformat"
21081 if $test X"$uidsize" = X"$longsize"; then
21084 if $test X"$uidsize" = X"$intsize"; then
21087 if $test X"$uidsize" = X"$shortsize"; then
21094 *) if $test X"$uidsize" = X"$uvsize"; then
21095 uidformat="$uvuformat"
21097 if $test X"$uidsize" = X"$longsize"; then
21100 if $test X"$uidsize" = X"$intsize"; then
21103 if $test X"$uidsize" = X"$shortsize"; then
21112 : Check if site customization support was requested
21113 case "$usesitecustomize" in
21114 $define|true|[Yy]*)
21115 usesitecustomize="$define"
21118 usesitecustomize="$undef"
21122 : determine compiler compiler
21131 if $test -f "$byacc$_exe"; then
21133 comp="byacc or $comp"
21135 if $test -f "$bison$_exe"; then
21136 comp="$comp or bison -y"
21138 rp="Which compiler compiler ($comp) shall I use?"
21147 echo "(Adding -y option to bison to get yacc-compatible behaviour.)"
21153 : see if this is a assert.h system
21154 set assert.h i_assert
21157 : see if this is a fp.h system
21161 : see if this is a fp_class.h system
21162 set fp_class.h i_fp_class
21165 : see if gdbm.h is available
21170 : see if gdbm_open exists
21171 set gdbm_open d_gdbm_open
21173 case "$d_gdbm_open" in
21176 echo "We won't be including <gdbm.h>"
21185 : see if this is a ieeefp.h system
21186 case "$i_ieeefp" in
21187 '' ) set ieeefp.h i_ieeefp
21192 : see if this is a libutil.h system
21193 set libutil.h i_libutil
21196 : see if mach cthreads are available
21197 if test "X$usethreads" = "X$define"; then
21198 set mach/cthreads.h i_machcthr
21201 i_machcthr="$undef"
21204 : see if this is a mntent.h system
21205 set mntent.h i_mntent
21208 : see if net/errno.h is available
21210 set net/errno.h val
21213 : Unfortunately, it causes problems on some systems. Arrgh.
21216 cat > try.c <<'EOM'
21219 #include <net/errno.h>
21225 if $cc $ccflags -c try.c >/dev/null 2>&1; then
21226 echo "We'll be including <net/errno.h>." >&4
21228 echo "We won't be including <net/errno.h>." >&4
21237 : see if netinet/tcp.h is available
21238 set netinet/tcp.h i_netinettcp
21241 : see if this is a poll.h system
21245 : see if this is a prot.h system
21249 : Preprocessor symbols
21251 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
21252 $cat <<'EOSH' > Cppsym.know
21253 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
21254 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
21255 alliant alpha am29000 AM29000 AMD64 amd64 amiga AMIGAOS AMIX
21256 ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
21257 BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
21258 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
21259 bull c cadmus clipper CMU COFF COMPILER_VERSION
21260 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
21261 CYGWIN DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
21262 Dynix DynixPTX ELF encore EPI EXTENSIONS FAVOR_BSD
21263 FILE_OFFSET_BITS FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
21265 GNU_SOURCE GNUC GNUC_MINOR GNU_LIBRARY GO32 gould GOULD_PN
21266 H3050R H3050RX hbullx20 hcx host_mips
21267 hp200 hp300 hp700 HP700 hp800 hp9000
21268 hp9000s200 hp9000s300 hp9000s400 hp9000s500
21269 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
21270 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
21271 IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
21272 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
21273 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
21274 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
21275 LIBCATAMOUNT Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
21276 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
21277 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
21278 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
21279 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
21280 MATH_HAS_NO_SIDE_EFFECTS
21281 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
21282 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
21283 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
21284 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
21285 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
21286 NetBSD news1500 news1700 news1800 news1900 news3700
21287 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
21288 ns32016 ns32332 ns32k nsc32000
21289 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
21290 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
21291 pc532 pdp11 PGC PIC plexus PORTAR posix
21292 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
21293 POSIX_C_SOURCE POSIX_SOURCE POWER
21294 PROTOTYPES PWB pyr QNX QK_USER R3000 REENTRANT RES Rhapsody RISC6000
21295 riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
21296 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
21297 sony sony_news sonyrisc sparc sparclite spectrum
21298 stardent stdc STDC_EXT stratos sun sun3 sun386
21299 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
21300 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
21301 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
21302 sysV68 sysV88 Tek4132 Tek4300 titan
21303 TM3200 TM5400 TM5600
21304 tower tower32 tower32_200 tower32_600 tower32_700
21305 tower32_800 tower32_850 tss
21306 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
21307 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
21308 unix UNIX95 UNIX99 unixpc unos
21309 USE_BSD USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE USE_LARGEFILE64
21310 USE_MISC USE_POSIX USE_POSIX199309 USE_POSIX199506 USE_POSIX2
21311 USE_REENTRANT USE_SVID USE_UNIX98 USE_XOPEN USE_XOPEN_EXTENDED
21313 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms x86_64 xenix Xenix286
21314 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
21315 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
21318 # Maybe put other stuff here too.
21319 cat <<EOSH >>Cppsym.know
21322 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
21323 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
21324 $cat Cppsym.know > Cppsym.c
21325 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
21326 $rm -f Cppsym.a Cppsym.b Cppsym.c
21327 cat <<EOSH > Cppsym
21329 if $test \$# -gt 0; then
21330 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
21331 if $test -s Cppsym.got; then
21338 $tr " " "$trnl" | ./Cppsym.try
21344 cat <<EOSH > Cppsym.try
21346 cat <<'EOCP' > try.c
21349 #define STRINGIFY(a) "a"
21351 #if cpp_stuff == 42
21352 #define StGiFy(a) #a
21353 #define STRINGIFY(a) StGiFy(a)
21355 #if $cpp_stuff != 1 && $cpp_stuff != 42
21356 # include "Bletch: How does this C preprocessor stringify macros?"
21362 cat <<'EOSH' >> Cppsym.try
21364 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
21365 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
21366 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
21367 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
21369 echo 'return 0;}' >> try.c
21371 cat <<EOSH >> Cppsym.try
21373 case "$osname-$gccversion" in
21374 irix-) ccflags="\$ccflags -woff 1178" ;;
21375 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
21377 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs && $run ./try | $sed 's/ /\\\\ /g'
21379 chmod +x Cppsym.try
21380 $eunicefix Cppsym.try
21381 ./Cppsym < Cppsym.know > Cppsym.true
21382 : Add in any linux cpp "predefined macros":
21383 case "$osname::$gccversion" in
21386 rm -f $tHdrH'.h' $tHdrH
21388 if cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
21389 sed 's/#define[\ \ ]*//;s/[\ \ ].*$//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
21390 if [ -s $tHdrH'_cppsym.real' ]; then
21391 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
21394 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
21397 : now check the C compiler for additional symbols
21398 postprocess_cc_v=''
21400 aix) postprocess_cc_v="|$tr , ' '" ;;
21407 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
21410 -D*) echo "\$i" | $sed 's/^-D//';;
21411 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
21416 postprocess_cc_v=''
21419 ./ccsym > ccsym1.raw
21420 if $test -s ccsym1.raw; then
21421 $sort ccsym1.raw | $uniq >ccsym.raw
21423 mv ccsym1.raw ccsym.raw
21426 $awk '/\=/ { print $0; next }
21427 { print $0"=1" }' ccsym.raw >ccsym.list
21428 $comm -13 Cppsym.true ccsym.list >ccsym.own
21429 $comm -12 Cppsym.true ccsym.list >ccsym.com
21430 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
21432 if $test -z ccsym.raw; then
21433 echo "Your C compiler doesn't seem to define any symbols!" >&4
21435 echo "However, your C preprocessor defines the following symbols:"
21438 cppsymbols=`$cat Cppsym.true`
21439 cppsymbols=`echo $cppsymbols`
21440 cppccsymbols="$cppsymbols"
21442 if $test -s ccsym.com; then
21443 echo "Your C compiler and pre-processor define these symbols:"
21444 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
21447 cppccsymbols=`$cat ccsym.com`
21448 cppccsymbols=`echo $cppccsymbols`
21449 $test "$silent" || sleep 1
21451 if $test -s ccsym.cpp; then
21452 $test "$also" && echo " "
21453 echo "Your C pre-processor ${also}defines the following symbols:"
21454 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
21456 cppsymbols=`$cat ccsym.cpp`
21457 cppsymbols=`echo $cppsymbols`
21458 $test "$silent" || sleep 1
21460 if $test -s ccsym.own; then
21461 $test "$also" && echo " "
21462 echo "Your C compiler ${also}defines the following cpp symbols:"
21463 $sed -e 's/\(..*\)=1/\1/' ccsym.own
21464 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
21465 ccsymbols=`$cat ccsym.own`
21466 ccsymbols=`echo $ccsymbols`
21467 $test "$silent" || sleep 1
21471 : see if this is a termio system
21475 if $test `./findhdr termios.h`; then
21476 set tcsetattr i_termios
21482 "$define") echo "You have POSIX termios.h... good!" >&4;;
21483 *) if ./Cppsym pyr; then
21484 case "`/bin/universe`" in
21485 ucb) if $test `./findhdr sgtty.h`; then
21487 echo "<sgtty.h> found." >&4
21489 echo "System is pyramid with BSD universe."
21490 ./warn "<sgtty.h> not found--you could have problems."
21492 *) if $test `./findhdr termio.h`; then
21494 echo "<termio.h> found." >&4
21496 echo "System is pyramid with USG universe."
21497 ./warn "<termio.h> not found--you could have problems."
21501 if $test `./findhdr termio.h`; then
21502 echo "<termio.h> found." >&4
21504 elif $test `./findhdr sgtty.h`; then
21505 echo "<sgtty.h> found." >&4
21508 ./warn "Neither <termio.h> nor <sgtty.h> found--cross fingers!"
21511 if $test `./findhdr sgtty.h`; then
21512 echo "<sgtty.h> found." >&4
21514 elif $test `./findhdr termio.h`; then
21515 echo "<termio.h> found." >&4
21518 ./warn "Neither <sgtty.h> nor <termio.h> found--cross fingers!"
21522 set i_termio; eval $setvar
21523 val=$val2; set i_sgtty; eval $setvar
21524 val=$val3; set i_termios; eval $setvar
21526 : see if stddef is available
21527 set stddef.h i_stddef
21530 : see if sys/access.h is available
21531 set sys/access.h i_sysaccess
21534 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
21535 set sys/filio.h i_sysfilio
21538 if $test `./findhdr sys/ioctl.h`; then
21540 echo '<sys/ioctl.h> found.' >&4
21543 if $test $i_sysfilio = "$define"; then
21544 echo '<sys/ioctl.h> NOT found.' >&4
21546 $test $i_sgtty = "$define" && xxx="sgtty.h"
21547 $test $i_termio = "$define" && xxx="termio.h"
21548 $test $i_termios = "$define" && xxx="termios.h"
21549 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
21555 : see if socket ioctl defs are in sys/sockio.h
21557 xxx=`./findhdr sys/sockio.h`
21558 if $test "$xxx"; then
21559 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
21561 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
21564 echo "No socket ioctls found in <sys/sockio.h>." >&4
21569 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
21575 : see if this is a syslog.h system
21576 set syslog.h i_syslog
21579 : see if this is a sys/mode.h system
21580 set sys/mode.h i_sysmode
21583 : see if there is a sys/poll.h file
21584 set sys/poll.h i_syspoll
21587 : see if sys/resource.h has to be included
21588 set sys/resource.h i_sysresrc
21591 : see if sys/security.h is available
21592 set sys/security.h i_syssecrt
21595 : see if this is a sys/statvfs.h system
21596 set sys/statvfs.h i_sysstatvfs
21599 : see if this is a sys/un.h system
21600 set sys/un.h i_sysun
21603 : see if this is a sys/utsname.h system
21604 set sys/utsname.h i_sysutsname
21607 : see if this is a syswait system
21608 set sys/wait.h i_syswait
21611 : see if this is a ustat.h system
21612 set ustat.h i_ustat
21615 : see if this is an utime system
21616 set utime.h i_utime
21619 : see if this is a vfork system
21622 set vfork.h i_vfork
21632 echo "Looking for extensions..." >&4
21633 : If we are using the old config.sh, known_extensions may contain
21634 : old or inaccurate or duplicate values.
21635 known_extensions=''
21636 nonxs_extensions=''
21637 : We do not use find because it might not be available.
21638 : We do not just use MANIFEST because the user may have dropped
21639 : some additional extensions into the source tree and expect them
21642 : Function to recursively find available extensions, ignoring DynaLoader
21643 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
21647 DynaLoader|dynaload) ;;
21649 this_ext=`echo $xxx | $sed -e s/-/\\\//g`;
21650 leaf=`echo $xxx | $sed -e s/.*-//`;
21651 if $test -d File-Glob; then
21652 if $test -f $xxx/$leaf.xs -o -f $xxx/$leaf.c; then
21653 known_extensions="$known_extensions $this_ext";
21654 elif $test -d $xxx; then
21655 nonxs_extensions="$nonxs_extensions $this_ext";
21658 if $test -f $xxx/$leaf.xs -o -f $xxx/$leaf.c; then
21659 known_extensions="$known_extensions $1$this_ext";
21660 elif $test -f $xxx/Makefile.PL; then
21661 nonxs_extensions="$nonxs_extensions $1$this_ext";
21663 if $test -d $xxx -a $# -lt 10; then
21666 eval $find_extensions;
21679 eval $find_extensions
21680 if $test -d File-Glob; then
21681 : All ext/ flattened
21683 # Special case: Add in modules that nest beyond the first level.
21684 # Currently threads/shared and Hash/Util/FieldHash, since they are
21685 # not picked up by the recursive find above (and adding in general
21686 # recursive finding breaks SDBM_File/sdbm).
21687 # A.D. 20011025 (SDBM), ajgough 20071008 (FieldHash)
21688 known_extensions="$known_extensions threads/shared Hash/Util/FieldHash"
21690 set X $known_extensions
21692 known_extensions="$*"
21693 set X $nonxs_extensions
21695 nonxs_extensions="$*"
21698 : Now see which are supported on this system.
21700 for xxx in $known_extensions ; do
21704 $define) avail_ext="$avail_ext $xxx" ;;
21707 GDBM_File|gdbm_fil)
21709 $define) avail_ext="$avail_ext $xxx" ;;
21712 I18N/Langinfo|i18n_lan)
21713 case "$i_langinfo$d_nl_langinfo" in
21714 $define$define) avail_ext="$avail_ext $xxx" ;;
21718 : XXX Do we need a useipcsysv variable here
21719 case "${d_msg}${d_sem}${d_shm}" in
21720 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
21723 NDBM_File|ndbm_fil)
21726 case "$osname-$use64bitint" in
21729 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
21732 *) avail_ext="$avail_ext $xxx" ;;
21737 ODBM_File|odbm_fil)
21738 case "${i_dbm}${i_rpcsvcdbm}" in
21740 case "$d_cplusplus" in
21741 define) ;; # delete as a function name will not work
21742 *) case "$osname-$use64bitint" in
21745 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
21748 *) avail_ext="$avail_ext $xxx" ;;
21756 case "$useopcode" in
21757 true|define|y) avail_ext="$avail_ext $xxx" ;;
21761 case "$useposix" in
21762 true|define|y) avail_ext="$avail_ext $xxx" ;;
21766 case "$d_socket" in
21769 beos) ;; # not unless BONE
21770 *) avail_ext="$avail_ext $xxx" ;;
21775 Sys/Syslog|sys/syslog)
21776 : XXX syslog requires socket
21777 case "$d_socket" in
21778 true|$define|y) avail_ext="$avail_ext $xxx" ;;
21782 case "$usethreads" in
21784 case "$use5005threads" in
21785 $define|true|[yY]*) avail_ext="$avail_ext $xxx" ;;
21789 threads|threads/shared)
21790 # threads and threads::shared are special cases.
21791 # To stop people from asking "Perl 5.8.0 was supposed
21792 # to have this new fancy threads implementation but my
21793 # perl doesn't have it" and from people trying to
21794 # (re)install the threads module using CPAN.pm and
21795 # CPAN.pm then offering to reinstall Perl 5.8.0,
21796 # the threads.pm and threads/shared.pm will always be
21797 # there, croaking informatively ("you need to rebuild
21798 # all of Perl with threads, sorry") when threads haven't
21799 # been compiled in.
21801 avail_ext="$avail_ext $xxx"
21807 cygwin) avail_ext="$avail_ext $xxx" ;;
21810 XS/APItest|xs/apitest)
21811 # This is just for testing. Skip it unless we have dynamic loading.
21814 $define) avail_ext="$avail_ext $xxx" ;;
21817 XS/Typemap|xs/typemap)
21818 # This is just for testing. Skip it unless we have dynamic loading.
21820 $define) avail_ext="$avail_ext $xxx" ;;
21823 *) avail_ext="$avail_ext $xxx"
21832 case "$onlyextensions" in
21834 *) keepextensions=''
21835 echo "You have requested that only certains extensions be included..." >&4
21836 for i in $onlyextensions; do
21837 case " $avail_ext " in
21839 echo "Keeping extension $i."
21840 keepextensions="$keepextensions $i"
21842 *) echo "Ignoring extension $i." ;;
21845 avail_ext="$keepextensions"
21849 case "$noextensions" in
21851 *) keepextensions=''
21852 echo "You have requested that certain extensions be ignored..." >&4
21853 for i in $avail_ext; do
21854 case " $noextensions " in
21855 *" $i "*) echo "Ignoring extension $i." ;;
21856 *) echo "Keeping extension $i.";
21857 keepextensions="$keepextensions $i"
21861 avail_ext="$keepextensions"
21865 : Now see which nonxs extensions are supported on this system.
21866 : For now assume all are.
21868 for xxx in $nonxs_extensions ; do
21870 *) nonxs_ext="$nonxs_ext $xxx"
21882 A number of extensions are supplied with $package. You may choose to
21883 compile these extensions for dynamic loading (the default), compile
21884 them into the $package executable (static loading), or not include
21885 them at all. Answer "none" to include no extensions.
21886 Note that DynaLoader is always built and need not be mentioned here.
21889 case "$dynamic_ext" in
21891 : Exclude those listed in static_ext
21893 for xxx in $avail_ext; do
21894 case " $static_ext " in
21896 *) dflt="$dflt $xxx" ;;
21903 *) dflt="$dynamic_ext"
21904 # Perhaps we are reusing an old out-of-date config.sh.
21907 if test X"$dynamic_ext" != X"$avail_ext"; then
21909 NOTICE: Your previous config.sh list may be incorrect.
21910 The extensions now available to you are
21912 but the default list from your previous config.sh is
21924 rp="What extensions do you wish to load dynamically?"
21927 none) dynamic_ext=' ' ;;
21928 *) dynamic_ext="$ans" ;;
21931 case "$static_ext" in
21933 : Exclude those already listed in dynamic linking
21935 for xxx in $avail_ext; do
21936 case " $dynamic_ext " in
21938 *) dflt="$dflt $xxx" ;;
21945 *) dflt="$static_ext"
21952 rp="What extensions do you wish to load statically?"
21955 none) static_ext=' ' ;;
21956 *) static_ext="$ans" ;;
21961 A number of extensions are supplied with $package. Answer "none"
21962 to include no extensions.
21963 Note that DynaLoader is always built and need not be mentioned here.
21966 case "$static_ext" in
21967 '') dflt="$avail_ext" ;;
21968 *) dflt="$static_ext"
21969 # Perhaps we are reusing an old out-of-date config.sh.
21972 if test X"$static_ext" != X"$avail_ext"; then
21974 NOTICE: Your previous config.sh list may be incorrect.
21975 The extensions now available to you are
21977 but the default list from your previous config.sh is
21986 : Exclude those that are not xs extensions
21990 rp="What extensions do you wish to include?"
21993 none) static_ext=' ' ;;
21994 *) static_ext="$ans" ;;
21999 # Encode is a special case. If we are building Encode as a static
22000 # extension, we need to explicitly list its subextensions as well.
22001 # For other nested extensions, this is handled automatically by
22002 # the appropriate Makefile.PL.
22003 case " $static_ext " in
22004 *" Encode "*) # Add the subextensions of Encode
22006 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
22007 static_ext="$static_ext Encode/$xxx"
22013 set X $dynamic_ext $static_ext $nonxs_ext
22017 # Sanity check: We require an extension suitable for use with
22018 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
22019 # should show up as failures in the test suite, but it's helpful to
22020 # catch them now.) The 'extensions' list is normally sorted
22021 # alphabetically, so we need to accept either
22022 # DB_File ... Fcntl ... IO ....
22023 # or something like
22024 # Fcntl ... NDBM_File ... IO ....
22025 case " $extensions" in
22026 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
22027 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
22028 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
22029 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
22030 echo "WARNING: The Perl you are building will be quite crippled." >& 4
22034 : Remove libraries needed only for extensions
22035 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
22036 : The exception is SunOS 4.x, which needs them.
22037 case "${osname}X${osvers}" in
22041 *) case "$usedl" in
22042 $define|true|[yY]*)
22043 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -lgdbm_compat @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
22047 *) perllibs="$libs"
22053 : Remove build directory name from cppstdin so it can be used from
22054 : either the present location or the final installed location.
22056 : Get out of the UU directory to get correct path name.
22058 case "$cppstdin" in
22060 echo "Stripping down cppstdin path name"
22066 : end of configuration questions
22068 echo "End of configuration questions."
22071 : back to where it started
22072 if test -d ../UU; then
22076 : configuration may be unconditionally patched via a 'config.arch' file
22077 if $test -f config.arch; then
22078 echo "I see a config.arch file, loading it." >&4
22082 : configuration may be patched via a 'config.over' file
22083 if $test -f config.over; then
22086 rp='I see a config.over file. Do you wish to load it?'
22089 n*) echo "OK, I'll ignore it.";;
22091 echo "Configuration override changes have been loaded."
22096 : in case they want portability, strip down executable paths
22097 case "$d_portable" in
22100 echo "Stripping down executable paths..." >&4
22101 for file in $loclist $trylist; do
22103 eval $file=`basename $temp`
22108 : create config.sh file
22110 echo "Creating config.sh..." >&4
22111 $spitshell <<EOT >config.sh
22114 # This file was produced by running the Configure script. It holds all the
22115 # definitions figured out by Configure. Should you modify one of these values,
22116 # do not forget to propagate your changes by running "Configure -der". You may
22117 # instead choose to run each of the .SH files by yourself, or "Configure -S".
22120 # Package name : $package
22121 # Source directory : $src
22122 # Configuration time: $cf_time
22123 # Configured by : $cf_by
22124 # Target system : $myuname
22127 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
22128 $spitshell <<EOT >>config.sh
22137 Revision='$Revision'
22145 alignbytes='$alignbytes'
22146 ansi2knr='$ansi2knr'
22147 aphostname='$aphostname'
22148 api_revision='$api_revision'
22149 api_subversion='$api_subversion'
22150 api_version='$api_version'
22151 api_versionstring='$api_versionstring'
22154 archlibexp='$archlibexp'
22155 archname64='$archname64'
22156 archname='$archname'
22157 archobjs='$archobjs'
22158 asctime_r_proto='$asctime_r_proto'
22166 byteorder='$byteorder'
22168 castflags='$castflags'
22171 cccdlflags='$cccdlflags'
22172 ccdlflags='$ccdlflags'
22174 ccflags_uselargefiles='$ccflags_uselargefiles'
22176 ccsymbols='$ccsymbols'
22177 ccversion='$ccversion'
22179 cf_email='$cf_email'
22184 clocktype='$clocktype'
22186 compress='$compress'
22187 contains='$contains'
22191 cpp_stuff='$cpp_stuff'
22192 cppccsymbols='$cppccsymbols'
22193 cppflags='$cppflags'
22195 cppminus='$cppminus'
22197 cppstdin='$cppstdin'
22198 cppsymbols='$cppsymbols'
22199 crypt_r_proto='$crypt_r_proto'
22200 cryptlib='$cryptlib'
22202 ctermid_r_proto='$ctermid_r_proto'
22203 ctime_r_proto='$ctime_r_proto'
22204 d_Gconvert='$d_Gconvert'
22205 d_PRIEUldbl='$d_PRIEUldbl'
22206 d_PRIFUldbl='$d_PRIFUldbl'
22207 d_PRIGUldbl='$d_PRIGUldbl'
22208 d_PRIXU64='$d_PRIXU64'
22209 d_PRId64='$d_PRId64'
22210 d_PRIeldbl='$d_PRIeldbl'
22211 d_PRIfldbl='$d_PRIfldbl'
22212 d_PRIgldbl='$d_PRIgldbl'
22213 d_PRIi64='$d_PRIi64'
22214 d_PRIo64='$d_PRIo64'
22215 d_PRIu64='$d_PRIu64'
22216 d_PRIx64='$d_PRIx64'
22217 d_SCNfldbl='$d_SCNfldbl'
22218 d__fwalk='$d__fwalk'
22219 d_access='$d_access'
22220 d_accessx='$d_accessx'
22223 d_archlib='$d_archlib'
22224 d_asctime64='$d_asctime64'
22225 d_asctime_r='$d_asctime_r'
22228 d_attribute_deprecated='$d_attribute_deprecated'
22229 d_attribute_format='$d_attribute_format'
22230 d_attribute_malloc='$d_attribute_malloc'
22231 d_attribute_nonnull='$d_attribute_nonnull'
22232 d_attribute_noreturn='$d_attribute_noreturn'
22233 d_attribute_pure='$d_attribute_pure'
22234 d_attribute_unused='$d_attribute_unused'
22235 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
22239 d_bsdgetpgrp='$d_bsdgetpgrp'
22240 d_bsdsetpgrp='$d_bsdsetpgrp'
22241 d_builtin_choose_expr='$d_builtin_choose_expr'
22242 d_builtin_expect='$d_builtin_expect'
22244 d_c99_variadic_macros='$d_c99_variadic_macros'
22245 d_casti32='$d_casti32'
22246 d_castneg='$d_castneg'
22247 d_charvspr='$d_charvspr'
22249 d_chroot='$d_chroot'
22250 d_chsize='$d_chsize'
22252 d_clearenv='$d_clearenv'
22253 d_closedir='$d_closedir'
22254 d_cmsghdr_s='$d_cmsghdr_s'
22256 d_copysignl='$d_copysignl'
22257 d_cplusplus='$d_cplusplus'
22259 d_crypt_r='$d_crypt_r'
22261 d_ctermid='$d_ctermid'
22262 d_ctermid_r='$d_ctermid_r'
22263 d_ctime64='$d_ctime64'
22264 d_ctime_r='$d_ctime_r'
22265 d_cuserid='$d_cuserid'
22266 d_dbl_dig='$d_dbl_dig'
22267 d_dbminitproto='$d_dbminitproto'
22268 d_difftime64='$d_difftime64'
22269 d_difftime='$d_difftime'
22270 d_dir_dd_fd='$d_dir_dd_fd'
22272 d_dirnamlen='$d_dirnamlen'
22273 d_dlerror='$d_dlerror'
22274 d_dlopen='$d_dlopen'
22275 d_dlsymun='$d_dlsymun'
22276 d_dosuid='$d_dosuid'
22277 d_drand48_r='$d_drand48_r'
22278 d_drand48proto='$d_drand48proto'
22280 d_eaccess='$d_eaccess'
22281 d_endgrent='$d_endgrent'
22282 d_endgrent_r='$d_endgrent_r'
22283 d_endhent='$d_endhent'
22284 d_endhostent_r='$d_endhostent_r'
22285 d_endnent='$d_endnent'
22286 d_endnetent_r='$d_endnetent_r'
22287 d_endpent='$d_endpent'
22288 d_endprotoent_r='$d_endprotoent_r'
22289 d_endpwent='$d_endpwent'
22290 d_endpwent_r='$d_endpwent_r'
22291 d_endsent='$d_endsent'
22292 d_endservent_r='$d_endservent_r'
22293 d_eofnblk='$d_eofnblk'
22294 d_eunice='$d_eunice'
22295 d_faststdio='$d_faststdio'
22296 d_fchdir='$d_fchdir'
22297 d_fchmod='$d_fchmod'
22298 d_fchown='$d_fchown'
22300 d_fcntl_can_lock='$d_fcntl_can_lock'
22301 d_fd_macros='$d_fd_macros'
22302 d_fd_set='$d_fd_set'
22303 d_fds_bits='$d_fds_bits'
22304 d_fgetpos='$d_fgetpos'
22305 d_finite='$d_finite'
22306 d_finitel='$d_finitel'
22307 d_flexfnam='$d_flexfnam'
22309 d_flockproto='$d_flockproto'
22311 d_fp_class='$d_fp_class'
22312 d_fpathconf='$d_fpathconf'
22313 d_fpclass='$d_fpclass'
22314 d_fpclassify='$d_fpclassify'
22315 d_fpclassl='$d_fpclassl'
22316 d_fpos64_t='$d_fpos64_t'
22317 d_frexpl='$d_frexpl'
22318 d_fs_data_s='$d_fs_data_s'
22319 d_fseeko='$d_fseeko'
22320 d_fsetpos='$d_fsetpos'
22321 d_fstatfs='$d_fstatfs'
22322 d_fstatvfs='$d_fstatvfs'
22324 d_ftello='$d_ftello'
22326 d_futimes='$d_futimes'
22327 d_gdbm_ndbm_h_uses_prototypes='$d_gdbm_ndbm_h_uses_prototypes'
22328 d_gdbmndbm_h_uses_prototypes='$d_gdbmndbm_h_uses_prototypes'
22329 d_getaddrinfo='$d_getaddrinfo'
22330 d_getcwd='$d_getcwd'
22331 d_getespwnam='$d_getespwnam'
22332 d_getfsstat='$d_getfsstat'
22333 d_getgrent='$d_getgrent'
22334 d_getgrent_r='$d_getgrent_r'
22335 d_getgrgid_r='$d_getgrgid_r'
22336 d_getgrnam_r='$d_getgrnam_r'
22337 d_getgrps='$d_getgrps'
22338 d_gethbyaddr='$d_gethbyaddr'
22339 d_gethbyname='$d_gethbyname'
22340 d_gethent='$d_gethent'
22341 d_gethname='$d_gethname'
22342 d_gethostbyaddr_r='$d_gethostbyaddr_r'
22343 d_gethostbyname_r='$d_gethostbyname_r'
22344 d_gethostent_r='$d_gethostent_r'
22345 d_gethostprotos='$d_gethostprotos'
22346 d_getitimer='$d_getitimer'
22347 d_getlogin='$d_getlogin'
22348 d_getlogin_r='$d_getlogin_r'
22349 d_getmnt='$d_getmnt'
22350 d_getmntent='$d_getmntent'
22351 d_getnameinfo='$d_getnameinfo'
22352 d_getnbyaddr='$d_getnbyaddr'
22353 d_getnbyname='$d_getnbyname'
22354 d_getnent='$d_getnent'
22355 d_getnetbyaddr_r='$d_getnetbyaddr_r'
22356 d_getnetbyname_r='$d_getnetbyname_r'
22357 d_getnetent_r='$d_getnetent_r'
22358 d_getnetprotos='$d_getnetprotos'
22359 d_getpagsz='$d_getpagsz'
22360 d_getpbyname='$d_getpbyname'
22361 d_getpbynumber='$d_getpbynumber'
22362 d_getpent='$d_getpent'
22363 d_getpgid='$d_getpgid'
22364 d_getpgrp2='$d_getpgrp2'
22365 d_getpgrp='$d_getpgrp'
22366 d_getppid='$d_getppid'
22367 d_getprior='$d_getprior'
22368 d_getprotobyname_r='$d_getprotobyname_r'
22369 d_getprotobynumber_r='$d_getprotobynumber_r'
22370 d_getprotoent_r='$d_getprotoent_r'
22371 d_getprotoprotos='$d_getprotoprotos'
22372 d_getprpwnam='$d_getprpwnam'
22373 d_getpwent='$d_getpwent'
22374 d_getpwent_r='$d_getpwent_r'
22375 d_getpwnam_r='$d_getpwnam_r'
22376 d_getpwuid_r='$d_getpwuid_r'
22377 d_getsbyname='$d_getsbyname'
22378 d_getsbyport='$d_getsbyport'
22379 d_getsent='$d_getsent'
22380 d_getservbyname_r='$d_getservbyname_r'
22381 d_getservbyport_r='$d_getservbyport_r'
22382 d_getservent_r='$d_getservent_r'
22383 d_getservprotos='$d_getservprotos'
22384 d_getspnam='$d_getspnam'
22385 d_getspnam_r='$d_getspnam_r'
22386 d_gettimeod='$d_gettimeod'
22387 d_gmtime64='$d_gmtime64'
22388 d_gmtime_r='$d_gmtime_r'
22389 d_gnulibc='$d_gnulibc'
22390 d_grpasswd='$d_grpasswd'
22391 d_hasmntopt='$d_hasmntopt'
22393 d_ilogbl='$d_ilogbl'
22394 d_inc_version_list='$d_inc_version_list'
22396 d_inetaton='$d_inetaton'
22397 d_inetntop='$d_inetntop'
22398 d_inetpton='$d_inetpton'
22399 d_int64_t='$d_int64_t'
22400 d_isascii='$d_isascii'
22401 d_isfinite='$d_isfinite'
22404 d_isnanl='$d_isnanl'
22405 d_killpg='$d_killpg'
22406 d_lchown='$d_lchown'
22407 d_ldbl_dig='$d_ldbl_dig'
22408 d_libm_lib_version='$d_libm_lib_version'
22410 d_localtime64='$d_localtime64'
22411 d_localtime_r='$d_localtime_r'
22412 d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset'
22413 d_locconv='$d_locconv'
22415 d_longdbl='$d_longdbl'
22416 d_longlong='$d_longlong'
22417 d_lseekproto='$d_lseekproto'
22419 d_madvise='$d_madvise'
22420 d_malloc_good_size='$d_malloc_good_size'
22421 d_malloc_size='$d_malloc_size'
22423 d_mbstowcs='$d_mbstowcs'
22424 d_mbtowc='$d_mbtowc'
22425 d_memchr='$d_memchr'
22426 d_memcmp='$d_memcmp'
22427 d_memcpy='$d_memcpy'
22428 d_memmove='$d_memmove'
22429 d_memset='$d_memset'
22431 d_mkdtemp='$d_mkdtemp'
22432 d_mkfifo='$d_mkfifo'
22433 d_mkstemp='$d_mkstemp'
22434 d_mkstemps='$d_mkstemps'
22435 d_mktime64='$d_mktime64'
22436 d_mktime='$d_mktime'
22439 d_modfl_pow32_bug='$d_modfl_pow32_bug'
22440 d_modflproto='$d_modflproto'
22441 d_mprotect='$d_mprotect'
22443 d_msg_ctrunc='$d_msg_ctrunc'
22444 d_msg_dontroute='$d_msg_dontroute'
22445 d_msg_oob='$d_msg_oob'
22446 d_msg_peek='$d_msg_peek'
22447 d_msg_proxy='$d_msg_proxy'
22448 d_msgctl='$d_msgctl'
22449 d_msgget='$d_msgget'
22450 d_msghdr_s='$d_msghdr_s'
22451 d_msgrcv='$d_msgrcv'
22452 d_msgsnd='$d_msgsnd'
22454 d_munmap='$d_munmap'
22455 d_mymalloc='$d_mymalloc'
22457 d_ndbm_h_uses_prototypes='$d_ndbm_h_uses_prototypes'
22459 d_nl_langinfo='$d_nl_langinfo'
22460 d_nv_preserves_uv='$d_nv_preserves_uv'
22461 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
22462 d_off64_t='$d_off64_t'
22463 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
22464 d_oldpthreads='$d_oldpthreads'
22465 d_oldsock='$d_oldsock'
22467 d_pathconf='$d_pathconf'
22469 d_perl_otherlibdirs='$d_perl_otherlibdirs'
22470 d_phostname='$d_phostname'
22473 d_portable='$d_portable'
22474 d_printf_format_null='$d_printf_format_null'
22475 d_procselfexe='$d_procselfexe'
22476 d_pseudofork='$d_pseudofork'
22477 d_pthread_atfork='$d_pthread_atfork'
22478 d_pthread_attr_setscope='$d_pthread_attr_setscope'
22479 d_pthread_yield='$d_pthread_yield'
22481 d_pwchange='$d_pwchange'
22482 d_pwclass='$d_pwclass'
22483 d_pwcomment='$d_pwcomment'
22484 d_pwexpire='$d_pwexpire'
22485 d_pwgecos='$d_pwgecos'
22486 d_pwpasswd='$d_pwpasswd'
22487 d_pwquota='$d_pwquota'
22490 d_random_r='$d_random_r'
22491 d_readdir64_r='$d_readdir64_r'
22492 d_readdir='$d_readdir'
22493 d_readdir_r='$d_readdir_r'
22494 d_readlink='$d_readlink'
22496 d_recvmsg='$d_recvmsg'
22497 d_rename='$d_rename'
22498 d_rewinddir='$d_rewinddir'
22500 d_safebcpy='$d_safebcpy'
22501 d_safemcpy='$d_safemcpy'
22502 d_sanemcmp='$d_sanemcmp'
22503 d_sbrkproto='$d_sbrkproto'
22504 d_scalbnl='$d_scalbnl'
22505 d_sched_yield='$d_sched_yield'
22506 d_scm_rights='$d_scm_rights'
22507 d_seekdir='$d_seekdir'
22508 d_select='$d_select'
22510 d_semctl='$d_semctl'
22511 d_semctl_semid_ds='$d_semctl_semid_ds'
22512 d_semctl_semun='$d_semctl_semun'
22513 d_semget='$d_semget'
22515 d_sendmsg='$d_sendmsg'
22516 d_setegid='$d_setegid'
22517 d_seteuid='$d_seteuid'
22518 d_setgrent='$d_setgrent'
22519 d_setgrent_r='$d_setgrent_r'
22520 d_setgrps='$d_setgrps'
22521 d_sethent='$d_sethent'
22522 d_sethostent_r='$d_sethostent_r'
22523 d_setitimer='$d_setitimer'
22524 d_setlinebuf='$d_setlinebuf'
22525 d_setlocale='$d_setlocale'
22526 d_setlocale_r='$d_setlocale_r'
22527 d_setnent='$d_setnent'
22528 d_setnetent_r='$d_setnetent_r'
22529 d_setpent='$d_setpent'
22530 d_setpgid='$d_setpgid'
22531 d_setpgrp2='$d_setpgrp2'
22532 d_setpgrp='$d_setpgrp'
22533 d_setprior='$d_setprior'
22534 d_setproctitle='$d_setproctitle'
22535 d_setprotoent_r='$d_setprotoent_r'
22536 d_setpwent='$d_setpwent'
22537 d_setpwent_r='$d_setpwent_r'
22538 d_setregid='$d_setregid'
22539 d_setresgid='$d_setresgid'
22540 d_setresuid='$d_setresuid'
22541 d_setreuid='$d_setreuid'
22542 d_setrgid='$d_setrgid'
22543 d_setruid='$d_setruid'
22544 d_setsent='$d_setsent'
22545 d_setservent_r='$d_setservent_r'
22546 d_setsid='$d_setsid'
22547 d_setvbuf='$d_setvbuf'
22551 d_shmatprototype='$d_shmatprototype'
22552 d_shmctl='$d_shmctl'
22554 d_shmget='$d_shmget'
22555 d_sigaction='$d_sigaction'
22556 d_signbit='$d_signbit'
22557 d_sigprocmask='$d_sigprocmask'
22558 d_sigsetjmp='$d_sigsetjmp'
22559 d_sitearch='$d_sitearch'
22560 d_snprintf='$d_snprintf'
22561 d_sockatmark='$d_sockatmark'
22562 d_sockatmarkproto='$d_sockatmarkproto'
22563 d_socket='$d_socket'
22564 d_socklen_t='$d_socklen_t'
22565 d_sockpair='$d_sockpair'
22566 d_socks5_init='$d_socks5_init'
22567 d_sprintf_returns_strlen='$d_sprintf_returns_strlen'
22569 d_srand48_r='$d_srand48_r'
22570 d_srandom_r='$d_srandom_r'
22571 d_sresgproto='$d_sresgproto'
22572 d_sresuproto='$d_sresuproto'
22573 d_statblks='$d_statblks'
22574 d_statfs_f_flags='$d_statfs_f_flags'
22575 d_statfs_s='$d_statfs_s'
22576 d_statvfs='$d_statvfs'
22577 d_stdio_cnt_lval='$d_stdio_cnt_lval'
22578 d_stdio_ptr_lval='$d_stdio_ptr_lval'
22579 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
22580 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
22581 d_stdio_stream_array='$d_stdio_stream_array'
22582 d_stdiobase='$d_stdiobase'
22583 d_stdstdio='$d_stdstdio'
22584 d_strchr='$d_strchr'
22585 d_strcoll='$d_strcoll'
22586 d_strctcpy='$d_strctcpy'
22587 d_strerrm='$d_strerrm'
22588 d_strerror='$d_strerror'
22589 d_strerror_r='$d_strerror_r'
22590 d_strftime='$d_strftime'
22591 d_strlcat='$d_strlcat'
22592 d_strlcpy='$d_strlcpy'
22593 d_strtod='$d_strtod'
22594 d_strtol='$d_strtol'
22595 d_strtold='$d_strtold'
22596 d_strtoll='$d_strtoll'
22597 d_strtoq='$d_strtoq'
22598 d_strtoul='$d_strtoul'
22599 d_strtoull='$d_strtoull'
22600 d_strtouq='$d_strtouq'
22601 d_strxfrm='$d_strxfrm'
22602 d_suidsafe='$d_suidsafe'
22603 d_symlink='$d_symlink'
22604 d_syscall='$d_syscall'
22605 d_syscallproto='$d_syscallproto'
22606 d_sysconf='$d_sysconf'
22607 d_sysernlst='$d_sysernlst'
22608 d_syserrlst='$d_syserrlst'
22609 d_system='$d_system'
22610 d_tcgetpgrp='$d_tcgetpgrp'
22611 d_tcsetpgrp='$d_tcsetpgrp'
22612 d_telldir='$d_telldir'
22613 d_telldirproto='$d_telldirproto'
22615 d_timegm='$d_timegm'
22617 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
22618 d_tm_tm_zone='$d_tm_tm_zone'
22619 d_tmpnam_r='$d_tmpnam_r'
22620 d_truncate='$d_truncate'
22621 d_ttyname_r='$d_ttyname_r'
22622 d_tzname='$d_tzname'
22623 d_u32align='$d_u32align'
22624 d_ualarm='$d_ualarm'
22627 d_union_semun='$d_union_semun'
22628 d_unordered='$d_unordered'
22629 d_unsetenv='$d_unsetenv'
22630 d_usleep='$d_usleep'
22631 d_usleepproto='$d_usleepproto'
22633 d_vendorarch='$d_vendorarch'
22634 d_vendorbin='$d_vendorbin'
22635 d_vendorlib='$d_vendorlib'
22636 d_vendorscript='$d_vendorscript'
22638 d_void_closedir='$d_void_closedir'
22639 d_voidsig='$d_voidsig'
22640 d_voidtty='$d_voidtty'
22641 d_volatile='$d_volatile'
22642 d_vprintf='$d_vprintf'
22643 d_vsnprintf='$d_vsnprintf'
22645 d_waitpid='$d_waitpid'
22646 d_wcstombs='$d_wcstombs'
22647 d_wctomb='$d_wctomb'
22648 d_writev='$d_writev'
22651 db_hashtype='$db_hashtype'
22652 db_prefixtype='$db_prefixtype'
22653 db_version_major='$db_version_major'
22654 db_version_minor='$db_version_minor'
22655 db_version_patch='$db_version_patch'
22656 defvoidused='$defvoidused'
22657 direntrytype='$direntrytype'
22660 doublesize='$doublesize'
22662 drand48_r_proto='$drand48_r_proto'
22664 dynamic_ext='$dynamic_ext'
22670 endgrent_r_proto='$endgrent_r_proto'
22671 endhostent_r_proto='$endhostent_r_proto'
22672 endnetent_r_proto='$endnetent_r_proto'
22673 endprotoent_r_proto='$endprotoent_r_proto'
22674 endpwent_r_proto='$endpwent_r_proto'
22675 endservent_r_proto='$endservent_r_proto'
22676 eunicefix='$eunicefix'
22679 extensions='$extensions'
22680 extern_C='$extern_C'
22682 fflushNULL='$fflushNULL'
22683 fflushall='$fflushall'
22685 firstmakefile='$firstmakefile'
22687 fpossize='$fpossize'
22688 fpostype='$fpostype'
22689 freetype='$freetype'
22692 full_csh='$full_csh'
22693 full_sed='$full_sed'
22694 gccansipedantic='$gccansipedantic'
22695 gccosandvers='$gccosandvers'
22696 gccversion='$gccversion'
22697 getgrent_r_proto='$getgrent_r_proto'
22698 getgrgid_r_proto='$getgrgid_r_proto'
22699 getgrnam_r_proto='$getgrnam_r_proto'
22700 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
22701 gethostbyname_r_proto='$gethostbyname_r_proto'
22702 gethostent_r_proto='$gethostent_r_proto'
22703 getlogin_r_proto='$getlogin_r_proto'
22704 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
22705 getnetbyname_r_proto='$getnetbyname_r_proto'
22706 getnetent_r_proto='$getnetent_r_proto'
22707 getprotobyname_r_proto='$getprotobyname_r_proto'
22708 getprotobynumber_r_proto='$getprotobynumber_r_proto'
22709 getprotoent_r_proto='$getprotoent_r_proto'
22710 getpwent_r_proto='$getpwent_r_proto'
22711 getpwnam_r_proto='$getpwnam_r_proto'
22712 getpwuid_r_proto='$getpwuid_r_proto'
22713 getservbyname_r_proto='$getservbyname_r_proto'
22714 getservbyport_r_proto='$getservbyport_r_proto'
22715 getservent_r_proto='$getservent_r_proto'
22716 getspnam_r_proto='$getspnam_r_proto'
22717 gidformat='$gidformat'
22723 gmtime_r_proto='$gmtime_r_proto'
22724 gnulibc_version='$gnulibc_version'
22726 groupcat='$groupcat'
22727 groupstype='$groupstype'
22730 h_sysfile='$h_sysfile'
22733 html1dir='$html1dir'
22734 html1direxp='$html1direxp'
22735 html3dir='$html3dir'
22736 html3direxp='$html3direxp'
22745 i_arpainet='$i_arpainet'
22746 i_assert='$i_assert'
22747 i_bsdioctl='$i_bsdioctl'
22751 i_dirent='$i_dirent'
22757 i_fp_class='$i_fp_class'
22759 i_gdbm_ndbm='$i_gdbm_ndbm'
22760 i_gdbmndbm='$i_gdbmndbm'
22762 i_ieeefp='$i_ieeefp'
22763 i_inttypes='$i_inttypes'
22764 i_langinfo='$i_langinfo'
22765 i_libutil='$i_libutil'
22766 i_limits='$i_limits'
22767 i_locale='$i_locale'
22768 i_machcthr='$i_machcthr'
22769 i_malloc='$i_malloc'
22770 i_mallocmalloc='$i_mallocmalloc'
22772 i_memory='$i_memory'
22773 i_mntent='$i_mntent'
22776 i_neterrno='$i_neterrno'
22777 i_netinettcp='$i_netinettcp'
22781 i_pthread='$i_pthread'
22783 i_rpcsvcdbm='$i_rpcsvcdbm'
22786 i_shadow='$i_shadow'
22788 i_stdarg='$i_stdarg'
22789 i_stddef='$i_stddef'
22790 i_stdlib='$i_stdlib'
22791 i_string='$i_string'
22792 i_sunmath='$i_sunmath'
22793 i_sysaccess='$i_sysaccess'
22794 i_sysdir='$i_sysdir'
22795 i_sysfile='$i_sysfile'
22796 i_sysfilio='$i_sysfilio'
22798 i_sysioctl='$i_sysioctl'
22799 i_syslog='$i_syslog'
22800 i_sysmman='$i_sysmman'
22801 i_sysmode='$i_sysmode'
22802 i_sysmount='$i_sysmount'
22803 i_sysndir='$i_sysndir'
22804 i_sysparam='$i_sysparam'
22805 i_syspoll='$i_syspoll'
22806 i_sysresrc='$i_sysresrc'
22807 i_syssecrt='$i_syssecrt'
22808 i_sysselct='$i_sysselct'
22809 i_syssockio='$i_syssockio'
22810 i_sysstat='$i_sysstat'
22811 i_sysstatfs='$i_sysstatfs'
22812 i_sysstatvfs='$i_sysstatvfs'
22813 i_systime='$i_systime'
22814 i_systimek='$i_systimek'
22815 i_systimes='$i_systimes'
22816 i_systypes='$i_systypes'
22817 i_sysuio='$i_sysuio'
22819 i_sysutsname='$i_sysutsname'
22820 i_sysvfs='$i_sysvfs'
22821 i_syswait='$i_syswait'
22822 i_termio='$i_termio'
22823 i_termios='$i_termios'
22825 i_unistd='$i_unistd'
22828 i_values='$i_values'
22829 i_varargs='$i_varargs'
22830 i_varhdr='$i_varhdr'
22832 ignore_versioned_solibs='$ignore_versioned_solibs'
22833 inc_version_list='$inc_version_list'
22834 inc_version_list_init='$inc_version_list_init'
22837 initialinstalllocation='$initialinstalllocation'
22838 installarchlib='$installarchlib'
22839 installbin='$installbin'
22840 installhtml1dir='$installhtml1dir'
22841 installhtml3dir='$installhtml3dir'
22842 installman1dir='$installman1dir'
22843 installman3dir='$installman3dir'
22844 installprefix='$installprefix'
22845 installprefixexp='$installprefixexp'
22846 installprivlib='$installprivlib'
22847 installscript='$installscript'
22848 installsitearch='$installsitearch'
22849 installsitebin='$installsitebin'
22850 installsitehtml1dir='$installsitehtml1dir'
22851 installsitehtml3dir='$installsitehtml3dir'
22852 installsitelib='$installsitelib'
22853 installsiteman1dir='$installsiteman1dir'
22854 installsiteman3dir='$installsiteman3dir'
22855 installsitescript='$installsitescript'
22856 installstyle='$installstyle'
22857 installusrbinperl='$installusrbinperl'
22858 installvendorarch='$installvendorarch'
22859 installvendorbin='$installvendorbin'
22860 installvendorhtml1dir='$installvendorhtml1dir'
22861 installvendorhtml3dir='$installvendorhtml3dir'
22862 installvendorlib='$installvendorlib'
22863 installvendorman1dir='$installvendorman1dir'
22864 installvendorman3dir='$installvendorman3dir'
22865 installvendorscript='$installvendorscript'
22867 issymlink='$issymlink'
22868 ivdformat='$ivdformat'
22871 known_extensions='$known_extensions'
22874 lddlflags='$lddlflags'
22876 ldflags_uselargefiles='$ldflags_uselargefiles'
22877 ldlibpthname='$ldlibpthname'
22884 libsdirs='$libsdirs'
22885 libsfiles='$libsfiles'
22886 libsfound='$libsfound'
22887 libspath='$libspath'
22888 libswanted='$libswanted'
22889 libswanted_uselargefiles='$libswanted_uselargefiles'
22895 localtime_r_proto='$localtime_r_proto'
22896 locincpth='$locincpth'
22897 loclibpth='$loclibpth'
22898 longdblsize='$longdblsize'
22899 longlongsize='$longlongsize'
22900 longsize='$longsize'
22904 lseeksize='$lseeksize'
22905 lseektype='$lseektype'
22908 madlyobj='$madlyobj'
22909 madlysrc='$madlysrc'
22913 make_set_make='$make_set_make'
22914 mallocobj='$mallocobj'
22915 mallocsrc='$mallocsrc'
22916 malloctype='$malloctype'
22918 man1direxp='$man1direxp'
22921 man3direxp='$man3direxp'
22923 mips_type='$mips_type'
22924 mistrustnm='$mistrustnm'
22926 mmaptype='$mmaptype'
22927 modetype='$modetype'
22929 multiarch='$multiarch'
22931 myarchname='$myarchname'
22932 mydomain='$mydomain'
22933 myhostname='$myhostname'
22936 need_va_copy='$need_va_copy'
22937 netdb_hlen_type='$netdb_hlen_type'
22938 netdb_host_type='$netdb_host_type'
22939 netdb_name_type='$netdb_name_type'
22940 netdb_net_type='$netdb_net_type'
22943 nm_so_opt='$nm_so_opt'
22944 nonxs_ext='$nonxs_ext'
22946 nvEUformat='$nvEUformat'
22947 nvFUformat='$nvFUformat'
22948 nvGUformat='$nvGUformat'
22949 nv_overflows_integers_at='$nv_overflows_integers_at'
22950 nv_preserves_uv_bits='$nv_preserves_uv_bits'
22951 nveformat='$nveformat'
22952 nvfformat='$nvfformat'
22953 nvgformat='$nvgformat'
22956 o_nonblock='$o_nonblock'
22958 old_pthread_create_joinable='$old_pthread_create_joinable'
22959 optimize='$optimize'
22960 orderlib='$orderlib'
22963 otherlibdirs='$otherlibdirs'
22967 patchlevel='$patchlevel'
22968 path_sep='$path_sep'
22971 perl_patchlevel='$perl_patchlevel'
22972 perladmin='$perladmin'
22973 perllibs='$perllibs'
22974 perlpath='$perlpath'
22976 phostname='$phostname'
22982 prefixexp='$prefixexp'
22984 privlibexp='$privlibexp'
22985 procselfexe='$procselfexe'
22986 prototype='$prototype'
22988 quadkind='$quadkind'
22989 quadtype='$quadtype'
22990 randbits='$randbits'
22991 randfunc='$randfunc'
22992 random_r_proto='$random_r_proto'
22993 randseedtype='$randseedtype'
22995 rd_nodata='$rd_nodata'
22996 readdir64_r_proto='$readdir64_r_proto'
22997 readdir_r_proto='$readdir_r_proto'
22998 revision='$revision'
23004 sGMTIME_max='$sGMTIME_max'
23005 sGMTIME_min='$sGMTIME_min'
23006 sLOCALTIME_max='$sLOCALTIME_max'
23007 sLOCALTIME_min='$sLOCALTIME_min'
23008 sPRIEUldbl='$sPRIEUldbl'
23009 sPRIFUldbl='$sPRIFUldbl'
23010 sPRIGUldbl='$sPRIGUldbl'
23011 sPRIXU64='$sPRIXU64'
23013 sPRIeldbl='$sPRIeldbl'
23014 sPRIfldbl='$sPRIfldbl'
23015 sPRIgldbl='$sPRIgldbl'
23020 sSCNfldbl='$sSCNfldbl'
23021 sched_yield='$sched_yield'
23022 scriptdir='$scriptdir'
23023 scriptdirexp='$scriptdirexp'
23025 seedfunc='$seedfunc'
23026 selectminbits='$selectminbits'
23027 selecttype='$selecttype'
23028 sendmail='$sendmail'
23029 setgrent_r_proto='$setgrent_r_proto'
23030 sethostent_r_proto='$sethostent_r_proto'
23031 setlocale_r_proto='$setlocale_r_proto'
23032 setnetent_r_proto='$setnetent_r_proto'
23033 setprotoent_r_proto='$setprotoent_r_proto'
23034 setpwent_r_proto='$setpwent_r_proto'
23035 setservent_r_proto='$setservent_r_proto'
23038 sharpbang='$sharpbang'
23039 shmattype='$shmattype'
23040 shortsize='$shortsize'
23043 sig_count='$sig_count'
23044 sig_name='$sig_name'
23045 sig_name_init='$sig_name_init'
23047 sig_num_init='$sig_num_init'
23048 sig_size='$sig_size'
23049 signal_t='$signal_t'
23050 sitearch='$sitearch'
23051 sitearchexp='$sitearchexp'
23053 sitebinexp='$sitebinexp'
23054 sitehtml1dir='$sitehtml1dir'
23055 sitehtml1direxp='$sitehtml1direxp'
23056 sitehtml3dir='$sitehtml3dir'
23057 sitehtml3direxp='$sitehtml3direxp'
23059 sitelib_stem='$sitelib_stem'
23060 sitelibexp='$sitelibexp'
23061 siteman1dir='$siteman1dir'
23062 siteman1direxp='$siteman1direxp'
23063 siteman3dir='$siteman3dir'
23064 siteman3direxp='$siteman3direxp'
23065 siteprefix='$siteprefix'
23066 siteprefixexp='$siteprefixexp'
23067 sitescript='$sitescript'
23068 sitescriptexp='$sitescriptexp'
23069 sizesize='$sizesize'
23070 sizetype='$sizetype'
23074 sockethdr='$sockethdr'
23075 socketlib='$socketlib'
23076 socksizetype='$socksizetype'
23078 spackage='$spackage'
23079 spitshell='$spitshell'
23080 srand48_r_proto='$srand48_r_proto'
23081 srandom_r_proto='$srandom_r_proto'
23083 ssizetype='$ssizetype'
23084 startperl='$startperl'
23086 static_ext='$static_ext'
23088 stdio_base='$stdio_base'
23089 stdio_bufsiz='$stdio_bufsiz'
23090 stdio_cnt='$stdio_cnt'
23091 stdio_filbuf='$stdio_filbuf'
23092 stdio_ptr='$stdio_ptr'
23093 stdio_stream_array='$stdio_stream_array'
23094 strerror_r_proto='$strerror_r_proto'
23097 subversion='$subversion'
23101 targetarch='$targetarch'
23105 timeincl='$timeincl'
23106 timetype='$timetype'
23107 tmpnam_r_proto='$tmpnam_r_proto'
23113 ttyname_r_proto='$ttyname_r_proto'
23122 uidformat='$uidformat'
23128 uquadtype='$uquadtype'
23129 use5005threads='$use5005threads'
23130 use64bitall='$use64bitall'
23131 use64bitint='$use64bitint'
23132 usecrosscompile='$usecrosscompile'
23133 usedevel='$usedevel'
23135 usedtrace='$usedtrace'
23136 usefaststdio='$usefaststdio'
23137 useithreads='$useithreads'
23138 uselargefiles='$uselargefiles'
23139 uselongdouble='$uselongdouble'
23140 usemallocwrap='$usemallocwrap'
23141 usemorebits='$usemorebits'
23142 usemultiplicity='$usemultiplicity'
23143 usemymalloc='$usemymalloc'
23145 useopcode='$useopcode'
23146 useperlio='$useperlio'
23147 useposix='$useposix'
23148 usereentrant='$usereentrant'
23149 userelocatableinc='$userelocatableinc'
23151 useshrplib='$useshrplib'
23152 usesitecustomize='$usesitecustomize'
23153 usesocks='$usesocks'
23154 usethreads='$usethreads'
23155 usevendorprefix='$usevendorprefix'
23156 usevfork='$usevfork'
23159 uvXUformat='$uvXUformat'
23160 uvoformat='$uvoformat'
23163 uvuformat='$uvuformat'
23164 uvxformat='$uvxformat'
23165 vendorarch='$vendorarch'
23166 vendorarchexp='$vendorarchexp'
23167 vendorbin='$vendorbin'
23168 vendorbinexp='$vendorbinexp'
23169 vendorhtml1dir='$vendorhtml1dir'
23170 vendorhtml1direxp='$vendorhtml1direxp'
23171 vendorhtml3dir='$vendorhtml3dir'
23172 vendorhtml3direxp='$vendorhtml3direxp'
23173 vendorlib='$vendorlib'
23174 vendorlib_stem='$vendorlib_stem'
23175 vendorlibexp='$vendorlibexp'
23176 vendorman1dir='$vendorman1dir'
23177 vendorman1direxp='$vendorman1direxp'
23178 vendorman3dir='$vendorman3dir'
23179 vendorman3direxp='$vendorman3direxp'
23180 vendorprefix='$vendorprefix'
23181 vendorprefixexp='$vendorprefixexp'
23182 vendorscript='$vendorscript'
23183 vendorscriptexp='$vendorscriptexp'
23185 version_patchlevel_string='$version_patchlevel_string'
23186 versiononly='$versiononly'
23188 voidflags='$voidflags'
23191 yaccflags='$yaccflags'
23196 : Add in command line options if available
23197 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
23199 : add special variables
23200 $test -f $src/patchlevel.h && \
23201 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
23202 echo "PERL_PATCHLEVEL='$perl_patchlevel'" >>config.sh
23203 echo "PERL_CONFIG_SH=true" >>config.sh
23205 : propagate old symbols
23206 if $test -f UU/config.sh; then
23207 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
23208 $sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' \
23209 config.sh config.sh UU/oldconfig.sh |\
23210 $sort | $uniq -u >UU/oldsyms
23211 set X `cat UU/oldsyms`
23217 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
23219 echo ": Variables propagated from previous config.sh file." >>config.sh
23220 for sym in `cat UU/oldsyms`; do
23221 echo " Propagating $hint variable "'$'"$sym..."
23222 eval 'tmp="$'"${sym}"'"'
23224 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
23230 : Finish up by extracting the .SH files
23234 echo "Extraction done."
23244 If you'd like to make any changes to the config.sh file before I begin
23245 to configure things, do it as a shell escape now (e.g. !vi config.sh).
23248 rp="Press return or use a shell escape to edit config.sh:"
23253 *) : in case they cannot read
23254 sh 1>&4 -c "$ans";;
23259 : if this fails, just run all the .SH files by hand
23268 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
23275 Now you need to generate make dependencies by running "$make depend".
23276 You might prefer to run it in background: "$make depend > makedepend.out &"
23277 It can take a while, so you might not want to run it right now.
23282 rp="Run $make depend now?"
23286 $make depend && echo "Now you must run '$make'."
23289 echo "You must run '$make depend' then '$make'."
23292 elif test -f [Mm]akefile; then
23294 echo "Now you must run a $make."
23296 echo "Configure done."
23299 if $test -f Policy.sh; then
23302 If you compile $package on a different machine or from a different object
23303 directory, copy the Policy.sh file from this object directory to the
23304 new one before you run Configure -- this will help you with most of
23305 the policy defaults.
23309 if $test -f config.msg; then
23310 echo "Hmm. I also noted the following information while running:"
23312 $cat config.msg >&4
23315 $rm -f kit*isdone ark*isdone