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 Mar 25 17:28:24 CET 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
8194 # Figure out a good name for libperl.so. Since it gets stored in
8195 # a version-specific architecture-dependent library, the version
8196 # number isn't really that important, except for making cc/ld happy.
8198 # A name such as libperl.so.10.1
8199 majmin="libperl.$so.$patchlevel.$subversion"
8200 # A name such as libperl.so.100
8201 majonly=`echo $patchlevel $subversion |
8202 $awk '{printf "%d%02d", $1, $2}'`
8203 majonly=libperl.$so.$majonly
8204 # I'd prefer to keep the os-specific stuff here to a minimum, and
8205 # rely on figuring it out from the naming of libc.
8206 case "${osname}${osvers}" in
8209 # XXX How handle the --version stuff for MAB?
8211 linux*|gnu*) # ld won't link with a bare -lperl otherwise.
8214 cygwin*) # ld links now against the dll directly
8215 majmin="cygperl5_${patchlevel}_${subversion}.${so}"
8216 majonly=`echo $patchlevel $subversion |
8217 $awk '{printf "%03d%03d", $1, $2}'`
8218 majonly=cygperl5.$majonly.$so
8221 *) # Try to guess based on whether libc has major.minor.
8223 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
8224 *libc.$so.[0-9]*) dflt=$majonly ;;
8225 *) dflt=libperl.$so ;;
8235 I need to select a good name for the shared libperl. If your system uses
8236 library names with major and minor numbers, then you might want something
8237 like $majmin. Alternatively, if your system uses a single version
8238 number for shared libraries, then you might want to use $majonly.
8239 Or, your system might be quite happy with a simple libperl.$so.
8241 Since the shared libperl will get installed into a version-specific
8242 architecture-dependent directory, the version number of the shared perl
8243 library probably isn't important, so the default should be o.k.
8246 rp='What name do you want to give to the shared libperl?'
8249 echo "Ok, I'll use $libperl"
8252 libperl="libperl${_a}"
8256 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
8260 WARNING: Use of the shrpdir variable for the installation location of
8261 the shared $libperl is not supported. It was never documented and
8262 will not work in this version. Let me (perlbug@perl.org)
8263 know of any problems this may cause.
8269 But your current setting of $shrpdir is
8270 the default anyway, so it's harmless.
8275 Further, your current attempted setting of $shrpdir
8276 conflicts with the value of $archlibexp/CORE
8277 that installperl will use.
8284 # How will the perl executable find the installed shared $libperl?
8285 # Add $xxx to ccdlflags.
8286 # If we can't figure out a command-line option, use $shrpenv to
8287 # set env LD_RUN_PATH. The main perl makefile uses this.
8288 shrpdir=$archlibexp/CORE
8291 if "$useshrplib"; then
8294 # We'll set it in Makefile.SH...
8299 freebsd|netbsd|openbsd|interix|dragonfly)
8300 xxx="-Wl,-R$shrpdir"
8302 bsdos|linux|irix*|dec_osf|gnu*)
8303 xxx="-Wl,-rpath,$shrpdir"
8306 # next doesn't like the default...
8309 # beos doesn't like the default, either.
8312 # Haiku doesn't like the default, either.
8315 # hpux doesn't like the default, either.
8316 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
8319 # cygwin needs only ldlibpth
8322 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
8328 # Only add $xxx if it isn't already in ccdlflags.
8329 case " $ccdlflags " in
8331 *) ccdlflags="$ccdlflags $xxx"
8334 Adding $xxx to the flags
8335 passed to $ld so that the perl executable will find the
8336 installed shared $libperl.
8344 # Fix ccdlflags in AIX for building external extensions.
8345 # (For building Perl itself bare -bE:perl.exp is needed,
8346 # Makefile.SH takes care of this.)
8348 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8350 # Respect a hint or command-line value.
8352 '') shrpenv="$tmp_shrpenv" ;;
8354 case "$ldlibpthname" in
8355 '') ldlibpthname=LD_LIBRARY_PATH ;;
8356 none) ldlibpthname='' ;;
8359 : determine where manual pages are on this system
8363 syspath='/usr/share/man/man1 /usr/man/man1'
8364 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8365 syspath="$syspath /usr/man/u_man/man1"
8366 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8367 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8368 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8369 sysman=`./loc . /usr/man/man1 $syspath`
8372 if $test -d "$sysman"; then
8373 echo "System manual is in $sysman." >&4
8375 echo "Could not find manual pages in source form." >&4
8378 : determine where manual pages go
8379 set man1dir man1dir none
8383 $spackage has manual pages available in source form.
8387 echo "However, you don't have nroff, so they're probably useless to you."
8389 '') man1dir="none";;
8392 echo "If you don't want the manual sources installed, answer 'none'."
8397 lookpath="$prefixexp/share/man/man1"
8398 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8399 lookpath="$lookpath $prefixexp/man/p_man/man1"
8400 lookpath="$lookpath $prefixexp/man/u_man/man1"
8401 lookpath="$lookpath $prefixexp/man/man.1"
8403 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8404 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8414 rp="Where do the main $spackage manual pages (source) go?"
8416 if $test "X$man1direxp" != "X$ansexp"; then
8427 : What suffix to use on installed man pages
8434 rp="What suffix should be used for the main $spackage man pages?"
8436 '') case "$man1dir" in
8450 *) dflt="$man1ext";;
8457 : see if we can have long filenames
8459 first=123456789abcdef
8461 if (echo hi >$first) 2>/dev/null; then
8462 if $test -f 123456789abcde; then
8463 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8466 echo 'You can have filenames longer than 14 characters.'>&4
8471 You can't have filenames longer than 14 chars.
8472 You can't even think about them!
8478 $rm -rf 123456789abcde*
8480 : determine where library module manual pages go
8481 set man3dir man3dir none
8485 $spackage has manual pages for many of the library modules.
8491 However, you don't have nroff, so they're probably useless to you.
8494 '') man3dir="none";;
8498 case "$d_flexfnam" in
8501 However, your system can't handle the long file names like File::Basename.3.
8504 '') man3dir="none";;
8508 echo "If you don't want the manual sources installed, answer 'none'."
8509 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8511 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
8512 if $test -d "$privlib/man/man3"; then
8515 WARNING: Previous versions of perl installed man3 pages into
8516 $privlib/man/man3. This version will suggest a
8517 new default of $dflt.
8521 rp='Do you wish to preserve the old behavior?(y/n)'
8524 y*) dflt="$privlib/man/man3" ;;
8529 *) dflt="$man3dir" ;;
8536 rp="Where do the $package library man pages (source) go?"
8546 : What suffix to use on installed man pages
8552 rp="What suffix should be used for the $package library man pages?"
8554 '') case "$man3dir" in
8568 *) dflt="$man3ext";;
8575 : see if we have to deal with yellow pages, now NIS.
8576 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
8577 if $test -f /usr/etc/nibindd; then
8579 echo "I'm fairly confident you're on a NeXT."
8581 rp='Do you get the hosts file via NetInfo?'
8590 y*) hostcat='nidump hosts .';;
8591 *) case "$hostcat" in
8592 nidump*) hostcat='';;
8602 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
8610 rp='Are you getting the hosts file via yellow pages?'
8613 y*) hostcat='ypcat hosts';;
8614 *) hostcat='cat /etc/hosts';;
8620 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
8623 '') test -f /etc/group && groupcat='cat /etc/group';;
8626 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
8629 : now get the host name
8631 echo "Figuring out host name..." >&4
8632 case "$myhostname" in
8634 echo 'Maybe "hostname" will work...'
8635 if tans=`sh -c hostname 2>&1` ; then
8643 if $test "$cont"; then
8645 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
8646 if tans=`cat /etc/systemid 2>&1` ; then
8648 phostname='cat /etc/systemid'
8649 echo "Whadyaknow. Xenix always was a bit strange..."
8652 elif $test -r /etc/systemid; then
8653 echo "(What is a non-Xenix system doing with /etc/systemid?)"
8656 if $test "$cont"; then
8657 echo 'No, maybe "uuname -l" will work...'
8658 if tans=`sh -c 'uuname -l' 2>&1` ; then
8660 phostname='uuname -l'
8662 echo 'Strange. Maybe "uname -n" will work...'
8663 if tans=`sh -c 'uname -n' 2>&1` ; then
8665 phostname='uname -n'
8667 echo 'Oh well, maybe I can mine it out of whoami.h...'
8668 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
8669 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
8670 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
8672 case "$myhostname" in
8673 '') echo "Does this machine have an identity crisis or something?"
8676 echo "Well, you said $myhostname before..."
8677 phostname='echo $myhostname';;
8683 case "$myhostname" in
8684 '') myhostname=noname ;;
8686 : you do not want to know about this
8691 if $test "$myhostname" ; then
8693 rp='Your host name appears to be "'$myhostname'".'" Right?"
8701 : bad guess or no guess
8702 while $test "X$myhostname" = X ; do
8704 rp="Please type the (one word) name of your host:"
8709 : translate upper to lower if necessary
8710 case "$myhostname" in
8712 echo "(Normalizing case in your host name)"
8713 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
8717 case "$myhostname" in
8719 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
8720 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
8721 echo "(Trimming domain name from host name--host name is now $myhostname)"
8723 *) case "$mydomain" in
8726 test "X$hostcat" = "Xypcat hosts" &&
8727 ypmatch "$myhostname" hosts 2>/dev/null |\
8728 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
8731 test "X$hostcat" != "X" &&
8732 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
8733 /[ ]$myhostname[ . ]/p" > hosts
8736 if $test -f hosts; then
8737 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
8738 END { print sum }" hosts` = x1 || tmp_re="[ ]"
8739 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
8740 hosts | $sort | $uniq | \
8741 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
8742 case `$echo X$dflt` in
8743 X*\ *) echo "(Several hosts in the database matched hostname)"
8746 X.) echo "(You do not have fully-qualified names in the hosts database)"
8750 echo "(I cannot locate a hosts database anywhere)"
8755 tans=`./loc resolv.conf X /etc /usr/etc`
8756 if $test -f "$tans"; then
8757 echo "(Attempting domain name extraction from $tans)"
8758 dflt=.`$sed -n -e 's/ / /g' \
8759 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
8762 .) dflt=.`$sed -n -e 's/ / /g' \
8763 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
8771 .) echo "(No help from resolv.conf either -- attempting clever guess)"
8772 dflt=.`sh -c domainname 2>/dev/null`
8775 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
8779 case "$dflt$osname" in
8780 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
8781 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
8785 .) echo "(Lost all hope -- silly guess then)"
8791 *) dflt="$mydomain";;
8795 rp="What is your domain name?"
8805 : translate upper to lower if necessary
8808 echo "(Normalizing case in your domain name)"
8809 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
8813 : a little sanity check here
8814 case "$phostname" in
8817 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
8818 $myhostname$mydomain|$myhostname) ;;
8820 case "$phostname" in
8822 echo "(That doesn't agree with your whoami.h file, by the way.)"
8825 echo "(That doesn't agree with your $phostname command, by the way.)"
8833 : determine the e-mail address of the user who is running us
8836 I need to get your e-mail address in Internet format if possible, i.e.
8837 something like user@host.domain. Please answer accurately since I have
8838 no easy means to double check it. The default value provided below
8839 is most probably close to reality but may not be valid from outside
8840 your organization...
8844 while test "$cont"; do
8846 '') dflt="$cf_by@$myhostname$mydomain";;
8847 *) dflt="$cf_email";;
8849 rp='What is your e-mail address?'
8855 rp='Address does not look like an Internet one. Use it anyway?'
8869 : Ask e-mail of administrator
8872 If you or somebody else will be maintaining perl at your site, please
8873 fill in the correct e-mail address here so that they may be contacted
8874 if necessary. Currently, the "perlbug" program included with perl
8875 will send mail to this address in addition to perlbug@perl.org. You may
8876 enter "none" for no administrator.
8879 case "$perladmin" in
8880 '') dflt="$cf_email";;
8881 *) dflt="$perladmin";;
8883 rp='Perl administrator e-mail address'
8887 : determine whether to only install version-specific parts.
8890 Do you want to install only the version-specific parts of the perl
8891 distribution? Usually you do *not* want to do this.
8893 case "$versiononly" in
8894 "$define"|[Yy]*|true) dflt='y' ;;
8897 rp="Do you want to install only the version-specific parts of perl?"
8900 [yY]*) val="$define";;
8906 case "$versiononly" in
8907 "$define") inc_version_list=''
8908 inc_version_list_init=0
8912 : figure out how to guarantee perl startup
8913 : XXX Note that this currently takes advantage of the bug that binexp ignores
8914 : the Configure -Dinstallprefix setting, which in turn means that under
8915 : relocatable @INC, initialinstalllocation is what binexp started as.
8916 case "$startperl" in
8918 case "$sharpbang" in
8922 I can use the #! construct to start perl on your system. This will
8923 make startup of perl scripts faster, but may cause problems if you
8924 want to share those scripts and perl is not in a standard place
8925 ($initialinstalllocation/perl) on all your platforms. The alternative
8926 is to force a shell by starting the script with a single ':' character.
8929 case "$versiononly" in
8930 "$define") dflt="$initialinstalllocation/perl$version";;
8931 *) dflt="$initialinstalllocation/perl";;
8933 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
8936 none) startperl=": # use perl";;
8937 *) startperl="#!$ans"
8938 if $test 30 -lt `echo "$ans" | wc -c`; then
8941 WARNING: Some systems limit the #! command to 32 characters.
8942 If you experience difficulty running Perl scripts with #!, try
8943 installing Perl in a directory with a shorter pathname.
8949 *) startperl=": # use perl"
8954 echo "I'll use $startperl to start perl scripts."
8956 : figure best path for perl in scripts
8959 case "$versiononly" in
8960 "$define") perlpath="$initialinstalllocation/perl$version";;
8961 *) perlpath="$initialinstalllocation/perl";;
8963 case "$startperl" in
8968 I will use the "eval 'exec'" idiom to start Perl on your system.
8969 I can use the full path of your Perl binary for this purpose, but
8970 doing so may cause problems if you want to share those scripts and
8971 Perl is not always in a standard place ($initialinstalllocation/perl).
8974 dflt="$initialinstalllocation/perl"
8975 rp="What path shall I use in \"eval 'exec'\"?"
8982 case "$startperl" in
8984 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
8987 : determine where public executable scripts go
8988 set scriptdir scriptdir
8990 case "$scriptdir" in
8993 : guess some guesses
8994 $test -d /usr/share/scripts && dflt=/usr/share/scripts
8995 $test -d /usr/share/bin && dflt=/usr/share/bin
8996 $test -d /usr/local/script && dflt=/usr/local/script
8997 $test -d /usr/local/scripts && dflt=/usr/local/scripts
8998 $test -d $prefixexp/script && dflt=$prefixexp/script
9002 *) dflt="$scriptdir"
9007 Some installations have a separate directory just for executable scripts so
9008 that they can mount it across multiple architectures but keep the scripts in
9009 one spot. You might, for example, have a subdirectory of /usr/share for this.
9010 Or you might just lump your scripts in with all your other executables.
9014 rp='Where do you keep publicly executable scripts?'
9016 if $test "X$ansexp" != "X$scriptdirexp"; then
9022 : A little fix up for an irregularly named variable.
9023 installscript="$installscriptdir"
9025 : determine where add-on public executables go
9027 '') dflt=$siteprefix/bin ;;
9031 rp='Pathname where the add-on public executables should be installed?'
9036 : determine where add-on html pages go
9037 : There is no standard location, so try to copy the previously-selected
9038 : directory structure for the core html pages.
9039 case "$sitehtml1dir" in
9040 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9041 *) dflt=$sitehtml1dir ;;
9044 ''|' ') dflt=none ;;
9047 rp='Pathname where the site-specific html pages should be installed?'
9049 prefixvar=sitehtml1dir
9052 : determine where add-on library html pages go
9053 : There is no standard location, so try to copy the previously-selected
9054 : directory structure for the core html pages.
9055 case "$sitehtml3dir" in
9056 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9057 *) dflt=$sitehtml3dir ;;
9060 ''|' ') dflt=none ;;
9063 rp='Pathname where the site-specific library html pages should be installed?'
9065 prefixvar=sitehtml3dir
9068 : determine where add-on manual pages go
9069 case "$siteman1dir" in
9070 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
9071 *) dflt=$siteman1dir ;;
9074 ''|' ') dflt=none ;;
9077 rp='Pathname where the site-specific manual pages should be installed?'
9079 prefixvar=siteman1dir
9082 : determine where add-on library man pages go
9083 case "$siteman3dir" in
9084 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
9085 *) dflt=$siteman3dir ;;
9088 ''|' ') dflt=none ;;
9091 rp='Pathname where the site-specific library manual pages should be installed?'
9093 prefixvar=siteman3dir
9096 : determine where add-on public executable scripts go
9097 case "$sitescript" in
9098 '') dflt=$siteprefix/script
9099 $test -d $dflt || dflt=$sitebin ;;
9100 *) dflt="$sitescript" ;;
9103 rp='Pathname where add-on public executable scripts should be installed?'
9105 prefixvar=sitescript
9108 : Check if faststdio is requested and available
9109 case "$usefaststdio" in
9110 $define|true|[yY]*|'')
9111 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
9121 Perl can be built to use 'fast stdio', which means using the stdio
9122 library but also directly manipulating the stdio buffers to enable
9123 faster I/O. Using stdio is better for backward compatibility (especially
9124 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
9125 interface has been preferred instead of stdio.
9127 If this doesn't make any sense to you, just accept the default '$dflt'.
9129 rp='Use the "fast stdio" if available?'
9132 y|Y) val="$define" ;;
9139 : define an is-a-typedef? function
9140 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9142 "") inclist="sys/types.h";;
9144 eval "varval=\$$var";
9148 for inc in $inclist; do
9149 echo "#include <$inc>" >>temp.c;
9151 echo "#ifdef $type" >> temp.c;
9152 echo "printf(\"We have $type\");" >> temp.c;
9153 echo "#endif" >> temp.c;
9154 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9155 if $contains $type temp.E >/dev/null 2>&1; then
9161 *) eval "$var=\$varval";;
9164 : define an is-a-typedef? function that prompts if the type is not available.
9165 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9167 "") inclist="sys/types.h";;
9169 eval "varval=\$$var";
9173 for inc in $inclist; do
9174 echo "#include <$inc>" >>temp.c;
9176 echo "#ifdef $type" >> temp.c;
9177 echo "printf(\"We have $type\");" >> temp.c;
9178 echo "#endif" >> temp.c;
9179 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9181 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
9182 if $contains $type temp.E >/dev/null 2>&1; then
9183 echo "$type found." >&4;
9186 echo "$type NOT found." >&4;
9192 *) eval "$var=\$varval";;
9195 : see what type lseek is declared as in the kernel
9196 rp="What is the type used for lseek's offset on this system?"
9197 set off_t lseektype long stdio.h sys/types.h
9201 echo "Checking to see how big your file offsets are..." >&4
9203 #include <sys/types.h>
9207 printf("%d\n", (int)sizeof($lseektype));
9212 if eval $compile_ok; then
9213 lseeksize=`$run ./try`
9214 echo "Your file offsets are $lseeksize bytes long."
9218 echo "(I can't seem to compile the test program. Guessing...)"
9219 rp="What is the size of your file offsets (in bytes)?"
9225 : see what type file positions are declared as in the library
9226 rp="What is the type for file position used by fsetpos()?"
9227 set fpos_t fpostype long stdio.h sys/types.h
9230 : Check size for Fpos_t
9233 *_t) zzz="$fpostype" ;;
9236 echo "Checking the size of $zzz..." >&4
9238 #include <sys/types.h>
9245 printf("%d\n", (int)sizeof($fpostype));
9250 if eval $compile_ok; then
9254 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9257 echo "Your $zzz is $fpossize bytes long."
9263 echo "(I can't compile the test program. Guessing...)" >&4
9264 rp="What is the size of your file positions (in bytes)?"
9269 : Check for large file support
9270 # Backward compatibility (uselfs is deprecated).
9272 "$define"|true|[yY]*)
9275 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
9277 uselargefiles="$define"
9281 case "$lseeksize:$fpossize" in
9284 You can have files larger than 2 gigabytes.
9287 *) case "$uselargefiles" in
9288 "$undef"|false|[nN]*) dflt='n' ;;
9293 Perl can be built to understand large files (files larger than 2 gigabytes)
9294 on some systems. To do so, Configure can be run with -Duselargefiles.
9296 If this doesn't make any sense to you, just accept the default '$dflt'.
9298 rp='Try to understand large files, if available?'
9301 y|Y) val="$define" ;;
9308 : Look for a hint-file generated 'call-back-unit'. If the
9309 : user has specified that a large files perl is to be built,
9310 : we may need to set or change some other defaults.
9311 if $test -f uselargefiles.cbu; then
9312 echo "Your platform has some specific hints regarding large file builds, using them..."
9313 . ./uselargefiles.cbu
9315 case "$uselargefiles" in
9317 if $test -f uselargefiles.cbu; then
9319 echo "Rechecking to see how big your file offsets are..." >&4
9321 #include <sys/types.h>
9325 printf("%d\n", (int)sizeof($lseektype));
9330 if eval $compile_ok; then
9331 lseeksize=`$run ./try`
9332 $echo "Your file offsets are now $lseeksize bytes long."
9336 echo "(I can't seem to compile the test program. Guessing...)"
9337 rp="What is the size of your file offsets (in bytes)?"
9342 *_t) zzz="$fpostype" ;;
9345 $echo $n "Rechecking the size of $zzz...$c" >&4
9347 #include <sys/types.h>
9354 printf("%d\n", (int)sizeof($fpostype));
9359 if eval $compile_ok; then
9364 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9367 echo " $fpossize bytes." >&4
9373 echo "(I can't compile the test program. Guessing...)" >&4
9374 rp="What is the size of your file positions (in bytes)?"
9383 : Set the vendorbin variables
9384 case "$vendorprefix" in
9385 '') d_vendorbin="$undef"
9389 *) d_vendorbin="$define"
9390 : determine where vendor-supplied executables go.
9391 case "$vendorbin" in
9392 '') dflt=$vendorprefix/bin ;;
9393 *) dflt="$vendorbin" ;;
9396 rp='Pathname for the vendor-supplied executables directory?'
9399 vendorbinexp="$ansexp"
9405 : Set the vendorhtml1dir variables
9406 case "$vendorprefix" in
9407 '') vendorhtml1dir=''
9408 vendorhtml1direxp=''
9410 *) : determine where vendor-supplied html pages go.
9411 : There is no standard location, so try to copy the previously-selected
9412 : directory structure for the core html pages.
9413 : XXX Better default suggestions would be welcome.
9414 case "$vendorhtml1dir" in
9415 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9416 *) dflt=$vendorhtml1dir ;;
9419 ''|' ') dflt=none ;;
9422 rp='Pathname for the vendor-supplied html pages?'
9424 vendorhtml1dir="$ans"
9425 vendorhtml1direxp="$ansexp"
9428 : Use ' ' for none so value is preserved next time through Configure
9429 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9430 prefixvar=vendorhtml1dir
9433 : Set the vendorhtml3dir variables
9434 case "$vendorprefix" in
9435 '') vendorhtml3dir=''
9436 vendorhtml3direxp=''
9438 *) : determine where vendor-supplied module html pages go.
9439 : There is no standard location, so try to copy the previously-selected
9440 : directory structure for the core html pages.
9441 : XXX Better default suggestions would be welcome.
9442 case "$vendorhtml3dir" in
9443 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9444 *) dflt=$vendorhtml3dir ;;
9447 ''|' ') dflt=none ;;
9450 rp='Pathname for the vendor-supplied html pages?'
9452 vendorhtml3dir="$ans"
9453 vendorhtml3direxp="$ansexp"
9456 : Use ' ' for none so value is preserved next time through Configure
9457 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9458 prefixvar=vendorhtml3dir
9461 : Set the vendorman1dir variables
9462 case "$vendorprefix" in
9463 '') vendorman1dir=''
9466 *) : determine where vendor-supplied manual pages go.
9467 case "$vendorman1dir" in
9468 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9469 *) dflt=$vendorman1dir ;;
9472 ''|' ') dflt=none ;;
9475 rp='Pathname for the vendor-supplied manual section 1 pages?'
9477 vendorman1dir="$ans"
9478 vendorman1direxp="$ansexp"
9481 : Use ' ' for none so value is preserved next time through Configure
9482 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
9483 prefixvar=vendorman1dir
9486 : Set the vendorman3dir variables
9487 case "$vendorprefix" in
9488 '') vendorman3dir=''
9491 *) : determine where vendor-supplied module manual pages go.
9492 case "$vendorman3dir" in
9493 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9494 *) dflt=$vendorman3dir ;;
9497 ''|' ') dflt=none ;;
9500 rp='Pathname for the vendor-supplied manual section 3 pages?'
9502 vendorman3dir="$ans"
9503 vendorman3direxp="$ansexp"
9506 : Use ' ' for none so value is preserved next time through Configure
9507 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
9508 prefixvar=vendorman3dir
9511 : Set the vendorscript variables
9512 case "$vendorprefix" in
9513 '') d_vendorscript="$undef"
9517 *) d_vendorscript="$define"
9518 : determine where vendor-supplied scripts go.
9519 case "$vendorscript" in
9520 '') dflt=$vendorprefix/script
9521 $test -d $dflt || dflt=$vendorbin ;;
9522 *) dflt="$vendorscript" ;;
9526 The installation process will create a directory for
9527 vendor-supplied scripts.
9531 rp='Pathname for the vendor-supplied scripts directory?'
9534 vendorscriptexp="$ansexp"
9537 prefixvar=vendorscript
9540 : script used to emit important warnings
9543 if test \$# -gt 0; then
9548 echo "*** WARNING:" >&4
9549 sed -e 's/^/*** /' <msg >&4
9551 cat msg >>config.msg
9552 echo " " >>config.msg
9558 : see which of string.h or strings.h is needed
9560 strings=`./findhdr string.h`
9561 if $test "$strings" && $test -r "$strings"; then
9562 echo "Using <string.h> instead of <strings.h>." >&4
9566 strings=`./findhdr strings.h`
9567 if $test "$strings" && $test -r "$strings"; then
9568 echo "Using <strings.h> instead of <string.h>." >&4
9570 ./warn "No string header found -- You'll surely have problems."
9576 "$undef") strings=`./findhdr strings.h`;;
9577 *) strings=`./findhdr string.h`;;
9580 : see if qgcvt exists
9584 : Check print/scan long double stuff
9587 if $test X"$d_longdbl" = X"$define"; then
9589 echo "Checking how to print long doubles..." >&4
9591 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
9592 $cat >try.c <<'EOCP'
9593 #include <sys/types.h>
9597 printf("%.3f\n", d);
9601 if eval $compile; then
9605 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
9606 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
9607 echo "We will use %f."
9613 if $test X"$sPRIfldbl" = X; then
9614 $cat >try.c <<'EOCP'
9615 #include <sys/types.h>
9618 long double d = 123.456;
9619 printf("%.3Lf\n", d);
9623 if eval $compile; then
9627 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
9628 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
9629 echo "We will use %Lf."
9635 if $test X"$sPRIfldbl" = X; then
9636 $cat >try.c <<'EOCP'
9637 #include <sys/types.h>
9640 long double d = 123.456;
9641 printf("%.3llf\n", d);
9645 if eval $compile; then
9649 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
9650 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
9651 echo "We will use %llf."
9657 if $test X"$sPRIfldbl" = X; then
9658 $cat >try.c <<'EOCP'
9659 #include <sys/types.h>
9662 long double d = 123.456;
9663 printf("%.3lf\n", d);
9667 if eval $compile; then
9671 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
9672 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
9673 echo "We will use %lf."
9679 if $test X"$sPRIfldbl" = X; then
9680 echo "Cannot figure out how to print long doubles." >&4
9682 sSCNfldbl=$sPRIfldbl # expect consistency
9689 case "$sPRIfldbl" in
9690 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
9691 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
9692 d_SCNfldbl="$undef";
9694 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
9695 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
9696 d_SCNfldbl="$define";
9700 : Check how to convert floats to strings.
9702 if test "X$d_Gconvert" = X; then
9705 echo "Checking for an efficient way to convert floats to strings."
9707 case "$uselongdouble" in
9708 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
9710 case "$d_longdbl" in
9711 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
9713 case "$d_PRIgldbl" in
9714 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
9718 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
9719 char *myname = "gconvert";
9722 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
9723 char *myname = "gcvt";
9726 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
9727 char *myname = "qgcvt";
9728 #define DOUBLETYPE long double
9731 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9733 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
9735 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
9738 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
9740 char *myname = "sprintf";
9744 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9745 #define DOUBLETYPE long double
9747 #define DOUBLETYPE double
9759 # include <string.h>
9761 # include <strings.h>
9764 int checkit(char *expect, char *got)
9766 if (strcmp(expect, got)) {
9767 printf("%s oddity: Expected %s, got %s\n",
9768 myname, expect, got);
9778 /* This must be 1st test on (which?) platform */
9779 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
9780 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
9781 checkit("0.1", buf);
9783 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
9784 checkit("0.01", buf);
9786 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
9787 checkit("0.001", buf);
9789 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
9790 checkit("0.0001", buf);
9792 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
9793 if (strlen(buf) > 5)
9794 checkit("9e-005", buf); /* for Microsoft ?? */
9796 checkit("9e-05", buf);
9798 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
9801 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
9802 checkit("1.1", buf);
9804 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
9805 checkit("1.01", buf);
9807 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
9808 checkit("1.001", buf);
9810 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
9811 checkit("1.0001", buf);
9813 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
9814 checkit("1.00001", buf);
9816 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
9817 checkit("1.000001", buf);
9819 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
9822 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
9825 /* Some Linux gcvt's give 1.e+5 here. */
9826 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
9827 checkit("100000", buf);
9829 /* Some Linux gcvt's give -1.e+5 here. */
9830 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
9831 checkit("-100000", buf);
9833 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
9834 checkit("123.456", buf);
9836 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
9837 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
9838 /* 34 should be enough to scare even long double
9839 * places into using the e notation. */
9840 if (strlen(buf) > 5)
9841 checkit("1e+034", buf); /* for Microsoft */
9843 checkit("1e+34", buf);
9845 /* For Perl, if you add additional tests here, also add them to
9846 * t/base/num.t for benefit of platforms not using Configure or
9847 * overriding d_Gconvert */
9852 : first add preferred functions to our list
9854 for xxx_convert in $gconvert_preference; do
9855 case $xxx_convert in
9856 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
9857 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
9860 : then add any others
9861 for xxx_convert in gconvert gcvt sprintf; do
9864 *) xxx_list="$xxx_list $xxx_convert" ;;
9868 case "$d_longdbl$uselongdouble" in
9870 : again, add prefered functions to our list first
9872 for xxx_convert in $gconvert_ld_preference; do
9873 case $xxx_convert in
9874 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9875 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
9878 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
9879 for xxx_convert in qgcvt sprintf $xxx_list; do
9880 case "$xxx_ld_list" in
9881 $xxx_convert*|*" $xxx_convert"*) ;;
9882 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9885 : if sprintf cannot do long doubles, move it to the end
9886 if test "$d_PRIgldbl" != "$define"; then
9887 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
9889 : if no qgcvt, remove it
9890 if test "$d_qgcvt" != "$define"; then
9891 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
9894 xxx_list="$xxx_ld_list"
9898 for xxx_convert in $xxx_list; do
9899 echo "Trying $xxx_convert..."
9900 $rm -f try try$_o core
9901 set try -DTRY_$xxx_convert
9902 if eval $compile; then
9903 echo "$xxx_convert() found." >&4
9905 echo "I'll use $xxx_convert to convert floats into a string." >&4
9908 echo "...But $xxx_convert didn't work as I expected."
9912 echo "$xxx_convert NOT found." >&4
9916 if test X$xxx_convert = X; then
9917 echo "*** WHOA THERE!!! ***" >&4
9918 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
9922 case "$xxx_convert" in
9923 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
9924 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
9925 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
9926 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
9927 "$define$define$define")
9928 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
9929 "$define$define$undef")
9930 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
9931 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
9939 : see if _fwalk exists
9943 : Initialize h_fcntl
9946 : Initialize h_sysfile
9949 : access call always available on UNIX
9953 : locate the flags for 'access()'
9957 $cat >access.c <<EOCP
9958 #include <sys/types.h>
9963 #include <sys/file.h>
9976 : check sys/file.h first, no particular reason here
9977 if $test `./findhdr sys/file.h` && \
9978 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
9980 echo "<sys/file.h> defines the *_OK access constants." >&4
9981 elif $test `./findhdr fcntl.h` && \
9982 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
9984 echo "<fcntl.h> defines the *_OK access constants." >&4
9985 elif $test `./findhdr unistd.h` && \
9986 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
9987 echo "<unistd.h> defines the *_OK access constants." >&4
9989 echo "I can't find the four *_OK access constants--I'll use mine." >&4
9995 : see if accessx exists
9996 set accessx d_accessx
9999 : see if aintl exists
10003 : see if alarm exists
10007 : see if 64bit time functions exists
10009 set ctime64 d_ctime64
10012 set localtime64 d_localtime64
10015 set gmtime64 d_gmtime64
10018 set mktime64 d_mktime64
10021 set difftime64 d_difftime64
10024 set asctime64 d_asctime64
10027 : see if POSIX threads are available
10028 set pthread.h i_pthread
10031 : define a fucntion to check prototypes
10032 $cat > protochk <<EOSH
10035 optimize="$optimize"
10037 prototype="$prototype"
10040 usethreads=$usethreads
10041 i_pthread=$i_pthread
10042 pthread_h_first=$pthread_h_first
10045 $cat >> protochk <<'EOSH'
10050 while test $# -ge 2; do
10052 $define) echo "#include <$2>" >> try.c ;;
10053 literal) echo "$2" >> try.c ;;
10055 # Extra magic for the benefit of systems that need pthread.h
10056 # to be included early to correctly detect threadsafe functions.
10057 # Such functions must guarantee themselves, though, that the usethreads
10058 # and i_pthread have been defined, before calling protochk.
10059 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
10060 echo "#include <pthread.h>" >> try.c
10065 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
10066 cat >> try.c <<'EOCP'
10067 #ifdef CAN_PROTOTYPE
10068 #define _(args) args
10073 echo "$foo" >> try.c
10074 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
10075 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
10081 $eunicefix protochk
10083 : Define hasproto macro for Configure internal use
10084 hasproto='varname=$1; func=$2; shift; shift;
10085 while $test $# -ge 2; do
10087 $define) echo "#include <$2>";;
10091 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
10092 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
10093 echo "$func() prototype found.";
10096 echo "$func() prototype NOT found.";
10103 : see if sys/types.h has to be included
10104 set sys/types.h i_systypes
10107 : see if sys/select.h has to be included
10108 set sys/select.h i_sysselct
10111 : Define hasfield macro for Configure internal use
10112 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
10113 while $test $# -ge 2; do
10115 $define) echo "#include <$2>";;
10119 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
10121 if eval $compile; then
10130 : see if we should include time.h, sys/time.h, or both
10132 if test "X$timeincl" = X; then
10133 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
10134 $echo $n "I'm now running the test program...$c"
10136 #include <sys/types.h>
10141 #ifdef SYSTIMEKERNEL
10144 #include <sys/time.h>
10147 #include <sys/select.h>
10149 #$i_stdlib I_STDLIB
10151 #include <stdlib.h>
10157 struct timeval bar;
10160 struct timezone tzp;
10162 if (foo.tm_sec == foo.tm_sec)
10165 if (bar.tv_sec == bar.tv_sec)
10172 for s_timezone in '-DS_TIMEZONE' ''; do
10174 for s_timeval in '-DS_TIMEVAL' ''; do
10175 for i_systimek in '' '-DSYSTIMEKERNEL'; do
10176 for i_time in '' '-DI_TIME'; do
10177 for i_systime in '-DI_SYSTIME' ''; do
10180 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
10181 if eval $compile; then
10182 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
10186 $echo $n "Succeeded with $flags$c"
10198 *SYSTIMEKERNEL*) i_systimek="$define"
10199 timeincl=`./findhdr sys/time.h`
10200 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
10201 *) i_systimek="$undef";;
10204 *I_TIME*) i_time="$define"
10205 timeincl=`./findhdr time.h`" $timeincl"
10206 echo "We'll include <time.h>." >&4;;
10207 *) i_time="$undef";;
10210 *I_SYSTIME*) i_systime="$define"
10211 timeincl=`./findhdr sys/time.h`" $timeincl"
10212 echo "We'll include <sys/time.h>." >&4;;
10213 *) i_systime="$undef";;
10217 : see if struct tm knows about tm_zone
10218 case "$i_systime$i_time" in
10221 echo "Checking to see if your struct tm has tm_zone field..." >&4
10222 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
10230 case "$d_tm_tm_zone" in
10231 "$define") echo "Yes, it does." ;;
10232 *) echo "No, it doesn't." ;;
10234 : see if struct tm knows about tm_gmtoff
10235 case "$i_systime$i_time" in
10238 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
10239 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
10247 case "$d_tm_tm_gmtoff" in
10248 "$define") echo "Yes, it does." ;;
10249 *) echo "No, it doesn't." ;;
10252 : see if asctime_r exists
10253 set asctime_r d_asctime_r
10255 case "$d_asctime_r" in
10257 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10258 case "$d_asctime_r_proto:$usethreads" in
10259 ":define") d_asctime_r_proto=define
10260 set d_asctime_r_proto asctime_r $hdrs
10264 case "$d_asctime_r_proto" in
10266 case "$asctime_r_proto" in
10267 ''|0) try='char* asctime_r(const struct tm*, char*);'
10268 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SB ;;
10270 case "$asctime_r_proto" in
10271 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
10272 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SBI ;;
10274 case "$asctime_r_proto" in
10275 ''|0) try='int asctime_r(const struct tm*, char*);'
10276 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SB ;;
10278 case "$asctime_r_proto" in
10279 ''|0) try='int asctime_r(const struct tm*, char*, int);'
10280 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SBI ;;
10282 case "$asctime_r_proto" in
10283 ''|0) d_asctime_r=undef
10285 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
10286 * ) case "$asctime_r_proto" in
10287 REENTRANT_PROTO*) ;;
10288 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
10290 echo "Prototype: $try" ;;
10293 *) case "$usethreads" in
10294 define) echo "asctime_r has no prototype, not using it." >&4 ;;
10301 *) asctime_r_proto=0
10305 : see if atolf exists
10309 : see if atoll exists
10313 : Look for GCC-style attribute format
10314 case "$d_attribute_format" in
10317 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
10318 $cat >attrib.c <<'EOCP'
10320 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
10322 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10323 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10324 echo "Your C compiler doesn't support __attribute__((format))."
10327 echo "Your C compiler supports __attribute__((format))."
10331 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10335 *) val="$d_attribute_format" ;;
10337 set d_attribute_format
10341 : Look for GCC-style attribute format with null format allowed
10342 case "$d_printf_format_null" in
10343 '') case "$d_attribute_format" in
10346 echo "Checking whether your compiler allows __printf__ format to be null ..." >&4
10347 $cat >attrib.c <<EOCP
10349 #$i_stdlib I_STDLIB
10351 #include <stdlib.h>
10353 int null_printf (char* pat,...) __attribute__((__format__(__printf__,1,2)));
10354 int null_printf (char* pat,...) { return (int)pat; }
10355 int main () { exit(null_printf(NULL)); }
10357 if $cc $ccflags -o attrib attrib.c >attrib.out 2>&1 ; then
10358 : run the executable in case it produces a run-time warning
10359 if $run ./attrib >>attrib.out 2>&1; then
10360 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10361 echo "Your C compiler doesn't allow __printf__ format to be null."
10364 echo "Your C compiler allows __printf__ format to be null."
10368 echo "Your C compiler executable failed with __printf__ format null."
10372 echo "Your C compiler fails with __printf__ format null."
10379 *) val="$d_printf_format_null" ;;
10381 set d_printf_format_null
10385 : Look for GCC-style attribute malloc
10386 case "$d_attribute_malloc" in
10389 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
10390 $cat >attrib.c <<'EOCP'
10392 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
10394 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10395 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10396 echo "Your C compiler doesn't support __attribute__((malloc))."
10399 echo "Your C compiler supports __attribute__((malloc))."
10403 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10407 *) val="$d_attribute_malloc" ;;
10409 set d_attribute_malloc
10413 : Look for GCC-style attribute nonnull
10414 case "$d_attribute_nonnull" in
10417 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
10418 $cat >attrib.c <<'EOCP'
10420 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
10422 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10423 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10424 echo "Your C compiler doesn't support __attribute__((nonnull))."
10427 echo "Your C compiler supports __attribute__((nonnull))."
10431 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10435 *) val="$d_attribute_nonnull" ;;
10437 set d_attribute_nonnull
10441 : Look for GCC-style attribute noreturn
10442 case "$d_attribute_noreturn" in
10445 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
10446 $cat >attrib.c <<'EOCP'
10448 void fall_over_dead( void ) __attribute__((noreturn));
10450 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10451 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10452 echo "Your C compiler doesn't support __attribute__((noreturn))."
10455 echo "Your C compiler supports __attribute__((noreturn))."
10459 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10463 *) val="$d_attribute_noreturn" ;;
10465 set d_attribute_noreturn
10469 : Look for GCC-style attribute pure
10470 case "$d_attribute_pure" in
10473 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
10474 $cat >attrib.c <<'EOCP'
10476 int square( int n ) __attribute__((pure));
10478 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10479 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10480 echo "Your C compiler doesn't support __attribute__((pure))."
10483 echo "Your C compiler supports __attribute__((pure))."
10487 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10491 *) val="$d_attribute_pure" ;;
10493 set d_attribute_pure
10497 : Look for GCC-style attribute unused
10498 case "$d_attribute_unused" in
10501 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
10502 $cat >attrib.c <<'EOCP'
10504 int do_something( int dummy __attribute__((unused)), int n );
10506 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10507 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10508 echo "Your C compiler doesn't support __attribute__((unused))."
10511 echo "Your C compiler supports __attribute__((unused))."
10515 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10519 *) val="$d_attribute_unused" ;;
10521 set d_attribute_unused
10525 : Look for GCC-style attribute deprecated
10526 case "$d_attribute_deprecated" in
10529 echo "Checking whether your compiler can handle __attribute__((deprecated)) ..." >&4
10530 $cat >attrib.c <<'EOCP'
10532 int I_am_deprecated(void) __attribute__((deprecated));
10534 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10535 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10536 echo "Your C compiler doesn't support __attribute__((deprecated))."
10539 echo "Your C compiler supports __attribute__((deprecated))."
10543 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10547 *) val="$d_attribute_deprecated" ;;
10549 set d_attribute_deprecated
10553 : Look for GCC-style attribute warn_unused_result
10554 case "$d_attribute_warn_unused_result" in
10557 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
10558 $cat >attrib.c <<'EOCP'
10560 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
10562 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10563 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10564 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
10567 echo "Your C compiler supports __attribute__((warn_unused_result))."
10571 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10575 *) val="$d_attribute_warn_unused_result" ;;
10577 set d_attribute_warn_unused_result
10581 : see if bcmp exists
10585 : see if bcopy exists
10589 : see if getpgrp exists
10590 set getpgrp d_getpgrp
10593 case "$d_getpgrp" in
10596 echo "Checking to see which flavor of getpgrp is in use..."
10598 #$i_unistd I_UNISTD
10599 #include <sys/types.h>
10601 # include <unistd.h>
10603 #$i_stdlib I_STDLIB
10605 #include <stdlib.h>
10609 if (getuid() == 0) {
10610 printf("(I see you are running Configure as super-user...)\n");
10613 #ifdef TRY_BSD_PGRP
10614 if (getpgrp(1) == 0)
10623 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10624 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
10626 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10627 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
10630 echo "I can't seem to compile and run the test program."
10632 xxx="a USG one, i.e. you use getpgrp()."
10634 # SVR4 systems can appear rather BSD-ish.
10635 case "$i_unistd" in
10637 xxx="a BSD one, i.e. you use getpgrp(pid)."
10641 xxx="probably a USG one, i.e. you use getpgrp()."
10646 echo "Assuming your getpgrp is $xxx" >&4
10655 : see if setpgrp exists
10656 set setpgrp d_setpgrp
10659 case "$d_setpgrp" in
10662 echo "Checking to see which flavor of setpgrp is in use..."
10664 #$i_unistd I_UNISTD
10665 #include <sys/types.h>
10667 # include <unistd.h>
10669 #$i_stdlib I_STDLIB
10671 #include <stdlib.h>
10675 if (getuid() == 0) {
10676 printf("(I see you are running Configure as super-user...)\n");
10679 #ifdef TRY_BSD_PGRP
10680 if (-1 == setpgrp(1, 1))
10683 if (setpgrp() != -1)
10689 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10690 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
10692 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10693 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
10696 echo "(I can't seem to compile and run the test program.)"
10698 xxx="a USG one, i.e. you use setpgrp()."
10700 # SVR4 systems can appear rather BSD-ish.
10701 case "$i_unistd" in
10703 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
10707 xxx="probably a USG one, i.e. you use setpgrp()."
10712 echo "Assuming your setpgrp is $xxx" >&4
10721 : Look for GCC-style __builtin_choose_expr
10722 case "$d_builtin_choose_expr" in
10725 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
10726 $cat >try.c <<'EOCP'
10727 #include <assert.h>
10728 #include <stdlib.h>
10731 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
10734 assert( SYRINX(1) == 2112 );
10735 assert( SYRINX(1) != 5150 );
10736 assert( SYRINX(0) == 5150 );
10737 assert( SYRINX(0) != 2112 );
10738 puts( "All good!" );
10744 if eval $compile && $run ./try; then
10745 echo "Your C compiler supports __builtin_choose_expr."
10748 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
10752 *) val="$d_builtin_choose_expr" ;;
10755 set d_builtin_choose_expr
10759 : Look for GCC-style __builtin_expect
10760 case "$d_builtin_expect" in
10763 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
10764 $cat >try.c <<'EOCP'
10767 if ( __builtin_expect(n, 0) ) n = 1;
10768 /* Remember shell exit code truth is 0, C truth is non-zero */
10773 if eval $compile && $run ./try; then
10774 echo "Your C compiler supports __builtin_expect."
10777 echo "Your C compiler doesn't seem to understand __builtin_expect."
10781 *) val="$d_builtin_expect" ;;
10784 set d_builtin_expect
10788 : see if bzero exists
10792 : see if stdarg is available
10794 if $test `./findhdr stdarg.h`; then
10795 echo "<stdarg.h> found." >&4
10798 echo "<stdarg.h> NOT found." >&4
10802 : see if varags is available
10804 if $test `./findhdr varargs.h`; then
10805 echo "<varargs.h> found." >&4
10807 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
10810 : set up the varargs testing programs
10811 $cat > varargs.c <<EOP
10813 #include <stdarg.h>
10816 #include <varargs.h>
10820 int f(char *p, ...)
10834 p = va_arg(ap, char *);
10840 $cat > varargs <<EOP
10842 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
10851 : now check which varargs header should be included
10856 if `./varargs I_STDARG`; then
10858 elif `./varargs I_VARARGS`; then
10863 if `./varargs I_VARARGS`; then
10870 echo "I could not find the definition for va_dcl... You have problems..." >&4
10871 val="$undef"; set i_stdarg; eval $setvar
10872 val="$undef"; set i_varargs; eval $setvar
10877 case "$i_varhdr" in
10879 val="$define"; set i_stdarg; eval $setvar
10880 val="$undef"; set i_varargs; eval $setvar
10883 val="$undef"; set i_stdarg; eval $setvar
10884 val="$define"; set i_varargs; eval $setvar
10887 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
10891 : see if the Compiler supports C99 variadic macros
10892 case "$i_stdarg$i_stdlib" in
10894 echo "You have <stdarg.h> and <stdlib.h>, so checking for C99 variadic macros." >&4
10897 #include <stdarg.h>
10899 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
10903 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
10909 if eval $compile && $run ./try 2>&1 >/dev/null; then
10910 case "`$run ./try`" in
10912 echo "You have C99 variadic macros." >&4
10913 d_c99_variadic_macros="$define"
10916 echo "You don't have functional C99 variadic macros." >&4
10917 d_c99_variadic_macros="$undef"
10921 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
10922 d_c99_variadic_macros="$undef"
10927 echo "You don't have <stdarg.h> and <stdlib.h>, so not checking for C99 variadic macros." >&4
10928 d_c99_variadic_macros="$undef"
10932 : see if signal is declared as pointer to function returning int or void
10934 xxx=`./findhdr signal.h`
10935 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
10936 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10937 echo "You have int (*signal())() instead of void." >&4
10939 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10940 echo "You have void (*signal())()." >&4
10942 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
10943 echo "You have int (*signal())() instead of void." >&4
10945 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
10946 echo "You have void (*signal())()." >&4
10949 case "$d_voidsig" in
10951 echo "I can't determine whether signal handler returns void or int..." >&4
10953 rp="What type does your signal handler return?"
10956 v*) val="$define";;
10960 echo "As you already told me, signal handler returns void." >&4
10963 *) echo "As you already told me, signal handler returns int." >&4
10970 case "$d_voidsig" in
10971 "$define") signal_t="void";;
10972 *) signal_t="int";;
10976 : check for ability to cast large floats to 32-bit ints.
10978 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
10979 if $test "$intsize" -ge 4; then
10986 #$i_stdlib I_STDLIB
10988 #include <stdlib.h>
10990 #include <sys/types.h>
10991 #include <signal.h>
10992 $signal_t blech(int s) { exit(3); }
10999 signal(SIGFPE, blech);
11001 /* Don't let compiler optimize the test away. Store the number
11002 in a writable string for gcc to pass to sscanf under HP/UX.
11004 sprintf(str, "2147483647");
11005 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
11009 /* x86 processors will probably give 0x8000 0000, which is a
11010 sign change. We don't want that. We want to mimic SPARC
11011 behavior here, which is to preserve the sign and give
11014 if (i32 != ($xxx) f)
11020 if eval $compile_ok; then
11024 echo "(I can't seem to compile the test program--assuming it can't)"
11029 echo "Yup, it can."
11032 echo "Nope, it can't."
11039 : check for ability to cast negative floats to unsigned
11041 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
11044 #$i_stdlib I_STDLIB
11046 #include <stdlib.h>
11048 #include <sys/types.h>
11049 #include <signal.h>
11050 $signal_t blech(int s) { exit(7); }
11051 $signal_t blech_in_list(int s) { exit(4); }
11052 unsigned long dummy_long(unsigned long p) { return p; }
11053 unsigned int dummy_int(unsigned int p) { return p; }
11054 unsigned short dummy_short(unsigned short p) { return p; }
11058 unsigned long along;
11060 unsigned short ashort;
11064 /* Frustrate gcc-2.7.2's optimizer which failed this test with
11065 a direct f = -123. assignment. gcc-2.8.0 reportedly
11066 optimized the whole file away
11068 /* Store the number in a writable string for gcc to pass to
11069 sscanf under HP/UX.
11071 sprintf(str, "-123");
11072 sscanf(str, "%lf", &f); /* f = -123.; */
11074 signal(SIGFPE, blech);
11075 along = (unsigned long)f;
11076 aint = (unsigned int)f;
11077 ashort = (unsigned short)f;
11078 if (along != (unsigned long)-123)
11080 if (aint != (unsigned int)-123)
11082 if (ashort != (unsigned short)-123)
11084 sprintf(str, "1073741824.");
11085 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
11088 along = (unsigned long)f;
11089 if (along != 0x80000000)
11093 along = (unsigned long)f;
11094 if (along != 0x7fffffff)
11098 along = (unsigned long)f;
11099 if (along != 0x80000001)
11103 signal(SIGFPE, blech_in_list);
11104 sprintf(str, "123.");
11105 sscanf(str, "%lf", &f); /* f = 123.; */
11106 along = dummy_long((unsigned long)f);
11107 aint = dummy_int((unsigned int)f);
11108 ashort = dummy_short((unsigned short)f);
11109 if (along != (unsigned long)123)
11111 if (aint != (unsigned int)123)
11113 if (ashort != (unsigned short)123)
11120 if eval $compile_ok; then
11124 echo "(I can't seem to compile the test program--assuming it can't)"
11127 case "$castflags" in
11129 echo "Yup, it can."
11132 echo "Nope, it can't."
11139 : see if vprintf exists
11141 if set vprintf val -f d_vprintf; eval $csym; $val; then
11142 echo 'vprintf() found.' >&4
11145 #$i_stdarg I_STDARG /* Only one of these can be defined by i_varhrd */
11146 #$i_varargs I_VARARGS
11148 #$i_stdlib I_STDLIB
11149 #$i_unistd I_UNISTD
11152 # include <stdarg.h>
11153 #else /* I_VARARGS */
11154 # include <varargs.h>
11158 # include <unistd.h>
11162 # include <stdlib.h>
11165 #include <stdio.h> /* vsprintf prototype */
11168 void xxx(int n, ...)
11173 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11175 int main() { xxx(1, "foo"); }
11177 #else /* I_VARARGS */
11185 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11187 int main() { xxx("foo"); }
11193 if eval $compile_ok; then
11194 if $run ./try; then
11195 echo "Your vsprintf() returns (int)." >&4
11198 echo "Your vsprintf() returns (char*)." >&4
11202 echo 'I am unable to compile the vsprintf() test program.' >&4
11203 # We shouldn't get here. If we do, assume the standard signature,
11204 # not the old BSD one.
11205 echo 'Guessing that vsprintf() returns (int).' >&4
11209 echo 'vprintf() NOT found.' >&4
11220 : see if chown exists
11224 : see if chroot exists
11225 set chroot d_chroot
11228 : see if chsize exists
11229 set chsize d_chsize
11232 : see if class exists
11236 : see if clearenv exists
11237 set clearenv d_clearenv
11240 : Define hasstruct macro for Configure internal use
11241 hasstruct='varname=$1; struct=$2; shift; shift;
11242 while $test $# -ge 2; do
11244 $define) echo "#include <$2>";;
11248 echo "int main () { struct $struct foo; }" >> try.c;
11250 if eval $compile; then
11259 : see whether socket exists
11263 $echo $n "Hmm... $c" >&4
11264 if set socket val -f d_socket; eval $csym; $val; then
11265 echo "Looks like you have Berkeley networking support." >&4
11267 if set setsockopt val -f; eval $csym; $val; then
11270 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
11271 d_oldsock="$define"
11274 if $contains socklib libc.list >/dev/null 2>&1; then
11275 echo "Looks like you have Berkeley networking support." >&4
11277 : we will have to assume that it supports the 4.2 BSD interface
11280 echo "You don't have Berkeley networking in libc$_a..." >&4
11281 if test "X$d_socket" = "X$define"; then
11282 echo "...but you seem to believe that you have sockets." >&4
11284 for net in net socket
11286 if test -f /usr/lib/lib$net$_a; then
11287 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
11288 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
11289 if $contains socket libc.list >/dev/null 2>&1; then
11294 echo "...but the Wollongong group seems to have hacked it in." >&4
11295 sockethdr="-I/usr/netinclude"
11298 echo "Found Berkeley sockets interface in lib$net." >&4
11299 if $contains setsockopt libc.list >/dev/null 2>&1; then
11302 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
11303 d_oldsock="$define"
11309 if test "X$d_socket" != "X$define"; then
11310 echo "or anywhere else I see." >&4
11318 : see if socketpair exists
11319 set socketpair d_sockpair
11324 echo "Checking the availability of certain socket constants..." >&4
11325 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
11326 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
11328 #include <sys/types.h>
11329 #include <sys/socket.h>
11335 set try; if eval $compile; then
11338 set d_${enum}; eval $setvar
11342 : see if this is a sys/uio.h system
11343 set sys/uio.h i_sysuio
11346 : Check for cmsghdr support
11348 echo "Checking to see if your system supports struct cmsghdr..." >&4
11349 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
11351 case "$d_cmsghdr_s" in
11352 "$define") echo "Yes, it does." ;;
11353 *) echo "No, it doesn't." ;;
11357 : check for const keyword
11359 echo 'Checking to see if your C compiler knows about "const"...' >&4
11360 $cat >const.c <<'EOCP'
11361 typedef struct spug { int drokk; } spug;
11365 const spug y = { 0 };
11368 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
11370 echo "Yup, it does."
11373 echo "Nope, it doesn't."
11378 : see if copysignl exists
11379 set copysignl d_copysignl
11382 : see if crypt exists
11387 $define) cryptlib='' ;;
11388 *) if set crypt val -f d_crypt; eval $csym; $val; then
11389 echo 'crypt() found.' >&4
11393 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
11394 if $test -z "$cryptlib"; then
11395 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
11399 if $test -z "$cryptlib"; then
11400 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
11404 if $test -z "$cryptlib"; then
11405 cryptlib=`./loc libcrypt$_a "" $libpth`
11409 if $test -z "$cryptlib"; then
11410 echo 'crypt() NOT found.' >&4
11421 : see if this is a crypt.h system
11422 set crypt.h i_crypt
11425 : see if crypt_r exists
11426 set crypt_r d_crypt_r
11428 case "$d_crypt_r" in
11430 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
11431 case "$d_crypt_r_proto:$usethreads" in
11432 ":define") d_crypt_r_proto=define
11433 set d_crypt_r_proto crypt_r $hdrs
11437 case "$d_crypt_r_proto" in
11439 case "$crypt_r_proto" in
11440 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
11441 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCS ;;
11443 case "$crypt_r_proto" in
11444 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
11445 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCD ;;
11447 case "$crypt_r_proto" in
11448 ''|0) d_crypt_r=undef
11450 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
11451 * ) case "$crypt_r_proto" in
11452 REENTRANT_PROTO*) ;;
11453 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
11455 echo "Prototype: $try" ;;
11458 *) case "$usethreads" in
11459 define) echo "crypt_r has no prototype, not using it." >&4 ;;
11470 : get csh whereabouts
11472 'csh') val="$undef" ;;
11473 *) val="$define" ;;
11477 : Respect a hint or command line value for full_csh.
11478 case "$full_csh" in
11479 '') full_csh=$csh ;;
11482 : see if ctermid exists
11483 set ctermid d_ctermid
11486 : see if ctermid_r exists
11487 set ctermid_r d_ctermid_r
11489 case "$d_ctermid_r" in
11491 hdrs="$i_systypes sys/types.h define stdio.h "
11492 case "$d_ctermid_r_proto:$usethreads" in
11493 ":define") d_ctermid_r_proto=define
11494 set d_ctermid_r_proto ctermid_r $hdrs
11498 case "$d_ctermid_r_proto" in
11500 case "$ctermid_r_proto" in
11501 ''|0) try='char* ctermid_r(char*);'
11502 ./protochk "$extern_C $try" $hdrs && ctermid_r_proto=B_B ;;
11504 case "$ctermid_r_proto" in
11505 ''|0) d_ctermid_r=undef
11507 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
11508 * ) case "$ctermid_r_proto" in
11509 REENTRANT_PROTO*) ;;
11510 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
11512 echo "Prototype: $try" ;;
11515 *) case "$usethreads" in
11516 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
11523 *) ctermid_r_proto=0
11527 : see if ctime_r exists
11528 set ctime_r d_ctime_r
11530 case "$d_ctime_r" in
11532 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
11533 case "$d_ctime_r_proto:$usethreads" in
11534 ":define") d_ctime_r_proto=define
11535 set d_ctime_r_proto ctime_r $hdrs
11539 case "$d_ctime_r_proto" in
11541 case "$ctime_r_proto" in
11542 ''|0) try='char* ctime_r(const time_t*, char*);'
11543 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SB ;;
11545 case "$ctime_r_proto" in
11546 ''|0) try='char* ctime_r(const time_t*, char*, int);'
11547 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SBI ;;
11549 case "$ctime_r_proto" in
11550 ''|0) try='int ctime_r(const time_t*, char*);'
11551 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SB ;;
11553 case "$ctime_r_proto" in
11554 ''|0) try='int ctime_r(const time_t*, char*, int);'
11555 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SBI ;;
11557 case "$ctime_r_proto" in
11558 ''|0) d_ctime_r=undef
11560 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
11561 * ) case "$ctime_r_proto" in
11562 REENTRANT_PROTO*) ;;
11563 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
11565 echo "Prototype: $try" ;;
11568 *) case "$usethreads" in
11569 define) echo "ctime_r has no prototype, not using it." >&4 ;;
11580 : see if cuserid exists
11581 set cuserid d_cuserid
11584 : see if this is a limits.h system
11585 set limits.h i_limits
11588 : see if this is a float.h system
11589 set float.h i_float
11592 : See if number of significant digits in a double precision number is known
11594 $cat >dbl_dig.c <<EOM
11595 #$i_limits I_LIMITS
11598 #include <limits.h>
11604 printf("Contains DBL_DIG");
11607 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
11608 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
11609 echo "DBL_DIG found." >&4
11612 echo "DBL_DIG NOT found." >&4
11619 : see if dbm.h is available
11620 : see if dbmclose exists
11621 set dbmclose d_dbmclose
11624 case "$d_dbmclose" in
11634 *) set rpcsvc/dbm.h i_rpcsvcdbm
11639 *) echo "We won't be including <dbm.h>"
11649 : see if prototype for dbminit is available
11651 set d_dbminitproto dbminit $i_dbm dbm.h
11654 : see if difftime exists
11655 set difftime d_difftime
11658 : see if this is a dirent system
11660 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
11662 echo "<dirent.h> found." >&4
11665 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
11666 echo "<sys/dir.h> found." >&4
11669 xinc=`./findhdr sys/ndir.h`
11671 echo "<dirent.h> NOT found." >&4
11676 : Look for type of directory structure.
11678 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11680 case "$direntrytype" in
11682 case "$i_dirent" in
11683 $define) guess1='struct dirent' ;;
11684 *) guess1='struct direct' ;;
11687 *) guess1="$direntrytype"
11692 'struct dirent') guess2='struct direct' ;;
11693 *) guess2='struct dirent' ;;
11696 if $contains "$guess1" try.c >/dev/null 2>&1; then
11697 direntrytype="$guess1"
11698 echo "Your directory entries are $direntrytype." >&4
11699 elif $contains "$guess2" try.c >/dev/null 2>&1; then
11700 direntrytype="$guess2"
11701 echo "Your directory entries seem to be $direntrytype." >&4
11703 echo "I don't recognize your system's directory entries." >&4
11704 rp="What type is used for directory entries on this system?"
11707 direntrytype="$ans"
11711 : see if the directory entry stores field length
11713 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11714 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
11715 echo "Good, your directory entry keeps length information in d_namlen." >&4
11718 echo "Your directory entry does not know about the d_namlen field." >&4
11725 : Look for DIR.dd_fd
11726 case "$i_dirent" in
11728 echo "Checking to see if DIR has a dd_fd member variable" >&4
11730 #$i_stdlib I_STDLIB
11732 #include <stdlib.h>
11734 #include <dirent.h>
11744 if eval $compile; then
11745 echo "Yes, it does."
11748 echo "No, it does not."
11753 echo "You don't have a <dirent.h>, so not checking for dd_fd." >&4
11761 : see if this is an sysdir system
11762 set sys/dir.h i_sysdir
11765 : see if this is an sysndir system
11766 set sys/ndir.h i_sysndir
11771 $cat >dirfd.c <<EOM
11773 #$i_stdlib I_STDLIB
11775 #include <stdlib.h>
11777 #$i_dirent I_DIRENT /**/
11778 #$i_sysdir I_SYS_DIR /**/
11779 #$i_sysndir I_SYS_NDIR /**/
11780 #$i_systypes I_SYS_TYPES /**/
11781 #if defined(I_SYS_TYPES)
11782 #include <sys/types.h>
11784 #if defined(I_DIRENT)
11785 #include <dirent.h>
11786 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
11787 #include <sys/dir.h>
11791 #include <sys/ndir.h>
11795 #include <ndir.h> /* may be wrong in the future */
11797 #include <sys/dir.h>
11803 DIR *dirp = opendir(".");
11804 if (dirfd(dirp) >= 0)
11812 if eval $compile; then
11816 $define) echo "dirfd() found." >&4 ;;
11817 *) echo "dirfd() NOT found." >&4 ;;
11823 : see if dlerror exists
11826 set dlerror d_dlerror
11830 : see if dlfcn is available
11831 set dlfcn.h i_dlfcn
11834 : Check what extension to use for shared libs
11839 On a few systems, the dynamically loaded modules that perl generates and uses
11840 will need a different extension than shared libs. The default will probably
11846 *) dflt="$dlext" ;;
11848 rp='What is the extension of dynamically loaded modules'
11857 : Check if dlsym need a leading underscore
11863 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
11864 $cat >dyna.c <<'EOM'
11871 #$i_stdlib I_STDLIB
11873 #include <stdlib.h>
11877 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
11879 #include <sys/types.h>
11884 extern int fred() ;
11893 int mode = RTLD_LAZY ;
11895 handle = dlopen("./dyna.$dlext", mode) ;
11896 if (handle == NULL) {
11901 symbol = dlsym(handle, "fred") ;
11902 if (symbol == NULL) {
11903 /* try putting a leading underscore */
11904 symbol = dlsym(handle, "_fred") ;
11905 if (symbol == NULL) {
11918 : Call the object file tmp-dyna.o in case dlext=o.
11919 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
11920 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
11921 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
11922 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
11925 1) echo "Test program failed using dlopen." >&4
11926 echo "Perhaps you should not use dynamic loading." >&4;;
11927 2) echo "Test program failed using dlsym." >&4
11928 echo "Perhaps you should not use dynamic loading." >&4;;
11929 3) echo "dlsym needs a leading underscore" >&4
11931 4) echo "dlsym doesn't need a leading underscore." >&4;;
11934 echo "I can't compile and run the test program." >&4
11935 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
11940 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
11945 : see if drand48_r exists
11946 set drand48_r d_drand48_r
11948 case "$d_drand48_r" in
11950 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
11951 case "$d_drand48_r_proto:$usethreads" in
11952 ":define") d_drand48_r_proto=define
11953 set d_drand48_r_proto drand48_r $hdrs
11957 case "$d_drand48_r_proto" in
11959 case "$drand48_r_proto" in
11960 ''|0) try='int drand48_r(struct drand48_data*, double*);'
11961 ./protochk "$extern_C $try" $hdrs && drand48_r_proto=I_ST ;;
11963 case "$drand48_r_proto" in
11964 ''|0) d_drand48_r=undef
11966 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
11967 * ) case "$drand48_r_proto" in
11968 REENTRANT_PROTO*) ;;
11969 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
11971 echo "Prototype: $try" ;;
11974 *) case "$usethreads" in
11975 define) echo "drand48_r has no prototype, not using it." >&4 ;;
11982 *) drand48_r_proto=0
11986 : see if prototype for drand48 is available
11988 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
11991 : see if dup2 exists
11995 : see if eaccess exists
11996 set eaccess d_eaccess
11999 : see if endgrent exists
12000 set endgrent d_endgrent
12003 : see if this is an grp system
12009 xxx=`./findhdr grp.h`
12010 $cppstdin $cppflags $cppminus < $xxx >$$.h
12012 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
12024 set d_grpasswd; eval $setvar
12028 : see if endgrent_r exists
12029 set endgrent_r d_endgrent_r
12031 case "$d_endgrent_r" in
12033 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12034 case "$d_endgrent_r_proto:$usethreads" in
12035 ":define") d_endgrent_r_proto=define
12036 set d_endgrent_r_proto endgrent_r $hdrs
12040 case "$d_endgrent_r_proto" in
12042 case "$endgrent_r_proto" in
12043 ''|0) try='int endgrent_r(FILE**);'
12044 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=I_H ;;
12046 case "$endgrent_r_proto" in
12047 ''|0) try='void endgrent_r(FILE**);'
12048 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=V_H ;;
12050 case "$endgrent_r_proto" in
12051 ''|0) d_endgrent_r=undef
12053 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
12054 * ) case "$endgrent_r_proto" in
12055 REENTRANT_PROTO*) ;;
12056 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
12058 echo "Prototype: $try" ;;
12061 *) case "$usethreads" in
12062 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
12069 *) endgrent_r_proto=0
12073 : see if endhostent exists
12074 set endhostent d_endhent
12077 : see if this is a netdb.h system
12078 set netdb.h i_netdb
12081 : see if endhostent_r exists
12082 set endhostent_r d_endhostent_r
12084 case "$d_endhostent_r" in
12086 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12087 case "$d_endhostent_r_proto:$usethreads" in
12088 ":define") d_endhostent_r_proto=define
12089 set d_endhostent_r_proto endhostent_r $hdrs
12093 case "$d_endhostent_r_proto" in
12095 case "$endhostent_r_proto" in
12096 ''|0) try='int endhostent_r(struct hostent_data*);'
12097 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=I_D ;;
12099 case "$endhostent_r_proto" in
12100 ''|0) try='void endhostent_r(struct hostent_data*);'
12101 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=V_D ;;
12103 case "$endhostent_r_proto" in
12104 ''|0) d_endhostent_r=undef
12105 endhostent_r_proto=0
12106 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
12107 * ) case "$endhostent_r_proto" in
12108 REENTRANT_PROTO*) ;;
12109 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
12111 echo "Prototype: $try" ;;
12114 *) case "$usethreads" in
12115 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
12117 d_endhostent_r=undef
12118 endhostent_r_proto=0
12122 *) endhostent_r_proto=0
12126 : see if endnetent exists
12127 set endnetent d_endnent
12130 : see if endnetent_r exists
12131 set endnetent_r d_endnetent_r
12133 case "$d_endnetent_r" in
12135 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12136 case "$d_endnetent_r_proto:$usethreads" in
12137 ":define") d_endnetent_r_proto=define
12138 set d_endnetent_r_proto endnetent_r $hdrs
12142 case "$d_endnetent_r_proto" in
12144 case "$endnetent_r_proto" in
12145 ''|0) try='int endnetent_r(struct netent_data*);'
12146 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=I_D ;;
12148 case "$endnetent_r_proto" in
12149 ''|0) try='void endnetent_r(struct netent_data*);'
12150 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=V_D ;;
12152 case "$endnetent_r_proto" in
12153 ''|0) d_endnetent_r=undef
12154 endnetent_r_proto=0
12155 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
12156 * ) case "$endnetent_r_proto" in
12157 REENTRANT_PROTO*) ;;
12158 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
12160 echo "Prototype: $try" ;;
12163 *) case "$usethreads" in
12164 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
12166 d_endnetent_r=undef
12167 endnetent_r_proto=0
12171 *) endnetent_r_proto=0
12175 : see if endprotoent exists
12176 set endprotoent d_endpent
12179 : see if endprotoent_r exists
12180 set endprotoent_r d_endprotoent_r
12182 case "$d_endprotoent_r" in
12184 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12185 case "$d_endprotoent_r_proto:$usethreads" in
12186 ":define") d_endprotoent_r_proto=define
12187 set d_endprotoent_r_proto endprotoent_r $hdrs
12191 case "$d_endprotoent_r_proto" in
12193 case "$endprotoent_r_proto" in
12194 ''|0) try='int endprotoent_r(struct protoent_data*);'
12195 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=I_D ;;
12197 case "$endprotoent_r_proto" in
12198 ''|0) try='void endprotoent_r(struct protoent_data*);'
12199 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=V_D ;;
12201 case "$endprotoent_r_proto" in
12202 ''|0) d_endprotoent_r=undef
12203 endprotoent_r_proto=0
12204 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
12205 * ) case "$endprotoent_r_proto" in
12206 REENTRANT_PROTO*) ;;
12207 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
12209 echo "Prototype: $try" ;;
12212 *) case "$usethreads" in
12213 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
12215 d_endprotoent_r=undef
12216 endprotoent_r_proto=0
12220 *) endprotoent_r_proto=0
12224 : see if endpwent exists
12225 set endpwent d_endpwent
12228 : see if this is a pwd.h system
12234 xxx=`./findhdr pwd.h`
12235 $cppstdin $cppflags $cppminus < $xxx >$$.h
12237 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
12245 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
12253 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
12261 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
12269 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
12277 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
12285 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
12293 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
12305 set d_pwquota; eval $setvar
12306 set d_pwage; eval $setvar
12307 set d_pwchange; eval $setvar
12308 set d_pwclass; eval $setvar
12309 set d_pwexpire; eval $setvar
12310 set d_pwcomment; eval $setvar
12311 set d_pwgecos; eval $setvar
12312 set d_pwpasswd; eval $setvar
12316 : see if endpwent_r exists
12317 set endpwent_r d_endpwent_r
12319 case "$d_endpwent_r" in
12321 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
12322 case "$d_endpwent_r_proto:$usethreads" in
12323 ":define") d_endpwent_r_proto=define
12324 set d_endpwent_r_proto endpwent_r $hdrs
12328 case "$d_endpwent_r_proto" in
12330 case "$endpwent_r_proto" in
12331 ''|0) try='int endpwent_r(FILE**);'
12332 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=I_H ;;
12334 case "$endpwent_r_proto" in
12335 ''|0) try='void endpwent_r(FILE**);'
12336 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=V_H ;;
12338 case "$endpwent_r_proto" in
12339 ''|0) d_endpwent_r=undef
12341 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
12342 * ) case "$endpwent_r_proto" in
12343 REENTRANT_PROTO*) ;;
12344 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
12346 echo "Prototype: $try" ;;
12349 *) case "$usethreads" in
12350 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
12357 *) endpwent_r_proto=0
12361 : see if endservent exists
12362 set endservent d_endsent
12365 : see if endservent_r exists
12366 set endservent_r d_endservent_r
12368 case "$d_endservent_r" in
12370 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12371 case "$d_endservent_r_proto:$usethreads" in
12372 ":define") d_endservent_r_proto=define
12373 set d_endservent_r_proto endservent_r $hdrs
12377 case "$d_endservent_r_proto" in
12379 case "$endservent_r_proto" in
12380 ''|0) try='int endservent_r(struct servent_data*);'
12381 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=I_D ;;
12383 case "$endservent_r_proto" in
12384 ''|0) try='void endservent_r(struct servent_data*);'
12385 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=V_D ;;
12387 case "$endservent_r_proto" in
12388 ''|0) d_endservent_r=undef
12389 endservent_r_proto=0
12390 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
12391 * ) case "$endservent_r_proto" in
12392 REENTRANT_PROTO*) ;;
12393 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
12395 echo "Prototype: $try" ;;
12398 *) case "$usethreads" in
12399 define) echo "endservent_r has no prototype, not using it." >&4 ;;
12401 d_endservent_r=undef
12402 endservent_r_proto=0
12406 *) endservent_r_proto=0
12410 : Locate the flags for 'open()'
12413 #include <sys/types.h>
12418 #include <sys/file.h>
12420 #$i_stdlib I_STDLIB
12422 #include <stdlib.h>
12433 : check sys/file.h first to get FREAD on Sun
12434 if $test `./findhdr sys/file.h` && \
12435 set try -DI_SYS_FILE && eval $compile; then
12437 echo "<sys/file.h> defines the O_* constants..." >&4
12438 if $run ./try; then
12439 echo "and you have the 3 argument form of open()." >&4
12442 echo "but not the 3 argument form of open(). Oh, well." >&4
12445 elif $test `./findhdr fcntl.h` && \
12446 set try -DI_FCNTL && eval $compile; then
12448 echo "<fcntl.h> defines the O_* constants..." >&4
12449 if $run ./try; then
12450 echo "and you have the 3 argument form of open()." >&4
12453 echo "but not the 3 argument form of open(). Oh, well." >&4
12458 echo "I can't find the O_* constant definitions! You got problems." >&4
12464 : see if this is a sys/file.h system
12469 : do we need to include sys/file.h ?
12473 if $h_sysfile; then
12475 echo "We'll be including <sys/file.h>." >&4
12478 echo "We won't be including <sys/file.h>." >&4
12488 : see if fcntl.h is there
12493 : see if we can include fcntl.h
12499 echo "We'll be including <fcntl.h>." >&4
12502 if $h_sysfile; then
12503 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
12505 echo "We won't be including <fcntl.h>." >&4
12517 : see if fork exists
12521 : see if pipe exists
12525 : check for non-blocking I/O stuff
12526 case "$h_sysfile" in
12527 true) echo "#include <sys/file.h>" > head.c;;
12530 true) echo "#include <fcntl.h>" > head.c;;
12531 *) echo "#include <sys/fcntl.h>" > head.c;;
12536 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
12537 case "$o_nonblock" in
12539 $cat head.c > try.c
12540 $cat >>try.c <<EOCP
12542 #$i_stdlib I_STDLIB
12544 #include <stdlib.h>
12552 printf("O_NONBLOCK\n");
12556 printf("O_NDELAY\n");
12560 printf("FNDELAY\n");
12567 if eval $compile_ok; then
12568 o_nonblock=`$run ./try`
12569 case "$o_nonblock" in
12570 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
12571 *) echo "Seems like we can use $o_nonblock.";;
12574 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
12577 *) echo "Using $hint value $o_nonblock.";;
12582 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
12585 case "$d_fork:$d_pipe" in
12587 $cat head.c > try.c
12588 $cat >>try.c <<EOCP
12590 #include <sys/types.h>
12591 #include <signal.h>
12593 #$i_stdlib I_STDLIB
12595 #include <stdlib.h>
12601 #define MY_O_NONBLOCK $o_nonblock
12602 #ifndef errno /* XXX need better Configure test */
12605 #$i_unistd I_UNISTD
12607 #include <unistd.h>
12609 #$i_string I_STRING
12611 #include <string.h>
12613 #include <strings.h>
12615 $signal_t blech(int x) { exit(3); }
12617 $cat >> try.c <<'EOCP'
12625 pipe(pd); /* Down: child -> parent */
12626 pipe(pu); /* Up: parent -> child */
12629 close(pd[1]); /* Parent reads from pd[0] */
12630 close(pu[0]); /* Parent writes (blocking) to pu[1] */
12632 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
12637 signal(SIGALRM, blech);
12639 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
12641 sprintf(string, "%d\n", ret);
12642 write(2, string, strlen(string));
12645 if (errno == EAGAIN) {
12646 printf("EAGAIN\n");
12651 if (errno == EWOULDBLOCK)
12652 printf("EWOULDBLOCK\n");
12655 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
12656 sleep(2); /* Give it time to close our pipe */
12658 ret = read(pd[0], buf, 1); /* Should read EOF */
12660 sprintf(string, "%d\n", ret);
12661 write(4, string, strlen(string));
12665 close(pd[0]); /* We write to pd[1] */
12666 close(pu[1]); /* We read from pu[0] */
12667 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
12668 close(pd[1]); /* Pipe pd is now fully closed! */
12669 exit(0); /* Bye bye, thank you for playing! */
12673 if eval $compile_ok; then
12674 echo "$startsh" >mtry
12675 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
12677 ./mtry >/dev/null 2>&1
12679 0) eagain=`$cat try.out`;;
12680 1) echo "Could not perform non-blocking setting!";;
12681 2) echo "I did a successful read() for something that was not there!";;
12682 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
12683 4) echo "Could not find F_SETFL!";;
12684 *) echo "Something terribly wrong happened during testing.";;
12686 rd_nodata=`$cat try.ret`
12687 echo "A read() system call with no data present returns $rd_nodata."
12688 case "$rd_nodata" in
12691 echo "(That's peculiar, fixing that to be -1.)"
12697 echo "Forcing errno EAGAIN on read() with no data available."
12701 echo "Your read() sets errno to $eagain when no data is available."
12704 status=`$cat try.err`
12706 0) echo "And it correctly returns 0 to signal EOF.";;
12707 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
12708 *) echo "However, your read() returns '$status' on EOF??";;
12711 if test "$status" = "$rd_nodata"; then
12712 echo "WARNING: you can't distinguish between EOF and no data!"
12716 echo "I can't compile the test program--assuming errno EAGAIN will do."
12720 *) echo "Can't figure out how to test this--assuming errno EAGAIN will do."
12729 echo "Using $hint value $eagain."
12730 echo "Your read() returns $rd_nodata when no data is present."
12731 case "$d_eofnblk" in
12732 "$define") echo "And you can see EOF because read() returns 0.";;
12733 "$undef") echo "But you can't see EOF status from read() returned value.";;
12735 echo "(Assuming you can't see EOF status from read anyway.)"
12741 $rm_try head.c mtry
12743 : see if _ptr and _cnt from stdio act std
12746 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
12747 echo "(Looks like you have stdio.h from BSD.)"
12748 case "$stdio_ptr" in
12749 '') stdio_ptr='((fp)->_p)'
12752 *) ptr_lval=$d_stdio_ptr_lval;;
12754 case "$stdio_cnt" in
12755 '') stdio_cnt='((fp)->_r)'
12758 *) cnt_lval=$d_stdio_cnt_lval;;
12760 case "$stdio_base" in
12761 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
12763 case "$stdio_bufsiz" in
12764 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
12766 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
12767 echo "(Looks like you have stdio.h from Linux.)"
12768 case "$stdio_ptr" in
12769 '') stdio_ptr='((fp)->_IO_read_ptr)'
12772 *) ptr_lval=$d_stdio_ptr_lval;;
12774 case "$stdio_cnt" in
12775 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
12778 *) cnt_lval=$d_stdio_cnt_lval;;
12780 case "$stdio_base" in
12781 '') stdio_base='((fp)->_IO_read_base)';;
12783 case "$stdio_bufsiz" in
12784 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
12787 case "$stdio_ptr" in
12788 '') stdio_ptr='((fp)->_ptr)'
12791 *) ptr_lval=$d_stdio_ptr_lval;;
12793 case "$stdio_cnt" in
12794 '') stdio_cnt='((fp)->_cnt)'
12797 *) cnt_lval=$d_stdio_cnt_lval;;
12799 case "$stdio_base" in
12800 '') stdio_base='((fp)->_base)';;
12802 case "$stdio_bufsiz" in
12803 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
12807 : test whether _ptr and _cnt really work
12808 echo "Checking how std your stdio is..." >&4
12811 #$i_stdlib I_STDLIB
12813 #include <stdlib.h>
12815 #define FILE_ptr(fp) $stdio_ptr
12816 #define FILE_cnt(fp) $stdio_cnt
12818 FILE *fp = fopen("try.c", "r");
12821 18 <= FILE_cnt(fp) &&
12822 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12830 if eval $compile && $to try.c; then
12831 if $run ./try; then
12832 echo "Your stdio acts pretty std."
12835 echo "Your stdio isn't very std."
12838 echo "Your stdio doesn't appear very std."
12842 # glibc 2.2.90 and above apparently change stdio streams so Perl's
12843 # direct buffer manipulation no longer works. The Configure tests
12844 # should be changed to correctly detect this, but until then,
12845 # the following check should at least let perl compile and run.
12846 # (This quick fix should be updated before 5.8.1.)
12847 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
12848 # A. Dougherty, June 3, 2002.
12849 case "$d_gnulibc" in
12851 case "$gnulibc_version" in
12855 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
12864 : Can _ptr be used as an lvalue?
12865 case "$d_stdstdio$ptr_lval" in
12866 $define$define) val=$define ;;
12869 set d_stdio_ptr_lval
12872 : Can _cnt be used as an lvalue?
12873 case "$d_stdstdio$cnt_lval" in
12874 $define$define) val=$define ;;
12877 set d_stdio_cnt_lval
12881 : test whether setting _ptr sets _cnt as a side effect
12882 d_stdio_ptr_lval_sets_cnt="$undef"
12883 d_stdio_ptr_lval_nochange_cnt="$undef"
12884 case "$d_stdio_ptr_lval$d_stdstdio" in
12886 echo "Checking to see what happens if we set the stdio ptr..." >&4
12889 /* Can we scream? */
12890 /* Eat dust sed :-) */
12891 /* In the buffer space, no one can hear you scream. */
12892 #$i_stdlib I_STDLIB
12894 #include <stdlib.h>
12896 #define FILE_ptr(fp) $stdio_ptr
12897 #define FILE_cnt(fp) $stdio_cnt
12898 #include <sys/types.h>
12900 FILE *fp = fopen("try.c", "r");
12905 puts("Fail even to read");
12908 c = getc(fp); /* Read away the first # */
12910 puts("Fail even to read");
12914 18 <= FILE_cnt(fp) &&
12915 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12917 puts("Fail even to read");
12920 ptr = (char*) FILE_ptr(fp);
12921 cnt = (size_t)FILE_cnt(fp);
12923 FILE_ptr(fp) += 42;
12925 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
12926 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
12929 if (FILE_cnt(fp) <= 20) {
12930 printf ("Fail (<20 chars to test)");
12933 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
12934 puts("Fail compare");
12937 if (cnt == FILE_cnt(fp)) {
12938 puts("Pass_unchanged");
12941 if (FILE_cnt(fp) == (cnt - 42)) {
12942 puts("Pass_changed");
12945 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
12951 if eval $compile && $to try.c; then
12952 case `$run ./try` in
12954 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
12955 d_stdio_ptr_lval_sets_cnt="$define" ;;
12957 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
12958 d_stdio_ptr_lval_nochange_cnt="$define" ;;
12960 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
12962 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
12965 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
12971 : see if _base is also standard
12973 case "$d_stdstdio" in
12977 #$i_stdlib I_STDLIB
12979 #include <stdlib.h>
12981 #define FILE_base(fp) $stdio_base
12982 #define FILE_bufsiz(fp) $stdio_bufsiz
12984 FILE *fp = fopen("try.c", "r");
12987 19 <= FILE_bufsiz(fp) &&
12988 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
12995 if eval $compile && $to try.c; then
12996 if $run ./try; then
12997 echo "And its _base field acts std."
13000 echo "But its _base field isn't std."
13003 echo "However, it seems to be lacking the _base field."
13011 : see if fast_stdio exists
13013 case "$d_stdstdio:$d_stdio_ptr_lval" in
13015 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
13017 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
13028 : see if fchdir exists
13029 set fchdir d_fchdir
13032 : see if fchmod exists
13033 set fchmod d_fchmod
13036 : see if fchown exists
13037 set fchown d_fchown
13040 : see if this is an fcntl system
13044 : See if fcntl-based locking works.
13047 #$i_stdlib I_STDLIB
13049 #include <stdlib.h>
13051 #include <unistd.h>
13053 #include <signal.h>
13054 $signal_t blech(int x) { exit(3); }
13056 #if defined(F_SETLK) && defined(F_SETLKW)
13057 struct flock flock;
13059 fd = open("try.c", O_RDONLY);
13060 flock.l_type = F_RDLCK;
13061 flock.l_whence = SEEK_SET;
13062 flock.l_start = flock.l_len = 0;
13063 signal(SIGALRM, blech);
13065 retval = fcntl(fd, F_SETLK, &flock);
13067 (retval < 0 ? exit(2) : exit(0));
13073 echo "Checking if fcntl-based file locking works... "
13077 if eval $compile_ok; then
13078 if $run ./try; then
13079 echo "Yes, it seems to work."
13082 echo "Nope, it didn't work."
13087 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
13088 *** This is (almost) impossible.
13089 *** If your NFS lock daemons are not feeling well, something like
13090 *** this may happen, please investigate. Cannot continue, aborting.
13098 echo "I'm unable to compile the test program, so I'll assume not."
13103 echo "Nope, since you don't even have fcntl()."
13106 set d_fcntl_can_lock
13110 : check for fd_set items
13113 Checking to see how well your C compiler handles fd_set and friends ...
13116 #$i_stdlib I_STDLIB
13118 #include <stdlib.h>
13120 #$i_systime I_SYS_TIME
13121 #$i_sysselct I_SYS_SELECT
13122 #$d_socket HAS_SOCKET
13123 #include <sys/types.h>
13125 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
13128 #include <sys/time.h>
13130 #ifdef I_SYS_SELECT
13131 #include <sys/select.h>
13140 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
13148 if eval $compile; then
13149 d_fds_bits="$define"
13151 echo "Well, your system knows about the normal fd_set typedef..." >&4
13152 if $run ./try; then
13153 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
13154 d_fd_macros="$define"
13157 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
13159 d_fd_macros="$undef"
13163 Hmm, your compiler has some difficulty with fd_set. Checking further...
13166 if eval $compile; then
13167 d_fds_bits="$undef"
13169 echo "Well, your system has some sort of fd_set available..." >&4
13170 if $run ./try; then
13171 echo "and you have the normal fd_set macros." >&4
13172 d_fd_macros="$define"
13175 but not the normal fd_set macros! Gross! More work for me...
13177 d_fd_macros="$undef"
13180 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
13182 d_fds_bits="$undef"
13183 d_fd_macros="$undef"
13188 : see if fgetpos exists
13189 set fgetpos d_fgetpos
13192 : see if finite exists
13193 set finite d_finite
13196 : see if finitel exists
13197 set finitel d_finitel
13200 : see if flock exists
13204 : see if prototype for flock is available
13206 set d_flockproto flock $i_sysfile sys/file.h
13209 : see if fp_class exists
13210 set fp_class d_fp_class
13213 : see if pathconf exists
13214 set pathconf d_pathconf
13217 : see if fpathconf exists
13218 set fpathconf d_fpathconf
13221 : see if fpclass exists
13222 set fpclass d_fpclass
13225 : see if fpclassify exists
13226 set fpclassify d_fpclassify
13229 : see if fpclassl exists
13230 set fpclassl d_fpclassl
13233 : check for fpos64_t
13235 echo "Checking to see if you have fpos64_t..." >&4
13238 int main() { fpos64_t x = 7; }
13241 if eval $compile; then
13243 echo "You have fpos64_t."
13246 echo "You do not have fpos64_t."
13247 case "$fpossize" in
13248 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
13255 : see if frexpl exists
13256 set frexpl d_frexpl
13259 : see if this is a sys/param system
13260 set sys/param.h i_sysparam
13263 : see if this is a sys/mount.h system
13264 set sys/mount.h i_sysmount
13267 : Check for fs_data_s
13269 echo "Checking to see if your system supports struct fs_data..." >&4
13270 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
13272 case "$d_fs_data_s" in
13273 "$define") echo "Yes, it does." ;;
13274 *) echo "No, it doesn't." ;;
13277 : see if fseeko exists
13278 set fseeko d_fseeko
13280 case "$longsize" in
13281 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
13284 : see if fsetpos exists
13285 set fsetpos d_fsetpos
13288 : see if fstatfs exists
13289 set fstatfs d_fstatfs
13292 : see if statvfs exists
13293 set statvfs d_statvfs
13296 : see if fstatvfs exists
13297 set fstatvfs d_fstatvfs
13301 : see if fsync exists
13305 : see if ftello exists
13306 set ftello d_ftello
13308 case "$longsize" in
13309 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
13312 : check for a working futimes
13315 echo "Checking if you have a working futimes()" >&4
13318 #include <sys/time.h>
13325 fd = open ("try.c", O_RDWR);
13326 if (-1 == fd) exit (1);
13327 rv = futimes (fd, NULL);
13328 exit (rv == -1 ? errno : 0);
13332 if eval $compile; then
13336 0) echo "Yes, you have" >&4
13337 d_futimes="$define"
13339 *) echo "No, you have futimes, but it isn't working ($rc) (probably harmless)" >&4
13343 echo "No, it does not (probably harmless)" >&4
13347 : see if ndbm.h is available
13350 : Compatibility location for RedHat 7.1
13351 set gdbm/ndbm.h i_gdbmndbm
13353 : Compatibility location for Debian 4.0
13354 set gdbm-ndbm.h i_gdbm_ndbm
13358 if $test "$i_ndbm" = "$define" -o "$i_gdbmndbm" = "$define" -o "$i_gdbm_ndbm" = "$define"; then
13359 : see if dbm_open exists
13360 set dbm_open d_dbm_open
13362 case "$d_dbm_open" in
13365 i_gdbmndbm="$undef"
13366 i_gdbm_ndbm="$undef"
13367 echo "We won't be including <ndbm.h>"
13377 ndbm_hdr_protochk='name=$1; hdr=$2;
13378 eval "ihdr=\$""i_$name";
13380 if $test "$ihdr" = "$define"; then
13381 $echo "Checking if your <$hdr> uses prototypes..." >&4;
13382 case "$d_cplusplus" in
13383 $define) ./protochk "$extern_C void dbm_close(DBM *);" literal "extern \"C\" {" $ihdr $hdr literal "}" && val="$define" ;;
13384 *) ./protochk "$extern_C void dbm_close(int, int);" $ihdr $hdr || val="$define" ;;
13387 $define) $echo "Your <$hdr> seems to have prototypes";;
13388 *) $echo "Your <$hdr> does not seem to have prototypes";;
13391 set "d_${name}_h_uses_prototypes";
13395 eval $ndbm_hdr_protochk
13396 set gdbmndbm gdbm/ndbm.h
13397 eval $ndbm_hdr_protochk
13398 set gdbm_ndbm gdbm-ndbm.h
13399 eval $ndbm_hdr_protochk
13401 : see if getaddrinfo exists
13402 set getaddrinfo d_getaddrinfo
13405 : see if getcwd exists
13406 set getcwd d_getcwd
13409 : see if getespwnam exists
13410 set getespwnam d_getespwnam
13413 : see if getfsstat exists
13414 set getfsstat d_getfsstat
13417 : see if getgrent exists
13418 set getgrent d_getgrent
13421 : see if getgrent_r exists
13422 set getgrent_r d_getgrent_r
13424 case "$d_getgrent_r" in
13426 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13427 case "$d_getgrent_r_proto:$usethreads" in
13428 ":define") d_getgrent_r_proto=define
13429 set d_getgrent_r_proto getgrent_r $hdrs
13433 case "$d_getgrent_r_proto" in
13435 case "$getgrent_r_proto" in
13436 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
13437 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBWR ;;
13439 case "$getgrent_r_proto" in
13440 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
13441 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIR ;;
13443 case "$getgrent_r_proto" in
13444 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
13445 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBW ;;
13447 case "$getgrent_r_proto" in
13448 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
13449 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBI ;;
13451 case "$getgrent_r_proto" in
13452 ''|0) try='int getgrent_r(struct group*, char*, int);'
13453 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBI ;;
13455 case "$getgrent_r_proto" in
13456 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
13457 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIH ;;
13459 case "$getgrent_r_proto" in
13460 ''|0) d_getgrent_r=undef
13462 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
13463 * ) case "$getgrent_r_proto" in
13464 REENTRANT_PROTO*) ;;
13465 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
13467 echo "Prototype: $try" ;;
13470 *) case "$usethreads" in
13471 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
13478 *) getgrent_r_proto=0
13482 : see if getgrgid_r exists
13483 set getgrgid_r d_getgrgid_r
13485 case "$d_getgrgid_r" in
13487 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13488 case "$d_getgrgid_r_proto:$usethreads" in
13489 ":define") d_getgrgid_r_proto=define
13490 set d_getgrgid_r_proto getgrgid_r $hdrs
13494 case "$d_getgrgid_r_proto" in
13496 case "$getgrgid_r_proto" in
13497 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
13498 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
13500 case "$getgrgid_r_proto" in
13501 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
13502 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
13504 case "$getgrgid_r_proto" in
13505 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
13506 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
13508 case "$getgrgid_r_proto" in
13509 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
13510 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
13512 case "$getgrgid_r_proto" in
13513 ''|0) d_getgrgid_r=undef
13515 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
13516 * ) case "$getgrgid_r_proto" in
13517 REENTRANT_PROTO*) ;;
13518 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
13520 echo "Prototype: $try" ;;
13523 *) case "$usethreads" in
13524 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
13531 *) getgrgid_r_proto=0
13535 : see if getgrnam_r exists
13536 set getgrnam_r d_getgrnam_r
13538 case "$d_getgrnam_r" in
13540 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13541 case "$d_getgrnam_r_proto:$usethreads" in
13542 ":define") d_getgrnam_r_proto=define
13543 set d_getgrnam_r_proto getgrnam_r $hdrs
13547 case "$d_getgrnam_r_proto" in
13549 case "$getgrnam_r_proto" in
13550 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
13551 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
13553 case "$getgrnam_r_proto" in
13554 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
13555 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
13557 case "$getgrnam_r_proto" in
13558 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
13559 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CBI ;;
13561 case "$getgrnam_r_proto" in
13562 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
13563 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
13565 case "$getgrnam_r_proto" in
13566 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
13567 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
13569 case "$getgrnam_r_proto" in
13570 ''|0) d_getgrnam_r=undef
13572 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
13573 * ) case "$getgrnam_r_proto" in
13574 REENTRANT_PROTO*) ;;
13575 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
13577 echo "Prototype: $try" ;;
13580 *) case "$usethreads" in
13581 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
13588 *) getgrnam_r_proto=0
13592 : see if gethostbyaddr exists
13593 set gethostbyaddr d_gethbyaddr
13596 : see if gethostbyname exists
13597 set gethostbyname d_gethbyname
13600 : see if gethostent exists
13601 set gethostent d_gethent
13604 : see how we will look up host name
13607 if set gethostname val -f d_gethname; eval $csym; $val; then
13608 echo 'gethostname() found.' >&4
13609 d_gethname="$define"
13612 if set uname val -f d_uname; eval $csym; $val; then
13615 uname() was found, but you're running xenix, and older versions of xenix
13616 have a broken uname(). If you don't really know whether your xenix is old
13617 enough to have a broken system call, use the default answer.
13622 "$define") dflt=n;;
13624 rp='Is your uname() broken?'
13627 n*) d_uname="$define"; call=uname;;
13630 echo 'uname() found.' >&4
13637 case "$d_gethname" in
13638 '') d_gethname="$undef";;
13641 '') d_uname="$undef";;
13643 case "$d_uname$d_gethname" in
13648 Every now and then someone has a $call() that lies about the hostname
13649 but can't be fixed for political or economic reasons. If you wish, I can
13650 pretend $call() isn't there and maybe compute hostname at run-time
13651 thanks to the '$phostname' command.
13654 rp="Shall I ignore $call() from now on?"
13657 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
13660 case "$phostname" in
13661 '') aphostname='';;
13662 *) case "$aphostname" in
13664 *) set X $phostname
13668 file=`./loc $file $file $pth`
13669 aphostname=`echo $file $*`
13674 case "$d_uname$d_gethname" in
13677 case "$phostname" in
13679 echo "There will be no way for $package to get your hostname." >&4;;
13681 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
13685 case "$d_phostname" in
13686 '') d_phostname="$undef";;
13689 : see if gethostbyaddr_r exists
13690 set gethostbyaddr_r d_gethostbyaddr_r
13692 case "$d_gethostbyaddr_r" in
13694 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13695 case "$d_gethostbyaddr_r_proto:$usethreads" in
13696 ":define") d_gethostbyaddr_r_proto=define
13697 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
13701 case "$d_gethostbyaddr_r_proto" in
13703 case "$gethostbyaddr_r_proto" in
13704 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13705 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
13707 case "$gethostbyaddr_r_proto" in
13708 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
13709 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
13711 case "$gethostbyaddr_r_proto" in
13712 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
13713 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
13715 case "$gethostbyaddr_r_proto" in
13716 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
13717 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
13719 case "$gethostbyaddr_r_proto" in
13720 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
13721 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
13723 case "$gethostbyaddr_r_proto" in
13724 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
13725 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
13727 case "$gethostbyaddr_r_proto" in
13728 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
13729 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
13731 case "$gethostbyaddr_r_proto" in
13732 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
13733 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
13735 case "$gethostbyaddr_r_proto" in
13736 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
13737 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
13739 case "$gethostbyaddr_r_proto" in
13740 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
13741 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
13743 case "$gethostbyaddr_r_proto" in
13744 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13745 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
13747 case "$gethostbyaddr_r_proto" in
13748 ''|0) d_gethostbyaddr_r=undef
13749 gethostbyaddr_r_proto=0
13750 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
13751 * ) case "$gethostbyaddr_r_proto" in
13752 REENTRANT_PROTO*) ;;
13753 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
13755 echo "Prototype: $try" ;;
13758 *) case "$usethreads" in
13759 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
13761 d_gethostbyaddr_r=undef
13762 gethostbyaddr_r_proto=0
13766 *) gethostbyaddr_r_proto=0
13770 : see if gethostbyname_r exists
13771 set gethostbyname_r d_gethostbyname_r
13773 case "$d_gethostbyname_r" in
13775 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13776 case "$d_gethostbyname_r_proto:$usethreads" in
13777 ":define") d_gethostbyname_r_proto=define
13778 set d_gethostbyname_r_proto gethostbyname_r $hdrs
13782 case "$d_gethostbyname_r_proto" in
13784 case "$gethostbyname_r_proto" in
13785 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
13786 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
13788 case "$gethostbyname_r_proto" in
13789 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
13790 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
13792 case "$gethostbyname_r_proto" in
13793 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
13794 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
13796 case "$gethostbyname_r_proto" in
13797 ''|0) d_gethostbyname_r=undef
13798 gethostbyname_r_proto=0
13799 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
13800 * ) case "$gethostbyname_r_proto" in
13801 REENTRANT_PROTO*) ;;
13802 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
13804 echo "Prototype: $try" ;;
13807 *) case "$usethreads" in
13808 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
13810 d_gethostbyname_r=undef
13811 gethostbyname_r_proto=0
13815 *) gethostbyname_r_proto=0
13819 : see if gethostent_r exists
13820 set gethostent_r d_gethostent_r
13822 case "$d_gethostent_r" in
13824 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13825 case "$d_gethostent_r_proto:$usethreads" in
13826 ":define") d_gethostent_r_proto=define
13827 set d_gethostent_r_proto gethostent_r $hdrs
13831 case "$d_gethostent_r_proto" in
13833 case "$gethostent_r_proto" in
13834 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
13835 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
13837 case "$gethostent_r_proto" in
13838 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
13839 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBIE ;;
13841 case "$gethostent_r_proto" in
13842 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
13843 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBIE ;;
13845 case "$gethostent_r_proto" in
13846 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
13847 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBI ;;
13849 case "$gethostent_r_proto" in
13850 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
13851 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBI ;;
13853 case "$gethostent_r_proto" in
13854 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
13855 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SD ;;
13857 case "$gethostent_r_proto" in
13858 ''|0) d_gethostent_r=undef
13859 gethostent_r_proto=0
13860 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
13861 * ) case "$gethostent_r_proto" in
13862 REENTRANT_PROTO*) ;;
13863 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
13865 echo "Prototype: $try" ;;
13868 *) case "$usethreads" in
13869 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
13871 d_gethostent_r=undef
13872 gethostent_r_proto=0
13876 *) gethostent_r_proto=0
13880 : see if prototypes for various gethostxxx netdb.h functions are available
13882 set d_gethostprotos gethostent $i_netdb netdb.h
13885 : see if getitimer exists
13886 set getitimer d_getitimer
13889 : see if getlogin exists
13890 set getlogin d_getlogin
13893 : see if getlogin_r exists
13894 set getlogin_r d_getlogin_r
13896 case "$d_getlogin_r" in
13898 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
13899 case "$d_getlogin_r_proto:$usethreads" in
13900 ":define") d_getlogin_r_proto=define
13901 set d_getlogin_r_proto getlogin_r $hdrs
13905 case "$d_getlogin_r_proto" in
13907 case "$getlogin_r_proto" in
13908 ''|0) try='int getlogin_r(char*, size_t);'
13909 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BW ;;
13911 case "$getlogin_r_proto" in
13912 ''|0) try='int getlogin_r(char*, int);'
13913 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BI ;;
13915 case "$getlogin_r_proto" in
13916 ''|0) try='char* getlogin_r(char*, size_t);'
13917 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BW ;;
13919 case "$getlogin_r_proto" in
13920 ''|0) try='char* getlogin_r(char*, int);'
13921 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BI ;;
13923 case "$getlogin_r_proto" in
13924 ''|0) d_getlogin_r=undef
13926 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
13927 * ) case "$getlogin_r_proto" in
13928 REENTRANT_PROTO*) ;;
13929 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
13931 echo "Prototype: $try" ;;
13934 *) case "$usethreads" in
13935 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
13942 *) getlogin_r_proto=0
13946 : see if getmnt exists
13947 set getmnt d_getmnt
13950 : see if getmntent exists
13951 set getmntent d_getmntent
13954 : see if getnameinfo exists
13955 set getnameinfo d_getnameinfo
13958 : see if getnetbyaddr exists
13959 set getnetbyaddr d_getnbyaddr
13962 : see if getnetbyname exists
13963 set getnetbyname d_getnbyname
13966 : see if getnetent exists
13967 set getnetent d_getnent
13970 : see if getnetbyaddr_r exists
13971 set getnetbyaddr_r d_getnetbyaddr_r
13973 case "$d_getnetbyaddr_r" in
13975 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13976 case "$d_getnetbyaddr_r_proto:$usethreads" in
13977 ":define") d_getnetbyaddr_r_proto=define
13978 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
13982 case "$d_getnetbyaddr_r_proto" in
13984 case "$getnetbyaddr_r_proto" in
13985 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
13986 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
13988 case "$getnetbyaddr_r_proto" in
13989 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
13990 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
13992 case "$getnetbyaddr_r_proto" in
13993 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
13994 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
13996 case "$getnetbyaddr_r_proto" in
13997 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
13998 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
14000 case "$getnetbyaddr_r_proto" in
14001 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
14002 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
14004 case "$getnetbyaddr_r_proto" in
14005 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
14006 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
14008 case "$getnetbyaddr_r_proto" in
14009 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
14010 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
14012 case "$getnetbyaddr_r_proto" in
14013 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
14014 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
14016 case "$getnetbyaddr_r_proto" in
14017 ''|0) d_getnetbyaddr_r=undef
14018 getnetbyaddr_r_proto=0
14019 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
14020 * ) case "$getnetbyaddr_r_proto" in
14021 REENTRANT_PROTO*) ;;
14022 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
14024 echo "Prototype: $try" ;;
14027 *) case "$usethreads" in
14028 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
14030 d_getnetbyaddr_r=undef
14031 getnetbyaddr_r_proto=0
14035 *) getnetbyaddr_r_proto=0
14039 : see if getnetbyname_r exists
14040 set getnetbyname_r d_getnetbyname_r
14042 case "$d_getnetbyname_r" in
14044 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14045 case "$d_getnetbyname_r_proto:$usethreads" in
14046 ":define") d_getnetbyname_r_proto=define
14047 set d_getnetbyname_r_proto getnetbyname_r $hdrs
14051 case "$d_getnetbyname_r_proto" in
14053 case "$getnetbyname_r_proto" in
14054 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
14055 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
14057 case "$getnetbyname_r_proto" in
14058 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
14059 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
14061 case "$getnetbyname_r_proto" in
14062 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
14063 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
14065 case "$getnetbyname_r_proto" in
14066 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
14067 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
14069 case "$getnetbyname_r_proto" in
14070 ''|0) d_getnetbyname_r=undef
14071 getnetbyname_r_proto=0
14072 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
14073 * ) case "$getnetbyname_r_proto" in
14074 REENTRANT_PROTO*) ;;
14075 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
14077 echo "Prototype: $try" ;;
14080 *) case "$usethreads" in
14081 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
14083 d_getnetbyname_r=undef
14084 getnetbyname_r_proto=0
14088 *) getnetbyname_r_proto=0
14092 : see if getnetent_r exists
14093 set getnetent_r d_getnetent_r
14095 case "$d_getnetent_r" in
14097 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14098 case "$d_getnetent_r_proto:$usethreads" in
14099 ":define") d_getnetent_r_proto=define
14100 set d_getnetent_r_proto getnetent_r $hdrs
14104 case "$d_getnetent_r_proto" in
14106 case "$getnetent_r_proto" in
14107 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
14108 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
14110 case "$getnetent_r_proto" in
14111 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
14112 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBIE ;;
14114 case "$getnetent_r_proto" in
14115 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
14116 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBIE ;;
14118 case "$getnetent_r_proto" in
14119 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
14120 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBI ;;
14122 case "$getnetent_r_proto" in
14123 ''|0) try='int getnetent_r(struct netent*, char*, int);'
14124 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBI ;;
14126 case "$getnetent_r_proto" in
14127 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
14128 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SD ;;
14130 case "$getnetent_r_proto" in
14131 ''|0) d_getnetent_r=undef
14132 getnetent_r_proto=0
14133 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
14134 * ) case "$getnetent_r_proto" in
14135 REENTRANT_PROTO*) ;;
14136 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
14138 echo "Prototype: $try" ;;
14141 *) case "$usethreads" in
14142 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
14144 d_getnetent_r=undef
14145 getnetent_r_proto=0
14149 *) getnetent_r_proto=0
14153 : see if prototypes for various getnetxxx netdb.h functions are available
14155 set d_getnetprotos getnetent $i_netdb netdb.h
14158 : see if getpagesize exists
14159 set getpagesize d_getpagsz
14162 : Optional checks for getprotobyname and getprotobynumber
14164 : see if getprotobyname exists
14165 set getprotobyname d_getpbyname
14168 : see if getprotobynumber exists
14169 set getprotobynumber d_getpbynumber
14172 : see if getprotoent exists
14173 set getprotoent d_getpent
14176 : see if getpgid exists
14177 set getpgid d_getpgid
14180 : see if getpgrp2 exists
14181 set getpgrp2 d_getpgrp2
14184 : see if getppid exists
14185 set getppid d_getppid
14188 : see if getpriority exists
14189 set getpriority d_getprior
14192 : see if getprotobyname_r exists
14193 set getprotobyname_r d_getprotobyname_r
14195 case "$d_getprotobyname_r" in
14197 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14198 case "$d_getprotobyname_r_proto:$usethreads" in
14199 ":define") d_getprotobyname_r_proto=define
14200 set d_getprotobyname_r_proto getprotobyname_r $hdrs
14204 case "$d_getprotobyname_r_proto" in
14206 case "$getprotobyname_r_proto" in
14207 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
14208 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
14210 case "$getprotobyname_r_proto" in
14211 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
14212 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
14214 case "$getprotobyname_r_proto" in
14215 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
14216 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
14218 case "$getprotobyname_r_proto" in
14219 ''|0) d_getprotobyname_r=undef
14220 getprotobyname_r_proto=0
14221 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
14222 * ) case "$getprotobyname_r_proto" in
14223 REENTRANT_PROTO*) ;;
14224 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
14226 echo "Prototype: $try" ;;
14229 *) case "$usethreads" in
14230 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
14232 d_getprotobyname_r=undef
14233 getprotobyname_r_proto=0
14237 *) getprotobyname_r_proto=0
14241 : see if getprotobynumber_r exists
14242 set getprotobynumber_r d_getprotobynumber_r
14244 case "$d_getprotobynumber_r" in
14246 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14247 case "$d_getprotobynumber_r_proto:$usethreads" in
14248 ":define") d_getprotobynumber_r_proto=define
14249 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
14253 case "$d_getprotobynumber_r_proto" in
14255 case "$getprotobynumber_r_proto" in
14256 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
14257 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
14259 case "$getprotobynumber_r_proto" in
14260 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
14261 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
14263 case "$getprotobynumber_r_proto" in
14264 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
14265 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
14267 case "$getprotobynumber_r_proto" in
14268 ''|0) d_getprotobynumber_r=undef
14269 getprotobynumber_r_proto=0
14270 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
14271 * ) case "$getprotobynumber_r_proto" in
14272 REENTRANT_PROTO*) ;;
14273 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
14275 echo "Prototype: $try" ;;
14278 *) case "$usethreads" in
14279 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
14281 d_getprotobynumber_r=undef
14282 getprotobynumber_r_proto=0
14286 *) getprotobynumber_r_proto=0
14290 : see if getprotoent_r exists
14291 set getprotoent_r d_getprotoent_r
14293 case "$d_getprotoent_r" in
14295 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14296 case "$d_getprotoent_r_proto:$usethreads" in
14297 ":define") d_getprotoent_r_proto=define
14298 set d_getprotoent_r_proto getprotoent_r $hdrs
14302 case "$d_getprotoent_r_proto" in
14304 case "$getprotoent_r_proto" in
14305 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
14306 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
14308 case "$getprotoent_r_proto" in
14309 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
14310 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBI ;;
14312 case "$getprotoent_r_proto" in
14313 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
14314 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=S_SBI ;;
14316 case "$getprotoent_r_proto" in
14317 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
14318 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SD ;;
14320 case "$getprotoent_r_proto" in
14321 ''|0) d_getprotoent_r=undef
14322 getprotoent_r_proto=0
14323 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
14324 * ) case "$getprotoent_r_proto" in
14325 REENTRANT_PROTO*) ;;
14326 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
14328 echo "Prototype: $try" ;;
14331 *) case "$usethreads" in
14332 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
14334 d_getprotoent_r=undef
14335 getprotoent_r_proto=0
14339 *) getprotoent_r_proto=0
14343 : see if prototypes for various getprotoxxx netdb.h functions are available
14345 set d_getprotoprotos getprotoent $i_netdb netdb.h
14348 : see if getprpwnam exists
14349 set getprpwnam d_getprpwnam
14352 : see if getpwent exists
14353 set getpwent d_getpwent
14356 : see if getpwent_r exists
14357 set getpwent_r d_getpwent_r
14359 case "$d_getpwent_r" in
14361 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14362 case "$d_getpwent_r_proto:$usethreads" in
14363 ":define") d_getpwent_r_proto=define
14364 set d_getpwent_r_proto getpwent_r $hdrs
14368 case "$d_getpwent_r_proto" in
14370 case "$getpwent_r_proto" in
14371 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
14372 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBWR ;;
14374 case "$getpwent_r_proto" in
14375 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
14376 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIR ;;
14378 case "$getpwent_r_proto" in
14379 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
14380 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBW ;;
14382 case "$getpwent_r_proto" in
14383 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
14384 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBI ;;
14386 case "$getpwent_r_proto" in
14387 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
14388 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBI ;;
14390 case "$getpwent_r_proto" in
14391 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
14392 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIH ;;
14394 case "$getpwent_r_proto" in
14395 ''|0) d_getpwent_r=undef
14397 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
14398 * ) case "$getpwent_r_proto" in
14399 REENTRANT_PROTO*) ;;
14400 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
14402 echo "Prototype: $try" ;;
14405 *) case "$usethreads" in
14406 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
14413 *) getpwent_r_proto=0
14417 : see if getpwnam_r exists
14418 set getpwnam_r d_getpwnam_r
14420 case "$d_getpwnam_r" in
14422 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14423 case "$d_getpwnam_r_proto:$usethreads" in
14424 ":define") d_getpwnam_r_proto=define
14425 set d_getpwnam_r_proto getpwnam_r $hdrs
14429 case "$d_getpwnam_r_proto" in
14431 case "$getpwnam_r_proto" in
14432 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
14433 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
14435 case "$getpwnam_r_proto" in
14436 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
14437 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
14439 case "$getpwnam_r_proto" in
14440 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
14441 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
14443 case "$getpwnam_r_proto" in
14444 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
14445 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
14447 case "$getpwnam_r_proto" in
14448 ''|0) d_getpwnam_r=undef
14450 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
14451 * ) case "$getpwnam_r_proto" in
14452 REENTRANT_PROTO*) ;;
14453 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
14455 echo "Prototype: $try" ;;
14458 *) case "$usethreads" in
14459 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
14466 *) getpwnam_r_proto=0
14470 : see if getpwuid_r exists
14471 set getpwuid_r d_getpwuid_r
14473 case "$d_getpwuid_r" in
14475 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14476 case "$d_getpwuid_r_proto:$usethreads" in
14477 ":define") d_getpwuid_r_proto=define
14478 set d_getpwuid_r_proto getpwuid_r $hdrs
14482 case "$d_getpwuid_r_proto" in
14484 case "$getpwuid_r_proto" in
14485 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
14486 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
14488 case "$getpwuid_r_proto" in
14489 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
14490 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
14492 case "$getpwuid_r_proto" in
14493 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
14494 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
14496 case "$getpwuid_r_proto" in
14497 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
14498 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
14500 case "$getpwuid_r_proto" in
14501 ''|0) d_getpwuid_r=undef
14503 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
14504 * ) case "$getpwuid_r_proto" in
14505 REENTRANT_PROTO*) ;;
14506 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
14508 echo "Prototype: $try" ;;
14511 *) case "$usethreads" in
14512 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
14519 *) getpwuid_r_proto=0
14523 : Optional checks for getsbyname and getsbyport
14525 : see if getservbyname exists
14526 set getservbyname d_getsbyname
14529 : see if getservbyport exists
14530 set getservbyport d_getsbyport
14533 : see if getservent exists
14534 set getservent d_getsent
14537 : see if getservbyname_r exists
14538 set getservbyname_r d_getservbyname_r
14540 case "$d_getservbyname_r" in
14542 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14543 case "$d_getservbyname_r_proto:$usethreads" in
14544 ":define") d_getservbyname_r_proto=define
14545 set d_getservbyname_r_proto getservbyname_r $hdrs
14549 case "$d_getservbyname_r_proto" in
14551 case "$getservbyname_r_proto" in
14552 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
14553 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
14555 case "$getservbyname_r_proto" in
14556 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
14557 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
14559 case "$getservbyname_r_proto" in
14560 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
14561 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
14563 case "$getservbyname_r_proto" in
14564 ''|0) d_getservbyname_r=undef
14565 getservbyname_r_proto=0
14566 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
14567 * ) case "$getservbyname_r_proto" in
14568 REENTRANT_PROTO*) ;;
14569 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
14571 echo "Prototype: $try" ;;
14574 *) case "$usethreads" in
14575 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
14577 d_getservbyname_r=undef
14578 getservbyname_r_proto=0
14582 *) getservbyname_r_proto=0
14586 : see if getservbyport_r exists
14587 set getservbyport_r d_getservbyport_r
14589 case "$d_getservbyport_r" in
14591 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14592 case "$d_getservbyport_r_proto:$usethreads" in
14593 ":define") d_getservbyport_r_proto=define
14594 set d_getservbyport_r_proto getservbyport_r $hdrs
14598 case "$d_getservbyport_r_proto" in
14600 case "$getservbyport_r_proto" in
14601 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
14602 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
14604 case "$getservbyport_r_proto" in
14605 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
14606 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
14608 case "$getservbyport_r_proto" in
14609 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
14610 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
14612 case "$getservbyport_r_proto" in
14613 ''|0) d_getservbyport_r=undef
14614 getservbyport_r_proto=0
14615 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
14616 * ) case "$getservbyport_r_proto" in
14617 REENTRANT_PROTO*) ;;
14618 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
14620 echo "Prototype: $try" ;;
14623 *) case "$usethreads" in
14624 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
14626 d_getservbyport_r=undef
14627 getservbyport_r_proto=0
14631 *) getservbyport_r_proto=0
14635 : see if getservent_r exists
14636 set getservent_r d_getservent_r
14638 case "$d_getservent_r" in
14640 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14641 case "$d_getservent_r_proto:$usethreads" in
14642 ":define") d_getservent_r_proto=define
14643 set d_getservent_r_proto getservent_r $hdrs
14647 case "$d_getservent_r_proto" in
14649 case "$getservent_r_proto" in
14650 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
14651 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBWR ;;
14653 case "$getservent_r_proto" in
14654 ''|0) try='int getservent_r(struct servent*, char*, int);'
14655 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBI ;;
14657 case "$getservent_r_proto" in
14658 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
14659 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=S_SBI ;;
14661 case "$getservent_r_proto" in
14662 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
14663 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SD ;;
14665 case "$getservent_r_proto" in
14666 ''|0) d_getservent_r=undef
14667 getservent_r_proto=0
14668 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
14669 * ) case "$getservent_r_proto" in
14670 REENTRANT_PROTO*) ;;
14671 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
14673 echo "Prototype: $try" ;;
14676 *) case "$usethreads" in
14677 define) echo "getservent_r has no prototype, not using it." >&4 ;;
14679 d_getservent_r=undef
14680 getservent_r_proto=0
14684 *) getservent_r_proto=0
14688 : see if prototypes for various getservxxx netdb.h functions are available
14690 set d_getservprotos getservent $i_netdb netdb.h
14693 : see if getspnam exists
14694 set getspnam d_getspnam
14697 : see if this is a shadow.h system
14698 set shadow.h i_shadow
14701 : see if getspnam_r exists
14702 set getspnam_r d_getspnam_r
14704 case "$d_getspnam_r" in
14706 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
14707 case "$d_getspnam_r_proto:$usethreads" in
14708 ":define") d_getspnam_r_proto=define
14709 set d_getspnam_r_proto getspnam_r $hdrs
14713 case "$d_getspnam_r_proto" in
14715 case "$getspnam_r_proto" in
14716 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
14717 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
14719 case "$getspnam_r_proto" in
14720 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
14721 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=S_CSBI ;;
14723 case "$getspnam_r_proto" in
14724 ''|0) d_getspnam_r=undef
14726 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
14727 * ) case "$getspnam_r_proto" in
14728 REENTRANT_PROTO*) ;;
14729 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
14731 echo "Prototype: $try" ;;
14734 *) case "$usethreads" in
14735 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
14742 *) getspnam_r_proto=0
14746 : see if gettimeofday or ftime exists
14747 set gettimeofday d_gettimeod
14749 case "$d_gettimeod" in
14755 val="$undef"; set d_ftime; eval $setvar
14758 case "$d_gettimeod$d_ftime" in
14761 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
14765 : see if gmtime_r exists
14766 set gmtime_r d_gmtime_r
14768 case "$d_gmtime_r" in
14770 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14771 case "$d_gmtime_r_proto:$usethreads" in
14772 ":define") d_gmtime_r_proto=define
14773 set d_gmtime_r_proto gmtime_r $hdrs
14777 case "$d_gmtime_r_proto" in
14779 case "$gmtime_r_proto" in
14780 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
14781 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=S_TS ;;
14783 case "$gmtime_r_proto" in
14784 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
14785 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=I_TS ;;
14787 case "$gmtime_r_proto" in
14788 ''|0) d_gmtime_r=undef
14790 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
14791 * ) case "$gmtime_r_proto" in
14792 REENTRANT_PROTO*) ;;
14793 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
14795 echo "Prototype: $try" ;;
14798 *) case "$usethreads" in
14799 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
14806 *) gmtime_r_proto=0
14810 : see if hasmntopt exists
14811 set hasmntopt d_hasmntopt
14814 : see if this is a netinet/in.h or sys/in.h system
14815 set netinet/in.h i_niin sys/in.h i_sysin
14818 : see if arpa/inet.h has to be included
14819 set arpa/inet.h i_arpainet
14822 : see if htonl --and friends-- exists
14827 : Maybe they are macros.
14830 $cat >htonl.c <<EOM
14832 #include <sys/types.h>
14833 #$i_niin I_NETINET_IN
14835 #$i_arpainet I_ARPA_INET
14836 #ifdef I_NETINET_IN
14837 #include <netinet/in.h>
14840 #include <sys/in.h>
14843 #include <arpa/inet.h>
14846 printf("Defined as a macro.");
14849 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
14850 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
14852 echo "But it seems to be defined as a macro." >&4
14860 : see if ilogbl exists
14861 set ilogbl d_ilogbl
14866 if set index val -f; eval $csym; $val; then
14867 if set strchr val -f d_strchr; eval $csym; $val; then
14868 if $contains strchr "$strings" >/dev/null 2>&1 ; then
14871 echo "strchr() found." >&4
14875 echo "index() found." >&4
14880 echo "index() found." >&4
14883 if set strchr val -f d_strchr; eval $csym; $val; then
14886 echo "strchr() found." >&4
14888 echo "No index() or strchr() found!" >&4
14893 set d_strchr; eval $setvar
14895 set d_index; eval $setvar
14897 : check whether inet_aton exists
14898 set inet_aton d_inetaton
14901 : see if inet_ntop exists
14902 set inet_ntop d_inetntop
14905 : see if inet_pton exists
14906 set inet_pton d_inetpton
14911 $cat >isascii.c <<EOCP
14914 #$i_stdlib I_STDLIB
14916 #include <stdlib.h>
14927 if eval $compile; then
14928 echo "isascii() found." >&4
14931 echo "isascii() NOT found." >&4
14938 : see if isfinite exists
14939 set isfinite d_isfinite
14942 : see if isinf exists
14946 : see if isnan exists
14950 : see if isnanl exists
14951 set isnanl d_isnanl
14954 : see if killpg exists
14955 set killpg d_killpg
14958 : see if lchown exists
14960 $cat > try.c <<'EOCP'
14961 /* System header to define __stub macros and hopefully few prototypes,
14962 which can conflict with char lchown(); below. */
14963 #include <assert.h>
14964 /* Override any gcc2 internal prototype to avoid an error. */
14965 /* We use char because int might match the return type of a gcc2
14966 builtin and then its argument prototype would still apply. */
14969 /* The GNU C library defines this for functions which it implements
14970 to always fail with ENOSYS. Some functions are actually named
14971 something starting with __ and the normal name is an alias. */
14972 #if defined (__stub_lchown) || defined (__stub___lchown)
14980 if eval $compile; then
14981 $echo "lchown() found." >&4
14984 $echo "lchown() NOT found." >&4
14990 : See if number of significant digits in a double precision number is known
14992 $cat >ldbl_dig.c <<EOM
14993 #$i_limits I_LIMITS
14996 #include <limits.h>
15002 printf("Contains LDBL_DIG");
15005 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
15006 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
15007 echo "LDBL_DIG found." >&4
15010 echo "LDBL_DIG NOT found." >&4
15017 : see if this is a math.h system
15021 : check to see if math.h defines _LIB_VERSION
15022 d_libm_lib_version="$undef"
15026 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
15028 #include <unistd.h>
15030 int main (int argc, char *argv[])
15032 printf ("%d\n", _LIB_VERSION);
15037 if eval $compile; then
15039 echo "Yes, it does ($foo)" >&4
15040 d_libm_lib_version="$define"
15042 echo "No, it does not (probably harmless)" >&4
15049 : see if link exists
15053 : see if localtime_r exists
15054 set localtime_r d_localtime_r
15056 case "$d_localtime_r" in
15058 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
15059 case "$d_localtime_r_proto:$usethreads" in
15060 ":define") d_localtime_r_proto=define
15061 set d_localtime_r_proto localtime_r $hdrs
15065 case "$d_localtime_r_proto" in
15067 case "$localtime_r_proto" in
15068 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
15069 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=S_TS ;;
15071 case "$localtime_r_proto" in
15072 ''|0) try='int localtime_r(const time_t*, struct tm*);'
15073 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=I_TS ;;
15075 case "$localtime_r_proto" in
15076 ''|0) d_localtime_r=undef
15077 localtime_r_proto=0
15078 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
15079 * ) case "$localtime_r_proto" in
15080 REENTRANT_PROTO*) ;;
15081 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
15083 echo "Prototype: $try" ;;
15086 *) case "$usethreads" in
15087 define) echo "localtime_r has no prototype, not using it." >&4 ;;
15089 d_localtime_r=undef
15090 localtime_r_proto=0
15094 *) localtime_r_proto=0
15098 : see if localtime_r calls tzset
15099 case "$localtime_r_proto" in
15102 /* Does our libc's localtime_r call tzset ?
15103 * return 0 if so, 1 otherwise.
15105 #$i_systypes I_SYS_TYPES
15106 #$i_unistd I_UNISTD
15108 #$i_stdlib I_STDLIB
15109 #$i_string I_STRING
15110 #$i_malloc I_MALLOC
15112 # include <sys/types.h>
15115 # include <unistd.h>
15121 #include <stdlib.h>
15124 # include <string.h>
15126 # include <strings.h>
15129 # include <malloc.h>
15133 time_t t = time(0L);
15134 char w_tz[]="TZ" "=GMT+5",
15135 e_tz[]="TZ" "=GMT-5",
15136 *tz_e = (char*)malloc(16),
15137 *tz_w = (char*)malloc(16);
15138 struct tm tm_e, tm_w;
15139 memset(&tm_e,'\0',sizeof(struct tm));
15140 memset(&tm_w,'\0',sizeof(struct tm));
15145 localtime_r(&t, &tm_e);
15148 localtime_r(&t, &tm_w);
15150 if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 )
15156 if eval $compile; then
15157 if $run ./try; then
15158 d_localtime_r_needs_tzset=undef;
15160 d_localtime_r_needs_tzset=define;
15163 d_localtime_r_needs_tzset=undef;
15167 d_localtime_r_needs_tzset=undef;
15172 : see if localeconv exists
15173 set localeconv d_locconv
15176 : see if lockf exists
15180 : see if prototype for lseek is available
15182 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
15185 : see if lstat exists
15189 : see if madvise exists
15190 set madvise d_madvise
15193 : see if malloc_size exists
15194 set malloc_size d_malloc_size
15197 : see if malloc_size_good exists
15198 set malloc_good_size d_malloc_good_size
15201 : see if mblen exists
15205 : see if mbstowcs exists
15206 set mbstowcs d_mbstowcs
15209 : see if mbtowc exists
15210 set mbtowc d_mbtowc
15213 : see if memchr exists
15214 set memchr d_memchr
15217 : see if memcmp exists
15218 set memcmp d_memcmp
15221 : see if memcpy exists
15222 set memcpy d_memcpy
15225 : see if memmove exists
15226 set memmove d_memmove
15229 : see if memset exists
15230 set memset d_memset
15233 : see if mkdir exists
15237 : see if mkdtemp exists
15238 set mkdtemp d_mkdtemp
15241 : see if mkfifo exists
15242 set mkfifo d_mkfifo
15245 : see if mkstemp exists
15246 set mkstemp d_mkstemp
15249 : see if mkstemps exists
15250 set mkstemps d_mkstemps
15253 : see if mktime exists
15254 set mktime d_mktime
15257 : see if this is a sys/mman.h system
15258 set sys/mman.h i_sysmman
15261 : see if mmap exists
15264 : see what shmat returns
15265 : default to something harmless
15267 case "$i_sysmman$d_mmap" in
15269 $cat >mmap.c <<'END'
15270 #include <sys/mman.h>
15273 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
15278 echo "and it returns ($mmaptype)." >&4
15284 : see if sqrtl exists
15288 : see if scalbnl exists
15289 set scalbnl d_scalbnl
15292 : see if modfl exists
15296 : see if prototype for modfl is available
15298 set d_modflproto modfl $i_math math.h
15301 d_modfl_pow32_bug="$undef"
15303 case "$d_longdbl$d_modfl" in
15306 Checking to see whether your modfl() is okay for large values...
15312 if $test "X$d_modflproto" != "X$define"; then
15313 $cat >>try.c <<EOCP
15314 /* Sigh. many current glibcs provide the function, but do not prototype it. */
15315 long double modfl (long double, long double *);
15318 $cat >>try.c <<EOCP
15320 long double nv = 4294967303.15;
15326 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
15330 case "$osname:$gccversion" in
15331 aix:) saveccflags="$ccflags"
15332 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
15335 if eval $compile; then
15338 *" 4294967303.150000 1.150000 4294967302.000000")
15339 echo >&4 "Your modfl() is broken for large values."
15340 d_modfl_pow32_bug="$define"
15342 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
15346 *" 4294967303.150000 0.150000 4294967303.000000")
15347 echo >&4 "Your modfl() seems okay for large values."
15349 *) echo >&4 "I don't understand your modfl() at all."
15355 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
15358 case "$osname:$gccversion" in
15359 aix:) ccflags="$saveccflags" ;; # restore
15364 if $test "$uselongdouble" = "$define"; then
15366 if $test "$d_sqrtl" != "$define"; then
15367 message="$message sqrtl"
15369 if $test "$d_modfl" != "$define"; then
15370 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
15371 echo "You have both aintl and copysignl, so I can emulate modfl."
15373 message="$message modfl"
15376 if $test "$d_frexpl" != "$define"; then
15377 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
15378 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
15380 message="$message frexpl"
15384 if $test "$message" != ""; then
15387 *** You requested the use of long doubles but you do not seem to have
15388 *** the following mathematical functions needed for long double support:
15390 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
15391 *** Cannot continue, aborting.
15399 : see if mprotect exists
15400 set mprotect d_mprotect
15403 : see if msgctl exists
15404 set msgctl d_msgctl
15407 : see if msgget exists
15408 set msgget d_msgget
15411 : see if msgsnd exists
15412 set msgsnd d_msgsnd
15415 : see if msgrcv exists
15416 set msgrcv d_msgrcv
15419 : see how much of the 'msg*(2)' library is present.
15422 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
15423 *"$undef"*) h_msg=false;;
15427 case "`ipcs 2>&1`" in
15428 "SVID messages"*"not configured"*)
15429 echo "Your $osname does not have the msg*(2) configured." >&4
15432 set msgctl d_msgctl
15434 set msgget d_msgget
15436 set msgsnd d_msgsnd
15438 set msgrcv d_msgrcv
15444 : we could also check for sys/ipc.h ...
15445 if $h_msg && $test `./findhdr sys/msg.h`; then
15446 echo "You have the full msg*(2) library." >&4
15449 echo "You don't have the full msg*(2) library." >&4
15455 : Check for msghdr_s
15457 echo "Checking to see if your system supports struct msghdr..." >&4
15458 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
15460 case "$d_msghdr_s" in
15461 "$define") echo "Yes, it does." ;;
15462 *) echo "No, it doesn't." ;;
15466 : see if msync exists
15470 : see if munmap exists
15471 set munmap d_munmap
15474 : see if nice exists
15478 : see if this is a langinfo.h system
15479 set langinfo.h i_langinfo
15482 : see if nl_langinfo exists
15483 set nl_langinfo d_nl_langinfo
15486 : check for volatile keyword
15488 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
15489 $cat >try.c <<'EOCP'
15492 typedef struct _goo_struct goo_struct;
15493 goo_struct * volatile goo = ((goo_struct *)0);
15494 struct _goo_struct {
15499 typedef unsigned short foo_t;
15500 char *volatile foo;
15502 volatile foo_t blech;
15506 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
15508 echo "Yup, it does."
15511 echo "Nope, it doesn't."
15517 : Check basic sizes
15519 $echo "Choosing the C types to be used for Perl's internal types..." >&4
15521 case "$use64bitint:$d_quad:$quadtype" in
15524 uvtype="$uquadtype"
15529 uvtype="unsigned long"
15535 case "$uselongdouble:$d_longdbl" in
15537 nvtype="long double"
15538 nvsize=$longdblsize
15545 $echo "(IV will be "$ivtype", $ivsize bytes)"
15546 $echo "(UV will be "$uvtype", $uvsize bytes)"
15547 $echo "(NV will be "$nvtype", $nvsize bytes)"
15550 #$i_inttypes I_INTTYPES
15552 #include <inttypes.h>
15557 int8_t i = INT8_MAX;
15558 uint8_t u = UINT8_MAX;
15559 printf("int8_t\n");
15562 int16_t i = INT16_MAX;
15563 uint16_t i = UINT16_MAX;
15564 printf("int16_t\n");
15567 int32_t i = INT32_MAX;
15568 uint32_t u = UINT32_MAX;
15569 printf("int32_t\n");
15574 i8type="signed char"
15575 u8type="unsigned char"
15580 '') case "$shortsize" in
15582 u16type="unsigned short"
15590 '') set try -DINT16
15591 if eval $compile; then
15592 case "`$run ./try`" in
15604 '') if $test $shortsize -ge 2; then
15606 u16type="unsigned short"
15614 '') case "$longsize" in
15616 u32type="unsigned long"
15620 *) case "$intsize" in
15622 u32type="unsigned int"
15632 '') set try -DINT32
15633 if eval $compile; then
15634 case "`$run ./try`" in
15646 '') if $test $intsize -ge 4; then
15648 u32type="unsigned int"
15656 '') case "$d_quad:$quadtype" in
15658 i64type="$quadtype"
15659 u64type="$uquadtype"
15667 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
15668 : volatile so that the compiler has to store it out to memory.
15669 if test X"$d_volatile" = X"$define"; then
15674 #$i_stdlib I_STDLIB
15676 #include <stdlib.h>
15678 #include <sys/types.h>
15679 #include <signal.h>
15681 $volatile int bletched = 0;
15682 $signal_t blech(int s) { bletched = 1; }
15687 int n = 8 * $uvsize;
15690 signal(SIGFPE, blech);
15693 for (i = 0; i < n; i++) {
15694 u = u << 1 | ($uvtype)1;
15696 if (($uvtype)d != u)
15700 d = ($nvtype)(u - 1);
15701 if (($uvtype)d != (u - 1))
15708 printf("%d\n", ((i == n) ? -n : i));
15714 d_nv_preserves_uv="$undef"
15715 if eval $compile; then
15716 nv_preserves_uv_bits="`$run ./try`"
15718 case "$nv_preserves_uv_bits" in
15720 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
15721 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
15722 d_nv_preserves_uv="$define"
15724 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
15725 d_nv_preserves_uv="$undef" ;;
15726 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
15727 nv_preserves_uv_bits="0" ;;
15731 $echo "Checking to find the largest integer value your NVs can hold..." >&4
15732 : volatile so that the compiler has to store it out to memory.
15733 if test X"$d_volatile" = X"$define"; then
15739 typedef $nvtype NV;
15746 while(count < 256) {
15747 $volatile NV up = value + 1.0;
15748 $volatile NV negated = -value;
15749 $volatile NV down = negated - 1.0;
15750 $volatile NV got_up = up - value;
15751 int up_good = got_up == 1.0;
15752 int got_down = down - negated;
15753 int down_good = got_down == -1.0;
15755 if (down_good != up_good) {
15757 "Inconsistency - up %d %f; down %d %f; for 2**%d (%.20f)\n",
15758 up_good, (double) got_up, down_good, (double) got_down,
15759 count, (double) value);
15766 fputs("256.0", stdout);
15769 fputs("2.0", stdout);
15775 fputs("*", stdout);
15781 fprintf(stderr, "Cannot overflow integer range, even at 2**%d (%.20f)\n",
15782 count, (double) value);
15788 nv_overflows_integers_at='0'
15789 if eval $compile; then
15795 The largest integer your NVs can preserve is equal to $xxx
15797 nv_overflows_integers_at="$xxx"
15800 Cannot determine the largest integer value your NVs can hold, unexpected output
15807 Cannot determine the largest integer value your NVs can hold
15814 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
15815 : volatile so that the compiler has to store it out to memory.
15816 if test X"$d_volatile" = X"$define"; then
15821 #$i_stdlib I_STDLIB
15823 #include <stdlib.h>
15825 #$i_string I_STRING
15827 # include <string.h>
15829 # include <strings.h>
15831 #include <sys/types.h>
15832 #include <signal.h>
15834 $volatile int bletched = 0;
15835 $signal_t blech(int s) { bletched = 1; }
15838 int checkit($nvtype d, char *where) {
15839 unsigned char *p = (char *)&d;
15840 unsigned char *end = p + sizeof(d);
15850 printf("No - %s: 0x", where);
15852 printf ("%02X", *p++);
15857 int main(int argc, char **argv) {
15860 fail += checkit(d, "0.0");
15862 /* The compiler shouldn't be assuming that bletched is 0 */
15865 fail += checkit(d, "bleched");
15868 signal(SIGFPE, blech);
15871 /* Paranoia - the compiler should have no way of knowing that ANSI says
15872 that argv[argc] will always be NULL. Actually, if it did assume this it
15873 would be buggy, as this is C and main() can be called from elsewhere in
15875 d = argv[argc] ? 1 : 0;
15878 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
15881 fail += checkit(d, "ternary");
15883 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
15886 printf("No - memset doesn't give 0.0\n");
15887 /* This might just blow up: */
15888 printf("(gives %g)\n", d);
15894 printf("No - something bleched\n");
15899 printf("No - %d fail(s)\n", fail);
15908 d_nv_zero_is_allbits_zero="$undef"
15909 if eval $compile; then
15915 0.0 is represented as all bits zero in memory
15917 d_nv_zero_is_allbits_zero="$define"
15920 0.0 is not represented as all bits zero in memory
15922 d_nv_zero_is_allbits_zero="$undef"
15927 0.0 is not represented as all bits zero in memory
15929 d_nv_zero_is_allbits_zero="$undef"
15935 : check for off64_t
15937 echo "Checking to see if you have off64_t..." >&4
15939 #include <sys/types.h>
15940 #include <unistd.h>
15941 int main() { off64_t x = 7; }
15944 if eval $compile; then
15946 echo "You have off64_t."
15949 echo "You do not have off64_t."
15950 case "$lseeksize" in
15951 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
15958 : how to create joinable pthreads
15959 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
15961 echo "Checking what constant to use for creating joinable pthreads..." >&4
15962 $cat >try.c <<'EOCP'
15963 #include <pthread.h>
15965 int detachstate = JOINABLE;
15968 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
15969 if eval $compile; then
15970 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
15971 val="$undef" # Yes, undef.
15972 set d_old_pthread_create_joinable
15975 set old_pthread_create_joinable
15978 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
15979 if eval $compile; then
15980 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
15982 set d_old_pthread_create_joinable
15984 val=PTHREAD_CREATE_UNDETACHED
15985 set old_pthread_create_joinable
15988 set try -DJOINABLE=__UNDETACHED
15989 if eval $compile; then
15990 echo "You seem to use __UNDETACHED." >&4
15992 set d_old_pthread_create_joinable
15995 set old_pthread_create_joinable
15998 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
16000 set d_old_pthread_create_joinable
16003 set old_pthread_create_joinable
16010 d_old_pthread_create_joinable="$undef"
16011 old_pthread_create_joinable=""
16014 : see if pause exists
16018 : see if poll exists
16022 : see if readlink exists
16023 set readlink d_readlink
16026 : Check if exe is symlink to abs path of executing program
16030 case "$d_readlink" in
16032 if $issymlink /proc/self/exe ; then
16033 $ls -l /proc/self/exe > reflect
16034 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
16035 echo "You have Linux-like /proc/self/exe."
16036 procselfexe='"/proc/self/exe"'
16040 if $issymlink /proc/curproc/file ; then
16041 $ls -l /proc/curproc/file > reflect
16042 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
16043 echo "You have BSD-like /proc/curproc/file."
16044 procselfexe='"/proc/curproc/file"'
16054 : backward compatibility for d_hvfork
16055 if test X$d_hvfork != X; then
16056 d_vfork="$d_hvfork"
16059 : see if there is a vfork
16064 d_pseudofork=$undef
16066 : Ok, but do we want to use it. vfork is reportedly unreliable in
16067 : perl on Solaris 2.x, and probably elsewhere.
16071 case "$usevfork" in
16077 Perl can only use a vfork() that doesn't suffer from strict
16078 restrictions on calling functions or modifying global data in
16079 the child. For example, glibc-2.1 contains such a vfork()
16080 that is unsuitable. If your system provides a proper fork()
16081 call, chances are that you do NOT want perl to use vfork().
16084 rp="Do you still want to use vfork()?"
16089 echo "Ok, we won't use vfork()."
16098 $define) usevfork='true';;
16099 *) usevfork='false';;
16102 : see whether the pthread_atfork exists
16104 #include <pthread.h>
16107 #ifdef PTHREAD_ATFORK
16108 pthread_atfork(NULL,NULL,NULL);
16113 : see if pthread_atfork exists
16114 set try -DPTHREAD_ATFORK
16115 if eval $compile; then
16120 case "$usethreads" in
16123 $define) echo 'pthread_atfork found.' >&4 ;;
16124 *) echo 'pthread_atfork NOT found.' >&4 ;;
16127 set d_pthread_atfork
16130 : see if pthread_attr_setscope exists
16131 set pthread_attr_setscope d_pthread_attr_setscope
16134 : see whether the various POSIXish _yields exist
16136 #include <pthread.h>
16142 #ifdef PTHREAD_YIELD
16145 #ifdef PTHREAD_YIELD_NULL
16146 pthread_yield(NULL);
16152 : see if sched_yield exists
16153 set try -DSCHED_YIELD
16154 if eval $compile; then
16156 sched_yield='sched_yield()'
16160 case "$usethreads" in
16163 $define) echo 'sched_yield() found.' >&4 ;;
16164 *) echo 'sched_yield() NOT found.' >&4 ;;
16170 : see if pthread_yield exists
16171 set try -DPTHREAD_YIELD
16172 if eval $compile; then
16174 case "$sched_yield" in
16175 '') sched_yield='pthread_yield()' ;;
16178 set try -DPTHREAD_YIELD_NULL
16179 if eval $compile; then
16181 case "$sched_yield" in
16182 '') sched_yield='pthread_yield(NULL)' ;;
16188 case "$usethreads" in
16191 $define) echo 'pthread_yield() found.' >&4 ;;
16192 *) echo 'pthread_yield() NOT found.' >&4 ;;
16196 set d_pthread_yield
16198 case "$sched_yield" in
16199 '') sched_yield=undef ;;
16203 : see if random_r exists
16204 set random_r d_random_r
16206 case "$d_random_r" in
16208 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
16209 case "$d_random_r_proto:$usethreads" in
16210 ":define") d_random_r_proto=define
16211 set d_random_r_proto random_r $hdrs
16215 case "$d_random_r_proto" in
16217 case "$random_r_proto" in
16218 ''|0) try='int random_r(int*, struct random_data*);'
16219 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_iS ;;
16221 case "$random_r_proto" in
16222 ''|0) try='int random_r(long*, struct random_data*);'
16223 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_lS ;;
16225 case "$random_r_proto" in
16226 ''|0) try='int random_r(struct random_data*, int32_t*);'
16227 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_St ;;
16229 case "$random_r_proto" in
16230 ''|0) d_random_r=undef
16232 echo "Disabling random_r, cannot determine prototype." >&4 ;;
16233 * ) case "$random_r_proto" in
16234 REENTRANT_PROTO*) ;;
16235 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
16237 echo "Prototype: $try" ;;
16240 *) case "$usethreads" in
16241 define) echo "random_r has no prototype, not using it." >&4 ;;
16248 *) random_r_proto=0
16252 : see if readdir and friends exist
16253 set readdir d_readdir
16255 set seekdir d_seekdir
16257 set telldir d_telldir
16259 set rewinddir d_rewinddir
16262 : see if readdir64_r exists
16263 set readdir64_r d_readdir64_r
16265 case "$d_readdir64_r" in
16267 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
16268 case "$d_readdir64_r_proto:$usethreads" in
16269 ":define") d_readdir64_r_proto=define
16270 set d_readdir64_r_proto readdir64_r $hdrs
16274 case "$d_readdir64_r_proto" in
16276 case "$readdir64_r_proto" in
16277 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
16278 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TSR ;;
16280 case "$readdir64_r_proto" in
16281 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
16282 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TS ;;
16284 case "$readdir64_r_proto" in
16285 ''|0) d_readdir64_r=undef
16286 readdir64_r_proto=0
16287 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
16288 * ) case "$readdir64_r_proto" in
16289 REENTRANT_PROTO*) ;;
16290 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
16292 echo "Prototype: $try" ;;
16295 *) case "$usethreads" in
16296 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
16298 d_readdir64_r=undef
16299 readdir64_r_proto=0
16303 *) readdir64_r_proto=0
16307 : see if readdir_r exists
16308 set readdir_r d_readdir_r
16310 case "$d_readdir_r" in
16312 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
16313 case "$d_readdir_r_proto:$usethreads" in
16314 ":define") d_readdir_r_proto=define
16315 set d_readdir_r_proto readdir_r $hdrs
16319 case "$d_readdir_r_proto" in
16321 case "$readdir_r_proto" in
16322 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
16323 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TSR ;;
16325 case "$readdir_r_proto" in
16326 ''|0) try='int readdir_r(DIR*, struct dirent*);'
16327 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TS ;;
16329 case "$readdir_r_proto" in
16330 ''|0) d_readdir_r=undef
16332 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
16333 * ) case "$readdir_r_proto" in
16334 REENTRANT_PROTO*) ;;
16335 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
16337 echo "Prototype: $try" ;;
16340 *) case "$usethreads" in
16341 define) echo "readdir_r has no prototype, not using it." >&4 ;;
16348 *) readdir_r_proto=0
16352 : see if readv exists
16356 : see if recvmsg exists
16357 set recvmsg d_recvmsg
16360 : see if rename exists
16361 set rename d_rename
16364 : see if rmdir exists
16368 : see if memory.h is available.
16373 : See if it conflicts with string.h
16379 $cppstdin $cppflags $cppminus < $strings > mem.h
16380 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
16382 echo "We won't be including <memory.h>."
16392 : can bcopy handle overlapping blocks?
16395 case "$d_memmove" in
16396 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
16397 *) case "$d_bcopy" in
16399 echo "Checking to see if bcopy() can do overlapping copies..." >&4
16401 #$i_memory I_MEMORY
16402 #$i_stdlib I_STDLIB
16403 #$i_string I_STRING
16404 #$i_unistd I_UNISTD
16406 $cat >>try.c <<'EOCP'
16409 # include <memory.h>
16412 # include <stdlib.h>
16415 # include <string.h>
16417 # include <strings.h>
16420 # include <unistd.h> /* Needed for NetBSD */
16424 char buf[128], abc[128];
16430 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16431 try to store the string in read-only memory. */
16432 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
16434 for (align = 7; align >= 0; align--) {
16435 for (len = 36; len; len--) {
16437 bcopy(abc, b, len);
16438 for (off = 1; off <= len; off++) {
16439 bcopy(b, b+off, len);
16440 bcopy(b+off, b, len);
16441 if (bcmp(b, abc, len))
16450 if eval $compile_ok; then
16451 if $run ./try 2>/dev/null; then
16452 echo "Yes, it can."
16455 echo "It can't, sorry."
16458 echo "(I can't compile the test program, so we'll assume not...)"
16468 : can memcpy handle overlapping blocks?
16471 case "$d_memmove" in
16472 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
16473 *) case "$d_memcpy" in
16475 echo "Checking to see if memcpy() can do overlapping copies..." >&4
16477 #$i_memory I_MEMORY
16478 #$i_stdlib I_STDLIB
16479 #$i_string I_STRING
16480 #$i_unistd I_UNISTD
16482 $cat >>try.c <<'EOCP'
16485 # include <memory.h>
16488 # include <stdlib.h>
16491 # include <string.h>
16493 # include <strings.h>
16496 # include <unistd.h> /* Needed for NetBSD */
16500 char buf[128], abc[128];
16506 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16507 try to store the string in read-only memory. */
16508 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
16510 for (align = 7; align >= 0; align--) {
16511 for (len = 36; len; len--) {
16513 memcpy(b, abc, len);
16514 for (off = 1; off <= len; off++) {
16515 memcpy(b+off, b, len);
16516 memcpy(b, b+off, len);
16517 if (memcmp(b, abc, len))
16526 if eval $compile_ok; then
16527 if $run ./try 2>/dev/null; then
16528 echo "Yes, it can."
16531 echo "It can't, sorry."
16534 echo "(I can't compile the test program, so we'll assume not...)"
16544 : can memcmp be trusted to compare relative magnitude?
16546 case "$d_memcmp" in
16549 echo "Checking if your memcmp() can compare relative magnitude..." >&4
16551 #$i_memory I_MEMORY
16552 #$i_stdlib I_STDLIB
16553 #$i_string I_STRING
16554 #$i_unistd I_UNISTD
16556 $cat >>try.c <<'EOCP'
16559 # include <memory.h>
16562 # include <stdlib.h>
16565 # include <string.h>
16567 # include <strings.h>
16570 # include <unistd.h> /* Needed for NetBSD */
16576 if ((a < b) && memcmp(&a, &b, 1) < 0)
16582 if eval $compile_ok; then
16583 if $run ./try 2>/dev/null; then
16584 echo "Yes, it can."
16587 echo "No, it can't (it uses signed chars)."
16590 echo "(I can't compile the test program, so we'll assume not...)"
16598 : see if prototype for sbrk is available
16600 set d_sbrkproto sbrk $i_unistd unistd.h
16603 : see if select exists
16604 set select d_select
16607 : see if semctl exists
16608 set semctl d_semctl
16611 : see if semget exists
16612 set semget d_semget
16615 : see if semop exists
16619 : see how much of the 'sem*(2)' library is present.
16622 case "$d_semctl$d_semget$d_semop" in
16623 *"$undef"*) h_sem=false;;
16627 case "`ipcs 2>&1`" in
16628 "SVID messages"*"not configured"*)
16629 echo "Your $osname does not have the sem*(2) configured." >&4
16632 set semctl d_semctl
16634 set semget d_semget
16642 : we could also check for sys/ipc.h ...
16643 if $h_sem && $test `./findhdr sys/sem.h`; then
16644 echo "You have the full sem*(2) library." >&4
16647 echo "You don't have the full sem*(2) library." >&4
16653 : see whether sys/sem.h defines union semun
16655 $cat > try.c <<'END'
16656 #include <sys/types.h>
16657 #include <sys/ipc.h>
16658 #include <sys/sem.h>
16659 int main () { union semun semun; semun.buf = 0; }
16662 if eval $compile; then
16663 echo "You have union semun in <sys/sem.h>." >&4
16666 echo "You do not have union semun in <sys/sem.h>." >&4
16673 : see how to do semctl IPC_STAT
16677 $cat > tryh.h <<END
16680 # define S_IRUSR S_IREAD
16681 # define S_IWUSR S_IWRITE
16682 # define S_IXUSR S_IEXEC
16684 # define S_IRUSR 0400
16685 # define S_IWUSR 0200
16686 # define S_IXUSR 0100
16688 # define S_IRGRP (S_IRUSR>>3)
16689 # define S_IWGRP (S_IWUSR>>3)
16690 # define S_IXGRP (S_IXUSR>>3)
16691 # define S_IROTH (S_IRUSR>>6)
16692 # define S_IWOTH (S_IWUSR>>6)
16693 # define S_IXOTH (S_IXUSR>>6)
16696 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
16697 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
16698 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
16701 : see whether semctl IPC_STAT can use union semun
16702 case "$d_semctl_semun" in
16706 #include <sys/types.h>
16707 #include <sys/ipc.h>
16708 #include <sys/sem.h>
16709 #include <sys/stat.h>
16716 #$d_union_semun HAS_UNION_SEMUN
16719 #ifndef HAS_UNION_SEMUN
16722 struct semid_ds *buf;
16723 unsigned short *array;
16729 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16730 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16732 struct semid_ds argbuf;
16735 st = semctl(sem, 0, IPC_STAT, arg);
16739 # endif /* IPC_STAT */
16740 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16742 if (semctl(sem, 0, IPC_RMID, arg) != 0)
16743 # endif /* IPC_RMID */
16744 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16746 #endif /* IPC_PRIVATE && ... */
16747 printf("semget failed: errno = %d\n", errno);
16752 if eval $compile; then
16755 semun) val="$define" ;;
16763 case "$d_semctl_semun" in
16765 echo "You can use union semun for semctl IPC_STAT." >&4
16768 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
16773 : see whether semctl IPC_STAT can use struct semid_ds pointer
16774 case "$d_semctl_semid_ds" in
16777 $cat > try.c <<'END'
16778 #include <sys/types.h>
16779 #include <sys/ipc.h>
16780 #include <sys/sem.h>
16781 #include <sys/stat.h>
16789 struct semid_ds arg;
16792 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16793 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16796 st = semctl(sem, 0, IPC_STAT, &arg);
16798 printf("semid_ds\n");
16800 # endif /* IPC_STAT */
16801 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16803 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
16804 # endif /* IPC_RMID */
16805 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16807 #endif /* IPC_PRIVATE && ... */
16808 printf("semget failed: errno = %d\n", errno);
16814 if eval $compile; then
16817 semid_ds) val="$define" ;;
16821 set d_semctl_semid_ds
16825 case "$d_semctl_semid_ds" in
16827 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
16829 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
16835 # We do not have the full sem*(2) library, so assume we can not
16841 set d_semctl_semid_ds
16847 : see if sendmsg exists
16848 set sendmsg d_sendmsg
16851 : see if setegid exists
16852 set setegid d_setegid
16855 : see if seteuid exists
16856 set seteuid d_seteuid
16859 : see if setgrent exists
16860 set setgrent d_setgrent
16863 : see if setgrent_r exists
16864 set setgrent_r d_setgrent_r
16866 case "$d_setgrent_r" in
16868 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
16869 case "$d_setgrent_r_proto:$usethreads" in
16870 ":define") d_setgrent_r_proto=define
16871 set d_setgrent_r_proto setgrent_r $hdrs
16875 case "$d_setgrent_r_proto" in
16877 case "$setgrent_r_proto" in
16878 ''|0) try='int setgrent_r(FILE**);'
16879 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=I_H ;;
16881 case "$setgrent_r_proto" in
16882 ''|0) try='void setgrent_r(FILE**);'
16883 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=V_H ;;
16885 case "$setgrent_r_proto" in
16886 ''|0) d_setgrent_r=undef
16888 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
16889 * ) case "$setgrent_r_proto" in
16890 REENTRANT_PROTO*) ;;
16891 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
16893 echo "Prototype: $try" ;;
16896 *) case "$usethreads" in
16897 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
16904 *) setgrent_r_proto=0
16908 : see if sethostent exists
16909 set sethostent d_sethent
16912 : see if sethostent_r exists
16913 set sethostent_r d_sethostent_r
16915 case "$d_sethostent_r" in
16917 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16918 case "$d_sethostent_r_proto:$usethreads" in
16919 ":define") d_sethostent_r_proto=define
16920 set d_sethostent_r_proto sethostent_r $hdrs
16924 case "$d_sethostent_r_proto" in
16926 case "$sethostent_r_proto" in
16927 ''|0) try='int sethostent_r(int, struct hostent_data*);'
16928 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=I_ID ;;
16930 case "$sethostent_r_proto" in
16931 ''|0) try='void sethostent_r(int, struct hostent_data*);'
16932 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=V_ID ;;
16934 case "$sethostent_r_proto" in
16935 ''|0) d_sethostent_r=undef
16936 sethostent_r_proto=0
16937 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
16938 * ) case "$sethostent_r_proto" in
16939 REENTRANT_PROTO*) ;;
16940 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
16942 echo "Prototype: $try" ;;
16945 *) case "$usethreads" in
16946 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
16948 d_sethostent_r=undef
16949 sethostent_r_proto=0
16953 *) sethostent_r_proto=0
16957 : see if setitimer exists
16958 set setitimer d_setitimer
16961 : see if setlinebuf exists
16962 set setlinebuf d_setlinebuf
16965 : see if setlocale exists
16966 set setlocale d_setlocale
16969 : see if locale.h is available
16970 set locale.h i_locale
16973 : see if setlocale_r exists
16974 set setlocale_r d_setlocale_r
16976 case "$d_setlocale_r" in
16978 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
16979 case "$d_setlocale_r_proto:$usethreads" in
16980 ":define") d_setlocale_r_proto=define
16981 set d_setlocale_r_proto setlocale_r $hdrs
16985 case "$d_setlocale_r_proto" in
16987 case "$setlocale_r_proto" in
16988 ''|0) try='int setlocale_r(int, const char*, char*, int);'
16989 ./protochk "$extern_C $try" $hdrs && setlocale_r_proto=I_ICBI ;;
16991 case "$setlocale_r_proto" in
16992 ''|0) d_setlocale_r=undef
16993 setlocale_r_proto=0
16994 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
16995 * ) case "$setlocale_r_proto" in
16996 REENTRANT_PROTO*) ;;
16997 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
16999 echo "Prototype: $try" ;;
17002 *) case "$usethreads" in
17003 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
17005 d_setlocale_r=undef
17006 setlocale_r_proto=0
17010 *) setlocale_r_proto=0
17014 : see if setnetent exists
17015 set setnetent d_setnent
17018 : see if setnetent_r exists
17019 set setnetent_r d_setnetent_r
17021 case "$d_setnetent_r" in
17023 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17024 case "$d_setnetent_r_proto:$usethreads" in
17025 ":define") d_setnetent_r_proto=define
17026 set d_setnetent_r_proto setnetent_r $hdrs
17030 case "$d_setnetent_r_proto" in
17032 case "$setnetent_r_proto" in
17033 ''|0) try='int setnetent_r(int, struct netent_data*);'
17034 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=I_ID ;;
17036 case "$setnetent_r_proto" in
17037 ''|0) try='void setnetent_r(int, struct netent_data*);'
17038 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=V_ID ;;
17040 case "$setnetent_r_proto" in
17041 ''|0) d_setnetent_r=undef
17042 setnetent_r_proto=0
17043 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
17044 * ) case "$setnetent_r_proto" in
17045 REENTRANT_PROTO*) ;;
17046 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
17048 echo "Prototype: $try" ;;
17051 *) case "$usethreads" in
17052 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
17054 d_setnetent_r=undef
17055 setnetent_r_proto=0
17059 *) setnetent_r_proto=0
17063 : see if setprotoent exists
17064 set setprotoent d_setpent
17067 : see if setpgid exists
17068 set setpgid d_setpgid
17071 : see if setpgrp2 exists
17072 set setpgrp2 d_setpgrp2
17075 : see if setpriority exists
17076 set setpriority d_setprior
17079 : see if setproctitle exists
17080 set setproctitle d_setproctitle
17083 : see if setprotoent_r exists
17084 set setprotoent_r d_setprotoent_r
17086 case "$d_setprotoent_r" in
17088 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17089 case "$d_setprotoent_r_proto:$usethreads" in
17090 ":define") d_setprotoent_r_proto=define
17091 set d_setprotoent_r_proto setprotoent_r $hdrs
17095 case "$d_setprotoent_r_proto" in
17097 case "$setprotoent_r_proto" in
17098 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
17099 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=I_ID ;;
17101 case "$setprotoent_r_proto" in
17102 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
17103 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=V_ID ;;
17105 case "$setprotoent_r_proto" in
17106 ''|0) d_setprotoent_r=undef
17107 setprotoent_r_proto=0
17108 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
17109 * ) case "$setprotoent_r_proto" in
17110 REENTRANT_PROTO*) ;;
17111 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
17113 echo "Prototype: $try" ;;
17116 *) case "$usethreads" in
17117 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
17119 d_setprotoent_r=undef
17120 setprotoent_r_proto=0
17124 *) setprotoent_r_proto=0
17128 : see if setpwent exists
17129 set setpwent d_setpwent
17132 : see if setpwent_r exists
17133 set setpwent_r d_setpwent_r
17135 case "$d_setpwent_r" in
17137 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
17138 case "$d_setpwent_r_proto:$usethreads" in
17139 ":define") d_setpwent_r_proto=define
17140 set d_setpwent_r_proto setpwent_r $hdrs
17144 case "$d_setpwent_r_proto" in
17146 case "$setpwent_r_proto" in
17147 ''|0) try='int setpwent_r(FILE**);'
17148 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=I_H ;;
17150 case "$setpwent_r_proto" in
17151 ''|0) try='void setpwent_r(FILE**);'
17152 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=V_H ;;
17154 case "$setpwent_r_proto" in
17155 ''|0) d_setpwent_r=undef
17157 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
17158 * ) case "$setpwent_r_proto" in
17159 REENTRANT_PROTO*) ;;
17160 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
17162 echo "Prototype: $try" ;;
17165 *) case "$usethreads" in
17166 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
17173 *) setpwent_r_proto=0
17177 : see if setregid exists
17178 set setregid d_setregid
17180 set setresgid d_setresgid
17183 : see if setreuid exists
17184 set setreuid d_setreuid
17186 set setresuid d_setresuid
17189 : see if setrgid exists
17190 set setrgid d_setrgid
17193 : see if setruid exists
17194 set setruid d_setruid
17197 : see if setservent exists
17198 set setservent d_setsent
17201 : see if setservent_r exists
17202 set setservent_r d_setservent_r
17204 case "$d_setservent_r" in
17206 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17207 case "$d_setservent_r_proto:$usethreads" in
17208 ":define") d_setservent_r_proto=define
17209 set d_setservent_r_proto setservent_r $hdrs
17213 case "$d_setservent_r_proto" in
17215 case "$setservent_r_proto" in
17216 ''|0) try='int setservent_r(int, struct servent_data*);'
17217 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=I_ID ;;
17219 case "$setservent_r_proto" in
17220 ''|0) try='void setservent_r(int, struct servent_data*);'
17221 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=V_ID ;;
17223 case "$setservent_r_proto" in
17224 ''|0) d_setservent_r=undef
17225 setservent_r_proto=0
17226 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
17227 * ) case "$setservent_r_proto" in
17228 REENTRANT_PROTO*) ;;
17229 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
17231 echo "Prototype: $try" ;;
17234 *) case "$usethreads" in
17235 define) echo "setservent_r has no prototype, not using it." >&4 ;;
17237 d_setservent_r=undef
17238 setservent_r_proto=0
17242 *) setservent_r_proto=0
17246 : see if setsid exists
17247 set setsid d_setsid
17250 : see if setvbuf exists
17251 set setvbuf d_setvbuf
17254 : see if sfio.h is available
17258 : see if sfio library is available
17269 : Ok, but do we want to use it.
17273 true|$define|[yY]*) dflt='y';;
17276 echo "$package can use the sfio library, but it is experimental."
17277 case "$useperlio" in
17279 echo "For sfio also the PerlIO abstraction layer is needed."
17280 echo "Earlier you said you wouldn't want that."
17283 rp="You seem to have sfio available, do you want to try using it?"
17286 y|Y) echo "Ok, turning on both sfio and PerlIO, then."
17287 useperlio="$define"
17290 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
17295 *) case "$usesfio" in
17296 true|$define|[yY]*)
17297 echo "Sorry, cannot find sfio on this machine." >&4
17298 echo "Ignoring your setting of usesfio=$usesfio." >&4
17307 $define) usesfio='true';;
17308 *) usesfio='false';;
17312 *) : Remove sfio from list of libraries to use
17315 echo "Removing unneeded -lsfio from library list" >&4
17316 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
17319 echo "libs = $libs" >&4
17326 : see if shmctl exists
17327 set shmctl d_shmctl
17330 : see if shmget exists
17331 set shmget d_shmget
17334 : see if shmat exists
17337 : see what shmat returns
17340 $cat >shmat.c <<'END'
17341 #include <sys/shm.h>
17344 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
17349 echo "and it returns ($shmattype)." >&4
17350 : see if a prototype for shmat is available
17351 xxx=`./findhdr sys/shm.h`
17352 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
17353 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
17364 set d_shmatprototype
17367 : see if shmdt exists
17371 : see how much of the 'shm*(2)' library is present.
17374 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
17375 *"$undef"*) h_shm=false;;
17379 case "`ipcs 2>&1`" in
17380 "SVID shared memory"*"not configured"*)
17381 echo "Your $osname does not have the shm*(2) configured." >&4
17384 set shmctl d_shmctl
17386 set shmget d_shmget
17396 : we could also check for sys/ipc.h ...
17397 if $h_shm && $test `./findhdr sys/shm.h`; then
17398 echo "You have the full shm*(2) library." >&4
17401 echo "You don't have the full shm*(2) library." >&4
17407 : see if we have sigaction
17409 if set sigaction val -f d_sigaction; eval $csym; $val; then
17410 echo 'sigaction() found.' >&4
17413 #include <sys/types.h>
17414 #include <signal.h>
17415 #$i_stdlib I_STDLIB
17417 #include <stdlib.h>
17421 struct sigaction act, oact;
17423 oact.sa_handler = 0;
17424 /* so that act and oact are used */
17425 exit(act.sa_flags == 0 && oact.sa_handler == 0);
17429 if eval $compile_ok; then
17432 echo "But you don't seem to have a useable struct sigaction." >&4
17436 echo 'sigaction NOT found.' >&4
17439 set d_sigaction; eval $setvar
17442 : see if this is a sunmath.h system
17443 set sunmath.h i_sunmath
17446 : see if signbit exists
17447 $echo $n "Checking to see if you have signbit() available to work on $nvtype... $c" >&4
17450 #$i_sunmath I_SUNMATH
17454 #ifdef I_SUNMATH /* Solaris special math library */
17455 # include <sunmath.h>
17458 int main(int argc, char **argv)
17462 if ((signbit(x) == 0) && (signbit(y) != 0))
17470 if eval $compile; then
17471 if $run ./try; then
17475 $echo "Signbit seems to be available, but doesn't work as I expected."
17476 $echo "I won't use it." >&4
17487 : see if sigprocmask exists
17488 set sigprocmask d_sigprocmask
17491 : see if sigsetjmp exists
17493 case "$d_sigsetjmp" in
17496 #include <setjmp.h>
17497 #$i_stdlib I_STDLIB
17499 #include <stdlib.h>
17505 if (sigsetjmp(env,1))
17508 siglongjmp(env, 1);
17513 if eval $compile; then
17514 if $run ./try >/dev/null 2>&1; then
17515 echo "POSIX sigsetjmp found." >&4
17519 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
17525 echo "sigsetjmp not found." >&4
17529 *) val="$d_sigsetjmp"
17530 case "$d_sigsetjmp" in
17531 $define) echo "POSIX sigsetjmp found." >&4;;
17532 $undef) echo "sigsetjmp not found." >&4;;
17540 : see if snprintf exists
17541 set snprintf d_snprintf
17544 : see if vsnprintf exists
17545 set vsnprintf d_vsnprintf
17548 case "$d_snprintf-$d_vsnprintf" in
17551 Checking whether your snprintf() and vsnprintf() work okay...
17553 $cat >try.c <<'EOCP'
17554 /* v?snprintf testing logic courtesy of Russ Allbery.
17555 * According to C99:
17556 * - if the buffer is too short it still must be \0-terminated
17557 * - if the buffer is too short the potentially required length
17558 * must be returned and not -1
17559 * - if the buffer is NULL the potentially required length
17560 * must be returned and not -1 or core dump
17563 #include <stdarg.h>
17567 int test (char *format, ...)
17572 va_start (args, format);
17573 count = vsnprintf (buf, sizeof buf, format, args);
17580 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
17581 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
17585 if eval $compile; then
17588 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
17590 Your snprintf() and snprintf() don't seem to be working okay.
17592 d_snprintf="$undef"
17593 d_vsnprintf="$undef"
17597 echo "(I can't seem to compile the test program--assuming they don't)"
17598 d_snprintf="$undef"
17599 d_vsnprintf="$undef"
17605 : see if sockatmark exists
17606 set sockatmark d_sockatmark
17609 : see if prototype for sockatmark is available
17611 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
17614 : see if socks5_init exists
17615 set socks5_init d_socks5_init
17618 : see if sprintf returns the length of the string in the buffer as per ANSI
17619 $echo "Checking whether sprintf returns the length of the string..." >&4
17622 #$i_stdlib I_STDLIB
17624 #include <stdlib.h>
17626 #$i_string I_STRING
17628 # include <string.h>
17630 # include <strings.h>
17639 int check (size_t expect, int test) {
17640 size_t got = strlen(buffer);
17644 printf("expected %ld, got %ld in test %d '%s'\n", (long) expect, (long) got,
17649 int main(int argc, char **argv) {
17652 check(sprintf(buffer, ""), ++test);
17653 check(sprintf(buffer, "%s %s", "perl", "rules"), ++test);
17654 check(sprintf(buffer, "I like %g", atan2(0,-1)), ++test);
17661 if eval $compile; then
17665 sprintf returns the length of the string (as ANSI says it should)
17667 d_sprintf_returns_strlen="$define"
17670 sprintf does not return the length of the string (how old is this system?)
17672 d_sprintf_returns_strlen="$undef"
17676 echo "(I can't seem to compile the test program--assuming it doesn't)" >&4
17677 d_sprintf_returns_strlen="$undef"
17681 : see if srand48_r exists
17682 set srand48_r d_srand48_r
17684 case "$d_srand48_r" in
17686 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17687 case "$d_srand48_r_proto:$usethreads" in
17688 ":define") d_srand48_r_proto=define
17689 set d_srand48_r_proto srand48_r $hdrs
17693 case "$d_srand48_r_proto" in
17695 case "$srand48_r_proto" in
17696 ''|0) try='int srand48_r(long, struct drand48_data*);'
17697 ./protochk "$extern_C $try" $hdrs && srand48_r_proto=I_LS ;;
17699 case "$srand48_r_proto" in
17700 ''|0) d_srand48_r=undef
17702 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
17703 * ) case "$srand48_r_proto" in
17704 REENTRANT_PROTO*) ;;
17705 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
17707 echo "Prototype: $try" ;;
17710 *) case "$usethreads" in
17711 define) echo "srand48_r has no prototype, not using it." >&4 ;;
17718 *) srand48_r_proto=0
17722 : see if srandom_r exists
17723 set srandom_r d_srandom_r
17725 case "$d_srandom_r" in
17727 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17728 case "$d_srandom_r_proto:$usethreads" in
17729 ":define") d_srandom_r_proto=define
17730 set d_srandom_r_proto srandom_r $hdrs
17734 case "$d_srandom_r_proto" in
17736 case "$srandom_r_proto" in
17737 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
17738 ./protochk "$extern_C $try" $hdrs && srandom_r_proto=I_TS ;;
17740 case "$srandom_r_proto" in
17741 ''|0) d_srandom_r=undef
17743 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
17744 * ) case "$srandom_r_proto" in
17745 REENTRANT_PROTO*) ;;
17746 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
17748 echo "Prototype: $try" ;;
17751 *) case "$usethreads" in
17752 define) echo "srandom_r has no prototype, not using it." >&4 ;;
17759 *) srandom_r_proto=0
17763 : see if prototype for setresgid is available
17765 set d_sresgproto setresgid $i_unistd unistd.h
17768 : see if prototype for setresuid is available
17770 set d_sresuproto setresuid $i_unistd unistd.h
17773 : see if sys/stat.h is available
17774 set sys/stat.h i_sysstat
17777 : see if stat knows about block sizes
17779 echo "Checking to see if your struct stat has st_blocks field..." >&4
17780 set d_statblks stat st_blocks $i_sysstat sys/stat.h
17783 : see if this is a sys/vfs.h system
17784 set sys/vfs.h i_sysvfs
17787 : see if this is a sys/statfs.h system
17788 set sys/statfs.h i_sysstatfs
17791 : Check for statfs_s
17793 echo "Checking to see if your system supports struct statfs..." >&4
17794 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
17796 case "$d_statfs_s" in
17797 "$define") echo "Yes, it does." ;;
17798 *) echo "No, it doesn't." ;;
17802 : see if struct statfs knows about f_flags
17803 case "$d_statfs_s" in
17806 echo "Checking to see if your struct statfs has f_flags field..." >&4
17807 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
17811 set d_statfs_f_flags
17815 case "$d_statfs_f_flags" in
17816 "$define") echo "Yes, it does." ;;
17817 *) echo "No, it doesn't." ;;
17820 : Check stream access
17822 Checking how to access stdio streams by file descriptor number...
17824 case "$stdio_stream_array" in
17825 '') $cat >try.c <<EOCP
17828 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
17832 for s in _iob __iob __sF
17834 set try -DSTDIO_STREAM_ARRAY=$s
17835 if eval $compile; then
17836 case "`$run ./try`" in
17837 yes) stdio_stream_array=$s; break ;;
17843 case "$stdio_stream_array" in
17845 I can't figure out how to access stdio streams by file descriptor number.
17847 d_stdio_stream_array="$undef"
17850 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
17852 d_stdio_stream_array="$define"
17856 : see if strcoll exists
17857 set strcoll d_strcoll
17860 : check for structure copying
17862 echo "Checking to see if your C compiler can copy structs..." >&4
17863 $cat >try.c <<'EOCP'
17873 if $cc -c try.c >/dev/null 2>&1 ; then
17875 echo "Yup, it can."
17878 echo "Nope, it can't."
17884 : see if strerror and/or sys_errlist[] exist
17886 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
17887 if set strerror val -f d_strerror; eval $csym; $val; then
17888 echo 'strerror() found.' >&4
17889 d_strerror="$define"
17890 d_strerrm='strerror(e)'
17891 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17892 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
17893 d_syserrlst="$define"
17895 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
17896 d_syserrlst="$undef"
17898 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
17899 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
17900 echo 'strerror() found in string header.' >&4
17901 d_strerror="$define"
17902 d_strerrm='strerror(e)'
17903 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17904 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
17905 d_syserrlst="$define"
17907 echo "(You don't appear to have any sys_errlist[], how can this be?)"
17908 d_syserrlst="$undef"
17910 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17911 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
17912 d_strerror="$undef"
17913 d_syserrlst="$define"
17914 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
17916 echo 'strerror() and sys_errlist[] NOT found.' >&4
17917 d_strerror="$undef"
17918 d_syserrlst="$undef"
17919 d_strerrm='"unknown"'
17923 : see if strerror_r exists
17924 set strerror_r d_strerror_r
17926 case "$d_strerror_r" in
17928 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
17929 case "$d_strerror_r_proto:$usethreads" in
17930 ":define") d_strerror_r_proto=define
17931 set d_strerror_r_proto strerror_r $hdrs
17935 case "$d_strerror_r_proto" in
17937 case "$strerror_r_proto" in
17938 ''|0) try='int strerror_r(int, char*, size_t);'
17939 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBW ;;
17941 case "$strerror_r_proto" in
17942 ''|0) try='int strerror_r(int, char*, int);'
17943 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBI ;;
17945 case "$strerror_r_proto" in
17946 ''|0) try='char* strerror_r(int, char*, size_t);'
17947 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=B_IBW ;;
17949 case "$strerror_r_proto" in
17950 ''|0) d_strerror_r=undef
17952 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
17953 * ) case "$strerror_r_proto" in
17954 REENTRANT_PROTO*) ;;
17955 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
17957 echo "Prototype: $try" ;;
17960 *) case "$usethreads" in
17961 define) echo "strerror_r has no prototype, not using it." >&4 ;;
17968 *) strerror_r_proto=0
17972 : see if strftime exists
17973 set strftime d_strftime
17976 : see if strlcat exists
17977 set strlcat d_strlcat
17980 : see if strlcpy exists
17981 set strlcpy d_strlcpy
17984 : see if strtod exists
17985 set strtod d_strtod
17988 : see if strtol exists
17989 set strtol d_strtol
17992 : see if strtold exists
17993 set strtold d_strtold
17996 : see if strtoll exists
17997 set strtoll d_strtoll
18000 case "$d_longlong-$d_strtoll" in
18003 Checking whether your strtoll() works okay...
18005 $cat >try.c <<'EOCP'
18008 #define strtoll __strtoll
18011 #define strtoll _strtoll
18014 extern long long int strtoll(char *s, char **, int);
18015 static int bad = 0;
18016 int check(char *s, long long ell, int een) {
18019 gll = strtoll(s, 0, 10);
18020 if (!((gll == ell) && (errno == een)))
18024 check(" 1", 1LL, 0);
18025 check(" 0", 0LL, 0);
18026 check("-1", -1LL, 0);
18027 check("-9223372036854775808", -9223372036854775808LL, 0);
18028 check("-9223372036854775808", -9223372036854775808LL, 0);
18029 check(" 9223372036854775807", 9223372036854775807LL, 0);
18030 check("-9223372036854775808", -9223372036854775808LL, 0);
18031 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
18032 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
18038 if eval $compile; then
18041 ok) echo "Your strtoll() seems to be working okay." ;;
18043 Your strtoll() doesn't seem to be working okay.
18049 echo "(I can't seem to compile the test program--assuming it doesn't)"
18055 : see if strtoq exists
18056 set strtoq d_strtoq
18059 : see if strtoul exists
18060 set strtoul d_strtoul
18063 case "$d_strtoul" in
18066 Checking whether your strtoul() works okay...
18068 $cat >try.c <<'EOCP'
18071 extern unsigned long int strtoul(char *s, char **, int);
18072 static int bad = 0;
18073 void check(char *s, unsigned long eul, int een) {
18076 gul = strtoul(s, 0, 10);
18077 if (!((gul == eul) && (errno == een)))
18081 check(" 1", 1L, 0);
18082 check(" 0", 0L, 0);
18084 case "$longsize" in
18086 $cat >>try.c <<'EOCP'
18087 check("18446744073709551615", 18446744073709551615UL, 0);
18088 check("18446744073709551616", 18446744073709551615UL, ERANGE);
18089 #if 0 /* strtoul() for /^-/ strings is undefined. */
18090 check("-1", 18446744073709551615UL, 0);
18091 check("-18446744073709551614", 2, 0);
18092 check("-18446744073709551615", 1, 0);
18093 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
18094 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
18099 $cat >>try.c <<'EOCP'
18100 check("4294967295", 4294967295UL, 0);
18101 check("4294967296", 4294967295UL, ERANGE);
18102 #if 0 /* strtoul() for /^-/ strings is undefined. */
18103 check("-1", 4294967295UL, 0);
18104 check("-4294967294", 2, 0);
18105 check("-4294967295", 1, 0);
18106 check("-4294967296", 4294967295UL, ERANGE);
18107 check("-4294967297", 4294967295UL, ERANGE);
18112 : Should we write these tests to be more portable by sprintf-ing
18113 : ~0 and then manipulating that char string as input for strtol?
18116 $cat >>try.c <<'EOCP'
18123 if eval $compile; then
18124 case "`$run ./try`" in
18125 ok) echo "Your strtoul() seems to be working okay." ;;
18127 Your strtoul() doesn't seem to be working okay.
18133 echo "(I can't seem to compile the test program--assuming it doesn't)"
18139 : see if strtoull exists
18140 set strtoull d_strtoull
18143 case "$d_longlong-$d_strtoull" in
18146 Checking whether your strtoull() works okay...
18148 $cat >try.c <<'EOCP'
18151 #define strtoull __strtoull
18154 extern unsigned long long int strtoull(char *s, char **, int);
18155 static int bad = 0;
18156 int check(char *s, long long eull, int een) {
18159 gull = strtoull(s, 0, 10);
18160 if (!((gull == eull) && (errno == een)))
18164 check(" 1", 1LL, 0);
18165 check(" 0", 0LL, 0);
18166 check("18446744073709551615", 18446744073709551615ULL, 0);
18167 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
18168 #if 0 /* strtoull() for /^-/ strings is undefined. */
18169 check("-1", 18446744073709551615ULL, 0);
18170 check("-18446744073709551614", 2LL, 0);
18171 check("-18446744073709551615", 1LL, 0);
18172 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
18173 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
18180 if eval $compile; then
18181 case "`$run ./try`" in
18182 ok) echo "Your strtoull() seems to be working okay." ;;
18184 Your strtoull() doesn't seem to be working okay.
18186 d_strtoull="$undef"
18190 echo "(I can't seem to compile the test program--assuming it doesn't)"
18191 d_strtoull="$undef"
18196 : see if strtouq exists
18197 set strtouq d_strtouq
18200 case "$d_strtouq" in
18203 Checking whether your strtouq() works okay...
18205 $cat >try.c <<'EOCP'
18208 extern unsigned long long int strtouq(char *s, char **, int);
18209 static int bad = 0;
18210 void check(char *s, unsigned long long eull, int een) {
18211 unsigned long long gull;
18213 gull = strtouq(s, 0, 10);
18214 if (!((gull == eull) && (errno == een)))
18218 check(" 1", 1LL, 0);
18219 check(" 0", 0LL, 0);
18220 check("18446744073709551615", 18446744073709551615ULL, 0);
18221 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
18222 #if 0 /* strtouq() for /^-/ strings is undefined. */
18223 check("-1", 18446744073709551615ULL, 0);
18224 check("-18446744073709551614", 2LL, 0);
18225 check("-18446744073709551615", 1LL, 0);
18226 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
18227 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
18235 if eval $compile; then
18236 case "`$run ./try`" in
18237 ok) echo "Your strtouq() seems to be working okay." ;;
18239 Your strtouq() doesn't seem to be working okay.
18245 echo "(I can't seem to compile the test program--assuming it doesn't)"
18251 : see if strxfrm exists
18252 set strxfrm d_strxfrm
18255 : see if symlink exists
18256 set symlink d_symlink
18259 : see if syscall exists
18260 set syscall d_syscall
18263 : see if prototype for syscall is available
18265 set d_syscallproto syscall $i_unistd unistd.h
18268 : see if sysconf exists
18269 set sysconf d_sysconf
18272 : see if system exists
18273 set system d_system
18276 : see if tcgetpgrp exists
18277 set tcgetpgrp d_tcgetpgrp
18280 : see if tcsetpgrp exists
18281 set tcsetpgrp d_tcsetpgrp
18284 : see if prototype for telldir is available
18286 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
18289 : see if time exists
18291 if test "X$d_time" = X -o X"$timetype" = X; then
18292 if set time val -f d_time; eval $csym; $val; then
18293 echo 'time() found.' >&4
18295 rp="What is the type returned by time() on this system?"
18296 set time_t timetype long stdio.h sys/types.h
18299 echo 'time() not found, hope that will do.' >&4
18307 : see if timegm exists
18308 set timegm d_timegm
18311 : see if this is a sys/times.h system
18312 set sys/times.h i_systimes
18315 : see if times exists
18317 if set times val -f d_times; eval $csym; $val; then
18318 echo 'times() found.' >&4
18321 case "$i_systimes" in
18322 "$define") inc='sys/times.h';;
18324 rp="What is the type returned by times() on this system?"
18325 set clock_t clocktype long stdio.h sys/types.h $inc
18328 echo 'times() NOT found, hope that will do.' >&4
18333 : see if tmpnam_r exists
18334 set tmpnam_r d_tmpnam_r
18336 case "$d_tmpnam_r" in
18338 hdrs="$i_systypes sys/types.h define stdio.h "
18339 case "$d_tmpnam_r_proto:$usethreads" in
18340 ":define") d_tmpnam_r_proto=define
18341 set d_tmpnam_r_proto tmpnam_r $hdrs
18345 case "$d_tmpnam_r_proto" in
18347 case "$tmpnam_r_proto" in
18348 ''|0) try='char* tmpnam_r(char*);'
18349 ./protochk "$extern_C $try" $hdrs && tmpnam_r_proto=B_B ;;
18351 case "$tmpnam_r_proto" in
18352 ''|0) d_tmpnam_r=undef
18354 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
18355 * ) case "$tmpnam_r_proto" in
18356 REENTRANT_PROTO*) ;;
18357 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
18359 echo "Prototype: $try" ;;
18362 *) case "$usethreads" in
18363 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
18370 *) tmpnam_r_proto=0
18374 : see if truncate exists
18375 set truncate d_truncate
18378 : see if ttyname_r exists
18379 set ttyname_r d_ttyname_r
18381 case "$d_ttyname_r" in
18383 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
18384 case "$d_ttyname_r_proto:$usethreads" in
18385 ":define") d_ttyname_r_proto=define
18386 set d_ttyname_r_proto ttyname_r $hdrs
18390 case "$d_ttyname_r_proto" in
18392 case "$ttyname_r_proto" in
18393 ''|0) try='int ttyname_r(int, char*, size_t);'
18394 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBW ;;
18396 case "$ttyname_r_proto" in
18397 ''|0) try='int ttyname_r(int, char*, int);'
18398 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBI ;;
18400 case "$ttyname_r_proto" in
18401 ''|0) try='char* ttyname_r(int, char*, int);'
18402 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=B_IBI ;;
18404 case "$ttyname_r_proto" in
18405 ''|0) d_ttyname_r=undef
18407 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
18408 * ) case "$ttyname_r_proto" in
18409 REENTRANT_PROTO*) ;;
18410 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
18412 echo "Prototype: $try" ;;
18415 *) case "$usethreads" in
18416 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
18423 *) ttyname_r_proto=0
18427 : see if tzname[] exists
18429 if set tzname val -a d_tzname; eval $csym; $val; then
18431 echo 'tzname[] found.' >&4
18434 echo 'tzname[] NOT found.' >&4
18439 : Check if is a multiplatform env
18441 next|rhapsody|darwin) multiarch="$define" ;;
18443 case "$multiarch" in
18444 ''|[nN]*) multiarch="$undef" ;;
18447 : check for ordering of bytes in a UV
18449 case "$usecrosscompile$multiarch" in
18452 You seem to be either cross-compiling or doing a multiarchitecture build,
18453 skipping the byteorder check.
18459 case "$byteorder" in
18462 In the following, larger digits indicate more significance. A big-endian
18463 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
18464 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
18465 machines may have weird orders like 3412. A Cray will report 87654321,
18466 an Alpha will report 12345678. If the test program works the default is
18468 I'm now running the test program...
18472 #$i_stdlib I_STDLIB
18474 #include <stdlib.h>
18476 #include <sys/types.h>
18477 typedef $uvtype UV;
18487 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
18489 u.l = (UV)0x04030201;
18490 for (i = 0; i < $uvsize; i++)
18491 printf("%c", u.c[i]+'0');
18498 if eval $compile && $run ./try > /dev/null; then
18501 [1-4][1-4][1-4][1-4]|12345678|87654321)
18502 echo "(The test program ran ok.)"
18503 echo "byteorder=$dflt"
18506 ????|????????) echo "(The test program ran ok.)" ;;
18507 *) echo "(The test program didn't run right for some reason.)" ;;
18512 (I can't seem to compile the test program. Guessing big-endian...)
18515 case "$xxx_prompt" in
18517 rp="What is the order of bytes in $uvtype?"
18530 : Checking 32bit aligndness
18533 Checking to see whether you can access character data unalignedly...
18535 case "$d_u32align" in
18536 '') $cat >try.c <<EOCP
18538 #$i_stdlib I_STDLIB
18540 #include <stdlib.h>
18542 #define U32 $u32type
18543 #define BYTEORDER 0x$byteorder
18545 #include <signal.h>
18547 $signal_t bletch(int s) { exit(4); }
18550 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
18555 if (sizeof(U32) != 4) {
18556 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
18563 signal(SIGBUS, bletch);
18575 for (i = 0; i < 4; i++) {
18576 up = (U32*)(buf + i);
18577 if (! ((*up == 1 << (8*i)) || /* big-endian */
18578 (*up == 1 << (8*(3-i))) /* little-endian */
18582 printf("read failed (%x)\n", *up);
18588 for (i = 0; i < 4; i++) {
18589 up = (U32*)(buf + i);
18591 if (*up != 0xBeef) {
18592 printf("write failed (%x)\n", *up);
18606 if eval $compile_ok; then
18607 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
18608 $run ./try 2>&1 >/dev/null
18611 You can access character data pretty unalignedly.
18613 d_u32align="$undef"
18616 It seems that you must access character data in an aligned manner.
18618 d_u32align="$define"
18622 rp='Can you access character data at unaligned addresses?'
18626 [yY]*) d_u32align="$undef" ;;
18627 *) d_u32align="$define" ;;
18634 : see if ualarm exists
18635 set ualarm d_ualarm
18638 : see if umask exists
18642 : see if unordered exists
18643 set unordered d_unordered
18646 : see if unsetenv exists
18647 set unsetenv d_unsetenv
18650 : see if usleep exists
18651 set usleep d_usleep
18654 : see if prototype for usleep is available
18656 set d_usleepproto usleep $i_unistd unistd.h
18659 : see if ustat exists
18663 : see if closedir exists
18664 set closedir d_closedir
18667 case "$d_closedir" in
18670 echo "Checking whether closedir() returns a status..." >&4
18672 #$i_dirent I_DIRENT /**/
18673 #$i_sysdir I_SYS_DIR /**/
18674 #$i_sysndir I_SYS_NDIR /**/
18675 #$i_systypes I_SYS_TYPES /**/
18677 #if defined(I_SYS_TYPES)
18678 #include <sys/types.h>
18680 #if defined(I_DIRENT)
18681 #include <dirent.h>
18682 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
18683 #include <sys/dir.h>
18687 #include <sys/ndir.h>
18691 #include <ndir.h> /* may be wrong in the future */
18693 #include <sys/dir.h>
18698 int main() { return closedir(opendir(".")); }
18701 if eval $compile_ok; then
18702 if $run ./try > /dev/null 2>&1 ; then
18703 echo "Yes, it does."
18706 echo "No, it doesn't."
18710 echo "(I can't seem to compile the test program--assuming it doesn't)"
18718 set d_void_closedir
18722 : see if there is a wait4
18726 : see if waitpid exists
18727 set waitpid d_waitpid
18730 : see if wcstombs exists
18731 set wcstombs d_wcstombs
18734 : see if wctomb exists
18735 set wctomb d_wctomb
18738 : see if writev exists
18739 set writev d_writev
18742 : preserve RCS keywords in files with variable substitution, grrr
18747 Revision='$Revision'
18749 : check for alignment requirements
18751 case "$usecrosscompile$multiarch" in
18754 You seem to be either cross-compiling or doing a multiarchitecture build,
18755 skipping the memory alignment check.
18758 case "$alignbytes" in
18759 '') alignbytes=8 ;;
18763 case "$alignbytes" in
18764 '') echo "Checking alignment constraints..." >&4
18765 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
18766 $cat >try.c <<'EOCP'
18767 typedef long double NV;
18770 $cat >try.c <<'EOCP'
18774 $cat >>try.c <<'EOCP'
18782 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
18787 if eval $compile_ok; then
18791 echo "(I can't seem to compile the test program...)"
18794 *) dflt="$alignbytes"
18797 rp="Doubles must be aligned on a how-many-byte boundary?"
18805 : set the base revision
18808 : how do we concatenate cpp tokens here?
18810 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
18811 $cat >cpp_stuff.c <<'EOCP'
18812 #define RCAT(a,b)a/**/b
18813 #define ACAT(a,b)a ## b
18817 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
18818 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
18819 echo "Oh! Smells like ANSI's been here." >&4
18820 echo "We can catify or stringify, separately or together!"
18822 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
18823 echo "Ah, yes! The good old days!" >&4
18824 echo "However, in the good old days we don't know how to stringify and"
18825 echo "catify at the same time."
18829 Hmm, I don't seem to be able to concatenate tokens with your cpp.
18830 You're going to have to edit the values of CAT[2-5] in config.h...
18832 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
18836 : see if this is a db.h system
18842 : Check db version.
18844 echo "Checking Berkeley DB version ..." >&4
18850 #include <sys/types.h>
18852 #$i_stdlib I_STDLIB
18854 #include <stdlib.h>
18857 int main(int argc, char *argv[])
18859 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
18860 int Major, Minor, Patch ;
18861 unsigned long Version ;
18862 (void)db_version(&Major, &Minor, &Patch) ;
18864 printf("%d %d %d %d %d %d\n",
18865 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
18866 Major, Minor, Patch);
18869 printf("You have Berkeley DB Version 2 or greater.\n");
18871 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
18872 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
18873 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
18874 Major, Minor, Patch) ;
18876 /* check that db.h & libdb are compatible */
18877 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
18878 printf("db.h and libdb are incompatible.\n") ;
18882 printf("db.h and libdb are compatible.\n") ;
18884 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
18885 + DB_VERSION_PATCH ;
18887 /* needs to be >= 2.3.4 */
18888 if (Version < 2003004) {
18889 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
18890 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
18896 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
18901 printf("You have Berkeley DB Version 1.\n");
18902 exit(0); /* DB version < 2: the coast is clear. */
18904 exit(1); /* <db.h> not Berkeley DB? */
18910 if eval $compile_ok && $run ./try; then
18911 echo 'Looks OK.' >&4
18913 db_version_major=$1
18914 db_version_minor=$2
18915 db_version_patch=$3
18917 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
18921 : Remove db from list of libraries to use
18922 echo "Removing unusable -ldb from library list" >&4
18923 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
18926 echo "libs = $libs" >&4
18936 : Check the return type needed for hash
18938 echo "Checking return type needed for hash for Berkeley DB ..." >&4
18944 #include <sys/types.h>
18947 #ifndef DB_VERSION_MAJOR
18948 u_int32_t hash_cb (ptr, size)
18956 info.hash = hash_cb;
18960 if $cc $ccflags -c try.c >try.out 2>&1 ; then
18961 if $contains warning try.out >>/dev/null 2>&1 ; then
18964 db_hashtype='u_int32_t'
18967 : XXX Maybe we should just give up here.
18968 db_hashtype=u_int32_t
18970 echo "Help: I can't seem to compile the db test program." >&4
18971 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
18974 echo "Your version of Berkeley DB uses $db_hashtype for hash."
18976 *) db_hashtype=u_int32_t
18981 : Check the return type needed for prefix
18983 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
18989 #include <sys/types.h>
18992 #ifndef DB_VERSION_MAJOR
18993 size_t prefix_cb (key1, key2)
19001 info.prefix = prefix_cb;
19005 if $cc $ccflags -c try.c >try.out 2>&1 ; then
19006 if $contains warning try.out >>/dev/null 2>&1 ; then
19007 db_prefixtype='int'
19009 db_prefixtype='size_t'
19012 db_prefixtype='size_t'
19013 : XXX Maybe we should just give up here.
19015 echo "Help: I can't seem to compile the db test program." >&4
19016 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
19019 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
19021 *) db_prefixtype='size_t'
19025 : How can we generate normalized random numbers ?
19027 echo "Looking for a random number function..." >&4
19028 case "$randfunc" in
19030 if set drand48 val -f; eval $csym; $val; then
19032 echo "Good, found drand48()." >&4
19033 elif set random val -f; eval $csym; $val; then
19035 echo "OK, found random()." >&4
19038 echo "Yick, looks like I have to use rand()." >&4
19049 *-Dmy_rand=*|*-Dmy_srand=*)
19050 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
19051 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
19052 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
19053 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
19057 while $test "$cont"; do
19058 rp="Use which function to generate random numbers?"
19060 if $test "$ans" = "$dflt"; then
19066 if set $ans val -f; eval $csym; $val; then
19070 rp="I cannot find function $ans. Use that name anyway?"
19079 case "$randfunc" in
19081 drand01="drand48()"
19087 case "$randbits" in
19089 echo "Checking to see how many bits your $randfunc() function produces..." >&4
19091 #$i_unistd I_UNISTD
19092 #$i_stdlib I_STDLIB
19095 # include <unistd.h>
19098 # include <stdlib.h>
19103 register unsigned long tmp;
19104 register unsigned long max = 0L;
19106 for (i = 1000; i; i--) {
19107 tmp = (unsigned long) $randfunc();
19108 if (tmp > max) max = tmp;
19110 for (i = 0; max; i++)
19116 if eval $compile_ok; then
19120 echo "(I can't seem to compile the test program...)"
19127 rp="How many bits does your $randfunc() function produce?"
19131 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
19132 seedfunc="s$randfunc"
19133 randseedtype=unsigned
19137 rp="How many bits does your $randfunc() function produce?"
19140 seedfunc="s$randfunc"
19141 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
19142 if set $seedfunc val -f; eval $csym; $val; then
19143 echo "(Using $seedfunc() to seed random generator)"
19145 echo "(Warning: no $seedfunc() to seed random generator)"
19148 randseedtype=unsigned
19155 : Determine if this is an EBCDIC system
19157 echo "Determining whether or not we are on an EBCDIC system..." >&4
19158 $cat >try.c <<'EOM'
19161 if ('M'==0xd4) return 0;
19168 if eval $compile_ok; then
19169 if $run ./try; then
19170 echo "You seem to speak EBCDIC." >&4
19173 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
19176 echo "I'm unable to compile the test program." >&4
19177 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
19183 : Check how to flush
19186 Checking how to flush all pending stdio output...
19188 # I only know how to find the first 32 possibly open files on SunOS.
19189 # See also hints/sunos_4_1.sh and util.c --AD
19191 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
19193 $cat >>try.c <<EOCP
19195 #$i_stdlib I_STDLIB
19197 #include <stdlib.h>
19199 #$i_unistd I_UNISTD
19201 # include <unistd.h>
19203 #$d_sysconf HAS_SYSCONF
19204 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
19205 #ifdef HAS_STDIO_STREAM_ARRAY
19206 # define STDIO_STREAM_ARRAY $stdio_stream_array
19211 p = fopen("try.out", "w");
19215 # ifdef TRY_FPRINTF
19219 #ifdef TRY_FFLUSH_NULL
19222 #ifdef TRY_FFLUSH_ALL
19224 long open_max = -1;
19225 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
19226 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
19228 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
19229 open_max = sysconf(_SC_OPEN_MAX);
19232 open_max = FOPEN_MAX;
19235 open_max = OPEN_MAX;
19244 # ifdef HAS_STDIO_STREAM_ARRAY
19245 if (open_max > 0) {
19247 for (i = 0; i < open_max; i++)
19248 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
19249 STDIO_STREAM_ARRAY[i]._file < open_max &&
19250 STDIO_STREAM_ARRAY[i]._flag)
19251 fflush(&STDIO_STREAM_ARRAY[i]);
19259 : first we have to find out how _not_ to flush
19261 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
19263 set try -DTRY_FPUTC
19264 if eval $compile; then
19265 $run ./try 2>/dev/null
19268 if $test ! -s try.out -a "X$code" = X42; then
19274 set try -DTRY_FPRINTF
19275 if eval $compile; then
19276 $run ./try 2>/dev/null
19279 if $test ! -s try.out -a "X$code" = X42; then
19280 output=-DTRY_FPRINTF
19286 : check for fflush NULL behaviour
19287 case "$fflushNULL" in
19288 '') set try -DTRY_FFLUSH_NULL $output
19289 if eval $compile; then
19290 $run ./try 2>/dev/null
19293 if $test -s try.out -a "X$code" = X42; then
19294 fflushNULL="`$cat try.out`"
19296 if $test "X$code" != X42; then
19298 (If this test failed, don't worry, we'll try another method shortly.)
19303 $rm -f core try.core core.try.*
19304 case "$fflushNULL" in
19306 Your fflush(NULL) works okay for output streams.
19307 Let's see if it clobbers input pipes...
19309 # As of mid-March 2000 all versions of Solaris appear to have a stdio
19310 # bug that improperly flushes the input end of pipes. So we avoid the
19311 # autoflush on fork/system/exec support for now. :-(
19312 $cat >tryp.c <<EOCP
19315 main(int argc, char **argv)
19321 while ((i = getc(stdin)) != -1
19322 && (*bp++ = i) != '\n'
19323 && bp < &buf[1024])
19326 fprintf(stdout, "%s", buf);
19334 fflushNULL="$define"
19336 if eval $compile; then
19338 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
19339 if cmp tryp.c tryp.out >/dev/null 2>&1; then
19341 fflush(NULL) seems to behave okay with input streams.
19343 fflushNULL="$define"
19346 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
19348 fflushNULL="$undef"
19351 $rm -f core tryp.c tryp.core core.tryp.*
19354 Your fflush(NULL) isn't working (contrary to ANSI C).
19356 fflushNULL="$undef"
19359 Cannot figure out whether your fflush(NULL) works or not.
19360 I'm assuming it doesn't (contrary to ANSI C).
19362 fflushNULL="$undef"
19366 $define|true|[yY]*)
19367 fflushNULL="$define"
19370 fflushNULL="$undef"
19373 : check explicit looping only if NULL did not work, and if the pipe
19374 : bug does not show up on an explicit flush too
19375 case "$fflushNULL" in
19377 $cat >tryp.c <<EOCP
19380 main(int argc, char **argv)
19386 while ((i = getc(stdin)) != -1
19387 && (*bp++ = i) != '\n'
19388 && bp < &buf[1024])
19391 fprintf(stdout, "%s", buf);
19400 if eval $compile; then
19402 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
19403 if cmp tryp.c tryp.out >/dev/null 2>&1; then
19405 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
19407 : now check for fflushall behaviour
19408 case "$fflushall" in
19409 '') set try -DTRY_FFLUSH_ALL $output
19410 if eval $compile; then
19412 (Now testing the other method--but note that this also may fail.)
19414 $run ./try 2>/dev/null
19417 if $test -s try.out -a "X$code" = X42; then
19418 fflushall="`$cat try.out`"
19422 case "$fflushall" in
19424 Whew. Flushing explicitly all the stdio streams works.
19426 fflushall="$define"
19429 Sigh. Flushing explicitly all the stdio streams doesn't work.
19434 Cannot figure out whether flushing stdio streams explicitly works or not.
19435 I'm assuming it doesn't.
19441 "$define"|true|[yY]*)
19442 fflushall="$define"
19450 All is futile. Even fflush(stdin) clobbers input pipes!
19457 $rm -f core tryp.c tryp.core core.tryp.*
19459 *) fflushall="$undef"
19463 case "$fflushNULL$fflushall" in
19466 OK, I give up. I cannot figure out how to flush pending stdio output.
19467 We won't be flushing handles at all before fork/exec/popen.
19473 : Store the full pathname to the ar program for use in the C program
19474 : Respect a hint or command line value for full_ar.
19479 : Store the full pathname to the sed program for use in the C program
19482 : see what type gids are declared as in the kernel
19484 echo "Looking for the type for group ids returned by getgid()."
19485 set gid_t gidtype xxx stdio.h sys/types.h
19489 xxx=`./findhdr sys/user.h`
19490 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
19492 unsigned) dflt="$1 $2" ;;
19496 *) dflt="$gidtype";;
19499 gid_t) echo "gid_t found." ;;
19500 *) rp="What is the type for group ids returned by getgid()?"
19506 : Check the size of GID
19509 *_t) zzz="$gidtype" ;;
19512 echo "Checking the size of $zzz..." >&4
19514 #include <sys/types.h>
19516 #$i_stdlib I_STDLIB
19518 #include <stdlib.h>
19521 printf("%d\n", (int)sizeof($gidtype));
19526 if eval $compile_ok; then
19530 echo "(I can't execute the test program--guessing $gidsize.)" >&4
19533 echo "Your $zzz is $gidsize bytes long."
19538 echo "(I can't compile the test program--guessing $gidsize.)" >&4
19542 : Check if GID is signed
19545 *_t) zzz="$gidtype" ;;
19548 echo "Checking the sign of $zzz..." >&4
19550 #include <sys/types.h>
19561 if eval $compile; then
19565 echo "(I can't execute the test program--guessing unsigned.)" >&4
19569 1) echo "Your $zzz is unsigned." ;;
19570 -1) echo "Your $zzz is signed." ;;
19576 echo "(I can't compile the test program--guessing unsigned.)" >&4
19580 : Check 64bit sizes
19583 if $test X"$quadtype" != X; then
19585 echo "Checking how to print 64-bit integers..." >&4
19587 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
19588 $cat >try.c <<'EOCP'
19589 #include <sys/types.h>
19592 int q = 12345678901;
19593 printf("%ld\n", q);
19597 if eval $compile; then
19601 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
19602 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
19603 echo "We will use %d."
19609 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
19610 $cat >try.c <<'EOCP'
19611 #include <sys/types.h>
19614 long q = 12345678901;
19615 printf("%ld\n", q);
19619 if eval $compile; then
19623 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
19624 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
19625 echo "We will use %ld."
19631 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
19632 $cat >try.c <<'EOCP'
19633 #include <sys/types.h>
19634 #include <inttypes.h>
19637 int64_t q = 12345678901;
19638 printf("%" PRId64 "\n", q);
19642 if eval $compile; then
19646 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
19647 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
19648 echo "We will use the C9X style."
19654 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
19656 #include <sys/types.h>
19659 $quadtype q = 12345678901;
19660 printf("%Ld\n", q);
19664 if eval $compile; then
19668 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
19669 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
19670 echo "We will use %Ld."
19676 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
19677 $cat >try.c <<'EOCP'
19678 #include <sys/types.h>
19681 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
19682 printf("%lld\n", q);
19686 if eval $compile; then
19690 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
19691 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
19692 echo "We will use the %lld style."
19698 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
19700 #include <sys/types.h>
19703 $quadtype q = 12345678901;
19704 printf("%qd\n", q);
19708 if eval $compile; then
19712 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
19713 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
19714 echo "We will use %qd."
19720 if $test X"$sPRId64" = X; then
19721 echo "Cannot figure out how to print 64-bit integers." >&4
19728 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
19729 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
19731 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
19732 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
19736 : Check format strings for internal types
19738 $echo "Checking the format strings to be used for Perl's internal types..." >&4
19740 if $test X"$ivsize" = X8; then
19741 ivdformat="$sPRId64"
19742 uvuformat="$sPRIu64"
19743 uvoformat="$sPRIo64"
19744 uvxformat="$sPRIx64"
19745 uvXUformat="$sPRIXU64"
19747 if $test X"$ivsize" = X"$longsize"; then
19754 if $test X"$ivsize" = X"$intsize"; then
19762 if $test X"$ivsize" = X"$shortsize"; then
19773 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
19774 nveformat="$sPRIeldbl"
19775 nvfformat="$sPRIfldbl"
19776 nvgformat="$sPRIgldbl"
19777 nvEUformat="$sPRIEUldbl"
19778 nvFUformat="$sPRIFUldbl"
19779 nvGUformat="$sPRIGUldbl"
19789 case "$ivdformat" in
19790 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
19795 : Check format string for GID
19798 $echo "Checking the format string to be used for gids..." >&4
19801 -1) if $test X"$gidsize" = X"$ivsize"; then
19802 gidformat="$ivdformat"
19804 if $test X"$gidsize" = X"$longsize"; then
19807 if $test X"$gidsize" = X"$intsize"; then
19810 if $test X"$gidsize" = X"$shortsize"; then
19817 *) if $test X"$gidsize" = X"$uvsize"; then
19818 gidformat="$uvuformat"
19820 if $test X"$gidsize" = X"$longsize"; then
19823 if $test X"$gidsize" = X"$intsize"; then
19826 if $test X"$gidsize" = X"$shortsize"; then
19835 : see if getgroups exists
19836 set getgroups d_getgrps
19839 : see if setgroups exists
19840 set setgroups d_setgrps
19843 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
19845 case "$d_getgrps$d_setgrps" in
19847 case "$groupstype" in
19848 '') dflt="$gidtype" ;;
19849 *) dflt="$groupstype" ;;
19852 What type of pointer is the second argument to getgroups() and setgroups()?
19853 Usually this is the same as group ids, $gidtype, but not always.
19856 rp='What type pointer is the second argument to getgroups() and setgroups()?'
19860 *) groupstype="$gidtype";;
19863 : MAD = Misc Attribute Definition
19865 if $test $patchlevel -lt 9; then
19866 : MAD is not available in 5.8.x or earlier.
19870 $define|true|[yY]*) dflt='y' ;;
19875 Would you like to build with Misc Attribute Decoration? This is development
19876 work leading to a Perl 5 to Perl 6 convertor, which imposes a space and speed
19877 overhead on the interpreter.
19879 If this doesn't make any sense to you, just accept the default '$dflt'.
19881 rp='Build Perl with MAD?'
19886 madlyh='madly.h madly.act madly.tab'
19888 madlyobj="madly$_o" ;;
19897 : check whether make sets MAKE
19899 echo "Checking if your $make program sets \$(MAKE)..." >&4
19900 case "$make_set_make" in
19902 $sed 's/^X //' > testmake.mak << 'EOF'
19904 X @echo 'maketemp="$(MAKE)"'
19906 case "`$make -f testmake.mak 2>/dev/null`" in
19907 *maketemp=*) make_set_make='#' ;;
19908 *) make_set_make="MAKE=$make" ;;
19910 $rm -f testmake.mak
19913 case "$make_set_make" in
19914 '#') echo "Yup, it does.";;
19915 *) echo "Nope, it doesn't.";;
19918 : see what type is used for mode_t
19919 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
19920 set mode_t modetype int stdio.h sys/types.h
19923 : see if we need va_copy
19925 case "$i_stdarg" in
19928 #include <stdarg.h>
19930 #$i_stdlib I_STDLIB
19932 #include <stdlib.h>
19934 #include <signal.h>
19937 ivfprintf(FILE *f, const char *fmt, va_list *valp)
19939 return vfprintf(f, fmt, *valp);
19943 myvfprintf(FILE *f, const char *fmt, va_list val)
19945 return ivfprintf(f, fmt, &val);
19949 myprintf(char *fmt, ...)
19952 va_start(val, fmt);
19953 return myvfprintf(stdout, fmt, val);
19957 main(int ac, char **av)
19959 signal(SIGSEGV, exit);
19961 myprintf("%s%cs all right, then\n", "that", '\'');
19966 if eval $compile && $run ./try 2>&1 >/dev/null; then
19967 case "`$run ./try`" in
19968 "that's all right, then")
19974 yes) echo "It seems that you don't need va_copy()." >&4
19975 need_va_copy="$undef"
19977 *) echo "It seems that va_copy() or similar will be needed." >&4
19978 need_va_copy="$define"
19983 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
19987 : see what type is used for size_t
19988 rp="What is the type used for the length parameter for string functions?"
19989 set size_t sizetype 'unsigned int' stdio.h sys/types.h
19992 : check for type of arguments to gethostbyaddr.
19993 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
19994 case "$d_gethbyaddr" in
19998 Checking to see what type of arguments are accepted by gethostbyaddr().
20000 hdrs="$define sys/types.h
20001 $d_socket sys/socket.h
20002 $i_niin netinet/in.h
20004 $i_unistd unistd.h"
20005 : The first arg can 'char *' or 'void *'
20006 : The second arg is some of integral type
20007 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
20008 for yyy in size_t long int; do
20009 case "$netdb_host_type" in
20010 '') try="$extern_C struct hostent *gethostbyaddr($xxx, $yyy, int);"
20011 if ./protochk "$try" $hdrs; then
20012 echo "Your system accepts $xxx for the first arg."
20013 echo "...and $yyy for the second arg."
20014 netdb_host_type="$xxx"
20015 netdb_hlen_type="$yyy"
20021 : In case none of those worked, prompt the user.
20022 case "$netdb_host_type" in
20023 '') rp='What is the type for the 1st argument to gethostbyaddr?'
20026 netdb_host_type=$ans
20027 rp='What is the type for the 2nd argument to gethostbyaddr?'
20030 netdb_hlen_type=$ans
20034 *) : no gethostbyaddr, so pick harmless defaults
20035 netdb_host_type='char *'
20036 netdb_hlen_type="$sizetype"
20039 # Remove the "const" if needed. -- but then we'll have a
20041 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
20044 : check for type of argument to gethostbyname.
20045 if test "X$netdb_name_type" = X ; then
20046 case "$d_gethbyname" in
20050 Checking to see what type of argument is accepted by gethostbyname().
20052 hdrs="$define sys/types.h
20053 $d_socket sys/socket.h
20054 $i_niin netinet/in.h
20056 $i_unistd unistd.h"
20057 for xxx in "const char *" "char *"; do
20058 case "$netdb_name_type" in
20059 '') try="$extern_C struct hostent *gethostbyname($xxx);"
20060 if ./protochk "$try" $hdrs; then
20061 echo "Your system accepts $xxx."
20062 netdb_name_type="$xxx"
20067 : In case none of those worked, prompt the user.
20068 case "$netdb_name_type" in
20069 '') rp='What is the type for the 1st argument to gethostbyname?'
20072 netdb_name_type=$ans
20076 *) : no gethostbyname, so pick harmless default
20077 netdb_name_type='char *'
20082 : check for type of 1st argument to getnetbyaddr.
20083 if test "X$netdb_net_type" = X ; then
20084 case "$d_getnbyaddr" in
20088 Checking to see what type of 1st argument is accepted by getnetbyaddr().
20090 hdrs="$define sys/types.h
20091 $d_socket sys/socket.h
20092 $i_niin netinet/in.h
20094 $i_unistd unistd.h"
20095 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
20096 case "$netdb_net_type" in
20097 '') try="$extern_C struct netent *getnetbyaddr($xxx, int);"
20098 if ./protochk "$try" $hdrs; then
20099 echo "Your system accepts $xxx."
20100 netdb_net_type="$xxx"
20105 : In case none of those worked, prompt the user.
20106 case "$netdb_net_type" in
20107 '') rp='What is the type for the 1st argument to getnetbyaddr?'
20110 netdb_net_type=$ans
20114 *) : no getnetbyaddr, so pick harmless default
20115 netdb_net_type='long'
20119 : locate the preferred pager for this system
20126 [a-zA-Z]:/*) dflt=$pg;;
20130 [a-zA-Z]:/*) dflt=$more;;
20134 [a-zA-Z]:/*) dflt=$less;;
20137 '') dflt=/usr/ucb/more;;
20145 rp='What pager is used on your system?'
20149 : see what type pids are declared as in the kernel
20150 rp="What is the type of process ids on this system?"
20151 set pid_t pidtype int stdio.h sys/types.h
20154 : see if ar generates random libraries by itself
20156 echo "Checking how to generate random libraries on your machine..." >&4
20157 echo 'int bar1() { return bar2(); }' > bar1.c
20158 echo 'int bar2() { return 2; }' > bar2.c
20160 #$i_stdlib I_STDLIB
20162 #include <stdlib.h>
20164 int main() { printf("%d\n", bar1()); exit(0); }
20166 $cc $ccflags -c bar1.c >/dev/null 2>&1
20167 $cc $ccflags -c bar2.c >/dev/null 2>&1
20168 $cc $ccflags -c foo.c >/dev/null 2>&1
20169 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
20170 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20171 $run ./foobar >/dev/null 2>&1; then
20172 echo "$ar appears to generate random libraries itself."
20174 if [ "X$ranlib" = "X" ]; then
20177 elif $ar s bar$_a >/dev/null 2>&1 &&
20178 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20179 $run ./foobar >/dev/null 2>&1; then
20180 echo "a table of contents needs to be added with '$ar s'."
20183 elif $ar ts bar$_a >/dev/null 2>&1 &&
20184 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20185 $run ./foobar >/dev/null 2>&1; then
20186 echo "a table of contents needs to be added with '$ar ts'."
20193 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
20194 $test -f $ranlib || ranlib=''
20197 if $test -n "$ranlib"; then
20198 echo "your system has '$ranlib'; we'll use that."
20201 echo "your system doesn't seem to support random libraries"
20202 echo "so we'll use lorder and tsort to order the libraries."
20209 : see if this is a values.h system
20210 set values.h i_values
20213 : Check the max offset that gmtime and localtime accept
20214 echo "Checking max offsets that gmtime () accepts"
20217 define) yyy="#include <values.h>" ;;
20221 case "$sGMTIME_min/$sGMTIME_max" in
20224 #include <sys/types.h>
20233 void gm_check (time_t t, int min_year, int max_year)
20236 if ( tmp == NULL ||
20237 /* Check tm_year overflow */
20238 tmp->tm_year < min_year || tmp->tm_year > max_year)
20249 gm_check (MAXLONG, 69, 0x7fffffff);
20251 if (tmp == NULL || tmp->tm_year < 0) {
20252 for (i = 63; i >= 0; i--) {
20253 time_t x = pt | ((time_t)1 << i);
20254 if (x < 0 || x < pt) continue;
20255 gm_check (x, 69, 0x7fffffff);
20258 printf ("sGMTIME_max=%ld\n", pt);
20267 gm_check (MINLONG, -1900, 70);
20270 for (i = 36; i >= 0; i--) {
20271 time_t x = pt - ((time_t)1 << i);
20272 if (x > 0) continue;
20273 gm_check (x, -1900, 70);
20276 printf ("sGMTIME_min=%ld\n", pt);
20280 int main (int argc, char *argv[])
20282 fprintf (stderr, "Sizeof time_t = %ld\n", sizeof (time_t));
20289 if eval $compile; then
20292 echo "Cannot determine sGMTIME_max and sGMTIME_min." >&4
20298 echo "Checking max offsets that localtime () accepts"
20300 case "$sLOCALTIME_min/$sLOCALTIME_max" in
20303 #include <sys/types.h>
20312 void local_check (time_t t, int min_year, int max_year)
20314 if (sizeof (time_t) > 4 && t > 0x7ffffffffffff000LL)
20317 tmp = localtime (&t);
20318 if ( tmp == NULL ||
20319 /* Check tm_year overflow */
20320 tmp->tm_year < min_year || tmp->tm_year > max_year)
20324 } /* local_check */
20331 local_check (MAXLONG, 69, 0x7fffffff);
20333 if (tmp == NULL || tmp->tm_year < 0) {
20334 for (i = 63; i >= 0; i--) {
20335 time_t x = pt | ((time_t)1 << i);
20336 if (x < 0 || x < pt) continue;
20337 local_check (x, 69, 0x7fffffff);
20340 printf ("sLOCALTIME_max=%ld\n", pt);
20349 local_check (MINLONG, -1900, 70);
20352 for (i = 36; i >= 0; i--) {
20353 time_t x = pt - ((time_t)1 << i);
20354 if (x > 0) continue;
20355 local_check (x, -1900, 70);
20358 printf ("sLOCALTIME_min=%ld\n", pt);
20362 int main (int argc, char *argv[])
20370 if eval $compile; then
20373 echo "Cannot determine sLOCALTIME_max and sLOCALTIME_min." >&4
20379 : check for type of arguments to select.
20380 case "$selecttype" in
20381 '') case "$d_select" in
20385 Checking to see what type of arguments are accepted by select().
20387 hdrs="$define sys/types.h
20388 $i_systime sys/time.h
20389 $i_sysselct sys/select.h
20390 $d_socket sys/socket.h"
20391 : The first arg can be int, unsigned, or size_t
20392 : The last arg may or may not be 'const'
20394 : void pointer has been seen but using that
20395 : breaks the selectminbits test
20396 for xxx in 'fd_set *' 'int *'; do
20397 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
20398 for tmo in 'struct timeval *' 'const struct timeval *'; do
20400 '') try="$extern_C select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
20401 if ./protochk "$try" $hdrs; then
20402 echo "Your system accepts $xxx."
20411 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
20412 case "$d_fd_set" in
20413 $define) dflt="fd_set *" ;;
20422 *) : no select, so pick a harmless default
20429 : check for the select 'width'
20430 case "$selectminbits" in
20431 '') safebits=`expr $ptrsize \* 8`
20432 case "$d_select" in
20436 Checking to see on how many bits at a time your select() operates...
20439 #include <sys/types.h>
20441 #$i_systime I_SYS_TIME
20442 #$i_systimek I_SYS_TIME_KERNEL
20447 # ifdef I_SYS_TIME_KERNEL
20450 # include <sys/time.h>
20451 # ifdef I_SYS_TIME_KERNEL
20455 #$i_sysselct I_SYS_SELECT
20456 #ifdef I_SYS_SELECT
20457 #include <sys/select.h>
20459 #$d_socket HAS_SOCKET
20461 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
20464 #$i_stdlib I_STDLIB
20466 #include <stdlib.h>
20469 #define S sizeof(*(b))
20471 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
20472 #define NBITS (NBYTES * 8)
20474 char *s = (char *)malloc(NBYTES);
20483 fp = fopen("try.c", "r");
20489 b = ($selecttype)s;
20490 for (i = 0; i < NBITS; i++)
20494 select(fd + 1, b, 0, 0, &t);
20495 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
20497 printf("%d\n", i + 1);
20502 if eval $compile_ok; then
20503 selectminbits=`$run ./try`
20504 case "$selectminbits" in
20506 Cannot figure out on how many bits at a time your select() operates.
20507 I'll play safe and guess it is $safebits bits.
20509 selectminbits=$safebits
20510 bits="$safebits bits"
20513 *) bits="$selectminbits bits" ;;
20515 echo "Your select() operates on $bits at a time." >&4
20517 rp='What is the minimum number of bits your select() operates on?'
20518 case "$byteorder" in
20519 12345678) dflt=64 ;;
20525 selectminbits="$val"
20529 *) : no select, so pick a harmless default
20530 selectminbits=$safebits
20536 : Trace out the files included by signal.h, then look for SIGxxx names.
20537 if [ "X$fieldn" = X ]; then
20538 : Just make some guesses. We check them later.
20539 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
20541 xxx=`echo '#include <signal.h>' |
20542 $cppstdin $cppminus $cppflags 2>/dev/null |
20543 $grep '^[ ]*#.*include' |
20544 $awk "{print \\$$fieldn}" | $sed 's!"!!g' |\
20545 $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
20548 for xx in $xxx /dev/null ; do
20549 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
20551 case "$xxxfiles" in
20552 '') xxxfiles=`./findhdr signal.h` ;;
20555 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
20556 print substr($2, 4, 20)
20558 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
20559 print substr($3, 4, 20)
20561 : Append some common names just in case the awk scan failed.
20562 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
20563 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
20564 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
20565 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
20566 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
20568 : generate a few handy files for later
20569 $cat > signal.c <<EOCP
20570 #include <sys/types.h>
20571 #include <signal.h>
20572 #$i_stdlib I_STDLIB
20574 #include <stdlib.h>
20579 /* Strange style to avoid deeply-nested #if/#else/#endif */
20582 # define NSIG (_NSIG)
20588 # define NSIG (SIGMAX+1)
20594 # define NSIG (SIG_MAX+1)
20600 # define NSIG (_SIG_MAX+1)
20606 # define NSIG (MAXSIG+1)
20612 # define NSIG (MAX_SIG+1)
20617 # ifdef SIGARRAYSIZE
20618 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
20624 # define NSIG (_sys_nsig) /* Solaris 2.5 */
20628 /* Default to some arbitrary number that's big enough to get most
20629 of the common signals.
20635 printf("NSIG %d\n", NSIG);
20641 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
20643 printf "#ifdef SIG"; printf $1; printf "\n"
20644 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
20645 printf $1; printf ");\n"
20649 printf "#endif /* JUST_NSIG */\n";
20650 printf "exit(0);\n}\n";
20653 $cat >signal.awk <<'EOP'
20654 BEGIN { ndups = 0 }
20655 $1 ~ /^NSIG$/ { nsig = $2 }
20656 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
20657 if ($2 > maxsig) { maxsig = $2 }
20658 if (sig_name[$2]) {
20659 dup_name[ndups] = $1
20660 dup_num[ndups] = $2
20672 printf("NSIG %d\n", nsig);
20673 for (n = 1; n < nsig; n++) {
20675 printf("%s %d\n", sig_name[n], sig_num[n])
20678 printf("NUM%d %d\n", n, n)
20681 for (n = 0; n < ndups; n++) {
20682 printf("%s %d\n", dup_name[n], dup_num[n])
20686 $cat >signal_cmd <<EOS
20688 if $test -s signal.lst; then
20689 echo "Using your existing signal.lst file"
20694 $cat >>signal_cmd <<'EOS'
20697 if eval $compile_ok; then
20698 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) |\
20699 $uniq | $awk -f signal.awk >signal.lst
20701 echo "(I can't seem be able to compile the whole test program)" >&4
20702 echo "(I'll try it in little pieces.)" >&4
20703 set signal -DJUST_NSIG
20704 if eval $compile_ok; then
20705 $run ./signal$_exe > signal.nsg
20708 echo "I can't seem to figure out how many signals you have." >&4
20709 echo "Guessing 50." >&4
20710 echo 'NSIG 50' > signal.nsg
20712 : Now look at all the signal names, one at a time.
20713 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
20714 $cat > signal.c <<EOCP
20715 #include <sys/types.h>
20716 #include <signal.h>
20719 printf("$xx %d\n", SIG${xx});
20724 if eval $compile; then
20725 echo "SIG${xx} found."
20726 $run ./signal$_exe >> signal.ls1
20728 echo "SIG${xx} NOT found."
20731 if $test -s signal.ls1; then
20732 $cat signal.nsg signal.ls1 |
20733 $sort -n | $uniq | $awk -f signal.awk >signal.lst
20737 if $test -s signal.lst; then
20740 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
20741 echo 'kill -l' >signal
20742 set X `csh -f <signal`
20746 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
20748 echo $@ | $tr ' ' $trnl | \
20749 $awk '{ printf "%s %d\n", $1, ++s; }
20750 END { printf "NSIG %d\n", ++s }' >signal.lst
20752 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
20754 chmod a+x signal_cmd
20755 $eunicefix signal_cmd
20757 : generate list of signal names
20759 case "$sig_name_init" in
20761 *) case "$sig_num_init" in
20762 ''|*,*) doinit=yes ;;
20767 echo "Generating a list of signal names and numbers..." >&4
20769 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
20770 sig_name=`$awk 'BEGIN { printf "ZERO " }
20771 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
20772 sig_num=`$awk 'BEGIN { printf "0 " }
20773 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
20774 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
20775 !/^NSIG/ { printf "\"%s\", ", $1 }
20776 END { printf "0\n" }' signal.lst`
20777 sig_num_init=`$awk 'BEGIN { printf "0, " }
20778 !/^NSIG/ { printf "%d, ", $2}
20779 END { printf "0\n"}' signal.lst`
20782 echo "The following $sig_count signals are available:"
20784 echo $sig_name | $awk \
20785 'BEGIN { linelen = 0 }
20787 for (i = 1; i <= NF; i++) {
20788 name = "SIG" $i " "
20789 linelen = linelen + length(name)
20790 if (linelen > 70) {
20792 linelen = length(name)
20798 sig_size=`echo $sig_name | awk '{print NF}'`
20799 $rm -f signal signal.c signal.awk signal.lst signal_cmd
20801 : Check size of size
20803 case "$sizetype" in
20804 *_t) zzz="$sizetype" ;;
20805 *) zzz="filesize" ;;
20807 echo "Checking the size of $zzz..." >&4
20809 #include <sys/types.h>
20811 #$i_stdlib I_STDLIB
20813 #include <stdlib.h>
20816 printf("%d\n", (int)sizeof($sizetype));
20821 if eval $compile_ok; then
20825 echo "(I can't execute the test program--guessing $sizesize.)" >&4
20828 echo "Your $zzz size is $sizesize bytes."
20833 echo "(I can't compile the test program--guessing $sizesize.)" >&4
20837 : check for socklen_t
20839 echo "Checking to see if you have socklen_t..." >&4
20841 #include <sys/types.h>
20842 #$d_socket HAS_SOCKET
20844 #include <sys/socket.h>
20846 int main() { socklen_t x = 16; }
20849 if eval $compile; then
20851 echo "You have socklen_t."
20854 echo "You do not have socklen_t."
20855 case "$sizetype" in
20856 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
20863 : see if this is a socks.h system
20864 set socks.h i_socks
20867 : check for type of the size argument to socket calls
20868 case "$d_socket" in
20872 Checking to see what type is the last argument of accept().
20875 case "$d_socklen_t" in
20876 "$define") yyy="$yyy socklen_t"
20878 yyy="$yyy $sizetype int long unsigned"
20879 for xxx in $yyy; do
20880 case "$socksizetype" in
20881 '') try="$extern_C int accept(int, struct sockaddr *, $xxx *);"
20882 case "$usesocks" in
20884 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
20885 echo "Your system accepts '$xxx *' for the last argument of accept()."
20886 socksizetype="$xxx"
20889 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
20890 echo "Your system accepts '$xxx *' for the last argument of accept()."
20891 socksizetype="$xxx"
20898 : In case none of those worked, prompt the user.
20899 case "$socksizetype" in
20900 '') rp='What is the type for socket address structure sizes?'
20907 *) : no sockets, so pick relatively harmless default
20912 : see what type is used for signed size_t
20913 set ssize_t ssizetype int stdio.h sys/types.h
20918 #$i_stdlib I_STDLIB
20920 #include <stdlib.h>
20922 #include <sys/types.h>
20923 #define Size_t $sizetype
20924 #define SSize_t $dflt
20927 if (sizeof(Size_t) == sizeof(SSize_t))
20929 else if (sizeof(Size_t) == sizeof(int))
20938 if eval $compile_ok && $run ./try > /dev/null; then
20939 ssizetype=`$run ./try`
20940 echo "I'll be using $ssizetype for functions returning a byte count." >&4
20943 Help! I can't compile and run the ssize_t test program: please enlighten me!
20944 (This is probably a misconfiguration in your system or libraries, and
20945 you really ought to fix it. Still, I'll try anyway.)
20947 I need a type that is the same size as $sizetype, but is guaranteed to
20948 be signed. Common values are ssize_t, int and long.
20951 rp="What signed type is the same size as $sizetype?"
20957 : see what type of char stdio uses.
20959 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
20960 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
20961 echo "Your stdio uses unsigned chars." >&4
20962 stdchar="unsigned char"
20964 echo "Your stdio uses signed chars." >&4
20969 : see what type uids are declared as in the kernel
20971 echo "Looking for the type for user ids returned by getuid()."
20972 set uid_t uidtype xxx stdio.h sys/types.h
20976 xxx=`./findhdr sys/user.h`
20977 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
20979 unsigned) dflt="$1 $2" ;;
20983 *) dflt="$uidtype";;
20986 uid_t) echo "uid_t found." ;;
20987 *) rp="What is the type for user ids returned by getuid()?"
20993 : Check size of UID
20996 *_t) zzz="$uidtype" ;;
20999 echo "Checking the size of $zzz..." >&4
21001 #include <sys/types.h>
21003 #$i_stdlib I_STDLIB
21005 #include <stdlib.h>
21008 printf("%d\n", (int)sizeof($uidtype));
21013 if eval $compile_ok; then
21017 echo "(I can't execute the test program--guessing $uidsize.)" >&4
21020 echo "Your $zzz is $uidsize bytes long."
21025 echo "(I can't compile the test program--guessing $uidsize.)" >&4
21028 : Check if UID is signed
21031 *_t) zzz="$uidtype" ;;
21034 echo "Checking the sign of $zzz..." >&4
21036 #include <sys/types.h>
21047 if eval $compile; then
21051 echo "(I can't execute the test program--guessing unsigned.)" >&4
21055 1) echo "Your $zzz is unsigned." ;;
21056 -1) echo "Your $zzz is signed." ;;
21062 echo "(I can't compile the test program--guessing unsigned.)" >&4
21066 : Check format string for UID
21068 $echo "Checking the format string to be used for uids..." >&4
21071 -1) if $test X"$uidsize" = X"$ivsize"; then
21072 uidformat="$ivdformat"
21074 if $test X"$uidsize" = X"$longsize"; then
21077 if $test X"$uidsize" = X"$intsize"; then
21080 if $test X"$uidsize" = X"$shortsize"; then
21087 *) if $test X"$uidsize" = X"$uvsize"; then
21088 uidformat="$uvuformat"
21090 if $test X"$uidsize" = X"$longsize"; then
21093 if $test X"$uidsize" = X"$intsize"; then
21096 if $test X"$uidsize" = X"$shortsize"; then
21105 : Check if site customization support was requested
21106 case "$usesitecustomize" in
21107 $define|true|[Yy]*)
21108 usesitecustomize="$define"
21111 usesitecustomize="$undef"
21115 : determine compiler compiler
21124 if $test -f "$byacc$_exe"; then
21126 comp="byacc or $comp"
21128 if $test -f "$bison$_exe"; then
21129 comp="$comp or bison -y"
21131 rp="Which compiler compiler ($comp) shall I use?"
21140 echo "(Adding -y option to bison to get yacc-compatible behaviour.)"
21146 : see if this is a assert.h system
21147 set assert.h i_assert
21150 : see if this is a fp.h system
21154 : see if this is a fp_class.h system
21155 set fp_class.h i_fp_class
21158 : see if gdbm.h is available
21163 : see if gdbm_open exists
21164 set gdbm_open d_gdbm_open
21166 case "$d_gdbm_open" in
21169 echo "We won't be including <gdbm.h>"
21178 : see if this is a ieeefp.h system
21179 case "$i_ieeefp" in
21180 '' ) set ieeefp.h i_ieeefp
21185 : see if this is a libutil.h system
21186 set libutil.h i_libutil
21189 : see if mach cthreads are available
21190 if test "X$usethreads" = "X$define"; then
21191 set mach/cthreads.h i_machcthr
21194 i_machcthr="$undef"
21197 : see if this is a mntent.h system
21198 set mntent.h i_mntent
21201 : see if net/errno.h is available
21203 set net/errno.h val
21206 : Unfortunately, it causes problems on some systems. Arrgh.
21209 cat > try.c <<'EOM'
21212 #include <net/errno.h>
21218 if $cc $ccflags -c try.c >/dev/null 2>&1; then
21219 echo "We'll be including <net/errno.h>." >&4
21221 echo "We won't be including <net/errno.h>." >&4
21230 : see if netinet/tcp.h is available
21231 set netinet/tcp.h i_netinettcp
21234 : see if this is a poll.h system
21238 : see if this is a prot.h system
21242 : Preprocessor symbols
21244 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
21245 $cat <<'EOSH' > Cppsym.know
21246 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
21247 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
21248 alliant alpha am29000 AM29000 AMD64 amd64 amiga AMIGAOS AMIX
21249 ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
21250 BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
21251 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
21252 bull c cadmus clipper CMU COFF COMPILER_VERSION
21253 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
21254 CYGWIN DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
21255 Dynix DynixPTX ELF encore EPI EXTENSIONS FAVOR_BSD
21256 FILE_OFFSET_BITS FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
21258 GNU_SOURCE GNUC GNUC_MINOR GNU_LIBRARY GO32 gould GOULD_PN
21259 H3050R H3050RX hbullx20 hcx host_mips
21260 hp200 hp300 hp700 HP700 hp800 hp9000
21261 hp9000s200 hp9000s300 hp9000s400 hp9000s500
21262 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
21263 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
21264 IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
21265 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
21266 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
21267 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
21268 LIBCATAMOUNT Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
21269 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
21270 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
21271 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
21272 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
21273 MATH_HAS_NO_SIDE_EFFECTS
21274 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
21275 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
21276 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
21277 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
21278 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
21279 NetBSD news1500 news1700 news1800 news1900 news3700
21280 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
21281 ns32016 ns32332 ns32k nsc32000
21282 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
21283 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
21284 pc532 pdp11 PGC PIC plexus PORTAR posix
21285 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
21286 POSIX_C_SOURCE POSIX_SOURCE POWER
21287 PROTOTYPES PWB pyr QNX QK_USER R3000 REENTRANT RES Rhapsody RISC6000
21288 riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
21289 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
21290 sony sony_news sonyrisc sparc sparclite spectrum
21291 stardent stdc STDC_EXT stratos sun sun3 sun386
21292 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
21293 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
21294 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
21295 sysV68 sysV88 Tek4132 Tek4300 titan
21296 TM3200 TM5400 TM5600
21297 tower tower32 tower32_200 tower32_600 tower32_700
21298 tower32_800 tower32_850 tss
21299 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
21300 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
21301 unix UNIX95 UNIX99 unixpc unos
21302 USE_BSD USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE USE_LARGEFILE64
21303 USE_MISC USE_POSIX USE_POSIX199309 USE_POSIX199506 USE_POSIX2
21304 USE_REENTRANT USE_SVID USE_UNIX98 USE_XOPEN USE_XOPEN_EXTENDED
21306 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms x86_64 xenix Xenix286
21307 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
21308 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
21311 # Maybe put other stuff here too.
21312 cat <<EOSH >>Cppsym.know
21315 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
21316 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
21317 $cat Cppsym.know > Cppsym.c
21318 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
21319 $rm -f Cppsym.a Cppsym.b Cppsym.c
21320 cat <<EOSH > Cppsym
21322 if $test \$# -gt 0; then
21323 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
21324 if $test -s Cppsym.got; then
21331 $tr " " "$trnl" | ./Cppsym.try
21337 cat <<EOSH > Cppsym.try
21339 cat <<'EOCP' > try.c
21342 #define STRINGIFY(a) "a"
21344 #if cpp_stuff == 42
21345 #define StGiFy(a) #a
21346 #define STRINGIFY(a) StGiFy(a)
21348 #if $cpp_stuff != 1 && $cpp_stuff != 42
21349 # include "Bletch: How does this C preprocessor stringify macros?"
21355 cat <<'EOSH' >> Cppsym.try
21357 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
21358 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
21359 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
21360 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
21362 echo 'return 0;}' >> try.c
21364 cat <<EOSH >> Cppsym.try
21366 case "$osname-$gccversion" in
21367 irix-) ccflags="\$ccflags -woff 1178" ;;
21368 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
21370 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs && $run ./try | $sed 's/ /\\\\ /g'
21372 chmod +x Cppsym.try
21373 $eunicefix Cppsym.try
21374 ./Cppsym < Cppsym.know > Cppsym.true
21375 : Add in any linux cpp "predefined macros":
21376 case "$osname::$gccversion" in
21379 rm -f $tHdrH'.h' $tHdrH
21381 if cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
21382 sed 's/#define[\ \ ]*//;s/[\ \ ].*$//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
21383 if [ -s $tHdrH'_cppsym.real' ]; then
21384 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
21387 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
21390 : now check the C compiler for additional symbols
21391 postprocess_cc_v=''
21393 aix) postprocess_cc_v="|$tr , ' '" ;;
21400 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
21403 -D*) echo "\$i" | $sed 's/^-D//';;
21404 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
21409 postprocess_cc_v=''
21412 ./ccsym > ccsym1.raw
21413 if $test -s ccsym1.raw; then
21414 $sort ccsym1.raw | $uniq >ccsym.raw
21416 mv ccsym1.raw ccsym.raw
21419 $awk '/\=/ { print $0; next }
21420 { print $0"=1" }' ccsym.raw >ccsym.list
21421 $comm -13 Cppsym.true ccsym.list >ccsym.own
21422 $comm -12 Cppsym.true ccsym.list >ccsym.com
21423 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
21425 if $test -z ccsym.raw; then
21426 echo "Your C compiler doesn't seem to define any symbols!" >&4
21428 echo "However, your C preprocessor defines the following symbols:"
21431 cppsymbols=`$cat Cppsym.true`
21432 cppsymbols=`echo $cppsymbols`
21433 cppccsymbols="$cppsymbols"
21435 if $test -s ccsym.com; then
21436 echo "Your C compiler and pre-processor define these symbols:"
21437 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
21440 cppccsymbols=`$cat ccsym.com`
21441 cppccsymbols=`echo $cppccsymbols`
21442 $test "$silent" || sleep 1
21444 if $test -s ccsym.cpp; then
21445 $test "$also" && echo " "
21446 echo "Your C pre-processor ${also}defines the following symbols:"
21447 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
21449 cppsymbols=`$cat ccsym.cpp`
21450 cppsymbols=`echo $cppsymbols`
21451 $test "$silent" || sleep 1
21453 if $test -s ccsym.own; then
21454 $test "$also" && echo " "
21455 echo "Your C compiler ${also}defines the following cpp symbols:"
21456 $sed -e 's/\(..*\)=1/\1/' ccsym.own
21457 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
21458 ccsymbols=`$cat ccsym.own`
21459 ccsymbols=`echo $ccsymbols`
21460 $test "$silent" || sleep 1
21464 : see if this is a termio system
21468 if $test `./findhdr termios.h`; then
21469 set tcsetattr i_termios
21475 "$define") echo "You have POSIX termios.h... good!" >&4;;
21476 *) if ./Cppsym pyr; then
21477 case "`/bin/universe`" in
21478 ucb) if $test `./findhdr sgtty.h`; then
21480 echo "<sgtty.h> found." >&4
21482 echo "System is pyramid with BSD universe."
21483 ./warn "<sgtty.h> not found--you could have problems."
21485 *) if $test `./findhdr termio.h`; then
21487 echo "<termio.h> found." >&4
21489 echo "System is pyramid with USG universe."
21490 ./warn "<termio.h> not found--you could have problems."
21494 if $test `./findhdr termio.h`; then
21495 echo "<termio.h> found." >&4
21497 elif $test `./findhdr sgtty.h`; then
21498 echo "<sgtty.h> found." >&4
21501 ./warn "Neither <termio.h> nor <sgtty.h> found--cross fingers!"
21504 if $test `./findhdr sgtty.h`; then
21505 echo "<sgtty.h> found." >&4
21507 elif $test `./findhdr termio.h`; then
21508 echo "<termio.h> found." >&4
21511 ./warn "Neither <sgtty.h> nor <termio.h> found--cross fingers!"
21515 set i_termio; eval $setvar
21516 val=$val2; set i_sgtty; eval $setvar
21517 val=$val3; set i_termios; eval $setvar
21519 : see if stddef is available
21520 set stddef.h i_stddef
21523 : see if sys/access.h is available
21524 set sys/access.h i_sysaccess
21527 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
21528 set sys/filio.h i_sysfilio
21531 if $test `./findhdr sys/ioctl.h`; then
21533 echo '<sys/ioctl.h> found.' >&4
21536 if $test $i_sysfilio = "$define"; then
21537 echo '<sys/ioctl.h> NOT found.' >&4
21539 $test $i_sgtty = "$define" && xxx="sgtty.h"
21540 $test $i_termio = "$define" && xxx="termio.h"
21541 $test $i_termios = "$define" && xxx="termios.h"
21542 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
21548 : see if socket ioctl defs are in sys/sockio.h
21550 xxx=`./findhdr sys/sockio.h`
21551 if $test "$xxx"; then
21552 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
21554 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
21557 echo "No socket ioctls found in <sys/sockio.h>." >&4
21562 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
21568 : see if this is a syslog.h system
21569 set syslog.h i_syslog
21572 : see if this is a sys/mode.h system
21573 set sys/mode.h i_sysmode
21576 : see if there is a sys/poll.h file
21577 set sys/poll.h i_syspoll
21580 : see if sys/resource.h has to be included
21581 set sys/resource.h i_sysresrc
21584 : see if sys/security.h is available
21585 set sys/security.h i_syssecrt
21588 : see if this is a sys/statvfs.h system
21589 set sys/statvfs.h i_sysstatvfs
21592 : see if this is a sys/un.h system
21593 set sys/un.h i_sysun
21596 : see if this is a sys/utsname.h system
21597 set sys/utsname.h i_sysutsname
21600 : see if this is a syswait system
21601 set sys/wait.h i_syswait
21604 : see if this is a ustat.h system
21605 set ustat.h i_ustat
21608 : see if this is an utime system
21609 set utime.h i_utime
21612 : see if this is a vfork system
21615 set vfork.h i_vfork
21625 echo "Looking for extensions..." >&4
21626 : If we are using the old config.sh, known_extensions may contain
21627 : old or inaccurate or duplicate values.
21628 known_extensions=''
21629 nonxs_extensions=''
21630 : We do not use find because it might not be available.
21631 : We do not just use MANIFEST because the user may have dropped
21632 : some additional extensions into the source tree and expect them
21635 : Function to recursively find available extensions, ignoring DynaLoader
21636 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
21640 DynaLoader|dynaload) ;;
21642 this_ext=`echo $xxx | $sed -e s/-/\\\//g`;
21643 leaf=`echo $xxx | $sed -e s/.*-//`;
21644 if $test -d File-Glob; then
21645 if $test -f $xxx/$leaf.xs -o -f $xxx/$leaf.c; then
21646 known_extensions="$known_extensions $this_ext";
21647 elif $test -d $xxx; then
21648 nonxs_extensions="$nonxs_extensions $this_ext";
21651 if $test -f $xxx/$leaf.xs -o -f $xxx/$leaf.c; then
21652 known_extensions="$known_extensions $1$this_ext";
21653 elif $test -f $xxx/Makefile.PL; then
21654 nonxs_extensions="$nonxs_extensions $1$this_ext";
21656 if $test -d $xxx -a $# -lt 10; then
21659 eval $find_extensions;
21672 eval $find_extensions
21673 if $test -d File-Glob; then
21674 : All ext/ flattened
21676 # Special case: Add in modules that nest beyond the first level.
21677 # Currently threads/shared and Hash/Util/FieldHash, since they are
21678 # not picked up by the recursive find above (and adding in general
21679 # recursive finding breaks SDBM_File/sdbm).
21680 # A.D. 20011025 (SDBM), ajgough 20071008 (FieldHash)
21681 known_extensions="$known_extensions threads/shared Hash/Util/FieldHash"
21683 set X $known_extensions
21685 known_extensions="$*"
21686 set X $nonxs_extensions
21688 nonxs_extensions="$*"
21691 : Now see which are supported on this system.
21693 for xxx in $known_extensions ; do
21697 $define) avail_ext="$avail_ext $xxx" ;;
21700 GDBM_File|gdbm_fil)
21702 $define) avail_ext="$avail_ext $xxx" ;;
21705 I18N/Langinfo|i18n_lan)
21706 case "$i_langinfo$d_nl_langinfo" in
21707 $define$define) avail_ext="$avail_ext $xxx" ;;
21711 : XXX Do we need a useipcsysv variable here
21712 case "${d_msg}${d_sem}${d_shm}" in
21713 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
21716 NDBM_File|ndbm_fil)
21719 case "$osname-$use64bitint" in
21722 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
21725 *) avail_ext="$avail_ext $xxx" ;;
21730 ODBM_File|odbm_fil)
21731 case "${i_dbm}${i_rpcsvcdbm}" in
21733 case "$d_cplusplus" in
21734 define) ;; # delete as a function name will not work
21735 *) case "$osname-$use64bitint" in
21738 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
21741 *) avail_ext="$avail_ext $xxx" ;;
21749 case "$useopcode" in
21750 true|define|y) avail_ext="$avail_ext $xxx" ;;
21754 case "$useposix" in
21755 true|define|y) avail_ext="$avail_ext $xxx" ;;
21759 case "$d_socket" in
21762 beos) ;; # not unless BONE
21763 *) avail_ext="$avail_ext $xxx" ;;
21768 Sys/Syslog|sys/syslog)
21769 : XXX syslog requires socket
21770 case "$d_socket" in
21771 true|$define|y) avail_ext="$avail_ext $xxx" ;;
21775 case "$usethreads" in
21777 case "$use5005threads" in
21778 $define|true|[yY]*) avail_ext="$avail_ext $xxx" ;;
21782 threads|threads/shared)
21783 # threads and threads::shared are special cases.
21784 # To stop people from asking "Perl 5.8.0 was supposed
21785 # to have this new fancy threads implementation but my
21786 # perl doesn't have it" and from people trying to
21787 # (re)install the threads module using CPAN.pm and
21788 # CPAN.pm then offering to reinstall Perl 5.8.0,
21789 # the threads.pm and threads/shared.pm will always be
21790 # there, croaking informatively ("you need to rebuild
21791 # all of Perl with threads, sorry") when threads haven't
21792 # been compiled in.
21794 avail_ext="$avail_ext $xxx"
21800 cygwin) avail_ext="$avail_ext $xxx" ;;
21803 XS/APItest|xs/apitest)
21804 # This is just for testing. Skip it unless we have dynamic loading.
21807 $define) avail_ext="$avail_ext $xxx" ;;
21810 XS/Typemap|xs/typemap)
21811 # This is just for testing. Skip it unless we have dynamic loading.
21813 $define) avail_ext="$avail_ext $xxx" ;;
21816 *) avail_ext="$avail_ext $xxx"
21825 case "$onlyextensions" in
21827 *) keepextensions=''
21828 echo "You have requested that only certains extensions be included..." >&4
21829 for i in $onlyextensions; do
21830 case " $avail_ext " in
21832 echo "Keeping extension $i."
21833 keepextensions="$keepextensions $i"
21835 *) echo "Ignoring extension $i." ;;
21838 avail_ext="$keepextensions"
21842 case "$noextensions" in
21844 *) keepextensions=''
21845 echo "You have requested that certain extensions be ignored..." >&4
21846 for i in $avail_ext; do
21847 case " $noextensions " in
21848 *" $i "*) echo "Ignoring extension $i." ;;
21849 *) echo "Keeping extension $i.";
21850 keepextensions="$keepextensions $i"
21854 avail_ext="$keepextensions"
21858 : Now see which nonxs extensions are supported on this system.
21859 : For now assume all are.
21861 for xxx in $nonxs_extensions ; do
21863 *) nonxs_ext="$nonxs_ext $xxx"
21875 A number of extensions are supplied with $package. You may choose to
21876 compile these extensions for dynamic loading (the default), compile
21877 them into the $package executable (static loading), or not include
21878 them at all. Answer "none" to include no extensions.
21879 Note that DynaLoader is always built and need not be mentioned here.
21882 case "$dynamic_ext" in
21884 : Exclude those listed in static_ext
21886 for xxx in $avail_ext; do
21887 case " $static_ext " in
21889 *) dflt="$dflt $xxx" ;;
21896 *) dflt="$dynamic_ext"
21897 # Perhaps we are reusing an old out-of-date config.sh.
21900 if test X"$dynamic_ext" != X"$avail_ext"; then
21902 NOTICE: Your previous config.sh list may be incorrect.
21903 The extensions now available to you are
21905 but the default list from your previous config.sh is
21917 rp="What extensions do you wish to load dynamically?"
21920 none) dynamic_ext=' ' ;;
21921 *) dynamic_ext="$ans" ;;
21924 case "$static_ext" in
21926 : Exclude those already listed in dynamic linking
21928 for xxx in $avail_ext; do
21929 case " $dynamic_ext " in
21931 *) dflt="$dflt $xxx" ;;
21938 *) dflt="$static_ext"
21945 rp="What extensions do you wish to load statically?"
21948 none) static_ext=' ' ;;
21949 *) static_ext="$ans" ;;
21954 A number of extensions are supplied with $package. Answer "none"
21955 to include no extensions.
21956 Note that DynaLoader is always built and need not be mentioned here.
21959 case "$static_ext" in
21960 '') dflt="$avail_ext" ;;
21961 *) dflt="$static_ext"
21962 # Perhaps we are reusing an old out-of-date config.sh.
21965 if test X"$static_ext" != X"$avail_ext"; then
21967 NOTICE: Your previous config.sh list may be incorrect.
21968 The extensions now available to you are
21970 but the default list from your previous config.sh is
21979 : Exclude those that are not xs extensions
21983 rp="What extensions do you wish to include?"
21986 none) static_ext=' ' ;;
21987 *) static_ext="$ans" ;;
21992 # Encode is a special case. If we are building Encode as a static
21993 # extension, we need to explicitly list its subextensions as well.
21994 # For other nested extensions, this is handled automatically by
21995 # the appropriate Makefile.PL.
21996 case " $static_ext " in
21997 *" Encode "*) # Add the subextensions of Encode
21999 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
22000 static_ext="$static_ext Encode/$xxx"
22006 set X $dynamic_ext $static_ext $nonxs_ext
22010 # Sanity check: We require an extension suitable for use with
22011 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
22012 # should show up as failures in the test suite, but it's helpful to
22013 # catch them now.) The 'extensions' list is normally sorted
22014 # alphabetically, so we need to accept either
22015 # DB_File ... Fcntl ... IO ....
22016 # or something like
22017 # Fcntl ... NDBM_File ... IO ....
22018 case " $extensions" in
22019 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
22020 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
22021 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
22022 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
22023 echo "WARNING: The Perl you are building will be quite crippled." >& 4
22027 : Remove libraries needed only for extensions
22028 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
22029 : The exception is SunOS 4.x, which needs them.
22030 case "${osname}X${osvers}" in
22034 *) case "$usedl" in
22035 $define|true|[yY]*)
22036 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -lgdbm_compat @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
22040 *) perllibs="$libs"
22046 : Remove build directory name from cppstdin so it can be used from
22047 : either the present location or the final installed location.
22049 : Get out of the UU directory to get correct path name.
22051 case "$cppstdin" in
22053 echo "Stripping down cppstdin path name"
22059 : end of configuration questions
22061 echo "End of configuration questions."
22064 : back to where it started
22065 if test -d ../UU; then
22069 : configuration may be unconditionally patched via a 'config.arch' file
22070 if $test -f config.arch; then
22071 echo "I see a config.arch file, loading it." >&4
22075 : configuration may be patched via a 'config.over' file
22076 if $test -f config.over; then
22079 rp='I see a config.over file. Do you wish to load it?'
22082 n*) echo "OK, I'll ignore it.";;
22084 echo "Configuration override changes have been loaded."
22089 : in case they want portability, strip down executable paths
22090 case "$d_portable" in
22093 echo "Stripping down executable paths..." >&4
22094 for file in $loclist $trylist; do
22096 eval $file=`basename $temp`
22101 : create config.sh file
22103 echo "Creating config.sh..." >&4
22104 $spitshell <<EOT >config.sh
22107 # This file was produced by running the Configure script. It holds all the
22108 # definitions figured out by Configure. Should you modify one of these values,
22109 # do not forget to propagate your changes by running "Configure -der". You may
22110 # instead choose to run each of the .SH files by yourself, or "Configure -S".
22113 # Package name : $package
22114 # Source directory : $src
22115 # Configuration time: $cf_time
22116 # Configured by : $cf_by
22117 # Target system : $myuname
22120 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
22121 $spitshell <<EOT >>config.sh
22130 Revision='$Revision'
22138 alignbytes='$alignbytes'
22139 ansi2knr='$ansi2knr'
22140 aphostname='$aphostname'
22141 api_revision='$api_revision'
22142 api_subversion='$api_subversion'
22143 api_version='$api_version'
22144 api_versionstring='$api_versionstring'
22147 archlibexp='$archlibexp'
22148 archname64='$archname64'
22149 archname='$archname'
22150 archobjs='$archobjs'
22151 asctime_r_proto='$asctime_r_proto'
22159 byteorder='$byteorder'
22161 castflags='$castflags'
22164 cccdlflags='$cccdlflags'
22165 ccdlflags='$ccdlflags'
22167 ccflags_uselargefiles='$ccflags_uselargefiles'
22169 ccsymbols='$ccsymbols'
22170 ccversion='$ccversion'
22172 cf_email='$cf_email'
22177 clocktype='$clocktype'
22179 compress='$compress'
22180 contains='$contains'
22184 cpp_stuff='$cpp_stuff'
22185 cppccsymbols='$cppccsymbols'
22186 cppflags='$cppflags'
22188 cppminus='$cppminus'
22190 cppstdin='$cppstdin'
22191 cppsymbols='$cppsymbols'
22192 crypt_r_proto='$crypt_r_proto'
22193 cryptlib='$cryptlib'
22195 ctermid_r_proto='$ctermid_r_proto'
22196 ctime_r_proto='$ctime_r_proto'
22197 d_Gconvert='$d_Gconvert'
22198 d_PRIEUldbl='$d_PRIEUldbl'
22199 d_PRIFUldbl='$d_PRIFUldbl'
22200 d_PRIGUldbl='$d_PRIGUldbl'
22201 d_PRIXU64='$d_PRIXU64'
22202 d_PRId64='$d_PRId64'
22203 d_PRIeldbl='$d_PRIeldbl'
22204 d_PRIfldbl='$d_PRIfldbl'
22205 d_PRIgldbl='$d_PRIgldbl'
22206 d_PRIi64='$d_PRIi64'
22207 d_PRIo64='$d_PRIo64'
22208 d_PRIu64='$d_PRIu64'
22209 d_PRIx64='$d_PRIx64'
22210 d_SCNfldbl='$d_SCNfldbl'
22211 d__fwalk='$d__fwalk'
22212 d_access='$d_access'
22213 d_accessx='$d_accessx'
22216 d_archlib='$d_archlib'
22217 d_asctime64='$d_asctime64'
22218 d_asctime_r='$d_asctime_r'
22221 d_attribute_deprecated='$d_attribute_deprecated'
22222 d_attribute_format='$d_attribute_format'
22223 d_attribute_malloc='$d_attribute_malloc'
22224 d_attribute_nonnull='$d_attribute_nonnull'
22225 d_attribute_noreturn='$d_attribute_noreturn'
22226 d_attribute_pure='$d_attribute_pure'
22227 d_attribute_unused='$d_attribute_unused'
22228 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
22232 d_bsdgetpgrp='$d_bsdgetpgrp'
22233 d_bsdsetpgrp='$d_bsdsetpgrp'
22234 d_builtin_choose_expr='$d_builtin_choose_expr'
22235 d_builtin_expect='$d_builtin_expect'
22237 d_c99_variadic_macros='$d_c99_variadic_macros'
22238 d_casti32='$d_casti32'
22239 d_castneg='$d_castneg'
22240 d_charvspr='$d_charvspr'
22242 d_chroot='$d_chroot'
22243 d_chsize='$d_chsize'
22245 d_clearenv='$d_clearenv'
22246 d_closedir='$d_closedir'
22247 d_cmsghdr_s='$d_cmsghdr_s'
22249 d_copysignl='$d_copysignl'
22250 d_cplusplus='$d_cplusplus'
22252 d_crypt_r='$d_crypt_r'
22254 d_ctermid='$d_ctermid'
22255 d_ctermid_r='$d_ctermid_r'
22256 d_ctime64='$d_ctime64'
22257 d_ctime_r='$d_ctime_r'
22258 d_cuserid='$d_cuserid'
22259 d_dbl_dig='$d_dbl_dig'
22260 d_dbminitproto='$d_dbminitproto'
22261 d_difftime64='$d_difftime64'
22262 d_difftime='$d_difftime'
22263 d_dir_dd_fd='$d_dir_dd_fd'
22265 d_dirnamlen='$d_dirnamlen'
22266 d_dlerror='$d_dlerror'
22267 d_dlopen='$d_dlopen'
22268 d_dlsymun='$d_dlsymun'
22269 d_dosuid='$d_dosuid'
22270 d_drand48_r='$d_drand48_r'
22271 d_drand48proto='$d_drand48proto'
22273 d_eaccess='$d_eaccess'
22274 d_endgrent='$d_endgrent'
22275 d_endgrent_r='$d_endgrent_r'
22276 d_endhent='$d_endhent'
22277 d_endhostent_r='$d_endhostent_r'
22278 d_endnent='$d_endnent'
22279 d_endnetent_r='$d_endnetent_r'
22280 d_endpent='$d_endpent'
22281 d_endprotoent_r='$d_endprotoent_r'
22282 d_endpwent='$d_endpwent'
22283 d_endpwent_r='$d_endpwent_r'
22284 d_endsent='$d_endsent'
22285 d_endservent_r='$d_endservent_r'
22286 d_eofnblk='$d_eofnblk'
22287 d_eunice='$d_eunice'
22288 d_faststdio='$d_faststdio'
22289 d_fchdir='$d_fchdir'
22290 d_fchmod='$d_fchmod'
22291 d_fchown='$d_fchown'
22293 d_fcntl_can_lock='$d_fcntl_can_lock'
22294 d_fd_macros='$d_fd_macros'
22295 d_fd_set='$d_fd_set'
22296 d_fds_bits='$d_fds_bits'
22297 d_fgetpos='$d_fgetpos'
22298 d_finite='$d_finite'
22299 d_finitel='$d_finitel'
22300 d_flexfnam='$d_flexfnam'
22302 d_flockproto='$d_flockproto'
22304 d_fp_class='$d_fp_class'
22305 d_fpathconf='$d_fpathconf'
22306 d_fpclass='$d_fpclass'
22307 d_fpclassify='$d_fpclassify'
22308 d_fpclassl='$d_fpclassl'
22309 d_fpos64_t='$d_fpos64_t'
22310 d_frexpl='$d_frexpl'
22311 d_fs_data_s='$d_fs_data_s'
22312 d_fseeko='$d_fseeko'
22313 d_fsetpos='$d_fsetpos'
22314 d_fstatfs='$d_fstatfs'
22315 d_fstatvfs='$d_fstatvfs'
22317 d_ftello='$d_ftello'
22319 d_futimes='$d_futimes'
22320 d_gdbm_ndbm_h_uses_prototypes='$d_gdbm_ndbm_h_uses_prototypes'
22321 d_gdbmndbm_h_uses_prototypes='$d_gdbmndbm_h_uses_prototypes'
22322 d_getaddrinfo='$d_getaddrinfo'
22323 d_getcwd='$d_getcwd'
22324 d_getespwnam='$d_getespwnam'
22325 d_getfsstat='$d_getfsstat'
22326 d_getgrent='$d_getgrent'
22327 d_getgrent_r='$d_getgrent_r'
22328 d_getgrgid_r='$d_getgrgid_r'
22329 d_getgrnam_r='$d_getgrnam_r'
22330 d_getgrps='$d_getgrps'
22331 d_gethbyaddr='$d_gethbyaddr'
22332 d_gethbyname='$d_gethbyname'
22333 d_gethent='$d_gethent'
22334 d_gethname='$d_gethname'
22335 d_gethostbyaddr_r='$d_gethostbyaddr_r'
22336 d_gethostbyname_r='$d_gethostbyname_r'
22337 d_gethostent_r='$d_gethostent_r'
22338 d_gethostprotos='$d_gethostprotos'
22339 d_getitimer='$d_getitimer'
22340 d_getlogin='$d_getlogin'
22341 d_getlogin_r='$d_getlogin_r'
22342 d_getmnt='$d_getmnt'
22343 d_getmntent='$d_getmntent'
22344 d_getnameinfo='$d_getnameinfo'
22345 d_getnbyaddr='$d_getnbyaddr'
22346 d_getnbyname='$d_getnbyname'
22347 d_getnent='$d_getnent'
22348 d_getnetbyaddr_r='$d_getnetbyaddr_r'
22349 d_getnetbyname_r='$d_getnetbyname_r'
22350 d_getnetent_r='$d_getnetent_r'
22351 d_getnetprotos='$d_getnetprotos'
22352 d_getpagsz='$d_getpagsz'
22353 d_getpbyname='$d_getpbyname'
22354 d_getpbynumber='$d_getpbynumber'
22355 d_getpent='$d_getpent'
22356 d_getpgid='$d_getpgid'
22357 d_getpgrp2='$d_getpgrp2'
22358 d_getpgrp='$d_getpgrp'
22359 d_getppid='$d_getppid'
22360 d_getprior='$d_getprior'
22361 d_getprotobyname_r='$d_getprotobyname_r'
22362 d_getprotobynumber_r='$d_getprotobynumber_r'
22363 d_getprotoent_r='$d_getprotoent_r'
22364 d_getprotoprotos='$d_getprotoprotos'
22365 d_getprpwnam='$d_getprpwnam'
22366 d_getpwent='$d_getpwent'
22367 d_getpwent_r='$d_getpwent_r'
22368 d_getpwnam_r='$d_getpwnam_r'
22369 d_getpwuid_r='$d_getpwuid_r'
22370 d_getsbyname='$d_getsbyname'
22371 d_getsbyport='$d_getsbyport'
22372 d_getsent='$d_getsent'
22373 d_getservbyname_r='$d_getservbyname_r'
22374 d_getservbyport_r='$d_getservbyport_r'
22375 d_getservent_r='$d_getservent_r'
22376 d_getservprotos='$d_getservprotos'
22377 d_getspnam='$d_getspnam'
22378 d_getspnam_r='$d_getspnam_r'
22379 d_gettimeod='$d_gettimeod'
22380 d_gmtime64='$d_gmtime64'
22381 d_gmtime_r='$d_gmtime_r'
22382 d_gnulibc='$d_gnulibc'
22383 d_grpasswd='$d_grpasswd'
22384 d_hasmntopt='$d_hasmntopt'
22386 d_ilogbl='$d_ilogbl'
22387 d_inc_version_list='$d_inc_version_list'
22389 d_inetaton='$d_inetaton'
22390 d_inetntop='$d_inetntop'
22391 d_inetpton='$d_inetpton'
22392 d_int64_t='$d_int64_t'
22393 d_isascii='$d_isascii'
22394 d_isfinite='$d_isfinite'
22397 d_isnanl='$d_isnanl'
22398 d_killpg='$d_killpg'
22399 d_lchown='$d_lchown'
22400 d_ldbl_dig='$d_ldbl_dig'
22401 d_libm_lib_version='$d_libm_lib_version'
22403 d_localtime64='$d_localtime64'
22404 d_localtime_r='$d_localtime_r'
22405 d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset'
22406 d_locconv='$d_locconv'
22408 d_longdbl='$d_longdbl'
22409 d_longlong='$d_longlong'
22410 d_lseekproto='$d_lseekproto'
22412 d_madvise='$d_madvise'
22413 d_malloc_good_size='$d_malloc_good_size'
22414 d_malloc_size='$d_malloc_size'
22416 d_mbstowcs='$d_mbstowcs'
22417 d_mbtowc='$d_mbtowc'
22418 d_memchr='$d_memchr'
22419 d_memcmp='$d_memcmp'
22420 d_memcpy='$d_memcpy'
22421 d_memmove='$d_memmove'
22422 d_memset='$d_memset'
22424 d_mkdtemp='$d_mkdtemp'
22425 d_mkfifo='$d_mkfifo'
22426 d_mkstemp='$d_mkstemp'
22427 d_mkstemps='$d_mkstemps'
22428 d_mktime64='$d_mktime64'
22429 d_mktime='$d_mktime'
22432 d_modfl_pow32_bug='$d_modfl_pow32_bug'
22433 d_modflproto='$d_modflproto'
22434 d_mprotect='$d_mprotect'
22436 d_msg_ctrunc='$d_msg_ctrunc'
22437 d_msg_dontroute='$d_msg_dontroute'
22438 d_msg_oob='$d_msg_oob'
22439 d_msg_peek='$d_msg_peek'
22440 d_msg_proxy='$d_msg_proxy'
22441 d_msgctl='$d_msgctl'
22442 d_msgget='$d_msgget'
22443 d_msghdr_s='$d_msghdr_s'
22444 d_msgrcv='$d_msgrcv'
22445 d_msgsnd='$d_msgsnd'
22447 d_munmap='$d_munmap'
22448 d_mymalloc='$d_mymalloc'
22450 d_ndbm_h_uses_prototypes='$d_ndbm_h_uses_prototypes'
22452 d_nl_langinfo='$d_nl_langinfo'
22453 d_nv_preserves_uv='$d_nv_preserves_uv'
22454 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
22455 d_off64_t='$d_off64_t'
22456 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
22457 d_oldpthreads='$d_oldpthreads'
22458 d_oldsock='$d_oldsock'
22460 d_pathconf='$d_pathconf'
22462 d_perl_otherlibdirs='$d_perl_otherlibdirs'
22463 d_phostname='$d_phostname'
22466 d_portable='$d_portable'
22467 d_printf_format_null='$d_printf_format_null'
22468 d_procselfexe='$d_procselfexe'
22469 d_pseudofork='$d_pseudofork'
22470 d_pthread_atfork='$d_pthread_atfork'
22471 d_pthread_attr_setscope='$d_pthread_attr_setscope'
22472 d_pthread_yield='$d_pthread_yield'
22474 d_pwchange='$d_pwchange'
22475 d_pwclass='$d_pwclass'
22476 d_pwcomment='$d_pwcomment'
22477 d_pwexpire='$d_pwexpire'
22478 d_pwgecos='$d_pwgecos'
22479 d_pwpasswd='$d_pwpasswd'
22480 d_pwquota='$d_pwquota'
22483 d_random_r='$d_random_r'
22484 d_readdir64_r='$d_readdir64_r'
22485 d_readdir='$d_readdir'
22486 d_readdir_r='$d_readdir_r'
22487 d_readlink='$d_readlink'
22489 d_recvmsg='$d_recvmsg'
22490 d_rename='$d_rename'
22491 d_rewinddir='$d_rewinddir'
22493 d_safebcpy='$d_safebcpy'
22494 d_safemcpy='$d_safemcpy'
22495 d_sanemcmp='$d_sanemcmp'
22496 d_sbrkproto='$d_sbrkproto'
22497 d_scalbnl='$d_scalbnl'
22498 d_sched_yield='$d_sched_yield'
22499 d_scm_rights='$d_scm_rights'
22500 d_seekdir='$d_seekdir'
22501 d_select='$d_select'
22503 d_semctl='$d_semctl'
22504 d_semctl_semid_ds='$d_semctl_semid_ds'
22505 d_semctl_semun='$d_semctl_semun'
22506 d_semget='$d_semget'
22508 d_sendmsg='$d_sendmsg'
22509 d_setegid='$d_setegid'
22510 d_seteuid='$d_seteuid'
22511 d_setgrent='$d_setgrent'
22512 d_setgrent_r='$d_setgrent_r'
22513 d_setgrps='$d_setgrps'
22514 d_sethent='$d_sethent'
22515 d_sethostent_r='$d_sethostent_r'
22516 d_setitimer='$d_setitimer'
22517 d_setlinebuf='$d_setlinebuf'
22518 d_setlocale='$d_setlocale'
22519 d_setlocale_r='$d_setlocale_r'
22520 d_setnent='$d_setnent'
22521 d_setnetent_r='$d_setnetent_r'
22522 d_setpent='$d_setpent'
22523 d_setpgid='$d_setpgid'
22524 d_setpgrp2='$d_setpgrp2'
22525 d_setpgrp='$d_setpgrp'
22526 d_setprior='$d_setprior'
22527 d_setproctitle='$d_setproctitle'
22528 d_setprotoent_r='$d_setprotoent_r'
22529 d_setpwent='$d_setpwent'
22530 d_setpwent_r='$d_setpwent_r'
22531 d_setregid='$d_setregid'
22532 d_setresgid='$d_setresgid'
22533 d_setresuid='$d_setresuid'
22534 d_setreuid='$d_setreuid'
22535 d_setrgid='$d_setrgid'
22536 d_setruid='$d_setruid'
22537 d_setsent='$d_setsent'
22538 d_setservent_r='$d_setservent_r'
22539 d_setsid='$d_setsid'
22540 d_setvbuf='$d_setvbuf'
22544 d_shmatprototype='$d_shmatprototype'
22545 d_shmctl='$d_shmctl'
22547 d_shmget='$d_shmget'
22548 d_sigaction='$d_sigaction'
22549 d_signbit='$d_signbit'
22550 d_sigprocmask='$d_sigprocmask'
22551 d_sigsetjmp='$d_sigsetjmp'
22552 d_sitearch='$d_sitearch'
22553 d_snprintf='$d_snprintf'
22554 d_sockatmark='$d_sockatmark'
22555 d_sockatmarkproto='$d_sockatmarkproto'
22556 d_socket='$d_socket'
22557 d_socklen_t='$d_socklen_t'
22558 d_sockpair='$d_sockpair'
22559 d_socks5_init='$d_socks5_init'
22560 d_sprintf_returns_strlen='$d_sprintf_returns_strlen'
22562 d_srand48_r='$d_srand48_r'
22563 d_srandom_r='$d_srandom_r'
22564 d_sresgproto='$d_sresgproto'
22565 d_sresuproto='$d_sresuproto'
22566 d_statblks='$d_statblks'
22567 d_statfs_f_flags='$d_statfs_f_flags'
22568 d_statfs_s='$d_statfs_s'
22569 d_statvfs='$d_statvfs'
22570 d_stdio_cnt_lval='$d_stdio_cnt_lval'
22571 d_stdio_ptr_lval='$d_stdio_ptr_lval'
22572 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
22573 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
22574 d_stdio_stream_array='$d_stdio_stream_array'
22575 d_stdiobase='$d_stdiobase'
22576 d_stdstdio='$d_stdstdio'
22577 d_strchr='$d_strchr'
22578 d_strcoll='$d_strcoll'
22579 d_strctcpy='$d_strctcpy'
22580 d_strerrm='$d_strerrm'
22581 d_strerror='$d_strerror'
22582 d_strerror_r='$d_strerror_r'
22583 d_strftime='$d_strftime'
22584 d_strlcat='$d_strlcat'
22585 d_strlcpy='$d_strlcpy'
22586 d_strtod='$d_strtod'
22587 d_strtol='$d_strtol'
22588 d_strtold='$d_strtold'
22589 d_strtoll='$d_strtoll'
22590 d_strtoq='$d_strtoq'
22591 d_strtoul='$d_strtoul'
22592 d_strtoull='$d_strtoull'
22593 d_strtouq='$d_strtouq'
22594 d_strxfrm='$d_strxfrm'
22595 d_suidsafe='$d_suidsafe'
22596 d_symlink='$d_symlink'
22597 d_syscall='$d_syscall'
22598 d_syscallproto='$d_syscallproto'
22599 d_sysconf='$d_sysconf'
22600 d_sysernlst='$d_sysernlst'
22601 d_syserrlst='$d_syserrlst'
22602 d_system='$d_system'
22603 d_tcgetpgrp='$d_tcgetpgrp'
22604 d_tcsetpgrp='$d_tcsetpgrp'
22605 d_telldir='$d_telldir'
22606 d_telldirproto='$d_telldirproto'
22608 d_timegm='$d_timegm'
22610 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
22611 d_tm_tm_zone='$d_tm_tm_zone'
22612 d_tmpnam_r='$d_tmpnam_r'
22613 d_truncate='$d_truncate'
22614 d_ttyname_r='$d_ttyname_r'
22615 d_tzname='$d_tzname'
22616 d_u32align='$d_u32align'
22617 d_ualarm='$d_ualarm'
22620 d_union_semun='$d_union_semun'
22621 d_unordered='$d_unordered'
22622 d_unsetenv='$d_unsetenv'
22623 d_usleep='$d_usleep'
22624 d_usleepproto='$d_usleepproto'
22626 d_vendorarch='$d_vendorarch'
22627 d_vendorbin='$d_vendorbin'
22628 d_vendorlib='$d_vendorlib'
22629 d_vendorscript='$d_vendorscript'
22631 d_void_closedir='$d_void_closedir'
22632 d_voidsig='$d_voidsig'
22633 d_voidtty='$d_voidtty'
22634 d_volatile='$d_volatile'
22635 d_vprintf='$d_vprintf'
22636 d_vsnprintf='$d_vsnprintf'
22638 d_waitpid='$d_waitpid'
22639 d_wcstombs='$d_wcstombs'
22640 d_wctomb='$d_wctomb'
22641 d_writev='$d_writev'
22644 db_hashtype='$db_hashtype'
22645 db_prefixtype='$db_prefixtype'
22646 db_version_major='$db_version_major'
22647 db_version_minor='$db_version_minor'
22648 db_version_patch='$db_version_patch'
22649 defvoidused='$defvoidused'
22650 direntrytype='$direntrytype'
22653 doublesize='$doublesize'
22655 drand48_r_proto='$drand48_r_proto'
22657 dynamic_ext='$dynamic_ext'
22663 endgrent_r_proto='$endgrent_r_proto'
22664 endhostent_r_proto='$endhostent_r_proto'
22665 endnetent_r_proto='$endnetent_r_proto'
22666 endprotoent_r_proto='$endprotoent_r_proto'
22667 endpwent_r_proto='$endpwent_r_proto'
22668 endservent_r_proto='$endservent_r_proto'
22669 eunicefix='$eunicefix'
22672 extensions='$extensions'
22673 extern_C='$extern_C'
22675 fflushNULL='$fflushNULL'
22676 fflushall='$fflushall'
22678 firstmakefile='$firstmakefile'
22680 fpossize='$fpossize'
22681 fpostype='$fpostype'
22682 freetype='$freetype'
22685 full_csh='$full_csh'
22686 full_sed='$full_sed'
22687 gccansipedantic='$gccansipedantic'
22688 gccosandvers='$gccosandvers'
22689 gccversion='$gccversion'
22690 getgrent_r_proto='$getgrent_r_proto'
22691 getgrgid_r_proto='$getgrgid_r_proto'
22692 getgrnam_r_proto='$getgrnam_r_proto'
22693 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
22694 gethostbyname_r_proto='$gethostbyname_r_proto'
22695 gethostent_r_proto='$gethostent_r_proto'
22696 getlogin_r_proto='$getlogin_r_proto'
22697 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
22698 getnetbyname_r_proto='$getnetbyname_r_proto'
22699 getnetent_r_proto='$getnetent_r_proto'
22700 getprotobyname_r_proto='$getprotobyname_r_proto'
22701 getprotobynumber_r_proto='$getprotobynumber_r_proto'
22702 getprotoent_r_proto='$getprotoent_r_proto'
22703 getpwent_r_proto='$getpwent_r_proto'
22704 getpwnam_r_proto='$getpwnam_r_proto'
22705 getpwuid_r_proto='$getpwuid_r_proto'
22706 getservbyname_r_proto='$getservbyname_r_proto'
22707 getservbyport_r_proto='$getservbyport_r_proto'
22708 getservent_r_proto='$getservent_r_proto'
22709 getspnam_r_proto='$getspnam_r_proto'
22710 gidformat='$gidformat'
22716 gmtime_r_proto='$gmtime_r_proto'
22717 gnulibc_version='$gnulibc_version'
22719 groupcat='$groupcat'
22720 groupstype='$groupstype'
22723 h_sysfile='$h_sysfile'
22726 html1dir='$html1dir'
22727 html1direxp='$html1direxp'
22728 html3dir='$html3dir'
22729 html3direxp='$html3direxp'
22738 i_arpainet='$i_arpainet'
22739 i_assert='$i_assert'
22740 i_bsdioctl='$i_bsdioctl'
22744 i_dirent='$i_dirent'
22750 i_fp_class='$i_fp_class'
22752 i_gdbm_ndbm='$i_gdbm_ndbm'
22753 i_gdbmndbm='$i_gdbmndbm'
22755 i_ieeefp='$i_ieeefp'
22756 i_inttypes='$i_inttypes'
22757 i_langinfo='$i_langinfo'
22758 i_libutil='$i_libutil'
22759 i_limits='$i_limits'
22760 i_locale='$i_locale'
22761 i_machcthr='$i_machcthr'
22762 i_malloc='$i_malloc'
22763 i_mallocmalloc='$i_mallocmalloc'
22765 i_memory='$i_memory'
22766 i_mntent='$i_mntent'
22769 i_neterrno='$i_neterrno'
22770 i_netinettcp='$i_netinettcp'
22774 i_pthread='$i_pthread'
22776 i_rpcsvcdbm='$i_rpcsvcdbm'
22779 i_shadow='$i_shadow'
22781 i_stdarg='$i_stdarg'
22782 i_stddef='$i_stddef'
22783 i_stdlib='$i_stdlib'
22784 i_string='$i_string'
22785 i_sunmath='$i_sunmath'
22786 i_sysaccess='$i_sysaccess'
22787 i_sysdir='$i_sysdir'
22788 i_sysfile='$i_sysfile'
22789 i_sysfilio='$i_sysfilio'
22791 i_sysioctl='$i_sysioctl'
22792 i_syslog='$i_syslog'
22793 i_sysmman='$i_sysmman'
22794 i_sysmode='$i_sysmode'
22795 i_sysmount='$i_sysmount'
22796 i_sysndir='$i_sysndir'
22797 i_sysparam='$i_sysparam'
22798 i_syspoll='$i_syspoll'
22799 i_sysresrc='$i_sysresrc'
22800 i_syssecrt='$i_syssecrt'
22801 i_sysselct='$i_sysselct'
22802 i_syssockio='$i_syssockio'
22803 i_sysstat='$i_sysstat'
22804 i_sysstatfs='$i_sysstatfs'
22805 i_sysstatvfs='$i_sysstatvfs'
22806 i_systime='$i_systime'
22807 i_systimek='$i_systimek'
22808 i_systimes='$i_systimes'
22809 i_systypes='$i_systypes'
22810 i_sysuio='$i_sysuio'
22812 i_sysutsname='$i_sysutsname'
22813 i_sysvfs='$i_sysvfs'
22814 i_syswait='$i_syswait'
22815 i_termio='$i_termio'
22816 i_termios='$i_termios'
22818 i_unistd='$i_unistd'
22821 i_values='$i_values'
22822 i_varargs='$i_varargs'
22823 i_varhdr='$i_varhdr'
22825 ignore_versioned_solibs='$ignore_versioned_solibs'
22826 inc_version_list='$inc_version_list'
22827 inc_version_list_init='$inc_version_list_init'
22830 initialinstalllocation='$initialinstalllocation'
22831 installarchlib='$installarchlib'
22832 installbin='$installbin'
22833 installhtml1dir='$installhtml1dir'
22834 installhtml3dir='$installhtml3dir'
22835 installman1dir='$installman1dir'
22836 installman3dir='$installman3dir'
22837 installprefix='$installprefix'
22838 installprefixexp='$installprefixexp'
22839 installprivlib='$installprivlib'
22840 installscript='$installscript'
22841 installsitearch='$installsitearch'
22842 installsitebin='$installsitebin'
22843 installsitehtml1dir='$installsitehtml1dir'
22844 installsitehtml3dir='$installsitehtml3dir'
22845 installsitelib='$installsitelib'
22846 installsiteman1dir='$installsiteman1dir'
22847 installsiteman3dir='$installsiteman3dir'
22848 installsitescript='$installsitescript'
22849 installstyle='$installstyle'
22850 installusrbinperl='$installusrbinperl'
22851 installvendorarch='$installvendorarch'
22852 installvendorbin='$installvendorbin'
22853 installvendorhtml1dir='$installvendorhtml1dir'
22854 installvendorhtml3dir='$installvendorhtml3dir'
22855 installvendorlib='$installvendorlib'
22856 installvendorman1dir='$installvendorman1dir'
22857 installvendorman3dir='$installvendorman3dir'
22858 installvendorscript='$installvendorscript'
22860 issymlink='$issymlink'
22861 ivdformat='$ivdformat'
22864 known_extensions='$known_extensions'
22867 lddlflags='$lddlflags'
22869 ldflags_uselargefiles='$ldflags_uselargefiles'
22870 ldlibpthname='$ldlibpthname'
22877 libsdirs='$libsdirs'
22878 libsfiles='$libsfiles'
22879 libsfound='$libsfound'
22880 libspath='$libspath'
22881 libswanted='$libswanted'
22882 libswanted_uselargefiles='$libswanted_uselargefiles'
22888 localtime_r_proto='$localtime_r_proto'
22889 locincpth='$locincpth'
22890 loclibpth='$loclibpth'
22891 longdblsize='$longdblsize'
22892 longlongsize='$longlongsize'
22893 longsize='$longsize'
22897 lseeksize='$lseeksize'
22898 lseektype='$lseektype'
22901 madlyobj='$madlyobj'
22902 madlysrc='$madlysrc'
22906 make_set_make='$make_set_make'
22907 mallocobj='$mallocobj'
22908 mallocsrc='$mallocsrc'
22909 malloctype='$malloctype'
22911 man1direxp='$man1direxp'
22914 man3direxp='$man3direxp'
22916 mips_type='$mips_type'
22917 mistrustnm='$mistrustnm'
22919 mmaptype='$mmaptype'
22920 modetype='$modetype'
22922 multiarch='$multiarch'
22924 myarchname='$myarchname'
22925 mydomain='$mydomain'
22926 myhostname='$myhostname'
22929 need_va_copy='$need_va_copy'
22930 netdb_hlen_type='$netdb_hlen_type'
22931 netdb_host_type='$netdb_host_type'
22932 netdb_name_type='$netdb_name_type'
22933 netdb_net_type='$netdb_net_type'
22936 nm_so_opt='$nm_so_opt'
22937 nonxs_ext='$nonxs_ext'
22939 nvEUformat='$nvEUformat'
22940 nvFUformat='$nvFUformat'
22941 nvGUformat='$nvGUformat'
22942 nv_overflows_integers_at='$nv_overflows_integers_at'
22943 nv_preserves_uv_bits='$nv_preserves_uv_bits'
22944 nveformat='$nveformat'
22945 nvfformat='$nvfformat'
22946 nvgformat='$nvgformat'
22949 o_nonblock='$o_nonblock'
22951 old_pthread_create_joinable='$old_pthread_create_joinable'
22952 optimize='$optimize'
22953 orderlib='$orderlib'
22956 otherlibdirs='$otherlibdirs'
22960 patchlevel='$patchlevel'
22961 path_sep='$path_sep'
22964 perl_patchlevel='$perl_patchlevel'
22965 perladmin='$perladmin'
22966 perllibs='$perllibs'
22967 perlpath='$perlpath'
22969 phostname='$phostname'
22975 prefixexp='$prefixexp'
22977 privlibexp='$privlibexp'
22978 procselfexe='$procselfexe'
22979 prototype='$prototype'
22981 quadkind='$quadkind'
22982 quadtype='$quadtype'
22983 randbits='$randbits'
22984 randfunc='$randfunc'
22985 random_r_proto='$random_r_proto'
22986 randseedtype='$randseedtype'
22988 rd_nodata='$rd_nodata'
22989 readdir64_r_proto='$readdir64_r_proto'
22990 readdir_r_proto='$readdir_r_proto'
22991 revision='$revision'
22997 sGMTIME_max='$sGMTIME_max'
22998 sGMTIME_min='$sGMTIME_min'
22999 sLOCALTIME_max='$sLOCALTIME_max'
23000 sLOCALTIME_min='$sLOCALTIME_min'
23001 sPRIEUldbl='$sPRIEUldbl'
23002 sPRIFUldbl='$sPRIFUldbl'
23003 sPRIGUldbl='$sPRIGUldbl'
23004 sPRIXU64='$sPRIXU64'
23006 sPRIeldbl='$sPRIeldbl'
23007 sPRIfldbl='$sPRIfldbl'
23008 sPRIgldbl='$sPRIgldbl'
23013 sSCNfldbl='$sSCNfldbl'
23014 sched_yield='$sched_yield'
23015 scriptdir='$scriptdir'
23016 scriptdirexp='$scriptdirexp'
23018 seedfunc='$seedfunc'
23019 selectminbits='$selectminbits'
23020 selecttype='$selecttype'
23021 sendmail='$sendmail'
23022 setgrent_r_proto='$setgrent_r_proto'
23023 sethostent_r_proto='$sethostent_r_proto'
23024 setlocale_r_proto='$setlocale_r_proto'
23025 setnetent_r_proto='$setnetent_r_proto'
23026 setprotoent_r_proto='$setprotoent_r_proto'
23027 setpwent_r_proto='$setpwent_r_proto'
23028 setservent_r_proto='$setservent_r_proto'
23031 sharpbang='$sharpbang'
23032 shmattype='$shmattype'
23033 shortsize='$shortsize'
23036 sig_count='$sig_count'
23037 sig_name='$sig_name'
23038 sig_name_init='$sig_name_init'
23040 sig_num_init='$sig_num_init'
23041 sig_size='$sig_size'
23042 signal_t='$signal_t'
23043 sitearch='$sitearch'
23044 sitearchexp='$sitearchexp'
23046 sitebinexp='$sitebinexp'
23047 sitehtml1dir='$sitehtml1dir'
23048 sitehtml1direxp='$sitehtml1direxp'
23049 sitehtml3dir='$sitehtml3dir'
23050 sitehtml3direxp='$sitehtml3direxp'
23052 sitelib_stem='$sitelib_stem'
23053 sitelibexp='$sitelibexp'
23054 siteman1dir='$siteman1dir'
23055 siteman1direxp='$siteman1direxp'
23056 siteman3dir='$siteman3dir'
23057 siteman3direxp='$siteman3direxp'
23058 siteprefix='$siteprefix'
23059 siteprefixexp='$siteprefixexp'
23060 sitescript='$sitescript'
23061 sitescriptexp='$sitescriptexp'
23062 sizesize='$sizesize'
23063 sizetype='$sizetype'
23067 sockethdr='$sockethdr'
23068 socketlib='$socketlib'
23069 socksizetype='$socksizetype'
23071 spackage='$spackage'
23072 spitshell='$spitshell'
23073 srand48_r_proto='$srand48_r_proto'
23074 srandom_r_proto='$srandom_r_proto'
23076 ssizetype='$ssizetype'
23077 startperl='$startperl'
23079 static_ext='$static_ext'
23081 stdio_base='$stdio_base'
23082 stdio_bufsiz='$stdio_bufsiz'
23083 stdio_cnt='$stdio_cnt'
23084 stdio_filbuf='$stdio_filbuf'
23085 stdio_ptr='$stdio_ptr'
23086 stdio_stream_array='$stdio_stream_array'
23087 strerror_r_proto='$strerror_r_proto'
23090 subversion='$subversion'
23094 targetarch='$targetarch'
23098 timeincl='$timeincl'
23099 timetype='$timetype'
23100 tmpnam_r_proto='$tmpnam_r_proto'
23106 ttyname_r_proto='$ttyname_r_proto'
23115 uidformat='$uidformat'
23121 uquadtype='$uquadtype'
23122 use5005threads='$use5005threads'
23123 use64bitall='$use64bitall'
23124 use64bitint='$use64bitint'
23125 usecrosscompile='$usecrosscompile'
23126 usedevel='$usedevel'
23128 usedtrace='$usedtrace'
23129 usefaststdio='$usefaststdio'
23130 useithreads='$useithreads'
23131 uselargefiles='$uselargefiles'
23132 uselongdouble='$uselongdouble'
23133 usemallocwrap='$usemallocwrap'
23134 usemorebits='$usemorebits'
23135 usemultiplicity='$usemultiplicity'
23136 usemymalloc='$usemymalloc'
23138 useopcode='$useopcode'
23139 useperlio='$useperlio'
23140 useposix='$useposix'
23141 usereentrant='$usereentrant'
23142 userelocatableinc='$userelocatableinc'
23144 useshrplib='$useshrplib'
23145 usesitecustomize='$usesitecustomize'
23146 usesocks='$usesocks'
23147 usethreads='$usethreads'
23148 usevendorprefix='$usevendorprefix'
23149 usevfork='$usevfork'
23152 uvXUformat='$uvXUformat'
23153 uvoformat='$uvoformat'
23156 uvuformat='$uvuformat'
23157 uvxformat='$uvxformat'
23158 vendorarch='$vendorarch'
23159 vendorarchexp='$vendorarchexp'
23160 vendorbin='$vendorbin'
23161 vendorbinexp='$vendorbinexp'
23162 vendorhtml1dir='$vendorhtml1dir'
23163 vendorhtml1direxp='$vendorhtml1direxp'
23164 vendorhtml3dir='$vendorhtml3dir'
23165 vendorhtml3direxp='$vendorhtml3direxp'
23166 vendorlib='$vendorlib'
23167 vendorlib_stem='$vendorlib_stem'
23168 vendorlibexp='$vendorlibexp'
23169 vendorman1dir='$vendorman1dir'
23170 vendorman1direxp='$vendorman1direxp'
23171 vendorman3dir='$vendorman3dir'
23172 vendorman3direxp='$vendorman3direxp'
23173 vendorprefix='$vendorprefix'
23174 vendorprefixexp='$vendorprefixexp'
23175 vendorscript='$vendorscript'
23176 vendorscriptexp='$vendorscriptexp'
23178 version_patchlevel_string='$version_patchlevel_string'
23179 versiononly='$versiononly'
23181 voidflags='$voidflags'
23184 yaccflags='$yaccflags'
23189 : Add in command line options if available
23190 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
23192 : add special variables
23193 $test -f $src/patchlevel.h && \
23194 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
23195 echo "PERL_PATCHLEVEL='$perl_patchlevel'" >>config.sh
23196 echo "PERL_CONFIG_SH=true" >>config.sh
23198 : propagate old symbols
23199 if $test -f UU/config.sh; then
23200 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
23201 $sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' \
23202 config.sh config.sh UU/oldconfig.sh |\
23203 $sort | $uniq -u >UU/oldsyms
23204 set X `cat UU/oldsyms`
23210 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
23212 echo ": Variables propagated from previous config.sh file." >>config.sh
23213 for sym in `cat UU/oldsyms`; do
23214 echo " Propagating $hint variable "'$'"$sym..."
23215 eval 'tmp="$'"${sym}"'"'
23217 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
23223 : Finish up by extracting the .SH files
23227 echo "Extraction done."
23237 If you'd like to make any changes to the config.sh file before I begin
23238 to configure things, do it as a shell escape now (e.g. !vi config.sh).
23241 rp="Press return or use a shell escape to edit config.sh:"
23246 *) : in case they cannot read
23247 sh 1>&4 -c "$ans";;
23252 : if this fails, just run all the .SH files by hand
23261 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
23268 Now you need to generate make dependencies by running "$make depend".
23269 You might prefer to run it in background: "$make depend > makedepend.out &"
23270 It can take a while, so you might not want to run it right now.
23275 rp="Run $make depend now?"
23279 $make depend && echo "Now you must run '$make'."
23282 echo "You must run '$make depend' then '$make'."
23285 elif test -f [Mm]akefile; then
23287 echo "Now you must run a $make."
23289 echo "Configure done."
23292 if $test -f Policy.sh; then
23295 If you compile $package on a different machine or from a different object
23296 directory, copy the Policy.sh file from this object directory to the
23297 new one before you run Configure -- this will help you with most of
23298 the policy defaults.
23302 if $test -f config.msg; then
23303 echo "Hmm. I also noted the following information while running:"
23305 $cat config.msg >&4
23308 $rm -f kit*isdone ark*isdone