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
19 # Though this script was generated by metaconfig from metaunits, it is
20 # OK to send patches against Configure itself. It's up to the Configure
21 # pumpkin to backport the patch to the metaunits if it is accepted.
22 # For more information on patching Configure, see pod/perlhack.pod
24 # The metaunits are also available from the public git repository:
25 # http://perl5.git.perl.org/metaconfig.git/ or
26 # $ git clone git://perl5.git.perl.org/metaconfig.git metaconfig
28 # See Porting/pumpkin.pod for more information on metaconfig.
31 # $Id: Head.U 6 2006-08-25 22:21:46Z rmanfredi $
33 # Generated on Tue Jan 5 09:34:08 CET 2010 [metaconfig 3.5 PL0]
34 # (with additional metaconfig patches by perlbug@perl.org)
39 SCO csh still thinks true is false. Write to SCO today and tell them that next
40 year Configure ought to "rm /bin/csh" unless they fix their blasted shell. :-)
42 (Actually, Configure ought to just patch csh in place. Hmm. Hmmmmm. All
43 we'd have to do is go in and swap the && and || tokens, wherever they are.)
45 [End of diatribe. We now return you to your regularly scheduled programming...]
49 OOPS! You naughty creature! You didn't run Configure with sh!
50 I will attempt to remedy the situation by running sh for you...
54 true || exec sh $0 $argv:q
56 (exit $?0) || cat c2$$
57 (exit $?0) || exec sh $0 $argv:q
60 if test -f /dev/cputype -a -f /dev/drivers -a -f /dev/osversion; then
63 *** I'm sorry but this system looks like Plan 9 and Plan 9 doesn't do
64 *** Configure that well. (Plan 9 is close to UNIX but not close enough.)
65 *** Please read the README.plan9 for further instructions.
66 *** Cannot continue, aborting.
72 if test ! -c /dev/null ; then
75 *** I'm sorry, but /dev/null appears to be a file rather than a device.
76 *** Please consult your operating sytem's notes for making a device
78 *** Cannot continue, aborting.
84 : compute my invocation name
88 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
93 : Proper separator for the PATH environment variable
95 : On OS/2 this directory should exist if this is not floppy only system ":-]"
96 if test -d c:/. || ( uname -a | grep -i 'os\(/\|\)2' ) 2>&1 >/dev/null ; then
97 if test -n "$OS2_SHELL"; then
99 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
100 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
102 elif test -n "$DJGPP"; then
103 case "X${MACHTYPE:-nonesuchmach}" in
110 : Proper PATH setting
111 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
112 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
113 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
114 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
115 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
116 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /opt/ansic/bin /usr/ccs/bin"
117 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
118 paths="$paths /sbin /usr/sbin /usr/libexec"
119 paths="$paths /system/gnu_library/bin"
123 case "$p_$PATH$p_" in
125 *) test -d $p && PATH=$PATH$p_$p ;;
132 : shall we be using ksh?
138 if (PATH=.; alias -x) >/dev/null 2>&1; then
141 if test -f /hp-ux -a -f /bin/ksh; then
142 needksh='to avoid sh bug in "here document" expansion'
144 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
145 if test X`/usr/bin/uname -v` = X4; then
146 avoidksh="to avoid AIX 4's /bin/sh"
150 if test -f /osf_boot -a -f /usr/sbin/setld; then
151 if test X`/usr/bin/uname -s` = XOSF1; then
152 avoidksh="to avoid Digital UNIX' ksh"
157 case "$inksh/$needksh" in
164 case "$inksh/$avoidksh" in
170 case "$inksh/$needksh-$avoidksh-" in
173 (I see you are using the Korn shell. Some ksh's blow up on $me,
174 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
181 echo "(Feeding myself to $newsh $reason.)"
183 Configure|*/Configure) exec $newsh $0 "$@";;
184 *) exec $newsh Configure "$@";;
188 test -x "${newsh}" || unset newsh
190 : if needed, set CDPATH to a harmless value that is not chatty
191 : avoid bash 2.02 problems with empty CDPATH.
195 *bash*) CDPATH='.' ;;
201 : Configure runs within the UU subdirectory
202 test -d UU || mkdir UU
342 initialinstalllocation=''
371 d_attribute_deprecated=''
372 d_attribute_format=''
373 d_attribute_malloc=''
374 d_attribute_nonnull=''
375 d_attribute_noreturn=''
377 d_attribute_unused=''
378 d_attribute_warn_unused_result=''
379 d_printf_format_null=''
382 d_builtin_choose_expr=''
385 d_c99_variadic_macros=''
432 endhostent_r_proto=''
438 endprotoent_r_proto=''
444 endservent_r_proto=''
497 gethostbyaddr_r_proto=''
499 gethostbyname_r_proto=''
501 gethostent_r_proto=''
514 getnetbyaddr_r_proto=''
516 getnetbyname_r_proto=''
530 d_getprotobyname_r=''
531 getprotobyname_r_proto=''
532 d_getprotobynumber_r=''
533 getprotobynumber_r_proto=''
535 getprotoent_r_proto=''
547 getservbyname_r_proto=''
549 getservbyport_r_proto=''
551 getservent_r_proto=''
577 d_libm_lib_version=''
580 d_localtime_r_needs_tzset=''
591 d_malloc_good_size=''
633 d_old_pthread_create_joinable=''
634 old_pthread_create_joinable=''
636 d_pthread_attr_setscope=''
675 sethostent_r_proto=''
692 setprotoent_r_proto=''
704 setservent_r_proto=''
738 d_sprintf_returns_strlen=''
753 d_stdio_ptr_lval_nochange_cnt=''
754 d_stdio_ptr_lval_sets_cnt=''
898 d_gdbm_ndbm_h_uses_prototypes=''
899 d_gdbmndbm_h_uses_prototypes=''
901 d_ndbm_h_uses_prototypes=''
975 d_inc_version_list=''
977 inc_version_list_init=''
996 ignore_versioned_solibs=''
1060 d_perl_otherlibdirs=''
1068 api_versionstring=''
1074 version_patchlevel_string=''
1078 d_nv_preserves_uv=''
1079 d_nv_zero_is_allbits_zero=''
1090 nv_overflows_integers_at=''
1091 nv_preserves_uv_bits=''
1163 installsitehtml1dir=''
1166 installsitehtml3dir=''
1173 installsiteman1dir=''
1176 installsiteman3dir=''
1181 installsitescript=''
1196 d_stdio_stream_array=''
1197 stdio_stream_array=''
1214 ccflags_uselargefiles=''
1215 ldflags_uselargefiles=''
1216 libswanted_uselargefiles=''
1237 installvendorarch=''
1244 installvendorhtml1dir=''
1246 vendorhtml1direxp=''
1247 installvendorhtml3dir=''
1249 vendorhtml3direxp=''
1255 installvendorman1dir=''
1258 installvendorman3dir=''
1265 installvendorscript=''
1278 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1281 : We must find out about Eunice early
1283 if test -f /etc/unixtovms; then
1284 eunicefix=/etc/unixtovms
1286 if test -f /etc/unixtovms.exe; then
1287 eunicefix=/etc/unixtovms.exe
1290 : Set executable suffix now -- needed before hints available
1291 if test -f "/libs/version.library"; then
1294 elif test -f "/system/gnu_library/bin/ar.pm"; then
1297 elif test -n "$DJGPP"; then
1300 elif test -d c:/. -o -n "$is_os2" ; then
1307 : Trailing extension. Override this in a hint file, if needed.
1308 : Extra object files, if any, needed on this platform.
1312 : change the next line if compiling for Xenix/286 on Xenix/386
1313 xlibpth='/usr/lib/386 /lib/386'
1314 : Possible local library directories to search.
1315 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1316 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1318 : general looking path for locating libraries
1319 glibpth="/lib /usr/lib $xlibpth"
1320 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1321 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1322 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1323 test -d /usr/lib64 && glibpth="$glibpth /lib64 /usr/lib64 /usr/local/lib64"
1325 : Private path used by Configure to find libraries. Its value
1326 : is prepended to libpth. This variable takes care of special
1327 : machines, like the mips. Usually, it should be empty.
1330 : default library list
1332 : some systems want to use only the non-versioned libso:s
1333 ignore_versioned_solibs=''
1334 : set usethreads on the Configure command line to enable threads.
1335 usereentrant='undef'
1336 : full support for void wanted by default
1339 : Possible local include directories to search.
1340 : Set locincpth to "" in a hint file to defeat local include searches.
1341 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1342 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1344 : no include file wanted by default
1347 : Enable -DEBUGGING and -DDEBUGGING from the command line
1354 : set useposix=false in your hint file to disable the POSIX extension.
1356 : set useopcode=false in your hint file to disable the Opcode extension.
1359 ccflags_uselargefiles=''
1360 ldflags_uselargefiles=''
1361 libswanted_uselargefiles=''
1362 : set usemultiplicity on the Configure command line to enable multiplicity.
1363 : set usesocks on the Configure command line to enable socks.
1364 : List of libraries we want.
1365 : If anyone needs extra -lxxx, put those in a hint file.
1366 libswanted="sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun"
1367 libswanted="$libswanted m crypt sec util c cposix posix ucb bsd BSD"
1368 : We probably want to search /usr/shlib before most other libraries.
1369 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1370 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1371 glibpth="/usr/shlib $glibpth"
1372 : Do not use vfork unless overridden by a hint file.
1375 : Find the basic shell for Bourne shell scripts
1379 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1382 if test -f "$xxx"; then
1385 : Build up a list and do a single loop so we can 'break' out.
1386 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1387 for xxx in sh bash ksh pdksh ash; do
1389 try="$try ${p}/${xxx}"
1393 if test -f "$xxx"; then
1396 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1399 elif test -f "$xxx.exe"; then
1410 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1412 Usually it's in /bin/sh. How did you even get this far?
1413 Please contact me (Perl Maintainers) at perlbug@perl.org and
1414 we'll try to straighten this all out.
1420 : see if sh knows # comments
1421 if `$sh -c '#' >/dev/null 2>&1`; then
1425 test -f $xcat$_exe || xcat=/usr/bin/cat
1426 if test ! -f $xcat$_exe; then
1427 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1428 if test -f $p/cat$_exe; then
1433 if test ! -f $xcat$_exe; then
1434 echo "Can't find cat anywhere!"
1438 echo "#!$xcat" >sharp
1441 ./sharp > today 2>/dev/null
1442 if test -s today; then
1445 echo "#! $xcat" > sharp
1448 ./sharp > today 2>/dev/null
1449 if test -s today; then
1457 echo "Your $sh doesn't grok # comments--I will strip them later on."
1460 echo "exec grep -v '^[ ]*#'" >spitshell
1462 $eunicefix spitshell
1463 spitshell=`pwd`/spitshell
1465 echo "I presume that if # doesn't work, #! won't work either!"
1470 : figure out how to guarantee sh startup
1472 '') startsh=${sharpbang}${sh} ;;
1484 : echo "Yup, it does."
1486 echo "Hmm... '$startsh' does not guarantee sh startup..."
1487 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1491 : Save command line options in file UU/cmdline.opt for later use in
1492 : generating config.sh.
1493 cat > cmdline.opt <<EOSH
1494 : Configure command line arguments.
1503 cat >>cmdline.opt <<EOSH
1504 config_arg$argn='$arg'
1506 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1509 arg_exp=`cat cmdl.opt`
1510 args_exp="$args_exp$args_sep'$arg_exp'"
1511 argn=`expr $argn + 1`
1516 : produce awk script to parse command line options
1517 cat >options.awk <<'EOF'
1519 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1521 len = length(optstr);
1522 for (i = 1; i <= len; i++) {
1523 c = substr(optstr, i, 1);
1524 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1535 if (substr(str, 1, 1) != "-") {
1536 printf("'%s'\n", str);
1540 for (i = 2; i <= len; i++) {
1541 c = substr(str, i, 1);
1543 printf("-%s\n", substr(str, i));
1549 printf("'%s'\n", substr(str, i + 1));
1562 : process the command line options
1563 set X `for arg in "$@"; do echo "X$arg"; done |
1564 sed -e s/X// | awk -f options.awk`
1569 : set up default values
1579 rm -f optdef.sh posthint.sh
1580 cat >optdef.sh <<EOS
1586 while test $# -gt 0; do
1588 -d) shift; fastread=yes;;
1589 -e) shift; alldone=cont;;
1593 if test -r "$1"; then
1596 echo "$me: cannot read config file $1." >&2
1602 -h) shift; error=true;;
1603 -r) shift; reuseval=true;;
1604 -s) shift; silent=true; realsilent=true;;
1605 -E) shift; alldone=exit;;
1606 -K) shift; knowitall=true;;
1607 -O) shift; override=true;;
1608 -S) shift; silent=true; extractsh=true;;
1613 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1614 echo "$me: ignoring -D $1" >&2
1617 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1618 *) echo "$1='define'" >> optdef.sh;;
1625 *=) echo "$1" >> optdef.sh;;
1627 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1628 echo "$me: ignoring -U $1" >&2
1630 *) echo "$1='undef'" >> optdef.sh;;
1641 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1645 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1646 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1652 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1653 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1654 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1655 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1656 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1657 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1663 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1665 echo "$yyy=''" >> posthint.sh ;;
1670 echo "$yyy='$zzz'" >> posthint.sh ;;
1672 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1674 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1679 echo "$yyy=$zzz" >> posthint.sh ;;
1680 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1684 -V) echo "$me generated by metaconfig 3.5 PL0." >&2
1687 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1695 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1696 [-U symbol] [-U symbol=] [-A command:symbol...]
1697 -d : use defaults for all answers.
1698 -e : go on without questioning past the production of config.sh.
1699 -f : specify an alternate default configuration file.
1700 -h : print this help message and exit (with an error status).
1701 -r : reuse C symbols value if possible (skips costly nm extraction).
1702 -s : silent mode, only echoes questions and essential information.
1703 -D : define symbol to have some value:
1704 -D symbol symbol gets the value 'define'
1705 -D symbol=value symbol gets the value 'value'
1706 common used examples (see INSTALL for more info):
1707 -Duse64bitint use 64bit integers
1708 -Duse64bitall use 64bit integers and pointers
1709 -Dusethreads use thread support
1710 -Dinc_version_list=none do not include older perl trees in @INC
1711 -DEBUGGING=none DEBUGGING options
1712 -Dcc=gcc choose your compiler
1713 -Dprefix=/opt/perl5 choose your destination
1714 -E : stop at the end of questions, after having produced config.sh.
1715 -K : do not use unless you know what you are doing.
1716 -O : let -D and -U override definitions from loaded configuration file.
1717 -S : perform variable substitutions on all .SH files (can mix with -f)
1718 -U : undefine symbol:
1719 -U symbol symbol gets the value 'undef'
1720 -U symbol= symbol gets completely empty
1722 -A : manipulate symbol after the platform specific hints have been applied:
1723 -A append:symbol=value append value to symbol
1724 -A symbol=value like append:, but with a separating space
1725 -A define:symbol=value define symbol to have value
1726 -A clear:symbol define symbol to be ''
1727 -A define:symbol define symbol to be 'define'
1728 -A eval:symbol=value define symbol to be eval of value
1729 -A prepend:symbol=value prepend value to symbol
1730 -A undef:symbol define symbol to be 'undef'
1731 -A undef:symbol= define symbol to be ''
1732 e.g.: -A prepend:libswanted='cl pthread '
1733 -A ccflags=-DSOME_MACRO
1734 -V : print version number and exit (with a zero status).
1741 case "$fastread$alldone" in
1744 case "$extractsh" in
1747 if test ! -t 0; then
1748 echo "Say 'sh Configure', not 'sh <Configure'"
1758 true) exec 1>/dev/null;;
1761 : run the defines and the undefines, if any, but leave the file out there...
1764 : create the posthint manipulation script and leave the file out there...
1769 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1770 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1771 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1772 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1773 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1776 : Some greps do not return status, grrr.
1777 echo "grimblepritz" >grimble
1778 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1780 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1786 : the following should work in any shell
1790 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1791 cat >contains <<'EOSS'
1792 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1797 : Find the path to the source tree
1800 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1804 *) src=`cd ../$src && pwd` ;;
1817 if test -f $rsrc/Configure && \
1818 $contains "^package='$package'\$" $rsrc/Configure >/dev/null 2>&1
1820 : found it, so we are ok.
1823 for src in . .. ../.. ../../.. ../../../..; do
1824 if test -f ../$src/Configure && \
1825 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1836 Sorry, I can't seem to locate the source dir for $package. Please start
1837 Configure with an explicit path -- i.e. /some/path/Configure.
1845 echo "Sources for $package found in \"$src\"." >&4
1849 : script used to extract .SH files with variable substitutions
1850 cat >extract <<'EOS'
1852 echo "Doing variable substitutions on .SH files..."
1853 if test -f MANIFEST; then
1854 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1856 echo "(Looking for .SH files under the source directory.)"
1857 set x `(cd "$src"; find . -name "*.SH" -print)`
1861 0) set x `(cd "$src"; echo *.SH)`; shift;;
1863 if test ! -f "$src/$1"; then
1869 while test $name; do
1870 if test ! -d "$name"; then
1871 create="$name $create";
1872 name=`echo $name | sed -e "s|^[^/]*$||"`;
1873 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1878 for file in $create; do
1887 dir=`expr X$file : 'X\(.*\)/'`
1888 file=`expr X$file : 'X.*/\(.*\)'`
1889 (cd "$dir" && . ./$file)
1899 dir=`expr X$file : 'X\(.*\)/'`
1900 file=`expr X$file : 'X.*/\(.*\)'`
1901 (set x $dir; shift; eval $mkdir_p)
1902 sh <"$src/$dir/$file"
1911 if test -f "$src/config_h.SH"; then
1912 if test ! -f config.h; then
1913 : oops, they left it out of MANIFEST, probably, so do it anyway.
1914 . "$src/config_h.SH"
1919 : extract files and exit if asked to do so
1920 case "$extractsh" in
1922 case "$realsilent" in
1926 case "$config_sh" in
1927 '') config_sh='config.sh';;
1930 echo "Fetching answers from $config_sh..."
1933 test "$override" && . ./optdef.sh
1937 echo "Extraction done."
1942 : Eunice requires " " instead of "", can you believe it
1945 echo "Beginning of configuration questions for $package."
1947 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1949 : first determine how to suppress newline on echo command
1951 echo "Checking echo to see how to suppress newlines..."
1952 (echo "hi there\c" ; echo " ") >.echotmp
1953 if $contains c .echotmp >/dev/null 2>&1 ; then
1964 echo $n "The star should be here-->$c"
1968 : Now test for existence of everything in MANIFEST
1970 if test -f "$rsrc/MANIFEST"; then
1971 echo "First let's make sure your kit is complete. Checking..." >&4
1972 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | \
1973 (split -l 50 2>/dev/null || split -50)
1976 for filelist in x??; do
1977 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` \
1978 >/dev/null 2>>"$tmppwd/missing")
1980 if test -s missing; then
1984 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1986 You have the option of continuing the configuration process, despite the
1987 distinct possibility that your kit is damaged, by typing 'y'es. If you
1988 do, don't blame me if something goes wrong. I advise you to type 'n'o
1989 and contact the author (perlbug@perl.org).
1992 echo $n "Continue? [n] $c" >&4
1996 echo "Continuing..." >&4
2000 echo "ABORTING..." >&4
2005 echo "Looks good..."
2008 echo "There is no MANIFEST file. I hope your kit is complete !"
2012 : Find the appropriate value for a newline for tr
2014 if test -n "$DJGPP"; then
2017 if test X"$trnl" = X; then
2018 case "`echo foo|tr '\n' x 2>/dev/null`" in
2022 if test X"$trnl" = X; then
2023 case "`echo foo|tr '\012' x 2>/dev/null`" in
2024 foox) trnl='\012' ;;
2027 if test X"$trnl" = X; then
2028 case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
2029 fooxy) trnl='\n\r' ;;
2032 if test X"$trnl" = X; then
2035 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
2041 : compute the number of columns on the terminal for proper question formatting
2046 : set up the echo used in my read
2047 myecho="case \"\$xxxm\" in
2048 '') echo $n \"\$rp $c\" >&4;;
2050 '') echo $n \"[\$xxxm] $c\";;
2052 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
2054 echo $n \"[\$xxxm] $c\" >&4
2056 echo $n \"\$rp [\$xxxm] $c\" >&4
2062 : now set up to do reads with possible shell escape and default assignment
2068 case "\$fastread" in
2069 yes) case "\$dflt" in
2072 case "\$silent-\$rp" in
2077 *) case "\$silent" in
2078 true) case "\$rp" in
2083 while expr "X\$ans" : "X!" >/dev/null; do
2087 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2095 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2104 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2109 echo "(OK, I'll run with -d after this question.)" >&4
2112 echo "*** Sorry, \$1 not supported yet." >&4
2122 echo "*** Substitution done -- please confirm."
2124 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2129 echo "*** Error -- try again."
2136 case "\$ans\$xxxm\$nostick" in
2148 : create .config dir to save info across Configure sessions
2149 test -d ../.config || mkdir ../.config
2150 cat >../.config/README <<EOF
2151 This directory created by Configure to save information that should
2152 persist across sessions for $package.
2154 You may safely delete it if you wish.
2157 : See if we are using a devel version and want that
2158 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2161 usedevel="$define" ;;
2162 *) case "$xversion" in
2165 *** WHOA THERE!!! ***
2167 This is an UNSTABLE DEVELOPMENT release.
2168 The version of this $package distribution is $xversion, that is, odd,
2169 (as opposed to even) and that signifies a development release.
2170 If you want a maintenance release, you want an even-numbered version.
2172 Do ***NOT*** install this into production use.
2173 Data corruption and crashes are possible.
2175 It is most seriously suggested that you do not continue any further
2176 unless you want to help in developing and debugging Perl.
2178 If you *still* want to build perl, you can answer 'y' now,
2179 or pass -Dusedevel to Configure.
2182 rp='Do you really want to continue?'
2186 [yY]) echo >&4 "Okay, continuing."
2187 usedevel="$define" ;;
2188 *) echo >&4 "Okay, bye."
2199 case "$versiononly" in
2200 '') versiononly="$define" ;;
2202 case "$installusrbinperl" in
2203 '') installusrbinperl="$undef" ;;
2208 : general instructions
2211 user=`(logname) 2>/dev/null`
2213 '') user=`whoami 2>&1`;;
2215 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2218 rp='Would you like to see the instructions?'
2229 This installation shell script will examine your system and ask you questions
2230 to determine how the perl5 package should be installed. If you get
2231 stuck on a question, you may use a ! shell escape to start a subshell or
2232 execute a command. Many of the questions will have default answers in square
2233 brackets; typing carriage return will give you the default.
2235 On some of the questions which ask for file or directory names you are allowed
2236 to use the ~name construct to specify the login directory belonging to "name",
2237 even if you don't have a shell which knows about that. Questions where this is
2238 allowed will be marked "(~name ok)".
2242 dflt='Type carriage return to continue'
2246 The prompter used in this script allows you to use shell variables and
2247 backticks in your answers. You may use $1, $2, etc... to refer to the words
2248 in the default answer, as if the default line was a set of arguments given to a
2249 script shell. This means you may also use $* to repeat the whole default line,
2250 so you do not have to re-type everything to add something to the default.
2252 Everytime there is a substitution, you will have to confirm. If there is an
2253 error (e.g. an unmatched backtick), the default answer will remain unchanged
2254 and you will be prompted again.
2256 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2257 the questions and use the computed defaults (or the previous answers if there
2258 was already a config.sh file). Type 'Configure -h' for a list of options.
2259 You may also start interactively and then answer '& -d' at any prompt to turn
2260 on the non-interactive behaviour for the remainder of the execution.
2266 Much effort has been expended to ensure that this shell script will run on any
2267 Unix system. If despite that it blows up on yours, your best bet is to edit
2268 Configure and run it again. If you can't run Configure for some reason,
2269 you'll have to generate a config.sh file by hand. Whatever problems you
2270 have, let me (perlbug@perl.org) know how I blew it.
2272 This installation script affects things in two ways:
2274 1) it may do direct variable substitutions on some of the files included
2276 2) it builds a config.h file for inclusion in C programs. You may edit
2277 any of these files as the need arises after running this script.
2279 If you make a mistake on a question, there is no easy way to back up to it
2280 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2281 files. Configure will offer to let you do this before it runs the SH files.
2284 dflt='Type carriage return to continue'
2286 case "$firsttime" in
2287 true) echo $user >>../.config/instruct;;
2291 : find out where common programs are
2293 echo "Locating common programs..." >&4
2306 if test -d \$dir/\$thing; then
2312 for thisthing in \$dir/\$thing; do
2313 : just loop through to pick last item
2315 if test -f \$thisthing; then
2318 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2321 elif test -f \$dir/\$thing.exe; then
2322 if test -n "$DJGPP"; then
2323 echo \$dir/\$thing.exe
2324 elif test "$eunicefix" != ":"; then
2325 : on Eunice apparently
2377 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2378 pth="$pth /lib /usr/lib"
2379 for file in $loclist; do
2383 if test -f "$xxx"; then
2386 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2387 xxx=`./loc $file $file $pth`
2390 '') xxx=`./loc $file $file $pth`;;
2391 *) xxx=`./loc $xxx $xxx $pth`;;
2393 eval $file=$xxx$_exe
2397 echo $file is in $xxx.
2400 echo $file is in $xxx.
2403 echo "I don't know where '$file' is, and my life depends on it." >&4
2404 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2410 echo "Don't worry if any of the following aren't found..."
2412 for file in $trylist; do
2416 if test -f "$xxx"; then
2419 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2420 xxx=`./loc $file $file $pth`
2423 '') xxx=`./loc $file $file $pth`;;
2424 *) xxx=`./loc $xxx $xxx $pth`;;
2426 eval $file=$xxx$_exe
2430 echo $file is in $xxx.
2433 echo $file is in $xxx.
2436 echo "I don't see $file out there, $say."
2443 echo "Substituting grep for egrep."
2450 echo "Substituting cp for ln."
2459 echo "I can't find make or gmake, and my life depends on it." >&4
2460 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2468 *) # We can't have osname yet.
2469 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2470 # Assume that gmake, if found, is definitely GNU make
2471 # and prefer it over the system make.
2472 echo "Substituting gmake for make."
2480 echo "Hopefully test is built into your sh."
2483 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2484 echo "Using the test built into your sh."
2492 echo "Hopefully echo is built into your sh."
2497 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2498 $echo $n "hi there$c" >foo1
2499 echo $n "hi there$c" >foo2
2500 if cmp foo1 foo2 >/dev/null 2>&1; then
2501 echo "They are compatible. In fact, they may be identical."
2508 They are not compatible! You are probably running ksh on a non-USG system.
2509 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2510 have echo built in and we may have to run some Bourne shell scripts. That
2511 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2514 $echo $n "The star should be here-->$c"
2521 # This question was auctioned at YAPC::Europe-2007 in Vienna
2522 # I never promised you could answer it. I only auctioned the question.
2524 The following message is sponsored by
2526 Dresden.pm<--The stars should be here.
2528 Dear Perl user, system administrator or package
2529 maintainer, the Perl community sends greetings to
2530 you. Do you (emblematical) greet back [Y/n]? n
2534 : Check what type of C compiler we use
2538 cat <<'EOSC' >>trygcc
2543 int main(int argc, char *argv[]) {
2547 if $cc -o try $ccflags $ldflags try.c; then
2550 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2556 # Skip this test because it gives a false match on output like:
2557 # ./trygcc: line 23: cc: command not found
2558 # case "`$cc -v -c try.c 2>&1`" in
2559 # *gcc*) trygcc=no ;;
2561 if $test X"$trygcc" = Xyes; then
2562 if gcc -o try -c try.c; then
2564 echo "You seem to have a working gcc, though." >&4
2565 # Switching compilers may undo the work of hints files.
2566 # The most common problem is -D_REENTRANT for threads.
2567 # This heuristic catches that case, but gets false positives
2568 # if -Dusethreads was not actually specified. Better to
2569 # bail out here with a useful message than fail
2570 # mysteriously later. Should we perhaps just try to
2571 # re-invoke Configure -Dcc=gcc config_args ?
2572 if $test -f usethreads.cbu; then
2575 *** However, any setting of the C compiler flags (e.g. for thread support)
2576 *** will be lost. It may be necessary for you to restart Configure and
2577 *** add -Dcc=gcc to your Configure command line.
2580 rp="Would you like to go ahead and try gcc anyway?"
2583 rp="Would you like to use it?"
2586 if $test -f myread; then
2589 if $test -f UU/myread; then
2592 echo "Cannot find myread, sorry. Aborting." >&2
2597 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2610 cat <<'EOSC' >>checkcc
2615 int main(int argc, char *argv[]) {
2619 if $cc -o try $ccflags $ldflags try.c; then
2622 if $test X"$despair" = Xyes; then
2623 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2626 You need to find a working C compiler.
2627 Either (purchase and) install the C compiler supplied by your OS vendor,
2628 or for a free C compiler try http://gcc.gnu.org/
2629 I cannot continue any further, aborting.
2638 : determine whether symbolic links are supported
2641 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2642 echo "Symbolic links are supported." >&4
2645 echo "Symbolic links are NOT supported." >&4
2650 : determine whether symbolic links are supported
2654 echo "Checking how to test for symbolic links..." >&4
2656 if $test "X$issymlink" = X; then
2658 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2659 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2661 if test $? = 0; then
2664 echo "Your builtin 'test -h' may be broken." >&4
2667 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2670 if test -f "$p/$test"; then
2679 echo "Trying external '$test -h'." >&4
2680 issymlink="$test -h"
2681 if $test ! -h sym >/dev/null 2>&1; then
2682 echo "External '$test -h' is broken, too." >&4
2690 if $test "X$issymlink" = X; then
2691 if $test -L sym 2>/dev/null; then
2692 issymlink="$test -L"
2693 echo "The builtin '$test -L' worked." >&4
2696 if $test "X$issymlink" != X; then
2697 echo "You can test for symbolic links with '$issymlink'." >&4
2699 echo "I do not know how you can test for symbolic links." >&4
2703 *) echo "No symbolic links, so not testing for their testing..." >&4
2708 : Make symlinks util
2709 case "$mksymlinks" in
2712 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2715 *) case "$lns:$issymlink" in
2716 *"ln"*" -s:"*"test -"?)
2717 echo "Creating the symbolic links..." >&4
2718 echo "(First creating the subdirectories...)" >&4
2720 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2722 test -z "$directory" && break
2726 if test ! -d t/base; then
2727 echo "Failed to create the subdirectories. Aborting." >&4
2730 echo "(Then creating the symlinks...)" >&4
2731 awk '{print $1}' $src/MANIFEST | while true; do
2733 test -z "$filename" && break
2734 if test -f $filename; then
2735 if $issymlink $filename; then
2739 if test -f $filename; then
2740 echo "$filename already exists, not symlinking."
2742 ln -s $src/$filename $filename
2746 if test ! -f t/base/lex.t; then
2747 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2752 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2760 : Check for Cross-Compilation
2761 case "$usecrosscompile" in
2763 $echo "Cross-compiling..."
2766 *-*-gcc) # A cross-compiling gcc, probably.
2767 targetarch=`$echo $cc|$sed 's/-gcc$//'`
2769 # leave out ld, choosing it is more complex
2771 ranlib=$targetarch-ranlib
2772 $echo 'extern int foo;' > try.c
2773 set X `$cc -v -E try.c 2>&1 | $awk '/^#include </,/^End of search /'|$grep '/include'`
2775 if $test $# -gt 0; then
2777 incpth="`$echo $incpth|$sed 's/^ //'`"
2778 echo "Guessing incpth '$incpth'." >&4
2780 j="`$echo $i|$sed 's,/include$,/lib,'`"
2781 if $test -d $j; then
2785 libpth="`$echo $libpth|$sed 's/^ //'`"
2786 echo "Guessing libpth '$libpth'." >&4
2791 case "$targetarch" in
2792 '') echo "Targetarch not defined." >&4; croak=y ;;
2793 *) echo "Using targetarch $targetarch." >&4 ;;
2796 '') echo "Incpth not defined." >&4; croak=y ;;
2797 *) echo "Using incpth '$incpth'." >&4 ;;
2800 '') echo "Libpth not defined." >&4; croak=y ;;
2801 *) echo "Using libpth '$libpth'." >&4 ;;
2804 '') for i in $incpth; do
2805 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
2807 echo "Guessing usrinc $usrinc." >&4
2812 '') echo "Usrinc not defined." >&4; croak=y ;;
2815 *) echo "Using usrinc $usrinc." >&4 ;;
2817 case "$targethost" in
2818 '') echo "Targethost not defined." >&4; croak=y ;;
2819 *) echo "Using targethost $targethost." >&4
2824 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2827 /*) run=$src/Cross/run
2828 targetmkdir=$src/Cross/mkdir
2830 from=$src/Cross/from
2832 *) pwd=`$test -f ../Configure & cd ..; pwd`
2834 targetmkdir=$pwd/Cross/mkdir
2836 from=$pwd/Cross/from
2839 case "$targetrun" in
2840 '') targetrun=ssh ;;
2845 case "$targetfrom" in
2846 '') targetfrom=scp ;;
2850 from=$from-$targetfrom
2851 case "$targetdir" in
2853 echo "Guessing targetdir $targetdir." >&4
2856 case "$targetuser" in
2858 echo "Guessing targetuser $targetuser." >&4
2861 case "$targetfrom" in
2865 case "$targetrun" in
2877 '') cwd=$targetdir ;;
2881 if $test ! -f \$exe.xok; then
2885 $targetrun -l $targetuser $targethost "cd \$cwd && ./\$exe \$@"
2888 *) echo "Unknown targetrun '$targetrun'" >&4
2892 case "$targetmkdir" in
2894 cat >$targetmkdir <<EOF
2896 $targetrun -l $targetuser $targethost "mkdir -p \$@"
2898 $chmod a+rx $targetmkdir
2900 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
2912 $targetmkdir \`dirname \$f\`
2913 $targetto $q \$f $targetuser@$targethost:\$f || exit 1
2916 $targetmkdir $targetdir/\`dirname \$f\`
2917 $targetto $q \$f $targetuser@$targethost:$targetdir/\$f || exit 1
2930 $mkdir -p $targetdir/\`dirname \$f\`
2931 $cp \$f $targetdir/\$f || exit 1
2934 $targetmkdir $targetdir/\`dirname \$f\`
2935 $cp \$f $targetdir/\$f || exit 1
2942 *) echo "Unknown targetto '$targetto'" >&4
2946 case "$targetfrom" in
2953 $targetfrom $q $targetuser@$targethost:$targetdir/\$f . || exit 1
2958 cp) cat >$from <<EOF
2963 cp $targetdir/\$f . || exit 1
2968 *) echo "Unknown targetfrom '$targetfrom'" >&4
2972 if $test ! -f $run; then
2973 echo "Target 'run' script '$run' not found." >&4
2977 if $test ! -f $to; then
2978 echo "Target 'to' script '$to' not found." >&4
2982 if $test ! -f $from; then
2983 echo "Target 'from' script '$from' not found." >&4
2987 if $test ! -f $run -o ! -f $to -o ! -f $from; then
2991 Using '$run' for remote execution,
2992 and '$from' and '$to'
2993 for remote file transfer.
2999 usecrosscompile='undef'
3004 : see whether [:lower:] and [:upper:] are supported character classes
3006 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
3008 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
3012 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
3013 # (0xd9 and 0xe2), therefore that is a nice testing point.
3014 if test "X$up" = X -o "X$low" = X; then
3015 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
3021 if test "X$up" = X -o "X$low" = X; then
3022 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
3028 if test "X$up" = X -o "X$low" = X; then
3029 case "`echo RS | od -x 2>/dev/null`" in
3031 echo "Hey, this might be EBCDIC." >&4
3032 if test "X$up" = X -o "X$low" = X; then
3033 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
3034 rs) up='[A-IJ-RS-Z]'
3039 if test "X$up" = X -o "X$low" = X; then
3040 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
3050 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
3052 echo "Using $up and $low to convert case." >&4
3055 echo "I don't know how to translate letters from upper to lower case." >&4
3056 echo "Your tr is not acting any way I know of." >&4
3060 : set up the translation script tr, must be called with ./tr of course
3064 '[A-Z][a-z]') exec $tr '$up' '$low';;
3065 '[a-z][A-Z]') exec $tr '$low' '$up';;
3072 : Try to determine whether config.sh was made on this system
3073 case "$config_sh" in
3075 myuname=`$uname -a 2>/dev/null`
3076 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
3077 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
3078 # because the A-Z/a-z are not consecutive.
3079 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e "s,['/],,g" | \
3080 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
3081 newmyuname="$myuname"
3083 case "$knowitall" in
3085 if test -f ../config.sh; then
3086 if $contains myuname= ../config.sh >/dev/null 2>&1; then
3087 eval "`grep myuname= ../config.sh`"
3089 if test "X$myuname" = "X$newmyuname"; then
3097 : Get old answers from old config file if Configure was run on the
3098 : same system, otherwise use the hints.
3101 if test -f config.sh; then
3103 rp="I see a config.sh file. Shall I use it to set the defaults?"
3106 n*|N*) echo "OK, I'll ignore it."
3107 mv config.sh config.sh.old
3108 myuname="$newmyuname"
3110 *) echo "Fetching default answers from your old config.sh file..." >&4
3118 : Older versions did not always set $sh. Catch re-use of such
3128 if test ! -f config.sh; then
3131 First time through, eh? I have some defaults handy for some systems
3132 that need some extra help getting the Configure answers right:
3135 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3137 : Half the following guesses are probably wrong... If you have better
3138 : tests or hints, please send them to perlbug@perl.org
3139 : The metaconfig authors would also appreciate a copy...
3140 $test -f /irix && osname=irix
3141 $test -f /xenix && osname=sco_xenix
3142 $test -f /dynix && osname=dynix
3143 $test -f /dnix && osname=dnix
3144 $test -f /lynx.os && osname=lynxos
3145 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3146 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3147 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3148 $test -f /bin/mips && /bin/mips && osname=mips
3149 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
3150 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
3151 $test -d /usr/apollo/bin && osname=apollo
3152 $test -f /etc/saf/_sactab && osname=svr4
3153 $test -d /usr/include/minix && osname=minix
3154 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3155 if $test -d /MachTen -o -d /MachTen_Folder; then
3157 if $test -x /sbin/version; then
3158 osvers=`/sbin/version | $awk '{print $2}' |
3159 $sed -e 's/[A-Za-z]$//'`
3160 elif $test -x /usr/etc/version; then
3161 osvers=`/usr/etc/version | $awk '{print $2}' |
3162 $sed -e 's/[A-Za-z]$//'`
3168 $test -f /sys/posix.dll &&
3169 $test -f /usr/bin/what &&
3170 set X `/usr/bin/what /sys/posix.dll` &&
3171 $test "$3" = UWIN &&
3175 if $test -f $uname; then
3183 umips) osname=umips ;;
3186 [23]100) osname=mips ;;
3187 next*) osname=next ;;
3189 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3190 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3193 elif $test -f /etc/kconfig; then
3195 if test "$lns" = "$ln -s"; then
3197 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3199 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3206 if test -n "$DJGPP"; then
3215 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3217 # oslevel can fail with:
3218 # oslevel: Unable to acquire lock.
3219 *not\ found) osvers="$4"."$3" ;;
3220 '<3240'|'<>3240') osvers=3.2.0 ;;
3221 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3222 '=3250'|'>3250') osvers=3.2.5 ;;
3226 bsd386) osname=bsd386
3229 cygwin*) osname=cygwin
3232 *dc.osx) osname=dcosx
3238 domainos) osname=apollo
3244 dragonfly) osname=dragonfly
3247 dynixptx*) osname=dynixptx
3248 osvers=`echo "$4"|sed 's/^v//'`
3250 freebsd) osname=freebsd
3252 genix) osname=genix ;;
3256 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3272 netbsd*) osname=netbsd
3275 news-os) osvers="$3"
3277 4*) osname=newsos4 ;;
3281 next*) osname=next ;;
3282 nonstop-ux) osname=nonstopux ;;
3283 openbsd) osname=openbsd
3289 POSIX-BC | posix-bc ) osname=posix-bc
3292 powerux | power_ux | powermax_os | powermaxos | \
3293 powerunix | power_unix) osname=powerux
3299 solaris) osname=solaris
3301 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3308 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3312 titanos) osname=titanos
3321 ultrix) osname=ultrix
3324 osf1|mls+) case "$5" in
3327 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3330 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3333 hp*) osname=hp_osf1 ;;
3334 mips) osname=mips_osf1 ;;
3337 # UnixWare 7.1.2 is known as Open UNIX 8
3338 openunix|unixware) osname=svr5
3346 $2) case "$osname" in
3350 : svr4.x or possibly later
3360 if test -f /stand/boot ; then
3361 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3362 if test -n "$INITPROG" -a -f "$INITPROG"; then
3363 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3364 if test -n "$isesix"; then
3372 *) if test -f /etc/systemid; then
3374 set `echo $3 | $sed 's/\./ /g'` $4
3375 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3377 elif $test -f $src/hints/sco_$1_$2.sh; then
3379 elif $test -f $src/hints/sco_$1.sh; then
3384 '') : Still unknown. Probably a generic Sys V.
3393 *) case "$osname" in
3394 '') : Still unknown. Probably a generic BSD.
3402 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3403 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3404 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3407 $rm -f UU/kernel.what
3408 elif test -d c:/. -o -n "$is_os2" ; then
3415 case "$targetarch" in
3418 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3423 : Now look for a hint file osname_osvers, unless one has been
3424 : specified already.
3427 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3428 : Also try without trailing minor version numbers.
3429 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3430 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3431 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3432 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3435 *) case "$osvers" in
3438 *) if $test -f $src/hints/$file.sh ; then
3440 elif $test -f $src/hints/$xfile.sh ; then
3442 elif $test -f $src/hints/$xxfile.sh ; then
3444 elif $test -f $src/hints/$xxxfile.sh ; then
3446 elif $test -f $src/hints/$xxxxfile.sh ; then
3448 elif $test -f "$src/hints/${osname}.sh" ; then
3457 if $test -f Policy.sh ; then
3460 none) dflt="Policy" ;;
3461 *) dflt="Policy $dflt" ;;
3466 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3470 if $test -f Policy.sh ; then
3473 There's also a Policy hint file available, which should make the
3474 site-specific (policy) questions easier to answer.
3481 You may give one or more space-separated answers, or "none" if appropriate.
3482 If you have a handcrafted Policy.sh file or a Policy.sh file generated by a
3483 previous run of Configure, you may specify it as well as or instead of
3484 OS-specific hints. If hints are provided for your OS, you should use them:
3485 although Perl can probably be built without hints on many platforms, using
3486 hints often improve performance and may enable features that Configure can't
3487 set up on its own. If there are no hints that match your OS, specify "none";
3488 DO NOT give a wrong version or a wrong OS.
3492 rp="Which of these apply, if any?"
3495 for file in $tans; do
3496 if $test X$file = XPolicy -a -f Policy.sh; then
3498 $cat Policy.sh >> UU/config.sh
3499 elif $test -f $src/hints/$file.sh; then
3500 . $src/hints/$file.sh
3501 $cat $src/hints/$file.sh >> UU/config.sh
3502 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3505 : Give one chance to correct a possible typo.
3506 echo "$file.sh does not exist"
3508 rp="hint to use instead?"
3510 for file in $ans; do
3511 if $test -f "$src/hints/$file.sh"; then
3512 . $src/hints/$file.sh
3513 $cat $src/hints/$file.sh >> UU/config.sh
3514 elif $test X$ans = X -o X$ans = Xnone ; then
3517 echo "$file.sh does not exist -- ignored."
3524 : Remember our hint file for later.
3525 if $test -f "$src/hints/$file.sh" ; then
3535 echo "Fetching default answers from $config_sh..." >&4
3539 cp $config_sh config.sh 2>/dev/null
3549 test "$override" && . ./optdef.sh
3551 : Restore computed paths
3552 for file in $loclist $trylist; do
3553 eval $file="\$_$file"
3558 Configure uses the operating system name and version to set some defaults.
3559 The default value is probably right if the name rings a bell. Otherwise,
3560 since spelling matters for me, either accept the default or answer "none"
3567 ''|' '|none) dflt=none ;;
3568 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3571 *) dflt="$osname" ;;
3573 rp="Operating system name?"
3577 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3583 ''|' '|none) dflt=none ;;
3584 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3585 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3587 ''|' ') dflt=none ;;
3592 *) dflt="$osvers" ;;
3594 rp="Operating system version?"
3604 : who configured the system
3605 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3608 cf_by=`(logname) 2>/dev/null`
3611 cf_by=`(whoami) 2>/dev/null`
3613 "") cf_by=unknown ;;
3618 : decide how portable to be. Allow command line overrides.
3619 case "$d_portable" in
3621 *) d_portable="$define" ;;
3624 : set up shell script to do ~ expansion
3630 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3633 if $test -f /bin/csh; then
3634 /bin/csh -f -c "glob \$1"
3639 name=\`$expr x\$1 : '..\([^/]*\)'\`
3640 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3641 if $test ! -d "\$dir"; then
3643 echo "\$me: can't locate home directory for: \$name" >&2
3648 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3664 : now set up to get a file name
3668 cat <<'EOSC' >>getfile
3684 : getfile will accept an answer from the comma-separated list
3685 : enclosed in parentheses even if it does not meet other criteria.
3686 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3687 fn=`echo $fn | sed 's/(.*)//'`
3693 loc_file=`expr $fn : '.*:\(.*\)'`
3694 fn=`expr $fn : '\(.*\):.*'`
3702 */*) fullpath=true;;
3711 *e*) exp_file=true;;
3714 *p*) nopath_ok=true;;
3719 *d*) type='Directory';;
3720 *l*) type='Locate';;
3725 Locate) what='File';;
3730 case "$d_portable" in
3738 while test "$type"; do
3743 true) rp="$rp (~name ok)";;
3746 if test -f UU/getfile.ok && \
3747 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3766 value=`UU/filexp $ans`
3769 if test "$ans" != "$value"; then
3770 echo "(That expands to $value on this system.)"
3784 /*) value="$ansexp" ;;
3785 [a-zA-Z]:/*) value="$ansexp" ;;
3790 echo "I shall only accept a full path name, as in /bin/ls." >&4
3791 echo "Use a ! shell escape if you wish to check pathnames." >&4
3794 echo "Please give a full path name, starting with slash." >&4
3797 echo "Note that using ~name is ok provided it expands well." >&4
3810 for fp in $gfpth; do
3811 if test "X$fp" = X.; then
3816 if test -f "$pf"; then
3818 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3820 echo "($value is not a plain file, but that's ok.)"
3823 if test X"$type" = X; then
3830 for fp in $gfpth; do
3831 if test "X$fp" = X.; then
3836 direxp="$fp/$ansexp"
3838 if test -d "$direxp"; then
3846 if test -d "$ansexp"; then
3847 echo "(Looking for $loc_file in directory $value.)"
3848 value="$value/$loc_file"
3849 ansexp="$ansexp/$loc_file"
3851 if test -f "$ansexp"; then
3854 case "$nopath_ok" in
3855 true) case "$value" in
3857 *) echo "Assuming $value will be in people's path."
3873 if test "$fastread" = yes; then
3878 rp="$what $value doesn't exist. Use that name anyway?"
3897 test "X$gfpthkeep" != Xy && gfpth=""
3900 : determine root of directory hierarchy where package will be installed.
3903 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
3906 dflt=`echo "$prefix" | sed 's/.$//'`
3914 By default, $package will be installed in $dflt/bin, manual pages
3915 under $dflt/man, etc..., i.e. with $dflt as prefix for all
3916 installation directories. Typically this is something like /usr/local.
3917 If you wish to have binaries under /usr/bin but other parts of the
3918 installation under /usr/local, that's ok: you will be prompted
3919 separately for each of the installation directories, the prefix being
3920 only used to set the defaults.
3924 rp='Installation prefix to use?'
3932 *) oldprefix="$prefix";;
3939 : allow them to override the AFS root
3942 *) afsroot=$afsroot ;;
3948 $define|true) afs=true ;;
3949 $undef|false) afs=false ;;
3950 *) if $test -d $afsroot; then
3958 echo "AFS may be running... I'll be extra cautious then..." >&4
3960 echo "AFS does not seem to be running..." >&4
3963 : determine installation prefix for where package is to be installed.
3967 Since you are running AFS, I need to distinguish the directory in which
3968 files will reside from the directory in which they are installed (and from
3969 which they are presumably copied to the former directory by occult means).
3972 case "$installprefix" in
3973 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
3974 *) dflt="$installprefix";;
3979 In some special cases, particularly when building $package for distribution,
3980 it is convenient to distinguish the directory in which files should be
3981 installed from the directory ($prefix) in which they will
3982 eventually reside. For most users, these two directories are the same.
3985 case "$installprefix" in
3987 *) dflt=$installprefix;;
3991 rp='What installation prefix should I use for installing files?'
3993 installprefix="$ans"
3994 installprefixexp="$ansexp"
3996 : Perform the prefixexp/installprefixexp correction if necessary
3997 cat <<EOS >installprefix
4000 cat <<'EOSC' >>installprefix
4001 : Change installation prefix, if necessary.
4002 if $test X"$prefix" != X"$installprefix"; then
4003 eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`"
4005 eval "install${prefixvar}=\"\$${prefixvar}exp\""
4008 chmod +x installprefix
4009 $eunicefix installprefix
4011 : Set variables such as privlib and privlibexp from the output of ./getfile
4012 : performing the prefixexp/installprefixexp correction if necessary.
4013 cat <<EOS >setprefixvar
4016 cat <<'EOSC' >>setprefixvar
4017 eval "${prefixvar}=\"\$ans\""
4018 eval "${prefixvar}exp=\"\$ansexp\""
4021 chmod +x setprefixvar
4022 $eunicefix setprefixvar
4024 : set up the script used to warn in case of inconsistency
4033 '') echo "The $hint value for \$$var on this machine was \"$was\"!" >&4
4035 *) echo "Hmm. Based on the hints in hints/$hintfile.sh, " >&4
4036 echo "the $hint value for \$$var on this machine was \"$was\"!" >&4
4041 echo "*** WHOA THERE!!! ***" >&4
4042 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
4045 rp=" Keep the $hint value?"
4048 y) td=$was; tu=$was;;
4052 : function used to set '$1' to '$val'
4053 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
4055 $define$undef) . ./whoa; eval "$var=\$td";;
4056 $undef$define) . ./whoa; eval "$var=\$tu";;
4057 *) eval "$var=$val";;
4060 : Check is we will use socks
4062 $define|true|[yY]*) dflt='y';;
4067 Perl can be built to use the SOCKS proxy protocol library. To do so,
4068 Configure must be run with -Dusesocks. If you use SOCKS you also need
4069 to use the PerlIO abstraction layer, this will be implicitly selected.
4071 If this doesn't make any sense to you, just accept the default '$dflt'.
4073 rp='Build Perl for SOCKS?'
4076 y|Y) val="$define" ;;
4083 $define|true|[yY]*) useperlio="$define";;
4086 : Check if we want perlio
4087 case "$useperlio" in
4088 $define|true|[yY]*|'') dflt='y';;
4093 Previous version of $package used the standard IO mechanisms as
4094 defined in <stdio.h>. Versions 5.003_02 and later of $package allow
4095 alternate IO mechanisms via the PerlIO abstraction layer, but the
4096 stdio mechanism is still available if needed. The abstraction layer
4097 can use AT&T's sfio (if you already have sfio installed) or regular stdio.
4098 Using PerlIO with sfio may cause problems with some extension modules.
4100 If this doesn't make any sense to you, just accept the default '$dflt'.
4102 rp='Use the PerlIO abstraction layer?'
4109 echo "Ok, doing things the stdio way."
4118 case "$useperlio" in
4119 $define|true|[yY]*) ;;
4122 You are using the SOCKS proxy protocol library which means that you
4123 should also use the PerlIO layer. You may be headed for trouble.
4131 : get the patchlevel
4133 echo "Getting the current patchlevel..." >&4
4134 if $test -r $rsrc/patchlevel.h;then
4135 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
4136 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
4137 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4138 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
4139 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
4140 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4141 perl_patchlevel=`egrep ',"(MAINT|SMOKE)[0-9][0-9]*"' $rsrc/patchlevel.h|tail -1|sed 's/[^0-9]//g'`
4150 $echo "(You do not have patchlevel.h. Eek.)"
4152 if $test -r $rsrc/.patch ; then
4153 if $test "X$perl_patchlevel" = "X" || $test "`cat $rsrc/.patch`" -gt "$perl_patchlevel" ; then
4154 perl_patchlevel=`cat $rsrc/.patch`
4157 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
4158 version_patchlevel_string="version $patchlevel subversion $subversion"
4159 case "$perl_patchlevel" in
4161 *) perl_patchlevel=`echo $perl_patchlevel | sed 's/.* //'`
4162 version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel"
4166 $echo "(You have $package $version_patchlevel_string.)"
4170 : XXX Should be a Configure test for double-dots in filenames.
4171 version=`echo $revision $patchlevel $subversion | \
4172 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4173 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4174 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4177 version=`echo $revision $patchlevel $subversion | \
4178 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4179 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4180 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4183 : Special case the 5.005_xx maintenance series, which used 5.005
4184 : without any subversion label as a subdirectory in $sitelib
4185 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
4186 api_versionstring='5.005'
4189 : Do we want threads support and if so, what type
4190 case "$usethreads" in
4191 $define|true|[yY]*) dflt='y';;
4192 *) # Catch case where user specified ithreads or 5005threads but
4193 # forgot -Dusethreads (A.D. 4/2002)
4194 case "$useithreads$use5005threads" in
4196 case "$useperlio" in
4197 "$define") dflt='y' ;;
4207 Perl can be built to take advantage of threads on some systems.
4208 To do so, Configure can be run with -Dusethreads.
4210 Note that Perl built with threading support runs slightly slower
4211 and uses more memory than plain Perl. The current implementation
4212 is believed to be stable, but it is fairly new, and so should be
4213 treated with caution.
4215 If this doesn't make any sense to you, just accept the default '$dflt'.
4217 rp='Build a threading Perl?'
4220 y|Y) val="$define" ;;
4226 if $test $patchlevel -lt 9; then
4227 case "$usethreads" in
4231 Since release 5.6, Perl has had two different threading implementations,
4232 the newer interpreter-based version (ithreads) with one interpreter per
4233 thread, and the older 5.005 version (5005threads).
4234 The 5005threads version is effectively unmaintained and will probably be
4235 removed in Perl 5.10, so there should be no need to build a Perl using it
4236 unless needed for backwards compatibility with some existing 5.005threads
4240 : Default to ithreads unless overridden on command line or with
4243 case "$use5005threads" in
4244 $define|true|[yY]*) dflt='n';;
4246 case "$useithreads" in
4247 $undef|false|[nN]*) dflt='n';;
4249 rp='Use the newer interpreter-based ithreads?'
4252 y|Y) val="$define" ;;
4257 : Now set use5005threads to the opposite value.
4258 case "$useithreads" in
4259 $define) val="$undef" ;;
4266 useithreads="$undef"
4267 use5005threads="$undef"
4271 case "$useithreads$use5005threads" in
4275 You cannot have both the ithreads and the 5.005 threads enabled
4276 at the same time. Disabling the 5.005 threads since they are
4277 much less stable than the ithreads.
4280 use5005threads="$undef"
4285 : perl-5.9.x and later
4287 if test X"$usethreads" = "X$define"; then
4288 case "$use5005threads" in
4292 5.005 threads has been removed for 5.10. Perl will be built using ithreads.
4299 use5005threads="$undef"
4300 useithreads="$usethreads"
4303 if test X"$usethreads" = "X$define" -a "X$useperlio" = "Xundef"; then
4306 *** To build with ithreads you must also use the PerlIO layer.
4307 *** Cannot continue, aborting.
4313 case "$d_oldpthreads" in
4314 '') : Configure tests would be welcome here. For now, assume undef.
4316 *) val="$d_oldpthreads" ;;
4322 : Look for a hint-file generated 'call-back-unit'. If the
4323 : user has specified that a threading perl is to be built,
4324 : we may need to set or change some other defaults.
4325 if $test -f usethreads.cbu; then
4326 echo "Your platform has some specific hints regarding threaded builds, using them..."
4329 case "$usethreads" in
4330 "$define"|true|[yY]*)
4332 (Your platform does not have any specific hints for threaded builds.
4333 Assuming POSIX threads, then.)
4339 : Check if multiplicity is required
4342 Perl can be built so that multiple Perl interpreters can coexist
4343 within the same Perl executable.
4346 case "$useithreads" in
4349 This multiple interpreter support is required for interpreter-based threads.
4353 *) case "$usemultiplicity" in
4354 $define|true|[yY]*) dflt='y';;
4358 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
4359 rp='Build Perl for multiplicity?'
4362 y|Y) val="$define" ;;
4370 : Check if morebits is requested
4371 case "$usemorebits" in
4372 "$define"|true|[yY]*)
4373 use64bitint="$define"
4374 uselongdouble="$define"
4375 usemorebits="$define"
4377 *) usemorebits="$undef"
4381 : Determine the C compiler to be used
4387 rp="Use which C compiler?"
4391 : See whether they have no cc but they do have gcc
4393 if $test -f cc.cbu; then
4398 : make some quick guesses about what we are up against
4400 $echo $n "Hmm... $c"
4410 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
4411 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
4413 echo "Looks kind of like an OSF/1 system, but we'll see..."
4415 elif test `echo abc | $tr a-z A-Z` = Abc ; then
4416 xxx=`./loc addbib blurfl $pth`
4417 if $test -f $xxx; then
4418 echo "Looks kind of like a USG system with BSD features, but we'll see..."
4422 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
4423 echo "Looks kind of like an extended USG system, but we'll see..."
4425 echo "Looks kind of like a USG system, but we'll see..."
4429 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
4430 echo "Looks kind of like a BSD system, but we'll see..."
4434 echo "Looks kind of like a Version 7 system, but we'll see..."
4437 case "$eunicefix" in
4440 There is, however, a strange, musty smell in the air that reminds me of
4441 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
4445 : it so happens the Eunice I know will not run shell scripts in Unix format
4449 echo "Congratulations. You aren't running Eunice."
4453 : Detect OS2. The p_ variable is set above in the Head.U unit.
4454 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
4455 : semicolon as a patch separator
4460 I have the feeling something is not exactly right, however...don't tell me...
4461 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
4462 (Or you may be running DOS with DJGPP.)
4467 if test -f /xenix; then
4468 echo "Actually, this looks more like a XENIX system..."
4473 echo "It's not Xenix..."
4478 if test -f /venix; then
4479 echo "Actually, this looks more like a VENIX system..."
4486 echo "Nor is it Venix..."
4489 chmod +x bsd usg v7 osf1 eunice xenix venix os2
4490 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
4493 : Check if we are using GNU gcc and what its version is
4495 echo "Checking for GNU cc in disguise and/or its version number..." >&4
4499 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
4501 printf("%s\n", __VERSION__);
4503 printf("%s\n", "1");
4509 if $cc -o try $ccflags $ldflags try.c; then
4510 gccversion=`$run ./try`
4511 case "$gccversion" in
4512 '') echo "You are not using GNU cc." ;;
4513 *) echo "You are using GNU cc $gccversion."
4519 echo "*** WHOA THERE!!! ***" >&4
4520 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
4521 case "$knowitall" in
4523 echo " You'd better start hunting for one and let me know about it." >&4
4529 case "$gccversion" in
4530 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
4532 case "$gccversion" in
4533 '') gccosandvers='' ;;
4534 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
4535 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
4537 case "$gccosandvers" in
4538 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
4539 $osname$osvers) ;; # looking good
4540 $osname*) cat <<EOM >&4
4542 *** WHOA THERE!!! ***
4544 Your gcc has not been compiled for the exact release of
4545 your operating system ($gccosandvers versus $osname$osvers).
4547 In general it is a good idea to keep gcc synchronized with
4548 the operating system because otherwise serious problems
4549 may ensue when trying to compile software, like Perl.
4551 I'm trying to be optimistic here, though, and will continue.
4552 If later during the configuration and build icky compilation
4553 problems appear (headerfile conflicts being the most common
4554 manifestation), I suggest reinstalling the gcc to match
4555 your operating system release.
4559 *) gccosandvers='' ;; # failed to parse, better be silent
4567 # gcc 3.* complain about adding -Idirectories that they already know about,
4568 # so we will take those off from locincpth.
4569 case "$gccversion" in
4571 echo "main(){}">try.c
4572 for incdir in $locincpth; do
4573 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
4574 grep '^c[cp]p*[01]: warning: changing search order '`
4575 if test "X$warn" != X; then
4576 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
4582 : What should the include directory be ?
4584 $echo $n "Hmm... $c"
4588 if $test -f /bin/mips && /bin/mips; then
4589 echo "Looks like a MIPS system..."
4590 $cat >usr.c <<'EOCP'
4591 #ifdef SYSTYPE_BSD43
4595 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4596 dflt='/bsd43/usr/include'
4600 mips_type='System V'
4602 $rm -f usr.c usr.out
4603 echo "and you're compiling with the $mips_type compiler and libraries."
4607 echo "Doesn't look like a MIPS system."
4617 case "$xxx_prompt" in
4620 rp='Where are the include files you want to use?'
4628 : see how we invoke the C preprocessor
4630 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4631 cat <<'EOT' >testcpp.c
4637 if test ! -f cppstdin; then
4638 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4639 # AIX cc -E doesn't show the absolute headerfile
4640 # locations but we'll cheat by using the -M flag.
4641 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
4643 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4646 echo "Keeping your $hint cppstdin wrapper."
4649 wrapper=`pwd`/cppstdin
4653 if $test "X$cppstdin" != "X" && \
4654 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4655 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4657 echo "You used to use $cppstdin $cppminus so we'll use that again."
4659 '') echo "But let's see if we can live without a wrapper..." ;;
4661 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4662 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4664 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4667 echo "(However, $cpprun $cpplast does not work, let's see...)"
4675 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4682 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4683 $cc -E <testcpp.c >testcpp.out 2>&1; \
4684 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4685 echo "Yup, it does."
4688 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4689 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4690 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4691 echo "Yup, it does."
4694 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4695 $cc -P <testcpp.c >testcpp.out 2>&1; \
4696 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4697 echo "Yipee, that works!"
4700 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4701 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4702 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4703 echo "At long last!"
4706 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4707 $cpp <testcpp.c >testcpp.out 2>&1; \
4708 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4712 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4713 $cpp - <testcpp.c >testcpp.out 2>&1; \
4714 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4715 echo "Hooray, it works! I was beginning to wonder."
4718 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4719 $wrapper <testcpp.c >testcpp.out 2>&1; \
4720 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4726 rp="No dice. I can't find a C preprocessor. Name one:"
4730 $x_cpp <testcpp.c >testcpp.out 2>&1
4731 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4732 echo "OK, that will do." >&4
4734 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4749 echo "Perhaps can we force $cc -E using a wrapper..."
4750 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4751 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4757 echo "Nope, we'll have to live without it..."
4771 "$wrapper"|'cppstdin') ;;
4772 *) $rm -f $wrapper;;
4774 $rm -f testcpp.c testcpp.out
4776 : Set private lib path
4779 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4784 '') dlist="$loclibpth $plibpth $glibpth";;
4785 *) dlist="$libpth";;
4788 : Now check and see which directories actually exist, avoiding duplicates
4792 if $test -d $xxx; then
4795 *) libpth="$libpth $xxx";;
4801 Some systems have incompatible or broken versions of libraries. Among
4802 the directories listed in the question below, please remove any you
4803 know not to be holding relevant libraries, and add any that are needed.
4804 Say "none" for none.
4815 rp="Directories to use for library searches?"
4822 : compute shared library extension
4825 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4835 On some systems, shared libraries may be available. Answer 'none' if
4836 you want to suppress searching of shared libraries for the remainder
4837 of this configuration.
4840 rp='What is the file extension used for shared libraries?'
4844 : Define several unixisms.
4845 : Hints files or command line option can be used to override them.
4846 : The convoluted testing is in case hints files set either the old
4849 '') case "$exe_ext" in
4851 *) _exe="$exe_ext" ;;
4856 '') case "$lib_ext" in
4863 '') case "$obj_ext" in
4870 '') case "$path_sep" in
4881 rm_try="$rm -f try try$_exe a.out .out try.[cho] try.$_o core core.try* try.core*"
4883 : Which makefile gets called first. This is used by make depend.
4884 case "$firstmakefile" in
4885 '') firstmakefile='makefile';;
4888 : Check for uselongdouble support
4890 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
4893 case "$uselongdouble" in
4894 $define|true|[yY]*) dflt='y';;
4899 Perl can be built to take advantage of long doubles which
4900 (if available) may give more accuracy and range for floating point numbers.
4902 If this doesn't make any sense to you, just accept the default '$dflt'.
4904 rp='Try to use long doubles if available?'
4907 y|Y) val="$define" ;;
4913 case "$uselongdouble" in
4914 true|[yY]*) uselongdouble="$define" ;;
4917 : Look for a hint-file generated 'call-back-unit'. If the
4918 : user has specified that long doubles should be used,
4919 : we may need to set or change some other defaults.
4920 if $test -f uselongdouble.cbu; then
4921 echo "Your platform has some specific hints regarding long doubles, using them..."
4922 . ./uselongdouble.cbu
4924 case "$uselongdouble" in
4927 (Your platform does not have any specific hints for long doubles.)
4933 : Looking for optional libraries
4935 echo "Checking for optional libraries..." >&4
4940 case "$libswanted" in
4941 '') libswanted='c_s';;
4944 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
4950 for thisdir in $libpth $xlibpth; do
4951 test -d $thisdir && libspath="$libspath $thisdir"
4953 for thislib in $libswanted; do
4954 for thisdir in $libspath; do
4956 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4957 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
4958 $test -f "$xxx" && eval $libscheck
4959 $test -f "$xxx" && libstyle=shared
4961 if test ! -f "$xxx"; then
4962 xxx=$thisdir/lib$thislib.$so
4963 $test -f "$xxx" && eval $libscheck
4964 $test -f "$xxx" && libstyle=shared
4966 if test ! -f "$xxx"; then
4967 xxx=$thisdir/lib$thislib$_a
4968 $test -f "$xxx" && eval $libscheck
4969 $test -f "$xxx" && libstyle=static
4971 if test ! -f "$xxx"; then
4972 xxx=$thisdir/$thislib$_a
4973 $test -f "$xxx" && eval $libscheck
4974 $test -f "$xxx" && libstyle=static
4976 if test ! -f "$xxx"; then
4977 xxx=$thisdir/lib${thislib}_s$_a
4978 $test -f "$xxx" && eval $libscheck
4979 $test -f "$xxx" && libstyle=static
4980 $test -f "$xxx" && thislib=${thislib}_s
4982 if test ! -f "$xxx"; then
4983 xxx=$thisdir/Slib$thislib$_a
4984 $test -f "$xxx" && eval $libscheck
4985 $test -f "$xxx" && libstyle=static
4987 if $test -f "$xxx"; then
4989 shared) echo "Found -l$thislib (shared)." ;;
4990 static) echo "Found -l$thislib." ;;
4991 *) echo "Found -l$thislib ($libstyle)." ;;
4995 *) dflt="$dflt -l$thislib"
4996 libsfound="$libsfound $xxx"
4998 libsfiles="$libsfiles $yyy"
4999 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
5000 case " $libsdirs " in
5002 *) libsdirs="$libsdirs $yyy" ;;
5009 if $test ! -f "$xxx"; then
5010 echo "No -l$thislib."
5021 ' '|'') dflt='none';;
5026 In order to compile $package on your machine, a number of libraries
5027 are usually needed. Include any other special libraries here as well.
5028 Say "none" for none. The default list is almost always right.
5032 rp="What libraries to use?"
5039 : determine optimization, if desired, or use for debug flag also
5041 ' '|$undef) dflt='none';;
5043 *) dflt="$optimize";;
5047 By default, $package compiles with the -O flag to use the optimizer.
5048 Alternately, you might want to use the symbolic debugger, which uses
5049 the -g flag (on traditional Unix systems). Either flag can be
5050 specified here. To use neither flag, specify the word "none".
5053 rp="What optimizer/debugger flag should be used?"
5057 'none') optimize=" ";;
5060 : Check what DEBUGGING is required from the command line
5061 : -DEBUGGING or -DDEBUGGING or
5062 : -DEBUGGING=both = -g + -DDEBUGGING
5063 : -DEBUGGING=-g or -Doptimize=-g = -g
5064 : -DEBUGGING=none or -UDEBUGGING =
5065 : -DEBUGGING=old or -DEBUGGING=default = ? $optimize
5068 *) DEBUGGING=$EBUGGING ;;
5071 case "$DEBUGGING" in
5075 *) optimize="$optimize -g" ;;
5079 *-g*) set `echo "X $optimize " | sed 's/ -g / /'`
5087 case "$DEBUGGING" in
5088 both|$define) dflt='-DDEBUGGING'
5091 : argument order is deliberate, as the flag will start with - which set could
5092 : think is an option
5093 checkccflag='check=$1; flag=$2; callback=$3;
5095 echo "Checking if your compiler accepts $flag" 2>&1;
5096 echo "int main(void) { return 0; }" > gcctest.c;
5097 if $cc -O2 $flag -o gcctest gcctest.c 2>gcctest.out && ./gcctest; then
5098 echo "Yes, it does." 2>&1;
5099 if $test -s gcctest.out ; then
5100 echo "But your platform does not like it:";
5105 echo "Leaving current flags $ccflags alone." 2>&1
5107 *) dflt="$dflt $flag";
5113 echo "Nope, it does not, but that is ok." 2>&1;
5117 : We will not override a previous value, but we might want to
5118 : augment a hint file
5120 default|recommended)
5121 case "$gccversion" in
5122 1*) dflt="$dflt -fpcc-struct-return" ;;
5124 case "$optimize:$DEBUGGING" in
5125 *-g*:old) dflt="$dflt -DDEBUGGING";;
5127 case "$gccversion" in
5128 2*) if $test -d /etc/conf/kconfig.d &&
5129 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
5131 # Interactive Systems (ISC) POSIX mode.
5136 case "$gccversion" in
5139 ?*) set strict-aliasing -fno-strict-aliasing
5143 # For gcc, adding -pipe speeds up compilations for some, but apparently
5144 # some assemblers can't read from stdin. (It also slows down compilations
5145 # in other cases, but those are apparently rarer these days.) AD 5/2004.
5146 case "$gccversion" in
5152 # on x86_64 (at least) we require an extra library (libssp) in the
5153 # link command line. This library is not named, so I infer that it is
5154 # an implementation detail that may change. Hence the safest approach
5155 # is to add the flag to the flags passed to the compiler at link time,
5156 # as that way the compiler can do the right implementation dependant
5158 case "$gccversion" in
5159 ?*) set stack-protector -fstack-protector
5166 case "$mips_type" in
5167 *BSD*|'') inclwanted="$locincpth $usrinc";;
5168 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
5170 for thisincl in $inclwanted; do
5171 if $test -d $thisincl; then
5172 if $test x$thisincl != x$usrinc; then
5174 *" -I$thisincl "*);;
5175 *) dflt="$dflt -I$thisincl ";;
5181 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
5183 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
5191 *) dflt="$dflt -D$2";;
5195 set signal.h LANGUAGE_C; eval $inctest
5199 ccflags="$ccflags -DSOCKS"
5204 default|recommended) dflt="$ccflags $dflt" ;;
5205 *) dflt="$ccflags";;
5214 Your C compiler may want other flags. For this question you should include
5215 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
5216 but you should NOT include libraries or ld flags like -lwhatever. If you
5217 want $package to honor its debug switch, you should include -DDEBUGGING here.
5218 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
5220 To use no flags, specify the word "none".
5226 rp="Any additional cc flags?"
5233 : the following weeds options from ccflags that are of no interest to cpp
5235 '') cppflags="$ccflags" ;;
5236 *) cppflags="$cppflags $ccflags" ;;
5238 case "$gccversion" in
5239 1*) cppflags="$cppflags -D__GNUC__"
5241 case "$mips_type" in
5243 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
5249 echo "Let me guess what the preprocessor flags are..." >&4
5263 *) ftry="$previous $flag";;
5265 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
5266 >cpp1.out 2>/dev/null && \
5267 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
5268 >cpp2.out 2>/dev/null && \
5269 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
5270 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
5272 cppflags="$cppflags $ftry"
5282 *-*) echo "They appear to be: $cppflags";;
5284 $rm -f cpp.c cpp?.out
5288 : flags used in final linking phase
5290 '') if ./venix; then
5296 *-posix*) dflt="$dflt -posix" ;;
5299 *) dflt="$ldflags";;
5301 # See note above about -fstack-protector
5303 *-fstack-protector*)
5305 *-fstack-protector*) ;; # Don't add it again
5306 *) dflt="$dflt -fstack-protector" ;;
5311 : Try to guess additional flags to pick up local libraries.
5312 for thislibdir in $libpth; do
5313 case " $loclibpth " in
5316 *"-L$thislibdir "*) ;;
5317 *) dflt="$dflt -L$thislibdir" ;;
5329 Your C linker may need flags. For this question you should
5330 include -L/whatever and any other flags used by the C linker, but you
5331 should NOT include libraries like -lwhatever.
5333 Make sure you include the appropriate -L/path flags if your C linker
5334 does not normally search all of the directories you specified above,
5337 To use no flags, specify the word "none".
5341 rp="Any additional ld flags (NOT including libraries)?"
5347 rmlist="$rmlist pdp11"
5351 echo "Checking your choice of C compiler and flags for coherency..." >&4
5352 $cat > try.c <<'EOF'
5354 int main() { printf("Ok\n"); return(0); }
5356 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
5358 $cat >try.msg <<'EOM'
5359 I've tried to compile and run the following simple program:
5362 $cat try.c >> try.msg
5364 $cat >> try.msg <<EOM
5371 and I got the following output:
5375 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5376 if $sh -c "$run ./try " >>try.msg 2>&1; then
5380 *) echo 'The program compiled OK, but produced no output.' >> try.msg
5383 cat >> try.msg <<'EOQS'
5384 If $libs contains -lsfio, and sfio is mis-configured, then it
5385 sometimes (apparently) runs and exits with a 0 status, but with no
5386 output! It may have to do with sfio's use of _exit vs. exit.
5389 rp="You have a big problem. Shall I abort Configure"
5396 echo "The program compiled OK, but exited with status $?." >>try.msg
5397 rp="You have a problem. Shall I abort Configure"
5401 echo "I can't compile the test program." >>try.msg
5402 rp="You have a BIG problem. Shall I abort Configure"
5408 case "$knowitall" in
5410 echo "(The supplied flags or libraries might be incorrect.)"
5418 *) echo "Ok. Stopping Configure." >&4
5423 n) echo "OK, that should do.";;
5425 $rm_try gcctest gcctest.out
5427 : define a shorthand compile call
5431 case "$usedevel" in $define|true|[yY]*) if $test ! -f "${mc_file}.c"; then
5432 echo "Internal Configure script bug - compiler test file ${mc_file}.c is missing. Please report this to perlbug@perl.org" >&4;
5436 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5437 : define a shorthand compile call for compilations that should be ok.
5441 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5443 : determine filename position in cpp output
5445 echo "Computing filename position in cpp output for #include directives..." >&4
5447 vos) testaccess=-e ;;
5450 echo '#include <stdio.h>' > foo.c
5453 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5454 $grep '^[ ]*#.*stdio\.h' | \
5455 while read cline; do
5458 while $test \$# -gt 0; do
5459 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5464 pos=\`expr \$pos + 1\`
5476 *) pos="${fieldn}th";;
5478 echo "Your cpp writes the filename in the $pos field of the line."
5481 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
5482 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
5485 : locate header file
5490 for usrincdir in $usrinc
5492 if test -f \$usrincdir/\$wanted; then
5493 echo "\$usrincdir/\$wanted"
5497 awkprg='{ print \$$fieldn }'
5498 echo "#include <\$wanted>" > foo\$\$.c
5499 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5500 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5501 while read cline; do
5502 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5504 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5505 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5510 # status = 0: grep returned 0 lines, case statement not executed
5511 # status = 1: headerfile found
5512 # status = 2: while loop executed, no headerfile found
5516 if test \$status -eq 1; then
5523 : define an alternate in-header-list? function
5524 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5525 cont=true; xxf="echo \"<\$1> found.\" >&4";
5526 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5527 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5529 case $# in 4) instead=instead;; *) instead="at last";; esac;
5530 while $test "$cont"; do
5532 var=$2; eval "was=\$$2";
5533 if $test "$xxx" && $test -r "$xxx";
5535 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5538 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5539 set $yyy; shift; shift; yyy=$@;
5540 case $# in 0) cont="";;
5541 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5542 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5543 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5544 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5548 do set $yyy; var=$2; eval "was=\$$2";
5549 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5550 set $yyy; shift; shift; yyy=$@;
5553 : see if stdlib is available
5554 set stdlib.h i_stdlib
5557 : check for lengths of integral types
5561 echo "Checking to see how big your integers are..." >&4
5570 printf("intsize=%d;\n", (int)sizeof(int));
5571 printf("longsize=%d;\n", (int)sizeof(long));
5572 printf("shortsize=%d;\n", (int)sizeof(short));
5577 if eval $compile_ok && $run ./try > /dev/null; then
5579 echo "Your integers are $intsize bytes long."
5580 echo "Your long integers are $longsize bytes long."
5581 echo "Your short integers are $shortsize bytes long."
5585 Help! I can't compile and run the intsize test program: please enlighten me!
5586 (This is probably a misconfiguration in your system or libraries, and
5587 you really ought to fix it. Still, I'll try anyway.)
5591 rp="What is the size of an integer (in bytes)?"
5595 rp="What is the size of a long integer (in bytes)?"
5599 rp="What is the size of a short integer (in bytes)?"
5607 : check for long long
5609 echo "Checking to see if you have long long..." >&4
5610 echo 'int main() { long long x = 7; return 0; }' > try.c
5612 if eval $compile; then
5614 echo "You have long long."
5617 echo "You do not have long long."
5623 : check for length of long long
5624 case "${d_longlong}${longlongsize}" in
5627 echo "Checking to see how big your long longs are..." >&4
5628 $cat >try.c <<'EOCP'
5632 printf("%d\n", (int)sizeof(long long));
5637 if eval $compile_ok; then
5638 longlongsize=`$run ./try`
5639 echo "Your long longs are $longlongsize bytes long."
5643 echo "(I can't seem to compile the test program. Guessing...)"
5644 rp="What is the size of a long long (in bytes)?"
5648 if $test "X$longsize" = "X$longlongsize"; then
5649 echo "(That isn't any different from an ordinary long.)"
5655 : see if inttypes.h is available
5656 : we want a real compile instead of Inhdr because some systems
5657 : have an inttypes.h which includes non-existent headers
5660 #include <inttypes.h>
5662 static int32_t foo32 = 0x12345678;
5666 if eval $compile; then
5667 echo "<inttypes.h> found." >&4
5670 echo "<inttypes.h> NOT found." >&4
5679 echo "Checking to see if you have int64_t..." >&4
5681 #include <sys/types.h>
5682 #$i_inttypes I_INTTYPES
5684 #include <inttypes.h>
5686 int main() { int64_t x = 7; }
5689 if eval $compile; then
5691 echo "You have int64_t."
5694 echo "You do not have int64_t."
5700 : Check if 64bit ints have a quad type
5702 echo "Checking which 64-bit integer type we could use..." >&4
5708 val='"unsigned int"'
5713 *) case "$longsize" in
5717 val='"unsigned long"'
5722 *) case "$d_longlong:$longlongsize" in
5727 val='"unsigned long long"'
5732 *) case "$d_int64_t" in
5751 '') echo "Alas, no 64-bit integer types in sight." >&4
5754 *) echo "We could use '$quadtype' for 64-bit integers." >&4
5759 : Do we want 64bit support
5760 case "$uselonglong" in
5761 "$define"|true|[yY]*)
5764 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
5766 use64bitint="$define"
5769 case "$use64bits" in
5770 "$define"|true|[yY]*)
5773 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
5775 use64bitint="$define"
5778 case "$use64bitints" in
5779 "$define"|true|[yY]*)
5782 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
5784 use64bitint="$define"
5787 case "$use64bitsint" in
5788 "$define"|true|[yY]*)
5791 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
5793 use64bitint="$define"
5796 case "$uselonglongs" in
5797 "$define"|true|[yY]*)
5800 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
5802 use64bitint="$define"
5805 case "$use64bitsall" in
5806 "$define"|true|[yY]*)
5809 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
5811 use64bitall="$define"
5816 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
5818 case "$use64bitall" in
5819 "$define"|true|[yY]*) use64bitint="$define" ;;
5825 You have natively 64-bit long integers.
5829 *) case "$use64bitint" in
5830 "$define"|true|[yY]*) dflt='y';;
5839 Perl can be built to take advantage of 64-bit integer types
5840 on some systems. To do so, Configure can be run with -Duse64bitint.
5841 Choosing this option will most probably introduce binary incompatibilities.
5843 If this doesn't make any sense to you, just accept the default '$dflt'.
5844 (The default has been chosen based on your configuration.)
5846 rp='Try to use 64-bit integers, if available?'
5849 [yY]*) val="$define" ;;
5857 case "$use64bitall" in
5858 "$define"|true|[yY]*) dflt='y' ;;
5859 *) case "$longsize" in
5867 You may also choose to try maximal 64-bitness. It means using as much
5868 64-bitness as possible on the platform. This in turn means even more
5869 binary incompatibilities. On the other hand, your platform may not
5870 have any more 64-bitness available than what you already have chosen.
5872 If this doesn't make any sense to you, just accept the default '$dflt'.
5873 (The default has been chosen based on your configuration.)
5875 rp='Try to use maximal 64-bit support, if available?'
5878 [yY]*) val="$define" ;;
5883 case "$use64bitall" in
5885 case "$use64bitint" in
5889 Since you have chosen a maximally 64-bit build, I'm also turning on
5890 the use of 64-bit integers.
5892 use64bitint="$define" ;;
5897 : Look for a hint-file generated 'call-back-unit'. If the
5898 : user has specified that a 64-bit perl is to be built,
5899 : we may need to set or change some other defaults.
5900 if $test -f use64bitint.cbu; then
5901 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
5904 case "$use64bitint" in
5905 "$define"|true|[yY]*)
5907 4) case "$archname64" in
5908 '') archname64=64int ;;
5915 : Look for a hint-file generated 'call-back-unit'. If the
5916 : user has specified that a maximally 64-bit perl is to be built,
5917 : we may need to set or change some other defaults.
5918 if $test -f use64bitall.cbu; then
5919 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
5922 case "$use64bitall" in
5923 "$define"|true|[yY]*)
5925 4) case "$archname64" in
5926 ''|64int) archname64=64all ;;
5933 case "$d_quad:$use64bitint" in
5937 *** You have chosen to use 64-bit integers,
5938 *** but none can be found.
5939 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
5940 *** Cannot continue, aborting.
5947 : check for length of double
5949 case "$doublesize" in
5951 echo "Checking to see how big your double precision numbers are..." >&4
5960 printf("%d\n", (int)sizeof(double));
5965 if eval $compile_ok; then
5966 doublesize=`$run ./try`
5967 echo "Your double is $doublesize bytes long."
5970 echo "(I can't seem to compile the test program. Guessing...)"
5971 rp="What is the size of a double precision number (in bytes)?"
5979 : check for long doubles
5981 echo "Checking to see if you have long double..." >&4
5982 echo 'int main() { long double x = 7.0; }' > try.c
5984 if eval $compile; then
5986 echo "You have long double."
5989 echo "You do not have long double."
5995 : check for length of long double
5996 case "${d_longdbl}${longdblsize}" in
5999 echo "Checking to see how big your long doubles are..." >&4
6000 $cat >try.c <<'EOCP'
6004 printf("%d\n", sizeof(long double));
6009 if eval $compile; then
6010 longdblsize=`$run ./try`
6011 echo "Your long doubles are $longdblsize bytes long."
6015 echo "(I can't seem to compile the test program. Guessing...)" >&4
6016 rp="What is the size of a long double (in bytes)?"
6020 if $test "X$doublesize" = "X$longdblsize"; then
6021 echo "That isn't any different from an ordinary double."
6022 echo "I'll keep your setting anyway, but you may see some"
6023 echo "harmless compilation warnings."
6029 : determine the architecture name
6031 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
6032 tarch=`arch`"-$osname"
6033 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
6034 if uname -m > tmparch 2>&1 ; then
6035 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
6036 -e 's/$/'"-$osname/" tmparch`
6044 case "$myarchname" in
6047 echo "(Your architecture name used to be $myarchname.)"
6051 case "$targetarch" in
6053 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
6058 *) dflt="$archname";;
6060 rp='What is your architecture name'
6063 case "$usethreads" in
6065 echo "Threads selected." >&4
6067 *-thread*) echo "...and architecture name already has -thread." >&4
6069 *) archname="$archname-thread"
6070 echo "...setting architecture name to $archname." >&4
6075 case "$usemultiplicity" in
6077 echo "Multiplicity selected." >&4
6079 *-multi*) echo "...and architecture name already has -multi." >&4
6081 *) archname="$archname-multi"
6082 echo "...setting architecture name to $archname." >&4
6087 case "$use64bitint$use64bitall" in
6089 case "$archname64" in
6091 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
6094 case "$use64bitint" in
6095 "$define") echo "64 bit integers selected." >&4 ;;
6097 case "$use64bitall" in
6098 "$define") echo "Maximal 64 bitness selected." >&4 ;;
6101 *-$archname64*) echo "...and architecture name already has $archname64." >&4
6103 *) archname="$archname-$archname64"
6104 echo "...setting architecture name to $archname." >&4
6110 case "$uselongdouble" in
6112 echo "Long doubles selected." >&4
6113 case "$longdblsize" in
6115 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
6119 *-ld*) echo "...and architecture name already has -ld." >&4
6121 *) archname="$archname-ld"
6122 echo "...setting architecture name to $archname." >&4
6129 case "$useperlio" in
6131 echo "Perlio selected." >&4
6134 echo "Perlio not selected, using stdio." >&4
6136 *-stdio*) echo "...and architecture name already has -stdio." >&4
6138 *) archname="$archname-stdio"
6139 echo "...setting architecture name to $archname." >&4
6144 if $test -f archname.cbu; then
6145 echo "Your platform has some specific hints for architecture name, using them..."
6149 : set the prefixit variable, to compute a suitable default value
6150 prefixit='case "$3" in
6152 case "$oldprefix" in
6153 "") eval "$1=\"\$$2\"";;
6160 ""|" ") eval "$1=\"\$$2\"";;
6166 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
6168 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
6169 /*-$oldprefix/*|\~*-$oldprefix/*)
6170 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
6171 *) eval "$1=\"\$$2\"";;
6175 : determine installation style
6176 : For now, try to deduce it from prefix unless it is already set.
6177 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
6178 case "$installstyle" in
6179 '') case "$prefix" in
6180 *perl*) dflt='lib';;
6181 *) dflt='lib/perl5' ;;
6184 *) dflt="$installstyle" ;;
6186 : Probably not worth prompting for this since we prompt for all
6187 : the directories individually, and the prompt would be too long and
6191 : determine where public executables go
6196 rp='Pathname where the public executables will reside?'
6198 if $test "X$ansexp" != "X$binexp"; then
6202 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
6203 : XXX If this is fixed, also fix the "start perl" hunk below, which relies on
6204 : this via initialinstalllocation
6207 case "$userelocatableinc" in
6208 $define|true|[yY]*) dflt='y' ;;
6213 Would you like to build Perl so that the installation is relocatable, so that
6214 library paths in @INC are determined relative to the path of the perl binary?
6215 This is not advised for system Perl installs, or if you need to run setid
6216 scripts or scripts under taint mode.
6218 If this doesn't make any sense to you, just accept the default '$dflt'.
6220 rp='Use relocatable @INC?'
6223 y|Y) val="$define" ;;
6226 set userelocatableinc
6229 initialinstalllocation="$binexp"
6230 : Default prefix is now "up one level from where the binaries are"
6231 case "$userelocatableinc" in
6237 installprefixexp=".../.."
6241 : determine where private library files go
6242 : Usual default is /usr/local/lib/perl5/$version.
6243 : Also allow things like /opt/perl/lib/$version, since
6244 : /opt/perl/lib/perl5... would be redundant.
6245 : The default "style" setting is made in installstyle.U
6246 case "$installstyle" in
6247 *lib/perl5*) set dflt privlib lib/$package/$version ;;
6248 *) set dflt privlib lib/$version ;;
6253 There are some auxiliary files for $package that need to be put into a
6254 private library directory that is accessible by everyone.
6259 rp='Pathname where the private library files will reside?'
6264 : set the prefixup variable, to restore leading tilda escape
6265 prefixup='case "$prefixexp" in
6267 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
6270 : determine where public architecture dependent libraries go
6273 : privlib default is /usr/local/lib/$package/$version
6274 : archlib default is /usr/local/lib/$package/$version/$archname
6275 : privlib may have an optional trailing /share.
6276 tdflt=`echo $privlib | $sed 's,/share$,,'`
6277 tdflt=$tdflt/$archname
6286 $spackage contains architecture-dependent library files. If you are
6287 sharing libraries in a heterogeneous environment, you might store
6288 these files in a separate location. Otherwise, you can just include
6289 them with the rest of the public library files.
6294 rp='Where do you want to put the public architecture-dependent libraries?'
6298 if $test X"$archlib" = X"$privlib"; then
6304 : see if setuid scripts can be secure
6307 Some kernels have a bug that prevents setuid #! scripts from being
6308 secure. Some sites have disabled setuid #! scripts because of this.
6310 First let's decide if your kernel supports secure setuid #! scripts.
6311 (If setuid #! scripts would be secure but have been disabled anyway,
6312 don't say that they are secure if asked.)
6317 if $test -d /dev/fd; then
6318 echo "#!$ls" >reflect
6319 chmod +x,u+s reflect
6320 ./reflect >flect 2>&1
6321 if $contains "/dev/fd" flect >/dev/null; then
6322 echo "Congratulations, your kernel has secure setuid scripts!" >&4
6326 If you are not sure if they are secure, I can check but I'll need a
6327 username and password different from the one you are using right now.
6328 If you don't have such a username or don't want me to test, simply
6332 rp='Other username to test security of setuid scripts with?'
6337 case "$d_suidsafe" in
6338 '') echo "I'll assume setuid scripts are *not* secure." >&4
6341 echo "Well, the $hint value is *not* secure." >&4
6343 *) echo "Well, the $hint value *is* secure." >&4
6348 $rm -f reflect flect
6349 echo "#!$ls" >reflect
6350 chmod +x,u+s reflect
6353 echo '"su" will (probably) prompt you for '"$ans's password."
6354 su $ans -c './reflect >flect'
6355 if $contains "/dev/fd" flect >/dev/null; then
6356 echo "Okay, it looks like setuid scripts are secure." >&4
6359 echo "I don't think setuid scripts are secure." >&4
6364 rp='Does your kernel have *secure* setuid scripts?'
6367 [yY]*) val="$define";;
6372 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
6373 echo "(That's for file descriptors, not floppy disks.)"
6379 $rm -f reflect flect
6381 : now see if they want to do setuid emulation
6382 if $test $patchlevel -lt 11; then
6385 case "$d_suidsafe" in
6388 echo "No need to emulate SUID scripts since they are secure here." >&4
6392 Some systems have disabled setuid scripts, especially systems where
6393 setuid scripts cannot be secure. On systems where setuid scripts have
6394 been disabled, the setuid/setgid bits on scripts are currently
6395 useless. It is possible for $package to detect those bits and emulate
6396 setuid/setgid in a secure fashion. This emulation will only work if
6397 setuid scripts have been disabled in your kernel.
6401 "$define") dflt=y ;;
6404 rp="Do you want to do setuid/setgid emulation?"
6407 [yY]*) val="$define";;
6419 SUID emulation has been removed for 5.12
6420 Please re-run Configure without -Dd_dosuid
6429 : Find perl5.005 or later.
6430 echo "Looking for a previously installed perl5.005 or later... "
6432 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
6433 : Check if this perl is recent and can load a simple module
6434 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6437 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6447 '') echo "None found. That's ok.";;
6448 *) echo "Using $perl5." ;;
6451 : Set the siteprefix variables
6454 After $package is installed, you may wish to install various
6455 add-on modules and utilities. Typically, these add-ons will
6456 be installed under $prefix with the rest
6457 of this package. However, you may wish to install such add-ons
6458 elsewhere under a different prefix.
6460 If you do not wish to put everything under a single prefix, that's
6461 ok. You will be prompted for the individual locations; this siteprefix
6462 is only used to suggest the defaults.
6464 The default should be fine for most people.
6468 rp='Installation prefix to use for add-on modules and utilities?'
6469 : XXX Here might be another good place for an installstyle setting.
6470 case "$siteprefix" in
6472 *) dflt=$siteprefix ;;
6475 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6477 case "$siteprefix" in
6481 *) oldsiteprefix="$prefix";;
6486 siteprefixexp="$ansexp"
6488 : determine where site specific libraries go.
6489 : Usual default is /usr/local/lib/perl5/site_perl/$version
6490 : The default "style" setting is made in installstyle.U
6491 : XXX No longer works with Prefixit stuff.
6492 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6494 '') case "$installstyle" in
6495 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
6496 *) dflt=$siteprefix/lib/site_$prog/$version ;;
6504 The installation process will create a directory for
6505 site-specific extensions and modules. Most users find it convenient
6506 to place all site-specific files in this directory rather than in the
6507 main distribution directory.
6511 rp='Pathname for the site-specific library files?'
6515 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6517 : Determine list of previous versions to include in @INC
6518 $cat > getverlist <<EOPL
6521 \$api_versionstring = "$api_versionstring";
6522 \$version = "$version";
6523 \$stem = "$sitelib_stem";
6524 \$archname = "$archname";
6526 $cat >> getverlist <<'EOPL'
6527 # The list found is store twice for each entry: the original name, and
6528 # the binary broken down version as pack "sss", so sorting is easy and
6529 # unambiguous. This will work for all versions that have a maximum of
6530 # three digit groups, separate by '.'s or '_'s. Names are extended with
6531 # ".0.0" to ensure at least three elements for the pack.
6532 # -- H.Merijn Brand (m)'06 23-10-2006
6534 # Can't have leading @ because metaconfig interprets it as a command!
6535 ;@inc_version_list=();
6536 # XXX Redo to do opendir/readdir?
6539 ;@candidates = map {
6540 [ $_, pack "sss", split m/[._]/, "$_.0.0" ] } glob("5.*");
6541 ;@candidates = sort { $a->[1] cmp $b->[1]} @candidates;
6547 ($pversion, $aversion, $vsn5005) = map {
6548 pack "sss", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005";
6549 foreach $d (@candidates) {
6550 if ($d->[1] lt $pversion) {
6551 if ($d->[1] ge $aversion) {
6552 unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]);
6554 elsif ($d->[1] ge $vsn5005) {
6555 unshift(@inc_version_list, grep { -d } $d->[0]);
6559 # Skip newer version. I.e. don't look in
6560 # 5.7.0 if we're installing 5.6.1.
6564 if (@inc_version_list) {
6565 print join(' ', @inc_version_list);
6568 # Blank space to preserve value for next Configure run.
6573 case "$inc_version_list" in
6574 '') if test -x "$perl5$exe_ext"; then
6575 dflt=`$perl5 getverlist`
6580 $undef) dflt='none' ;;
6581 *) eval dflt=\"$inc_version_list\" ;;
6584 ''|' ') dflt=none ;;
6591 In order to ease the process of upgrading, this version of perl
6592 can be configured to use modules built and installed with earlier
6593 versions of perl that were installed under $prefix. Specify here
6594 the list of earlier versions that this version of perl should check.
6595 If Configure detected no earlier versions of perl installed under
6596 $prefix, then the list will be empty. Answer 'none' to tell perl
6597 to not search earlier versions.
6599 The default should almost always be sensible, so if you're not sure,
6600 just accept the default.
6603 rp='List of earlier versions to include in @INC?'
6606 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
6607 *) inc_version_list="$ans" ;;
6609 case "$inc_version_list" in
6611 inc_version_list_init='0'
6612 d_inc_version_list="$undef"
6614 *) inc_version_list_init=`echo $inc_version_list |
6615 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
6616 d_inc_version_list="$define"
6621 : see if malloc/malloc.h has to be included
6622 set malloc/malloc.h i_mallocmalloc
6625 : see if this is a malloc.h system
6626 : we want a real compile instead of Inhdr because some systems have a
6627 : malloc.h that just gives a compile error saying to use stdlib.h instead
6632 #$i_mallocmalloc I_MALLOCMALLOC
6633 #ifdef I_MALLOCMALLOC
6634 # include <malloc/malloc.h>
6637 int main () { return 0; }
6640 if eval $compile; then
6641 echo "<malloc.h> found." >&4
6644 echo "<malloc.h> NOT found." >&4
6651 : check for void type
6653 echo "Checking to see how well your C compiler groks the void type..." >&4
6654 case "$voidflags" in
6666 extern void moo(); /* function returning void */
6667 void (*goo)(); /* ptr to func returning void */
6669 void *hue; /* generic ptr */
6682 int main() { sub(); }
6684 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
6685 voidflags=$defvoidused
6686 echo "Good. It appears to support void to the level $package wants.">&4
6687 if $contains warning .out >/dev/null 2>&1; then
6688 echo "However, you might get some warnings that look like this:"
6692 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
6693 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
6694 echo "It supports 1..."
6695 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
6696 echo "It also supports 2..."
6697 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
6699 echo "And it supports 4 but not 8 definitely."
6701 echo "It doesn't support 4..."
6702 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
6704 echo "But it supports 8."
6707 echo "Neither does it support 8."
6711 echo "It does not support 2..."
6712 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
6714 echo "But it supports 4 and 8."
6716 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
6718 echo "And it supports 4 but has not heard about 8."
6720 echo "However it supports 8 but not 4."
6725 echo "There is no support at all for void."
6730 case "$voidflags" in
6733 Support flag bits are:
6734 1: basic void declarations.
6735 2: arrays of pointers to functions returning void.
6736 4: operations between pointers to and addresses of void functions.
6737 8: generic void pointers.
6740 rp="Your void support flags add up to what?"
6747 : check for length of pointer
6751 echo "Checking to see how big your pointers are..." >&4
6752 if test "$voidflags" -gt 7; then
6753 echo '#define VOID_PTR char *' > try.c
6755 echo '#define VOID_PTR void *' > try.c
6765 printf("%d\n", (int)sizeof(VOID_PTR));
6770 if eval $compile_ok; then
6771 ptrsize=`$run ./try`
6772 echo "Your pointers are $ptrsize bytes long."
6775 echo "(I can't seem to compile the test program. Guessing...)" >&4
6776 rp="What is the size of a pointer (in bytes)?"
6783 case "$use64bitall" in
6784 "$define"|true|[yY]*)
6788 *** You have chosen a maximally 64-bit build,
6789 *** but your pointers are only 4 bytes wide.
6790 *** Please rerun Configure without -Duse64bitall.
6795 *** Since you have quads, you could possibly try with -Duse64bitint.
6800 *** Cannot continue, aborting.
6811 : determine whether to use malloc wrapping
6813 case "$usemallocwrap" in
6814 [yY]*|true|$define) dflt='y' ;;
6815 [nN]*|false|$undef) dflt='n' ;;
6816 *) case "$usedevel" in
6817 [yY]*|true|$define) dflt='y' ;;
6822 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
6824 usemallocwrap="$ans"
6827 usemallocwrap="$define" ;;
6829 usemallocwrap="$undef" ;;
6832 : determine which malloc to compile in
6834 case "$usemymalloc" in
6835 [yY]*|true|$define) dflt='y' ;;
6836 [nN]*|false|$undef) dflt='n' ;;
6837 *) case "$ptrsize" in
6843 rp="Do you wish to attempt to use the malloc that comes with $package?"
6849 mallocsrc='malloc.c'
6850 mallocobj="malloc$_o"
6851 d_mymalloc="$define"
6854 : Remove malloc from list of libraries to use
6855 echo "Removing unneeded -lmalloc from library list" >&4
6856 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
6859 echo "libs = $libs" >&4
6871 : compute the return types of malloc and free
6873 $cat >malloc.c <<END
6877 #include <sys/types.h>
6891 case "$malloctype" in
6893 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
6900 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
6904 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
6911 echo "Your system uses $freetype free(), it would seem." >&4
6913 : determine where site specific architecture-dependent libraries go.
6914 : sitelib default is /usr/local/lib/perl5/site_perl/$version
6915 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6916 : sitelib may have an optional trailing /share.
6918 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
6919 dflt="$dflt/$archname"
6924 set sitearch sitearch none
6928 The installation process will also create a directory for
6929 architecture-dependent site-specific extensions and modules.
6933 rp='Pathname for the site-specific architecture-dependent library files?'
6937 if $test X"$sitearch" = X"$sitelib"; then
6940 d_sitearch="$define"
6943 : Set the vendorprefix variables
6946 The installation process will also create a directory for
6947 vendor-supplied add-ons. Vendors who supply perl with their system
6948 may find it convenient to place all vendor-supplied files in this
6949 directory rather than in the main distribution directory. This will
6950 ease upgrades between binary-compatible maintenance versions of perl.
6952 Of course you may also use these directories in whatever way you see
6953 fit. For example, you might use them to access modules shared over a
6954 company-wide network.
6956 The default answer should be fine for most people.
6957 This causes further questions about vendor add-ons to be skipped
6958 and no vendor-specific directories will be configured for perl.
6961 rp='Do you want to configure vendor-specific add-on directories?'
6962 case "$usevendorprefix" in
6963 define|true|[yY]*) dflt=y ;;
6964 *) : User may have set vendorprefix directly on Configure command line.
6965 case "$vendorprefix" in
6974 rp='Installation prefix to use for vendor-supplied add-ons?'
6975 case "$vendorprefix" in
6977 *) dflt=$vendorprefix ;;
6980 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6982 case "$vendorprefix" in
6986 *) oldvendorprefix="$prefix";;
6990 usevendorprefix="$define"
6992 vendorprefixexp="$ansexp"
6994 *) usevendorprefix="$undef"
7000 : Set the vendorlib variables
7001 case "$vendorprefix" in
7002 '') d_vendorlib="$undef"
7006 *) d_vendorlib="$define"
7007 : determine where vendor-supplied modules go.
7008 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
7009 case "$vendorlib" in
7011 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7012 case "$installstyle" in
7013 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
7014 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
7017 *) dflt="$vendorlib"
7021 rp='Pathname for the vendor-supplied library files?'
7024 vendorlibexp="$ansexp"
7027 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
7031 : Set the vendorarch variables
7032 case "$vendorprefix" in
7033 '') d_vendorarch="$undef"
7037 *) d_vendorarch="$define"
7038 : determine where vendor-supplied architecture-dependent libraries go.
7039 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
7040 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
7041 : vendorlib may have an optional trailing /share.
7042 case "$vendorarch" in
7043 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
7044 dflt="$dflt/$archname"
7046 *) dflt="$vendorarch" ;;
7049 rp='Pathname for vendor-supplied architecture-dependent files?'
7052 vendorarchexp="$ansexp"
7055 prefixvar=vendorarch
7057 if $test X"$vendorarch" = X"$vendorlib"; then
7058 d_vendorarch="$undef"
7060 d_vendorarch="$define"
7063 : Final catch-all directories to search
7066 Lastly, you can have perl look in other directories for extensions and
7067 modules in addition to those already specified.
7068 These directories will be searched after
7072 test X"$vendorlib" != "X" && echo ' ' $vendorlib
7073 test X"$vendorarch" != "X" && echo ' ' $vendorarch
7075 case "$otherlibdirs" in
7076 ''|' ') dflt='none' ;;
7077 *) dflt="$otherlibdirs" ;;
7080 Enter a colon-separated set of extra paths to include in perl's @INC
7081 search path, or enter 'none' for no extra paths.
7085 rp='Colon-separated list of additional directories for perl to search?'
7088 ' '|''|none) otherlibdirs=' ' ;;
7089 *) otherlibdirs="$ans" ;;
7091 case "$otherlibdirs" in
7095 set d_perl_otherlibdirs
7098 : Cruising for prototypes
7100 echo "Checking out function prototypes..." >&4
7101 $cat >prototype.c <<EOCP
7106 int main(int argc, char *argv[]) {
7109 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
7110 echo "Your C compiler appears to support function prototypes."
7113 echo "Your C compiler doesn't seem to understand function prototypes."
7120 : Check if ansi2knr is required
7121 case "$prototype" in
7123 *) ansi2knr='ansi2knr'
7128 This version of $package can only be compiled by a compiler that
7129 understands function prototypes. Unfortunately, your C compiler
7131 doesn't seem to understand them. Sorry about that.
7133 If GNU cc is available for your system, perhaps you could try that instead.
7135 Eventually, we hope to support building Perl with pre-ANSI compilers.
7136 If you would like to help in that effort, please contact <perlbug@perl.org>.
7138 Aborting Configure now.
7145 dflt_dtrace='/usr/sbin/dtrace'
7148 Perl can be built to support DTrace on platforms that support it.
7149 DTrace is a diagnosis and performance analysis tool from Sun.
7151 If this doesn't make any sense to you, just accept the default '$dflt'.
7155 case "$usedtrace" in
7161 dflt_dtrace=$usedtrace
7168 rp='Support DTrace if available?'
7171 y|Y) val="$define" ;;
7177 test "X$usedtrace" != "X$define" && break
7180 rp='Where is the dtrace executable?'
7189 if $dtrace -h -s ../perldtrace.d \
7190 -o perldtrace.tmp >/dev/null 2>&1 \
7191 && rm -f perldtrace.tmp
7194 echo "Good: your $dtrace knows about the -h flag."
7198 *** $me: Fatal Error: $dtrace doesn't support -h flag
7200 *** Your installed dtrace doesn't support the -h switch to compile a D
7201 *** program into a C header. Can't continue.
7213 *** $me: Fatal Error: $dtrace not found.
7220 echo "*** $dtrace was not found."
7226 : See if we want extra modules installed
7233 Perl can be built with extra modules or bundles of modules which
7234 will be fetched from the CPAN and installed alongside Perl.
7236 Notice that you will need access to the CPAN; either via the Internet,
7237 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
7238 be asked later to configure the CPAN.pm module which will in turn do
7239 the installation of the rest of the extra modules or bundles.)
7241 Notice also that if the modules require any external software such as
7242 libraries and headers (the libz library and the zlib.h header for the
7243 Compress::Zlib module, for example) you MUST have any such software
7244 already installed, this configuration process will NOT install such
7247 If this doesn't make any sense to you, just accept the default '$dflt'.
7249 rp='Install any extra modules (y or n)?'
7255 Please list any extra modules or bundles to be installed from CPAN,
7256 with spaces between the names. The names can be in any format the
7257 'install' command of CPAN.pm will understand. (Answer 'none',
7258 without the quotes, to install no extra modules or bundles.)
7268 $rm -f ../extras.lst
7270 *) echo "(Saving the list of extras for later...)"
7271 echo "$extras" > ../extras.lst
7279 : determine where html pages for programs go
7280 set html1dir html1dir none
7284 If you wish to install html files for programs in $spackage, indicate
7285 the appropriate directory here. To skip installing html files,
7289 ''|none|$undef|' ') dflt=none ;;
7290 *) dflt=$html1dir ;;
7293 rp="Directory for the main $spackage html pages?"
7297 : Use ' ' for none so value is preserved next time through Configure
7298 $test X"$html1dir" = "X" && html1dir=' '
7300 : determine where html pages for libraries and modules go
7301 set html3dir html3dir none
7305 If you wish to install html files for modules associated with $spackage,
7306 indicate the appropriate directory here. To skip installing html files,
7309 : There is no obvious default. If they have specified html1dir, then
7310 : try to key off that, possibly changing .../html1 into .../html3.
7312 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
7313 *) dflt=$html3dir ;;
7316 rp="Directory for the $spackage module html pages?"
7320 : Use ' ' for none so value is preserved next time through Configure
7321 $test X"$html3dir" = "X" && html3dir=' '
7323 : determine whether to install perl also as /usr/bin/perl
7326 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
7328 Many scripts expect perl to be installed as /usr/bin/perl.
7330 If you want to, I can install the perl you are about to compile
7331 as /usr/bin/perl (in addition to $bin/perl).
7333 if test -f /usr/bin/perl; then
7336 However, please note that because you already have a /usr/bin/perl,
7337 overwriting that with a new Perl would very probably cause problems.
7338 Therefore I'm assuming you don't want to do that (unless you insist).
7341 case "$installusrbinperl" in
7342 "$define"|[yY]*) dflt='y';;
7348 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
7351 case "$installusrbinperl" in
7352 "$undef"|[nN]*) dflt='n';;
7356 rp="Do you want to install perl as /usr/bin/perl?"
7359 [yY]*) val="$define";;
7365 set installusrbinperl
7368 : Check if we are using the GNU C library
7370 echo "Checking for GNU C Library..." >&4
7372 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
7373 alone are insufficient to distinguish different versions, such as
7374 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
7375 libc version 2.1.0. A. Dougherty, June 3, 2002.
7381 # ifdef __GLIBC_MINOR__
7382 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus)
7383 # include <gnu/libc-version.h>
7384 printf("%s\n", gnu_get_libc_version());
7386 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
7389 printf("%d\n", __GLIBC__);
7398 if eval $compile_ok && $run ./try > glibc.ver; then
7400 gnulibc_version=`$cat glibc.ver`
7401 echo "You are using the GNU C Library version $gnulibc_version"
7405 echo "You are not using the GNU C Library"
7411 : see if nm is to be used to determine whether a symbol is defined or not
7415 case "$d_gnulibc" in
7418 echo "nm probably won't work on the GNU C Library." >&4
7424 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
7426 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
7427 echo "'nm' won't be sufficient on this sytem." >&4
7433 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
7434 if $test $dflt -gt 20; then
7444 true|$define) dflt=y;;
7451 I can use $nm to extract the symbols from your C libraries. This
7452 is a time consuming task which may generate huge output on the disk (up
7453 to 3 megabytes) but that should make the symbols extraction faster. The
7454 alternative is to skip the 'nm' extraction part and to compile a small
7455 test program instead to determine whether each symbol is present. If
7456 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
7457 this may be the best solution.
7459 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
7462 rp="Shall I use $nm to extract C symbols from the libraries?"
7465 [Nn]*) usenm=false;;
7474 : nm options which may be necessary
7476 '') if $test -f /mach_boot; then
7478 elif $test -d /usr/ccs/lib; then
7479 nm_opt='-p' # Solaris (and SunOS?)
7480 elif $test -f /dgux; then
7482 elif $test -f /lib64/rld; then
7483 nm_opt='-p' # 64-bit Irix
7489 : nm options which may be necessary for shared libraries but illegal
7490 : for archive libraries. Thank you, Linux.
7491 case "$nm_so_opt" in
7492 '') case "$myuname" in
7494 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
7495 nm_so_opt='--dynamic'
7502 : Figure out where the libc is located
7505 : get list of predefined functions in a handy place
7510 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
7516 *) for thislib in $libs; do
7519 : Handle C library specially below.
7522 thislib=`echo $thislib | $sed -e 's/^-l//'`
7523 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
7525 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
7527 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
7529 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
7531 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
7533 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
7535 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
7540 libnames="$libnames $try"
7542 *) libnames="$libnames $thislib" ;;
7551 for xxx in $libpth; do
7552 $test -r $1 || set $xxx/libc.$so
7553 : The messy sed command sorts on library version numbers.
7555 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
7556 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
7558 s/[0-9][0-9]*/0000&/g
7559 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
7562 $sort | $sed -e 's/^.* //'`
7565 $test -r $1 || set /usr/ccs/lib/libc.$so
7566 $test -r $1 || set /lib/libsys_s$_a
7572 if $test -r "$1"; then
7573 echo "Your (shared) C library seems to be in $1."
7575 elif $test -r /lib/libc && $test -r /lib/clib; then
7576 echo "Your C library seems to be in both /lib/clib and /lib/libc."
7578 libc='/lib/clib /lib/libc'
7579 if $test -r /lib/syslib; then
7580 echo "(Your math library is in /lib/syslib.)"
7581 libc="$libc /lib/syslib"
7583 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7584 echo "Your C library seems to be in $libc, as you said before."
7585 elif $test -r $incpath/usr/lib/libc$_a; then
7586 libc=$incpath/usr/lib/libc$_a;
7587 echo "Your C library seems to be in $libc. That's fine."
7588 elif $test -r /lib/libc$_a; then
7590 echo "Your C library seems to be in $libc. You're normal."
7592 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
7594 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
7595 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
7596 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
7598 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7600 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7603 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
7605 if $test -r "$tans"; then
7606 echo "Your C library seems to be in $tans, of all places."
7612 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7616 If the guess above is wrong (which it might be if you're using a strange
7617 compiler, or your machine supports multiple models), you can override it here.
7622 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
7624 I can't seem to find your C library. I've looked in the following places:
7627 $sed 's/^/ /' libpath
7630 None of these seems to contain your C library. I need to get its name...
7635 rp='Where is your C library?'
7640 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
7641 set X `cat libnames`
7644 case $# in 1) xxx=file; esac
7645 echo "Extracting names from the following $xxx for later perusal:" >&4
7647 $sed 's/^/ /' libnames >&4
7649 $echo $n "This may take a while...$c" >&4
7653 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
7654 *) $nm $nm_opt $file 2>/dev/null;;
7659 $grep fprintf libc.tmp > libc.ptf
7660 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
7661 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
7663 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
7665 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7667 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
7669 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7671 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
7673 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7675 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
7677 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7679 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
7681 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7683 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
7685 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7687 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
7688 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
7690 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7692 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
7694 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7696 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
7698 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7700 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
7702 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7704 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
7706 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7708 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
7710 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7712 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
7714 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7716 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
7718 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7721 $nm -p $* 2>/dev/null >libc.tmp
7722 $grep fprintf libc.tmp > libc.ptf
7723 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
7724 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
7730 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
7732 if $ar t $libc > libc.tmp && \
7733 $contains '^fprintf$' libc.tmp >/dev/null 2>&1
7735 for thisname in $libnames $libc; do
7736 $ar t $thisname >>libc.tmp
7738 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
7740 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
7741 for thisname in $libnames $libc; do
7742 $ar tv $thisname >>libc.tmp
7743 emximp -o tmp.imp $thisname \
7745 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
7746 < tmp.imp >>libc.tmp
7749 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
7752 echo "$ar didn't seem to work right." >&4
7753 echo "Maybe this is a Cray...trying bld instead..." >&4
7755 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list &&
7758 for thisname in $libnames; do
7760 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
7761 $ar t $thisname >>libc.tmp
7765 echo "That didn't work either. Giving up." >&4
7775 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
7776 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
7778 *) if $test -f /lib/syscalls.exp; then
7780 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
7781 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' \
7782 /lib/syscalls.exp >>libc.list
7788 $rm -f libnames libpath
7790 : see if dld is available
7794 : Check if we are using C++
7796 echo "Checking for C++..." >&4
7797 $cat >try.c <<'EOCP'
7809 if eval $compile_ok && $run ./try; then
7811 echo "You are using a C++ compiler."
7814 echo "You are not using a C++ compiler."
7820 : is a C symbol defined?
7823 -v) tf=libc.tmp; tdc="";;
7824 -a) tf=libc.tmp; tdc="[]";;
7825 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
7827 case "$d_cplusplus" in
7828 $define) extern_C="extern \"C\"" ;;
7829 *) extern_C="extern" ;;
7832 case "$reuseval-$4" in
7834 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
7839 if $test "$runnm" = true; then
7840 if $contains $tlook $tf >/dev/null 2>&1; then
7842 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
7843 echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7844 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
7845 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
7849 echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7850 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
7856 $define) tval=true;;
7863 : define an is-in-libc? function
7864 inlibc='echo " "; td=$define; tu=$undef;
7865 sym=$1; var=$2; eval "was=\$$2";
7867 case "$reuseval$was" in
7877 echo "$sym() found." >&4;
7878 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
7880 echo "$sym() NOT found." >&4;
7881 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
7885 $define) echo "$sym() found." >&4;;
7886 *) echo "$sym() NOT found." >&4;;
7890 : see if dlopen exists
7892 xxx_ccflags="$ccflags"
7894 : with g++ one needs -shared to get is-in-libc to work for dlopen
7895 case "$gccversion" in
7897 *) case "$d_cplusplus" in
7898 "$define") ccflags="$ccflags -shared" ;;
7905 ccflags="$xxx_ccflags"
7907 : see if this is a unistd.h system
7908 set unistd.h i_unistd
7911 : determine which dynamic loading, if any, to compile in
7913 dldir="ext/DynaLoader"
7926 $define) dflt='y' ;;
7929 $define) dflt='y' ;;
7931 : Does a dl_xxx.xs file exist for this operating system
7932 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
7935 rp="Do you wish to use dynamic loading?"
7943 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
7944 dflt="$dldir/dl_${osname}.xs"
7945 elif $test "$d_dlopen" = "$define" ; then
7946 dflt="$dldir/dl_dlopen.xs"
7947 elif $test "$i_dld" = "$define" ; then
7948 dflt="$dldir/dl_dld.xs"
7953 *) dflt="$dldir/$dlsrc"
7956 echo "The following dynamic loading files are available:"
7957 : Can not go over to $dldir because getfile has path hard-coded in.
7958 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
7959 rp="Source file to use for dynamic loading"
7965 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
7969 Some systems may require passing special flags to $cc -c to
7970 compile modules that will be used to create a shared library.
7971 To use no flags, say "none".
7974 case "$cccdlflags" in
7975 '') case "$gccversion" in
7976 '') case "$osname" in
7978 next) dflt='none' ;;
7979 irix*) dflt='-KPIC' ;;
7980 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
7981 sunos) dflt='-pic' ;;
7985 *) case "$osname" in
7986 darwin) dflt='none' ;;
7987 linux*|svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
7992 *) dflt="$cccdlflags" ;;
7994 rp="Any special flags to pass to $cc -c to compile shared library modules?"
7997 none) cccdlflags=' ' ;;
7998 *) cccdlflags="$ans" ;;
8003 Some systems use ld to create libraries that can be dynamically loaded,
8004 while other systems (such as those using ELF) use $cc.
8008 '') $cat >try.c <<EOM
8009 /* Test for whether ELF binaries are produced */
8021 int i = open("a.out",O_RDONLY);
8024 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
8025 exit(0); /* succeed (yes, it's ELF) */
8030 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
8032 You appear to have ELF support. I'll use $cc to build dynamic libraries.
8037 echo "I'll use ld to build dynamic libraries."
8046 rp="What command should be used to create dynamic libraries?"
8052 Some systems may require passing special flags to $ld to create a
8053 library that can be dynamically loaded. If your ld flags include
8054 -L/other/path options to locate libraries outside your loader's normal
8055 search path, you may need to specify those -L options here as well. To
8056 use no flags, say "none".
8059 case "$lddlflags" in
8060 '') case "$osname" in
8061 beos) dflt='-nostart' ;;
8062 haiku) dflt='-shared' ;;
8064 case "$gccversion" in
8065 '') dflt="$dflt +vnocompatwarnings" ;;
8068 linux|irix*|gnu*) dflt="-shared $optimize" ;;
8069 next) dflt='none' ;;
8070 solaris) dflt='-G' ;;
8071 sunos) dflt='-assert nodefinitions' ;;
8072 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
8076 *) dflt="$lddlflags" ;;
8079 : Try to guess additional flags to pick up local libraries.
8080 : Be careful not to append to a plain 'none'
8084 for thisflag in $ldflags; do
8089 *) dflt="$dflt $thisflag" ;;
8096 ''|' ') dflt='none' ;;
8100 *-fstack-protector*)
8102 *-fstack-protector*) ;; # Don't add it again
8103 *) dflt="$dflt -fstack-protector" ;;
8109 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
8112 none) lddlflags=' ' ;;
8113 *) lddlflags="$ans" ;;
8118 Some systems may require passing special flags to $cc to indicate that
8119 the resulting executable will use dynamic linking. To use no flags,
8123 case "$ccdlflags" in
8124 '') case "$osname" in
8125 linux|hpux|gnu*) dflt='-Wl,-E' ;;
8126 next|sunos) dflt='none' ;;
8130 *) dflt="$ccdlflags" ;;
8132 rp="Any special flags to pass to $cc to use dynamic linking?"
8135 none) ccdlflags=' ' ;;
8136 *) ccdlflags="$ans" ;;
8147 : Do we want a shared libperl?
8151 # No dynamic loading being used, so don't bother even to prompt.
8154 *) case "$useshrplib" in
8155 '') case "$osname" in
8156 svr4*|nonstopux|dgux|dynixptx|esix|powerux|beos|haiku|cygwin*)
8158 also='Building a shared libperl is required for dynamic loading to work on your system.'
8163 also='Building a shared libperl is needed for MAB support.'
8181 The perl executable is normally obtained by linking perlmain.c with
8182 libperl${_a}, any static extensions (usually just DynaLoader), and
8183 any other libraries needed on this system (such as -lm, etc.). Since
8184 your system supports dynamic loading, it is probably possible to build
8185 a shared libperl.$so. If you will have more than one executable linked
8186 to libperl.$so, this will significantly reduce the size of each
8187 executable, but it may have a noticeable effect on performance. The
8188 default is probably sensible for your system.
8192 rp="Build a shared libperl.$so (y/n)"
8196 useshrplib='true' ;;
8197 *) useshrplib='false' ;;
8202 case "$useshrplib" in
8204 case "$userelocatableinc" in
8206 echo "Cannot build with both -Duserelocatableinc and -Duseshrplib" >&4
8207 echo "See INSTALL for an explanation why that won't work." >&4
8213 # Figure out a good name for libperl.so. Since it gets stored in
8214 # a version-specific architecture-dependent library, the version
8215 # number isn't really that important, except for making cc/ld happy.
8217 # A name such as libperl.so.10.1
8218 majmin="libperl.$so.$patchlevel.$subversion"
8219 # A name such as libperl.so.100
8220 majonly=`echo $patchlevel $subversion |
8221 $awk '{printf "%d%02d", $1, $2}'`
8222 majonly=libperl.$so.$majonly
8223 # I'd prefer to keep the os-specific stuff here to a minimum, and
8224 # rely on figuring it out from the naming of libc.
8225 case "${osname}${osvers}" in
8228 # XXX How handle the --version stuff for MAB?
8230 linux*|gnu*) # ld won't link with a bare -lperl otherwise.
8233 cygwin*) # ld links now against the dll directly
8234 majmin="cygperl5_${patchlevel}_${subversion}.${so}"
8235 majonly=`echo $patchlevel $subversion |
8236 $awk '{printf "%03d%03d", $1, $2}'`
8237 majonly=cygperl5.$majonly.$so
8240 *) # Try to guess based on whether libc has major.minor.
8242 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
8243 *libc.$so.[0-9]*) dflt=$majonly ;;
8244 *) dflt=libperl.$so ;;
8254 I need to select a good name for the shared libperl. If your system uses
8255 library names with major and minor numbers, then you might want something
8256 like $majmin. Alternatively, if your system uses a single version
8257 number for shared libraries, then you might want to use $majonly.
8258 Or, your system might be quite happy with a simple libperl.$so.
8260 Since the shared libperl will get installed into a version-specific
8261 architecture-dependent directory, the version number of the shared perl
8262 library probably isn't important, so the default should be o.k.
8265 rp='What name do you want to give to the shared libperl?'
8268 echo "Ok, I'll use $libperl"
8271 libperl="libperl${_a}"
8275 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
8279 WARNING: Use of the shrpdir variable for the installation location of
8280 the shared $libperl is not supported. It was never documented and
8281 will not work in this version. Let me (perlbug@perl.org)
8282 know of any problems this may cause.
8288 But your current setting of $shrpdir is
8289 the default anyway, so it's harmless.
8294 Further, your current attempted setting of $shrpdir
8295 conflicts with the value of $archlibexp/CORE
8296 that installperl will use.
8303 # How will the perl executable find the installed shared $libperl?
8304 # Add $xxx to ccdlflags.
8305 # If we can't figure out a command-line option, use $shrpenv to
8306 # set env LD_RUN_PATH. The main perl makefile uses this.
8307 shrpdir=$archlibexp/CORE
8310 if "$useshrplib"; then
8313 # We'll set it in Makefile.SH...
8318 freebsd|netbsd|openbsd|interix|dragonfly)
8319 xxx="-Wl,-R$shrpdir"
8321 bsdos|linux|irix*|dec_osf|gnu*)
8322 xxx="-Wl,-rpath,$shrpdir"
8325 # next doesn't like the default...
8328 # beos doesn't like the default, either.
8331 # Haiku doesn't like the default, either.
8334 # hpux doesn't like the default, either.
8335 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
8338 # cygwin needs only ldlibpth
8341 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
8347 # Only add $xxx if it isn't already in ccdlflags.
8348 case " $ccdlflags " in
8350 *) ccdlflags="$ccdlflags $xxx"
8353 Adding $xxx to the flags
8354 passed to $ld so that the perl executable will find the
8355 installed shared $libperl.
8363 # Fix ccdlflags in AIX for building external extensions.
8364 # (For building Perl itself bare -bE:perl.exp is needed,
8365 # Makefile.SH takes care of this.)
8367 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8369 # Respect a hint or command-line value.
8371 '') shrpenv="$tmp_shrpenv" ;;
8373 case "$ldlibpthname" in
8374 '') ldlibpthname=LD_LIBRARY_PATH ;;
8375 none) ldlibpthname='' ;;
8378 : determine where manual pages are on this system
8382 syspath='/usr/share/man/man1 /usr/man/man1'
8383 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8384 syspath="$syspath /usr/man/u_man/man1"
8385 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8386 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8387 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8388 sysman=`./loc . /usr/man/man1 $syspath`
8391 if $test -d "$sysman"; then
8392 echo "System manual is in $sysman." >&4
8394 echo "Could not find manual pages in source form." >&4
8397 : determine where manual pages go
8398 set man1dir man1dir none
8402 $spackage has manual pages available in source form.
8406 echo "However, you don't have nroff, so they're probably useless to you."
8408 '') man1dir="none";;
8411 echo "If you don't want the manual sources installed, answer 'none'."
8416 lookpath="$prefixexp/share/man/man1"
8417 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8418 lookpath="$lookpath $prefixexp/man/p_man/man1"
8419 lookpath="$lookpath $prefixexp/man/u_man/man1"
8420 lookpath="$lookpath $prefixexp/man/man.1"
8422 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8423 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8433 rp="Where do the main $spackage manual pages (source) go?"
8435 if $test "X$man1direxp" != "X$ansexp"; then
8446 : What suffix to use on installed man pages
8453 rp="What suffix should be used for the main $spackage man pages?"
8455 '') case "$man1dir" in
8469 *) dflt="$man1ext";;
8476 : see if we can have long filenames
8478 first=123456789abcdef
8480 if (echo hi >$first) 2>/dev/null; then
8481 if $test -f 123456789abcde; then
8482 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8485 echo 'You can have filenames longer than 14 characters.'>&4
8490 You can't have filenames longer than 14 chars.
8491 You can't even think about them!
8497 $rm -rf 123456789abcde*
8499 : determine where library module manual pages go
8500 set man3dir man3dir none
8504 $spackage has manual pages for many of the library modules.
8510 However, you don't have nroff, so they're probably useless to you.
8513 '') man3dir="none";;
8517 case "$d_flexfnam" in
8520 However, your system can't handle the long file names like File::Basename.3.
8523 '') man3dir="none";;
8527 echo "If you don't want the manual sources installed, answer 'none'."
8528 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8530 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
8531 if $test -d "$privlib/man/man3"; then
8534 WARNING: Previous versions of perl installed man3 pages into
8535 $privlib/man/man3. This version will suggest a
8536 new default of $dflt.
8540 rp='Do you wish to preserve the old behavior?(y/n)'
8543 y*) dflt="$privlib/man/man3" ;;
8548 *) dflt="$man3dir" ;;
8555 rp="Where do the $package library man pages (source) go?"
8565 : What suffix to use on installed man pages
8571 rp="What suffix should be used for the $package library man pages?"
8573 '') case "$man3dir" in
8587 *) dflt="$man3ext";;
8594 : see if we have to deal with yellow pages, now NIS.
8595 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
8596 if $test -f /usr/etc/nibindd; then
8598 echo "I'm fairly confident you're on a NeXT."
8600 rp='Do you get the hosts file via NetInfo?'
8609 y*) hostcat='nidump hosts .';;
8610 *) case "$hostcat" in
8611 nidump*) hostcat='';;
8621 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
8629 rp='Are you getting the hosts file via yellow pages?'
8632 y*) hostcat='ypcat hosts';;
8633 *) hostcat='cat /etc/hosts';;
8639 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
8642 '') test -f /etc/group && groupcat='cat /etc/group';;
8645 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
8648 : now get the host name
8650 echo "Figuring out host name..." >&4
8651 case "$myhostname" in
8653 echo 'Maybe "hostname" will work...'
8654 if tans=`sh -c hostname 2>&1` ; then
8662 if $test "$cont"; then
8664 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
8665 if tans=`cat /etc/systemid 2>&1` ; then
8667 phostname='cat /etc/systemid'
8668 echo "Whadyaknow. Xenix always was a bit strange..."
8671 elif $test -r /etc/systemid; then
8672 echo "(What is a non-Xenix system doing with /etc/systemid?)"
8675 if $test "$cont"; then
8676 echo 'No, maybe "uuname -l" will work...'
8677 if tans=`sh -c 'uuname -l' 2>&1` ; then
8679 phostname='uuname -l'
8681 echo 'Strange. Maybe "uname -n" will work...'
8682 if tans=`sh -c 'uname -n' 2>&1` ; then
8684 phostname='uname -n'
8686 echo 'Oh well, maybe I can mine it out of whoami.h...'
8687 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
8688 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
8689 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
8691 case "$myhostname" in
8692 '') echo "Does this machine have an identity crisis or something?"
8695 echo "Well, you said $myhostname before..."
8696 phostname='echo $myhostname';;
8702 case "$myhostname" in
8703 '') myhostname=noname ;;
8705 : you do not want to know about this
8710 if $test "$myhostname" ; then
8712 rp='Your host name appears to be "'$myhostname'".'" Right?"
8720 : bad guess or no guess
8721 while $test "X$myhostname" = X ; do
8723 rp="Please type the (one word) name of your host:"
8728 : translate upper to lower if necessary
8729 case "$myhostname" in
8731 echo "(Normalizing case in your host name)"
8732 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
8736 case "$myhostname" in
8738 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
8739 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
8740 echo "(Trimming domain name from host name--host name is now $myhostname)"
8742 *) case "$mydomain" in
8745 test "X$hostcat" = "Xypcat hosts" &&
8746 ypmatch "$myhostname" hosts 2>/dev/null |\
8747 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
8750 test "X$hostcat" != "X" &&
8751 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
8752 /[ ]$myhostname[ . ]/p" > hosts
8755 if $test -f hosts; then
8756 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
8757 END { print sum }" hosts` = x1 || tmp_re="[ ]"
8758 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
8759 hosts | $sort | $uniq | \
8760 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
8761 case `$echo X$dflt` in
8762 X*\ *) echo "(Several hosts in the database matched hostname)"
8765 X.) echo "(You do not have fully-qualified names in the hosts database)"
8769 echo "(I cannot locate a hosts database anywhere)"
8774 tans=`./loc resolv.conf X /etc /usr/etc`
8775 if $test -f "$tans"; then
8776 echo "(Attempting domain name extraction from $tans)"
8777 dflt=.`$sed -n -e 's/ / /g' \
8778 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
8781 .) dflt=.`$sed -n -e 's/ / /g' \
8782 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
8790 .) echo "(No help from resolv.conf either -- attempting clever guess)"
8791 dflt=.`sh -c domainname 2>/dev/null`
8794 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
8798 case "$dflt$osname" in
8799 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
8800 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
8804 .) echo "(Lost all hope -- silly guess then)"
8810 *) dflt="$mydomain";;
8814 rp="What is your domain name?"
8824 : translate upper to lower if necessary
8827 echo "(Normalizing case in your domain name)"
8828 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
8832 : a little sanity check here
8833 case "$phostname" in
8836 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
8837 $myhostname$mydomain|$myhostname) ;;
8839 case "$phostname" in
8841 echo "(That doesn't agree with your whoami.h file, by the way.)"
8844 echo "(That doesn't agree with your $phostname command, by the way.)"
8852 : determine the e-mail address of the user who is running us
8855 I need to get your e-mail address in Internet format if possible, i.e.
8856 something like user@host.domain. Please answer accurately since I have
8857 no easy means to double check it. The default value provided below
8858 is most probably close to reality but may not be valid from outside
8859 your organization...
8863 while test "$cont"; do
8865 '') dflt="$cf_by@$myhostname$mydomain";;
8866 *) dflt="$cf_email";;
8868 rp='What is your e-mail address?'
8874 rp='Address does not look like an Internet one. Use it anyway?'
8888 : Ask e-mail of administrator
8891 If you or somebody else will be maintaining perl at your site, please
8892 fill in the correct e-mail address here so that they may be contacted
8893 if necessary. Currently, the "perlbug" program included with perl
8894 will send mail to this address in addition to perlbug@perl.org. You may
8895 enter "none" for no administrator.
8898 case "$perladmin" in
8899 '') dflt="$cf_email";;
8900 *) dflt="$perladmin";;
8902 rp='Perl administrator e-mail address'
8906 : determine whether to only install version-specific parts.
8909 Do you want to install only the version-specific parts of the perl
8910 distribution? Usually you do *not* want to do this.
8912 case "$versiononly" in
8913 "$define"|[Yy]*|true) dflt='y' ;;
8916 rp="Do you want to install only the version-specific parts of perl?"
8919 [yY]*) val="$define";;
8925 case "$versiononly" in
8926 "$define") inc_version_list=''
8927 inc_version_list_init=0
8931 : figure out how to guarantee perl startup
8932 : XXX Note that this currently takes advantage of the bug that binexp ignores
8933 : the Configure -Dinstallprefix setting, which in turn means that under
8934 : relocatable @INC, initialinstalllocation is what binexp started as.
8935 case "$startperl" in
8937 case "$sharpbang" in
8941 I can use the #! construct to start perl on your system. This will
8942 make startup of perl scripts faster, but may cause problems if you
8943 want to share those scripts and perl is not in a standard place
8944 ($initialinstalllocation/perl) on all your platforms. The alternative
8945 is to force a shell by starting the script with a single ':' character.
8948 case "$versiononly" in
8949 "$define") dflt="$initialinstalllocation/perl$version";;
8950 *) dflt="$initialinstalllocation/perl";;
8952 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
8955 none) startperl=": # use perl";;
8956 *) startperl="#!$ans"
8957 if $test 30 -lt `echo "$ans" | wc -c`; then
8960 WARNING: Some systems limit the #! command to 32 characters.
8961 If you experience difficulty running Perl scripts with #!, try
8962 installing Perl in a directory with a shorter pathname.
8968 *) startperl=": # use perl"
8973 echo "I'll use $startperl to start perl scripts."
8975 : figure best path for perl in scripts
8978 case "$versiononly" in
8979 "$define") perlpath="$initialinstalllocation/perl$version";;
8980 *) perlpath="$initialinstalllocation/perl";;
8982 case "$startperl" in
8987 I will use the "eval 'exec'" idiom to start Perl on your system.
8988 I can use the full path of your Perl binary for this purpose, but
8989 doing so may cause problems if you want to share those scripts and
8990 Perl is not always in a standard place ($initialinstalllocation/perl).
8993 dflt="$initialinstalllocation/perl"
8994 rp="What path shall I use in \"eval 'exec'\"?"
9001 case "$startperl" in
9003 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
9006 : determine where public executable scripts go
9007 set scriptdir scriptdir
9009 case "$scriptdir" in
9012 : guess some guesses
9013 $test -d /usr/share/scripts && dflt=/usr/share/scripts
9014 $test -d /usr/share/bin && dflt=/usr/share/bin
9015 $test -d /usr/local/script && dflt=/usr/local/script
9016 $test -d /usr/local/scripts && dflt=/usr/local/scripts
9017 $test -d $prefixexp/script && dflt=$prefixexp/script
9021 *) dflt="$scriptdir"
9026 Some installations have a separate directory just for executable scripts so
9027 that they can mount it across multiple architectures but keep the scripts in
9028 one spot. You might, for example, have a subdirectory of /usr/share for this.
9029 Or you might just lump your scripts in with all your other executables.
9033 rp='Where do you keep publicly executable scripts?'
9035 if $test "X$ansexp" != "X$scriptdirexp"; then
9041 : A little fix up for an irregularly named variable.
9042 installscript="$installscriptdir"
9044 : determine where add-on public executables go
9046 '') dflt=$siteprefix/bin ;;
9050 rp='Pathname where the add-on public executables should be installed?'
9055 : determine where add-on html pages go
9056 : There is no standard location, so try to copy the previously-selected
9057 : directory structure for the core html pages.
9058 case "$sitehtml1dir" in
9059 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9060 *) dflt=$sitehtml1dir ;;
9063 ''|' ') dflt=none ;;
9066 rp='Pathname where the site-specific html pages should be installed?'
9068 prefixvar=sitehtml1dir
9071 : determine where add-on library html pages go
9072 : There is no standard location, so try to copy the previously-selected
9073 : directory structure for the core html pages.
9074 case "$sitehtml3dir" in
9075 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9076 *) dflt=$sitehtml3dir ;;
9079 ''|' ') dflt=none ;;
9082 rp='Pathname where the site-specific library html pages should be installed?'
9084 prefixvar=sitehtml3dir
9087 : determine where add-on manual pages go
9088 case "$siteman1dir" in
9089 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
9090 *) dflt=$siteman1dir ;;
9093 ''|' ') dflt=none ;;
9096 rp='Pathname where the site-specific manual pages should be installed?'
9098 prefixvar=siteman1dir
9101 : determine where add-on library man pages go
9102 case "$siteman3dir" in
9103 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
9104 *) dflt=$siteman3dir ;;
9107 ''|' ') dflt=none ;;
9110 rp='Pathname where the site-specific library manual pages should be installed?'
9112 prefixvar=siteman3dir
9115 : determine where add-on public executable scripts go
9116 case "$sitescript" in
9117 '') dflt=$siteprefix/script
9118 $test -d $dflt || dflt=$sitebin ;;
9119 *) dflt="$sitescript" ;;
9122 rp='Pathname where add-on public executable scripts should be installed?'
9124 prefixvar=sitescript
9127 : Check if faststdio is requested and available
9128 case "$usefaststdio" in
9129 $define|true|[yY]*|'')
9130 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
9140 Perl can be built to use 'fast stdio', which means using the stdio
9141 library but also directly manipulating the stdio buffers to enable
9142 faster I/O. Using stdio is better for backward compatibility (especially
9143 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
9144 interface has been preferred instead of stdio.
9146 If this doesn't make any sense to you, just accept the default '$dflt'.
9148 rp='Use the "fast stdio" if available?'
9151 y|Y) val="$define" ;;
9158 : define an is-a-typedef? function
9159 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9161 "") inclist="sys/types.h";;
9163 eval "varval=\$$var";
9167 for inc in $inclist; do
9168 echo "#include <$inc>" >>temp.c;
9170 echo "#ifdef $type" >> temp.c;
9171 echo "printf(\"We have $type\");" >> temp.c;
9172 echo "#endif" >> temp.c;
9173 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9174 if $contains $type temp.E >/dev/null 2>&1; then
9180 *) eval "$var=\$varval";;
9183 : define an is-a-typedef? function that prompts if the type is not available.
9184 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9186 "") inclist="sys/types.h";;
9188 eval "varval=\$$var";
9192 for inc in $inclist; do
9193 echo "#include <$inc>" >>temp.c;
9195 echo "#ifdef $type" >> temp.c;
9196 echo "printf(\"We have $type\");" >> temp.c;
9197 echo "#endif" >> temp.c;
9198 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9200 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
9201 if $contains $type temp.E >/dev/null 2>&1; then
9202 echo "$type found." >&4;
9205 echo "$type NOT found." >&4;
9211 *) eval "$var=\$varval";;
9214 : see what type lseek is declared as in the kernel
9215 rp="What is the type used for lseek's offset on this system?"
9216 set off_t lseektype long stdio.h sys/types.h
9220 echo "Checking to see how big your file offsets are..." >&4
9222 #include <sys/types.h>
9226 printf("%d\n", (int)sizeof($lseektype));
9231 if eval $compile_ok; then
9232 lseeksize=`$run ./try`
9233 echo "Your file offsets are $lseeksize bytes long."
9237 echo "(I can't seem to compile the test program. Guessing...)"
9238 rp="What is the size of your file offsets (in bytes)?"
9244 : see what type file positions are declared as in the library
9245 rp="What is the type for file position used by fsetpos()?"
9246 set fpos_t fpostype long stdio.h sys/types.h
9249 : Check size for Fpos_t
9252 *_t) zzz="$fpostype" ;;
9255 echo "Checking the size of $zzz..." >&4
9257 #include <sys/types.h>
9264 printf("%d\n", (int)sizeof($fpostype));
9269 if eval $compile_ok; then
9273 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9276 echo "Your $zzz is $fpossize bytes long."
9282 echo "(I can't compile the test program. Guessing...)" >&4
9283 rp="What is the size of your file positions (in bytes)?"
9288 : Check for large file support
9289 # Backward compatibility (uselfs is deprecated).
9291 "$define"|true|[yY]*)
9294 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
9296 uselargefiles="$define"
9300 case "$lseeksize:$fpossize" in
9303 You can have files larger than 2 gigabytes.
9306 *) case "$uselargefiles" in
9307 "$undef"|false|[nN]*) dflt='n' ;;
9312 Perl can be built to understand large files (files larger than 2 gigabytes)
9313 on some systems. To do so, Configure can be run with -Duselargefiles.
9315 If this doesn't make any sense to you, just accept the default '$dflt'.
9317 rp='Try to understand large files, if available?'
9320 y|Y) val="$define" ;;
9327 : Look for a hint-file generated 'call-back-unit'. If the
9328 : user has specified that a large files perl is to be built,
9329 : we may need to set or change some other defaults.
9330 if $test -f uselargefiles.cbu; then
9331 echo "Your platform has some specific hints regarding large file builds, using them..."
9332 . ./uselargefiles.cbu
9334 case "$uselargefiles" in
9336 if $test -f uselargefiles.cbu; then
9338 echo "Rechecking to see how big your file offsets are..." >&4
9340 #include <sys/types.h>
9344 printf("%d\n", (int)sizeof($lseektype));
9349 if eval $compile_ok; then
9350 lseeksize=`$run ./try`
9351 $echo "Your file offsets are now $lseeksize bytes long."
9355 echo "(I can't seem to compile the test program. Guessing...)"
9356 rp="What is the size of your file offsets (in bytes)?"
9361 *_t) zzz="$fpostype" ;;
9364 $echo $n "Rechecking the size of $zzz...$c" >&4
9366 #include <sys/types.h>
9373 printf("%d\n", (int)sizeof($fpostype));
9378 if eval $compile_ok; then
9383 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9386 echo " $fpossize bytes." >&4
9392 echo "(I can't compile the test program. Guessing...)" >&4
9393 rp="What is the size of your file positions (in bytes)?"
9402 : Set the vendorbin variables
9403 case "$vendorprefix" in
9404 '') d_vendorbin="$undef"
9408 *) d_vendorbin="$define"
9409 : determine where vendor-supplied executables go.
9410 case "$vendorbin" in
9411 '') dflt=$vendorprefix/bin ;;
9412 *) dflt="$vendorbin" ;;
9415 rp='Pathname for the vendor-supplied executables directory?'
9418 vendorbinexp="$ansexp"
9424 : Set the vendorhtml1dir variables
9425 case "$vendorprefix" in
9426 '') vendorhtml1dir=''
9427 vendorhtml1direxp=''
9429 *) : determine where vendor-supplied html pages go.
9430 : There is no standard location, so try to copy the previously-selected
9431 : directory structure for the core html pages.
9432 : XXX Better default suggestions would be welcome.
9433 case "$vendorhtml1dir" in
9434 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9435 *) dflt=$vendorhtml1dir ;;
9438 ''|' ') dflt=none ;;
9441 rp='Pathname for the vendor-supplied html pages?'
9443 vendorhtml1dir="$ans"
9444 vendorhtml1direxp="$ansexp"
9447 : Use ' ' for none so value is preserved next time through Configure
9448 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9449 prefixvar=vendorhtml1dir
9452 : Set the vendorhtml3dir variables
9453 case "$vendorprefix" in
9454 '') vendorhtml3dir=''
9455 vendorhtml3direxp=''
9457 *) : determine where vendor-supplied module html pages go.
9458 : There is no standard location, so try to copy the previously-selected
9459 : directory structure for the core html pages.
9460 : XXX Better default suggestions would be welcome.
9461 case "$vendorhtml3dir" in
9462 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9463 *) dflt=$vendorhtml3dir ;;
9466 ''|' ') dflt=none ;;
9469 rp='Pathname for the vendor-supplied html pages?'
9471 vendorhtml3dir="$ans"
9472 vendorhtml3direxp="$ansexp"
9475 : Use ' ' for none so value is preserved next time through Configure
9476 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9477 prefixvar=vendorhtml3dir
9480 : Set the vendorman1dir variables
9481 case "$vendorprefix" in
9482 '') vendorman1dir=''
9485 *) : determine where vendor-supplied manual pages go.
9486 case "$vendorman1dir" in
9487 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9488 *) dflt=$vendorman1dir ;;
9491 ''|' ') dflt=none ;;
9494 rp='Pathname for the vendor-supplied manual section 1 pages?'
9496 vendorman1dir="$ans"
9497 vendorman1direxp="$ansexp"
9500 : Use ' ' for none so value is preserved next time through Configure
9501 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
9502 prefixvar=vendorman1dir
9505 : Set the vendorman3dir variables
9506 case "$vendorprefix" in
9507 '') vendorman3dir=''
9510 *) : determine where vendor-supplied module manual pages go.
9511 case "$vendorman3dir" in
9512 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9513 *) dflt=$vendorman3dir ;;
9516 ''|' ') dflt=none ;;
9519 rp='Pathname for the vendor-supplied manual section 3 pages?'
9521 vendorman3dir="$ans"
9522 vendorman3direxp="$ansexp"
9525 : Use ' ' for none so value is preserved next time through Configure
9526 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
9527 prefixvar=vendorman3dir
9530 : Set the vendorscript variables
9531 case "$vendorprefix" in
9532 '') d_vendorscript="$undef"
9536 *) d_vendorscript="$define"
9537 : determine where vendor-supplied scripts go.
9538 case "$vendorscript" in
9539 '') dflt=$vendorprefix/script
9540 $test -d $dflt || dflt=$vendorbin ;;
9541 *) dflt="$vendorscript" ;;
9545 The installation process will create a directory for
9546 vendor-supplied scripts.
9550 rp='Pathname for the vendor-supplied scripts directory?'
9553 vendorscriptexp="$ansexp"
9556 prefixvar=vendorscript
9559 : script used to emit important warnings
9562 if test \$# -gt 0; then
9567 echo "*** WARNING:" >&4
9568 sed -e 's/^/*** /' <msg >&4
9570 cat msg >>config.msg
9571 echo " " >>config.msg
9577 : see which of string.h or strings.h is needed
9579 strings=`./findhdr string.h`
9580 if $test "$strings" && $test -r "$strings"; then
9581 echo "Using <string.h> instead of <strings.h>." >&4
9585 strings=`./findhdr strings.h`
9586 if $test "$strings" && $test -r "$strings"; then
9587 echo "Using <strings.h> instead of <string.h>." >&4
9589 ./warn "No string header found -- You'll surely have problems."
9595 "$undef") strings=`./findhdr strings.h`;;
9596 *) strings=`./findhdr string.h`;;
9599 : see if qgcvt exists
9603 : Check print/scan long double stuff
9606 if $test X"$d_longdbl" = X"$define"; then
9608 echo "Checking how to print long doubles..." >&4
9610 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
9611 $cat >try.c <<'EOCP'
9612 #include <sys/types.h>
9616 printf("%.3f\n", d);
9620 if eval $compile; then
9624 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
9625 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
9626 echo "We will use %f."
9632 if $test X"$sPRIfldbl" = X; then
9633 $cat >try.c <<'EOCP'
9634 #include <sys/types.h>
9637 long double d = 123.456;
9638 printf("%.3Lf\n", d);
9642 if eval $compile; then
9646 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
9647 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
9648 echo "We will use %Lf."
9654 if $test X"$sPRIfldbl" = X; then
9655 $cat >try.c <<'EOCP'
9656 #include <sys/types.h>
9659 long double d = 123.456;
9660 printf("%.3llf\n", d);
9664 if eval $compile; then
9668 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
9669 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
9670 echo "We will use %llf."
9676 if $test X"$sPRIfldbl" = X; then
9677 $cat >try.c <<'EOCP'
9678 #include <sys/types.h>
9681 long double d = 123.456;
9682 printf("%.3lf\n", d);
9686 if eval $compile; then
9690 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
9691 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
9692 echo "We will use %lf."
9698 if $test X"$sPRIfldbl" = X; then
9699 echo "Cannot figure out how to print long doubles." >&4
9701 sSCNfldbl=$sPRIfldbl # expect consistency
9708 case "$sPRIfldbl" in
9709 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
9710 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
9711 d_SCNfldbl="$undef";
9713 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
9714 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
9715 d_SCNfldbl="$define";
9719 : Check how to convert floats to strings.
9721 if test "X$d_Gconvert" = X; then
9724 echo "Checking for an efficient way to convert floats to strings."
9726 case "$uselongdouble" in
9727 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
9729 case "$d_longdbl" in
9730 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
9732 case "$d_PRIgldbl" in
9733 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
9737 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
9738 char *myname = "gconvert";
9741 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
9742 char *myname = "gcvt";
9745 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
9746 char *myname = "qgcvt";
9747 #define DOUBLETYPE long double
9750 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9752 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
9754 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
9757 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
9759 char *myname = "sprintf";
9763 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9764 #define DOUBLETYPE long double
9766 #define DOUBLETYPE double
9778 # include <string.h>
9780 # include <strings.h>
9783 int checkit(char *expect, char *got)
9785 if (strcmp(expect, got)) {
9786 printf("%s oddity: Expected %s, got %s\n",
9787 myname, expect, got);
9797 /* This must be 1st test on (which?) platform */
9798 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
9799 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
9800 checkit("0.1", buf);
9802 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
9803 checkit("0.01", buf);
9805 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
9806 checkit("0.001", buf);
9808 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
9809 checkit("0.0001", buf);
9811 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
9812 if (strlen(buf) > 5)
9813 checkit("9e-005", buf); /* for Microsoft ?? */
9815 checkit("9e-05", buf);
9817 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
9820 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
9821 checkit("1.1", buf);
9823 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
9824 checkit("1.01", buf);
9826 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
9827 checkit("1.001", buf);
9829 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
9830 checkit("1.0001", buf);
9832 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
9833 checkit("1.00001", buf);
9835 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
9836 checkit("1.000001", buf);
9838 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
9841 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
9844 /* Some Linux gcvt's give 1.e+5 here. */
9845 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
9846 checkit("100000", buf);
9848 /* Some Linux gcvt's give -1.e+5 here. */
9849 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
9850 checkit("-100000", buf);
9852 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
9853 checkit("123.456", buf);
9855 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
9856 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
9857 /* 34 should be enough to scare even long double
9858 * places into using the e notation. */
9859 if (strlen(buf) > 5)
9860 checkit("1e+034", buf); /* for Microsoft */
9862 checkit("1e+34", buf);
9864 /* For Perl, if you add additional tests here, also add them to
9865 * t/base/num.t for benefit of platforms not using Configure or
9866 * overriding d_Gconvert */
9871 : first add preferred functions to our list
9873 for xxx_convert in $gconvert_preference; do
9874 case $xxx_convert in
9875 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
9876 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
9879 : then add any others
9880 for xxx_convert in gconvert gcvt sprintf; do
9883 *) xxx_list="$xxx_list $xxx_convert" ;;
9887 case "$d_longdbl$uselongdouble" in
9889 : again, add prefered functions to our list first
9891 for xxx_convert in $gconvert_ld_preference; do
9892 case $xxx_convert in
9893 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9894 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
9897 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
9898 for xxx_convert in qgcvt sprintf $xxx_list; do
9899 case "$xxx_ld_list" in
9900 $xxx_convert*|*" $xxx_convert"*) ;;
9901 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9904 : if sprintf cannot do long doubles, move it to the end
9905 if test "$d_PRIgldbl" != "$define"; then
9906 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
9908 : if no qgcvt, remove it
9909 if test "$d_qgcvt" != "$define"; then
9910 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
9913 xxx_list="$xxx_ld_list"
9917 for xxx_convert in $xxx_list; do
9918 echo "Trying $xxx_convert..."
9919 $rm -f try try$_o core
9920 set try -DTRY_$xxx_convert
9921 if eval $compile; then
9922 echo "$xxx_convert() found." >&4
9924 echo "I'll use $xxx_convert to convert floats into a string." >&4
9927 echo "...But $xxx_convert didn't work as I expected."
9931 echo "$xxx_convert NOT found." >&4
9935 if test X$xxx_convert = X; then
9936 echo "*** WHOA THERE!!! ***" >&4
9937 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
9941 case "$xxx_convert" in
9942 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
9943 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
9944 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
9945 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
9946 "$define$define$define")
9947 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
9948 "$define$define$undef")
9949 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
9950 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
9958 : see if _fwalk exists
9962 : Initialize h_fcntl
9965 : Initialize h_sysfile
9968 : access call always available on UNIX
9972 : locate the flags for 'access()'
9976 $cat >access.c <<EOCP
9977 #include <sys/types.h>
9982 #include <sys/file.h>
9995 : check sys/file.h first, no particular reason here
9996 if $test `./findhdr sys/file.h` && \
9997 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
9999 echo "<sys/file.h> defines the *_OK access constants." >&4
10000 elif $test `./findhdr fcntl.h` && \
10001 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
10003 echo "<fcntl.h> defines the *_OK access constants." >&4
10004 elif $test `./findhdr unistd.h` && \
10005 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
10006 echo "<unistd.h> defines the *_OK access constants." >&4
10008 echo "I can't find the four *_OK access constants--I'll use mine." >&4
10014 : see if accessx exists
10015 set accessx d_accessx
10018 : see if aintl exists
10022 : see if alarm exists
10026 : see if 64bit time functions exists
10028 set ctime64 d_ctime64
10031 set localtime64 d_localtime64
10034 set gmtime64 d_gmtime64
10037 set mktime64 d_mktime64
10040 set difftime64 d_difftime64
10043 set asctime64 d_asctime64
10046 : see if POSIX threads are available
10047 set pthread.h i_pthread
10050 : define a fucntion to check prototypes
10051 $cat > protochk <<EOSH
10054 optimize="$optimize"
10056 prototype="$prototype"
10059 usethreads=$usethreads
10060 i_pthread=$i_pthread
10061 pthread_h_first=$pthread_h_first
10064 $cat >> protochk <<'EOSH'
10069 while test $# -ge 2; do
10071 $define) echo "#include <$2>" >> try.c ;;
10072 literal) echo "$2" >> try.c ;;
10074 # Extra magic for the benefit of systems that need pthread.h
10075 # to be included early to correctly detect threadsafe functions.
10076 # Such functions must guarantee themselves, though, that the usethreads
10077 # and i_pthread have been defined, before calling protochk.
10078 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
10079 echo "#include <pthread.h>" >> try.c
10084 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
10085 cat >> try.c <<'EOCP'
10086 #ifdef CAN_PROTOTYPE
10087 #define _(args) args
10092 echo "$foo" >> try.c
10093 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
10094 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
10100 $eunicefix protochk
10102 : Define hasproto macro for Configure internal use
10103 hasproto='varname=$1; func=$2; shift; shift;
10104 while $test $# -ge 2; do
10106 $define) echo "#include <$2>";;
10110 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
10111 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
10112 echo "$func() prototype found.";
10115 echo "$func() prototype NOT found.";
10122 : see if sys/types.h has to be included
10123 set sys/types.h i_systypes
10126 : see if sys/select.h has to be included
10127 set sys/select.h i_sysselct
10130 : Define hasfield macro for Configure internal use
10131 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
10132 while $test $# -ge 2; do
10134 $define) echo "#include <$2>";;
10138 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
10140 if eval $compile; then
10149 : see if we should include time.h, sys/time.h, or both
10151 if test "X$timeincl" = X; then
10152 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
10153 $echo $n "I'm now running the test program...$c"
10155 #include <sys/types.h>
10160 #ifdef SYSTIMEKERNEL
10163 #include <sys/time.h>
10166 #include <sys/select.h>
10168 #$i_stdlib I_STDLIB
10170 #include <stdlib.h>
10176 struct timeval bar;
10179 struct timezone tzp;
10181 if (foo.tm_sec == foo.tm_sec)
10184 if (bar.tv_sec == bar.tv_sec)
10191 for s_timezone in '-DS_TIMEZONE' ''; do
10193 for s_timeval in '-DS_TIMEVAL' ''; do
10194 for i_systimek in '' '-DSYSTIMEKERNEL'; do
10195 for i_time in '' '-DI_TIME'; do
10196 for i_systime in '-DI_SYSTIME' ''; do
10199 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
10200 if eval $compile; then
10201 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
10205 $echo $n "Succeeded with $flags$c"
10217 *SYSTIMEKERNEL*) i_systimek="$define"
10218 timeincl=`./findhdr sys/time.h`
10219 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
10220 *) i_systimek="$undef";;
10223 *I_TIME*) i_time="$define"
10224 timeincl=`./findhdr time.h`" $timeincl"
10225 echo "We'll include <time.h>." >&4;;
10226 *) i_time="$undef";;
10229 *I_SYSTIME*) i_systime="$define"
10230 timeincl=`./findhdr sys/time.h`" $timeincl"
10231 echo "We'll include <sys/time.h>." >&4;;
10232 *) i_systime="$undef";;
10236 : see if struct tm knows about tm_zone
10237 case "$i_systime$i_time" in
10240 echo "Checking to see if your struct tm has tm_zone field..." >&4
10241 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
10249 case "$d_tm_tm_zone" in
10250 "$define") echo "Yes, it does." ;;
10251 *) echo "No, it doesn't." ;;
10253 : see if struct tm knows about tm_gmtoff
10254 case "$i_systime$i_time" in
10257 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
10258 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
10266 case "$d_tm_tm_gmtoff" in
10267 "$define") echo "Yes, it does." ;;
10268 *) echo "No, it doesn't." ;;
10271 : see if asctime_r exists
10272 set asctime_r d_asctime_r
10274 case "$d_asctime_r" in
10276 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10277 case "$d_asctime_r_proto:$usethreads" in
10278 ":define") d_asctime_r_proto=define
10279 set d_asctime_r_proto asctime_r $hdrs
10283 case "$d_asctime_r_proto" in
10285 case "$asctime_r_proto" in
10286 ''|0) try='char* asctime_r(const struct tm*, char*);'
10287 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SB ;;
10289 case "$asctime_r_proto" in
10290 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
10291 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SBI ;;
10293 case "$asctime_r_proto" in
10294 ''|0) try='int asctime_r(const struct tm*, char*);'
10295 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SB ;;
10297 case "$asctime_r_proto" in
10298 ''|0) try='int asctime_r(const struct tm*, char*, int);'
10299 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SBI ;;
10301 case "$asctime_r_proto" in
10302 ''|0) d_asctime_r=undef
10304 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
10305 * ) case "$asctime_r_proto" in
10306 REENTRANT_PROTO*) ;;
10307 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
10309 echo "Prototype: $try" ;;
10312 *) case "$usethreads" in
10313 define) echo "asctime_r has no prototype, not using it." >&4 ;;
10320 *) asctime_r_proto=0
10324 : see if atolf exists
10328 : see if atoll exists
10332 : Look for GCC-style attribute format
10333 case "$d_attribute_format" in
10336 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
10337 $cat >attrib.c <<'EOCP'
10339 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
10341 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10342 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10343 echo "Your C compiler doesn't support __attribute__((format))."
10346 echo "Your C compiler supports __attribute__((format))."
10350 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10354 *) val="$d_attribute_format" ;;
10356 set d_attribute_format
10360 : Look for GCC-style attribute format with null format allowed
10361 case "$d_printf_format_null" in
10362 '') case "$d_attribute_format" in
10365 echo "Checking whether your compiler allows __printf__ format to be null ..." >&4
10366 $cat >attrib.c <<EOCP
10368 #$i_stdlib I_STDLIB
10370 #include <stdlib.h>
10372 int null_printf (char* pat,...) __attribute__((__format__(__printf__,1,2)));
10373 int null_printf (char* pat,...) { return (int)pat; }
10374 int main () { exit(null_printf(NULL)); }
10376 if $cc $ccflags -o attrib attrib.c >attrib.out 2>&1 ; then
10377 : run the executable in case it produces a run-time warning
10378 if $run ./attrib >>attrib.out 2>&1; then
10379 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10380 echo "Your C compiler doesn't allow __printf__ format to be null."
10383 echo "Your C compiler allows __printf__ format to be null."
10387 echo "Your C compiler executable failed with __printf__ format null."
10391 echo "Your C compiler fails with __printf__ format null."
10398 *) val="$d_printf_format_null" ;;
10400 set d_printf_format_null
10404 : Look for GCC-style attribute malloc
10405 case "$d_attribute_malloc" in
10408 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
10409 $cat >attrib.c <<'EOCP'
10411 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
10413 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10414 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10415 echo "Your C compiler doesn't support __attribute__((malloc))."
10418 echo "Your C compiler supports __attribute__((malloc))."
10422 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10426 *) val="$d_attribute_malloc" ;;
10428 set d_attribute_malloc
10432 : Look for GCC-style attribute nonnull
10433 case "$d_attribute_nonnull" in
10436 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
10437 $cat >attrib.c <<'EOCP'
10439 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
10441 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10442 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10443 echo "Your C compiler doesn't support __attribute__((nonnull))."
10446 echo "Your C compiler supports __attribute__((nonnull))."
10450 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10454 *) val="$d_attribute_nonnull" ;;
10456 set d_attribute_nonnull
10460 : Look for GCC-style attribute noreturn
10461 case "$d_attribute_noreturn" in
10464 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
10465 $cat >attrib.c <<'EOCP'
10467 void fall_over_dead( void ) __attribute__((noreturn));
10469 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10470 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10471 echo "Your C compiler doesn't support __attribute__((noreturn))."
10474 echo "Your C compiler supports __attribute__((noreturn))."
10478 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10482 *) val="$d_attribute_noreturn" ;;
10484 set d_attribute_noreturn
10488 : Look for GCC-style attribute pure
10489 case "$d_attribute_pure" in
10492 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
10493 $cat >attrib.c <<'EOCP'
10495 int square( int n ) __attribute__((pure));
10497 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10498 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10499 echo "Your C compiler doesn't support __attribute__((pure))."
10502 echo "Your C compiler supports __attribute__((pure))."
10506 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10510 *) val="$d_attribute_pure" ;;
10512 set d_attribute_pure
10516 : Look for GCC-style attribute unused
10517 case "$d_attribute_unused" in
10520 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
10521 $cat >attrib.c <<'EOCP'
10523 int do_something( int dummy __attribute__((unused)), int n );
10525 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10526 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10527 echo "Your C compiler doesn't support __attribute__((unused))."
10530 echo "Your C compiler supports __attribute__((unused))."
10534 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10538 *) val="$d_attribute_unused" ;;
10540 set d_attribute_unused
10544 : Look for GCC-style attribute deprecated
10545 case "$d_attribute_deprecated" in
10548 echo "Checking whether your compiler can handle __attribute__((deprecated)) ..." >&4
10549 $cat >attrib.c <<'EOCP'
10551 int I_am_deprecated(void) __attribute__((deprecated));
10553 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10554 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10555 echo "Your C compiler doesn't support __attribute__((deprecated))."
10558 echo "Your C compiler supports __attribute__((deprecated))."
10562 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10566 *) val="$d_attribute_deprecated" ;;
10568 set d_attribute_deprecated
10572 : Look for GCC-style attribute warn_unused_result
10573 case "$d_attribute_warn_unused_result" in
10576 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
10577 $cat >attrib.c <<'EOCP'
10579 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
10581 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10582 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10583 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
10586 echo "Your C compiler supports __attribute__((warn_unused_result))."
10590 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10594 *) val="$d_attribute_warn_unused_result" ;;
10596 set d_attribute_warn_unused_result
10600 : see if bcmp exists
10604 : see if bcopy exists
10608 : see if getpgrp exists
10609 set getpgrp d_getpgrp
10612 case "$d_getpgrp" in
10615 echo "Checking to see which flavor of getpgrp is in use..."
10617 #$i_unistd I_UNISTD
10618 #include <sys/types.h>
10620 # include <unistd.h>
10622 #$i_stdlib I_STDLIB
10624 #include <stdlib.h>
10628 if (getuid() == 0) {
10629 printf("(I see you are running Configure as super-user...)\n");
10632 #ifdef TRY_BSD_PGRP
10633 if (getpgrp(1) == 0)
10642 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10643 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
10645 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10646 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
10649 echo "I can't seem to compile and run the test program."
10651 xxx="a USG one, i.e. you use getpgrp()."
10653 # SVR4 systems can appear rather BSD-ish.
10654 case "$i_unistd" in
10656 xxx="a BSD one, i.e. you use getpgrp(pid)."
10660 xxx="probably a USG one, i.e. you use getpgrp()."
10665 echo "Assuming your getpgrp is $xxx" >&4
10674 : see if setpgrp exists
10675 set setpgrp d_setpgrp
10678 case "$d_setpgrp" in
10681 echo "Checking to see which flavor of setpgrp is in use..."
10683 #$i_unistd I_UNISTD
10684 #include <sys/types.h>
10686 # include <unistd.h>
10688 #$i_stdlib I_STDLIB
10690 #include <stdlib.h>
10694 if (getuid() == 0) {
10695 printf("(I see you are running Configure as super-user...)\n");
10698 #ifdef TRY_BSD_PGRP
10699 if (-1 == setpgrp(1, 1))
10702 if (setpgrp() != -1)
10708 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10709 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
10711 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10712 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
10715 echo "(I can't seem to compile and run the test program.)"
10717 xxx="a USG one, i.e. you use setpgrp()."
10719 # SVR4 systems can appear rather BSD-ish.
10720 case "$i_unistd" in
10722 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
10726 xxx="probably a USG one, i.e. you use setpgrp()."
10731 echo "Assuming your setpgrp is $xxx" >&4
10740 : Look for GCC-style __builtin_choose_expr
10741 case "$d_builtin_choose_expr" in
10744 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
10745 $cat >try.c <<'EOCP'
10746 #include <assert.h>
10747 #include <stdlib.h>
10750 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
10753 assert( SYRINX(1) == 2112 );
10754 assert( SYRINX(1) != 5150 );
10755 assert( SYRINX(0) == 5150 );
10756 assert( SYRINX(0) != 2112 );
10757 puts( "All good!" );
10763 if eval $compile && $run ./try; then
10764 echo "Your C compiler supports __builtin_choose_expr."
10767 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
10771 *) val="$d_builtin_choose_expr" ;;
10774 set d_builtin_choose_expr
10778 : Look for GCC-style __builtin_expect
10779 case "$d_builtin_expect" in
10782 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
10783 $cat >try.c <<'EOCP'
10786 if ( __builtin_expect(n, 0) ) n = 1;
10787 /* Remember shell exit code truth is 0, C truth is non-zero */
10792 if eval $compile && $run ./try; then
10793 echo "Your C compiler supports __builtin_expect."
10796 echo "Your C compiler doesn't seem to understand __builtin_expect."
10800 *) val="$d_builtin_expect" ;;
10803 set d_builtin_expect
10807 : see if bzero exists
10811 : see if stdarg is available
10813 if $test `./findhdr stdarg.h`; then
10814 echo "<stdarg.h> found." >&4
10817 echo "<stdarg.h> NOT found." >&4
10821 : see if varags is available
10823 if $test `./findhdr varargs.h`; then
10824 echo "<varargs.h> found." >&4
10826 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
10829 : set up the varargs testing programs
10830 $cat > varargs.c <<EOP
10832 #include <stdarg.h>
10835 #include <varargs.h>
10839 int f(char *p, ...)
10853 p = va_arg(ap, char *);
10859 $cat > varargs <<EOP
10861 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
10870 : now check which varargs header should be included
10875 if `./varargs I_STDARG`; then
10877 elif `./varargs I_VARARGS`; then
10882 if `./varargs I_VARARGS`; then
10889 echo "I could not find the definition for va_dcl... You have problems..." >&4
10890 val="$undef"; set i_stdarg; eval $setvar
10891 val="$undef"; set i_varargs; eval $setvar
10896 case "$i_varhdr" in
10898 val="$define"; set i_stdarg; eval $setvar
10899 val="$undef"; set i_varargs; eval $setvar
10902 val="$undef"; set i_stdarg; eval $setvar
10903 val="$define"; set i_varargs; eval $setvar
10906 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
10910 : see if the Compiler supports C99 variadic macros
10911 case "$i_stdarg$i_stdlib" in
10913 echo "You have <stdarg.h> and <stdlib.h>, so checking for C99 variadic macros." >&4
10916 #include <stdarg.h>
10918 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
10922 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
10928 if eval $compile && $run ./try 2>&1 >/dev/null; then
10929 case "`$run ./try`" in
10931 echo "You have C99 variadic macros." >&4
10932 d_c99_variadic_macros="$define"
10935 echo "You don't have functional C99 variadic macros." >&4
10936 d_c99_variadic_macros="$undef"
10940 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
10941 d_c99_variadic_macros="$undef"
10946 echo "You don't have <stdarg.h> and <stdlib.h>, so not checking for C99 variadic macros." >&4
10947 d_c99_variadic_macros="$undef"
10951 : see if signal is declared as pointer to function returning int or void
10953 xxx=`./findhdr signal.h`
10954 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
10955 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10956 echo "You have int (*signal())() instead of void." >&4
10958 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10959 echo "You have void (*signal())()." >&4
10961 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
10962 echo "You have int (*signal())() instead of void." >&4
10964 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
10965 echo "You have void (*signal())()." >&4
10968 case "$d_voidsig" in
10970 echo "I can't determine whether signal handler returns void or int..." >&4
10972 rp="What type does your signal handler return?"
10975 v*) val="$define";;
10979 echo "As you already told me, signal handler returns void." >&4
10982 *) echo "As you already told me, signal handler returns int." >&4
10989 case "$d_voidsig" in
10990 "$define") signal_t="void";;
10991 *) signal_t="int";;
10995 : check for ability to cast large floats to 32-bit ints.
10997 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
10998 if $test "$intsize" -ge 4; then
11005 #$i_stdlib I_STDLIB
11007 #include <stdlib.h>
11009 #include <sys/types.h>
11010 #include <signal.h>
11011 $signal_t blech(int s) { exit(3); }
11018 signal(SIGFPE, blech);
11020 /* Don't let compiler optimize the test away. Store the number
11021 in a writable string for gcc to pass to sscanf under HP-UX.
11023 sprintf(str, "2147483647");
11024 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
11028 /* x86 processors will probably give 0x8000 0000, which is a
11029 sign change. We don't want that. We want to mimic SPARC
11030 behavior here, which is to preserve the sign and give
11033 if (i32 != ($xxx) f)
11039 if eval $compile_ok; then
11043 echo "(I can't seem to compile the test program--assuming it can't)"
11048 echo "Yup, it can."
11051 echo "Nope, it can't."
11058 : check for ability to cast negative floats to unsigned
11060 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
11063 #$i_stdlib I_STDLIB
11065 #include <stdlib.h>
11067 #include <sys/types.h>
11068 #include <signal.h>
11069 $signal_t blech(int s) { exit(7); }
11070 $signal_t blech_in_list(int s) { exit(4); }
11071 unsigned long dummy_long(unsigned long p) { return p; }
11072 unsigned int dummy_int(unsigned int p) { return p; }
11073 unsigned short dummy_short(unsigned short p) { return p; }
11077 unsigned long along;
11079 unsigned short ashort;
11083 /* Frustrate gcc-2.7.2's optimizer which failed this test with
11084 a direct f = -123. assignment. gcc-2.8.0 reportedly
11085 optimized the whole file away
11087 /* Store the number in a writable string for gcc to pass to
11088 sscanf under HP-UX.
11090 sprintf(str, "-123");
11091 sscanf(str, "%lf", &f); /* f = -123.; */
11093 signal(SIGFPE, blech);
11094 along = (unsigned long)f;
11095 aint = (unsigned int)f;
11096 ashort = (unsigned short)f;
11097 if (along != (unsigned long)-123)
11099 if (aint != (unsigned int)-123)
11101 if (ashort != (unsigned short)-123)
11103 sprintf(str, "1073741824.");
11104 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
11107 along = (unsigned long)f;
11108 if (along != 0x80000000)
11112 along = (unsigned long)f;
11113 if (along != 0x7fffffff)
11117 along = (unsigned long)f;
11118 if (along != 0x80000001)
11122 signal(SIGFPE, blech_in_list);
11123 sprintf(str, "123.");
11124 sscanf(str, "%lf", &f); /* f = 123.; */
11125 along = dummy_long((unsigned long)f);
11126 aint = dummy_int((unsigned int)f);
11127 ashort = dummy_short((unsigned short)f);
11128 if (along != (unsigned long)123)
11130 if (aint != (unsigned int)123)
11132 if (ashort != (unsigned short)123)
11139 if eval $compile_ok; then
11143 echo "(I can't seem to compile the test program--assuming it can't)"
11146 case "$castflags" in
11148 echo "Yup, it can."
11151 echo "Nope, it can't."
11158 : see if vprintf exists
11160 if set vprintf val -f d_vprintf; eval $csym; $val; then
11161 echo 'vprintf() found.' >&4
11164 #$i_stdarg I_STDARG /* Only one of these can be defined by i_varhrd */
11165 #$i_varargs I_VARARGS
11167 #$i_stdlib I_STDLIB
11168 #$i_unistd I_UNISTD
11171 # include <stdarg.h>
11172 #else /* I_VARARGS */
11173 # include <varargs.h>
11177 # include <unistd.h>
11181 # include <stdlib.h>
11184 #include <stdio.h> /* vsprintf prototype */
11187 void xxx(int n, ...)
11192 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11194 int main() { xxx(1, "foo"); }
11196 #else /* I_VARARGS */
11204 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11206 int main() { xxx("foo"); }
11212 if eval $compile_ok; then
11213 if $run ./try; then
11214 echo "Your vsprintf() returns (int)." >&4
11217 echo "Your vsprintf() returns (char*)." >&4
11221 echo 'I am unable to compile the vsprintf() test program.' >&4
11222 # We shouldn't get here. If we do, assume the standard signature,
11223 # not the old BSD one.
11224 echo 'Guessing that vsprintf() returns (int).' >&4
11228 echo 'vprintf() NOT found.' >&4
11239 : see if chown exists
11243 : see if chroot exists
11244 set chroot d_chroot
11247 : see if chsize exists
11248 set chsize d_chsize
11251 : see if class exists
11255 : see if clearenv exists
11256 set clearenv d_clearenv
11259 : Define hasstruct macro for Configure internal use
11260 hasstruct='varname=$1; struct=$2; shift; shift;
11261 while $test $# -ge 2; do
11263 $define) echo "#include <$2>";;
11267 echo "int main () { struct $struct foo; }" >> try.c;
11269 if eval $compile; then
11278 : see whether socket exists
11282 $echo $n "Hmm... $c" >&4
11283 if set socket val -f d_socket; eval $csym; $val; then
11284 echo "Looks like you have Berkeley networking support." >&4
11286 if set setsockopt val -f; eval $csym; $val; then
11289 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
11290 d_oldsock="$define"
11293 if $contains socklib libc.list >/dev/null 2>&1; then
11294 echo "Looks like you have Berkeley networking support." >&4
11296 : we will have to assume that it supports the 4.2 BSD interface
11299 echo "You don't have Berkeley networking in libc$_a..." >&4
11300 if test "X$d_socket" = "X$define"; then
11301 echo "...but you seem to believe that you have sockets." >&4
11303 for net in net socket
11305 if test -f /usr/lib/lib$net$_a; then
11306 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
11307 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
11308 if $contains socket libc.list >/dev/null 2>&1; then
11313 echo "...but the Wollongong group seems to have hacked it in." >&4
11314 sockethdr="-I/usr/netinclude"
11317 echo "Found Berkeley sockets interface in lib$net." >&4
11318 if $contains setsockopt libc.list >/dev/null 2>&1; then
11321 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
11322 d_oldsock="$define"
11328 if test "X$d_socket" != "X$define"; then
11329 echo "or anywhere else I see." >&4
11337 : see if socketpair exists
11338 set socketpair d_sockpair
11343 echo "Checking the availability of certain socket constants..." >&4
11344 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
11345 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
11347 #include <sys/types.h>
11348 #include <sys/socket.h>
11354 set try; if eval $compile; then
11357 set d_${enum}; eval $setvar
11361 : see if this is a sys/uio.h system
11362 set sys/uio.h i_sysuio
11365 : Check for cmsghdr support
11367 echo "Checking to see if your system supports struct cmsghdr..." >&4
11368 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
11370 case "$d_cmsghdr_s" in
11371 "$define") echo "Yes, it does." ;;
11372 *) echo "No, it doesn't." ;;
11376 : check for const keyword
11378 echo 'Checking to see if your C compiler knows about "const"...' >&4
11379 $cat >const.c <<'EOCP'
11380 typedef struct spug { int drokk; } spug;
11384 const spug y = { 0 };
11387 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
11389 echo "Yup, it does."
11392 echo "Nope, it doesn't."
11397 : see if copysignl exists
11398 set copysignl d_copysignl
11401 : see if crypt exists
11406 $define) cryptlib='' ;;
11407 *) if set crypt val -f d_crypt; eval $csym; $val; then
11408 echo 'crypt() found.' >&4
11412 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
11413 if $test -z "$cryptlib"; then
11414 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
11418 if $test -z "$cryptlib"; then
11419 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
11423 if $test -z "$cryptlib"; then
11424 cryptlib=`./loc libcrypt$_a "" $libpth`
11428 if $test -z "$cryptlib"; then
11429 echo 'crypt() NOT found.' >&4
11440 : see if this is a crypt.h system
11441 set crypt.h i_crypt
11444 : see if crypt_r exists
11445 set crypt_r d_crypt_r
11447 case "$d_crypt_r" in
11449 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
11450 case "$d_crypt_r_proto:$usethreads" in
11451 ":define") d_crypt_r_proto=define
11452 set d_crypt_r_proto crypt_r $hdrs
11456 case "$d_crypt_r_proto" in
11458 case "$crypt_r_proto" in
11459 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
11460 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCS ;;
11462 case "$crypt_r_proto" in
11463 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
11464 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCD ;;
11466 case "$crypt_r_proto" in
11467 ''|0) d_crypt_r=undef
11469 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
11470 * ) case "$crypt_r_proto" in
11471 REENTRANT_PROTO*) ;;
11472 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
11474 echo "Prototype: $try" ;;
11477 *) case "$usethreads" in
11478 define) echo "crypt_r has no prototype, not using it." >&4 ;;
11489 : get csh whereabouts
11491 'csh') val="$undef" ;;
11492 *) val="$define" ;;
11496 : Respect a hint or command line value for full_csh.
11497 case "$full_csh" in
11498 '') full_csh=$csh ;;
11501 : see if ctermid exists
11502 set ctermid d_ctermid
11505 : see if ctermid_r exists
11506 set ctermid_r d_ctermid_r
11508 case "$d_ctermid_r" in
11510 hdrs="$i_systypes sys/types.h define stdio.h "
11511 case "$d_ctermid_r_proto:$usethreads" in
11512 ":define") d_ctermid_r_proto=define
11513 set d_ctermid_r_proto ctermid_r $hdrs
11517 case "$d_ctermid_r_proto" in
11519 case "$ctermid_r_proto" in
11520 ''|0) try='char* ctermid_r(char*);'
11521 ./protochk "$extern_C $try" $hdrs && ctermid_r_proto=B_B ;;
11523 case "$ctermid_r_proto" in
11524 ''|0) d_ctermid_r=undef
11526 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
11527 * ) case "$ctermid_r_proto" in
11528 REENTRANT_PROTO*) ;;
11529 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
11531 echo "Prototype: $try" ;;
11534 *) case "$usethreads" in
11535 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
11542 *) ctermid_r_proto=0
11546 : see if ctime_r exists
11547 set ctime_r d_ctime_r
11549 case "$d_ctime_r" in
11551 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
11552 case "$d_ctime_r_proto:$usethreads" in
11553 ":define") d_ctime_r_proto=define
11554 set d_ctime_r_proto ctime_r $hdrs
11558 case "$d_ctime_r_proto" in
11560 case "$ctime_r_proto" in
11561 ''|0) try='char* ctime_r(const time_t*, char*);'
11562 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SB ;;
11564 case "$ctime_r_proto" in
11565 ''|0) try='char* ctime_r(const time_t*, char*, int);'
11566 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SBI ;;
11568 case "$ctime_r_proto" in
11569 ''|0) try='int ctime_r(const time_t*, char*);'
11570 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SB ;;
11572 case "$ctime_r_proto" in
11573 ''|0) try='int ctime_r(const time_t*, char*, int);'
11574 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SBI ;;
11576 case "$ctime_r_proto" in
11577 ''|0) d_ctime_r=undef
11579 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
11580 * ) case "$ctime_r_proto" in
11581 REENTRANT_PROTO*) ;;
11582 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
11584 echo "Prototype: $try" ;;
11587 *) case "$usethreads" in
11588 define) echo "ctime_r has no prototype, not using it." >&4 ;;
11599 : see if cuserid exists
11600 set cuserid d_cuserid
11603 : see if this is a limits.h system
11604 set limits.h i_limits
11607 : see if this is a float.h system
11608 set float.h i_float
11611 : See if number of significant digits in a double precision number is known
11613 $cat >dbl_dig.c <<EOM
11614 #$i_limits I_LIMITS
11617 #include <limits.h>
11623 printf("Contains DBL_DIG");
11626 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
11627 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
11628 echo "DBL_DIG found." >&4
11631 echo "DBL_DIG NOT found." >&4
11638 : see if dbm.h is available
11639 : see if dbmclose exists
11640 set dbmclose d_dbmclose
11643 case "$d_dbmclose" in
11653 *) set rpcsvc/dbm.h i_rpcsvcdbm
11658 *) echo "We won't be including <dbm.h>"
11668 : see if prototype for dbminit is available
11670 set d_dbminitproto dbminit $i_dbm dbm.h
11673 : see if difftime exists
11674 set difftime d_difftime
11677 : see if this is a dirent system
11679 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
11681 echo "<dirent.h> found." >&4
11684 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
11685 echo "<sys/dir.h> found." >&4
11688 xinc=`./findhdr sys/ndir.h`
11690 echo "<dirent.h> NOT found." >&4
11695 : Look for type of directory structure.
11697 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11699 case "$direntrytype" in
11701 case "$i_dirent" in
11702 $define) guess1='struct dirent' ;;
11703 *) guess1='struct direct' ;;
11706 *) guess1="$direntrytype"
11711 'struct dirent') guess2='struct direct' ;;
11712 *) guess2='struct dirent' ;;
11715 if $contains "$guess1" try.c >/dev/null 2>&1; then
11716 direntrytype="$guess1"
11717 echo "Your directory entries are $direntrytype." >&4
11718 elif $contains "$guess2" try.c >/dev/null 2>&1; then
11719 direntrytype="$guess2"
11720 echo "Your directory entries seem to be $direntrytype." >&4
11722 echo "I don't recognize your system's directory entries." >&4
11723 rp="What type is used for directory entries on this system?"
11726 direntrytype="$ans"
11730 : see if the directory entry stores field length
11732 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11733 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
11734 echo "Good, your directory entry keeps length information in d_namlen." >&4
11737 echo "Your directory entry does not know about the d_namlen field." >&4
11744 : Look for DIR.dd_fd
11745 case "$i_dirent" in
11747 echo "Checking to see if DIR has a dd_fd member variable" >&4
11749 #$i_stdlib I_STDLIB
11751 #include <stdlib.h>
11753 #include <dirent.h>
11763 if eval $compile; then
11764 echo "Yes, it does."
11767 echo "No, it does not."
11772 echo "You don't have a <dirent.h>, so not checking for dd_fd." >&4
11780 : see if this is an sysdir system
11781 set sys/dir.h i_sysdir
11784 : see if this is an sysndir system
11785 set sys/ndir.h i_sysndir
11790 $cat >dirfd.c <<EOM
11792 #$i_stdlib I_STDLIB
11794 #include <stdlib.h>
11796 #$i_dirent I_DIRENT /**/
11797 #$i_sysdir I_SYS_DIR /**/
11798 #$i_sysndir I_SYS_NDIR /**/
11799 #$i_systypes I_SYS_TYPES /**/
11800 #if defined(I_SYS_TYPES)
11801 #include <sys/types.h>
11803 #if defined(I_DIRENT)
11804 #include <dirent.h>
11805 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
11806 #include <sys/dir.h>
11810 #include <sys/ndir.h>
11814 #include <ndir.h> /* may be wrong in the future */
11816 #include <sys/dir.h>
11822 DIR *dirp = opendir(".");
11823 if (dirfd(dirp) >= 0)
11831 if eval $compile; then
11835 $define) echo "dirfd() found." >&4 ;;
11836 *) echo "dirfd() NOT found." >&4 ;;
11842 : see if dlerror exists
11845 set dlerror d_dlerror
11849 : see if dlfcn is available
11850 set dlfcn.h i_dlfcn
11853 : Check what extension to use for shared libs
11858 On a few systems, the dynamically loaded modules that perl generates and uses
11859 will need a different extension than shared libs. The default will probably
11865 *) dflt="$dlext" ;;
11867 rp='What is the extension of dynamically loaded modules'
11876 : Check if dlsym need a leading underscore
11882 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
11883 $cat >dyna.c <<'EOM'
11890 #$i_stdlib I_STDLIB
11892 #include <stdlib.h>
11896 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
11898 #include <sys/types.h>
11903 extern int fred() ;
11912 int mode = RTLD_LAZY ;
11914 handle = dlopen("./dyna.$dlext", mode) ;
11915 if (handle == NULL) {
11920 symbol = dlsym(handle, "fred") ;
11921 if (symbol == NULL) {
11922 /* try putting a leading underscore */
11923 symbol = dlsym(handle, "_fred") ;
11924 if (symbol == NULL) {
11937 : Call the object file tmp-dyna.o in case dlext=o.
11938 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
11939 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
11940 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
11941 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
11944 1) echo "Test program failed using dlopen." >&4
11945 echo "Perhaps you should not use dynamic loading." >&4;;
11946 2) echo "Test program failed using dlsym." >&4
11947 echo "Perhaps you should not use dynamic loading." >&4;;
11948 3) echo "dlsym needs a leading underscore" >&4
11950 4) echo "dlsym doesn't need a leading underscore." >&4;;
11953 echo "I can't compile and run the test program." >&4
11954 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
11959 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
11964 : see if drand48_r exists
11965 set drand48_r d_drand48_r
11967 case "$d_drand48_r" in
11969 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
11970 case "$d_drand48_r_proto:$usethreads" in
11971 ":define") d_drand48_r_proto=define
11972 set d_drand48_r_proto drand48_r $hdrs
11976 case "$d_drand48_r_proto" in
11978 case "$drand48_r_proto" in
11979 ''|0) try='int drand48_r(struct drand48_data*, double*);'
11980 ./protochk "$extern_C $try" $hdrs && drand48_r_proto=I_ST ;;
11982 case "$drand48_r_proto" in
11983 ''|0) d_drand48_r=undef
11985 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
11986 * ) case "$drand48_r_proto" in
11987 REENTRANT_PROTO*) ;;
11988 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
11990 echo "Prototype: $try" ;;
11993 *) case "$usethreads" in
11994 define) echo "drand48_r has no prototype, not using it." >&4 ;;
12001 *) drand48_r_proto=0
12005 : see if prototype for drand48 is available
12007 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
12010 : see if dup2 exists
12014 : see if eaccess exists
12015 set eaccess d_eaccess
12018 : see if endgrent exists
12019 set endgrent d_endgrent
12022 : see if this is an grp system
12028 xxx=`./findhdr grp.h`
12029 $cppstdin $cppflags $cppminus < $xxx >$$.h
12031 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
12043 set d_grpasswd; eval $setvar
12047 : see if endgrent_r exists
12048 set endgrent_r d_endgrent_r
12050 case "$d_endgrent_r" in
12052 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12053 case "$d_endgrent_r_proto:$usethreads" in
12054 ":define") d_endgrent_r_proto=define
12055 set d_endgrent_r_proto endgrent_r $hdrs
12059 case "$d_endgrent_r_proto" in
12061 case "$endgrent_r_proto" in
12062 ''|0) try='int endgrent_r(FILE**);'
12063 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=I_H ;;
12065 case "$endgrent_r_proto" in
12066 ''|0) try='void endgrent_r(FILE**);'
12067 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=V_H ;;
12069 case "$endgrent_r_proto" in
12070 ''|0) d_endgrent_r=undef
12072 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
12073 * ) case "$endgrent_r_proto" in
12074 REENTRANT_PROTO*) ;;
12075 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
12077 echo "Prototype: $try" ;;
12080 *) case "$usethreads" in
12081 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
12088 *) endgrent_r_proto=0
12092 : see if endhostent exists
12093 set endhostent d_endhent
12096 : see if this is a netdb.h system
12097 set netdb.h i_netdb
12100 : see if endhostent_r exists
12101 set endhostent_r d_endhostent_r
12103 case "$d_endhostent_r" in
12105 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12106 case "$d_endhostent_r_proto:$usethreads" in
12107 ":define") d_endhostent_r_proto=define
12108 set d_endhostent_r_proto endhostent_r $hdrs
12112 case "$d_endhostent_r_proto" in
12114 case "$endhostent_r_proto" in
12115 ''|0) try='int endhostent_r(struct hostent_data*);'
12116 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=I_D ;;
12118 case "$endhostent_r_proto" in
12119 ''|0) try='void endhostent_r(struct hostent_data*);'
12120 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=V_D ;;
12122 case "$endhostent_r_proto" in
12123 ''|0) d_endhostent_r=undef
12124 endhostent_r_proto=0
12125 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
12126 * ) case "$endhostent_r_proto" in
12127 REENTRANT_PROTO*) ;;
12128 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
12130 echo "Prototype: $try" ;;
12133 *) case "$usethreads" in
12134 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
12136 d_endhostent_r=undef
12137 endhostent_r_proto=0
12141 *) endhostent_r_proto=0
12145 : see if endnetent exists
12146 set endnetent d_endnent
12149 : see if endnetent_r exists
12150 set endnetent_r d_endnetent_r
12152 case "$d_endnetent_r" in
12154 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12155 case "$d_endnetent_r_proto:$usethreads" in
12156 ":define") d_endnetent_r_proto=define
12157 set d_endnetent_r_proto endnetent_r $hdrs
12161 case "$d_endnetent_r_proto" in
12163 case "$endnetent_r_proto" in
12164 ''|0) try='int endnetent_r(struct netent_data*);'
12165 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=I_D ;;
12167 case "$endnetent_r_proto" in
12168 ''|0) try='void endnetent_r(struct netent_data*);'
12169 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=V_D ;;
12171 case "$endnetent_r_proto" in
12172 ''|0) d_endnetent_r=undef
12173 endnetent_r_proto=0
12174 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
12175 * ) case "$endnetent_r_proto" in
12176 REENTRANT_PROTO*) ;;
12177 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
12179 echo "Prototype: $try" ;;
12182 *) case "$usethreads" in
12183 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
12185 d_endnetent_r=undef
12186 endnetent_r_proto=0
12190 *) endnetent_r_proto=0
12194 : see if endprotoent exists
12195 set endprotoent d_endpent
12198 : see if endprotoent_r exists
12199 set endprotoent_r d_endprotoent_r
12201 case "$d_endprotoent_r" in
12203 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12204 case "$d_endprotoent_r_proto:$usethreads" in
12205 ":define") d_endprotoent_r_proto=define
12206 set d_endprotoent_r_proto endprotoent_r $hdrs
12210 case "$d_endprotoent_r_proto" in
12212 case "$endprotoent_r_proto" in
12213 ''|0) try='int endprotoent_r(struct protoent_data*);'
12214 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=I_D ;;
12216 case "$endprotoent_r_proto" in
12217 ''|0) try='void endprotoent_r(struct protoent_data*);'
12218 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=V_D ;;
12220 case "$endprotoent_r_proto" in
12221 ''|0) d_endprotoent_r=undef
12222 endprotoent_r_proto=0
12223 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
12224 * ) case "$endprotoent_r_proto" in
12225 REENTRANT_PROTO*) ;;
12226 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
12228 echo "Prototype: $try" ;;
12231 *) case "$usethreads" in
12232 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
12234 d_endprotoent_r=undef
12235 endprotoent_r_proto=0
12239 *) endprotoent_r_proto=0
12243 : see if endpwent exists
12244 set endpwent d_endpwent
12247 : see if this is a pwd.h system
12253 xxx=`./findhdr pwd.h`
12254 $cppstdin $cppflags $cppminus < $xxx >$$.h
12256 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
12264 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
12272 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
12280 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
12288 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
12296 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
12304 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
12312 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
12324 set d_pwquota; eval $setvar
12325 set d_pwage; eval $setvar
12326 set d_pwchange; eval $setvar
12327 set d_pwclass; eval $setvar
12328 set d_pwexpire; eval $setvar
12329 set d_pwcomment; eval $setvar
12330 set d_pwgecos; eval $setvar
12331 set d_pwpasswd; eval $setvar
12335 : see if endpwent_r exists
12336 set endpwent_r d_endpwent_r
12338 case "$d_endpwent_r" in
12340 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
12341 case "$d_endpwent_r_proto:$usethreads" in
12342 ":define") d_endpwent_r_proto=define
12343 set d_endpwent_r_proto endpwent_r $hdrs
12347 case "$d_endpwent_r_proto" in
12349 case "$endpwent_r_proto" in
12350 ''|0) try='int endpwent_r(FILE**);'
12351 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=I_H ;;
12353 case "$endpwent_r_proto" in
12354 ''|0) try='void endpwent_r(FILE**);'
12355 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=V_H ;;
12357 case "$endpwent_r_proto" in
12358 ''|0) d_endpwent_r=undef
12360 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
12361 * ) case "$endpwent_r_proto" in
12362 REENTRANT_PROTO*) ;;
12363 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
12365 echo "Prototype: $try" ;;
12368 *) case "$usethreads" in
12369 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
12376 *) endpwent_r_proto=0
12380 : see if endservent exists
12381 set endservent d_endsent
12384 : see if endservent_r exists
12385 set endservent_r d_endservent_r
12387 case "$d_endservent_r" in
12389 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12390 case "$d_endservent_r_proto:$usethreads" in
12391 ":define") d_endservent_r_proto=define
12392 set d_endservent_r_proto endservent_r $hdrs
12396 case "$d_endservent_r_proto" in
12398 case "$endservent_r_proto" in
12399 ''|0) try='int endservent_r(struct servent_data*);'
12400 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=I_D ;;
12402 case "$endservent_r_proto" in
12403 ''|0) try='void endservent_r(struct servent_data*);'
12404 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=V_D ;;
12406 case "$endservent_r_proto" in
12407 ''|0) d_endservent_r=undef
12408 endservent_r_proto=0
12409 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
12410 * ) case "$endservent_r_proto" in
12411 REENTRANT_PROTO*) ;;
12412 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
12414 echo "Prototype: $try" ;;
12417 *) case "$usethreads" in
12418 define) echo "endservent_r has no prototype, not using it." >&4 ;;
12420 d_endservent_r=undef
12421 endservent_r_proto=0
12425 *) endservent_r_proto=0
12429 : Locate the flags for 'open()'
12432 #include <sys/types.h>
12437 #include <sys/file.h>
12439 #$i_stdlib I_STDLIB
12441 #include <stdlib.h>
12452 : check sys/file.h first to get FREAD on Sun
12453 if $test `./findhdr sys/file.h` && \
12454 set try -DI_SYS_FILE && eval $compile; then
12456 echo "<sys/file.h> defines the O_* constants..." >&4
12457 if $run ./try; then
12458 echo "and you have the 3 argument form of open()." >&4
12461 echo "but not the 3 argument form of open(). Oh, well." >&4
12464 elif $test `./findhdr fcntl.h` && \
12465 set try -DI_FCNTL && eval $compile; then
12467 echo "<fcntl.h> defines the O_* constants..." >&4
12468 if $run ./try; then
12469 echo "and you have the 3 argument form of open()." >&4
12472 echo "but not the 3 argument form of open(). Oh, well." >&4
12477 echo "I can't find the O_* constant definitions! You got problems." >&4
12483 : see if this is a sys/file.h system
12488 : do we need to include sys/file.h ?
12492 if $h_sysfile; then
12494 echo "We'll be including <sys/file.h>." >&4
12497 echo "We won't be including <sys/file.h>." >&4
12507 : see if fcntl.h is there
12512 : see if we can include fcntl.h
12518 echo "We'll be including <fcntl.h>." >&4
12521 if $h_sysfile; then
12522 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
12524 echo "We won't be including <fcntl.h>." >&4
12536 : see if fork exists
12540 : see if pipe exists
12544 : check for non-blocking I/O stuff
12545 case "$h_sysfile" in
12546 true) echo "#include <sys/file.h>" > head.c;;
12549 true) echo "#include <fcntl.h>" > head.c;;
12550 *) echo "#include <sys/fcntl.h>" > head.c;;
12555 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
12556 case "$o_nonblock" in
12558 $cat head.c > try.c
12559 $cat >>try.c <<EOCP
12561 #$i_stdlib I_STDLIB
12563 #include <stdlib.h>
12571 printf("O_NONBLOCK\n");
12575 printf("O_NDELAY\n");
12579 printf("FNDELAY\n");
12586 if eval $compile_ok; then
12587 o_nonblock=`$run ./try`
12588 case "$o_nonblock" in
12589 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
12590 *) echo "Seems like we can use $o_nonblock.";;
12593 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
12596 *) echo "Using $hint value $o_nonblock.";;
12601 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
12604 case "$d_fork:$d_pipe" in
12606 $cat head.c > try.c
12607 $cat >>try.c <<EOCP
12609 #include <sys/types.h>
12610 #include <signal.h>
12612 #$i_stdlib I_STDLIB
12614 #include <stdlib.h>
12620 #define MY_O_NONBLOCK $o_nonblock
12621 #ifndef errno /* XXX need better Configure test */
12624 #$i_unistd I_UNISTD
12626 #include <unistd.h>
12628 #$i_string I_STRING
12630 #include <string.h>
12632 #include <strings.h>
12634 $signal_t blech(int x) { exit(3); }
12636 $cat >> try.c <<'EOCP'
12644 pipe(pd); /* Down: child -> parent */
12645 pipe(pu); /* Up: parent -> child */
12648 close(pd[1]); /* Parent reads from pd[0] */
12649 close(pu[0]); /* Parent writes (blocking) to pu[1] */
12651 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
12656 signal(SIGALRM, blech);
12658 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
12660 sprintf(string, "%d\n", ret);
12661 write(2, string, strlen(string));
12664 if (errno == EAGAIN) {
12665 printf("EAGAIN\n");
12670 if (errno == EWOULDBLOCK)
12671 printf("EWOULDBLOCK\n");
12674 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
12675 sleep(2); /* Give it time to close our pipe */
12677 ret = read(pd[0], buf, 1); /* Should read EOF */
12679 sprintf(string, "%d\n", ret);
12680 write(4, string, strlen(string));
12684 close(pd[0]); /* We write to pd[1] */
12685 close(pu[1]); /* We read from pu[0] */
12686 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
12687 close(pd[1]); /* Pipe pd is now fully closed! */
12688 exit(0); /* Bye bye, thank you for playing! */
12692 if eval $compile_ok; then
12693 echo "$startsh" >mtry
12694 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
12696 ./mtry >/dev/null 2>&1
12698 0) eagain=`$cat try.out`;;
12699 1) echo "Could not perform non-blocking setting!";;
12700 2) echo "I did a successful read() for something that was not there!";;
12701 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
12702 4) echo "Could not find F_SETFL!";;
12703 *) echo "Something terribly wrong happened during testing.";;
12705 rd_nodata=`$cat try.ret`
12706 echo "A read() system call with no data present returns $rd_nodata."
12707 case "$rd_nodata" in
12710 echo "(That's peculiar, fixing that to be -1.)"
12716 echo "Forcing errno EAGAIN on read() with no data available."
12720 echo "Your read() sets errno to $eagain when no data is available."
12723 status=`$cat try.err`
12725 0) echo "And it correctly returns 0 to signal EOF.";;
12726 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
12727 *) echo "However, your read() returns '$status' on EOF??";;
12730 if test "$status" = "$rd_nodata"; then
12731 echo "WARNING: you can't distinguish between EOF and no data!"
12735 echo "I can't compile the test program--assuming errno EAGAIN will do."
12739 *) echo "Can't figure out how to test this--assuming errno EAGAIN will do."
12748 echo "Using $hint value $eagain."
12749 echo "Your read() returns $rd_nodata when no data is present."
12750 case "$d_eofnblk" in
12751 "$define") echo "And you can see EOF because read() returns 0.";;
12752 "$undef") echo "But you can't see EOF status from read() returned value.";;
12754 echo "(Assuming you can't see EOF status from read anyway.)"
12760 $rm_try head.c mtry
12762 : see if _ptr and _cnt from stdio act std
12765 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
12766 echo "(Looks like you have stdio.h from BSD.)"
12767 case "$stdio_ptr" in
12768 '') stdio_ptr='((fp)->_p)'
12771 *) ptr_lval=$d_stdio_ptr_lval;;
12773 case "$stdio_cnt" in
12774 '') stdio_cnt='((fp)->_r)'
12777 *) cnt_lval=$d_stdio_cnt_lval;;
12779 case "$stdio_base" in
12780 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
12782 case "$stdio_bufsiz" in
12783 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
12785 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
12786 echo "(Looks like you have stdio.h from Linux.)"
12787 case "$stdio_ptr" in
12788 '') stdio_ptr='((fp)->_IO_read_ptr)'
12791 *) ptr_lval=$d_stdio_ptr_lval;;
12793 case "$stdio_cnt" in
12794 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
12797 *) cnt_lval=$d_stdio_cnt_lval;;
12799 case "$stdio_base" in
12800 '') stdio_base='((fp)->_IO_read_base)';;
12802 case "$stdio_bufsiz" in
12803 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
12806 case "$stdio_ptr" in
12807 '') stdio_ptr='((fp)->_ptr)'
12810 *) ptr_lval=$d_stdio_ptr_lval;;
12812 case "$stdio_cnt" in
12813 '') stdio_cnt='((fp)->_cnt)'
12816 *) cnt_lval=$d_stdio_cnt_lval;;
12818 case "$stdio_base" in
12819 '') stdio_base='((fp)->_base)';;
12821 case "$stdio_bufsiz" in
12822 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
12826 : test whether _ptr and _cnt really work
12827 echo "Checking how std your stdio is..." >&4
12830 #$i_stdlib I_STDLIB
12832 #include <stdlib.h>
12834 #define FILE_ptr(fp) $stdio_ptr
12835 #define FILE_cnt(fp) $stdio_cnt
12837 FILE *fp = fopen("try.c", "r");
12840 18 <= FILE_cnt(fp) &&
12841 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12849 if eval $compile && $to try.c; then
12850 if $run ./try; then
12851 echo "Your stdio acts pretty std."
12854 echo "Your stdio isn't very std."
12857 echo "Your stdio doesn't appear very std."
12861 # glibc 2.2.90 and above apparently change stdio streams so Perl's
12862 # direct buffer manipulation no longer works. The Configure tests
12863 # should be changed to correctly detect this, but until then,
12864 # the following check should at least let perl compile and run.
12865 # (This quick fix should be updated before 5.8.1.)
12866 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
12867 # A. Dougherty, June 3, 2002.
12868 case "$d_gnulibc" in
12870 case "$gnulibc_version" in
12874 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
12883 : Can _ptr be used as an lvalue?
12884 case "$d_stdstdio$ptr_lval" in
12885 $define$define) val=$define ;;
12888 set d_stdio_ptr_lval
12891 : Can _cnt be used as an lvalue?
12892 case "$d_stdstdio$cnt_lval" in
12893 $define$define) val=$define ;;
12896 set d_stdio_cnt_lval
12900 : test whether setting _ptr sets _cnt as a side effect
12901 d_stdio_ptr_lval_sets_cnt="$undef"
12902 d_stdio_ptr_lval_nochange_cnt="$undef"
12903 case "$d_stdio_ptr_lval$d_stdstdio" in
12905 echo "Checking to see what happens if we set the stdio ptr..." >&4
12908 /* Can we scream? */
12909 /* Eat dust sed :-) */
12910 /* In the buffer space, no one can hear you scream. */
12911 #$i_stdlib I_STDLIB
12913 #include <stdlib.h>
12915 #define FILE_ptr(fp) $stdio_ptr
12916 #define FILE_cnt(fp) $stdio_cnt
12917 #include <sys/types.h>
12919 FILE *fp = fopen("try.c", "r");
12924 puts("Fail even to read");
12927 c = getc(fp); /* Read away the first # */
12929 puts("Fail even to read");
12933 18 <= FILE_cnt(fp) &&
12934 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12936 puts("Fail even to read");
12939 ptr = (char*) FILE_ptr(fp);
12940 cnt = (size_t)FILE_cnt(fp);
12942 FILE_ptr(fp) += 42;
12944 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
12945 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
12948 if (FILE_cnt(fp) <= 20) {
12949 printf ("Fail (<20 chars to test)");
12952 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
12953 puts("Fail compare");
12956 if (cnt == FILE_cnt(fp)) {
12957 puts("Pass_unchanged");
12960 if (FILE_cnt(fp) == (cnt - 42)) {
12961 puts("Pass_changed");
12964 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
12970 if eval $compile && $to try.c; then
12971 case `$run ./try` in
12973 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
12974 d_stdio_ptr_lval_sets_cnt="$define" ;;
12976 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
12977 d_stdio_ptr_lval_nochange_cnt="$define" ;;
12979 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
12981 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
12984 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
12990 : see if _base is also standard
12992 case "$d_stdstdio" in
12996 #$i_stdlib I_STDLIB
12998 #include <stdlib.h>
13000 #define FILE_base(fp) $stdio_base
13001 #define FILE_bufsiz(fp) $stdio_bufsiz
13003 FILE *fp = fopen("try.c", "r");
13006 19 <= FILE_bufsiz(fp) &&
13007 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
13014 if eval $compile && $to try.c; then
13015 if $run ./try; then
13016 echo "And its _base field acts std."
13019 echo "But its _base field isn't std."
13022 echo "However, it seems to be lacking the _base field."
13030 : see if fast_stdio exists
13032 case "$d_stdstdio:$d_stdio_ptr_lval" in
13034 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
13036 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
13047 : see if fchdir exists
13048 set fchdir d_fchdir
13051 : see if fchmod exists
13052 set fchmod d_fchmod
13055 : see if fchown exists
13056 set fchown d_fchown
13059 : see if this is an fcntl system
13063 : See if fcntl-based locking works.
13066 #$i_stdlib I_STDLIB
13068 #include <stdlib.h>
13070 #include <unistd.h>
13072 #include <signal.h>
13073 $signal_t blech(int x) { exit(3); }
13075 #if defined(F_SETLK) && defined(F_SETLKW)
13076 struct flock flock;
13078 fd = open("try.c", O_RDONLY);
13079 flock.l_type = F_RDLCK;
13080 flock.l_whence = SEEK_SET;
13081 flock.l_start = flock.l_len = 0;
13082 signal(SIGALRM, blech);
13084 retval = fcntl(fd, F_SETLK, &flock);
13086 (retval < 0 ? exit(2) : exit(0));
13092 echo "Checking if fcntl-based file locking works... "
13096 if eval $compile_ok; then
13097 if $run ./try; then
13098 echo "Yes, it seems to work."
13101 echo "Nope, it didn't work."
13106 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
13107 *** This is (almost) impossible.
13108 *** If your NFS lock daemons are not feeling well, something like
13109 *** this may happen, please investigate. Cannot continue, aborting.
13117 echo "I'm unable to compile the test program, so I'll assume not."
13122 echo "Nope, since you don't even have fcntl()."
13125 set d_fcntl_can_lock
13129 : check for fd_set items
13132 Checking to see how well your C compiler handles fd_set and friends ...
13135 #$i_stdlib I_STDLIB
13137 #include <stdlib.h>
13139 #$i_systime I_SYS_TIME
13140 #$i_sysselct I_SYS_SELECT
13141 #$d_socket HAS_SOCKET
13142 #include <sys/types.h>
13144 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
13147 #include <sys/time.h>
13149 #ifdef I_SYS_SELECT
13150 #include <sys/select.h>
13159 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
13167 if eval $compile; then
13168 d_fds_bits="$define"
13170 echo "Well, your system knows about the normal fd_set typedef..." >&4
13171 if $run ./try; then
13172 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
13173 d_fd_macros="$define"
13176 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
13178 d_fd_macros="$undef"
13182 Hmm, your compiler has some difficulty with fd_set. Checking further...
13185 if eval $compile; then
13186 d_fds_bits="$undef"
13188 echo "Well, your system has some sort of fd_set available..." >&4
13189 if $run ./try; then
13190 echo "and you have the normal fd_set macros." >&4
13191 d_fd_macros="$define"
13194 but not the normal fd_set macros! Gross! More work for me...
13196 d_fd_macros="$undef"
13199 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
13201 d_fds_bits="$undef"
13202 d_fd_macros="$undef"
13207 : see if fgetpos exists
13208 set fgetpos d_fgetpos
13211 : see if finite exists
13212 set finite d_finite
13215 : see if finitel exists
13216 set finitel d_finitel
13219 : see if flock exists
13223 : see if prototype for flock is available
13225 set d_flockproto flock $i_sysfile sys/file.h
13228 : see if fp_class exists
13229 set fp_class d_fp_class
13232 : see if pathconf exists
13233 set pathconf d_pathconf
13236 : see if fpathconf exists
13237 set fpathconf d_fpathconf
13240 : see if fpclass exists
13241 set fpclass d_fpclass
13244 : see if fpclassify exists
13245 set fpclassify d_fpclassify
13248 : see if fpclassl exists
13249 set fpclassl d_fpclassl
13252 : check for fpos64_t
13254 echo "Checking to see if you have fpos64_t..." >&4
13257 int main() { fpos64_t x = 7; }
13260 if eval $compile; then
13262 echo "You have fpos64_t."
13265 echo "You do not have fpos64_t."
13266 case "$fpossize" in
13267 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
13274 : see if frexpl exists
13275 set frexpl d_frexpl
13278 : see if this is a sys/param system
13279 set sys/param.h i_sysparam
13282 : see if this is a sys/mount.h system
13283 set sys/mount.h i_sysmount
13286 : Check for fs_data_s
13288 echo "Checking to see if your system supports struct fs_data..." >&4
13289 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
13291 case "$d_fs_data_s" in
13292 "$define") echo "Yes, it does." ;;
13293 *) echo "No, it doesn't." ;;
13296 : see if fseeko exists
13297 set fseeko d_fseeko
13299 case "$longsize" in
13300 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
13303 : see if fsetpos exists
13304 set fsetpos d_fsetpos
13307 : see if fstatfs exists
13308 set fstatfs d_fstatfs
13311 : see if statvfs exists
13312 set statvfs d_statvfs
13315 : see if fstatvfs exists
13316 set fstatvfs d_fstatvfs
13320 : see if fsync exists
13324 : see if ftello exists
13325 set ftello d_ftello
13327 case "$longsize" in
13328 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
13331 : check for a working futimes
13334 echo "Checking if you have a working futimes()" >&4
13337 #include <sys/time.h>
13344 fd = open ("try.c", O_RDWR);
13345 if (-1 == fd) exit (1);
13346 rv = futimes (fd, NULL);
13347 exit (rv == -1 ? errno : 0);
13351 if eval $compile; then
13355 0) echo "Yes, you have" >&4
13356 d_futimes="$define"
13358 *) echo "No, you have futimes, but it isn't working ($rc) (probably harmless)" >&4
13362 echo "No, it does not (probably harmless)" >&4
13366 : see if ndbm.h is available
13369 : Compatibility location for RedHat 7.1
13370 set gdbm/ndbm.h i_gdbmndbm
13372 : Compatibility location for Debian 4.0
13373 set gdbm-ndbm.h i_gdbm_ndbm
13377 if $test "$i_ndbm" = "$define" -o "$i_gdbmndbm" = "$define" -o "$i_gdbm_ndbm" = "$define"; then
13378 : see if dbm_open exists
13379 set dbm_open d_dbm_open
13381 case "$d_dbm_open" in
13384 i_gdbmndbm="$undef"
13385 i_gdbm_ndbm="$undef"
13386 echo "We won't be including <ndbm.h>"
13396 ndbm_hdr_protochk='name=$1; hdr=$2;
13397 eval "ihdr=\$""i_$name";
13399 if $test "$ihdr" = "$define"; then
13400 $echo "Checking if your <$hdr> uses prototypes..." >&4;
13401 case "$d_cplusplus" in
13402 $define) ./protochk "$extern_C void dbm_close(DBM *);" literal "extern \"C\" {" $ihdr $hdr literal "}" && val="$define" ;;
13403 *) ./protochk "$extern_C void dbm_close(int, int);" $ihdr $hdr || val="$define" ;;
13406 $define) $echo "Your <$hdr> seems to have prototypes";;
13407 *) $echo "Your <$hdr> does not seem to have prototypes";;
13410 set "d_${name}_h_uses_prototypes";
13414 eval $ndbm_hdr_protochk
13415 set gdbmndbm gdbm/ndbm.h
13416 eval $ndbm_hdr_protochk
13417 set gdbm_ndbm gdbm-ndbm.h
13418 eval $ndbm_hdr_protochk
13420 : see if getaddrinfo exists
13421 set getaddrinfo d_getaddrinfo
13424 : see if getcwd exists
13425 set getcwd d_getcwd
13428 : see if getespwnam exists
13429 set getespwnam d_getespwnam
13432 : see if getfsstat exists
13433 set getfsstat d_getfsstat
13436 : see if getgrent exists
13437 set getgrent d_getgrent
13440 : see if getgrent_r exists
13441 set getgrent_r d_getgrent_r
13443 case "$d_getgrent_r" in
13445 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13446 case "$d_getgrent_r_proto:$usethreads" in
13447 ":define") d_getgrent_r_proto=define
13448 set d_getgrent_r_proto getgrent_r $hdrs
13452 case "$d_getgrent_r_proto" in
13454 case "$getgrent_r_proto" in
13455 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
13456 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBWR ;;
13458 case "$getgrent_r_proto" in
13459 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
13460 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIR ;;
13462 case "$getgrent_r_proto" in
13463 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
13464 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBW ;;
13466 case "$getgrent_r_proto" in
13467 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
13468 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBI ;;
13470 case "$getgrent_r_proto" in
13471 ''|0) try='int getgrent_r(struct group*, char*, int);'
13472 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBI ;;
13474 case "$getgrent_r_proto" in
13475 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
13476 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIH ;;
13478 case "$getgrent_r_proto" in
13479 ''|0) d_getgrent_r=undef
13481 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
13482 * ) case "$getgrent_r_proto" in
13483 REENTRANT_PROTO*) ;;
13484 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
13486 echo "Prototype: $try" ;;
13489 *) case "$usethreads" in
13490 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
13497 *) getgrent_r_proto=0
13501 : see if getgrgid_r exists
13502 set getgrgid_r d_getgrgid_r
13504 case "$d_getgrgid_r" in
13506 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13507 case "$d_getgrgid_r_proto:$usethreads" in
13508 ":define") d_getgrgid_r_proto=define
13509 set d_getgrgid_r_proto getgrgid_r $hdrs
13513 case "$d_getgrgid_r_proto" in
13515 case "$getgrgid_r_proto" in
13516 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
13517 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
13519 case "$getgrgid_r_proto" in
13520 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
13521 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
13523 case "$getgrgid_r_proto" in
13524 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
13525 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
13527 case "$getgrgid_r_proto" in
13528 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
13529 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
13531 case "$getgrgid_r_proto" in
13532 ''|0) d_getgrgid_r=undef
13534 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
13535 * ) case "$getgrgid_r_proto" in
13536 REENTRANT_PROTO*) ;;
13537 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
13539 echo "Prototype: $try" ;;
13542 *) case "$usethreads" in
13543 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
13550 *) getgrgid_r_proto=0
13554 : see if getgrnam_r exists
13555 set getgrnam_r d_getgrnam_r
13557 case "$d_getgrnam_r" in
13559 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13560 case "$d_getgrnam_r_proto:$usethreads" in
13561 ":define") d_getgrnam_r_proto=define
13562 set d_getgrnam_r_proto getgrnam_r $hdrs
13566 case "$d_getgrnam_r_proto" in
13568 case "$getgrnam_r_proto" in
13569 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
13570 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
13572 case "$getgrnam_r_proto" in
13573 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
13574 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
13576 case "$getgrnam_r_proto" in
13577 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
13578 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CBI ;;
13580 case "$getgrnam_r_proto" in
13581 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
13582 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
13584 case "$getgrnam_r_proto" in
13585 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
13586 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
13588 case "$getgrnam_r_proto" in
13589 ''|0) d_getgrnam_r=undef
13591 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
13592 * ) case "$getgrnam_r_proto" in
13593 REENTRANT_PROTO*) ;;
13594 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
13596 echo "Prototype: $try" ;;
13599 *) case "$usethreads" in
13600 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
13607 *) getgrnam_r_proto=0
13611 : see if gethostbyaddr exists
13612 set gethostbyaddr d_gethbyaddr
13615 : see if gethostbyname exists
13616 set gethostbyname d_gethbyname
13619 : see if gethostent exists
13620 set gethostent d_gethent
13623 : see how we will look up host name
13626 if set gethostname val -f d_gethname; eval $csym; $val; then
13627 echo 'gethostname() found.' >&4
13628 d_gethname="$define"
13631 if set uname val -f d_uname; eval $csym; $val; then
13634 uname() was found, but you're running xenix, and older versions of xenix
13635 have a broken uname(). If you don't really know whether your xenix is old
13636 enough to have a broken system call, use the default answer.
13641 "$define") dflt=n;;
13643 rp='Is your uname() broken?'
13646 n*) d_uname="$define"; call=uname;;
13649 echo 'uname() found.' >&4
13656 case "$d_gethname" in
13657 '') d_gethname="$undef";;
13660 '') d_uname="$undef";;
13662 case "$d_uname$d_gethname" in
13667 Every now and then someone has a $call() that lies about the hostname
13668 but can't be fixed for political or economic reasons. If you wish, I can
13669 pretend $call() isn't there and maybe compute hostname at run-time
13670 thanks to the '$phostname' command.
13673 rp="Shall I ignore $call() from now on?"
13676 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
13679 case "$phostname" in
13680 '') aphostname='';;
13681 *) case "$aphostname" in
13683 *) set X $phostname
13687 file=`./loc $file $file $pth`
13688 aphostname=`echo $file $*`
13693 case "$d_uname$d_gethname" in
13696 case "$phostname" in
13698 echo "There will be no way for $package to get your hostname." >&4;;
13700 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
13704 case "$d_phostname" in
13705 '') d_phostname="$undef";;
13708 : see if gethostbyaddr_r exists
13709 set gethostbyaddr_r d_gethostbyaddr_r
13711 case "$d_gethostbyaddr_r" in
13713 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13714 case "$d_gethostbyaddr_r_proto:$usethreads" in
13715 ":define") d_gethostbyaddr_r_proto=define
13716 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
13720 case "$d_gethostbyaddr_r_proto" in
13722 case "$gethostbyaddr_r_proto" in
13723 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13724 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
13726 case "$gethostbyaddr_r_proto" in
13727 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
13728 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
13730 case "$gethostbyaddr_r_proto" in
13731 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
13732 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
13734 case "$gethostbyaddr_r_proto" in
13735 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
13736 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
13738 case "$gethostbyaddr_r_proto" in
13739 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
13740 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
13742 case "$gethostbyaddr_r_proto" in
13743 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
13744 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
13746 case "$gethostbyaddr_r_proto" in
13747 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
13748 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
13750 case "$gethostbyaddr_r_proto" in
13751 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
13752 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
13754 case "$gethostbyaddr_r_proto" in
13755 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
13756 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
13758 case "$gethostbyaddr_r_proto" in
13759 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
13760 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
13762 case "$gethostbyaddr_r_proto" in
13763 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13764 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
13766 case "$gethostbyaddr_r_proto" in
13767 ''|0) d_gethostbyaddr_r=undef
13768 gethostbyaddr_r_proto=0
13769 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
13770 * ) case "$gethostbyaddr_r_proto" in
13771 REENTRANT_PROTO*) ;;
13772 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
13774 echo "Prototype: $try" ;;
13777 *) case "$usethreads" in
13778 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
13780 d_gethostbyaddr_r=undef
13781 gethostbyaddr_r_proto=0
13785 *) gethostbyaddr_r_proto=0
13789 : see if gethostbyname_r exists
13790 set gethostbyname_r d_gethostbyname_r
13792 case "$d_gethostbyname_r" in
13794 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13795 case "$d_gethostbyname_r_proto:$usethreads" in
13796 ":define") d_gethostbyname_r_proto=define
13797 set d_gethostbyname_r_proto gethostbyname_r $hdrs
13801 case "$d_gethostbyname_r_proto" in
13803 case "$gethostbyname_r_proto" in
13804 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
13805 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
13807 case "$gethostbyname_r_proto" in
13808 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
13809 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
13811 case "$gethostbyname_r_proto" in
13812 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
13813 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
13815 case "$gethostbyname_r_proto" in
13816 ''|0) d_gethostbyname_r=undef
13817 gethostbyname_r_proto=0
13818 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
13819 * ) case "$gethostbyname_r_proto" in
13820 REENTRANT_PROTO*) ;;
13821 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
13823 echo "Prototype: $try" ;;
13826 *) case "$usethreads" in
13827 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
13829 d_gethostbyname_r=undef
13830 gethostbyname_r_proto=0
13834 *) gethostbyname_r_proto=0
13838 : see if gethostent_r exists
13839 set gethostent_r d_gethostent_r
13841 case "$d_gethostent_r" in
13843 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13844 case "$d_gethostent_r_proto:$usethreads" in
13845 ":define") d_gethostent_r_proto=define
13846 set d_gethostent_r_proto gethostent_r $hdrs
13850 case "$d_gethostent_r_proto" in
13852 case "$gethostent_r_proto" in
13853 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
13854 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
13856 case "$gethostent_r_proto" in
13857 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
13858 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBIE ;;
13860 case "$gethostent_r_proto" in
13861 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
13862 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBIE ;;
13864 case "$gethostent_r_proto" in
13865 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
13866 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBI ;;
13868 case "$gethostent_r_proto" in
13869 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
13870 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBI ;;
13872 case "$gethostent_r_proto" in
13873 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
13874 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SD ;;
13876 case "$gethostent_r_proto" in
13877 ''|0) d_gethostent_r=undef
13878 gethostent_r_proto=0
13879 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
13880 * ) case "$gethostent_r_proto" in
13881 REENTRANT_PROTO*) ;;
13882 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
13884 echo "Prototype: $try" ;;
13887 *) case "$usethreads" in
13888 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
13890 d_gethostent_r=undef
13891 gethostent_r_proto=0
13895 *) gethostent_r_proto=0
13899 : see if prototypes for various gethostxxx netdb.h functions are available
13901 set d_gethostprotos gethostent $i_netdb netdb.h
13904 : see if getitimer exists
13905 set getitimer d_getitimer
13908 : see if getlogin exists
13909 set getlogin d_getlogin
13912 : see if getlogin_r exists
13913 set getlogin_r d_getlogin_r
13915 case "$d_getlogin_r" in
13917 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
13918 case "$d_getlogin_r_proto:$usethreads" in
13919 ":define") d_getlogin_r_proto=define
13920 set d_getlogin_r_proto getlogin_r $hdrs
13924 case "$d_getlogin_r_proto" in
13926 case "$getlogin_r_proto" in
13927 ''|0) try='int getlogin_r(char*, size_t);'
13928 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BW ;;
13930 case "$getlogin_r_proto" in
13931 ''|0) try='int getlogin_r(char*, int);'
13932 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BI ;;
13934 case "$getlogin_r_proto" in
13935 ''|0) try='char* getlogin_r(char*, size_t);'
13936 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BW ;;
13938 case "$getlogin_r_proto" in
13939 ''|0) try='char* getlogin_r(char*, int);'
13940 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BI ;;
13942 case "$getlogin_r_proto" in
13943 ''|0) d_getlogin_r=undef
13945 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
13946 * ) case "$getlogin_r_proto" in
13947 REENTRANT_PROTO*) ;;
13948 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
13950 echo "Prototype: $try" ;;
13953 *) case "$usethreads" in
13954 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
13961 *) getlogin_r_proto=0
13965 : see if getmnt exists
13966 set getmnt d_getmnt
13969 : see if getmntent exists
13970 set getmntent d_getmntent
13973 : see if getnameinfo exists
13974 set getnameinfo d_getnameinfo
13977 : see if getnetbyaddr exists
13978 set getnetbyaddr d_getnbyaddr
13981 : see if getnetbyname exists
13982 set getnetbyname d_getnbyname
13985 : see if getnetent exists
13986 set getnetent d_getnent
13989 : see if getnetbyaddr_r exists
13990 set getnetbyaddr_r d_getnetbyaddr_r
13992 case "$d_getnetbyaddr_r" in
13994 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13995 case "$d_getnetbyaddr_r_proto:$usethreads" in
13996 ":define") d_getnetbyaddr_r_proto=define
13997 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
14001 case "$d_getnetbyaddr_r_proto" in
14003 case "$getnetbyaddr_r_proto" in
14004 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
14005 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
14007 case "$getnetbyaddr_r_proto" in
14008 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
14009 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
14011 case "$getnetbyaddr_r_proto" in
14012 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
14013 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
14015 case "$getnetbyaddr_r_proto" in
14016 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
14017 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
14019 case "$getnetbyaddr_r_proto" in
14020 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
14021 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
14023 case "$getnetbyaddr_r_proto" in
14024 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
14025 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
14027 case "$getnetbyaddr_r_proto" in
14028 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
14029 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
14031 case "$getnetbyaddr_r_proto" in
14032 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
14033 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
14035 case "$getnetbyaddr_r_proto" in
14036 ''|0) d_getnetbyaddr_r=undef
14037 getnetbyaddr_r_proto=0
14038 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
14039 * ) case "$getnetbyaddr_r_proto" in
14040 REENTRANT_PROTO*) ;;
14041 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
14043 echo "Prototype: $try" ;;
14046 *) case "$usethreads" in
14047 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
14049 d_getnetbyaddr_r=undef
14050 getnetbyaddr_r_proto=0
14054 *) getnetbyaddr_r_proto=0
14058 : see if getnetbyname_r exists
14059 set getnetbyname_r d_getnetbyname_r
14061 case "$d_getnetbyname_r" in
14063 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14064 case "$d_getnetbyname_r_proto:$usethreads" in
14065 ":define") d_getnetbyname_r_proto=define
14066 set d_getnetbyname_r_proto getnetbyname_r $hdrs
14070 case "$d_getnetbyname_r_proto" in
14072 case "$getnetbyname_r_proto" in
14073 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
14074 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
14076 case "$getnetbyname_r_proto" in
14077 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
14078 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
14080 case "$getnetbyname_r_proto" in
14081 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
14082 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
14084 case "$getnetbyname_r_proto" in
14085 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
14086 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
14088 case "$getnetbyname_r_proto" in
14089 ''|0) d_getnetbyname_r=undef
14090 getnetbyname_r_proto=0
14091 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
14092 * ) case "$getnetbyname_r_proto" in
14093 REENTRANT_PROTO*) ;;
14094 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
14096 echo "Prototype: $try" ;;
14099 *) case "$usethreads" in
14100 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
14102 d_getnetbyname_r=undef
14103 getnetbyname_r_proto=0
14107 *) getnetbyname_r_proto=0
14111 : see if getnetent_r exists
14112 set getnetent_r d_getnetent_r
14114 case "$d_getnetent_r" in
14116 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14117 case "$d_getnetent_r_proto:$usethreads" in
14118 ":define") d_getnetent_r_proto=define
14119 set d_getnetent_r_proto getnetent_r $hdrs
14123 case "$d_getnetent_r_proto" in
14125 case "$getnetent_r_proto" in
14126 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
14127 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
14129 case "$getnetent_r_proto" in
14130 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
14131 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBIE ;;
14133 case "$getnetent_r_proto" in
14134 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
14135 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBIE ;;
14137 case "$getnetent_r_proto" in
14138 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
14139 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBI ;;
14141 case "$getnetent_r_proto" in
14142 ''|0) try='int getnetent_r(struct netent*, char*, int);'
14143 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBI ;;
14145 case "$getnetent_r_proto" in
14146 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
14147 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SD ;;
14149 case "$getnetent_r_proto" in
14150 ''|0) d_getnetent_r=undef
14151 getnetent_r_proto=0
14152 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
14153 * ) case "$getnetent_r_proto" in
14154 REENTRANT_PROTO*) ;;
14155 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
14157 echo "Prototype: $try" ;;
14160 *) case "$usethreads" in
14161 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
14163 d_getnetent_r=undef
14164 getnetent_r_proto=0
14168 *) getnetent_r_proto=0
14172 : see if prototypes for various getnetxxx netdb.h functions are available
14174 set d_getnetprotos getnetent $i_netdb netdb.h
14177 : see if getpagesize exists
14178 set getpagesize d_getpagsz
14181 : Optional checks for getprotobyname and getprotobynumber
14183 : see if getprotobyname exists
14184 set getprotobyname d_getpbyname
14187 : see if getprotobynumber exists
14188 set getprotobynumber d_getpbynumber
14191 : see if getprotoent exists
14192 set getprotoent d_getpent
14195 : see if getpgid exists
14196 set getpgid d_getpgid
14199 : see if getpgrp2 exists
14200 set getpgrp2 d_getpgrp2
14203 : see if getppid exists
14204 set getppid d_getppid
14207 : see if getpriority exists
14208 set getpriority d_getprior
14211 : see if getprotobyname_r exists
14212 set getprotobyname_r d_getprotobyname_r
14214 case "$d_getprotobyname_r" in
14216 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14217 case "$d_getprotobyname_r_proto:$usethreads" in
14218 ":define") d_getprotobyname_r_proto=define
14219 set d_getprotobyname_r_proto getprotobyname_r $hdrs
14223 case "$d_getprotobyname_r_proto" in
14225 case "$getprotobyname_r_proto" in
14226 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
14227 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
14229 case "$getprotobyname_r_proto" in
14230 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
14231 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
14233 case "$getprotobyname_r_proto" in
14234 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
14235 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
14237 case "$getprotobyname_r_proto" in
14238 ''|0) d_getprotobyname_r=undef
14239 getprotobyname_r_proto=0
14240 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
14241 * ) case "$getprotobyname_r_proto" in
14242 REENTRANT_PROTO*) ;;
14243 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
14245 echo "Prototype: $try" ;;
14248 *) case "$usethreads" in
14249 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
14251 d_getprotobyname_r=undef
14252 getprotobyname_r_proto=0
14256 *) getprotobyname_r_proto=0
14260 : see if getprotobynumber_r exists
14261 set getprotobynumber_r d_getprotobynumber_r
14263 case "$d_getprotobynumber_r" in
14265 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14266 case "$d_getprotobynumber_r_proto:$usethreads" in
14267 ":define") d_getprotobynumber_r_proto=define
14268 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
14272 case "$d_getprotobynumber_r_proto" in
14274 case "$getprotobynumber_r_proto" in
14275 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
14276 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
14278 case "$getprotobynumber_r_proto" in
14279 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
14280 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
14282 case "$getprotobynumber_r_proto" in
14283 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
14284 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
14286 case "$getprotobynumber_r_proto" in
14287 ''|0) d_getprotobynumber_r=undef
14288 getprotobynumber_r_proto=0
14289 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
14290 * ) case "$getprotobynumber_r_proto" in
14291 REENTRANT_PROTO*) ;;
14292 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
14294 echo "Prototype: $try" ;;
14297 *) case "$usethreads" in
14298 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
14300 d_getprotobynumber_r=undef
14301 getprotobynumber_r_proto=0
14305 *) getprotobynumber_r_proto=0
14309 : see if getprotoent_r exists
14310 set getprotoent_r d_getprotoent_r
14312 case "$d_getprotoent_r" in
14314 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14315 case "$d_getprotoent_r_proto:$usethreads" in
14316 ":define") d_getprotoent_r_proto=define
14317 set d_getprotoent_r_proto getprotoent_r $hdrs
14321 case "$d_getprotoent_r_proto" in
14323 case "$getprotoent_r_proto" in
14324 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
14325 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
14327 case "$getprotoent_r_proto" in
14328 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
14329 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBI ;;
14331 case "$getprotoent_r_proto" in
14332 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
14333 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=S_SBI ;;
14335 case "$getprotoent_r_proto" in
14336 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
14337 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SD ;;
14339 case "$getprotoent_r_proto" in
14340 ''|0) d_getprotoent_r=undef
14341 getprotoent_r_proto=0
14342 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
14343 * ) case "$getprotoent_r_proto" in
14344 REENTRANT_PROTO*) ;;
14345 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
14347 echo "Prototype: $try" ;;
14350 *) case "$usethreads" in
14351 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
14353 d_getprotoent_r=undef
14354 getprotoent_r_proto=0
14358 *) getprotoent_r_proto=0
14362 : see if prototypes for various getprotoxxx netdb.h functions are available
14364 set d_getprotoprotos getprotoent $i_netdb netdb.h
14367 : see if getprpwnam exists
14368 set getprpwnam d_getprpwnam
14371 : see if getpwent exists
14372 set getpwent d_getpwent
14375 : see if getpwent_r exists
14376 set getpwent_r d_getpwent_r
14378 case "$d_getpwent_r" in
14380 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14381 case "$d_getpwent_r_proto:$usethreads" in
14382 ":define") d_getpwent_r_proto=define
14383 set d_getpwent_r_proto getpwent_r $hdrs
14387 case "$d_getpwent_r_proto" in
14389 case "$getpwent_r_proto" in
14390 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
14391 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBWR ;;
14393 case "$getpwent_r_proto" in
14394 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
14395 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIR ;;
14397 case "$getpwent_r_proto" in
14398 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
14399 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBW ;;
14401 case "$getpwent_r_proto" in
14402 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
14403 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBI ;;
14405 case "$getpwent_r_proto" in
14406 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
14407 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBI ;;
14409 case "$getpwent_r_proto" in
14410 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
14411 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIH ;;
14413 case "$getpwent_r_proto" in
14414 ''|0) d_getpwent_r=undef
14416 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
14417 * ) case "$getpwent_r_proto" in
14418 REENTRANT_PROTO*) ;;
14419 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
14421 echo "Prototype: $try" ;;
14424 *) case "$usethreads" in
14425 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
14432 *) getpwent_r_proto=0
14436 : see if getpwnam_r exists
14437 set getpwnam_r d_getpwnam_r
14439 case "$d_getpwnam_r" in
14441 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14442 case "$d_getpwnam_r_proto:$usethreads" in
14443 ":define") d_getpwnam_r_proto=define
14444 set d_getpwnam_r_proto getpwnam_r $hdrs
14448 case "$d_getpwnam_r_proto" in
14450 case "$getpwnam_r_proto" in
14451 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
14452 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
14454 case "$getpwnam_r_proto" in
14455 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
14456 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
14458 case "$getpwnam_r_proto" in
14459 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
14460 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
14462 case "$getpwnam_r_proto" in
14463 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
14464 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
14466 case "$getpwnam_r_proto" in
14467 ''|0) d_getpwnam_r=undef
14469 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
14470 * ) case "$getpwnam_r_proto" in
14471 REENTRANT_PROTO*) ;;
14472 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
14474 echo "Prototype: $try" ;;
14477 *) case "$usethreads" in
14478 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
14485 *) getpwnam_r_proto=0
14489 : see if getpwuid_r exists
14490 set getpwuid_r d_getpwuid_r
14492 case "$d_getpwuid_r" in
14494 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14495 case "$d_getpwuid_r_proto:$usethreads" in
14496 ":define") d_getpwuid_r_proto=define
14497 set d_getpwuid_r_proto getpwuid_r $hdrs
14501 case "$d_getpwuid_r_proto" in
14503 case "$getpwuid_r_proto" in
14504 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
14505 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
14507 case "$getpwuid_r_proto" in
14508 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
14509 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
14511 case "$getpwuid_r_proto" in
14512 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
14513 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
14515 case "$getpwuid_r_proto" in
14516 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
14517 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
14519 case "$getpwuid_r_proto" in
14520 ''|0) d_getpwuid_r=undef
14522 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
14523 * ) case "$getpwuid_r_proto" in
14524 REENTRANT_PROTO*) ;;
14525 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
14527 echo "Prototype: $try" ;;
14530 *) case "$usethreads" in
14531 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
14538 *) getpwuid_r_proto=0
14542 : Optional checks for getsbyname and getsbyport
14544 : see if getservbyname exists
14545 set getservbyname d_getsbyname
14548 : see if getservbyport exists
14549 set getservbyport d_getsbyport
14552 : see if getservent exists
14553 set getservent d_getsent
14556 : see if getservbyname_r exists
14557 set getservbyname_r d_getservbyname_r
14559 case "$d_getservbyname_r" in
14561 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14562 case "$d_getservbyname_r_proto:$usethreads" in
14563 ":define") d_getservbyname_r_proto=define
14564 set d_getservbyname_r_proto getservbyname_r $hdrs
14568 case "$d_getservbyname_r_proto" in
14570 case "$getservbyname_r_proto" in
14571 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
14572 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
14574 case "$getservbyname_r_proto" in
14575 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
14576 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
14578 case "$getservbyname_r_proto" in
14579 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
14580 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
14582 case "$getservbyname_r_proto" in
14583 ''|0) d_getservbyname_r=undef
14584 getservbyname_r_proto=0
14585 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
14586 * ) case "$getservbyname_r_proto" in
14587 REENTRANT_PROTO*) ;;
14588 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
14590 echo "Prototype: $try" ;;
14593 *) case "$usethreads" in
14594 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
14596 d_getservbyname_r=undef
14597 getservbyname_r_proto=0
14601 *) getservbyname_r_proto=0
14605 : see if getservbyport_r exists
14606 set getservbyport_r d_getservbyport_r
14608 case "$d_getservbyport_r" in
14610 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14611 case "$d_getservbyport_r_proto:$usethreads" in
14612 ":define") d_getservbyport_r_proto=define
14613 set d_getservbyport_r_proto getservbyport_r $hdrs
14617 case "$d_getservbyport_r_proto" in
14619 case "$getservbyport_r_proto" in
14620 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
14621 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
14623 case "$getservbyport_r_proto" in
14624 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
14625 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
14627 case "$getservbyport_r_proto" in
14628 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
14629 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
14631 case "$getservbyport_r_proto" in
14632 ''|0) d_getservbyport_r=undef
14633 getservbyport_r_proto=0
14634 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
14635 * ) case "$getservbyport_r_proto" in
14636 REENTRANT_PROTO*) ;;
14637 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
14639 echo "Prototype: $try" ;;
14642 *) case "$usethreads" in
14643 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
14645 d_getservbyport_r=undef
14646 getservbyport_r_proto=0
14650 *) getservbyport_r_proto=0
14654 : see if getservent_r exists
14655 set getservent_r d_getservent_r
14657 case "$d_getservent_r" in
14659 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14660 case "$d_getservent_r_proto:$usethreads" in
14661 ":define") d_getservent_r_proto=define
14662 set d_getservent_r_proto getservent_r $hdrs
14666 case "$d_getservent_r_proto" in
14668 case "$getservent_r_proto" in
14669 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
14670 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBWR ;;
14672 case "$getservent_r_proto" in
14673 ''|0) try='int getservent_r(struct servent*, char*, int);'
14674 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBI ;;
14676 case "$getservent_r_proto" in
14677 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
14678 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=S_SBI ;;
14680 case "$getservent_r_proto" in
14681 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
14682 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SD ;;
14684 case "$getservent_r_proto" in
14685 ''|0) d_getservent_r=undef
14686 getservent_r_proto=0
14687 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
14688 * ) case "$getservent_r_proto" in
14689 REENTRANT_PROTO*) ;;
14690 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
14692 echo "Prototype: $try" ;;
14695 *) case "$usethreads" in
14696 define) echo "getservent_r has no prototype, not using it." >&4 ;;
14698 d_getservent_r=undef
14699 getservent_r_proto=0
14703 *) getservent_r_proto=0
14707 : see if prototypes for various getservxxx netdb.h functions are available
14709 set d_getservprotos getservent $i_netdb netdb.h
14712 : see if getspnam exists
14713 set getspnam d_getspnam
14716 : see if this is a shadow.h system
14717 set shadow.h i_shadow
14720 : see if getspnam_r exists
14721 set getspnam_r d_getspnam_r
14723 case "$d_getspnam_r" in
14725 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
14726 case "$d_getspnam_r_proto:$usethreads" in
14727 ":define") d_getspnam_r_proto=define
14728 set d_getspnam_r_proto getspnam_r $hdrs
14732 case "$d_getspnam_r_proto" in
14734 case "$getspnam_r_proto" in
14735 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
14736 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
14738 case "$getspnam_r_proto" in
14739 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
14740 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=S_CSBI ;;
14742 case "$getspnam_r_proto" in
14743 ''|0) d_getspnam_r=undef
14745 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
14746 * ) case "$getspnam_r_proto" in
14747 REENTRANT_PROTO*) ;;
14748 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
14750 echo "Prototype: $try" ;;
14753 *) case "$usethreads" in
14754 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
14761 *) getspnam_r_proto=0
14765 : see if gettimeofday or ftime exists
14766 set gettimeofday d_gettimeod
14768 case "$d_gettimeod" in
14774 val="$undef"; set d_ftime; eval $setvar
14777 case "$d_gettimeod$d_ftime" in
14780 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
14784 : see if gmtime_r exists
14785 set gmtime_r d_gmtime_r
14787 case "$d_gmtime_r" in
14789 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14790 case "$d_gmtime_r_proto:$usethreads" in
14791 ":define") d_gmtime_r_proto=define
14792 set d_gmtime_r_proto gmtime_r $hdrs
14796 case "$d_gmtime_r_proto" in
14798 case "$gmtime_r_proto" in
14799 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
14800 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=S_TS ;;
14802 case "$gmtime_r_proto" in
14803 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
14804 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=I_TS ;;
14806 case "$gmtime_r_proto" in
14807 ''|0) d_gmtime_r=undef
14809 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
14810 * ) case "$gmtime_r_proto" in
14811 REENTRANT_PROTO*) ;;
14812 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
14814 echo "Prototype: $try" ;;
14817 *) case "$usethreads" in
14818 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
14825 *) gmtime_r_proto=0
14829 : see if hasmntopt exists
14830 set hasmntopt d_hasmntopt
14833 : see if this is a netinet/in.h or sys/in.h system
14834 set netinet/in.h i_niin sys/in.h i_sysin
14837 : see if arpa/inet.h has to be included
14838 set arpa/inet.h i_arpainet
14841 : see if htonl --and friends-- exists
14846 : Maybe they are macros.
14849 $cat >htonl.c <<EOM
14851 #include <sys/types.h>
14852 #$i_niin I_NETINET_IN
14854 #$i_arpainet I_ARPA_INET
14855 #ifdef I_NETINET_IN
14856 #include <netinet/in.h>
14859 #include <sys/in.h>
14862 #include <arpa/inet.h>
14865 printf("Defined as a macro.");
14868 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
14869 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
14871 echo "But it seems to be defined as a macro." >&4
14879 : see if ilogbl exists
14880 set ilogbl d_ilogbl
14885 if set index val -f; eval $csym; $val; then
14886 if set strchr val -f d_strchr; eval $csym; $val; then
14887 if $contains strchr "$strings" >/dev/null 2>&1 ; then
14890 echo "strchr() found." >&4
14894 echo "index() found." >&4
14899 echo "index() found." >&4
14902 if set strchr val -f d_strchr; eval $csym; $val; then
14905 echo "strchr() found." >&4
14907 echo "No index() or strchr() found!" >&4
14912 set d_strchr; eval $setvar
14914 set d_index; eval $setvar
14916 : check whether inet_aton exists
14917 set inet_aton d_inetaton
14920 : see if inet_ntop exists
14921 set inet_ntop d_inetntop
14924 : see if inet_pton exists
14925 set inet_pton d_inetpton
14930 $cat >isascii.c <<EOCP
14933 #$i_stdlib I_STDLIB
14935 #include <stdlib.h>
14946 if eval $compile; then
14947 echo "isascii() found." >&4
14950 echo "isascii() NOT found." >&4
14957 : see if isfinite exists
14958 set isfinite d_isfinite
14961 : see if isinf exists
14965 : see if isnan exists
14969 : see if isnanl exists
14970 set isnanl d_isnanl
14973 : see if killpg exists
14974 set killpg d_killpg
14977 : see if lchown exists
14979 $cat > try.c <<'EOCP'
14980 /* System header to define __stub macros and hopefully few prototypes,
14981 which can conflict with char lchown(); below. */
14982 #include <assert.h>
14983 /* Override any gcc2 internal prototype to avoid an error. */
14984 /* We use char because int might match the return type of a gcc2
14985 builtin and then its argument prototype would still apply. */
14988 /* The GNU C library defines this for functions which it implements
14989 to always fail with ENOSYS. Some functions are actually named
14990 something starting with __ and the normal name is an alias. */
14991 #if defined (__stub_lchown) || defined (__stub___lchown)
14999 if eval $compile; then
15000 $echo "lchown() found." >&4
15003 $echo "lchown() NOT found." >&4
15009 : See if number of significant digits in a double precision number is known
15011 $cat >ldbl_dig.c <<EOM
15012 #$i_limits I_LIMITS
15015 #include <limits.h>
15021 printf("Contains LDBL_DIG");
15024 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
15025 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
15026 echo "LDBL_DIG found." >&4
15029 echo "LDBL_DIG NOT found." >&4
15036 : see if this is a math.h system
15040 : check to see if math.h defines _LIB_VERSION
15041 d_libm_lib_version="$undef"
15045 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
15047 #include <unistd.h>
15049 int main (int argc, char *argv[])
15051 printf ("%d\n", _LIB_VERSION);
15056 if eval $compile; then
15058 echo "Yes, it does ($foo)" >&4
15059 d_libm_lib_version="$define"
15061 echo "No, it does not (probably harmless)" >&4
15068 : see if link exists
15072 : see if localtime_r exists
15073 set localtime_r d_localtime_r
15075 case "$d_localtime_r" in
15077 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
15078 case "$d_localtime_r_proto:$usethreads" in
15079 ":define") d_localtime_r_proto=define
15080 set d_localtime_r_proto localtime_r $hdrs
15084 case "$d_localtime_r_proto" in
15086 case "$localtime_r_proto" in
15087 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
15088 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=S_TS ;;
15090 case "$localtime_r_proto" in
15091 ''|0) try='int localtime_r(const time_t*, struct tm*);'
15092 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=I_TS ;;
15094 case "$localtime_r_proto" in
15095 ''|0) d_localtime_r=undef
15096 localtime_r_proto=0
15097 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
15098 * ) case "$localtime_r_proto" in
15099 REENTRANT_PROTO*) ;;
15100 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
15102 echo "Prototype: $try" ;;
15105 *) case "$usethreads" in
15106 define) echo "localtime_r has no prototype, not using it." >&4 ;;
15108 d_localtime_r=undef
15109 localtime_r_proto=0
15113 *) localtime_r_proto=0
15117 : see if localtime_r calls tzset
15118 case "$localtime_r_proto" in
15121 /* Does our libc's localtime_r call tzset ?
15122 * return 0 if so, 1 otherwise.
15124 #$i_systypes I_SYS_TYPES
15125 #$i_unistd I_UNISTD
15127 #$i_stdlib I_STDLIB
15128 #$i_string I_STRING
15129 #$i_malloc I_MALLOC
15131 # include <sys/types.h>
15134 # include <unistd.h>
15140 #include <stdlib.h>
15143 # include <string.h>
15145 # include <strings.h>
15148 # include <malloc.h>
15152 time_t t = time(0L);
15153 char w_tz[]="TZ" "=GMT+5",
15154 e_tz[]="TZ" "=GMT-5",
15155 *tz_e = (char*)malloc(16),
15156 *tz_w = (char*)malloc(16);
15157 struct tm tm_e, tm_w;
15158 memset(&tm_e,'\0',sizeof(struct tm));
15159 memset(&tm_w,'\0',sizeof(struct tm));
15164 localtime_r(&t, &tm_e);
15167 localtime_r(&t, &tm_w);
15169 if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 )
15175 if eval $compile; then
15176 if $run ./try; then
15177 d_localtime_r_needs_tzset=undef;
15179 d_localtime_r_needs_tzset=define;
15182 d_localtime_r_needs_tzset=undef;
15186 d_localtime_r_needs_tzset=undef;
15191 : see if localeconv exists
15192 set localeconv d_locconv
15195 : see if lockf exists
15199 : see if prototype for lseek is available
15201 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
15204 : see if lstat exists
15208 : see if madvise exists
15209 set madvise d_madvise
15212 : see if malloc_size exists
15213 set malloc_size d_malloc_size
15216 : see if malloc_size_good exists
15217 set malloc_good_size d_malloc_good_size
15220 : see if mblen exists
15224 : see if mbstowcs exists
15225 set mbstowcs d_mbstowcs
15228 : see if mbtowc exists
15229 set mbtowc d_mbtowc
15232 : see if memchr exists
15233 set memchr d_memchr
15236 : see if memcmp exists
15237 set memcmp d_memcmp
15240 : see if memcpy exists
15241 set memcpy d_memcpy
15244 : see if memmove exists
15245 set memmove d_memmove
15248 : see if memset exists
15249 set memset d_memset
15252 : see if mkdir exists
15256 : see if mkdtemp exists
15257 set mkdtemp d_mkdtemp
15260 : see if mkfifo exists
15261 set mkfifo d_mkfifo
15264 : see if mkstemp exists
15265 set mkstemp d_mkstemp
15268 : see if mkstemps exists
15269 set mkstemps d_mkstemps
15272 : see if mktime exists
15273 set mktime d_mktime
15276 : see if this is a sys/mman.h system
15277 set sys/mman.h i_sysmman
15280 : see if mmap exists
15283 : see what shmat returns
15284 : default to something harmless
15286 case "$i_sysmman$d_mmap" in
15288 $cat >mmap.c <<'END'
15289 #include <sys/mman.h>
15292 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
15297 echo "and it returns ($mmaptype)." >&4
15303 : see if sqrtl exists
15307 : see if scalbnl exists
15308 set scalbnl d_scalbnl
15311 : see if modfl exists
15315 : see if prototype for modfl is available
15317 set d_modflproto modfl $i_math math.h
15320 d_modfl_pow32_bug="$undef"
15322 case "$d_longdbl$d_modfl" in
15325 Checking to see whether your modfl() is okay for large values...
15331 if $test "X$d_modflproto" != "X$define"; then
15332 $cat >>try.c <<EOCP
15333 /* Sigh. many current glibcs provide the function, but do not prototype it. */
15334 long double modfl (long double, long double *);
15337 $cat >>try.c <<EOCP
15339 long double nv = 4294967303.15;
15345 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
15349 case "$osname:$gccversion" in
15350 aix:) saveccflags="$ccflags"
15351 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
15354 if eval $compile; then
15357 *" 4294967303.150000 1.150000 4294967302.000000")
15358 echo >&4 "Your modfl() is broken for large values."
15359 d_modfl_pow32_bug="$define"
15361 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
15365 *" 4294967303.150000 0.150000 4294967303.000000")
15366 echo >&4 "Your modfl() seems okay for large values."
15368 *) echo >&4 "I don't understand your modfl() at all."
15374 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
15377 case "$osname:$gccversion" in
15378 aix:) ccflags="$saveccflags" ;; # restore
15383 if $test "$uselongdouble" = "$define"; then
15385 if $test "$d_sqrtl" != "$define"; then
15386 message="$message sqrtl"
15388 if $test "$d_modfl" != "$define"; then
15389 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
15390 echo "You have both aintl and copysignl, so I can emulate modfl."
15392 message="$message modfl"
15395 if $test "$d_frexpl" != "$define"; then
15396 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
15397 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
15399 message="$message frexpl"
15403 if $test "$message" != ""; then
15406 *** You requested the use of long doubles but you do not seem to have
15407 *** the following mathematical functions needed for long double support:
15409 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
15410 *** Cannot continue, aborting.
15418 : see if mprotect exists
15419 set mprotect d_mprotect
15422 : see if msgctl exists
15423 set msgctl d_msgctl
15426 : see if msgget exists
15427 set msgget d_msgget
15430 : see if msgsnd exists
15431 set msgsnd d_msgsnd
15434 : see if msgrcv exists
15435 set msgrcv d_msgrcv
15438 : see how much of the 'msg*(2)' library is present.
15441 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
15442 *"$undef"*) h_msg=false;;
15446 case "`ipcs 2>&1`" in
15447 "SVID messages"*"not configured"*)
15448 echo "Your $osname does not have the msg*(2) configured." >&4
15451 set msgctl d_msgctl
15453 set msgget d_msgget
15455 set msgsnd d_msgsnd
15457 set msgrcv d_msgrcv
15463 : we could also check for sys/ipc.h ...
15464 if $h_msg && $test `./findhdr sys/msg.h`; then
15465 echo "You have the full msg*(2) library." >&4
15468 echo "You don't have the full msg*(2) library." >&4
15474 : Check for msghdr_s
15476 echo "Checking to see if your system supports struct msghdr..." >&4
15477 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
15479 case "$d_msghdr_s" in
15480 "$define") echo "Yes, it does." ;;
15481 *) echo "No, it doesn't." ;;
15485 : see if msync exists
15489 : see if munmap exists
15490 set munmap d_munmap
15493 : see if nice exists
15497 : see if this is a langinfo.h system
15498 set langinfo.h i_langinfo
15501 : see if nl_langinfo exists
15502 set nl_langinfo d_nl_langinfo
15505 : check for volatile keyword
15507 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
15508 $cat >try.c <<'EOCP'
15511 typedef struct _goo_struct goo_struct;
15512 goo_struct * volatile goo = ((goo_struct *)0);
15513 struct _goo_struct {
15518 typedef unsigned short foo_t;
15519 char *volatile foo;
15521 volatile foo_t blech;
15525 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
15527 echo "Yup, it does."
15530 echo "Nope, it doesn't."
15536 : Check basic sizes
15538 $echo "Choosing the C types to be used for Perl's internal types..." >&4
15540 case "$use64bitint:$d_quad:$quadtype" in
15543 uvtype="$uquadtype"
15548 uvtype="unsigned long"
15554 case "$uselongdouble:$d_longdbl" in
15556 nvtype="long double"
15557 nvsize=$longdblsize
15564 $echo "(IV will be "$ivtype", $ivsize bytes)"
15565 $echo "(UV will be "$uvtype", $uvsize bytes)"
15566 $echo "(NV will be "$nvtype", $nvsize bytes)"
15569 #$i_inttypes I_INTTYPES
15571 #include <inttypes.h>
15576 int8_t i = INT8_MAX;
15577 uint8_t u = UINT8_MAX;
15578 printf("int8_t\n");
15581 int16_t i = INT16_MAX;
15582 uint16_t i = UINT16_MAX;
15583 printf("int16_t\n");
15586 int32_t i = INT32_MAX;
15587 uint32_t u = UINT32_MAX;
15588 printf("int32_t\n");
15593 i8type="signed char"
15594 u8type="unsigned char"
15599 '') case "$shortsize" in
15601 u16type="unsigned short"
15609 '') set try -DINT16
15610 if eval $compile; then
15611 case "`$run ./try`" in
15623 '') if $test $shortsize -ge 2; then
15625 u16type="unsigned short"
15633 '') case "$longsize" in
15635 u32type="unsigned long"
15639 *) case "$intsize" in
15641 u32type="unsigned int"
15651 '') set try -DINT32
15652 if eval $compile; then
15653 case "`$run ./try`" in
15665 '') if $test $intsize -ge 4; then
15667 u32type="unsigned int"
15675 '') case "$d_quad:$quadtype" in
15677 i64type="$quadtype"
15678 u64type="$uquadtype"
15686 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
15687 : volatile so that the compiler has to store it out to memory.
15688 if test X"$d_volatile" = X"$define"; then
15693 #$i_stdlib I_STDLIB
15695 #include <stdlib.h>
15697 #include <sys/types.h>
15698 #include <signal.h>
15700 $volatile int bletched = 0;
15701 $signal_t blech(int s) { bletched = 1; }
15706 int n = 8 * $uvsize;
15709 signal(SIGFPE, blech);
15712 for (i = 0; i < n; i++) {
15713 u = u << 1 | ($uvtype)1;
15715 if (($uvtype)d != u)
15719 d = ($nvtype)(u - 1);
15720 if (($uvtype)d != (u - 1))
15727 printf("%d\n", ((i == n) ? -n : i));
15733 d_nv_preserves_uv="$undef"
15734 if eval $compile; then
15735 nv_preserves_uv_bits="`$run ./try`"
15737 case "$nv_preserves_uv_bits" in
15739 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
15740 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
15741 d_nv_preserves_uv="$define"
15743 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
15744 d_nv_preserves_uv="$undef" ;;
15745 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
15746 nv_preserves_uv_bits="0" ;;
15750 $echo "Checking to find the largest integer value your NVs can hold..." >&4
15751 : volatile so that the compiler has to store it out to memory.
15752 if test X"$d_volatile" = X"$define"; then
15758 typedef $nvtype NV;
15765 while(count < 256) {
15766 $volatile NV up = value + 1.0;
15767 $volatile NV negated = -value;
15768 $volatile NV down = negated - 1.0;
15769 $volatile NV got_up = up - value;
15770 int up_good = got_up == 1.0;
15771 int got_down = down - negated;
15772 int down_good = got_down == -1.0;
15774 if (down_good != up_good) {
15776 "Inconsistency - up %d %f; down %d %f; for 2**%d (%.20f)\n",
15777 up_good, (double) got_up, down_good, (double) got_down,
15778 count, (double) value);
15785 fputs("256.0", stdout);
15788 fputs("2.0", stdout);
15794 fputs("*", stdout);
15800 fprintf(stderr, "Cannot overflow integer range, even at 2**%d (%.20f)\n",
15801 count, (double) value);
15807 nv_overflows_integers_at='0'
15808 if eval $compile; then
15814 The largest integer your NVs can preserve is equal to $xxx
15816 nv_overflows_integers_at="$xxx"
15819 Cannot determine the largest integer value your NVs can hold, unexpected output
15826 Cannot determine the largest integer value your NVs can hold
15833 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
15834 : volatile so that the compiler has to store it out to memory.
15835 if test X"$d_volatile" = X"$define"; then
15840 #$i_stdlib I_STDLIB
15842 #include <stdlib.h>
15844 #$i_string I_STRING
15846 # include <string.h>
15848 # include <strings.h>
15850 #include <sys/types.h>
15851 #include <signal.h>
15853 $volatile int bletched = 0;
15854 $signal_t blech(int s) { bletched = 1; }
15857 int checkit($nvtype d, char *where) {
15858 unsigned char *p = (char *)&d;
15859 unsigned char *end = p + sizeof(d);
15869 printf("No - %s: 0x", where);
15871 printf ("%02X", *p++);
15876 int main(int argc, char **argv) {
15879 fail += checkit(d, "0.0");
15881 /* The compiler shouldn't be assuming that bletched is 0 */
15884 fail += checkit(d, "bleched");
15887 signal(SIGFPE, blech);
15890 /* Paranoia - the compiler should have no way of knowing that ANSI says
15891 that argv[argc] will always be NULL. Actually, if it did assume this it
15892 would be buggy, as this is C and main() can be called from elsewhere in
15894 d = argv[argc] ? 1 : 0;
15897 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
15900 fail += checkit(d, "ternary");
15902 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
15905 printf("No - memset doesn't give 0.0\n");
15906 /* This might just blow up: */
15907 printf("(gives %g)\n", d);
15913 printf("No - something bleched\n");
15918 printf("No - %d fail(s)\n", fail);
15927 d_nv_zero_is_allbits_zero="$undef"
15928 if eval $compile; then
15934 0.0 is represented as all bits zero in memory
15936 d_nv_zero_is_allbits_zero="$define"
15939 0.0 is not represented as all bits zero in memory
15941 d_nv_zero_is_allbits_zero="$undef"
15946 0.0 is not represented as all bits zero in memory
15948 d_nv_zero_is_allbits_zero="$undef"
15954 : check for off64_t
15956 echo "Checking to see if you have off64_t..." >&4
15958 #include <sys/types.h>
15959 #include <unistd.h>
15960 int main() { off64_t x = 7; }
15963 if eval $compile; then
15965 echo "You have off64_t."
15968 echo "You do not have off64_t."
15969 case "$lseeksize" in
15970 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
15977 : how to create joinable pthreads
15978 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
15980 echo "Checking what constant to use for creating joinable pthreads..." >&4
15981 $cat >try.c <<'EOCP'
15982 #include <pthread.h>
15984 int detachstate = JOINABLE;
15987 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
15988 if eval $compile; then
15989 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
15990 val="$undef" # Yes, undef.
15991 set d_old_pthread_create_joinable
15994 set old_pthread_create_joinable
15997 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
15998 if eval $compile; then
15999 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
16001 set d_old_pthread_create_joinable
16003 val=PTHREAD_CREATE_UNDETACHED
16004 set old_pthread_create_joinable
16007 set try -DJOINABLE=__UNDETACHED
16008 if eval $compile; then
16009 echo "You seem to use __UNDETACHED." >&4
16011 set d_old_pthread_create_joinable
16014 set old_pthread_create_joinable
16017 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
16019 set d_old_pthread_create_joinable
16022 set old_pthread_create_joinable
16029 d_old_pthread_create_joinable="$undef"
16030 old_pthread_create_joinable=""
16033 : see if pause exists
16037 : see if poll exists
16041 : see if readlink exists
16042 set readlink d_readlink
16045 : Check if exe is symlink to abs path of executing program
16049 case "$d_readlink" in
16051 if $issymlink /proc/self/exe ; then
16052 $ls -l /proc/self/exe > reflect
16053 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
16054 echo "You have Linux-like /proc/self/exe."
16055 procselfexe='"/proc/self/exe"'
16059 if $issymlink /proc/curproc/file ; then
16060 $ls -l /proc/curproc/file > reflect
16061 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
16062 echo "You have BSD-like /proc/curproc/file."
16063 procselfexe='"/proc/curproc/file"'
16073 : backward compatibility for d_hvfork
16074 if test X$d_hvfork != X; then
16075 d_vfork="$d_hvfork"
16078 : see if there is a vfork
16083 d_pseudofork=$undef
16085 : Ok, but do we want to use it. vfork is reportedly unreliable in
16086 : perl on Solaris 2.x, and probably elsewhere.
16090 case "$usevfork" in
16096 Perl can only use a vfork() that doesn't suffer from strict
16097 restrictions on calling functions or modifying global data in
16098 the child. For example, glibc-2.1 contains such a vfork()
16099 that is unsuitable. If your system provides a proper fork()
16100 call, chances are that you do NOT want perl to use vfork().
16103 rp="Do you still want to use vfork()?"
16108 echo "Ok, we won't use vfork()."
16117 $define) usevfork='true';;
16118 *) usevfork='false';;
16121 : see whether the pthread_atfork exists
16123 #include <pthread.h>
16126 #ifdef PTHREAD_ATFORK
16127 pthread_atfork(NULL,NULL,NULL);
16132 : see if pthread_atfork exists
16133 set try -DPTHREAD_ATFORK
16134 if eval $compile; then
16139 case "$usethreads" in
16142 $define) echo 'pthread_atfork found.' >&4 ;;
16143 *) echo 'pthread_atfork NOT found.' >&4 ;;
16146 set d_pthread_atfork
16149 : see if pthread_attr_setscope exists
16150 set pthread_attr_setscope d_pthread_attr_setscope
16153 : see whether the various POSIXish _yields exist
16155 #include <pthread.h>
16161 #ifdef PTHREAD_YIELD
16164 #ifdef PTHREAD_YIELD_NULL
16165 pthread_yield(NULL);
16171 : see if sched_yield exists
16172 set try -DSCHED_YIELD
16173 if eval $compile; then
16175 sched_yield='sched_yield()'
16179 case "$usethreads" in
16182 $define) echo 'sched_yield() found.' >&4 ;;
16183 *) echo 'sched_yield() NOT found.' >&4 ;;
16189 : see if pthread_yield exists
16190 set try -DPTHREAD_YIELD
16191 if eval $compile; then
16193 case "$sched_yield" in
16194 '') sched_yield='pthread_yield()' ;;
16197 set try -DPTHREAD_YIELD_NULL
16198 if eval $compile; then
16200 case "$sched_yield" in
16201 '') sched_yield='pthread_yield(NULL)' ;;
16207 case "$usethreads" in
16210 $define) echo 'pthread_yield() found.' >&4 ;;
16211 *) echo 'pthread_yield() NOT found.' >&4 ;;
16215 set d_pthread_yield
16217 case "$sched_yield" in
16218 '') sched_yield=undef ;;
16222 : see if random_r exists
16223 set random_r d_random_r
16225 case "$d_random_r" in
16227 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
16228 case "$d_random_r_proto:$usethreads" in
16229 ":define") d_random_r_proto=define
16230 set d_random_r_proto random_r $hdrs
16234 case "$d_random_r_proto" in
16236 case "$random_r_proto" in
16237 ''|0) try='int random_r(int*, struct random_data*);'
16238 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_iS ;;
16240 case "$random_r_proto" in
16241 ''|0) try='int random_r(long*, struct random_data*);'
16242 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_lS ;;
16244 case "$random_r_proto" in
16245 ''|0) try='int random_r(struct random_data*, int32_t*);'
16246 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_St ;;
16248 case "$random_r_proto" in
16249 ''|0) d_random_r=undef
16251 echo "Disabling random_r, cannot determine prototype." >&4 ;;
16252 * ) case "$random_r_proto" in
16253 REENTRANT_PROTO*) ;;
16254 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
16256 echo "Prototype: $try" ;;
16259 *) case "$usethreads" in
16260 define) echo "random_r has no prototype, not using it." >&4 ;;
16267 *) random_r_proto=0
16271 : see if readdir and friends exist
16272 set readdir d_readdir
16274 set seekdir d_seekdir
16276 set telldir d_telldir
16278 set rewinddir d_rewinddir
16281 : see if readdir64_r exists
16282 set readdir64_r d_readdir64_r
16284 case "$d_readdir64_r" in
16286 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
16287 case "$d_readdir64_r_proto:$usethreads" in
16288 ":define") d_readdir64_r_proto=define
16289 set d_readdir64_r_proto readdir64_r $hdrs
16293 case "$d_readdir64_r_proto" in
16295 case "$readdir64_r_proto" in
16296 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
16297 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TSR ;;
16299 case "$readdir64_r_proto" in
16300 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
16301 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TS ;;
16303 case "$readdir64_r_proto" in
16304 ''|0) d_readdir64_r=undef
16305 readdir64_r_proto=0
16306 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
16307 * ) case "$readdir64_r_proto" in
16308 REENTRANT_PROTO*) ;;
16309 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
16311 echo "Prototype: $try" ;;
16314 *) case "$usethreads" in
16315 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
16317 d_readdir64_r=undef
16318 readdir64_r_proto=0
16322 *) readdir64_r_proto=0
16326 : see if readdir_r exists
16327 set readdir_r d_readdir_r
16329 case "$d_readdir_r" in
16331 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
16332 case "$d_readdir_r_proto:$usethreads" in
16333 ":define") d_readdir_r_proto=define
16334 set d_readdir_r_proto readdir_r $hdrs
16338 case "$d_readdir_r_proto" in
16340 case "$readdir_r_proto" in
16341 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
16342 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TSR ;;
16344 case "$readdir_r_proto" in
16345 ''|0) try='int readdir_r(DIR*, struct dirent*);'
16346 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TS ;;
16348 case "$readdir_r_proto" in
16349 ''|0) d_readdir_r=undef
16351 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
16352 * ) case "$readdir_r_proto" in
16353 REENTRANT_PROTO*) ;;
16354 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
16356 echo "Prototype: $try" ;;
16359 *) case "$usethreads" in
16360 define) echo "readdir_r has no prototype, not using it." >&4 ;;
16367 *) readdir_r_proto=0
16371 : see if readv exists
16375 : see if recvmsg exists
16376 set recvmsg d_recvmsg
16379 : see if rename exists
16380 set rename d_rename
16383 : see if rmdir exists
16387 : see if memory.h is available.
16392 : See if it conflicts with string.h
16398 $cppstdin $cppflags $cppminus < $strings > mem.h
16399 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
16401 echo "We won't be including <memory.h>."
16411 : can bcopy handle overlapping blocks?
16414 case "$d_memmove" in
16415 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
16416 *) case "$d_bcopy" in
16418 echo "Checking to see if bcopy() can do overlapping copies..." >&4
16420 #$i_memory I_MEMORY
16421 #$i_stdlib I_STDLIB
16422 #$i_string I_STRING
16423 #$i_unistd I_UNISTD
16425 $cat >>try.c <<'EOCP'
16428 # include <memory.h>
16431 # include <stdlib.h>
16434 # include <string.h>
16436 # include <strings.h>
16439 # include <unistd.h> /* Needed for NetBSD */
16443 char buf[128], abc[128];
16449 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16450 try to store the string in read-only memory. */
16451 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
16453 for (align = 7; align >= 0; align--) {
16454 for (len = 36; len; len--) {
16456 bcopy(abc, b, len);
16457 for (off = 1; off <= len; off++) {
16458 bcopy(b, b+off, len);
16459 bcopy(b+off, b, len);
16460 if (bcmp(b, abc, len))
16469 if eval $compile_ok; then
16470 if $run ./try 2>/dev/null; then
16471 echo "Yes, it can."
16474 echo "It can't, sorry."
16477 echo "(I can't compile the test program, so we'll assume not...)"
16487 : can memcpy handle overlapping blocks?
16490 case "$d_memmove" in
16491 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
16492 *) case "$d_memcpy" in
16494 echo "Checking to see if memcpy() can do overlapping copies..." >&4
16496 #$i_memory I_MEMORY
16497 #$i_stdlib I_STDLIB
16498 #$i_string I_STRING
16499 #$i_unistd I_UNISTD
16501 $cat >>try.c <<'EOCP'
16504 # include <memory.h>
16507 # include <stdlib.h>
16510 # include <string.h>
16512 # include <strings.h>
16515 # include <unistd.h> /* Needed for NetBSD */
16519 char buf[128], abc[128];
16525 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16526 try to store the string in read-only memory. */
16527 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
16529 for (align = 7; align >= 0; align--) {
16530 for (len = 36; len; len--) {
16532 memcpy(b, abc, len);
16533 for (off = 1; off <= len; off++) {
16534 memcpy(b+off, b, len);
16535 memcpy(b, b+off, len);
16536 if (memcmp(b, abc, len))
16545 if eval $compile_ok; then
16546 if $run ./try 2>/dev/null; then
16547 echo "Yes, it can."
16550 echo "It can't, sorry."
16553 echo "(I can't compile the test program, so we'll assume not...)"
16563 : can memcmp be trusted to compare relative magnitude?
16565 case "$d_memcmp" in
16568 echo "Checking if your memcmp() can compare relative magnitude..." >&4
16570 #$i_memory I_MEMORY
16571 #$i_stdlib I_STDLIB
16572 #$i_string I_STRING
16573 #$i_unistd I_UNISTD
16575 $cat >>try.c <<'EOCP'
16578 # include <memory.h>
16581 # include <stdlib.h>
16584 # include <string.h>
16586 # include <strings.h>
16589 # include <unistd.h> /* Needed for NetBSD */
16595 if ((a < b) && memcmp(&a, &b, 1) < 0)
16601 if eval $compile_ok; then
16602 if $run ./try 2>/dev/null; then
16603 echo "Yes, it can."
16606 echo "No, it can't (it uses signed chars)."
16609 echo "(I can't compile the test program, so we'll assume not...)"
16617 : see if prototype for sbrk is available
16619 set d_sbrkproto sbrk $i_unistd unistd.h
16622 : see if select exists
16623 set select d_select
16626 : see if semctl exists
16627 set semctl d_semctl
16630 : see if semget exists
16631 set semget d_semget
16634 : see if semop exists
16638 : see how much of the 'sem*(2)' library is present.
16641 case "$d_semctl$d_semget$d_semop" in
16642 *"$undef"*) h_sem=false;;
16646 case "`ipcs 2>&1`" in
16647 "SVID messages"*"not configured"*)
16648 echo "Your $osname does not have the sem*(2) configured." >&4
16651 set semctl d_semctl
16653 set semget d_semget
16661 : we could also check for sys/ipc.h ...
16662 if $h_sem && $test `./findhdr sys/sem.h`; then
16663 echo "You have the full sem*(2) library." >&4
16666 echo "You don't have the full sem*(2) library." >&4
16672 : see whether sys/sem.h defines union semun
16674 $cat > try.c <<'END'
16675 #include <sys/types.h>
16676 #include <sys/ipc.h>
16677 #include <sys/sem.h>
16678 int main () { union semun semun; semun.buf = 0; }
16681 if eval $compile; then
16682 echo "You have union semun in <sys/sem.h>." >&4
16685 echo "You do not have union semun in <sys/sem.h>." >&4
16692 : see how to do semctl IPC_STAT
16696 $cat > tryh.h <<END
16699 # define S_IRUSR S_IREAD
16700 # define S_IWUSR S_IWRITE
16701 # define S_IXUSR S_IEXEC
16703 # define S_IRUSR 0400
16704 # define S_IWUSR 0200
16705 # define S_IXUSR 0100
16707 # define S_IRGRP (S_IRUSR>>3)
16708 # define S_IWGRP (S_IWUSR>>3)
16709 # define S_IXGRP (S_IXUSR>>3)
16710 # define S_IROTH (S_IRUSR>>6)
16711 # define S_IWOTH (S_IWUSR>>6)
16712 # define S_IXOTH (S_IXUSR>>6)
16715 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
16716 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
16717 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
16720 : see whether semctl IPC_STAT can use union semun
16721 case "$d_semctl_semun" in
16725 #include <sys/types.h>
16726 #include <sys/ipc.h>
16727 #include <sys/sem.h>
16728 #include <sys/stat.h>
16735 #$d_union_semun HAS_UNION_SEMUN
16738 #ifndef HAS_UNION_SEMUN
16741 struct semid_ds *buf;
16742 unsigned short *array;
16748 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16749 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16751 struct semid_ds argbuf;
16754 st = semctl(sem, 0, IPC_STAT, arg);
16758 # endif /* IPC_STAT */
16759 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16761 if (semctl(sem, 0, IPC_RMID, arg) != 0)
16762 # endif /* IPC_RMID */
16763 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16765 #endif /* IPC_PRIVATE && ... */
16766 printf("semget failed: errno = %d\n", errno);
16771 if eval $compile; then
16774 semun) val="$define" ;;
16782 case "$d_semctl_semun" in
16784 echo "You can use union semun for semctl IPC_STAT." >&4
16787 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
16792 : see whether semctl IPC_STAT can use struct semid_ds pointer
16793 case "$d_semctl_semid_ds" in
16796 $cat > try.c <<'END'
16797 #include <sys/types.h>
16798 #include <sys/ipc.h>
16799 #include <sys/sem.h>
16800 #include <sys/stat.h>
16808 struct semid_ds arg;
16811 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16812 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16815 st = semctl(sem, 0, IPC_STAT, &arg);
16817 printf("semid_ds\n");
16819 # endif /* IPC_STAT */
16820 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16822 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
16823 # endif /* IPC_RMID */
16824 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16826 #endif /* IPC_PRIVATE && ... */
16827 printf("semget failed: errno = %d\n", errno);
16833 if eval $compile; then
16836 semid_ds) val="$define" ;;
16840 set d_semctl_semid_ds
16844 case "$d_semctl_semid_ds" in
16846 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
16848 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
16854 # We do not have the full sem*(2) library, so assume we can not
16860 set d_semctl_semid_ds
16866 : see if sendmsg exists
16867 set sendmsg d_sendmsg
16870 : see if setegid exists
16871 set setegid d_setegid
16874 : see if seteuid exists
16875 set seteuid d_seteuid
16878 : see if setgrent exists
16879 set setgrent d_setgrent
16882 : see if setgrent_r exists
16883 set setgrent_r d_setgrent_r
16885 case "$d_setgrent_r" in
16887 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
16888 case "$d_setgrent_r_proto:$usethreads" in
16889 ":define") d_setgrent_r_proto=define
16890 set d_setgrent_r_proto setgrent_r $hdrs
16894 case "$d_setgrent_r_proto" in
16896 case "$setgrent_r_proto" in
16897 ''|0) try='int setgrent_r(FILE**);'
16898 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=I_H ;;
16900 case "$setgrent_r_proto" in
16901 ''|0) try='void setgrent_r(FILE**);'
16902 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=V_H ;;
16904 case "$setgrent_r_proto" in
16905 ''|0) d_setgrent_r=undef
16907 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
16908 * ) case "$setgrent_r_proto" in
16909 REENTRANT_PROTO*) ;;
16910 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
16912 echo "Prototype: $try" ;;
16915 *) case "$usethreads" in
16916 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
16923 *) setgrent_r_proto=0
16927 : see if sethostent exists
16928 set sethostent d_sethent
16931 : see if sethostent_r exists
16932 set sethostent_r d_sethostent_r
16934 case "$d_sethostent_r" in
16936 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16937 case "$d_sethostent_r_proto:$usethreads" in
16938 ":define") d_sethostent_r_proto=define
16939 set d_sethostent_r_proto sethostent_r $hdrs
16943 case "$d_sethostent_r_proto" in
16945 case "$sethostent_r_proto" in
16946 ''|0) try='int sethostent_r(int, struct hostent_data*);'
16947 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=I_ID ;;
16949 case "$sethostent_r_proto" in
16950 ''|0) try='void sethostent_r(int, struct hostent_data*);'
16951 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=V_ID ;;
16953 case "$sethostent_r_proto" in
16954 ''|0) d_sethostent_r=undef
16955 sethostent_r_proto=0
16956 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
16957 * ) case "$sethostent_r_proto" in
16958 REENTRANT_PROTO*) ;;
16959 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
16961 echo "Prototype: $try" ;;
16964 *) case "$usethreads" in
16965 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
16967 d_sethostent_r=undef
16968 sethostent_r_proto=0
16972 *) sethostent_r_proto=0
16976 : see if setitimer exists
16977 set setitimer d_setitimer
16980 : see if setlinebuf exists
16981 set setlinebuf d_setlinebuf
16984 : see if setlocale exists
16985 set setlocale d_setlocale
16988 : see if locale.h is available
16989 set locale.h i_locale
16992 : see if setlocale_r exists
16993 set setlocale_r d_setlocale_r
16995 case "$d_setlocale_r" in
16997 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
16998 case "$d_setlocale_r_proto:$usethreads" in
16999 ":define") d_setlocale_r_proto=define
17000 set d_setlocale_r_proto setlocale_r $hdrs
17004 case "$d_setlocale_r_proto" in
17006 case "$setlocale_r_proto" in
17007 ''|0) try='int setlocale_r(int, const char*, char*, int);'
17008 ./protochk "$extern_C $try" $hdrs && setlocale_r_proto=I_ICBI ;;
17010 case "$setlocale_r_proto" in
17011 ''|0) d_setlocale_r=undef
17012 setlocale_r_proto=0
17013 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
17014 * ) case "$setlocale_r_proto" in
17015 REENTRANT_PROTO*) ;;
17016 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
17018 echo "Prototype: $try" ;;
17021 *) case "$usethreads" in
17022 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
17024 d_setlocale_r=undef
17025 setlocale_r_proto=0
17029 *) setlocale_r_proto=0
17033 : see if setnetent exists
17034 set setnetent d_setnent
17037 : see if setnetent_r exists
17038 set setnetent_r d_setnetent_r
17040 case "$d_setnetent_r" in
17042 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17043 case "$d_setnetent_r_proto:$usethreads" in
17044 ":define") d_setnetent_r_proto=define
17045 set d_setnetent_r_proto setnetent_r $hdrs
17049 case "$d_setnetent_r_proto" in
17051 case "$setnetent_r_proto" in
17052 ''|0) try='int setnetent_r(int, struct netent_data*);'
17053 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=I_ID ;;
17055 case "$setnetent_r_proto" in
17056 ''|0) try='void setnetent_r(int, struct netent_data*);'
17057 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=V_ID ;;
17059 case "$setnetent_r_proto" in
17060 ''|0) d_setnetent_r=undef
17061 setnetent_r_proto=0
17062 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
17063 * ) case "$setnetent_r_proto" in
17064 REENTRANT_PROTO*) ;;
17065 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
17067 echo "Prototype: $try" ;;
17070 *) case "$usethreads" in
17071 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
17073 d_setnetent_r=undef
17074 setnetent_r_proto=0
17078 *) setnetent_r_proto=0
17082 : see if setprotoent exists
17083 set setprotoent d_setpent
17086 : see if setpgid exists
17087 set setpgid d_setpgid
17090 : see if setpgrp2 exists
17091 set setpgrp2 d_setpgrp2
17094 : see if setpriority exists
17095 set setpriority d_setprior
17098 : see if setproctitle exists
17099 set setproctitle d_setproctitle
17102 : see if setprotoent_r exists
17103 set setprotoent_r d_setprotoent_r
17105 case "$d_setprotoent_r" in
17107 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17108 case "$d_setprotoent_r_proto:$usethreads" in
17109 ":define") d_setprotoent_r_proto=define
17110 set d_setprotoent_r_proto setprotoent_r $hdrs
17114 case "$d_setprotoent_r_proto" in
17116 case "$setprotoent_r_proto" in
17117 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
17118 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=I_ID ;;
17120 case "$setprotoent_r_proto" in
17121 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
17122 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=V_ID ;;
17124 case "$setprotoent_r_proto" in
17125 ''|0) d_setprotoent_r=undef
17126 setprotoent_r_proto=0
17127 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
17128 * ) case "$setprotoent_r_proto" in
17129 REENTRANT_PROTO*) ;;
17130 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
17132 echo "Prototype: $try" ;;
17135 *) case "$usethreads" in
17136 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
17138 d_setprotoent_r=undef
17139 setprotoent_r_proto=0
17143 *) setprotoent_r_proto=0
17147 : see if setpwent exists
17148 set setpwent d_setpwent
17151 : see if setpwent_r exists
17152 set setpwent_r d_setpwent_r
17154 case "$d_setpwent_r" in
17156 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
17157 case "$d_setpwent_r_proto:$usethreads" in
17158 ":define") d_setpwent_r_proto=define
17159 set d_setpwent_r_proto setpwent_r $hdrs
17163 case "$d_setpwent_r_proto" in
17165 case "$setpwent_r_proto" in
17166 ''|0) try='int setpwent_r(FILE**);'
17167 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=I_H ;;
17169 case "$setpwent_r_proto" in
17170 ''|0) try='void setpwent_r(FILE**);'
17171 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=V_H ;;
17173 case "$setpwent_r_proto" in
17174 ''|0) d_setpwent_r=undef
17176 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
17177 * ) case "$setpwent_r_proto" in
17178 REENTRANT_PROTO*) ;;
17179 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
17181 echo "Prototype: $try" ;;
17184 *) case "$usethreads" in
17185 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
17192 *) setpwent_r_proto=0
17196 : see if setregid exists
17197 set setregid d_setregid
17199 set setresgid d_setresgid
17202 : see if setreuid exists
17203 set setreuid d_setreuid
17205 set setresuid d_setresuid
17208 : see if setrgid exists
17209 set setrgid d_setrgid
17212 : see if setruid exists
17213 set setruid d_setruid
17216 : see if setservent exists
17217 set setservent d_setsent
17220 : see if setservent_r exists
17221 set setservent_r d_setservent_r
17223 case "$d_setservent_r" in
17225 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17226 case "$d_setservent_r_proto:$usethreads" in
17227 ":define") d_setservent_r_proto=define
17228 set d_setservent_r_proto setservent_r $hdrs
17232 case "$d_setservent_r_proto" in
17234 case "$setservent_r_proto" in
17235 ''|0) try='int setservent_r(int, struct servent_data*);'
17236 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=I_ID ;;
17238 case "$setservent_r_proto" in
17239 ''|0) try='void setservent_r(int, struct servent_data*);'
17240 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=V_ID ;;
17242 case "$setservent_r_proto" in
17243 ''|0) d_setservent_r=undef
17244 setservent_r_proto=0
17245 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
17246 * ) case "$setservent_r_proto" in
17247 REENTRANT_PROTO*) ;;
17248 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
17250 echo "Prototype: $try" ;;
17253 *) case "$usethreads" in
17254 define) echo "setservent_r has no prototype, not using it." >&4 ;;
17256 d_setservent_r=undef
17257 setservent_r_proto=0
17261 *) setservent_r_proto=0
17265 : see if setsid exists
17266 set setsid d_setsid
17269 : see if setvbuf exists
17270 set setvbuf d_setvbuf
17273 : see if sfio.h is available
17277 : see if sfio library is available
17288 : Ok, but do we want to use it.
17292 true|$define|[yY]*) dflt='y';;
17295 echo "$package can use the sfio library, but it is experimental."
17296 case "$useperlio" in
17298 echo "For sfio also the PerlIO abstraction layer is needed."
17299 echo "Earlier you said you wouldn't want that."
17302 rp="You seem to have sfio available, do you want to try using it?"
17305 y|Y) echo "Ok, turning on both sfio and PerlIO, then."
17306 useperlio="$define"
17309 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
17314 *) case "$usesfio" in
17315 true|$define|[yY]*)
17316 echo "Sorry, cannot find sfio on this machine." >&4
17317 echo "Ignoring your setting of usesfio=$usesfio." >&4
17326 $define) usesfio='true';;
17327 *) usesfio='false';;
17331 *) : Remove sfio from list of libraries to use
17334 echo "Removing unneeded -lsfio from library list" >&4
17335 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
17338 echo "libs = $libs" >&4
17345 : see if shmctl exists
17346 set shmctl d_shmctl
17349 : see if shmget exists
17350 set shmget d_shmget
17353 : see if shmat exists
17356 : see what shmat returns
17359 $cat >shmat.c <<'END'
17360 #include <sys/shm.h>
17363 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
17368 echo "and it returns ($shmattype)." >&4
17369 : see if a prototype for shmat is available
17370 xxx=`./findhdr sys/shm.h`
17371 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
17372 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
17383 set d_shmatprototype
17386 : see if shmdt exists
17390 : see how much of the 'shm*(2)' library is present.
17393 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
17394 *"$undef"*) h_shm=false;;
17398 case "`ipcs 2>&1`" in
17399 "SVID shared memory"*"not configured"*)
17400 echo "Your $osname does not have the shm*(2) configured." >&4
17403 set shmctl d_shmctl
17405 set shmget d_shmget
17415 : we could also check for sys/ipc.h ...
17416 if $h_shm && $test `./findhdr sys/shm.h`; then
17417 echo "You have the full shm*(2) library." >&4
17420 echo "You don't have the full shm*(2) library." >&4
17426 : see if we have sigaction
17428 if set sigaction val -f d_sigaction; eval $csym; $val; then
17429 echo 'sigaction() found.' >&4
17432 #include <sys/types.h>
17433 #include <signal.h>
17434 #$i_stdlib I_STDLIB
17436 #include <stdlib.h>
17440 struct sigaction act, oact;
17442 oact.sa_handler = 0;
17443 /* so that act and oact are used */
17444 exit(act.sa_flags == 0 && oact.sa_handler == 0);
17448 if eval $compile_ok; then
17451 echo "But you don't seem to have a useable struct sigaction." >&4
17455 echo 'sigaction NOT found.' >&4
17458 set d_sigaction; eval $setvar
17461 : see if this is a sunmath.h system
17462 set sunmath.h i_sunmath
17465 : see if signbit exists
17466 $echo $n "Checking to see if you have signbit() available to work on $nvtype... $c" >&4
17469 #$i_sunmath I_SUNMATH
17473 #ifdef I_SUNMATH /* Solaris special math library */
17474 # include <sunmath.h>
17477 int main(int argc, char **argv)
17481 if ((signbit(x) == 0) && (signbit(y) != 0))
17489 if eval $compile; then
17490 if $run ./try; then
17494 $echo "Signbit seems to be available, but doesn't work as I expected."
17495 $echo "I won't use it." >&4
17506 : see if sigprocmask exists
17507 set sigprocmask d_sigprocmask
17510 : see if sigsetjmp exists
17512 case "$d_sigsetjmp" in
17515 #include <setjmp.h>
17516 #$i_stdlib I_STDLIB
17518 #include <stdlib.h>
17524 if (sigsetjmp(env,1))
17527 siglongjmp(env, 1);
17532 if eval $compile; then
17533 if $run ./try >/dev/null 2>&1; then
17534 echo "POSIX sigsetjmp found." >&4
17538 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
17544 echo "sigsetjmp not found." >&4
17548 *) val="$d_sigsetjmp"
17549 case "$d_sigsetjmp" in
17550 $define) echo "POSIX sigsetjmp found." >&4;;
17551 $undef) echo "sigsetjmp not found." >&4;;
17559 : see if snprintf exists
17560 set snprintf d_snprintf
17563 : see if vsnprintf exists
17564 set vsnprintf d_vsnprintf
17567 case "$d_snprintf-$d_vsnprintf" in
17570 Checking whether your snprintf() and vsnprintf() work okay...
17572 $cat >try.c <<'EOCP'
17573 /* v?snprintf testing logic courtesy of Russ Allbery.
17574 * According to C99:
17575 * - if the buffer is too short it still must be \0-terminated
17576 * - if the buffer is too short the potentially required length
17577 * must be returned and not -1
17578 * - if the buffer is NULL the potentially required length
17579 * must be returned and not -1 or core dump
17582 #include <stdarg.h>
17586 int test (char *format, ...)
17591 va_start (args, format);
17592 count = vsnprintf (buf, sizeof buf, format, args);
17599 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
17600 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
17604 if eval $compile; then
17607 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
17609 Your snprintf() and snprintf() don't seem to be working okay.
17611 d_snprintf="$undef"
17612 d_vsnprintf="$undef"
17616 echo "(I can't seem to compile the test program--assuming they don't)"
17617 d_snprintf="$undef"
17618 d_vsnprintf="$undef"
17624 : see if sockatmark exists
17625 set sockatmark d_sockatmark
17628 : see if prototype for sockatmark is available
17630 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
17633 : see if socks5_init exists
17634 set socks5_init d_socks5_init
17637 : see if sprintf returns the length of the string in the buffer as per ANSI
17638 $echo "Checking whether sprintf returns the length of the string..." >&4
17641 #$i_stdlib I_STDLIB
17643 #include <stdlib.h>
17645 #$i_string I_STRING
17647 # include <string.h>
17649 # include <strings.h>
17658 int check (size_t expect, int test) {
17659 size_t got = strlen(buffer);
17663 printf("expected %ld, got %ld in test %d '%s'\n", (long) expect, (long) got,
17668 int main(int argc, char **argv) {
17671 check(sprintf(buffer, ""), ++test);
17672 check(sprintf(buffer, "%s %s", "perl", "rules"), ++test);
17673 check(sprintf(buffer, "I like %g", atan2(0,-1)), ++test);
17680 if eval $compile; then
17684 sprintf returns the length of the string (as ANSI says it should)
17686 d_sprintf_returns_strlen="$define"
17689 sprintf does not return the length of the string (how old is this system?)
17691 d_sprintf_returns_strlen="$undef"
17695 echo "(I can't seem to compile the test program--assuming it doesn't)" >&4
17696 d_sprintf_returns_strlen="$undef"
17700 : see if srand48_r exists
17701 set srand48_r d_srand48_r
17703 case "$d_srand48_r" in
17705 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17706 case "$d_srand48_r_proto:$usethreads" in
17707 ":define") d_srand48_r_proto=define
17708 set d_srand48_r_proto srand48_r $hdrs
17712 case "$d_srand48_r_proto" in
17714 case "$srand48_r_proto" in
17715 ''|0) try='int srand48_r(long, struct drand48_data*);'
17716 ./protochk "$extern_C $try" $hdrs && srand48_r_proto=I_LS ;;
17718 case "$srand48_r_proto" in
17719 ''|0) d_srand48_r=undef
17721 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
17722 * ) case "$srand48_r_proto" in
17723 REENTRANT_PROTO*) ;;
17724 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
17726 echo "Prototype: $try" ;;
17729 *) case "$usethreads" in
17730 define) echo "srand48_r has no prototype, not using it." >&4 ;;
17737 *) srand48_r_proto=0
17741 : see if srandom_r exists
17742 set srandom_r d_srandom_r
17744 case "$d_srandom_r" in
17746 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17747 case "$d_srandom_r_proto:$usethreads" in
17748 ":define") d_srandom_r_proto=define
17749 set d_srandom_r_proto srandom_r $hdrs
17753 case "$d_srandom_r_proto" in
17755 case "$srandom_r_proto" in
17756 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
17757 ./protochk "$extern_C $try" $hdrs && srandom_r_proto=I_TS ;;
17759 case "$srandom_r_proto" in
17760 ''|0) d_srandom_r=undef
17762 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
17763 * ) case "$srandom_r_proto" in
17764 REENTRANT_PROTO*) ;;
17765 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
17767 echo "Prototype: $try" ;;
17770 *) case "$usethreads" in
17771 define) echo "srandom_r has no prototype, not using it." >&4 ;;
17778 *) srandom_r_proto=0
17782 : see if prototype for setresgid is available
17784 set d_sresgproto setresgid $i_unistd unistd.h
17787 : see if prototype for setresuid is available
17789 set d_sresuproto setresuid $i_unistd unistd.h
17792 : see if sys/stat.h is available
17793 set sys/stat.h i_sysstat
17796 : see if stat knows about block sizes
17798 echo "Checking to see if your struct stat has st_blocks field..." >&4
17799 set d_statblks stat st_blocks $i_sysstat sys/stat.h
17802 : see if this is a sys/vfs.h system
17803 set sys/vfs.h i_sysvfs
17806 : see if this is a sys/statfs.h system
17807 set sys/statfs.h i_sysstatfs
17810 : Check for statfs_s
17812 echo "Checking to see if your system supports struct statfs..." >&4
17813 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
17815 case "$d_statfs_s" in
17816 "$define") echo "Yes, it does." ;;
17817 *) echo "No, it doesn't." ;;
17821 : see if struct statfs knows about f_flags
17822 case "$d_statfs_s" in
17825 echo "Checking to see if your struct statfs has f_flags field..." >&4
17826 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
17830 set d_statfs_f_flags
17834 case "$d_statfs_f_flags" in
17835 "$define") echo "Yes, it does." ;;
17836 *) echo "No, it doesn't." ;;
17839 : Check stream access
17841 Checking how to access stdio streams by file descriptor number...
17843 case "$stdio_stream_array" in
17844 '') $cat >try.c <<EOCP
17847 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
17851 for s in _iob __iob __sF
17853 set try -DSTDIO_STREAM_ARRAY=$s
17854 if eval $compile; then
17855 case "`$run ./try`" in
17856 yes) stdio_stream_array=$s; break ;;
17862 case "$stdio_stream_array" in
17864 I can't figure out how to access stdio streams by file descriptor number.
17866 d_stdio_stream_array="$undef"
17869 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
17871 d_stdio_stream_array="$define"
17875 : see if strcoll exists
17876 set strcoll d_strcoll
17879 : check for structure copying
17881 echo "Checking to see if your C compiler can copy structs..." >&4
17882 $cat >try.c <<'EOCP'
17892 if $cc -c try.c >/dev/null 2>&1 ; then
17894 echo "Yup, it can."
17897 echo "Nope, it can't."
17903 : see if strerror and/or sys_errlist[] exist
17905 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
17906 if set strerror val -f d_strerror; eval $csym; $val; then
17907 echo 'strerror() found.' >&4
17908 d_strerror="$define"
17909 d_strerrm='strerror(e)'
17910 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17911 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
17912 d_syserrlst="$define"
17914 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
17915 d_syserrlst="$undef"
17917 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
17918 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
17919 echo 'strerror() found in string header.' >&4
17920 d_strerror="$define"
17921 d_strerrm='strerror(e)'
17922 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17923 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
17924 d_syserrlst="$define"
17926 echo "(You don't appear to have any sys_errlist[], how can this be?)"
17927 d_syserrlst="$undef"
17929 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17930 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
17931 d_strerror="$undef"
17932 d_syserrlst="$define"
17933 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
17935 echo 'strerror() and sys_errlist[] NOT found.' >&4
17936 d_strerror="$undef"
17937 d_syserrlst="$undef"
17938 d_strerrm='"unknown"'
17942 : see if strerror_r exists
17943 set strerror_r d_strerror_r
17945 case "$d_strerror_r" in
17947 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
17948 case "$d_strerror_r_proto:$usethreads" in
17949 ":define") d_strerror_r_proto=define
17950 set d_strerror_r_proto strerror_r $hdrs
17954 case "$d_strerror_r_proto" in
17956 case "$strerror_r_proto" in
17957 ''|0) try='int strerror_r(int, char*, size_t);'
17958 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBW ;;
17960 case "$strerror_r_proto" in
17961 ''|0) try='int strerror_r(int, char*, int);'
17962 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBI ;;
17964 case "$strerror_r_proto" in
17965 ''|0) try='char* strerror_r(int, char*, size_t);'
17966 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=B_IBW ;;
17968 case "$strerror_r_proto" in
17969 ''|0) d_strerror_r=undef
17971 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
17972 * ) case "$strerror_r_proto" in
17973 REENTRANT_PROTO*) ;;
17974 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
17976 echo "Prototype: $try" ;;
17979 *) case "$usethreads" in
17980 define) echo "strerror_r has no prototype, not using it." >&4 ;;
17987 *) strerror_r_proto=0
17991 : see if strftime exists
17992 set strftime d_strftime
17995 : see if strlcat exists
17996 set strlcat d_strlcat
17999 : see if strlcpy exists
18000 set strlcpy d_strlcpy
18003 : see if strtod exists
18004 set strtod d_strtod
18007 : see if strtol exists
18008 set strtol d_strtol
18011 : see if strtold exists
18012 set strtold d_strtold
18015 : see if strtoll exists
18016 set strtoll d_strtoll
18019 case "$d_longlong-$d_strtoll" in
18022 Checking whether your strtoll() works okay...
18024 $cat >try.c <<'EOCP'
18027 #define strtoll __strtoll
18030 #define strtoll _strtoll
18033 extern long long int strtoll(char *s, char **, int);
18034 static int bad = 0;
18035 int check(char *s, long long ell, int een) {
18038 gll = strtoll(s, 0, 10);
18039 if (!((gll == ell) && (errno == een)))
18043 check(" 1", 1LL, 0);
18044 check(" 0", 0LL, 0);
18045 check("-1", -1LL, 0);
18046 check("-9223372036854775808", -9223372036854775808LL, 0);
18047 check("-9223372036854775808", -9223372036854775808LL, 0);
18048 check(" 9223372036854775807", 9223372036854775807LL, 0);
18049 check("-9223372036854775808", -9223372036854775808LL, 0);
18050 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
18051 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
18057 if eval $compile; then
18060 ok) echo "Your strtoll() seems to be working okay." ;;
18062 Your strtoll() doesn't seem to be working okay.
18068 echo "(I can't seem to compile the test program--assuming it doesn't)"
18074 : see if strtoq exists
18075 set strtoq d_strtoq
18078 : see if strtoul exists
18079 set strtoul d_strtoul
18082 case "$d_strtoul" in
18085 Checking whether your strtoul() works okay...
18087 $cat >try.c <<'EOCP'
18090 extern unsigned long int strtoul(char *s, char **, int);
18091 static int bad = 0;
18092 void check(char *s, unsigned long eul, int een) {
18095 gul = strtoul(s, 0, 10);
18096 if (!((gul == eul) && (errno == een)))
18100 check(" 1", 1L, 0);
18101 check(" 0", 0L, 0);
18103 case "$longsize" in
18105 $cat >>try.c <<'EOCP'
18106 check("18446744073709551615", 18446744073709551615UL, 0);
18107 check("18446744073709551616", 18446744073709551615UL, ERANGE);
18108 #if 0 /* strtoul() for /^-/ strings is undefined. */
18109 check("-1", 18446744073709551615UL, 0);
18110 check("-18446744073709551614", 2, 0);
18111 check("-18446744073709551615", 1, 0);
18112 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
18113 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
18118 $cat >>try.c <<'EOCP'
18119 check("4294967295", 4294967295UL, 0);
18120 check("4294967296", 4294967295UL, ERANGE);
18121 #if 0 /* strtoul() for /^-/ strings is undefined. */
18122 check("-1", 4294967295UL, 0);
18123 check("-4294967294", 2, 0);
18124 check("-4294967295", 1, 0);
18125 check("-4294967296", 4294967295UL, ERANGE);
18126 check("-4294967297", 4294967295UL, ERANGE);
18131 : Should we write these tests to be more portable by sprintf-ing
18132 : ~0 and then manipulating that char string as input for strtol?
18135 $cat >>try.c <<'EOCP'
18142 if eval $compile; then
18143 case "`$run ./try`" in
18144 ok) echo "Your strtoul() seems to be working okay." ;;
18146 Your strtoul() doesn't seem to be working okay.
18152 echo "(I can't seem to compile the test program--assuming it doesn't)"
18158 : see if strtoull exists
18159 set strtoull d_strtoull
18162 case "$d_longlong-$d_strtoull" in
18165 Checking whether your strtoull() works okay...
18167 $cat >try.c <<'EOCP'
18170 #define strtoull __strtoull
18173 extern unsigned long long int strtoull(char *s, char **, int);
18174 static int bad = 0;
18175 int check(char *s, long long eull, int een) {
18178 gull = strtoull(s, 0, 10);
18179 if (!((gull == eull) && (errno == een)))
18183 check(" 1", 1LL, 0);
18184 check(" 0", 0LL, 0);
18185 check("18446744073709551615", 18446744073709551615ULL, 0);
18186 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
18187 #if 0 /* strtoull() for /^-/ strings is undefined. */
18188 check("-1", 18446744073709551615ULL, 0);
18189 check("-18446744073709551614", 2LL, 0);
18190 check("-18446744073709551615", 1LL, 0);
18191 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
18192 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
18199 if eval $compile; then
18200 case "`$run ./try`" in
18201 ok) echo "Your strtoull() seems to be working okay." ;;
18203 Your strtoull() doesn't seem to be working okay.
18205 d_strtoull="$undef"
18209 echo "(I can't seem to compile the test program--assuming it doesn't)"
18210 d_strtoull="$undef"
18215 : see if strtouq exists
18216 set strtouq d_strtouq
18219 case "$d_strtouq" in
18222 Checking whether your strtouq() works okay...
18224 $cat >try.c <<'EOCP'
18227 extern unsigned long long int strtouq(char *s, char **, int);
18228 static int bad = 0;
18229 void check(char *s, unsigned long long eull, int een) {
18230 unsigned long long gull;
18232 gull = strtouq(s, 0, 10);
18233 if (!((gull == eull) && (errno == een)))
18237 check(" 1", 1LL, 0);
18238 check(" 0", 0LL, 0);
18239 check("18446744073709551615", 18446744073709551615ULL, 0);
18240 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
18241 #if 0 /* strtouq() for /^-/ strings is undefined. */
18242 check("-1", 18446744073709551615ULL, 0);
18243 check("-18446744073709551614", 2LL, 0);
18244 check("-18446744073709551615", 1LL, 0);
18245 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
18246 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
18254 if eval $compile; then
18255 case "`$run ./try`" in
18256 ok) echo "Your strtouq() seems to be working okay." ;;
18258 Your strtouq() doesn't seem to be working okay.
18264 echo "(I can't seem to compile the test program--assuming it doesn't)"
18270 : see if strxfrm exists
18271 set strxfrm d_strxfrm
18274 : see if symlink exists
18275 set symlink d_symlink
18278 : see if syscall exists
18279 set syscall d_syscall
18282 : see if prototype for syscall is available
18284 set d_syscallproto syscall $i_unistd unistd.h
18287 : see if sysconf exists
18288 set sysconf d_sysconf
18291 : see if system exists
18292 set system d_system
18295 : see if tcgetpgrp exists
18296 set tcgetpgrp d_tcgetpgrp
18299 : see if tcsetpgrp exists
18300 set tcsetpgrp d_tcsetpgrp
18303 : see if prototype for telldir is available
18305 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
18308 : see if time exists
18310 if test "X$d_time" = X -o X"$timetype" = X; then
18311 if set time val -f d_time; eval $csym; $val; then
18312 echo 'time() found.' >&4
18314 rp="What is the type returned by time() on this system?"
18315 set time_t timetype long stdio.h sys/types.h
18318 echo 'time() not found, hope that will do.' >&4
18326 : see if timegm exists
18327 set timegm d_timegm
18330 : see if this is a sys/times.h system
18331 set sys/times.h i_systimes
18334 : see if times exists
18336 if set times val -f d_times; eval $csym; $val; then
18337 echo 'times() found.' >&4
18340 case "$i_systimes" in
18341 "$define") inc='sys/times.h';;
18343 rp="What is the type returned by times() on this system?"
18344 set clock_t clocktype long stdio.h sys/types.h $inc
18347 echo 'times() NOT found, hope that will do.' >&4
18352 : see if tmpnam_r exists
18353 set tmpnam_r d_tmpnam_r
18355 case "$d_tmpnam_r" in
18357 hdrs="$i_systypes sys/types.h define stdio.h "
18358 case "$d_tmpnam_r_proto:$usethreads" in
18359 ":define") d_tmpnam_r_proto=define
18360 set d_tmpnam_r_proto tmpnam_r $hdrs
18364 case "$d_tmpnam_r_proto" in
18366 case "$tmpnam_r_proto" in
18367 ''|0) try='char* tmpnam_r(char*);'
18368 ./protochk "$extern_C $try" $hdrs && tmpnam_r_proto=B_B ;;
18370 case "$tmpnam_r_proto" in
18371 ''|0) d_tmpnam_r=undef
18373 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
18374 * ) case "$tmpnam_r_proto" in
18375 REENTRANT_PROTO*) ;;
18376 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
18378 echo "Prototype: $try" ;;
18381 *) case "$usethreads" in
18382 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
18389 *) tmpnam_r_proto=0
18393 : see if truncate exists
18394 set truncate d_truncate
18397 : see if ttyname_r exists
18398 set ttyname_r d_ttyname_r
18400 case "$d_ttyname_r" in
18402 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
18403 case "$d_ttyname_r_proto:$usethreads" in
18404 ":define") d_ttyname_r_proto=define
18405 set d_ttyname_r_proto ttyname_r $hdrs
18409 case "$d_ttyname_r_proto" in
18411 case "$ttyname_r_proto" in
18412 ''|0) try='int ttyname_r(int, char*, size_t);'
18413 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBW ;;
18415 case "$ttyname_r_proto" in
18416 ''|0) try='int ttyname_r(int, char*, int);'
18417 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBI ;;
18419 case "$ttyname_r_proto" in
18420 ''|0) try='char* ttyname_r(int, char*, int);'
18421 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=B_IBI ;;
18423 case "$ttyname_r_proto" in
18424 ''|0) d_ttyname_r=undef
18426 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
18427 * ) case "$ttyname_r_proto" in
18428 REENTRANT_PROTO*) ;;
18429 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
18431 echo "Prototype: $try" ;;
18434 *) case "$usethreads" in
18435 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
18442 *) ttyname_r_proto=0
18446 : see if tzname[] exists
18448 if set tzname val -a d_tzname; eval $csym; $val; then
18450 echo 'tzname[] found.' >&4
18453 echo 'tzname[] NOT found.' >&4
18458 : Check if is a multiplatform env
18460 next|rhapsody|darwin) multiarch="$define" ;;
18462 case "$multiarch" in
18463 ''|[nN]*) multiarch="$undef" ;;
18466 : check for ordering of bytes in a UV
18468 case "$usecrosscompile$multiarch" in
18471 You seem to be either cross-compiling or doing a multiarchitecture build,
18472 skipping the byteorder check.
18478 case "$byteorder" in
18481 In the following, larger digits indicate more significance. A big-endian
18482 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
18483 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
18484 machines may have weird orders like 3412. A Cray will report 87654321,
18485 an Alpha will report 12345678. If the test program works the default is
18487 I'm now running the test program...
18491 #$i_stdlib I_STDLIB
18493 #include <stdlib.h>
18495 #include <sys/types.h>
18496 typedef $uvtype UV;
18506 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
18508 u.l = (UV)0x04030201;
18509 for (i = 0; i < $uvsize; i++)
18510 printf("%c", u.c[i]+'0');
18517 if eval $compile && $run ./try > /dev/null; then
18520 [1-4][1-4][1-4][1-4]|12345678|87654321)
18521 echo "(The test program ran ok.)"
18522 echo "byteorder=$dflt"
18525 ????|????????) echo "(The test program ran ok.)" ;;
18526 *) echo "(The test program didn't run right for some reason.)" ;;
18531 (I can't seem to compile the test program. Guessing big-endian...)
18534 case "$xxx_prompt" in
18536 rp="What is the order of bytes in $uvtype?"
18549 : Checking 32bit aligndness
18552 Checking to see whether you can access character data unalignedly...
18554 case "$d_u32align" in
18555 '') $cat >try.c <<EOCP
18557 #$i_stdlib I_STDLIB
18559 #include <stdlib.h>
18561 #define U32 $u32type
18562 #define BYTEORDER 0x$byteorder
18564 #include <signal.h>
18566 $signal_t bletch(int s) { exit(4); }
18569 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
18574 if (sizeof(U32) != 4) {
18575 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
18582 signal(SIGBUS, bletch);
18594 for (i = 0; i < 4; i++) {
18595 up = (U32*)(buf + i);
18596 if (! ((*up == 1 << (8*i)) || /* big-endian */
18597 (*up == 1 << (8*(3-i))) /* little-endian */
18601 printf("read failed (%x)\n", *up);
18607 for (i = 0; i < 4; i++) {
18608 up = (U32*)(buf + i);
18610 if (*up != 0xBeef) {
18611 printf("write failed (%x)\n", *up);
18625 if eval $compile_ok; then
18626 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
18627 $run ./try 2>&1 >/dev/null
18630 You can access character data pretty unalignedly.
18632 d_u32align="$undef"
18635 It seems that you must access character data in an aligned manner.
18637 d_u32align="$define"
18641 rp='Can you access character data at unaligned addresses?'
18645 [yY]*) d_u32align="$undef" ;;
18646 *) d_u32align="$define" ;;
18653 : see if ualarm exists
18654 set ualarm d_ualarm
18657 : see if umask exists
18661 : see if unordered exists
18662 set unordered d_unordered
18665 : see if unsetenv exists
18666 set unsetenv d_unsetenv
18669 : see if usleep exists
18670 set usleep d_usleep
18673 : see if prototype for usleep is available
18675 set d_usleepproto usleep $i_unistd unistd.h
18678 : see if ustat exists
18682 : see if closedir exists
18683 set closedir d_closedir
18686 case "$d_closedir" in
18689 echo "Checking whether closedir() returns a status..." >&4
18691 #$i_dirent I_DIRENT /**/
18692 #$i_sysdir I_SYS_DIR /**/
18693 #$i_sysndir I_SYS_NDIR /**/
18694 #$i_systypes I_SYS_TYPES /**/
18696 #if defined(I_SYS_TYPES)
18697 #include <sys/types.h>
18699 #if defined(I_DIRENT)
18700 #include <dirent.h>
18701 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
18702 #include <sys/dir.h>
18706 #include <sys/ndir.h>
18710 #include <ndir.h> /* may be wrong in the future */
18712 #include <sys/dir.h>
18717 int main() { return closedir(opendir(".")); }
18720 if eval $compile_ok; then
18721 if $run ./try > /dev/null 2>&1 ; then
18722 echo "Yes, it does."
18725 echo "No, it doesn't."
18729 echo "(I can't seem to compile the test program--assuming it doesn't)"
18737 set d_void_closedir
18741 : see if there is a wait4
18745 : see if waitpid exists
18746 set waitpid d_waitpid
18749 : see if wcstombs exists
18750 set wcstombs d_wcstombs
18753 : see if wctomb exists
18754 set wctomb d_wctomb
18757 : see if writev exists
18758 set writev d_writev
18761 : preserve RCS keywords in files with variable substitution, grrr
18766 Revision='$Revision'
18768 : check for alignment requirements
18770 case "$usecrosscompile$multiarch" in
18773 You seem to be either cross-compiling or doing a multiarchitecture build,
18774 skipping the memory alignment check.
18777 case "$alignbytes" in
18778 '') alignbytes=8 ;;
18782 case "$alignbytes" in
18783 '') echo "Checking alignment constraints..." >&4
18784 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
18785 $cat >try.c <<'EOCP'
18786 typedef long double NV;
18789 $cat >try.c <<'EOCP'
18793 $cat >>try.c <<'EOCP'
18801 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
18806 if eval $compile_ok; then
18810 echo "(I can't seem to compile the test program...)"
18813 *) dflt="$alignbytes"
18816 rp="Doubles must be aligned on a how-many-byte boundary?"
18824 : set the base revision
18827 : check for length of character
18829 case "$charsize" in
18831 echo "Checking to see how big your characters are (hey, you never know)..." >&4
18834 #$i_stdlib I_STDLIB
18836 #include <stdlib.h>
18840 printf("%d\n", (int)sizeof(char));
18845 if eval $compile_ok; then
18849 echo "(I can't seem to compile the test program. Guessing...)"
18856 rp="What is the size of a character (in bytes)?"
18861 : Check for the number of bits in a character
18862 case "$charbits" in
18863 '') echo "Checking how long a character is (in bits)..." >&4
18870 for (c = 1, n = 0; c; c <<= 1, n++) ;
18871 printf ("%d\n", n);
18876 if eval $compile_ok; then
18880 echo "(I can't seem to compile the test program. Guessing...)"
18887 rp="What is the length of a character (in bits)?"
18891 case "$charbits" in
18894 Your system has an unsigned character size of $charbits bits, which
18895 is rather unusual (normally it is 8 bits). Perl likely will not work
18896 correctly on your system, with subtle bugs in various places.
18898 rp='Do you really want to continue?'
18902 [yY]) echo >&4 "Okay, continuing." ;;
18907 : how do we concatenate cpp tokens here?
18909 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
18910 $cat >cpp_stuff.c <<'EOCP'
18911 #define RCAT(a,b)a/**/b
18912 #define ACAT(a,b)a ## b
18916 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
18917 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
18918 echo "Oh! Smells like ANSI's been here." >&4
18919 echo "We can catify or stringify, separately or together!"
18921 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
18922 echo "Ah, yes! The good old days!" >&4
18923 echo "However, in the good old days we don't know how to stringify and"
18924 echo "catify at the same time."
18928 Hmm, I don't seem to be able to concatenate tokens with your cpp.
18929 You're going to have to edit the values of CAT[2-5] in config.h...
18931 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
18935 : see if this is a db.h system
18941 : Check db version.
18943 echo "Checking Berkeley DB version ..." >&4
18949 #include <sys/types.h>
18951 #$i_stdlib I_STDLIB
18953 #include <stdlib.h>
18956 int main(int argc, char *argv[])
18958 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
18959 int Major, Minor, Patch ;
18960 unsigned long Version ;
18961 (void)db_version(&Major, &Minor, &Patch) ;
18963 printf("%d %d %d %d %d %d\n",
18964 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
18965 Major, Minor, Patch);
18968 printf("You have Berkeley DB Version 2 or greater.\n");
18970 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
18971 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
18972 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
18973 Major, Minor, Patch) ;
18975 /* check that db.h & libdb are compatible */
18976 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
18977 printf("db.h and libdb are incompatible.\n") ;
18981 printf("db.h and libdb are compatible.\n") ;
18983 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
18984 + DB_VERSION_PATCH ;
18986 /* needs to be >= 2.3.4 */
18987 if (Version < 2003004) {
18988 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
18989 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
18995 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
19000 printf("You have Berkeley DB Version 1.\n");
19001 exit(0); /* DB version < 2: the coast is clear. */
19003 exit(1); /* <db.h> not Berkeley DB? */
19009 if eval $compile_ok && $run ./try; then
19010 echo 'Looks OK.' >&4
19012 db_version_major=$1
19013 db_version_minor=$2
19014 db_version_patch=$3
19016 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
19020 : Remove db from list of libraries to use
19021 echo "Removing unusable -ldb from library list" >&4
19022 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
19025 echo "libs = $libs" >&4
19035 : Check the return type needed for hash
19037 echo "Checking return type needed for hash for Berkeley DB ..." >&4
19043 #include <sys/types.h>
19046 #ifndef DB_VERSION_MAJOR
19047 u_int32_t hash_cb (ptr, size)
19055 info.hash = hash_cb;
19059 if $cc $ccflags -c try.c >try.out 2>&1 ; then
19060 if $contains warning try.out >>/dev/null 2>&1 ; then
19063 db_hashtype='u_int32_t'
19066 : XXX Maybe we should just give up here.
19067 db_hashtype=u_int32_t
19069 echo "Help: I can't seem to compile the db test program." >&4
19070 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
19073 echo "Your version of Berkeley DB uses $db_hashtype for hash."
19075 *) db_hashtype=u_int32_t
19080 : Check the return type needed for prefix
19082 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
19088 #include <sys/types.h>
19091 #ifndef DB_VERSION_MAJOR
19092 size_t prefix_cb (key1, key2)
19100 info.prefix = prefix_cb;
19104 if $cc $ccflags -c try.c >try.out 2>&1 ; then
19105 if $contains warning try.out >>/dev/null 2>&1 ; then
19106 db_prefixtype='int'
19108 db_prefixtype='size_t'
19111 db_prefixtype='size_t'
19112 : XXX Maybe we should just give up here.
19114 echo "Help: I can't seem to compile the db test program." >&4
19115 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
19118 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
19120 *) db_prefixtype='size_t'
19124 : How can we generate normalized random numbers ?
19126 echo "Looking for a random number function..." >&4
19127 case "$randfunc" in
19129 if set drand48 val -f; eval $csym; $val; then
19131 echo "Good, found drand48()." >&4
19132 elif set random val -f; eval $csym; $val; then
19134 echo "OK, found random()." >&4
19137 echo "Yick, looks like I have to use rand()." >&4
19148 *-Dmy_rand=*|*-Dmy_srand=*)
19149 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
19150 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
19151 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
19152 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
19156 while $test "$cont"; do
19157 rp="Use which function to generate random numbers?"
19159 if $test "$ans" = "$dflt"; then
19165 if set $ans val -f; eval $csym; $val; then
19169 rp="I cannot find function $ans. Use that name anyway?"
19178 case "$randfunc" in
19180 drand01="drand48()"
19186 case "$randbits" in
19188 echo "Checking to see how many bits your $randfunc() function produces..." >&4
19190 #$i_unistd I_UNISTD
19191 #$i_stdlib I_STDLIB
19194 # include <unistd.h>
19197 # include <stdlib.h>
19202 register unsigned long tmp;
19203 register unsigned long max = 0L;
19205 for (i = 1000; i; i--) {
19206 tmp = (unsigned long) $randfunc();
19207 if (tmp > max) max = tmp;
19209 for (i = 0; max; i++)
19215 if eval $compile_ok; then
19219 echo "(I can't seem to compile the test program...)"
19226 rp="How many bits does your $randfunc() function produce?"
19230 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
19231 seedfunc="s$randfunc"
19232 randseedtype=unsigned
19236 rp="How many bits does your $randfunc() function produce?"
19239 seedfunc="s$randfunc"
19240 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
19241 if set $seedfunc val -f; eval $csym; $val; then
19242 echo "(Using $seedfunc() to seed random generator)"
19244 echo "(Warning: no $seedfunc() to seed random generator)"
19247 randseedtype=unsigned
19254 : Determine if this is an EBCDIC system
19256 echo "Determining whether or not we are on an EBCDIC system..." >&4
19257 $cat >try.c <<'EOM'
19260 if ('M'==0xd4) return 0;
19267 if eval $compile_ok; then
19268 if $run ./try; then
19269 echo "You seem to speak EBCDIC." >&4
19272 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
19275 echo "I'm unable to compile the test program." >&4
19276 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
19282 : Check how to flush
19285 Checking how to flush all pending stdio output...
19287 # I only know how to find the first 32 possibly open files on SunOS.
19288 # See also hints/sunos_4_1.sh and util.c --AD
19290 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
19292 $cat >>try.c <<EOCP
19294 #$i_stdlib I_STDLIB
19296 #include <stdlib.h>
19298 #$i_unistd I_UNISTD
19300 # include <unistd.h>
19302 #$d_sysconf HAS_SYSCONF
19303 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
19304 #ifdef HAS_STDIO_STREAM_ARRAY
19305 # define STDIO_STREAM_ARRAY $stdio_stream_array
19310 p = fopen("try.out", "w");
19314 # ifdef TRY_FPRINTF
19318 #ifdef TRY_FFLUSH_NULL
19321 #ifdef TRY_FFLUSH_ALL
19323 long open_max = -1;
19324 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
19325 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
19327 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
19328 open_max = sysconf(_SC_OPEN_MAX);
19331 open_max = FOPEN_MAX;
19334 open_max = OPEN_MAX;
19343 # ifdef HAS_STDIO_STREAM_ARRAY
19344 if (open_max > 0) {
19346 for (i = 0; i < open_max; i++)
19347 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
19348 STDIO_STREAM_ARRAY[i]._file < open_max &&
19349 STDIO_STREAM_ARRAY[i]._flag)
19350 fflush(&STDIO_STREAM_ARRAY[i]);
19358 : first we have to find out how _not_ to flush
19360 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
19362 set try -DTRY_FPUTC
19363 if eval $compile; then
19364 $run ./try 2>/dev/null
19367 if $test ! -s try.out -a "X$code" = X42; then
19373 set try -DTRY_FPRINTF
19374 if eval $compile; then
19375 $run ./try 2>/dev/null
19378 if $test ! -s try.out -a "X$code" = X42; then
19379 output=-DTRY_FPRINTF
19385 : check for fflush NULL behaviour
19386 case "$fflushNULL" in
19387 '') set try -DTRY_FFLUSH_NULL $output
19388 if eval $compile; then
19389 $run ./try 2>/dev/null
19392 if $test -s try.out -a "X$code" = X42; then
19393 fflushNULL="`$cat try.out`"
19395 if $test "X$code" != X42; then
19397 (If this test failed, don't worry, we'll try another method shortly.)
19402 $rm -f core try.core core.try.*
19403 case "$fflushNULL" in
19405 Your fflush(NULL) works okay for output streams.
19406 Let's see if it clobbers input pipes...
19408 # As of mid-March 2000 all versions of Solaris appear to have a stdio
19409 # bug that improperly flushes the input end of pipes. So we avoid the
19410 # autoflush on fork/system/exec support for now. :-(
19411 $cat >tryp.c <<EOCP
19414 main(int argc, char **argv)
19420 while ((i = getc(stdin)) != -1
19421 && (*bp++ = i) != '\n'
19422 && bp < &buf[1024])
19425 fprintf(stdout, "%s", buf);
19433 fflushNULL="$define"
19435 if eval $compile; then
19437 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
19438 if cmp tryp.c tryp.out >/dev/null 2>&1; then
19440 fflush(NULL) seems to behave okay with input streams.
19442 fflushNULL="$define"
19445 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
19447 fflushNULL="$undef"
19450 $rm -f core tryp.c tryp.core core.tryp.*
19453 Your fflush(NULL) isn't working (contrary to ANSI C).
19455 fflushNULL="$undef"
19458 Cannot figure out whether your fflush(NULL) works or not.
19459 I'm assuming it doesn't (contrary to ANSI C).
19461 fflushNULL="$undef"
19465 $define|true|[yY]*)
19466 fflushNULL="$define"
19469 fflushNULL="$undef"
19472 : check explicit looping only if NULL did not work, and if the pipe
19473 : bug does not show up on an explicit flush too
19474 case "$fflushNULL" in
19476 $cat >tryp.c <<EOCP
19479 main(int argc, char **argv)
19485 while ((i = getc(stdin)) != -1
19486 && (*bp++ = i) != '\n'
19487 && bp < &buf[1024])
19490 fprintf(stdout, "%s", buf);
19499 if eval $compile; then
19501 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
19502 if cmp tryp.c tryp.out >/dev/null 2>&1; then
19504 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
19506 : now check for fflushall behaviour
19507 case "$fflushall" in
19508 '') set try -DTRY_FFLUSH_ALL $output
19509 if eval $compile; then
19511 (Now testing the other method--but note that this also may fail.)
19513 $run ./try 2>/dev/null
19516 if $test -s try.out -a "X$code" = X42; then
19517 fflushall="`$cat try.out`"
19521 case "$fflushall" in
19523 Whew. Flushing explicitly all the stdio streams works.
19525 fflushall="$define"
19528 Sigh. Flushing explicitly all the stdio streams doesn't work.
19533 Cannot figure out whether flushing stdio streams explicitly works or not.
19534 I'm assuming it doesn't.
19540 "$define"|true|[yY]*)
19541 fflushall="$define"
19549 All is futile. Even fflush(stdin) clobbers input pipes!
19556 $rm -f core tryp.c tryp.core core.tryp.*
19558 *) fflushall="$undef"
19562 case "$fflushNULL$fflushall" in
19565 OK, I give up. I cannot figure out how to flush pending stdio output.
19566 We won't be flushing handles at all before fork/exec/popen.
19572 : Store the full pathname to the ar program for use in the C program
19573 : Respect a hint or command line value for full_ar.
19578 : Store the full pathname to the sed program for use in the C program
19581 : see what type gids are declared as in the kernel
19583 echo "Looking for the type for group ids returned by getgid()."
19584 set gid_t gidtype xxx stdio.h sys/types.h
19588 xxx=`./findhdr sys/user.h`
19589 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
19591 unsigned) dflt="$1 $2" ;;
19595 *) dflt="$gidtype";;
19598 gid_t) echo "gid_t found." ;;
19599 *) rp="What is the type for group ids returned by getgid()?"
19605 : Check the size of GID
19608 *_t) zzz="$gidtype" ;;
19611 echo "Checking the size of $zzz..." >&4
19613 #include <sys/types.h>
19615 #$i_stdlib I_STDLIB
19617 #include <stdlib.h>
19620 printf("%d\n", (int)sizeof($gidtype));
19625 if eval $compile_ok; then
19629 echo "(I can't execute the test program--guessing $gidsize.)" >&4
19632 echo "Your $zzz is $gidsize bytes long."
19637 echo "(I can't compile the test program--guessing $gidsize.)" >&4
19641 : Check if GID is signed
19644 *_t) zzz="$gidtype" ;;
19647 echo "Checking the sign of $zzz..." >&4
19649 #include <sys/types.h>
19660 if eval $compile; then
19664 echo "(I can't execute the test program--guessing unsigned.)" >&4
19668 1) echo "Your $zzz is unsigned." ;;
19669 -1) echo "Your $zzz is signed." ;;
19675 echo "(I can't compile the test program--guessing unsigned.)" >&4
19679 : Check 64bit sizes
19682 if $test X"$quadtype" != X; then
19684 echo "Checking how to print 64-bit integers..." >&4
19686 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
19687 $cat >try.c <<'EOCP'
19688 #include <sys/types.h>
19691 int q = 12345678901;
19692 printf("%ld\n", q);
19696 if eval $compile; then
19700 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
19701 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
19702 echo "We will use %d."
19708 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
19709 $cat >try.c <<'EOCP'
19710 #include <sys/types.h>
19713 long q = 12345678901;
19714 printf("%ld\n", q);
19718 if eval $compile; then
19722 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
19723 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
19724 echo "We will use %ld."
19730 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
19731 $cat >try.c <<'EOCP'
19732 #include <sys/types.h>
19733 #include <inttypes.h>
19736 int64_t q = 12345678901;
19737 printf("%" PRId64 "\n", q);
19741 if eval $compile; then
19745 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
19746 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
19747 echo "We will use the C9X style."
19753 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
19755 #include <sys/types.h>
19758 $quadtype q = 12345678901;
19759 printf("%Ld\n", q);
19763 if eval $compile; then
19767 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
19768 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
19769 echo "We will use %Ld."
19775 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
19776 $cat >try.c <<'EOCP'
19777 #include <sys/types.h>
19780 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
19781 printf("%lld\n", q);
19785 if eval $compile; then
19789 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
19790 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
19791 echo "We will use the %lld style."
19797 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
19799 #include <sys/types.h>
19802 $quadtype q = 12345678901;
19803 printf("%qd\n", q);
19807 if eval $compile; then
19811 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
19812 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
19813 echo "We will use %qd."
19819 if $test X"$sPRId64" = X; then
19820 echo "Cannot figure out how to print 64-bit integers." >&4
19827 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
19828 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
19830 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
19831 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
19835 : Check format strings for internal types
19837 $echo "Checking the format strings to be used for Perl's internal types..." >&4
19839 if $test X"$ivsize" = X8; then
19840 ivdformat="$sPRId64"
19841 uvuformat="$sPRIu64"
19842 uvoformat="$sPRIo64"
19843 uvxformat="$sPRIx64"
19844 uvXUformat="$sPRIXU64"
19846 if $test X"$ivsize" = X"$longsize"; then
19853 if $test X"$ivsize" = X"$intsize"; then
19861 if $test X"$ivsize" = X"$shortsize"; then
19872 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
19873 nveformat="$sPRIeldbl"
19874 nvfformat="$sPRIfldbl"
19875 nvgformat="$sPRIgldbl"
19876 nvEUformat="$sPRIEUldbl"
19877 nvFUformat="$sPRIFUldbl"
19878 nvGUformat="$sPRIGUldbl"
19888 case "$ivdformat" in
19889 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
19894 : Check format string for GID
19897 $echo "Checking the format string to be used for gids..." >&4
19900 -1) if $test X"$gidsize" = X"$ivsize"; then
19901 gidformat="$ivdformat"
19903 if $test X"$gidsize" = X"$longsize"; then
19906 if $test X"$gidsize" = X"$intsize"; then
19909 if $test X"$gidsize" = X"$shortsize"; then
19916 *) if $test X"$gidsize" = X"$uvsize"; then
19917 gidformat="$uvuformat"
19919 if $test X"$gidsize" = X"$longsize"; then
19922 if $test X"$gidsize" = X"$intsize"; then
19925 if $test X"$gidsize" = X"$shortsize"; then
19934 : see if getgroups exists
19935 set getgroups d_getgrps
19938 : see if setgroups exists
19939 set setgroups d_setgrps
19942 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
19944 case "$d_getgrps$d_setgrps" in
19946 case "$groupstype" in
19947 '') dflt="$gidtype" ;;
19948 *) dflt="$groupstype" ;;
19951 What type of pointer is the second argument to getgroups() and setgroups()?
19952 Usually this is the same as group ids, $gidtype, but not always.
19955 rp='What type pointer is the second argument to getgroups() and setgroups()?'
19959 *) groupstype="$gidtype";;
19962 : MAD = Misc Attribute Definition
19964 if $test $patchlevel -lt 9; then
19965 : MAD is not available in 5.8.x or earlier.
19969 $define|true|[yY]*) dflt='y' ;;
19974 Would you like to build with Misc Attribute Decoration? This is development
19975 work leading to a Perl 5 to Perl 6 convertor, which imposes a space and speed
19976 overhead on the interpreter.
19978 If this doesn't make any sense to you, just accept the default '$dflt'.
19980 rp='Build Perl with MAD?'
19985 madlyh='madly.h madly.act madly.tab'
19987 madlyobj="madly$_o" ;;
19996 : check whether make sets MAKE
19998 echo "Checking if your $make program sets \$(MAKE)..." >&4
19999 case "$make_set_make" in
20001 $sed 's/^X //' > testmake.mak << 'EOF'
20003 X @echo 'maketemp="$(MAKE)"'
20005 case "`$make -f testmake.mak 2>/dev/null`" in
20006 *maketemp=*) make_set_make='#' ;;
20007 *) make_set_make="MAKE=$make" ;;
20009 $rm -f testmake.mak
20012 case "$make_set_make" in
20013 '#') echo "Yup, it does.";;
20014 *) echo "Nope, it doesn't.";;
20017 : see what type is used for mode_t
20018 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
20019 set mode_t modetype int stdio.h sys/types.h
20022 : see if we need va_copy
20024 case "$i_stdarg" in
20027 #include <stdarg.h>
20029 #$i_stdlib I_STDLIB
20031 #include <stdlib.h>
20033 #include <signal.h>
20036 ivfprintf(FILE *f, const char *fmt, va_list *valp)
20038 return vfprintf(f, fmt, *valp);
20042 myvfprintf(FILE *f, const char *fmt, va_list val)
20044 return ivfprintf(f, fmt, &val);
20048 myprintf(char *fmt, ...)
20051 va_start(val, fmt);
20052 return myvfprintf(stdout, fmt, val);
20056 main(int ac, char **av)
20058 signal(SIGSEGV, exit);
20060 myprintf("%s%cs all right, then\n", "that", '\'');
20065 if eval $compile && $run ./try 2>&1 >/dev/null; then
20066 case "`$run ./try`" in
20067 "that's all right, then")
20073 yes) echo "It seems that you don't need va_copy()." >&4
20074 need_va_copy="$undef"
20076 *) echo "It seems that va_copy() or similar will be needed." >&4
20077 need_va_copy="$define"
20082 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
20086 : see what type is used for size_t
20087 rp="What is the type used for the length parameter for string functions?"
20088 set size_t sizetype 'unsigned int' stdio.h sys/types.h
20091 : check for type of arguments to gethostbyaddr.
20092 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
20093 case "$d_gethbyaddr" in
20097 Checking to see what type of arguments are accepted by gethostbyaddr().
20099 hdrs="$define sys/types.h
20100 $d_socket sys/socket.h
20101 $i_niin netinet/in.h
20103 $i_unistd unistd.h"
20104 : The first arg can 'char *' or 'void *'
20105 : The second arg is some of integral type
20106 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
20107 for yyy in size_t long int; do
20108 case "$netdb_host_type" in
20109 '') try="$extern_C struct hostent *gethostbyaddr($xxx, $yyy, int);"
20110 if ./protochk "$try" $hdrs; then
20111 echo "Your system accepts $xxx for the first arg."
20112 echo "...and $yyy for the second arg."
20113 netdb_host_type="$xxx"
20114 netdb_hlen_type="$yyy"
20120 : In case none of those worked, prompt the user.
20121 case "$netdb_host_type" in
20122 '') rp='What is the type for the 1st argument to gethostbyaddr?'
20125 netdb_host_type=$ans
20126 rp='What is the type for the 2nd argument to gethostbyaddr?'
20129 netdb_hlen_type=$ans
20133 *) : no gethostbyaddr, so pick harmless defaults
20134 netdb_host_type='char *'
20135 netdb_hlen_type="$sizetype"
20138 # Remove the "const" if needed. -- but then we'll have a
20140 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
20143 : check for type of argument to gethostbyname.
20144 if test "X$netdb_name_type" = X ; then
20145 case "$d_gethbyname" in
20149 Checking to see what type of argument is accepted by gethostbyname().
20151 hdrs="$define sys/types.h
20152 $d_socket sys/socket.h
20153 $i_niin netinet/in.h
20155 $i_unistd unistd.h"
20156 for xxx in "const char *" "char *"; do
20157 case "$netdb_name_type" in
20158 '') try="$extern_C struct hostent *gethostbyname($xxx);"
20159 if ./protochk "$try" $hdrs; then
20160 echo "Your system accepts $xxx."
20161 netdb_name_type="$xxx"
20166 : In case none of those worked, prompt the user.
20167 case "$netdb_name_type" in
20168 '') rp='What is the type for the 1st argument to gethostbyname?'
20171 netdb_name_type=$ans
20175 *) : no gethostbyname, so pick harmless default
20176 netdb_name_type='char *'
20181 : check for type of 1st argument to getnetbyaddr.
20182 if test "X$netdb_net_type" = X ; then
20183 case "$d_getnbyaddr" in
20187 Checking to see what type of 1st argument is accepted by getnetbyaddr().
20189 hdrs="$define sys/types.h
20190 $d_socket sys/socket.h
20191 $i_niin netinet/in.h
20193 $i_unistd unistd.h"
20194 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
20195 case "$netdb_net_type" in
20196 '') try="$extern_C struct netent *getnetbyaddr($xxx, int);"
20197 if ./protochk "$try" $hdrs; then
20198 echo "Your system accepts $xxx."
20199 netdb_net_type="$xxx"
20204 : In case none of those worked, prompt the user.
20205 case "$netdb_net_type" in
20206 '') rp='What is the type for the 1st argument to getnetbyaddr?'
20209 netdb_net_type=$ans
20213 *) : no getnetbyaddr, so pick harmless default
20214 netdb_net_type='long'
20218 : locate the preferred pager for this system
20225 [a-zA-Z]:/*) dflt=$pg;;
20229 [a-zA-Z]:/*) dflt=$more;;
20233 [a-zA-Z]:/*) dflt=$less;;
20236 '') dflt=/usr/ucb/more;;
20244 rp='What pager is used on your system?'
20248 : see what type pids are declared as in the kernel
20249 rp="What is the type of process ids on this system?"
20250 set pid_t pidtype int stdio.h sys/types.h
20253 : see if ar generates random libraries by itself
20255 echo "Checking how to generate random libraries on your machine..." >&4
20256 echo 'int bar1() { return bar2(); }' > bar1.c
20257 echo 'int bar2() { return 2; }' > bar2.c
20259 #$i_stdlib I_STDLIB
20261 #include <stdlib.h>
20263 int main() { printf("%d\n", bar1()); exit(0); }
20265 $cc $ccflags -c bar1.c >/dev/null 2>&1
20266 $cc $ccflags -c bar2.c >/dev/null 2>&1
20267 $cc $ccflags -c foo.c >/dev/null 2>&1
20268 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
20269 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20270 $run ./foobar >/dev/null 2>&1; then
20271 echo "$ar appears to generate random libraries itself."
20273 if [ "X$ranlib" = "X" ]; then
20276 elif $ar s bar$_a >/dev/null 2>&1 &&
20277 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20278 $run ./foobar >/dev/null 2>&1; then
20279 echo "a table of contents needs to be added with '$ar s'."
20282 elif $ar ts bar$_a >/dev/null 2>&1 &&
20283 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20284 $run ./foobar >/dev/null 2>&1; then
20285 echo "a table of contents needs to be added with '$ar ts'."
20292 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
20293 $test -f $ranlib || ranlib=''
20296 if $test -n "$ranlib"; then
20297 echo "your system has '$ranlib'; we'll use that."
20300 echo "your system doesn't seem to support random libraries"
20301 echo "so we'll use lorder and tsort to order the libraries."
20308 : see if this is a values.h system
20309 set values.h i_values
20312 : Check the max offset that gmtime and localtime accept
20313 echo "Checking max offsets that gmtime () accepts"
20316 define) yyy="#include <values.h>" ;;
20320 case "$sGMTIME_min/$sGMTIME_max" in
20323 #include <sys/types.h>
20332 void gm_check (time_t t, int min_year, int max_year)
20335 if ( tmp == NULL ||
20336 /* Check tm_year overflow */
20337 tmp->tm_year < min_year || tmp->tm_year > max_year)
20348 gm_check (MAXLONG, 69, 0x7fffffff);
20350 if (tmp == NULL || tmp->tm_year < 0) {
20351 for (i = 63; i >= 0; i--) {
20352 time_t x = pt | ((time_t)1 << i);
20353 if (x < 0 || x < pt) continue;
20354 gm_check (x, 69, 0x7fffffff);
20357 printf ("sGMTIME_max=%ld\n", pt);
20366 gm_check (MINLONG, -1900, 70);
20369 for (i = 36; i >= 0; i--) {
20370 time_t x = pt - ((time_t)1 << i);
20371 if (x > 0) continue;
20372 gm_check (x, -1900, 70);
20375 printf ("sGMTIME_min=%ld\n", pt);
20379 int main (int argc, char *argv[])
20381 fprintf (stderr, "Sizeof time_t = %ld\n", sizeof (time_t));
20388 if eval $compile; then
20391 echo "Cannot determine sGMTIME_max and sGMTIME_min." >&4
20397 echo "Checking max offsets that localtime () accepts"
20399 case "$sLOCALTIME_min/$sLOCALTIME_max" in
20402 #include <sys/types.h>
20411 void local_check (time_t t, int min_year, int max_year)
20413 if (sizeof (time_t) > 4 && t > 0x7ffffffffffff000LL)
20416 tmp = localtime (&t);
20417 if ( tmp == NULL ||
20418 /* Check tm_year overflow */
20419 tmp->tm_year < min_year || tmp->tm_year > max_year)
20423 } /* local_check */
20430 local_check (MAXLONG, 69, 0x7fffffff);
20432 if (tmp == NULL || tmp->tm_year < 0) {
20433 for (i = 63; i >= 0; i--) {
20434 time_t x = pt | ((time_t)1 << i);
20435 if (x < 0 || x < pt) continue;
20436 local_check (x, 69, 0x7fffffff);
20439 printf ("sLOCALTIME_max=%ld\n", pt);
20448 local_check (MINLONG, -1900, 70);
20451 for (i = 36; i >= 0; i--) {
20452 time_t x = pt - ((time_t)1 << i);
20453 if (x > 0) continue;
20454 local_check (x, -1900, 70);
20457 printf ("sLOCALTIME_min=%ld\n", pt);
20461 int main (int argc, char *argv[])
20469 if eval $compile; then
20472 echo "Cannot determine sLOCALTIME_max and sLOCALTIME_min." >&4
20478 : check for type of arguments to select.
20479 case "$selecttype" in
20480 '') case "$d_select" in
20484 Checking to see what type of arguments are accepted by select().
20486 hdrs="$define sys/types.h
20487 $i_systime sys/time.h
20488 $i_sysselct sys/select.h
20489 $d_socket sys/socket.h"
20490 : The first arg can be int, unsigned, or size_t
20491 : The last arg may or may not be 'const'
20493 : void pointer has been seen but using that
20494 : breaks the selectminbits test
20495 for xxx in 'fd_set *' 'int *'; do
20496 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
20497 for tmo in 'struct timeval *' 'const struct timeval *'; do
20499 '') try="$extern_C select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
20500 if ./protochk "$try" $hdrs; then
20501 echo "Your system accepts $xxx."
20510 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
20511 case "$d_fd_set" in
20512 $define) dflt="fd_set *" ;;
20521 *) : no select, so pick a harmless default
20528 : check for the select 'width'
20529 case "$selectminbits" in
20530 '') safebits=`expr $ptrsize \* 8`
20531 case "$d_select" in
20535 Checking to see on how many bits at a time your select() operates...
20538 #include <sys/types.h>
20540 #$i_systime I_SYS_TIME
20541 #$i_systimek I_SYS_TIME_KERNEL
20546 # ifdef I_SYS_TIME_KERNEL
20549 # include <sys/time.h>
20550 # ifdef I_SYS_TIME_KERNEL
20554 #$i_sysselct I_SYS_SELECT
20555 #ifdef I_SYS_SELECT
20556 #include <sys/select.h>
20558 #$d_socket HAS_SOCKET
20560 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
20563 #$i_stdlib I_STDLIB
20565 #include <stdlib.h>
20568 #define S sizeof(*(b))
20570 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
20571 #define NBITS (NBYTES * 8)
20573 char *s = (char *)malloc(NBYTES);
20582 fp = fopen("try.c", "r");
20588 b = ($selecttype)s;
20589 for (i = 0; i < NBITS; i++)
20593 select(fd + 1, b, 0, 0, &t);
20594 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
20596 printf("%d\n", i + 1);
20601 if eval $compile_ok; then
20602 selectminbits=`$run ./try`
20603 case "$selectminbits" in
20605 Cannot figure out on how many bits at a time your select() operates.
20606 I'll play safe and guess it is $safebits bits.
20608 selectminbits=$safebits
20609 bits="$safebits bits"
20612 *) bits="$selectminbits bits" ;;
20614 echo "Your select() operates on $bits at a time." >&4
20616 rp='What is the minimum number of bits your select() operates on?'
20617 case "$byteorder" in
20618 12345678) dflt=64 ;;
20624 selectminbits="$val"
20628 *) : no select, so pick a harmless default
20629 selectminbits=$safebits
20635 : Trace out the files included by signal.h, then look for SIGxxx names.
20636 if [ "X$fieldn" = X ]; then
20637 : Just make some guesses. We check them later.
20638 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
20640 xxx=`echo '#include <signal.h>' |
20641 $cppstdin $cppminus $cppflags 2>/dev/null |
20642 $grep '^[ ]*#.*include' |
20643 $awk "{print \\$$fieldn}" | $sed 's!"!!g' |\
20644 $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
20647 for xx in $xxx /dev/null ; do
20648 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
20650 case "$xxxfiles" in
20651 '') xxxfiles=`./findhdr signal.h` ;;
20654 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
20655 print substr($2, 4, 20)
20657 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
20658 print substr($3, 4, 20)
20660 : Append some common names just in case the awk scan failed.
20661 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
20662 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
20663 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
20664 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
20665 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
20667 : generate a few handy files for later
20668 $cat > signal.c <<EOCP
20669 #include <sys/types.h>
20670 #include <signal.h>
20671 #$i_stdlib I_STDLIB
20673 #include <stdlib.h>
20678 /* Strange style to avoid deeply-nested #if/#else/#endif */
20681 # define NSIG (_NSIG)
20687 # define NSIG (SIGMAX+1)
20693 # define NSIG (SIG_MAX+1)
20699 # define NSIG (_SIG_MAX+1)
20705 # define NSIG (MAXSIG+1)
20711 # define NSIG (MAX_SIG+1)
20716 # ifdef SIGARRAYSIZE
20717 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
20723 # define NSIG (_sys_nsig) /* Solaris 2.5 */
20727 /* Default to some arbitrary number that's big enough to get most
20728 of the common signals.
20734 printf("NSIG %d\n", NSIG);
20740 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
20742 printf "#ifdef SIG"; printf $1; printf "\n"
20743 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
20744 printf $1; printf ");\n"
20748 printf "#endif /* JUST_NSIG */\n";
20749 printf "exit(0);\n}\n";
20752 $cat >signal.awk <<'EOP'
20753 BEGIN { ndups = 0 }
20754 $1 ~ /^NSIG$/ { nsig = $2 }
20755 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
20756 if ($2 > maxsig) { maxsig = $2 }
20757 if (sig_name[$2]) {
20758 dup_name[ndups] = $1
20759 dup_num[ndups] = $2
20771 printf("NSIG %d\n", nsig);
20772 for (n = 1; n < nsig; n++) {
20774 printf("%s %d\n", sig_name[n], sig_num[n])
20777 printf("NUM%d %d\n", n, n)
20780 for (n = 0; n < ndups; n++) {
20781 printf("%s %d\n", dup_name[n], dup_num[n])
20785 $cat >signal_cmd <<EOS
20787 if $test -s signal.lst; then
20788 echo "Using your existing signal.lst file"
20793 $cat >>signal_cmd <<'EOS'
20796 if eval $compile_ok; then
20797 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) |\
20798 $uniq | $awk -f signal.awk >signal.lst
20800 echo "(I can't seem be able to compile the whole test program)" >&4
20801 echo "(I'll try it in little pieces.)" >&4
20802 set signal -DJUST_NSIG
20803 if eval $compile_ok; then
20804 $run ./signal$_exe > signal.nsg
20807 echo "I can't seem to figure out how many signals you have." >&4
20808 echo "Guessing 50." >&4
20809 echo 'NSIG 50' > signal.nsg
20811 : Now look at all the signal names, one at a time.
20812 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
20813 $cat > signal.c <<EOCP
20814 #include <sys/types.h>
20815 #include <signal.h>
20818 printf("$xx %d\n", SIG${xx});
20823 if eval $compile; then
20824 echo "SIG${xx} found."
20825 $run ./signal$_exe >> signal.ls1
20827 echo "SIG${xx} NOT found."
20830 if $test -s signal.ls1; then
20831 $cat signal.nsg signal.ls1 |
20832 $sort -n | $uniq | $awk -f signal.awk >signal.lst
20836 if $test -s signal.lst; then
20839 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
20840 echo 'kill -l' >signal
20841 set X `csh -f <signal`
20845 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
20847 echo $@ | $tr ' ' $trnl | \
20848 $awk '{ printf "%s %d\n", $1, ++s; }
20849 END { printf "NSIG %d\n", ++s }' >signal.lst
20851 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
20853 chmod a+x signal_cmd
20854 $eunicefix signal_cmd
20856 : generate list of signal names
20858 case "$sig_name_init" in
20860 *) case "$sig_num_init" in
20861 ''|*,*) doinit=yes ;;
20866 echo "Generating a list of signal names and numbers..." >&4
20868 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
20869 sig_name=`$awk 'BEGIN { printf "ZERO " }
20870 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
20871 sig_num=`$awk 'BEGIN { printf "0 " }
20872 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
20873 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
20874 !/^NSIG/ { printf "\"%s\", ", $1 }
20875 END { printf "0\n" }' signal.lst`
20876 sig_num_init=`$awk 'BEGIN { printf "0, " }
20877 !/^NSIG/ { printf "%d, ", $2}
20878 END { printf "0\n"}' signal.lst`
20881 echo "The following $sig_count signals are available:"
20883 echo $sig_name | $awk \
20884 'BEGIN { linelen = 0 }
20886 for (i = 1; i <= NF; i++) {
20887 name = "SIG" $i " "
20888 linelen = linelen + length(name)
20889 if (linelen > 70) {
20891 linelen = length(name)
20897 sig_size=`echo $sig_name | awk '{print NF}'`
20898 $rm -f signal signal.c signal.awk signal.lst signal_cmd
20900 : Check size of size
20902 case "$sizetype" in
20903 *_t) zzz="$sizetype" ;;
20904 *) zzz="filesize" ;;
20906 echo "Checking the size of $zzz..." >&4
20908 #include <sys/types.h>
20910 #$i_stdlib I_STDLIB
20912 #include <stdlib.h>
20915 printf("%d\n", (int)sizeof($sizetype));
20920 if eval $compile_ok; then
20924 echo "(I can't execute the test program--guessing $sizesize.)" >&4
20927 echo "Your $zzz size is $sizesize bytes."
20932 echo "(I can't compile the test program--guessing $sizesize.)" >&4
20936 : check for socklen_t
20938 echo "Checking to see if you have socklen_t..." >&4
20940 #include <sys/types.h>
20941 #$d_socket HAS_SOCKET
20943 #include <sys/socket.h>
20945 int main() { socklen_t x = 16; }
20948 if eval $compile; then
20950 echo "You have socklen_t."
20953 echo "You do not have socklen_t."
20954 case "$sizetype" in
20955 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
20962 : see if this is a socks.h system
20963 set socks.h i_socks
20966 : check for type of the size argument to socket calls
20967 case "$d_socket" in
20971 Checking to see what type is the last argument of accept().
20974 case "$d_socklen_t" in
20975 "$define") yyy="$yyy socklen_t"
20977 yyy="$yyy $sizetype int long unsigned"
20978 for xxx in $yyy; do
20979 case "$socksizetype" in
20980 '') try="$extern_C int accept(int, struct sockaddr *, $xxx *);"
20981 case "$usesocks" in
20983 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
20984 echo "Your system accepts '$xxx *' for the last argument of accept()."
20985 socksizetype="$xxx"
20988 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
20989 echo "Your system accepts '$xxx *' for the last argument of accept()."
20990 socksizetype="$xxx"
20997 : In case none of those worked, prompt the user.
20998 case "$socksizetype" in
20999 '') rp='What is the type for socket address structure sizes?'
21006 *) : no sockets, so pick relatively harmless default
21011 : see what type is used for signed size_t
21012 set ssize_t ssizetype int stdio.h sys/types.h
21017 #$i_stdlib I_STDLIB
21019 #include <stdlib.h>
21021 #include <sys/types.h>
21022 #define Size_t $sizetype
21023 #define SSize_t $dflt
21026 if (sizeof(Size_t) == sizeof(SSize_t))
21028 else if (sizeof(Size_t) == sizeof(int))
21037 if eval $compile_ok && $run ./try > /dev/null; then
21038 ssizetype=`$run ./try`
21039 echo "I'll be using $ssizetype for functions returning a byte count." >&4
21042 Help! I can't compile and run the ssize_t test program: please enlighten me!
21043 (This is probably a misconfiguration in your system or libraries, and
21044 you really ought to fix it. Still, I'll try anyway.)
21046 I need a type that is the same size as $sizetype, but is guaranteed to
21047 be signed. Common values are ssize_t, int and long.
21050 rp="What signed type is the same size as $sizetype?"
21056 : see what type of char stdio uses.
21058 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
21059 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
21060 echo "Your stdio uses unsigned chars." >&4
21061 stdchar="unsigned char"
21063 echo "Your stdio uses signed chars." >&4
21068 : see what type uids are declared as in the kernel
21070 echo "Looking for the type for user ids returned by getuid()."
21071 set uid_t uidtype xxx stdio.h sys/types.h
21075 xxx=`./findhdr sys/user.h`
21076 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
21078 unsigned) dflt="$1 $2" ;;
21082 *) dflt="$uidtype";;
21085 uid_t) echo "uid_t found." ;;
21086 *) rp="What is the type for user ids returned by getuid()?"
21092 : Check size of UID
21095 *_t) zzz="$uidtype" ;;
21098 echo "Checking the size of $zzz..." >&4
21100 #include <sys/types.h>
21102 #$i_stdlib I_STDLIB
21104 #include <stdlib.h>
21107 printf("%d\n", (int)sizeof($uidtype));
21112 if eval $compile_ok; then
21116 echo "(I can't execute the test program--guessing $uidsize.)" >&4
21119 echo "Your $zzz is $uidsize bytes long."
21124 echo "(I can't compile the test program--guessing $uidsize.)" >&4
21127 : Check if UID is signed
21130 *_t) zzz="$uidtype" ;;
21133 echo "Checking the sign of $zzz..." >&4
21135 #include <sys/types.h>
21146 if eval $compile; then
21150 echo "(I can't execute the test program--guessing unsigned.)" >&4
21154 1) echo "Your $zzz is unsigned." ;;
21155 -1) echo "Your $zzz is signed." ;;
21161 echo "(I can't compile the test program--guessing unsigned.)" >&4
21165 : Check format string for UID
21167 $echo "Checking the format string to be used for uids..." >&4
21170 -1) if $test X"$uidsize" = X"$ivsize"; then
21171 uidformat="$ivdformat"
21173 if $test X"$uidsize" = X"$longsize"; then
21176 if $test X"$uidsize" = X"$intsize"; then
21179 if $test X"$uidsize" = X"$shortsize"; then
21186 *) if $test X"$uidsize" = X"$uvsize"; then
21187 uidformat="$uvuformat"
21189 if $test X"$uidsize" = X"$longsize"; then
21192 if $test X"$uidsize" = X"$intsize"; then
21195 if $test X"$uidsize" = X"$shortsize"; then
21204 : Check if site customization support was requested
21205 case "$usesitecustomize" in
21206 $define|true|[Yy]*)
21207 usesitecustomize="$define"
21210 usesitecustomize="$undef"
21214 : see if prototypes support variable argument declarations
21216 case "$prototype$i_stdarg" in
21218 echo "It appears we'll be able to prototype varargs functions." >&4
21222 echo "Too bad... We won't be using prototyped varargs functions..." >&4
21229 : determine compiler compiler
21238 if $test -f "$byacc$_exe"; then
21240 comp="byacc or $comp"
21242 if $test -f "$bison$_exe"; then
21243 comp="$comp or bison -y"
21245 rp="Which compiler compiler ($comp) shall I use?"
21254 echo "(Adding -y option to bison to get yacc-compatible behaviour.)"
21260 : see if this is a assert.h system
21261 set assert.h i_assert
21264 : see if this is a fp.h system
21268 : see if this is a fp_class.h system
21269 set fp_class.h i_fp_class
21272 : see if gdbm.h is available
21277 : see if gdbm_open exists
21278 set gdbm_open d_gdbm_open
21280 case "$d_gdbm_open" in
21283 echo "We won't be including <gdbm.h>"
21292 : see if this is a ieeefp.h system
21293 case "$i_ieeefp" in
21294 '' ) set ieeefp.h i_ieeefp
21299 : see if this is a libutil.h system
21300 set libutil.h i_libutil
21303 : see if mach cthreads are available
21304 if test "X$usethreads" = "X$define"; then
21305 set mach/cthreads.h i_machcthr
21308 i_machcthr="$undef"
21311 : see if this is a mntent.h system
21312 set mntent.h i_mntent
21315 : see if net/errno.h is available
21317 set net/errno.h val
21320 : Unfortunately, it causes problems on some systems. Arrgh.
21323 cat > try.c <<'EOM'
21326 #include <net/errno.h>
21332 if $cc $ccflags -c try.c >/dev/null 2>&1; then
21333 echo "We'll be including <net/errno.h>." >&4
21335 echo "We won't be including <net/errno.h>." >&4
21344 : see if netinet/tcp.h is available
21345 set netinet/tcp.h i_netinettcp
21348 : see if this is a poll.h system
21352 : see if this is a prot.h system
21356 : Preprocessor symbols
21358 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
21359 $cat <<'EOSH' > Cppsym.know
21360 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
21361 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
21362 alliant alpha am29000 AM29000 AMD64 amd64 amiga AMIGAOS AMIX
21363 ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
21364 BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
21365 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
21366 bull c cadmus clipper CMU COFF COMPILER_VERSION
21367 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
21368 CYGWIN DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
21369 Dynix DynixPTX ELF encore EPI EXTENSIONS FAVOR_BSD
21370 FILE_OFFSET_BITS FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
21372 GNU_SOURCE GNUC GNUC_MINOR GNU_LIBRARY GO32 gould GOULD_PN
21373 H3050R H3050RX hbullx20 hcx host_mips
21374 hp200 hp300 hp700 HP700 hp800 hp9000
21375 hp9000s200 hp9000s300 hp9000s400 hp9000s500
21376 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
21377 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
21378 IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
21379 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
21380 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
21381 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
21382 LIBCATAMOUNT Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
21383 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
21384 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
21385 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
21386 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
21387 MATH_HAS_NO_SIDE_EFFECTS
21388 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
21389 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
21390 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
21391 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
21392 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
21393 NetBSD news1500 news1700 news1800 news1900 news3700
21394 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
21395 ns32016 ns32332 ns32k nsc32000
21396 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
21397 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
21398 pc532 pdp11 PGC PIC plexus PORTAR posix
21399 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
21400 POSIX_C_SOURCE POSIX_SOURCE POWER
21401 PROTOTYPES PWB pyr QNX QK_USER R3000 REENTRANT RES Rhapsody RISC6000
21402 riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
21403 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
21404 sony sony_news sonyrisc sparc sparclite spectrum
21405 stardent stdc STDC_EXT stratos sun sun3 sun386
21406 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
21407 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
21408 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
21409 sysV68 sysV88 Tek4132 Tek4300 titan
21410 TM3200 TM5400 TM5600
21411 tower tower32 tower32_200 tower32_600 tower32_700
21412 tower32_800 tower32_850 tss
21413 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
21414 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
21415 unix UNIX95 UNIX99 unixpc unos
21416 USE_BSD USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE USE_LARGEFILE64
21417 USE_MISC USE_POSIX USE_POSIX199309 USE_POSIX199506 USE_POSIX2
21418 USE_REENTRANT USE_SVID USE_UNIX98 USE_XOPEN USE_XOPEN_EXTENDED
21420 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms x86_64 xenix Xenix286
21421 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
21422 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
21425 # Maybe put other stuff here too.
21426 cat <<EOSH >>Cppsym.know
21429 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
21430 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
21431 $cat Cppsym.know > Cppsym.c
21432 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
21433 $rm -f Cppsym.a Cppsym.b Cppsym.c
21434 cat <<EOSH > Cppsym
21436 if $test \$# -gt 0; then
21437 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
21438 if $test -s Cppsym.got; then
21445 $tr " " "$trnl" | ./Cppsym.try
21451 cat <<EOSH > Cppsym.try
21453 cat <<'EOCP' > try.c
21456 #define STRINGIFY(a) "a"
21458 #if cpp_stuff == 42
21459 #define StGiFy(a) #a
21460 #define STRINGIFY(a) StGiFy(a)
21462 #if $cpp_stuff != 1 && $cpp_stuff != 42
21463 # include "Bletch: How does this C preprocessor stringify macros?"
21469 cat <<'EOSH' >> Cppsym.try
21471 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
21472 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
21473 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
21474 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
21476 echo 'return 0;}' >> try.c
21478 cat <<EOSH >> Cppsym.try
21480 case "$osname-$gccversion" in
21481 irix-) ccflags="\$ccflags -woff 1178" ;;
21482 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
21484 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs && $run ./try | $sed 's/ /\\\\ /g'
21486 chmod +x Cppsym.try
21487 $eunicefix Cppsym.try
21488 ./Cppsym < Cppsym.know > Cppsym.true
21489 : Add in any linux cpp "predefined macros":
21490 case "$osname::$gccversion" in
21491 *linux*::*.*|*gnukfreebsd*::*.*)
21493 rm -f $tHdrH'.h' $tHdrH
21495 if $cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
21496 sed 's/#define[\ \ ]*//;s/[\ \ ].*$//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
21497 if [ -s $tHdrH'_cppsym.real' ]; then
21498 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
21501 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
21504 : now check the C compiler for additional symbols
21505 postprocess_cc_v=''
21507 aix) postprocess_cc_v="|$tr , ' '" ;;
21514 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
21517 -D*) echo "\$i" | $sed 's/^-D//';;
21518 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
21523 postprocess_cc_v=''
21526 ./ccsym > ccsym1.raw
21527 if $test -s ccsym1.raw; then
21528 $sort ccsym1.raw | $uniq >ccsym.raw
21530 mv ccsym1.raw ccsym.raw
21533 $awk '/\=/ { print $0; next }
21534 { print $0"=1" }' ccsym.raw >ccsym.list
21535 $comm -13 Cppsym.true ccsym.list >ccsym.own
21536 $comm -12 Cppsym.true ccsym.list >ccsym.com
21537 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
21539 if $test -z ccsym.raw; then
21540 echo "Your C compiler doesn't seem to define any symbols!" >&4
21542 echo "However, your C preprocessor defines the following symbols:"
21545 cppsymbols=`$cat Cppsym.true`
21546 cppsymbols=`echo $cppsymbols`
21547 cppccsymbols="$cppsymbols"
21549 if $test -s ccsym.com; then
21550 echo "Your C compiler and pre-processor define these symbols:"
21551 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
21554 cppccsymbols=`$cat ccsym.com`
21555 cppccsymbols=`echo $cppccsymbols`
21556 $test "$silent" || sleep 1
21558 if $test -s ccsym.cpp; then
21559 $test "$also" && echo " "
21560 echo "Your C pre-processor ${also}defines the following symbols:"
21561 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
21563 cppsymbols=`$cat ccsym.cpp`
21564 cppsymbols=`echo $cppsymbols`
21565 $test "$silent" || sleep 1
21567 if $test -s ccsym.own; then
21568 $test "$also" && echo " "
21569 echo "Your C compiler ${also}defines the following cpp symbols:"
21570 $sed -e 's/\(..*\)=1/\1/' ccsym.own
21571 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
21572 ccsymbols=`$cat ccsym.own`
21573 ccsymbols=`echo $ccsymbols`
21574 $test "$silent" || sleep 1
21578 : see if this is a termio system
21582 if $test `./findhdr termios.h`; then
21583 set tcsetattr i_termios
21589 "$define") echo "You have POSIX termios.h... good!" >&4;;
21590 *) if ./Cppsym pyr; then
21591 case "`/bin/universe`" in
21592 ucb) if $test `./findhdr sgtty.h`; then
21594 echo "<sgtty.h> found." >&4
21596 echo "System is pyramid with BSD universe."
21597 ./warn "<sgtty.h> not found--you could have problems."
21599 *) if $test `./findhdr termio.h`; then
21601 echo "<termio.h> found." >&4
21603 echo "System is pyramid with USG universe."
21604 ./warn "<termio.h> not found--you could have problems."
21608 if $test `./findhdr termio.h`; then
21609 echo "<termio.h> found." >&4
21611 elif $test `./findhdr sgtty.h`; then
21612 echo "<sgtty.h> found." >&4
21615 ./warn "Neither <termio.h> nor <sgtty.h> found--cross fingers!"
21618 if $test `./findhdr sgtty.h`; then
21619 echo "<sgtty.h> found." >&4
21621 elif $test `./findhdr termio.h`; then
21622 echo "<termio.h> found." >&4
21625 ./warn "Neither <sgtty.h> nor <termio.h> found--cross fingers!"
21629 set i_termio; eval $setvar
21630 val=$val2; set i_sgtty; eval $setvar
21631 val=$val3; set i_termios; eval $setvar
21633 : see if stddef is available
21634 set stddef.h i_stddef
21637 : see if sys/access.h is available
21638 set sys/access.h i_sysaccess
21641 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
21642 set sys/filio.h i_sysfilio
21645 if $test `./findhdr sys/ioctl.h`; then
21647 echo '<sys/ioctl.h> found.' >&4
21650 if $test $i_sysfilio = "$define"; then
21651 echo '<sys/ioctl.h> NOT found.' >&4
21653 $test $i_sgtty = "$define" && xxx="sgtty.h"
21654 $test $i_termio = "$define" && xxx="termio.h"
21655 $test $i_termios = "$define" && xxx="termios.h"
21656 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
21662 : see if socket ioctl defs are in sys/sockio.h
21664 xxx=`./findhdr sys/sockio.h`
21665 if $test "$xxx"; then
21666 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
21668 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
21671 echo "No socket ioctls found in <sys/sockio.h>." >&4
21676 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
21682 : see if this is a syslog.h system
21683 set syslog.h i_syslog
21686 : see if this is a sys/mode.h system
21687 set sys/mode.h i_sysmode
21690 : see if there is a sys/poll.h file
21691 set sys/poll.h i_syspoll
21694 : see if sys/resource.h has to be included
21695 set sys/resource.h i_sysresrc
21698 : see if sys/security.h is available
21699 set sys/security.h i_syssecrt
21702 : see if this is a sys/statvfs.h system
21703 set sys/statvfs.h i_sysstatvfs
21706 : see if this is a sys/un.h system
21707 set sys/un.h i_sysun
21710 : see if this is a sys/utsname.h system
21711 set sys/utsname.h i_sysutsname
21714 : see if this is a syswait system
21715 set sys/wait.h i_syswait
21718 : see if this is a ustat.h system
21719 set ustat.h i_ustat
21722 : see if this is an utime system
21723 set utime.h i_utime
21726 : see if this is a vfork system
21729 set vfork.h i_vfork
21739 echo "Looking for extensions..." >&4
21740 : If we are using the old config.sh, known_extensions may contain
21741 : old or inaccurate or duplicate values.
21742 known_extensions=''
21743 nonxs_extensions=''
21744 : We do not use find because it might not be available.
21745 : We do not just use MANIFEST because the user may have dropped
21746 : some additional extensions into the source tree and expect them
21749 : Function to recursively find available extensions, ignoring DynaLoader
21750 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
21751 : In 5.10.1 and later, extensions are stored in directories
21752 : like File-Glob instead of the older File/Glob/.
21756 DynaLoader|dynaload) ;;
21758 this_ext=`echo $xxx | $sed -e s/-/\\\//g`;
21759 leaf=`echo $xxx | $sed -e s/.*-//`;
21760 if $test -d File; then
21761 if $test -f $xxx/$leaf.xs -o -f $xxx/$leaf.c; then
21762 known_extensions="$known_extensions $1$this_ext";
21763 elif $test -f $xxx/Makefile.PL; then
21764 nonxs_extensions="$nonxs_extensions $1$this_ext";
21766 if $test -d $xxx -a $# -lt 10; then
21769 eval $find_extensions;
21775 $ls -1 $xxx > $$.tmp;
21776 if $contains "\.xs$" $$.tmp > /dev/null 2>&1; then
21777 known_extensions="$known_extensions $this_ext";
21778 elif $contains "\.c$" $$.tmp > /dev/null 2>&1; then
21779 known_extensions="$known_extensions $this_ext";
21780 elif $test -d $xxx; then
21781 nonxs_extensions="$nonxs_extensions $this_ext";
21792 eval $find_extensions
21796 eval $find_extensions
21800 eval $find_extensions
21801 if $test -d File-Glob; then
21802 : All ext/ flattened
21804 # Special case: Add in modules that nest beyond the first level.
21805 # Currently threads/shared and Hash/Util/FieldHash, since they are
21806 # not picked up by the recursive find above (and adding in general
21807 # recursive finding breaks SDBM_File/sdbm).
21808 # A.D. 20011025 (SDBM), ajgough 20071008 (FieldHash)
21809 known_extensions="$known_extensions threads/shared Hash/Util/FieldHash"
21811 set X $known_extensions
21813 known_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
21814 set X $nonxs_extensions
21816 nonxs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
21819 : Now see which are supported on this system.
21821 for xxx in $known_extensions ; do
21825 $define) avail_ext="$avail_ext $xxx" ;;
21828 GDBM_File|gdbm_fil)
21830 $define) avail_ext="$avail_ext $xxx" ;;
21833 I18N/Langinfo|i18n_lan)
21834 case "$i_langinfo$d_nl_langinfo" in
21835 $define$define) avail_ext="$avail_ext $xxx" ;;
21839 : XXX Do we need a useipcsysv variable here
21840 case "${d_msg}${d_sem}${d_shm}" in
21841 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
21844 NDBM_File|ndbm_fil)
21847 case "$osname-$use64bitint" in
21850 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
21853 *) avail_ext="$avail_ext $xxx" ;;
21858 ODBM_File|odbm_fil)
21859 case "${i_dbm}${i_rpcsvcdbm}" in
21861 case "$d_cplusplus" in
21862 define) ;; # delete as a function name will not work
21863 *) case "$osname-$use64bitint" in
21866 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
21869 *) avail_ext="$avail_ext $xxx" ;;
21877 case "$useopcode" in
21878 true|define|y) avail_ext="$avail_ext $xxx" ;;
21882 case "$useposix" in
21883 true|define|y) avail_ext="$avail_ext $xxx" ;;
21887 case "$d_socket" in
21890 beos) ;; # not unless BONE
21891 *) avail_ext="$avail_ext $xxx" ;;
21896 Sys/Syslog|sys/syslog)
21897 : XXX syslog requires socket
21898 case "$d_socket" in
21899 true|$define|y) avail_ext="$avail_ext $xxx" ;;
21903 case "$usethreads" in
21905 case "$use5005threads" in
21906 $define|true|[yY]*) avail_ext="$avail_ext $xxx" ;;
21910 threads|threads/shared)
21911 # threads and threads::shared are special cases.
21912 # To stop people from asking "Perl 5.8.0 was supposed
21913 # to have this new fancy threads implementation but my
21914 # perl doesn't have it" and from people trying to
21915 # (re)install the threads module using CPAN.pm and
21916 # CPAN.pm then offering to reinstall Perl 5.8.0,
21917 # the threads.pm and threads/shared.pm will always be
21918 # there, croaking informatively ("you need to rebuild
21919 # all of Perl with threads, sorry") when threads haven't
21920 # been compiled in.
21922 avail_ext="$avail_ext $xxx"
21928 cygwin) avail_ext="$avail_ext $xxx" ;;
21931 XS/APItest|xs/apitest)
21932 # This is just for testing. Skip it unless we have dynamic loading.
21935 $define) avail_ext="$avail_ext $xxx" ;;
21938 XS/APItest/KeywordRPN|xs/apitest/keywordrpn)
21939 # This is just for testing. Skip it unless we have dynamic loading.
21942 $define) avail_ext="$avail_ext $xxx" ;;
21945 XS/Typemap|xs/typemap)
21946 # This is just for testing. Skip it unless we have dynamic loading.
21948 $define) avail_ext="$avail_ext $xxx" ;;
21951 *) avail_ext="$avail_ext $xxx"
21960 case "$onlyextensions" in
21962 *) keepextensions=''
21963 echo "You have requested that only certains extensions be included..." >&4
21964 for i in $onlyextensions; do
21965 case " $avail_ext " in
21967 echo "Keeping extension $i."
21968 keepextensions="$keepextensions $i"
21970 *) echo "Ignoring extension $i." ;;
21973 avail_ext="$keepextensions"
21977 case "$noextensions" in
21979 *) keepextensions=''
21980 echo "You have requested that certain extensions be ignored..." >&4
21981 for i in $avail_ext; do
21982 case " $noextensions " in
21983 *" $i "*) echo "Ignoring extension $i." ;;
21984 *) echo "Keeping extension $i.";
21985 keepextensions="$keepextensions $i"
21989 avail_ext="$keepextensions"
21993 : Now see which nonxs extensions are supported on this system.
21994 : For now assume all are.
21996 for xxx in $nonxs_extensions ; do
21998 *) nonxs_ext="$nonxs_ext $xxx"
22010 A number of extensions are supplied with $package. You may choose to
22011 compile these extensions for dynamic loading (the default), compile
22012 them into the $package executable (static loading), or not include
22013 them at all. Answer "none" to include no extensions.
22014 Note that DynaLoader is always built and need not be mentioned here.
22017 case "$dynamic_ext" in
22019 : Exclude those listed in static_ext
22021 for xxx in $avail_ext; do
22022 case " $static_ext " in
22024 *) dflt="$dflt $xxx" ;;
22031 *) dflt="$dynamic_ext"
22032 # Perhaps we are reusing an old out-of-date config.sh.
22035 if test X"$dynamic_ext" != X"$avail_ext"; then
22037 NOTICE: Your previous config.sh list may be incorrect.
22038 The extensions now available to you are
22040 but the default list from your previous config.sh is
22052 rp="What extensions do you wish to load dynamically?"
22055 none) dynamic_ext=' ' ;;
22056 *) dynamic_ext="$ans" ;;
22059 case "$static_ext" in
22061 : Exclude those already listed in dynamic linking
22063 for xxx in $avail_ext; do
22064 case " $dynamic_ext " in
22066 *) dflt="$dflt $xxx" ;;
22073 *) dflt="$static_ext"
22080 rp="What extensions do you wish to load statically?"
22083 none) static_ext=' ' ;;
22084 *) static_ext="$ans" ;;
22089 A number of extensions are supplied with $package. Answer "none"
22090 to include no extensions.
22091 Note that DynaLoader is always built and need not be mentioned here.
22094 case "$static_ext" in
22095 '') dflt="$avail_ext" ;;
22096 *) dflt="$static_ext"
22097 # Perhaps we are reusing an old out-of-date config.sh.
22100 if test X"$static_ext" != X"$avail_ext"; then
22102 NOTICE: Your previous config.sh list may be incorrect.
22103 The extensions now available to you are
22105 but the default list from your previous config.sh is
22114 : Exclude those that are not xs extensions
22118 rp="What extensions do you wish to include?"
22121 none) static_ext=' ' ;;
22122 *) static_ext="$ans" ;;
22127 # Encode is a special case. If we are building Encode as a static
22128 # extension, we need to explicitly list its subextensions as well.
22129 # For other nested extensions, this is handled automatically by
22130 # the appropriate Makefile.PL.
22131 case " $static_ext " in
22132 *" Encode "*) # Add the subextensions of Encode
22134 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
22135 static_ext="$static_ext Encode/$xxx"
22141 set X $dynamic_ext $static_ext $nonxs_ext
22145 # Sanity check: We require an extension suitable for use with
22146 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
22147 # should show up as failures in the test suite, but it's helpful to
22148 # catch them now.) The 'extensions' list is normally sorted
22149 # alphabetically, so we need to accept either
22150 # DB_File ... Fcntl ... IO ....
22151 # or something like
22152 # Fcntl ... NDBM_File ... IO ....
22153 case " $extensions" in
22154 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
22155 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
22156 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
22157 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
22158 echo "WARNING: The Perl you are building will be quite crippled." >& 4
22162 : Remove libraries needed only for extensions
22163 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
22164 : The exception is SunOS 4.x, which needs them.
22165 case "${osname}X${osvers}" in
22169 *) case "$usedl" in
22170 $define|true|[yY]*)
22171 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -lgdbm_compat @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
22175 *) perllibs="$libs"
22181 : Remove build directory name from cppstdin so it can be used from
22182 : either the present location or the final installed location.
22184 : Get out of the UU directory to get correct path name.
22186 case "$cppstdin" in
22188 echo "Stripping down cppstdin path name"
22194 : end of configuration questions
22196 echo "End of configuration questions."
22199 : back to where it started
22200 if test -d ../UU; then
22204 : configuration may be unconditionally patched via a 'config.arch' file
22205 if $test -f config.arch; then
22206 echo "I see a config.arch file, loading it." >&4
22210 : configuration may be patched via a 'config.over' file
22211 if $test -f config.over; then
22214 rp='I see a config.over file. Do you wish to load it?'
22217 n*) echo "OK, I'll ignore it.";;
22219 echo "Configuration override changes have been loaded."
22224 : in case they want portability, strip down executable paths
22225 case "$d_portable" in
22228 echo "Stripping down executable paths..." >&4
22229 for file in $loclist $trylist; do
22231 eval $file=`basename $temp`
22236 : create config.sh file
22238 echo "Creating config.sh..." >&4
22239 $spitshell <<EOT >config.sh
22242 # This file was produced by running the Configure script. It holds all the
22243 # definitions figured out by Configure. Should you modify one of these values,
22244 # do not forget to propagate your changes by running "Configure -der". You may
22245 # instead choose to run each of the .SH files by yourself, or "Configure -S".
22248 # Package name : $package
22249 # Source directory : $src
22250 # Configuration time: $cf_time
22251 # Configured by : $cf_by
22252 # Target system : $myuname
22255 : Add in command line options if available
22256 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
22258 $spitshell <<EOT >>config.sh
22267 Revision='$Revision'
22275 alignbytes='$alignbytes'
22276 ansi2knr='$ansi2knr'
22277 aphostname='$aphostname'
22278 api_revision='$api_revision'
22279 api_subversion='$api_subversion'
22280 api_version='$api_version'
22281 api_versionstring='$api_versionstring'
22284 archlibexp='$archlibexp'
22285 archname64='$archname64'
22286 archname='$archname'
22287 archobjs='$archobjs'
22288 asctime_r_proto='$asctime_r_proto'
22297 byteorder='$byteorder'
22299 castflags='$castflags'
22302 cccdlflags='$cccdlflags'
22303 ccdlflags='$ccdlflags'
22305 ccflags_uselargefiles='$ccflags_uselargefiles'
22307 ccsymbols='$ccsymbols'
22308 ccversion='$ccversion'
22310 cf_email='$cf_email'
22312 charbits='$charbits'
22313 charsize='$charsize'
22317 clocktype='$clocktype'
22319 compress='$compress'
22320 contains='$contains'
22324 cpp_stuff='$cpp_stuff'
22325 cppccsymbols='$cppccsymbols'
22326 cppflags='$cppflags'
22328 cppminus='$cppminus'
22330 cppstdin='$cppstdin'
22331 cppsymbols='$cppsymbols'
22332 crypt_r_proto='$crypt_r_proto'
22333 cryptlib='$cryptlib'
22335 ctermid_r_proto='$ctermid_r_proto'
22336 ctime_r_proto='$ctime_r_proto'
22337 d_Gconvert='$d_Gconvert'
22338 d_PRIEUldbl='$d_PRIEUldbl'
22339 d_PRIFUldbl='$d_PRIFUldbl'
22340 d_PRIGUldbl='$d_PRIGUldbl'
22341 d_PRIXU64='$d_PRIXU64'
22342 d_PRId64='$d_PRId64'
22343 d_PRIeldbl='$d_PRIeldbl'
22344 d_PRIfldbl='$d_PRIfldbl'
22345 d_PRIgldbl='$d_PRIgldbl'
22346 d_PRIi64='$d_PRIi64'
22347 d_PRIo64='$d_PRIo64'
22348 d_PRIu64='$d_PRIu64'
22349 d_PRIx64='$d_PRIx64'
22350 d_SCNfldbl='$d_SCNfldbl'
22351 d__fwalk='$d__fwalk'
22352 d_access='$d_access'
22353 d_accessx='$d_accessx'
22356 d_archlib='$d_archlib'
22357 d_asctime64='$d_asctime64'
22358 d_asctime_r='$d_asctime_r'
22361 d_attribute_deprecated='$d_attribute_deprecated'
22362 d_attribute_format='$d_attribute_format'
22363 d_attribute_malloc='$d_attribute_malloc'
22364 d_attribute_nonnull='$d_attribute_nonnull'
22365 d_attribute_noreturn='$d_attribute_noreturn'
22366 d_attribute_pure='$d_attribute_pure'
22367 d_attribute_unused='$d_attribute_unused'
22368 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
22372 d_bsdgetpgrp='$d_bsdgetpgrp'
22373 d_bsdsetpgrp='$d_bsdsetpgrp'
22374 d_builtin_choose_expr='$d_builtin_choose_expr'
22375 d_builtin_expect='$d_builtin_expect'
22377 d_c99_variadic_macros='$d_c99_variadic_macros'
22378 d_casti32='$d_casti32'
22379 d_castneg='$d_castneg'
22380 d_charvspr='$d_charvspr'
22382 d_chroot='$d_chroot'
22383 d_chsize='$d_chsize'
22385 d_clearenv='$d_clearenv'
22386 d_closedir='$d_closedir'
22387 d_cmsghdr_s='$d_cmsghdr_s'
22389 d_copysignl='$d_copysignl'
22390 d_cplusplus='$d_cplusplus'
22392 d_crypt_r='$d_crypt_r'
22394 d_ctermid='$d_ctermid'
22395 d_ctermid_r='$d_ctermid_r'
22396 d_ctime64='$d_ctime64'
22397 d_ctime_r='$d_ctime_r'
22398 d_cuserid='$d_cuserid'
22399 d_dbl_dig='$d_dbl_dig'
22400 d_dbminitproto='$d_dbminitproto'
22401 d_difftime64='$d_difftime64'
22402 d_difftime='$d_difftime'
22403 d_dir_dd_fd='$d_dir_dd_fd'
22405 d_dirnamlen='$d_dirnamlen'
22406 d_dlerror='$d_dlerror'
22407 d_dlopen='$d_dlopen'
22408 d_dlsymun='$d_dlsymun'
22409 d_dosuid='$d_dosuid'
22410 d_drand48_r='$d_drand48_r'
22411 d_drand48proto='$d_drand48proto'
22413 d_eaccess='$d_eaccess'
22414 d_endgrent='$d_endgrent'
22415 d_endgrent_r='$d_endgrent_r'
22416 d_endhent='$d_endhent'
22417 d_endhostent_r='$d_endhostent_r'
22418 d_endnent='$d_endnent'
22419 d_endnetent_r='$d_endnetent_r'
22420 d_endpent='$d_endpent'
22421 d_endprotoent_r='$d_endprotoent_r'
22422 d_endpwent='$d_endpwent'
22423 d_endpwent_r='$d_endpwent_r'
22424 d_endsent='$d_endsent'
22425 d_endservent_r='$d_endservent_r'
22426 d_eofnblk='$d_eofnblk'
22427 d_eunice='$d_eunice'
22428 d_faststdio='$d_faststdio'
22429 d_fchdir='$d_fchdir'
22430 d_fchmod='$d_fchmod'
22431 d_fchown='$d_fchown'
22433 d_fcntl_can_lock='$d_fcntl_can_lock'
22434 d_fd_macros='$d_fd_macros'
22435 d_fd_set='$d_fd_set'
22436 d_fds_bits='$d_fds_bits'
22437 d_fgetpos='$d_fgetpos'
22438 d_finite='$d_finite'
22439 d_finitel='$d_finitel'
22440 d_flexfnam='$d_flexfnam'
22442 d_flockproto='$d_flockproto'
22444 d_fp_class='$d_fp_class'
22445 d_fpathconf='$d_fpathconf'
22446 d_fpclass='$d_fpclass'
22447 d_fpclassify='$d_fpclassify'
22448 d_fpclassl='$d_fpclassl'
22449 d_fpos64_t='$d_fpos64_t'
22450 d_frexpl='$d_frexpl'
22451 d_fs_data_s='$d_fs_data_s'
22452 d_fseeko='$d_fseeko'
22453 d_fsetpos='$d_fsetpos'
22454 d_fstatfs='$d_fstatfs'
22455 d_fstatvfs='$d_fstatvfs'
22457 d_ftello='$d_ftello'
22459 d_futimes='$d_futimes'
22460 d_gdbm_ndbm_h_uses_prototypes='$d_gdbm_ndbm_h_uses_prototypes'
22461 d_gdbmndbm_h_uses_prototypes='$d_gdbmndbm_h_uses_prototypes'
22462 d_getaddrinfo='$d_getaddrinfo'
22463 d_getcwd='$d_getcwd'
22464 d_getespwnam='$d_getespwnam'
22465 d_getfsstat='$d_getfsstat'
22466 d_getgrent='$d_getgrent'
22467 d_getgrent_r='$d_getgrent_r'
22468 d_getgrgid_r='$d_getgrgid_r'
22469 d_getgrnam_r='$d_getgrnam_r'
22470 d_getgrps='$d_getgrps'
22471 d_gethbyaddr='$d_gethbyaddr'
22472 d_gethbyname='$d_gethbyname'
22473 d_gethent='$d_gethent'
22474 d_gethname='$d_gethname'
22475 d_gethostbyaddr_r='$d_gethostbyaddr_r'
22476 d_gethostbyname_r='$d_gethostbyname_r'
22477 d_gethostent_r='$d_gethostent_r'
22478 d_gethostprotos='$d_gethostprotos'
22479 d_getitimer='$d_getitimer'
22480 d_getlogin='$d_getlogin'
22481 d_getlogin_r='$d_getlogin_r'
22482 d_getmnt='$d_getmnt'
22483 d_getmntent='$d_getmntent'
22484 d_getnameinfo='$d_getnameinfo'
22485 d_getnbyaddr='$d_getnbyaddr'
22486 d_getnbyname='$d_getnbyname'
22487 d_getnent='$d_getnent'
22488 d_getnetbyaddr_r='$d_getnetbyaddr_r'
22489 d_getnetbyname_r='$d_getnetbyname_r'
22490 d_getnetent_r='$d_getnetent_r'
22491 d_getnetprotos='$d_getnetprotos'
22492 d_getpagsz='$d_getpagsz'
22493 d_getpbyname='$d_getpbyname'
22494 d_getpbynumber='$d_getpbynumber'
22495 d_getpent='$d_getpent'
22496 d_getpgid='$d_getpgid'
22497 d_getpgrp2='$d_getpgrp2'
22498 d_getpgrp='$d_getpgrp'
22499 d_getppid='$d_getppid'
22500 d_getprior='$d_getprior'
22501 d_getprotobyname_r='$d_getprotobyname_r'
22502 d_getprotobynumber_r='$d_getprotobynumber_r'
22503 d_getprotoent_r='$d_getprotoent_r'
22504 d_getprotoprotos='$d_getprotoprotos'
22505 d_getprpwnam='$d_getprpwnam'
22506 d_getpwent='$d_getpwent'
22507 d_getpwent_r='$d_getpwent_r'
22508 d_getpwnam_r='$d_getpwnam_r'
22509 d_getpwuid_r='$d_getpwuid_r'
22510 d_getsbyname='$d_getsbyname'
22511 d_getsbyport='$d_getsbyport'
22512 d_getsent='$d_getsent'
22513 d_getservbyname_r='$d_getservbyname_r'
22514 d_getservbyport_r='$d_getservbyport_r'
22515 d_getservent_r='$d_getservent_r'
22516 d_getservprotos='$d_getservprotos'
22517 d_getspnam='$d_getspnam'
22518 d_getspnam_r='$d_getspnam_r'
22519 d_gettimeod='$d_gettimeod'
22520 d_gmtime64='$d_gmtime64'
22521 d_gmtime_r='$d_gmtime_r'
22522 d_gnulibc='$d_gnulibc'
22523 d_grpasswd='$d_grpasswd'
22524 d_hasmntopt='$d_hasmntopt'
22526 d_ilogbl='$d_ilogbl'
22527 d_inc_version_list='$d_inc_version_list'
22529 d_inetaton='$d_inetaton'
22530 d_inetntop='$d_inetntop'
22531 d_inetpton='$d_inetpton'
22532 d_int64_t='$d_int64_t'
22533 d_isascii='$d_isascii'
22534 d_isfinite='$d_isfinite'
22537 d_isnanl='$d_isnanl'
22538 d_killpg='$d_killpg'
22539 d_lchown='$d_lchown'
22540 d_ldbl_dig='$d_ldbl_dig'
22541 d_libm_lib_version='$d_libm_lib_version'
22543 d_localtime64='$d_localtime64'
22544 d_localtime_r='$d_localtime_r'
22545 d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset'
22546 d_locconv='$d_locconv'
22548 d_longdbl='$d_longdbl'
22549 d_longlong='$d_longlong'
22550 d_lseekproto='$d_lseekproto'
22552 d_madvise='$d_madvise'
22553 d_malloc_good_size='$d_malloc_good_size'
22554 d_malloc_size='$d_malloc_size'
22556 d_mbstowcs='$d_mbstowcs'
22557 d_mbtowc='$d_mbtowc'
22558 d_memchr='$d_memchr'
22559 d_memcmp='$d_memcmp'
22560 d_memcpy='$d_memcpy'
22561 d_memmove='$d_memmove'
22562 d_memset='$d_memset'
22564 d_mkdtemp='$d_mkdtemp'
22565 d_mkfifo='$d_mkfifo'
22566 d_mkstemp='$d_mkstemp'
22567 d_mkstemps='$d_mkstemps'
22568 d_mktime64='$d_mktime64'
22569 d_mktime='$d_mktime'
22572 d_modfl_pow32_bug='$d_modfl_pow32_bug'
22573 d_modflproto='$d_modflproto'
22574 d_mprotect='$d_mprotect'
22576 d_msg_ctrunc='$d_msg_ctrunc'
22577 d_msg_dontroute='$d_msg_dontroute'
22578 d_msg_oob='$d_msg_oob'
22579 d_msg_peek='$d_msg_peek'
22580 d_msg_proxy='$d_msg_proxy'
22581 d_msgctl='$d_msgctl'
22582 d_msgget='$d_msgget'
22583 d_msghdr_s='$d_msghdr_s'
22584 d_msgrcv='$d_msgrcv'
22585 d_msgsnd='$d_msgsnd'
22587 d_munmap='$d_munmap'
22588 d_mymalloc='$d_mymalloc'
22590 d_ndbm_h_uses_prototypes='$d_ndbm_h_uses_prototypes'
22592 d_nl_langinfo='$d_nl_langinfo'
22593 d_nv_preserves_uv='$d_nv_preserves_uv'
22594 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
22595 d_off64_t='$d_off64_t'
22596 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
22597 d_oldpthreads='$d_oldpthreads'
22598 d_oldsock='$d_oldsock'
22600 d_pathconf='$d_pathconf'
22602 d_perl_otherlibdirs='$d_perl_otherlibdirs'
22603 d_phostname='$d_phostname'
22606 d_portable='$d_portable'
22607 d_printf_format_null='$d_printf_format_null'
22608 d_procselfexe='$d_procselfexe'
22609 d_pseudofork='$d_pseudofork'
22610 d_pthread_atfork='$d_pthread_atfork'
22611 d_pthread_attr_setscope='$d_pthread_attr_setscope'
22612 d_pthread_yield='$d_pthread_yield'
22614 d_pwchange='$d_pwchange'
22615 d_pwclass='$d_pwclass'
22616 d_pwcomment='$d_pwcomment'
22617 d_pwexpire='$d_pwexpire'
22618 d_pwgecos='$d_pwgecos'
22619 d_pwpasswd='$d_pwpasswd'
22620 d_pwquota='$d_pwquota'
22623 d_random_r='$d_random_r'
22624 d_readdir64_r='$d_readdir64_r'
22625 d_readdir='$d_readdir'
22626 d_readdir_r='$d_readdir_r'
22627 d_readlink='$d_readlink'
22629 d_recvmsg='$d_recvmsg'
22630 d_rename='$d_rename'
22631 d_rewinddir='$d_rewinddir'
22633 d_safebcpy='$d_safebcpy'
22634 d_safemcpy='$d_safemcpy'
22635 d_sanemcmp='$d_sanemcmp'
22636 d_sbrkproto='$d_sbrkproto'
22637 d_scalbnl='$d_scalbnl'
22638 d_sched_yield='$d_sched_yield'
22639 d_scm_rights='$d_scm_rights'
22640 d_seekdir='$d_seekdir'
22641 d_select='$d_select'
22643 d_semctl='$d_semctl'
22644 d_semctl_semid_ds='$d_semctl_semid_ds'
22645 d_semctl_semun='$d_semctl_semun'
22646 d_semget='$d_semget'
22648 d_sendmsg='$d_sendmsg'
22649 d_setegid='$d_setegid'
22650 d_seteuid='$d_seteuid'
22651 d_setgrent='$d_setgrent'
22652 d_setgrent_r='$d_setgrent_r'
22653 d_setgrps='$d_setgrps'
22654 d_sethent='$d_sethent'
22655 d_sethostent_r='$d_sethostent_r'
22656 d_setitimer='$d_setitimer'
22657 d_setlinebuf='$d_setlinebuf'
22658 d_setlocale='$d_setlocale'
22659 d_setlocale_r='$d_setlocale_r'
22660 d_setnent='$d_setnent'
22661 d_setnetent_r='$d_setnetent_r'
22662 d_setpent='$d_setpent'
22663 d_setpgid='$d_setpgid'
22664 d_setpgrp2='$d_setpgrp2'
22665 d_setpgrp='$d_setpgrp'
22666 d_setprior='$d_setprior'
22667 d_setproctitle='$d_setproctitle'
22668 d_setprotoent_r='$d_setprotoent_r'
22669 d_setpwent='$d_setpwent'
22670 d_setpwent_r='$d_setpwent_r'
22671 d_setregid='$d_setregid'
22672 d_setresgid='$d_setresgid'
22673 d_setresuid='$d_setresuid'
22674 d_setreuid='$d_setreuid'
22675 d_setrgid='$d_setrgid'
22676 d_setruid='$d_setruid'
22677 d_setsent='$d_setsent'
22678 d_setservent_r='$d_setservent_r'
22679 d_setsid='$d_setsid'
22680 d_setvbuf='$d_setvbuf'
22684 d_shmatprototype='$d_shmatprototype'
22685 d_shmctl='$d_shmctl'
22687 d_shmget='$d_shmget'
22688 d_sigaction='$d_sigaction'
22689 d_signbit='$d_signbit'
22690 d_sigprocmask='$d_sigprocmask'
22691 d_sigsetjmp='$d_sigsetjmp'
22692 d_sitearch='$d_sitearch'
22693 d_snprintf='$d_snprintf'
22694 d_sockatmark='$d_sockatmark'
22695 d_sockatmarkproto='$d_sockatmarkproto'
22696 d_socket='$d_socket'
22697 d_socklen_t='$d_socklen_t'
22698 d_sockpair='$d_sockpair'
22699 d_socks5_init='$d_socks5_init'
22700 d_sprintf_returns_strlen='$d_sprintf_returns_strlen'
22702 d_srand48_r='$d_srand48_r'
22703 d_srandom_r='$d_srandom_r'
22704 d_sresgproto='$d_sresgproto'
22705 d_sresuproto='$d_sresuproto'
22706 d_statblks='$d_statblks'
22707 d_statfs_f_flags='$d_statfs_f_flags'
22708 d_statfs_s='$d_statfs_s'
22709 d_statvfs='$d_statvfs'
22710 d_stdio_cnt_lval='$d_stdio_cnt_lval'
22711 d_stdio_ptr_lval='$d_stdio_ptr_lval'
22712 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
22713 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
22714 d_stdio_stream_array='$d_stdio_stream_array'
22715 d_stdiobase='$d_stdiobase'
22716 d_stdstdio='$d_stdstdio'
22717 d_strchr='$d_strchr'
22718 d_strcoll='$d_strcoll'
22719 d_strctcpy='$d_strctcpy'
22720 d_strerrm='$d_strerrm'
22721 d_strerror='$d_strerror'
22722 d_strerror_r='$d_strerror_r'
22723 d_strftime='$d_strftime'
22724 d_strlcat='$d_strlcat'
22725 d_strlcpy='$d_strlcpy'
22726 d_strtod='$d_strtod'
22727 d_strtol='$d_strtol'
22728 d_strtold='$d_strtold'
22729 d_strtoll='$d_strtoll'
22730 d_strtoq='$d_strtoq'
22731 d_strtoul='$d_strtoul'
22732 d_strtoull='$d_strtoull'
22733 d_strtouq='$d_strtouq'
22734 d_strxfrm='$d_strxfrm'
22735 d_suidsafe='$d_suidsafe'
22736 d_symlink='$d_symlink'
22737 d_syscall='$d_syscall'
22738 d_syscallproto='$d_syscallproto'
22739 d_sysconf='$d_sysconf'
22740 d_sysernlst='$d_sysernlst'
22741 d_syserrlst='$d_syserrlst'
22742 d_system='$d_system'
22743 d_tcgetpgrp='$d_tcgetpgrp'
22744 d_tcsetpgrp='$d_tcsetpgrp'
22745 d_telldir='$d_telldir'
22746 d_telldirproto='$d_telldirproto'
22748 d_timegm='$d_timegm'
22750 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
22751 d_tm_tm_zone='$d_tm_tm_zone'
22752 d_tmpnam_r='$d_tmpnam_r'
22753 d_truncate='$d_truncate'
22754 d_ttyname_r='$d_ttyname_r'
22755 d_tzname='$d_tzname'
22756 d_u32align='$d_u32align'
22757 d_ualarm='$d_ualarm'
22760 d_union_semun='$d_union_semun'
22761 d_unordered='$d_unordered'
22762 d_unsetenv='$d_unsetenv'
22763 d_usleep='$d_usleep'
22764 d_usleepproto='$d_usleepproto'
22766 d_vendorarch='$d_vendorarch'
22767 d_vendorbin='$d_vendorbin'
22768 d_vendorlib='$d_vendorlib'
22769 d_vendorscript='$d_vendorscript'
22771 d_void_closedir='$d_void_closedir'
22772 d_voidsig='$d_voidsig'
22773 d_voidtty='$d_voidtty'
22774 d_volatile='$d_volatile'
22775 d_vprintf='$d_vprintf'
22776 d_vsnprintf='$d_vsnprintf'
22778 d_waitpid='$d_waitpid'
22779 d_wcstombs='$d_wcstombs'
22780 d_wctomb='$d_wctomb'
22781 d_writev='$d_writev'
22784 db_hashtype='$db_hashtype'
22785 db_prefixtype='$db_prefixtype'
22786 db_version_major='$db_version_major'
22787 db_version_minor='$db_version_minor'
22788 db_version_patch='$db_version_patch'
22789 defvoidused='$defvoidused'
22790 direntrytype='$direntrytype'
22793 doublesize='$doublesize'
22795 drand48_r_proto='$drand48_r_proto'
22797 dynamic_ext='$dynamic_ext'
22803 endgrent_r_proto='$endgrent_r_proto'
22804 endhostent_r_proto='$endhostent_r_proto'
22805 endnetent_r_proto='$endnetent_r_proto'
22806 endprotoent_r_proto='$endprotoent_r_proto'
22807 endpwent_r_proto='$endpwent_r_proto'
22808 endservent_r_proto='$endservent_r_proto'
22809 eunicefix='$eunicefix'
22812 extensions='$extensions'
22813 extern_C='$extern_C'
22815 fflushNULL='$fflushNULL'
22816 fflushall='$fflushall'
22818 firstmakefile='$firstmakefile'
22820 fpossize='$fpossize'
22821 fpostype='$fpostype'
22822 freetype='$freetype'
22825 full_csh='$full_csh'
22826 full_sed='$full_sed'
22827 gccansipedantic='$gccansipedantic'
22828 gccosandvers='$gccosandvers'
22829 gccversion='$gccversion'
22830 getgrent_r_proto='$getgrent_r_proto'
22831 getgrgid_r_proto='$getgrgid_r_proto'
22832 getgrnam_r_proto='$getgrnam_r_proto'
22833 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
22834 gethostbyname_r_proto='$gethostbyname_r_proto'
22835 gethostent_r_proto='$gethostent_r_proto'
22836 getlogin_r_proto='$getlogin_r_proto'
22837 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
22838 getnetbyname_r_proto='$getnetbyname_r_proto'
22839 getnetent_r_proto='$getnetent_r_proto'
22840 getprotobyname_r_proto='$getprotobyname_r_proto'
22841 getprotobynumber_r_proto='$getprotobynumber_r_proto'
22842 getprotoent_r_proto='$getprotoent_r_proto'
22843 getpwent_r_proto='$getpwent_r_proto'
22844 getpwnam_r_proto='$getpwnam_r_proto'
22845 getpwuid_r_proto='$getpwuid_r_proto'
22846 getservbyname_r_proto='$getservbyname_r_proto'
22847 getservbyport_r_proto='$getservbyport_r_proto'
22848 getservent_r_proto='$getservent_r_proto'
22849 getspnam_r_proto='$getspnam_r_proto'
22850 gidformat='$gidformat'
22856 gmtime_r_proto='$gmtime_r_proto'
22857 gnulibc_version='$gnulibc_version'
22859 groupcat='$groupcat'
22860 groupstype='$groupstype'
22863 h_sysfile='$h_sysfile'
22866 html1dir='$html1dir'
22867 html1direxp='$html1direxp'
22868 html3dir='$html3dir'
22869 html3direxp='$html3direxp'
22878 i_arpainet='$i_arpainet'
22879 i_assert='$i_assert'
22880 i_bsdioctl='$i_bsdioctl'
22884 i_dirent='$i_dirent'
22890 i_fp_class='$i_fp_class'
22892 i_gdbm_ndbm='$i_gdbm_ndbm'
22893 i_gdbmndbm='$i_gdbmndbm'
22895 i_ieeefp='$i_ieeefp'
22896 i_inttypes='$i_inttypes'
22897 i_langinfo='$i_langinfo'
22898 i_libutil='$i_libutil'
22899 i_limits='$i_limits'
22900 i_locale='$i_locale'
22901 i_machcthr='$i_machcthr'
22902 i_malloc='$i_malloc'
22903 i_mallocmalloc='$i_mallocmalloc'
22905 i_memory='$i_memory'
22906 i_mntent='$i_mntent'
22909 i_neterrno='$i_neterrno'
22910 i_netinettcp='$i_netinettcp'
22914 i_pthread='$i_pthread'
22916 i_rpcsvcdbm='$i_rpcsvcdbm'
22919 i_shadow='$i_shadow'
22921 i_stdarg='$i_stdarg'
22922 i_stddef='$i_stddef'
22923 i_stdlib='$i_stdlib'
22924 i_string='$i_string'
22925 i_sunmath='$i_sunmath'
22926 i_sysaccess='$i_sysaccess'
22927 i_sysdir='$i_sysdir'
22928 i_sysfile='$i_sysfile'
22929 i_sysfilio='$i_sysfilio'
22931 i_sysioctl='$i_sysioctl'
22932 i_syslog='$i_syslog'
22933 i_sysmman='$i_sysmman'
22934 i_sysmode='$i_sysmode'
22935 i_sysmount='$i_sysmount'
22936 i_sysndir='$i_sysndir'
22937 i_sysparam='$i_sysparam'
22938 i_syspoll='$i_syspoll'
22939 i_sysresrc='$i_sysresrc'
22940 i_syssecrt='$i_syssecrt'
22941 i_sysselct='$i_sysselct'
22942 i_syssockio='$i_syssockio'
22943 i_sysstat='$i_sysstat'
22944 i_sysstatfs='$i_sysstatfs'
22945 i_sysstatvfs='$i_sysstatvfs'
22946 i_systime='$i_systime'
22947 i_systimek='$i_systimek'
22948 i_systimes='$i_systimes'
22949 i_systypes='$i_systypes'
22950 i_sysuio='$i_sysuio'
22952 i_sysutsname='$i_sysutsname'
22953 i_sysvfs='$i_sysvfs'
22954 i_syswait='$i_syswait'
22955 i_termio='$i_termio'
22956 i_termios='$i_termios'
22958 i_unistd='$i_unistd'
22961 i_values='$i_values'
22962 i_varargs='$i_varargs'
22963 i_varhdr='$i_varhdr'
22965 ignore_versioned_solibs='$ignore_versioned_solibs'
22966 inc_version_list='$inc_version_list'
22967 inc_version_list_init='$inc_version_list_init'
22970 initialinstalllocation='$initialinstalllocation'
22971 installarchlib='$installarchlib'
22972 installbin='$installbin'
22973 installhtml1dir='$installhtml1dir'
22974 installhtml3dir='$installhtml3dir'
22975 installman1dir='$installman1dir'
22976 installman3dir='$installman3dir'
22977 installprefix='$installprefix'
22978 installprefixexp='$installprefixexp'
22979 installprivlib='$installprivlib'
22980 installscript='$installscript'
22981 installsitearch='$installsitearch'
22982 installsitebin='$installsitebin'
22983 installsitehtml1dir='$installsitehtml1dir'
22984 installsitehtml3dir='$installsitehtml3dir'
22985 installsitelib='$installsitelib'
22986 installsiteman1dir='$installsiteman1dir'
22987 installsiteman3dir='$installsiteman3dir'
22988 installsitescript='$installsitescript'
22989 installstyle='$installstyle'
22990 installusrbinperl='$installusrbinperl'
22991 installvendorarch='$installvendorarch'
22992 installvendorbin='$installvendorbin'
22993 installvendorhtml1dir='$installvendorhtml1dir'
22994 installvendorhtml3dir='$installvendorhtml3dir'
22995 installvendorlib='$installvendorlib'
22996 installvendorman1dir='$installvendorman1dir'
22997 installvendorman3dir='$installvendorman3dir'
22998 installvendorscript='$installvendorscript'
23000 issymlink='$issymlink'
23001 ivdformat='$ivdformat'
23004 known_extensions='$known_extensions'
23007 lddlflags='$lddlflags'
23009 ldflags_uselargefiles='$ldflags_uselargefiles'
23010 ldlibpthname='$ldlibpthname'
23017 libsdirs='$libsdirs'
23018 libsfiles='$libsfiles'
23019 libsfound='$libsfound'
23020 libspath='$libspath'
23021 libswanted='$libswanted'
23022 libswanted_uselargefiles='$libswanted_uselargefiles'
23028 localtime_r_proto='$localtime_r_proto'
23029 locincpth='$locincpth'
23030 loclibpth='$loclibpth'
23031 longdblsize='$longdblsize'
23032 longlongsize='$longlongsize'
23033 longsize='$longsize'
23037 lseeksize='$lseeksize'
23038 lseektype='$lseektype'
23041 madlyobj='$madlyobj'
23042 madlysrc='$madlysrc'
23046 make_set_make='$make_set_make'
23047 mallocobj='$mallocobj'
23048 mallocsrc='$mallocsrc'
23049 malloctype='$malloctype'
23051 man1direxp='$man1direxp'
23054 man3direxp='$man3direxp'
23056 mips_type='$mips_type'
23057 mistrustnm='$mistrustnm'
23059 mmaptype='$mmaptype'
23060 modetype='$modetype'
23062 multiarch='$multiarch'
23064 myarchname='$myarchname'
23065 mydomain='$mydomain'
23066 myhostname='$myhostname'
23069 need_va_copy='$need_va_copy'
23070 netdb_hlen_type='$netdb_hlen_type'
23071 netdb_host_type='$netdb_host_type'
23072 netdb_name_type='$netdb_name_type'
23073 netdb_net_type='$netdb_net_type'
23076 nm_so_opt='$nm_so_opt'
23077 nonxs_ext='$nonxs_ext'
23079 nvEUformat='$nvEUformat'
23080 nvFUformat='$nvFUformat'
23081 nvGUformat='$nvGUformat'
23082 nv_overflows_integers_at='$nv_overflows_integers_at'
23083 nv_preserves_uv_bits='$nv_preserves_uv_bits'
23084 nveformat='$nveformat'
23085 nvfformat='$nvfformat'
23086 nvgformat='$nvgformat'
23089 o_nonblock='$o_nonblock'
23091 old_pthread_create_joinable='$old_pthread_create_joinable'
23092 optimize='$optimize'
23093 orderlib='$orderlib'
23096 otherlibdirs='$otherlibdirs'
23100 patchlevel='$patchlevel'
23101 path_sep='$path_sep'
23104 perl_patchlevel='$perl_patchlevel'
23105 perladmin='$perladmin'
23106 perllibs='$perllibs'
23107 perlpath='$perlpath'
23109 phostname='$phostname'
23115 prefixexp='$prefixexp'
23117 privlibexp='$privlibexp'
23118 procselfexe='$procselfexe'
23119 prototype='$prototype'
23121 quadkind='$quadkind'
23122 quadtype='$quadtype'
23123 randbits='$randbits'
23124 randfunc='$randfunc'
23125 random_r_proto='$random_r_proto'
23126 randseedtype='$randseedtype'
23128 rd_nodata='$rd_nodata'
23129 readdir64_r_proto='$readdir64_r_proto'
23130 readdir_r_proto='$readdir_r_proto'
23131 revision='$revision'
23137 sGMTIME_max='$sGMTIME_max'
23138 sGMTIME_min='$sGMTIME_min'
23139 sLOCALTIME_max='$sLOCALTIME_max'
23140 sLOCALTIME_min='$sLOCALTIME_min'
23141 sPRIEUldbl='$sPRIEUldbl'
23142 sPRIFUldbl='$sPRIFUldbl'
23143 sPRIGUldbl='$sPRIGUldbl'
23144 sPRIXU64='$sPRIXU64'
23146 sPRIeldbl='$sPRIeldbl'
23147 sPRIfldbl='$sPRIfldbl'
23148 sPRIgldbl='$sPRIgldbl'
23153 sSCNfldbl='$sSCNfldbl'
23154 sched_yield='$sched_yield'
23155 scriptdir='$scriptdir'
23156 scriptdirexp='$scriptdirexp'
23158 seedfunc='$seedfunc'
23159 selectminbits='$selectminbits'
23160 selecttype='$selecttype'
23161 sendmail='$sendmail'
23162 setgrent_r_proto='$setgrent_r_proto'
23163 sethostent_r_proto='$sethostent_r_proto'
23164 setlocale_r_proto='$setlocale_r_proto'
23165 setnetent_r_proto='$setnetent_r_proto'
23166 setprotoent_r_proto='$setprotoent_r_proto'
23167 setpwent_r_proto='$setpwent_r_proto'
23168 setservent_r_proto='$setservent_r_proto'
23171 sharpbang='$sharpbang'
23172 shmattype='$shmattype'
23173 shortsize='$shortsize'
23176 sig_count='$sig_count'
23177 sig_name='$sig_name'
23178 sig_name_init='$sig_name_init'
23180 sig_num_init='$sig_num_init'
23181 sig_size='$sig_size'
23182 signal_t='$signal_t'
23183 sitearch='$sitearch'
23184 sitearchexp='$sitearchexp'
23186 sitebinexp='$sitebinexp'
23187 sitehtml1dir='$sitehtml1dir'
23188 sitehtml1direxp='$sitehtml1direxp'
23189 sitehtml3dir='$sitehtml3dir'
23190 sitehtml3direxp='$sitehtml3direxp'
23192 sitelib_stem='$sitelib_stem'
23193 sitelibexp='$sitelibexp'
23194 siteman1dir='$siteman1dir'
23195 siteman1direxp='$siteman1direxp'
23196 siteman3dir='$siteman3dir'
23197 siteman3direxp='$siteman3direxp'
23198 siteprefix='$siteprefix'
23199 siteprefixexp='$siteprefixexp'
23200 sitescript='$sitescript'
23201 sitescriptexp='$sitescriptexp'
23202 sizesize='$sizesize'
23203 sizetype='$sizetype'
23207 sockethdr='$sockethdr'
23208 socketlib='$socketlib'
23209 socksizetype='$socksizetype'
23211 spackage='$spackage'
23212 spitshell='$spitshell'
23213 srand48_r_proto='$srand48_r_proto'
23214 srandom_r_proto='$srandom_r_proto'
23216 ssizetype='$ssizetype'
23217 startperl='$startperl'
23219 static_ext='$static_ext'
23221 stdio_base='$stdio_base'
23222 stdio_bufsiz='$stdio_bufsiz'
23223 stdio_cnt='$stdio_cnt'
23224 stdio_filbuf='$stdio_filbuf'
23225 stdio_ptr='$stdio_ptr'
23226 stdio_stream_array='$stdio_stream_array'
23227 strerror_r_proto='$strerror_r_proto'
23230 subversion='$subversion'
23234 targetarch='$targetarch'
23238 timeincl='$timeincl'
23239 timetype='$timetype'
23240 tmpnam_r_proto='$tmpnam_r_proto'
23246 ttyname_r_proto='$ttyname_r_proto'
23255 uidformat='$uidformat'
23261 uquadtype='$uquadtype'
23262 use5005threads='$use5005threads'
23263 use64bitall='$use64bitall'
23264 use64bitint='$use64bitint'
23265 usecrosscompile='$usecrosscompile'
23266 usedevel='$usedevel'
23268 usedtrace='$usedtrace'
23269 usefaststdio='$usefaststdio'
23270 useithreads='$useithreads'
23271 uselargefiles='$uselargefiles'
23272 uselongdouble='$uselongdouble'
23273 usemallocwrap='$usemallocwrap'
23274 usemorebits='$usemorebits'
23275 usemultiplicity='$usemultiplicity'
23276 usemymalloc='$usemymalloc'
23278 useopcode='$useopcode'
23279 useperlio='$useperlio'
23280 useposix='$useposix'
23281 usereentrant='$usereentrant'
23282 userelocatableinc='$userelocatableinc'
23284 useshrplib='$useshrplib'
23285 usesitecustomize='$usesitecustomize'
23286 usesocks='$usesocks'
23287 usethreads='$usethreads'
23288 usevendorprefix='$usevendorprefix'
23289 usevfork='$usevfork'
23292 uvXUformat='$uvXUformat'
23293 uvoformat='$uvoformat'
23296 uvuformat='$uvuformat'
23297 uvxformat='$uvxformat'
23299 vendorarch='$vendorarch'
23300 vendorarchexp='$vendorarchexp'
23301 vendorbin='$vendorbin'
23302 vendorbinexp='$vendorbinexp'
23303 vendorhtml1dir='$vendorhtml1dir'
23304 vendorhtml1direxp='$vendorhtml1direxp'
23305 vendorhtml3dir='$vendorhtml3dir'
23306 vendorhtml3direxp='$vendorhtml3direxp'
23307 vendorlib='$vendorlib'
23308 vendorlib_stem='$vendorlib_stem'
23309 vendorlibexp='$vendorlibexp'
23310 vendorman1dir='$vendorman1dir'
23311 vendorman1direxp='$vendorman1direxp'
23312 vendorman3dir='$vendorman3dir'
23313 vendorman3direxp='$vendorman3direxp'
23314 vendorprefix='$vendorprefix'
23315 vendorprefixexp='$vendorprefixexp'
23316 vendorscript='$vendorscript'
23317 vendorscriptexp='$vendorscriptexp'
23319 version_patchlevel_string='$version_patchlevel_string'
23320 versiononly='$versiononly'
23322 voidflags='$voidflags'
23325 yaccflags='$yaccflags'
23330 : add special variables
23331 $test -f $src/patchlevel.h && \
23332 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
23333 echo "PERL_PATCHLEVEL='$perl_patchlevel'" >>config.sh
23334 echo "PERL_CONFIG_SH=true" >>config.sh
23336 : propagate old symbols
23337 if $test -f UU/config.sh; then
23338 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
23339 $sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' \
23340 config.sh config.sh UU/oldconfig.sh |\
23341 $sort | $uniq -u >UU/oldsyms
23342 set X `cat UU/oldsyms`
23348 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
23350 echo ": Variables propagated from previous config.sh file." >>config.sh
23351 for sym in `cat UU/oldsyms`; do
23352 echo " Propagating $hint variable "'$'"$sym..."
23353 eval 'tmp="$'"${sym}"'"'
23355 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
23361 : Finish up by extracting the .SH files
23365 echo "Extraction done."
23375 If you'd like to make any changes to the config.sh file before I begin
23376 to configure things, do it as a shell escape now (e.g. !vi config.sh).
23379 rp="Press return or use a shell escape to edit config.sh:"
23384 *) : in case they cannot read
23385 sh 1>&4 -c "$ans";;
23390 : if this fails, just run all the .SH files by hand
23399 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
23406 Now you need to generate make dependencies by running "$make depend".
23407 You might prefer to run it in background: "$make depend > makedepend.out &"
23408 It can take a while, so you might not want to run it right now.
23413 rp="Run $make depend now?"
23417 $make depend && echo "Now you must run '$make'."
23420 echo "You must run '$make depend' then '$make'."
23423 elif test -f [Mm]akefile; then
23425 echo "Now you must run a $make."
23427 echo "Configure done."
23430 if $test -f Policy.sh; then
23433 If you compile $package on a different machine or from a different object
23434 directory, copy the Policy.sh file from this object directory to the
23435 new one before you run Configure -- this will help you with most of
23436 the policy defaults.
23440 if $test -f config.msg; then
23441 echo "Hmm. I also noted the following information while running:"
23443 $cat config.msg >&4
23446 $rm -f kit*isdone ark*isdone