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 # Generated on Fri Jan 27 15:48:54 CET 2012 [metaconfig 3.5 PL0]
32 # (with additional metaconfig patches by perlbug@perl.org)
37 SCO csh still thinks true is false. Write to SCO today and tell them that next
38 year Configure ought to "rm /bin/csh" unless they fix their blasted shell. :-)
40 (Actually, Configure ought to just patch csh in place. Hmm. Hmmmmm. All
41 we'd have to do is go in and swap the && and || tokens, wherever they are.)
43 [End of diatribe. We now return you to your regularly scheduled programming...]
47 OOPS! You naughty creature! You didn't run Configure with sh!
48 I will attempt to remedy the situation by running sh for you...
52 true || exec sh $0 $argv:q
54 (exit $?0) || cat c2$$
55 (exit $?0) || exec sh $0 $argv:q
58 if test -f /dev/cputype -a -f /dev/drivers -a -f /dev/osversion; then
61 *** I'm sorry but this system looks like Plan 9 and Plan 9 doesn't do
62 *** Configure that well. (Plan 9 is close to UNIX but not close enough.)
63 *** Please read the README.plan9 for further instructions.
64 *** Cannot continue, aborting.
70 if test ! -c /dev/null ; then
73 *** I'm sorry, but /dev/null appears to be a file rather than a device.
74 *** Please consult your operating sytem's notes for making a device
76 *** Cannot continue, aborting.
82 : compute my invocation name
86 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
91 : Proper separator for the PATH environment variable
93 : On OS/2 this directory should exist if this is not floppy only system ":-]"
94 if test -d c:/. || ( uname -a | grep -i 'os\(/\|\)2' ) 2>&1 >/dev/null ; then
95 if test -n "$OS2_SHELL"; then
97 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
98 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
100 elif test -n "$DJGPP"; then
101 case "X${MACHTYPE:-nonesuchmach}" in
108 : Proper PATH setting
109 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
110 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
111 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
112 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
113 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
114 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /opt/ansic/bin /usr/ccs/bin"
115 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
116 paths="$paths /sbin /usr/sbin /usr/libexec"
117 paths="$paths /system/gnu_library/bin"
121 case "$p_$PATH$p_" in
123 *) test -d $p && PATH=$PATH$p_$p ;;
130 : shall we be using ksh?
136 if (PATH=.; alias -x) >/dev/null 2>&1; then
139 if test -f /hp-ux -a -f /bin/ksh; then
140 needksh='to avoid sh bug in "here document" expansion'
142 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
143 if test X`/usr/bin/uname -v` = X4; then
144 avoidksh="to avoid AIX 4's /bin/sh"
148 if test -f /osf_boot -a -f /usr/sbin/setld; then
149 if test X`/usr/bin/uname -s` = XOSF1; then
150 avoidksh="to avoid Digital UNIX' ksh"
155 case "$inksh/$needksh" in
162 case "$inksh/$avoidksh" in
168 case "$inksh/$needksh-$avoidksh-" in
171 (I see you are using the Korn shell. Some ksh's blow up on $me,
172 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
179 echo "(Feeding myself to $newsh $reason.)"
181 Configure|*/Configure) exec $newsh $0 "$@";;
182 *) exec $newsh Configure "$@";;
186 test -x "${newsh}" || unset newsh
188 : if needed, set CDPATH to a harmless value that is not chatty
189 : avoid bash 2.02 problems with empty CDPATH.
193 *bash*) CDPATH='.' ;;
199 : Configure runs within the UU subdirectory
200 test -d UU || mkdir UU
340 initialinstalllocation=''
369 d_attribute_deprecated=''
370 d_attribute_format=''
371 d_attribute_malloc=''
372 d_attribute_nonnull=''
373 d_attribute_noreturn=''
375 d_attribute_unused=''
376 d_attribute_warn_unused_result=''
377 d_printf_format_null=''
380 d_builtin_choose_expr=''
383 d_c99_variadic_macros=''
430 endhostent_r_proto=''
436 endprotoent_r_proto=''
442 endservent_r_proto=''
495 gethostbyaddr_r_proto=''
497 gethostbyname_r_proto=''
499 gethostent_r_proto=''
512 getnetbyaddr_r_proto=''
514 getnetbyname_r_proto=''
528 d_getprotobyname_r=''
529 getprotobyname_r_proto=''
530 d_getprotobynumber_r=''
531 getprotobynumber_r_proto=''
533 getprotoent_r_proto=''
545 getservbyname_r_proto=''
547 getservbyport_r_proto=''
549 getservent_r_proto=''
576 d_libm_lib_version=''
579 d_localtime_r_needs_tzset=''
590 d_malloc_good_size=''
634 d_old_pthread_create_joinable=''
635 old_pthread_create_joinable=''
637 d_pthread_attr_setscope=''
676 sethostent_r_proto=''
693 setprotoent_r_proto=''
705 setservent_r_proto=''
741 d_sprintf_returns_strlen=''
753 perl_static_inline=''
758 d_stdio_ptr_lval_nochange_cnt=''
759 d_stdio_ptr_lval_sets_cnt=''
903 d_gdbm_ndbm_h_uses_prototypes=''
904 d_gdbmndbm_h_uses_prototypes=''
906 d_ndbm_h_uses_prototypes=''
981 d_inc_version_list=''
983 inc_version_list_init=''
1002 ignore_versioned_solibs=''
1066 d_perl_otherlibdirs=''
1074 api_versionstring=''
1080 version_patchlevel_string=''
1084 d_nv_preserves_uv=''
1085 d_nv_zero_is_allbits_zero=''
1096 nv_overflows_integers_at=''
1097 nv_preserves_uv_bits=''
1169 installsitehtml1dir=''
1172 installsitehtml3dir=''
1179 installsiteman1dir=''
1182 installsiteman3dir=''
1187 installsitescript=''
1204 d_stdio_stream_array=''
1205 stdio_stream_array=''
1222 usekernprocpathname=''
1223 ccflags_uselargefiles=''
1224 ldflags_uselargefiles=''
1225 libswanted_uselargefiles=''
1234 usensgetexecutablepath=''
1247 installvendorarch=''
1254 installvendorhtml1dir=''
1256 vendorhtml1direxp=''
1257 installvendorhtml3dir=''
1259 vendorhtml3direxp=''
1265 installvendorman1dir=''
1268 installvendorman3dir=''
1275 installvendorscript=''
1288 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1291 : We must find out about Eunice early
1293 if test -f /etc/unixtovms; then
1294 eunicefix=/etc/unixtovms
1296 if test -f /etc/unixtovms.exe; then
1297 eunicefix=/etc/unixtovms.exe
1300 : Set executable suffix now -- needed before hints available
1301 if test -f "/libs/version.library"; then
1304 elif test -f "/system/gnu_library/bin/ar.pm"; then
1307 elif test -n "$DJGPP"; then
1310 elif test -d c:/. -o -n "$is_os2" ; then
1317 : Trailing extension. Override this in a hint file, if needed.
1318 : Extra object files, if any, needed on this platform.
1321 : Possible local include directories to search.
1322 : Set locincpth to "" in a hint file to defeat local include searches.
1323 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1324 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1326 : no include file wanted by default
1329 : Enable -DEBUGGING and -DDEBUGGING from the command line
1334 : change the next line if compiling for Xenix/286 on Xenix/386
1335 xlibpth='/usr/lib/386 /lib/386'
1336 : Possible local library directories to search.
1337 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1338 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1340 : general looking path for locating libraries
1341 glibpth="/lib /usr/lib $xlibpth"
1342 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1343 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1344 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1345 test -d /usr/lib64 && glibpth="$glibpth /lib64 /usr/lib64 /usr/local/lib64"
1347 : Private path used by Configure to find libraries. Its value
1348 : is prepended to libpth. This variable takes care of special
1349 : machines, like the mips. Usually, it should be empty.
1352 : default library list
1354 : some systems want to use only the non-versioned libso:s
1355 ignore_versioned_solibs=''
1356 : set usethreads on the Configure command line to enable threads.
1357 usereentrant='undef'
1358 : full support for void wanted by default
1364 : set useposix=false in your hint file to disable the POSIX extension.
1366 : set useopcode=false in your hint file to disable the Opcode extension.
1369 ccflags_uselargefiles=''
1370 ldflags_uselargefiles=''
1371 libswanted_uselargefiles=''
1372 : set usemultiplicity on the Configure command line to enable multiplicity.
1373 : set usesocks on the Configure command line to enable socks.
1374 : List of libraries we want.
1375 : If anyone needs extra -lxxx, put those in a hint file.
1376 libswanted="sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun"
1377 libswanted="$libswanted m crypt sec util c cposix posix ucb bsd BSD"
1378 : We probably want to search /usr/shlib before most other libraries.
1379 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1380 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1381 glibpth="/usr/shlib $glibpth"
1382 : Do not use vfork unless overridden by a hint file.
1385 : Find the basic shell for Bourne shell scripts
1389 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1392 if test -f "$xxx"; then
1395 : Build up a list and do a single loop so we can 'break' out.
1396 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1397 for xxx in sh bash ksh pdksh ash; do
1399 try="$try ${p}/${xxx}"
1403 if test -f "$xxx"; then
1406 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1409 elif test -f "$xxx.exe"; then
1420 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1422 Usually it's in /bin/sh. How did you even get this far?
1423 Please contact me (Perl Maintainers) at perlbug@perl.org and
1424 we'll try to straighten this all out.
1430 : see if sh knows # comments
1431 if `$sh -c '#' >/dev/null 2>&1`; then
1435 test -f $xcat$_exe || xcat=/usr/bin/cat
1436 if test ! -f $xcat$_exe; then
1437 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1438 if test -f $p/cat$_exe; then
1443 if test ! -f $xcat$_exe; then
1444 echo "Can't find cat anywhere!"
1448 echo "#!$xcat" >sharp
1451 ./sharp > today 2>/dev/null
1452 if test -s today; then
1455 echo "#! $xcat" > sharp
1458 ./sharp > today 2>/dev/null
1459 if test -s today; then
1467 echo "Your $sh doesn't grok # comments--I will strip them later on."
1470 echo "exec grep -v '^[ ]*#'" >spitshell
1472 $eunicefix spitshell
1473 spitshell=`pwd`/spitshell
1475 echo "I presume that if # doesn't work, #! won't work either!"
1480 : figure out how to guarantee sh startup
1482 '') startsh=${sharpbang}${sh} ;;
1494 : echo "Yup, it does."
1496 echo "Hmm... '$startsh' does not guarantee sh startup..."
1497 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1501 : Save command line options in file UU/cmdline.opt for later use in
1502 : generating config.sh.
1503 cat > cmdline.opt <<EOSH
1504 : Configure command line arguments.
1513 cat >>cmdline.opt <<EOSH
1514 config_arg$argn='$arg'
1516 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1519 arg_exp=`cat cmdl.opt`
1520 args_exp="$args_exp$args_sep'$arg_exp'"
1521 argn=`expr $argn + 1`
1526 : produce awk script to parse command line options
1527 cat >options.awk <<'EOF'
1529 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1531 len = length(optstr);
1532 for (i = 1; i <= len; i++) {
1533 c = substr(optstr, i, 1);
1534 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1545 if (substr(str, 1, 1) != "-") {
1546 printf("'%s'\n", str);
1550 for (i = 2; i <= len; i++) {
1551 c = substr(str, i, 1);
1553 printf("-%s\n", substr(str, i));
1559 printf("'%s'\n", substr(str, i + 1));
1572 : process the command line options
1573 set X `for arg in "$@"; do echo "X$arg"; done |
1574 sed -e s/X// | awk -f options.awk`
1579 : set up default values
1589 rm -f optdef.sh posthint.sh
1590 cat >optdef.sh <<EOS
1596 while test $# -gt 0; do
1598 -d) shift; fastread=yes;;
1599 -e) shift; alldone=cont;;
1603 if test -r "$1"; then
1606 echo "$me: cannot read config file $1." >&2
1612 -h) shift; error=true;;
1613 -r) shift; reuseval=true;;
1614 -s) shift; silent=true; realsilent=true;;
1615 -E) shift; alldone=exit;;
1616 -K) shift; knowitall=true;;
1617 -O) shift; override=true;;
1618 -S) shift; silent=true; extractsh=true;;
1623 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1624 echo "$me: ignoring -D $1" >&2
1627 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1628 *) echo "$1='define'" >> optdef.sh;;
1635 *=) echo "$1" >> optdef.sh;;
1637 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1638 echo "$me: ignoring -U $1" >&2
1640 *) echo "$1='undef'" >> optdef.sh;;
1651 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1655 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1656 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1662 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1663 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1664 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1665 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1666 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1667 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1673 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1675 echo "$yyy=''" >> posthint.sh ;;
1680 echo "$yyy='$zzz'" >> posthint.sh ;;
1682 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1684 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1689 echo "$yyy=$zzz" >> posthint.sh ;;
1690 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1694 -V) echo "$me generated by metaconfig 3.5 PL0." >&2
1697 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1705 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1706 [-U symbol] [-U symbol=] [-A command:symbol...]
1707 -d : use defaults for all answers.
1708 -e : go on without questioning past the production of config.sh.
1709 -f : specify an alternate default configuration file.
1710 -h : print this help message and exit (with an error status).
1711 -r : reuse C symbols value if possible (skips costly nm extraction).
1712 -s : silent mode, only echoes questions and essential information.
1713 -D : define symbol to have some value:
1714 -D symbol symbol gets the value 'define'
1715 -D symbol=value symbol gets the value 'value'
1716 common used examples (see INSTALL for more info):
1717 -Duse64bitint use 64bit integers
1718 -Duse64bitall use 64bit integers and pointers
1719 -Dusethreads use thread support
1720 -Dinc_version_list=none do not include older perl trees in @INC
1721 -DEBUGGING=none DEBUGGING options
1722 -Dcc=gcc choose your compiler
1723 -Dprefix=/opt/perl5 choose your destination
1724 -E : stop at the end of questions, after having produced config.sh.
1725 -K : do not use unless you know what you are doing.
1726 -O : let -D and -U override definitions from loaded configuration file.
1727 -S : perform variable substitutions on all .SH files (can mix with -f)
1728 -U : undefine symbol:
1729 -U symbol symbol gets the value 'undef'
1730 -U symbol= symbol gets completely empty
1732 -A : manipulate symbol after the platform specific hints have been applied:
1733 -A append:symbol=value append value to symbol
1734 -A symbol=value like append:, but with a separating space
1735 -A define:symbol=value define symbol to have value
1736 -A clear:symbol define symbol to be ''
1737 -A define:symbol define symbol to be 'define'
1738 -A eval:symbol=value define symbol to be eval of value
1739 -A prepend:symbol=value prepend value to symbol
1740 -A undef:symbol define symbol to be 'undef'
1741 -A undef:symbol= define symbol to be ''
1742 e.g.: -A prepend:libswanted='cl pthread '
1743 -A ccflags=-DSOME_MACRO
1744 -V : print version number and exit (with a zero status).
1751 case "$fastread$alldone" in
1754 case "$extractsh" in
1757 if test ! -t 0; then
1758 echo "Say 'sh Configure', not 'sh <Configure'"
1768 true) exec 1>/dev/null;;
1771 : run the defines and the undefines, if any, but leave the file out there...
1774 : create the posthint manipulation script and leave the file out there...
1779 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1780 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1781 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1782 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1783 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1786 : Some greps do not return status, grrr.
1787 echo "grimblepritz" >grimble
1788 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1790 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1796 : the following should work in any shell
1800 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1801 cat >contains <<'EOSS'
1802 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1807 : Find the path to the source tree
1810 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1814 *) src=`cd ../$src && pwd` ;;
1827 if test -f $rsrc/Configure && \
1828 $contains "^package='$package'\$" $rsrc/Configure >/dev/null 2>&1
1830 : found it, so we are ok.
1833 for src in . .. ../.. ../../.. ../../../..; do
1834 if test -f ../$src/Configure && \
1835 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1846 Sorry, I can't seem to locate the source dir for $package. Please start
1847 Configure with an explicit path -- i.e. /some/path/Configure.
1855 echo "Sources for $package found in \"$src\"." >&4
1859 : script used to extract .SH files with variable substitutions
1860 cat >extract <<'EOS'
1862 echo "Doing variable substitutions on .SH files..."
1863 if test -f MANIFEST; then
1864 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1866 echo "(Looking for .SH files under the source directory.)"
1867 set x `(cd "$src"; find . -name "*.SH" -print)`
1871 0) set x `(cd "$src"; echo *.SH)`; shift;;
1873 if test ! -f "$src/$1"; then
1879 while test $name; do
1880 if test ! -d "$name"; then
1881 create="$name $create";
1882 name=`echo $name | sed -e "s|^[^/]*$||"`;
1883 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1888 for file in $create; do
1897 dir=`expr X$file : 'X\(.*\)/'`
1898 file=`expr X$file : 'X.*/\(.*\)'`
1899 (cd "$dir" && . ./$file)
1909 dir=`expr X$file : 'X\(.*\)/'`
1910 file=`expr X$file : 'X.*/\(.*\)'`
1911 (set x $dir; shift; eval $mkdir_p)
1912 sh <"$src/$dir/$file"
1921 if test -f "$src/config_h.SH"; then
1922 if test ! -f config.h; then
1923 : oops, they left it out of MANIFEST, probably, so do it anyway.
1924 . "$src/config_h.SH"
1929 : extract files and exit if asked to do so
1930 case "$extractsh" in
1932 case "$realsilent" in
1936 case "$config_sh" in
1937 '') config_sh='config.sh';;
1940 echo "Fetching answers from $config_sh..."
1943 test "$override" && . ./optdef.sh
1947 echo "Extraction done."
1952 : Eunice requires " " instead of "", can you believe it
1955 echo "Beginning of configuration questions for $package."
1957 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1959 : first determine how to suppress newline on echo command
1961 echo "Checking echo to see how to suppress newlines..."
1962 (echo "hi there\c" ; echo " ") >.echotmp
1963 if $contains c .echotmp >/dev/null 2>&1 ; then
1974 echo $n "The star should be here-->$c"
1978 : Now test for existence of everything in MANIFEST
1980 if test -f "$rsrc/MANIFEST"; then
1981 echo "First let's make sure your kit is complete. Checking..." >&4
1982 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | \
1983 (split -l 50 2>/dev/null || split -50)
1986 for filelist in x??; do
1987 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` \
1988 >/dev/null 2>>"$tmppwd/missing")
1990 if test -s missing; then
1994 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1996 You have the option of continuing the configuration process, despite the
1997 distinct possibility that your kit is damaged, by typing 'y'es. If you
1998 do, don't blame me if something goes wrong. I advise you to type 'n'o
1999 and contact the author (perlbug@perl.org).
2002 echo $n "Continue? [n] $c" >&4
2006 echo "Continuing..." >&4
2010 echo "ABORTING..." >&4
2015 echo "Looks good..."
2018 echo "There is no MANIFEST file. I hope your kit is complete !"
2022 : Find the appropriate value for a newline for tr
2024 if test -n "$DJGPP"; then
2027 if test X"$trnl" = X; then
2028 case "`echo foo|tr '\n' x 2>/dev/null`" in
2032 if test X"$trnl" = X; then
2033 case "`echo foo|tr '\012' x 2>/dev/null`" in
2034 foox) trnl='\012' ;;
2037 if test X"$trnl" = X; then
2038 case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
2039 fooxy) trnl='\n\r' ;;
2042 if test X"$trnl" = X; then
2045 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
2051 : compute the number of columns on the terminal for proper question formatting
2056 : set up the echo used in my read
2057 myecho="case \"\$xxxm\" in
2058 '') echo $n \"\$rp $c\" >&4;;
2060 '') echo $n \"[\$xxxm] $c\";;
2062 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
2064 echo $n \"[\$xxxm] $c\" >&4
2066 echo $n \"\$rp [\$xxxm] $c\" >&4
2072 : now set up to do reads with possible shell escape and default assignment
2078 case "\$fastread" in
2079 yes) case "\$dflt" in
2082 case "\$silent-\$rp" in
2087 *) case "\$silent" in
2088 true) case "\$rp" in
2093 while expr "X\$ans" : "X!" >/dev/null; do
2097 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2105 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2114 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2119 echo "(OK, I'll run with -d after this question.)" >&4
2122 echo "*** Sorry, \$1 not supported yet." >&4
2132 echo "*** Substitution done -- please confirm."
2134 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2139 echo "*** Error -- try again."
2146 case "\$ans\$xxxm\$nostick" in
2158 : create .config dir to save info across Configure sessions
2159 test -d ../.config || mkdir ../.config
2160 cat >../.config/README <<EOF
2161 This directory created by Configure to save information that should
2162 persist across sessions for $package.
2164 You may safely delete it if you wish.
2167 : See if we are using a devel version and want that
2168 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2171 usedevel="$define" ;;
2172 *) case "$xversion" in
2175 *** WHOA THERE!!! ***
2177 This is an UNSTABLE DEVELOPMENT release.
2178 The version of this $package distribution is $xversion, that is, odd,
2179 (as opposed to even) and that signifies a development release.
2180 If you want a maintenance release, you want an even-numbered version.
2182 Do ***NOT*** install this into production use.
2183 Data corruption and crashes are possible.
2185 It is most seriously suggested that you do not continue any further
2186 unless you want to help in developing and debugging Perl.
2188 If you *still* want to build perl, you can answer 'y' now,
2189 or pass -Dusedevel to Configure.
2192 rp='Do you really want to continue?'
2196 [yY]) echo >&4 "Okay, continuing."
2197 usedevel="$define" ;;
2198 *) echo >&4 "Okay, bye."
2209 case "$versiononly" in
2210 '') versiononly="$define" ;;
2212 case "$installusrbinperl" in
2213 '') installusrbinperl="$undef" ;;
2218 : general instructions
2221 user=`(logname) 2>/dev/null`
2223 '') user=`whoami 2>&1`;;
2225 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2228 rp='Would you like to see the instructions?'
2239 This installation shell script will examine your system and ask you questions
2240 to determine how the perl5 package should be installed. If you get
2241 stuck on a question, you may use a ! shell escape to start a subshell or
2242 execute a command. Many of the questions will have default answers in square
2243 brackets; typing carriage return will give you the default.
2245 On some of the questions which ask for file or directory names you are allowed
2246 to use the ~name construct to specify the login directory belonging to "name",
2247 even if you don't have a shell which knows about that. Questions where this is
2248 allowed will be marked "(~name ok)".
2252 dflt='Type carriage return to continue'
2256 The prompter used in this script allows you to use shell variables and
2257 backticks in your answers. You may use $1, $2, etc... to refer to the words
2258 in the default answer, as if the default line was a set of arguments given to a
2259 script shell. This means you may also use $* to repeat the whole default line,
2260 so you do not have to re-type everything to add something to the default.
2262 Every time there is a substitution, you will have to confirm. If there is an
2263 error (e.g. an unmatched backtick), the default answer will remain unchanged
2264 and you will be prompted again.
2266 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2267 the questions and use the computed defaults (or the previous answers if there
2268 was already a config.sh file). Type 'Configure -h' for a list of options.
2269 You may also start interactively and then answer '& -d' at any prompt to turn
2270 on the non-interactive behaviour for the remainder of the execution.
2276 Much effort has been expended to ensure that this shell script will run on any
2277 Unix system. If despite that it blows up on yours, your best bet is to edit
2278 Configure and run it again. If you can't run Configure for some reason,
2279 you'll have to generate a config.sh file by hand. Whatever problems you
2280 have, let me (perlbug@perl.org) know how I blew it.
2282 This installation script affects things in two ways:
2284 1) it may do direct variable substitutions on some of the files included
2286 2) it builds a config.h file for inclusion in C programs. You may edit
2287 any of these files as the need arises after running this script.
2289 If you make a mistake on a question, there is no easy way to back up to it
2290 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2291 files. Configure will offer to let you do this before it runs the SH files.
2294 dflt='Type carriage return to continue'
2296 case "$firsttime" in
2297 true) echo $user >>../.config/instruct;;
2301 : find out where common programs are
2303 echo "Locating common programs..." >&4
2316 if test -d \$dir/\$thing; then
2322 for thisthing in \$dir/\$thing; do
2323 : just loop through to pick last item
2325 if test -f \$thisthing; then
2328 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2331 elif test -f \$dir/\$thing.exe; then
2332 if test -n "$DJGPP"; then
2333 echo \$dir/\$thing.exe
2334 elif test "$eunicefix" != ":"; then
2335 : on Eunice apparently
2388 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2389 pth="$pth /lib /usr/lib"
2390 for file in $loclist; do
2394 if test -f "$xxx"; then
2397 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2398 xxx=`./loc $file $file $pth`
2401 '') xxx=`./loc $file $file $pth`;;
2402 *) xxx=`./loc $xxx $xxx $pth`;;
2404 eval $file=$xxx$_exe
2408 echo $file is in $xxx.
2411 echo $file is in $xxx.
2414 echo "I don't know where '$file' is, and my life depends on it." >&4
2415 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2421 echo "Don't worry if any of the following aren't found..."
2423 for file in $trylist; do
2427 if test -f "$xxx"; then
2430 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2431 xxx=`./loc $file $file $pth`
2434 '') xxx=`./loc $file $file $pth`;;
2435 *) xxx=`./loc $xxx $xxx $pth`;;
2437 eval $file=$xxx$_exe
2441 echo $file is in $xxx.
2444 echo $file is in $xxx.
2447 echo "I don't see $file out there, $say."
2454 echo "Substituting grep for egrep."
2461 *) if $less -R </dev/null >/dev/null; then
2462 echo "Substituting less -R for less."
2470 echo "Substituting cp for ln."
2479 echo "I can't find make or gmake, and my life depends on it." >&4
2480 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2488 *) # We can't have osname yet.
2489 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2490 # Assume that gmake, if found, is definitely GNU make
2491 # and prefer it over the system make.
2492 echo "Substituting gmake for make."
2500 echo "Hopefully test is built into your sh."
2503 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2504 echo "Using the test built into your sh."
2512 echo "Hopefully echo is built into your sh."
2517 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2518 $echo $n "hi there$c" >foo1
2519 echo $n "hi there$c" >foo2
2520 if cmp foo1 foo2 >/dev/null 2>&1; then
2521 echo "They are compatible. In fact, they may be identical."
2528 They are not compatible! You are probably running ksh on a non-USG system.
2529 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2530 have echo built in and we may have to run some Bourne shell scripts. That
2531 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2534 $echo $n "The star should be here-->$c"
2541 # This question was auctioned at YAPC::Europe-2007 in Vienna
2542 # I never promised you could answer it. I only auctioned the question.
2544 The following message is sponsored by
2546 Dresden.pm<--The stars should be here.
2548 Dear Perl user, system administrator or package
2549 maintainer, the Perl community sends greetings to
2550 you. Do you (emblematical) greet back [Y/n]? n
2554 : Check what type of C compiler we use
2558 cat <<'EOSC' >>trygcc
2563 int main(int argc, char *argv[]) {
2567 if $cc -o try $ccflags $ldflags try.c; then
2570 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2576 # Skip this test because it gives a false match on output like:
2577 # ./trygcc: line 23: cc: command not found
2578 # case "`$cc -v -c try.c 2>&1`" in
2579 # *gcc*) trygcc=no ;;
2581 if $test X"$trygcc" = Xyes; then
2582 if gcc -o try -c try.c; then
2584 echo "You seem to have a working gcc, though." >&4
2585 # Switching compilers may undo the work of hints files.
2586 # The most common problem is -D_REENTRANT for threads.
2587 # This heuristic catches that case, but gets false positives
2588 # if -Dusethreads was not actually specified. Better to
2589 # bail out here with a useful message than fail
2590 # mysteriously later. Should we perhaps just try to
2591 # re-invoke Configure -Dcc=gcc config_args ?
2592 if $test -f usethreads.cbu; then
2595 *** However, any setting of the C compiler flags (e.g. for thread support)
2596 *** will be lost. It may be necessary for you to restart Configure and
2597 *** add -Dcc=gcc to your Configure command line.
2600 rp="Would you like to go ahead and try gcc anyway?"
2603 rp="Would you like to use it?"
2606 if $test -f myread; then
2609 if $test -f UU/myread; then
2612 echo "Cannot find myread, sorry. Aborting." >&2
2617 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2630 cat <<'EOSC' >>checkcc
2635 int main(int argc, char *argv[]) {
2639 if $cc -o try $ccflags $ldflags try.c; then
2642 if $test X"$despair" = Xyes; then
2643 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2646 You need to find a working C compiler.
2647 Either (purchase and) install the C compiler supplied by your OS vendor,
2648 or for a free C compiler try http://gcc.gnu.org/
2649 I cannot continue any further, aborting.
2658 : determine whether symbolic links are supported
2661 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2662 echo "Symbolic links are supported." >&4
2665 echo "Symbolic links are NOT supported." >&4
2670 : determine whether symbolic links are supported
2674 echo "Checking how to test for symbolic links..." >&4
2676 if $test "X$issymlink" = X; then
2678 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2679 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2681 if test $? = 0; then
2684 echo "Your builtin 'test -h' may be broken." >&4
2687 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2690 if test -f "$p/$test"; then
2699 echo "Trying external '$test -h'." >&4
2700 issymlink="$test -h"
2701 if $test ! -h sym >/dev/null 2>&1; then
2702 echo "External '$test -h' is broken, too." >&4
2710 if $test "X$issymlink" = X; then
2711 if $test -L sym 2>/dev/null; then
2712 issymlink="$test -L"
2713 echo "The builtin '$test -L' worked." >&4
2716 if $test "X$issymlink" != X; then
2717 echo "You can test for symbolic links with '$issymlink'." >&4
2719 echo "I do not know how you can test for symbolic links." >&4
2723 *) echo "No symbolic links, so not testing for their testing..." >&4
2728 : Make symlinks util
2729 case "$mksymlinks" in
2732 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2735 *) case "$lns:$issymlink" in
2736 *"ln"*" -s:"*"test -"?)
2737 echo "Creating the symbolic links..." >&4
2738 echo "(First creating the subdirectories...)" >&4
2740 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2742 test -z "$directory" && break
2746 if test ! -d t/base; then
2747 echo "Failed to create the subdirectories. Aborting." >&4
2750 echo "(Then creating the symlinks...)" >&4
2751 awk '{print $1}' $src/MANIFEST | while true; do
2753 test -z "$filename" && break
2754 if test -f $filename; then
2755 if $issymlink $filename; then
2759 if test -f $filename; then
2760 echo "$filename already exists, not symlinking."
2762 ln -s $src/$filename $filename
2766 if test ! -f t/base/lex.t; then
2767 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2772 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2780 : Check for Cross-Compilation
2781 case "$usecrosscompile" in
2783 $echo "Cross-compiling..."
2786 *-*-gcc) # A cross-compiling gcc, probably.
2787 targetarch=`$echo $cc|$sed 's/-gcc$//'`
2789 # leave out ld, choosing it is more complex
2791 ranlib=$targetarch-ranlib
2792 $echo 'extern int foo;' > try.c
2793 set X `$cc -v -E try.c 2>&1 | $awk '/^#include </,/^End of search /'|$grep '/include'`
2795 if $test $# -gt 0; then
2797 incpth="`$echo $incpth|$sed 's/^ //'`"
2798 echo "Guessing incpth '$incpth'." >&4
2800 j="`$echo $i|$sed 's,/include$,/lib,'`"
2801 if $test -d $j; then
2805 libpth="`$echo $libpth|$sed 's/^ //'`"
2806 echo "Guessing libpth '$libpth'." >&4
2811 case "$targetarch" in
2812 '') echo "Targetarch not defined." >&4; croak=y ;;
2813 *) echo "Using targetarch $targetarch." >&4 ;;
2816 '') echo "Incpth not defined." >&4; croak=y ;;
2817 *) echo "Using incpth '$incpth'." >&4 ;;
2820 '') echo "Libpth not defined." >&4; croak=y ;;
2821 *) echo "Using libpth '$libpth'." >&4 ;;
2824 '') for i in $incpth; do
2825 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
2827 echo "Guessing usrinc $usrinc." >&4
2832 '') echo "Usrinc not defined." >&4; croak=y ;;
2835 *) echo "Using usrinc $usrinc." >&4 ;;
2837 case "$targethost" in
2838 '') echo "Targethost not defined." >&4; croak=y ;;
2839 *) echo "Using targethost $targethost." >&4
2844 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2847 /*) run=$src/Cross/run
2848 targetmkdir=$src/Cross/mkdir
2850 from=$src/Cross/from
2852 *) pwd=`$test -f ../Configure & cd ..; pwd`
2854 targetmkdir=$pwd/Cross/mkdir
2856 from=$pwd/Cross/from
2859 case "$targetrun" in
2860 '') targetrun=ssh ;;
2865 case "$targetfrom" in
2866 '') targetfrom=scp ;;
2870 from=$from-$targetfrom
2871 case "$targetdir" in
2873 echo "Guessing targetdir $targetdir." >&4
2876 case "$targetuser" in
2878 echo "Guessing targetuser $targetuser." >&4
2881 case "$targetfrom" in
2885 case "$targetrun" in
2897 '') cwd=$targetdir ;;
2901 if $test ! -f \$exe.xok; then
2905 $targetrun -l $targetuser $targethost "cd \$cwd && ./\$exe \$@"
2908 *) echo "Unknown targetrun '$targetrun'" >&4
2912 case "$targetmkdir" in
2914 cat >$targetmkdir <<EOF
2916 $targetrun -l $targetuser $targethost "mkdir -p \$@"
2918 $chmod a+rx $targetmkdir
2920 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
2932 $targetmkdir \`dirname \$f\`
2933 $targetto $q \$f $targetuser@$targethost:\$f || exit 1
2936 $targetmkdir $targetdir/\`dirname \$f\`
2937 $targetto $q \$f $targetuser@$targethost:$targetdir/\$f || exit 1
2950 $mkdir -p $targetdir/\`dirname \$f\`
2951 $cp \$f $targetdir/\$f || exit 1
2954 $targetmkdir $targetdir/\`dirname \$f\`
2955 $cp \$f $targetdir/\$f || exit 1
2962 *) echo "Unknown targetto '$targetto'" >&4
2966 case "$targetfrom" in
2973 $targetfrom $q $targetuser@$targethost:$targetdir/\$f . || exit 1
2978 cp) cat >$from <<EOF
2983 cp $targetdir/\$f . || exit 1
2988 *) echo "Unknown targetfrom '$targetfrom'" >&4
2992 if $test ! -f $run; then
2993 echo "Target 'run' script '$run' not found." >&4
2997 if $test ! -f $to; then
2998 echo "Target 'to' script '$to' not found." >&4
3002 if $test ! -f $from; then
3003 echo "Target 'from' script '$from' not found." >&4
3007 if $test ! -f $run -o ! -f $to -o ! -f $from; then
3011 Using '$run' for remote execution,
3012 and '$from' and '$to'
3013 for remote file transfer.
3019 usecrosscompile='undef'
3024 : see whether [:lower:] and [:upper:] are supported character classes
3026 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
3028 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
3032 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
3033 # (0xd9 and 0xe2), therefore that is a nice testing point.
3034 if test "X$up" = X -o "X$low" = X; then
3035 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
3041 if test "X$up" = X -o "X$low" = X; then
3042 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
3048 if test "X$up" = X -o "X$low" = X; then
3049 case "`echo RS | od -x 2>/dev/null`" in
3051 echo "Hey, this might be EBCDIC." >&4
3052 if test "X$up" = X -o "X$low" = X; then
3053 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
3054 rs) up='[A-IJ-RS-Z]'
3059 if test "X$up" = X -o "X$low" = X; then
3060 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
3070 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
3072 echo "Using $up and $low to convert case." >&4
3075 echo "I don't know how to translate letters from upper to lower case." >&4
3076 echo "Your tr is not acting any way I know of." >&4
3080 : set up the translation script tr, must be called with ./tr of course
3084 '[A-Z][a-z]') exec $tr '$up' '$low';;
3085 '[a-z][A-Z]') exec $tr '$low' '$up';;
3092 : Try to determine whether config.sh was made on this system
3093 case "$config_sh" in
3095 myuname=`$uname -a 2>/dev/null`
3096 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
3097 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
3098 # because the A-Z/a-z are not consecutive.
3099 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e "s,['/],,g" | \
3100 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
3101 newmyuname="$myuname"
3103 case "$knowitall" in
3105 if test -f ../config.sh; then
3106 if $contains myuname= ../config.sh >/dev/null 2>&1; then
3107 eval "`grep myuname= ../config.sh`"
3109 if test "X$myuname" = "X$newmyuname"; then
3117 : Get old answers from old config file if Configure was run on the
3118 : same system, otherwise use the hints.
3121 if test -f config.sh; then
3123 rp="I see a config.sh file. Shall I use it to set the defaults?"
3126 n*|N*) echo "OK, I'll ignore it."
3127 mv config.sh config.sh.old
3128 myuname="$newmyuname"
3130 *) echo "Fetching default answers from your old config.sh file..." >&4
3138 : Older versions did not always set $sh. Catch re-use of such
3148 if test ! -f config.sh; then
3151 First time through, eh? I have some defaults handy for some systems
3152 that need some extra help getting the Configure answers right:
3155 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3157 : Half the following guesses are probably wrong... If you have better
3158 : tests or hints, please send them to perlbug@perl.org
3159 : The metaconfig authors would also appreciate a copy...
3160 $test -f /irix && osname=irix
3161 $test -f /xenix && osname=sco_xenix
3162 $test -f /dynix && osname=dynix
3163 $test -f /dnix && osname=dnix
3164 $test -f /lynx.os && osname=lynxos
3165 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3166 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3167 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3168 $test -f /bin/mips && /bin/mips && osname=mips
3169 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
3170 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
3171 $test -d /usr/apollo/bin && osname=apollo
3172 $test -f /etc/saf/_sactab && osname=svr4
3173 $test -d /usr/include/minix && osname=minix
3174 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3175 if $test -d /MachTen -o -d /MachTen_Folder; then
3177 if $test -x /sbin/version; then
3178 osvers=`/sbin/version | $awk '{print $2}' |
3179 $sed -e 's/[A-Za-z]$//'`
3180 elif $test -x /usr/etc/version; then
3181 osvers=`/usr/etc/version | $awk '{print $2}' |
3182 $sed -e 's/[A-Za-z]$//'`
3188 $test -f /sys/posix.dll &&
3189 $test -f /usr/bin/what &&
3190 set X `/usr/bin/what /sys/posix.dll` &&
3191 $test "$3" = UWIN &&
3195 if $test -f $uname; then
3203 umips) osname=umips ;;
3206 [23]100) osname=mips ;;
3207 next*) osname=next ;;
3209 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3210 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3213 elif $test -f /etc/kconfig; then
3215 if test "$lns" = "$ln -s"; then
3217 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3219 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3226 if test -n "$DJGPP"; then
3235 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3237 # oslevel can fail with:
3238 # oslevel: Unable to acquire lock.
3239 *not\ found) osvers="$4"."$3" ;;
3240 '<3240'|'<>3240') osvers=3.2.0 ;;
3241 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3242 '=3250'|'>3250') osvers=3.2.5 ;;
3246 bsd386) osname=bsd386
3249 cygwin*) osname=cygwin
3252 *dc.osx) osname=dcosx
3258 domainos) osname=apollo
3264 dragonfly) osname=dragonfly
3267 dynixptx*) osname=dynixptx
3268 osvers=`echo "$4"|sed 's/^v//'`
3270 freebsd) osname=freebsd
3272 genix) osname=genix ;;
3276 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3292 netbsd*) osname=netbsd
3295 news-os) osvers="$3"
3297 4*) osname=newsos4 ;;
3301 next*) osname=next ;;
3302 nonstop-ux) osname=nonstopux ;;
3303 openbsd) osname=openbsd
3309 POSIX-BC | posix-bc ) osname=posix-bc
3312 powerux | power_ux | powermax_os | powermaxos | \
3313 powerunix | power_unix) osname=powerux
3319 solaris) osname=solaris
3321 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3328 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3332 titanos) osname=titanos
3341 ultrix) osname=ultrix
3344 osf1|mls+) case "$5" in
3347 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3350 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3353 hp*) osname=hp_osf1 ;;
3354 mips) osname=mips_osf1 ;;
3357 # UnixWare 7.1.2 is known as Open UNIX 8
3358 openunix|unixware) osname=svr5
3366 $2) case "$osname" in
3370 : svr4.x or possibly later
3380 if test -f /stand/boot ; then
3381 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3382 if test -n "$INITPROG" -a -f "$INITPROG"; then
3383 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3384 if test -n "$isesix"; then
3392 *) if test -f /etc/systemid; then
3394 set `echo $3 | $sed 's/\./ /g'` $4
3395 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3397 elif $test -f $src/hints/sco_$1_$2.sh; then
3399 elif $test -f $src/hints/sco_$1.sh; then
3404 '') : Still unknown. Probably a generic Sys V.
3413 *) case "$osname" in
3414 '') : Still unknown. Probably a generic BSD.
3422 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3423 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3424 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3427 $rm -f UU/kernel.what
3428 elif test -d c:/. -o -n "$is_os2" ; then
3435 case "$targetarch" in
3438 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3443 : Now look for a hint file osname_osvers, unless one has been
3444 : specified already.
3447 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3448 : Also try without trailing minor version numbers.
3449 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3450 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3451 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3452 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3455 *) case "$osvers" in
3458 *) if $test -f $src/hints/$file.sh ; then
3460 elif $test -f $src/hints/$xfile.sh ; then
3462 elif $test -f $src/hints/$xxfile.sh ; then
3464 elif $test -f $src/hints/$xxxfile.sh ; then
3466 elif $test -f $src/hints/$xxxxfile.sh ; then
3468 elif $test -f "$src/hints/${osname}.sh" ; then
3477 if $test -f Policy.sh ; then
3480 none) dflt="Policy" ;;
3481 *) dflt="Policy $dflt" ;;
3486 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3490 if $test -f Policy.sh ; then
3493 There's also a Policy hint file available, which should make the
3494 site-specific (policy) questions easier to answer.
3501 You may give one or more space-separated answers, or "none" if appropriate.
3502 If you have a handcrafted Policy.sh file or a Policy.sh file generated by a
3503 previous run of Configure, you may specify it as well as or instead of
3504 OS-specific hints. If hints are provided for your OS, you should use them:
3505 although Perl can probably be built without hints on many platforms, using
3506 hints often improve performance and may enable features that Configure can't
3507 set up on its own. If there are no hints that match your OS, specify "none";
3508 DO NOT give a wrong version or a wrong OS.
3512 rp="Which of these apply, if any?"
3515 for file in $tans; do
3516 if $test X$file = XPolicy -a -f Policy.sh; then
3518 $cat Policy.sh >> UU/config.sh
3519 elif $test -f $src/hints/$file.sh; then
3520 . $src/hints/$file.sh
3521 $cat $src/hints/$file.sh >> UU/config.sh
3522 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3525 : Give one chance to correct a possible typo.
3526 echo "$file.sh does not exist"
3528 rp="hint to use instead?"
3530 for file in $ans; do
3531 if $test -f "$src/hints/$file.sh"; then
3532 . $src/hints/$file.sh
3533 $cat $src/hints/$file.sh >> UU/config.sh
3534 elif $test X$ans = X -o X$ans = Xnone ; then
3537 echo "$file.sh does not exist -- ignored."
3544 : Remember our hint file for later.
3545 if $test -f "$src/hints/$file.sh" ; then
3555 echo "Fetching default answers from $config_sh..." >&4
3559 cp $config_sh config.sh 2>/dev/null
3569 test "$override" && . ./optdef.sh
3571 : Restore computed paths
3572 for file in $loclist $trylist; do
3573 eval $file="\$_$file"
3578 Configure uses the operating system name and version to set some defaults.
3579 The default value is probably right if the name rings a bell. Otherwise,
3580 since spelling matters for me, either accept the default or answer "none"
3587 ''|' '|none) dflt=none ;;
3588 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3591 *) dflt="$osname" ;;
3593 rp="Operating system name?"
3597 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3603 ''|' '|none) dflt=none ;;
3604 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3605 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3607 ''|' ') dflt=none ;;
3612 *) dflt="$osvers" ;;
3614 rp="Operating system version?"
3624 : who configured the system
3625 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3628 cf_by=`(logname) 2>/dev/null`
3631 cf_by=`(whoami) 2>/dev/null`
3633 "") cf_by=unknown ;;
3638 : decide how portable to be. Allow command line overrides.
3639 case "$d_portable" in
3641 *) d_portable="$define" ;;
3644 : set up shell script to do ~ expansion
3650 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3653 if $test -f /bin/csh; then
3654 /bin/csh -f -c "glob \$1"
3659 name=\`$expr x\$1 : '..\([^/]*\)'\`
3660 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3661 if $test ! -d "\$dir"; then
3663 echo "\$me: can't locate home directory for: \$name" >&2
3668 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3684 : now set up to get a file name
3688 cat <<'EOSC' >>getfile
3704 : getfile will accept an answer from the comma-separated list
3705 : enclosed in parentheses even if it does not meet other criteria.
3706 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3707 fn=`echo $fn | sed 's/(.*)//'`
3713 loc_file=`expr $fn : '.*:\(.*\)'`
3714 fn=`expr $fn : '\(.*\):.*'`
3722 */*) fullpath=true;;
3731 *e*) exp_file=true;;
3734 *p*) nopath_ok=true;;
3739 *d*) type='Directory';;
3740 *l*) type='Locate';;
3745 Locate) what='File';;
3750 case "$d_portable" in
3758 while test "$type"; do
3763 true) rp="$rp (~name ok)";;
3766 if test -f UU/getfile.ok && \
3767 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3786 value=`UU/filexp $ans`
3789 if test "$ans" != "$value"; then
3790 echo "(That expands to $value on this system.)"
3804 /*) value="$ansexp" ;;
3805 [a-zA-Z]:/*) value="$ansexp" ;;
3810 echo "I shall only accept a full path name, as in /bin/ls." >&4
3811 echo "Use a ! shell escape if you wish to check pathnames." >&4
3814 echo "Please give a full path name, starting with slash." >&4
3817 echo "Note that using ~name is ok provided it expands well." >&4
3830 for fp in $gfpth; do
3831 if test "X$fp" = X.; then
3836 if test -f "$pf"; then
3838 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3840 echo "($value is not a plain file, but that's ok.)"
3843 if test X"$type" = X; then
3850 for fp in $gfpth; do
3851 if test "X$fp" = X.; then
3856 direxp="$fp/$ansexp"
3858 if test -d "$direxp"; then
3866 if test -d "$ansexp"; then
3867 echo "(Looking for $loc_file in directory $value.)"
3868 value="$value/$loc_file"
3869 ansexp="$ansexp/$loc_file"
3871 if test -f "$ansexp"; then
3874 case "$nopath_ok" in
3875 true) case "$value" in
3877 *) echo "Assuming $value will be in people's path."
3893 if test "$fastread" = yes; then
3898 rp="$what $value doesn't exist. Use that name anyway?"
3917 test "X$gfpthkeep" != Xy && gfpth=""
3920 : determine root of directory hierarchy where package will be installed.
3923 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
3926 dflt=`echo "$prefix" | sed 's/.$//'`
3934 By default, $package will be installed in $dflt/bin, manual pages
3935 under $dflt/man, etc..., i.e. with $dflt as prefix for all
3936 installation directories. Typically this is something like /usr/local.
3937 If you wish to have binaries under /usr/bin but other parts of the
3938 installation under /usr/local, that's ok: you will be prompted
3939 separately for each of the installation directories, the prefix being
3940 only used to set the defaults.
3944 rp='Installation prefix to use?'
3952 *) oldprefix="$prefix";;
3959 : allow them to override the AFS root
3962 *) afsroot=$afsroot ;;
3968 $define|true) afs=true ;;
3969 $undef|false) afs=false ;;
3970 *) if $test -d $afsroot; then
3978 echo "AFS may be running... I'll be extra cautious then..." >&4
3980 echo "AFS does not seem to be running..." >&4
3983 : determine installation prefix for where package is to be installed.
3987 Since you are running AFS, I need to distinguish the directory in which
3988 files will reside from the directory in which they are installed (and from
3989 which they are presumably copied to the former directory by occult means).
3992 case "$installprefix" in
3993 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
3994 *) dflt="$installprefix";;
3999 In some special cases, particularly when building $package for distribution,
4000 it is convenient to distinguish the directory in which files should be
4001 installed from the directory ($prefix) in which they will
4002 eventually reside. For most users, these two directories are the same.
4005 case "$installprefix" in
4007 *) dflt=$installprefix;;
4011 rp='What installation prefix should I use for installing files?'
4013 installprefix="$ans"
4014 installprefixexp="$ansexp"
4016 : Perform the prefixexp/installprefixexp correction if necessary
4017 cat <<EOS >installprefix
4020 cat <<'EOSC' >>installprefix
4021 : Change installation prefix, if necessary.
4022 if $test X"$prefix" != X"$installprefix"; then
4023 eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`"
4025 eval "install${prefixvar}=\"\$${prefixvar}exp\""
4028 chmod +x installprefix
4029 $eunicefix installprefix
4031 : Set variables such as privlib and privlibexp from the output of ./getfile
4032 : performing the prefixexp/installprefixexp correction if necessary.
4033 cat <<EOS >setprefixvar
4036 cat <<'EOSC' >>setprefixvar
4037 eval "${prefixvar}=\"\$ans\""
4038 eval "${prefixvar}exp=\"\$ansexp\""
4041 chmod +x setprefixvar
4042 $eunicefix setprefixvar
4044 : set up the script used to warn in case of inconsistency
4053 '') echo "The $hint value for \$$var on this machine was \"$was\"!" >&4
4055 *) echo "Hmm. Based on the hints in hints/$hintfile.sh, " >&4
4056 echo "the $hint value for \$$var on this machine was \"$was\"!" >&4
4061 echo "*** WHOA THERE!!! ***" >&4
4062 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
4065 rp=" Keep the $hint value?"
4068 y) td=$was; tu=$was;;
4072 : function used to set '$1' to '$val'
4073 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
4075 $define$undef) . ./whoa; eval "$var=\$td";;
4076 $undef$define) . ./whoa; eval "$var=\$tu";;
4077 *) eval "$var=$val";;
4080 : get the patchlevel
4082 echo "Getting the current patchlevel..." >&4
4083 if $test -r $rsrc/patchlevel.h;then
4084 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
4085 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
4086 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4087 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
4088 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
4089 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4090 perl_patchlevel=`egrep ',"(MAINT|SMOKE)[0-9][0-9]*"' $rsrc/patchlevel.h|tail -1|sed 's/[^0-9]//g'`
4099 $echo "(You do not have patchlevel.h. Eek.)"
4101 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
4102 version_patchlevel_string="version $patchlevel subversion $subversion"
4103 case "$perl_patchlevel" in
4105 *) perl_patchlevel=`echo $perl_patchlevel | sed 's/.* //'`
4106 version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel"
4110 $echo "(You have $package $version_patchlevel_string.)"
4114 : XXX Should be a Configure test for double-dots in filenames.
4115 version=`echo $revision $patchlevel $subversion | \
4116 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4117 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4118 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4121 version=`echo $revision $patchlevel $subversion | \
4122 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4123 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4124 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4127 : Special case the 5.005_xx maintenance series, which used 5.005
4128 : without any subversion label as a subdirectory in $sitelib
4129 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
4130 api_versionstring='5.005'
4133 : Do we want threads support and if so, what type
4134 case "$usethreads" in
4135 $define|true|[yY]*) dflt='y';;
4136 *) # Catch case where user specified ithreads or 5005threads but
4137 # forgot -Dusethreads (A.D. 4/2002)
4138 case "$useithreads$use5005threads" in
4139 *$define*) dflt='y';;
4146 Perl can be built to take advantage of threads on some systems.
4147 To do so, Configure can be run with -Dusethreads.
4149 Note that Perl built with threading support runs slightly slower
4150 and uses more memory than plain Perl. The current implementation
4151 is believed to be stable, but it is fairly new, and so should be
4152 treated with caution.
4154 If this doesn't make any sense to you, just accept the default '$dflt'.
4156 rp='Build a threading Perl?'
4159 y|Y) val="$define" ;;
4165 if $test $patchlevel -lt 9; then
4166 case "$usethreads" in
4170 Since release 5.6, Perl has had two different threading implementations,
4171 the newer interpreter-based version (ithreads) with one interpreter per
4172 thread, and the older 5.005 version (5005threads).
4173 The 5005threads version is effectively unmaintained and will probably be
4174 removed in Perl 5.10, so there should be no need to build a Perl using it
4175 unless needed for backwards compatibility with some existing 5.005threads
4179 : Default to ithreads unless overridden on command line or with
4182 case "$use5005threads" in
4183 $define|true|[yY]*) dflt='n';;
4185 case "$useithreads" in
4186 $undef|false|[nN]*) dflt='n';;
4188 rp='Use the newer interpreter-based ithreads?'
4191 y|Y) val="$define" ;;
4196 : Now set use5005threads to the opposite value.
4197 case "$useithreads" in
4198 $define) val="$undef" ;;
4205 useithreads="$undef"
4206 use5005threads="$undef"
4210 case "$useithreads$use5005threads" in
4214 You cannot have both the ithreads and the 5.005 threads enabled
4215 at the same time. Disabling the 5.005 threads since they are
4216 much less stable than the ithreads.
4219 use5005threads="$undef"
4224 : perl-5.9.x and later
4226 if test X"$usethreads" = "X$define"; then
4227 case "$use5005threads" in
4231 5.005 threads has been removed for 5.10. Perl will be built using ithreads.
4238 use5005threads="$undef"
4239 useithreads="$usethreads"
4242 case "$d_oldpthreads" in
4243 '') : Configure tests would be welcome here. For now, assume undef.
4245 *) val="$d_oldpthreads" ;;
4251 : Look for a hint-file generated 'call-back-unit'. If the
4252 : user has specified that a threading perl is to be built,
4253 : we may need to set or change some other defaults.
4254 if $test -f usethreads.cbu; then
4255 echo "Your platform has some specific hints regarding threaded builds, using them..."
4258 case "$usethreads" in
4259 "$define"|true|[yY]*)
4261 (Your platform does not have any specific hints for threaded builds.
4262 Assuming POSIX threads, then.)
4268 : Check if multiplicity is required
4271 Perl can be built so that multiple Perl interpreters can coexist
4272 within the same Perl executable.
4275 case "$useithreads" in
4278 This multiple interpreter support is required for interpreter-based threads.
4282 *) case "$usemultiplicity" in
4283 $define|true|[yY]*) dflt='y';;
4287 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
4288 rp='Build Perl for multiplicity?'
4291 y|Y) val="$define" ;;
4299 : Check if morebits is requested
4300 case "$usemorebits" in
4301 "$define"|true|[yY]*)
4302 use64bitint="$define"
4303 uselongdouble="$define"
4304 usemorebits="$define"
4306 *) usemorebits="$undef"
4310 : Determine the C compiler to be used
4316 rp="Use which C compiler?"
4320 : See whether they have no cc but they do have gcc
4322 if $test -f cc.cbu; then
4327 : make some quick guesses about what we are up against
4329 $echo $n "Hmm... $c"
4339 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
4340 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
4342 echo "Looks kind of like an OSF/1 system, but we'll see..."
4344 elif test `echo abc | $tr a-z A-Z` = Abc ; then
4345 xxx=`./loc addbib blurfl $pth`
4346 if $test -f $xxx; then
4347 echo "Looks kind of like a USG system with BSD features, but we'll see..."
4351 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
4352 echo "Looks kind of like an extended USG system, but we'll see..."
4354 echo "Looks kind of like a USG system, but we'll see..."
4358 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
4359 echo "Looks kind of like a BSD system, but we'll see..."
4363 echo "Looks kind of like a Version 7 system, but we'll see..."
4366 case "$eunicefix" in
4369 There is, however, a strange, musty smell in the air that reminds me of
4370 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
4374 : it so happens the Eunice I know will not run shell scripts in Unix format
4378 echo "Congratulations. You aren't running Eunice."
4382 : Detect OS2. The p_ variable is set above in the Head.U unit.
4383 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
4384 : semicolon as a patch separator
4389 I have the feeling something is not exactly right, however...don't tell me...
4390 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
4391 (Or you may be running DOS with DJGPP.)
4396 if test -f /xenix; then
4397 echo "Actually, this looks more like a XENIX system..."
4402 echo "It's not Xenix..."
4407 if test -f /venix; then
4408 echo "Actually, this looks more like a VENIX system..."
4415 echo "Nor is it Venix..."
4418 chmod +x bsd usg v7 osf1 eunice xenix venix os2
4419 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
4422 : Check if we are using GNU gcc and what its version is
4424 echo "Checking for GNU cc in disguise and/or its version number..." >&4
4428 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
4430 printf("%s\n", __VERSION__);
4432 printf("%s\n", "1");
4438 if $cc -o try $ccflags $ldflags try.c; then
4439 gccversion=`$run ./try`
4440 case "$gccversion" in
4441 '') echo "You are not using GNU cc." ;;
4442 *) echo "You are using GNU cc $gccversion."
4448 echo "*** WHOA THERE!!! ***" >&4
4449 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
4450 case "$knowitall" in
4452 echo " You'd better start hunting for one and let me know about it." >&4
4458 case "$gccversion" in
4459 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
4461 case "$gccversion" in
4462 '') gccosandvers='' ;;
4463 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
4464 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
4466 case "$gccosandvers" in
4467 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
4468 $osname$osvers) ;; # looking good
4469 $osname*) cat <<EOM >&4
4471 *** WHOA THERE!!! ***
4473 Your gcc has not been compiled for the exact release of
4474 your operating system ($gccosandvers versus $osname$osvers).
4476 In general it is a good idea to keep gcc synchronized with
4477 the operating system because otherwise serious problems
4478 may ensue when trying to compile software, like Perl.
4480 I'm trying to be optimistic here, though, and will continue.
4481 If later during the configuration and build icky compilation
4482 problems appear (headerfile conflicts being the most common
4483 manifestation), I suggest reinstalling the gcc to match
4484 your operating system release.
4488 *) gccosandvers='' ;; # failed to parse, better be silent
4496 # gcc 3.* complain about adding -Idirectories that they already know about,
4497 # so we will take those off from locincpth.
4498 case "$gccversion" in
4500 echo "main(){}">try.c
4501 for incdir in $locincpth; do
4502 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
4503 grep '^c[cp]p*[01]: warning: changing search order '`
4504 if test "X$warn" != X; then
4505 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
4511 : What should the include directory be ?
4513 $echo $n "Hmm... $c"
4517 if $test -f /bin/mips && /bin/mips; then
4518 echo "Looks like a MIPS system..."
4519 $cat >usr.c <<'EOCP'
4520 #ifdef SYSTYPE_BSD43
4524 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4525 dflt='/bsd43/usr/include'
4529 mips_type='System V'
4531 $rm -f usr.c usr.out
4532 echo "and you're compiling with the $mips_type compiler and libraries."
4536 echo "Doesn't look like a MIPS system."
4546 case "$xxx_prompt" in
4549 rp='Where are the include files you want to use?'
4557 : see how we invoke the C preprocessor
4559 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4560 cat <<'EOT' >testcpp.c
4566 if test ! -f cppstdin; then
4567 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4568 # AIX cc -E doesn't show the absolute headerfile
4569 # locations but we'll cheat by using the -M flag.
4570 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
4572 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4575 echo "Keeping your $hint cppstdin wrapper."
4578 wrapper=`pwd`/cppstdin
4582 if $test "X$cppstdin" != "X" && \
4583 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4584 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4586 echo "You used to use $cppstdin $cppminus so we'll use that again."
4588 '') echo "But let's see if we can live without a wrapper..." ;;
4590 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4591 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4593 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4596 echo "(However, $cpprun $cpplast does not work, let's see...)"
4604 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4611 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4612 $cc -E <testcpp.c >testcpp.out 2>&1; \
4613 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4614 echo "Yup, it does."
4617 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4618 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4619 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4620 echo "Yup, it does."
4623 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4624 $cc -P <testcpp.c >testcpp.out 2>&1; \
4625 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4626 echo "Yipee, that works!"
4629 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4630 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4631 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4632 echo "At long last!"
4635 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4636 $cpp <testcpp.c >testcpp.out 2>&1; \
4637 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4641 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4642 $cpp - <testcpp.c >testcpp.out 2>&1; \
4643 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4644 echo "Hooray, it works! I was beginning to wonder."
4647 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4648 $wrapper <testcpp.c >testcpp.out 2>&1; \
4649 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4655 rp="No dice. I can't find a C preprocessor. Name one:"
4659 $x_cpp <testcpp.c >testcpp.out 2>&1
4660 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4661 echo "OK, that will do." >&4
4663 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4678 echo "Perhaps can we force $cc -E using a wrapper..."
4679 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4680 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4686 echo "Nope, we'll have to live without it..."
4700 "$wrapper"|'cppstdin') ;;
4701 *) $rm -f $wrapper;;
4703 $rm -f testcpp.c testcpp.out
4705 : Set private lib path
4708 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4713 '') dlist="$loclibpth $plibpth $glibpth";;
4714 *) dlist="$libpth";;
4717 : Now check and see which directories actually exist, avoiding duplicates
4721 if $test -d $xxx; then
4724 *) libpth="$libpth $xxx";;
4730 Some systems have incompatible or broken versions of libraries. Among
4731 the directories listed in the question below, please remove any you
4732 know not to be holding relevant libraries, and add any that are needed.
4733 Say "none" for none.
4744 rp="Directories to use for library searches?"
4751 : compute shared library extension
4754 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4764 On some systems, shared libraries may be available. Answer 'none' if
4765 you want to suppress searching of shared libraries for the remainder
4766 of this configuration.
4769 rp='What is the file extension used for shared libraries?'
4773 : Define several unixisms.
4774 : Hints files or command line option can be used to override them.
4775 : The convoluted testing is in case hints files set either the old
4778 '') case "$exe_ext" in
4780 *) _exe="$exe_ext" ;;
4785 '') case "$lib_ext" in
4792 '') case "$obj_ext" in
4799 '') case "$path_sep" in
4810 rm_try="$rm -f try try$_exe a.out .out try.[cho] try.$_o core core.try* try.core*"
4812 : Which makefile gets called first. This is used by make depend.
4813 case "$firstmakefile" in
4814 '') firstmakefile='makefile';;
4817 : Check is we will use socks
4819 $define|true|[yY]*) dflt='y';;
4824 Perl can be built to use the SOCKS proxy protocol library. To do so,
4825 Configure must be run with -Dusesocks. If you use SOCKS you also need
4826 to use the PerlIO abstraction layer, this will be implicitly selected.
4828 If this doesn't make any sense to you, just accept the default '$dflt'.
4830 rp='Build Perl for SOCKS?'
4833 y|Y) val="$define" ;;
4839 : Check for uselongdouble support
4841 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
4844 case "$uselongdouble" in
4845 $define|true|[yY]*) dflt='y';;
4850 Perl can be built to take advantage of long doubles which
4851 (if available) may give more accuracy and range for floating point numbers.
4853 If this doesn't make any sense to you, just accept the default '$dflt'.
4855 rp='Try to use long doubles if available?'
4858 y|Y) val="$define" ;;
4864 case "$uselongdouble" in
4865 true|[yY]*) uselongdouble="$define" ;;
4868 : Look for a hint-file generated 'call-back-unit'. If the
4869 : user has specified that long doubles should be used,
4870 : we may need to set or change some other defaults.
4871 if $test -f uselongdouble.cbu; then
4872 echo "Your platform has some specific hints regarding long doubles, using them..."
4873 . ./uselongdouble.cbu
4875 case "$uselongdouble" in
4878 (Your platform does not have any specific hints for long doubles.)
4884 : Looking for optional libraries
4886 echo "Checking for optional libraries..." >&4
4891 case "$libswanted" in
4892 '') libswanted='c_s';;
4895 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
4901 for thisdir in $libpth $xlibpth; do
4902 test -d $thisdir && libspath="$libspath $thisdir"
4904 for thislib in $libswanted; do
4905 for thisdir in $libspath; do
4907 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4908 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
4909 $test -f "$xxx" && eval $libscheck
4910 $test -f "$xxx" && libstyle=shared
4912 if test ! -f "$xxx"; then
4913 xxx=$thisdir/lib$thislib.$so
4914 $test -f "$xxx" && eval $libscheck
4915 $test -f "$xxx" && libstyle=shared
4917 if test ! -f "$xxx"; then
4918 xxx=$thisdir/lib$thislib$_a
4919 $test -f "$xxx" && eval $libscheck
4920 $test -f "$xxx" && libstyle=static
4922 if test ! -f "$xxx"; then
4923 xxx=$thisdir/$thislib$_a
4924 $test -f "$xxx" && eval $libscheck
4925 $test -f "$xxx" && libstyle=static
4927 if test ! -f "$xxx"; then
4928 xxx=$thisdir/lib${thislib}_s$_a
4929 $test -f "$xxx" && eval $libscheck
4930 $test -f "$xxx" && libstyle=static
4931 $test -f "$xxx" && thislib=${thislib}_s
4933 if test ! -f "$xxx"; then
4934 xxx=$thisdir/Slib$thislib$_a
4935 $test -f "$xxx" && eval $libscheck
4936 $test -f "$xxx" && libstyle=static
4938 if $test -f "$xxx"; then
4940 shared) echo "Found -l$thislib (shared)." ;;
4941 static) echo "Found -l$thislib." ;;
4942 *) echo "Found -l$thislib ($libstyle)." ;;
4946 *) dflt="$dflt -l$thislib"
4947 libsfound="$libsfound $xxx"
4949 libsfiles="$libsfiles $yyy"
4950 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
4951 case " $libsdirs " in
4953 *) libsdirs="$libsdirs $yyy" ;;
4960 if $test ! -f "$xxx"; then
4961 echo "No -l$thislib."
4972 ' '|'') dflt='none';;
4977 In order to compile $package on your machine, a number of libraries
4978 are usually needed. Include any other special libraries here as well.
4979 Say "none" for none. The default list is almost always right.
4983 rp="What libraries to use?"
4990 : determine optimization, if desired, or use for debug flag also
4992 ' '|$undef) dflt='none';;
4994 *) dflt="$optimize";;
4998 By default, $package compiles with the -O flag to use the optimizer.
4999 Alternately, you might want to use the symbolic debugger, which uses
5000 the -g flag (on traditional Unix systems). Either flag can be
5001 specified here. To use neither flag, specify the word "none".
5004 rp="What optimizer/debugger flag should be used?"
5008 'none') optimize=" ";;
5011 : Check what DEBUGGING is required from the command line
5012 : -DEBUGGING or -DDEBUGGING or
5013 : -DEBUGGING=both = -g + -DDEBUGGING
5014 : -DEBUGGING=-g or -Doptimize=-g = -g
5015 : -DEBUGGING=none or -UDEBUGGING =
5016 : -DEBUGGING=old or -DEBUGGING=default = ? $optimize
5019 *) DEBUGGING=$EBUGGING ;;
5022 case "$DEBUGGING" in
5026 *) optimize="$optimize -g" ;;
5030 *-g*) set `echo "X $optimize " | sed 's/ -g / /'`
5038 case "$DEBUGGING" in
5039 both|$define) dflt='-DDEBUGGING'
5042 : argument order is deliberate, as the flag will start with - which set could
5043 : think is an option
5044 checkccflag='check=$1; flag=$2; callback=$3;
5046 echo "Checking if your compiler accepts $flag" 2>&1;
5047 echo "int main(void) { return 0; }" > gcctest.c;
5048 if $cc -O2 $flag -o gcctest gcctest.c 2>gcctest.out && ./gcctest; then
5049 echo "Yes, it does." 2>&1;
5050 if $test -s gcctest.out ; then
5051 echo "But your platform does not like it:";
5056 echo "Leaving current flags $ccflags alone." 2>&1
5058 *) dflt="$dflt $flag";
5064 echo "Nope, it does not, but that is ok." 2>&1;
5068 : We will not override a previous value, but we might want to
5069 : augment a hint file
5071 default|recommended)
5072 case "$gccversion" in
5073 1*) dflt="$dflt -fpcc-struct-return" ;;
5075 case "$optimize:$DEBUGGING" in
5076 *-g*:old) dflt="$dflt -DDEBUGGING";;
5078 case "$gccversion" in
5079 2*) if $test -d /etc/conf/kconfig.d &&
5080 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
5082 # Interactive Systems (ISC) POSIX mode.
5087 case "$gccversion" in
5090 ?*) set strict-aliasing -fno-strict-aliasing
5094 # For gcc, adding -pipe speeds up compilations for some, but apparently
5095 # some assemblers can't read from stdin. (It also slows down compilations
5096 # in other cases, but those are apparently rarer these days.) AD 5/2004.
5097 case "$gccversion" in
5103 # on x86_64 (at least) we require an extra library (libssp) in the
5104 # link command line. This library is not named, so I infer that it is
5105 # an implementation detail that may change. Hence the safest approach
5106 # is to add the flag to the flags passed to the compiler at link time,
5107 # as that way the compiler can do the right implementation dependant
5109 case "$gccversion" in
5110 ?*) set stack-protector -fstack-protector
5117 case "$mips_type" in
5118 *BSD*|'') inclwanted="$locincpth $usrinc";;
5119 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
5121 for thisincl in $inclwanted; do
5122 if $test -d $thisincl; then
5123 if $test x$thisincl != x$usrinc; then
5125 *" -I$thisincl "*);;
5126 *) dflt="$dflt -I$thisincl ";;
5132 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
5134 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
5142 *) dflt="$dflt -D$2";;
5146 set signal.h LANGUAGE_C; eval $inctest
5150 ccflags="$ccflags -DSOCKS"
5155 default|recommended) dflt="$ccflags $dflt" ;;
5156 *) dflt="$ccflags";;
5165 Your C compiler may want other flags. For this question you should include
5166 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
5167 but you should NOT include libraries or ld flags like -lwhatever. If you
5168 want $package to honor its debug switch, you should include -DDEBUGGING here.
5169 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
5171 To use no flags, specify the word "none".
5177 rp="Any additional cc flags?"
5184 : the following weeds options from ccflags that are of no interest to cpp
5186 '') cppflags="$ccflags" ;;
5187 *) cppflags="$cppflags $ccflags" ;;
5189 case "$gccversion" in
5190 1*) cppflags="$cppflags -D__GNUC__"
5192 case "$mips_type" in
5194 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
5200 echo "Let me guess what the preprocessor flags are..." >&4
5214 *) ftry="$previous $flag";;
5216 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
5217 >cpp1.out 2>/dev/null && \
5218 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
5219 >cpp2.out 2>/dev/null && \
5220 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
5221 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
5223 cppflags="$cppflags $ftry"
5233 *-*) echo "They appear to be: $cppflags";;
5235 $rm -f cpp.c cpp?.out
5239 : flags used in final linking phase
5241 '') if ./venix; then
5247 *-posix*) dflt="$dflt -posix" ;;
5250 *) dflt="$ldflags";;
5252 # See note above about -fstack-protector
5254 *-fstack-protector*)
5256 *-fstack-protector*) ;; # Don't add it again
5257 *) dflt="$dflt -fstack-protector" ;;
5262 : Try to guess additional flags to pick up local libraries.
5263 for thislibdir in $libpth; do
5264 case " $loclibpth " in
5267 *"-L$thislibdir "*) ;;
5268 *) dflt="$dflt -L$thislibdir" ;;
5280 Your C linker may need flags. For this question you should
5281 include -L/whatever and any other flags used by the C linker, but you
5282 should NOT include libraries like -lwhatever.
5284 Make sure you include the appropriate -L/path flags if your C linker
5285 does not normally search all of the directories you specified above,
5288 To use no flags, specify the word "none".
5292 rp="Any additional ld flags (NOT including libraries)?"
5298 rmlist="$rmlist pdp11"
5302 echo "Checking your choice of C compiler and flags for coherency..." >&4
5303 $cat > try.c <<'EOF'
5305 int main() { printf("Ok\n"); return(0); }
5307 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
5309 $cat >try.msg <<'EOM'
5310 I've tried to compile and run the following simple program:
5313 $cat try.c >> try.msg
5315 $cat >> try.msg <<EOM
5322 and I got the following output:
5326 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5327 if $sh -c "$run ./try " >>try.msg 2>&1; then
5331 *) echo 'The program compiled OK, but produced no output.' >> try.msg
5334 cat >> try.msg <<'EOQS'
5335 If $libs contains -lsfio, and sfio is mis-configured, then it
5336 sometimes (apparently) runs and exits with a 0 status, but with no
5337 output! It may have to do with sfio's use of _exit vs. exit.
5340 rp="You have a big problem. Shall I abort Configure"
5347 echo "The program compiled OK, but exited with status $?." >>try.msg
5348 rp="You have a problem. Shall I abort Configure"
5352 echo "I can't compile the test program." >>try.msg
5353 rp="You have a BIG problem. Shall I abort Configure"
5359 case "$knowitall" in
5361 echo "(The supplied flags or libraries might be incorrect.)"
5369 *) echo "Ok. Stopping Configure." >&4
5374 n) echo "OK, that should do.";;
5376 $rm_try gcctest gcctest.out
5378 : define a shorthand compile call
5382 case "$usedevel" in $define|true|[yY]*) if $test ! -f "${mc_file}.c"; then
5383 echo "Internal Configure script bug - compiler test file ${mc_file}.c is missing. Please report this to perlbug@perl.org" >&4;
5387 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5388 : define a shorthand compile call for compilations that should be ok.
5392 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5394 : determine filename position in cpp output
5396 echo "Computing filename position in cpp output for #include directives..." >&4
5398 vos) testaccess=-e ;;
5401 echo '#include <stdio.h>' > foo.c
5404 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5405 $grep '^[ ]*#.*stdio\.h' | \
5406 while read cline; do
5409 while $test \$# -gt 0; do
5410 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5415 pos=\`expr \$pos + 1\`
5427 *) pos="${fieldn}th";;
5429 echo "Your cpp writes the filename in the $pos field of the line."
5432 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
5433 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
5436 : locate header file
5441 for usrincdir in $usrinc
5443 if test -f \$usrincdir/\$wanted; then
5444 echo "\$usrincdir/\$wanted"
5448 awkprg='{ print \$$fieldn }'
5449 echo "#include <\$wanted>" > foo\$\$.c
5450 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5451 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5452 while read cline; do
5453 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5455 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5456 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5461 # status = 0: grep returned 0 lines, case statement not executed
5462 # status = 1: headerfile found
5463 # status = 2: while loop executed, no headerfile found
5467 if test \$status -eq 1; then
5474 : define an alternate in-header-list? function
5475 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5476 cont=true; xxf="echo \"<\$1> found.\" >&4";
5477 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5478 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5480 case $# in 4) instead=instead;; *) instead="at last";; esac;
5481 while $test "$cont"; do
5483 var=$2; eval "was=\$$2";
5484 if $test "$xxx" && $test -r "$xxx";
5486 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5489 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5490 set $yyy; shift; shift; yyy=$@;
5491 case $# in 0) cont="";;
5492 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5493 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5494 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5495 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5499 do set $yyy; var=$2; eval "was=\$$2";
5500 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5501 set $yyy; shift; shift; yyy=$@;
5504 : see if stdlib is available
5505 set stdlib.h i_stdlib
5508 : check for lengths of integral types
5512 echo "Checking to see how big your integers are..." >&4
5521 printf("intsize=%d;\n", (int)sizeof(int));
5522 printf("longsize=%d;\n", (int)sizeof(long));
5523 printf("shortsize=%d;\n", (int)sizeof(short));
5528 if eval $compile_ok && $run ./try > /dev/null; then
5530 echo "Your integers are $intsize bytes long."
5531 echo "Your long integers are $longsize bytes long."
5532 echo "Your short integers are $shortsize bytes long."
5536 Help! I can't compile and run the intsize test program: please enlighten me!
5537 (This is probably a misconfiguration in your system or libraries, and
5538 you really ought to fix it. Still, I'll try anyway.)
5542 rp="What is the size of an integer (in bytes)?"
5546 rp="What is the size of a long integer (in bytes)?"
5550 rp="What is the size of a short integer (in bytes)?"
5558 : check for long long
5560 echo "Checking to see if you have long long..." >&4
5561 echo 'int main() { long long x = 7; return 0; }' > try.c
5563 if eval $compile; then
5565 echo "You have long long."
5568 echo "You do not have long long."
5574 : check for length of long long
5575 case "${d_longlong}${longlongsize}" in
5578 echo "Checking to see how big your long longs are..." >&4
5579 $cat >try.c <<'EOCP'
5583 printf("%d\n", (int)sizeof(long long));
5588 if eval $compile_ok; then
5589 longlongsize=`$run ./try`
5590 echo "Your long longs are $longlongsize bytes long."
5594 echo "(I can't seem to compile the test program. Guessing...)"
5595 rp="What is the size of a long long (in bytes)?"
5599 if $test "X$longsize" = "X$longlongsize"; then
5600 echo "(That isn't any different from an ordinary long.)"
5606 : see if inttypes.h is available
5607 : we want a real compile instead of Inhdr because some systems
5608 : have an inttypes.h which includes non-existent headers
5611 #include <inttypes.h>
5613 static int32_t foo32 = 0x12345678;
5617 if eval $compile; then
5618 echo "<inttypes.h> found." >&4
5621 echo "<inttypes.h> NOT found." >&4
5630 echo "Checking to see if you have int64_t..." >&4
5632 #include <sys/types.h>
5633 #$i_inttypes I_INTTYPES
5635 #include <inttypes.h>
5637 int main() { int64_t x = 7; }
5640 if eval $compile; then
5642 echo "You have int64_t."
5645 echo "You do not have int64_t."
5651 : Check if 64bit ints have a quad type
5653 echo "Checking which 64-bit integer type we could use..." >&4
5659 val='"unsigned int"'
5664 *) case "$longsize" in
5668 val='"unsigned long"'
5673 *) case "$d_longlong:$longlongsize" in
5678 val='"unsigned long long"'
5683 *) case "$d_int64_t" in
5702 '') echo "Alas, no 64-bit integer types in sight." >&4
5705 *) echo "We could use '$quadtype' for 64-bit integers." >&4
5710 : Do we want 64bit support
5711 case "$uselonglong" in
5712 "$define"|true|[yY]*)
5715 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
5717 use64bitint="$define"
5720 case "$use64bits" in
5721 "$define"|true|[yY]*)
5724 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
5726 use64bitint="$define"
5729 case "$use64bitints" in
5730 "$define"|true|[yY]*)
5733 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
5735 use64bitint="$define"
5738 case "$use64bitsint" in
5739 "$define"|true|[yY]*)
5742 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
5744 use64bitint="$define"
5747 case "$uselonglongs" in
5748 "$define"|true|[yY]*)
5751 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
5753 use64bitint="$define"
5756 case "$use64bitsall" in
5757 "$define"|true|[yY]*)
5760 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
5762 use64bitall="$define"
5767 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
5769 case "$use64bitall" in
5770 "$define"|true|[yY]*) use64bitint="$define" ;;
5776 You have natively 64-bit long integers.
5780 *) case "$use64bitint" in
5781 "$define"|true|[yY]*) dflt='y';;
5790 Perl can be built to take advantage of 64-bit integer types
5791 on some systems. To do so, Configure can be run with -Duse64bitint.
5792 Choosing this option will most probably introduce binary incompatibilities.
5794 If this doesn't make any sense to you, just accept the default '$dflt'.
5795 (The default has been chosen based on your configuration.)
5797 rp='Try to use 64-bit integers, if available?'
5800 [yY]*) val="$define" ;;
5808 case "$use64bitall" in
5809 "$define"|true|[yY]*) dflt='y' ;;
5810 *) case "$longsize" in
5818 You may also choose to try maximal 64-bitness. It means using as much
5819 64-bitness as possible on the platform. This in turn means even more
5820 binary incompatibilities. On the other hand, your platform may not
5821 have any more 64-bitness available than what you already have chosen.
5823 If this doesn't make any sense to you, just accept the default '$dflt'.
5824 (The default has been chosen based on your configuration.)
5826 rp='Try to use maximal 64-bit support, if available?'
5829 [yY]*) val="$define" ;;
5834 case "$use64bitall" in
5836 case "$use64bitint" in
5840 Since you have chosen a maximally 64-bit build, I'm also turning on
5841 the use of 64-bit integers.
5843 use64bitint="$define" ;;
5848 : Look for a hint-file generated 'call-back-unit'. If the
5849 : user has specified that a 64-bit perl is to be built,
5850 : we may need to set or change some other defaults.
5851 if $test -f use64bitint.cbu; then
5852 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
5855 case "$use64bitint" in
5856 "$define"|true|[yY]*)
5858 4) case "$archname64" in
5859 '') archname64=64int ;;
5866 : Look for a hint-file generated 'call-back-unit'. If the
5867 : user has specified that a maximally 64-bit perl is to be built,
5868 : we may need to set or change some other defaults.
5869 if $test -f use64bitall.cbu; then
5870 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
5873 case "$use64bitall" in
5874 "$define"|true|[yY]*)
5876 4) case "$archname64" in
5877 ''|64int) archname64=64all ;;
5884 case "$d_quad:$use64bitint" in
5888 *** You have chosen to use 64-bit integers,
5889 *** but none can be found.
5890 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
5891 *** Cannot continue, aborting.
5898 : check for length of double
5900 case "$doublesize" in
5902 echo "Checking to see how big your double precision numbers are..." >&4
5911 printf("%d\n", (int)sizeof(double));
5916 if eval $compile_ok; then
5917 doublesize=`$run ./try`
5918 echo "Your double is $doublesize bytes long."
5921 echo "(I can't seem to compile the test program. Guessing...)"
5922 rp="What is the size of a double precision number (in bytes)?"
5930 : check for long doubles
5932 echo "Checking to see if you have long double..." >&4
5933 echo 'int main() { long double x = 7.0; }' > try.c
5935 if eval $compile; then
5937 echo "You have long double."
5940 echo "You do not have long double."
5946 : check for length of long double
5947 case "${d_longdbl}${longdblsize}" in
5950 echo "Checking to see how big your long doubles are..." >&4
5951 $cat >try.c <<'EOCP'
5955 printf("%d\n", sizeof(long double));
5960 if eval $compile; then
5961 longdblsize=`$run ./try`
5962 echo "Your long doubles are $longdblsize bytes long."
5966 echo "(I can't seem to compile the test program. Guessing...)" >&4
5967 rp="What is the size of a long double (in bytes)?"
5971 if $test "X$doublesize" = "X$longdblsize"; then
5972 echo "That isn't any different from an ordinary double."
5973 echo "I'll keep your setting anyway, but you may see some"
5974 echo "harmless compilation warnings."
5980 : determine the architecture name
5982 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
5983 tarch=`arch`"-$osname"
5984 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
5985 if uname -m > tmparch 2>&1 ; then
5986 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
5987 -e 's/$/'"-$osname/" tmparch`
5995 case "$myarchname" in
5998 echo "(Your architecture name used to be $myarchname.)"
6002 case "$targetarch" in
6004 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
6009 *) dflt="$archname";;
6011 rp='What is your architecture name'
6014 case "$usethreads" in
6016 echo "Threads selected." >&4
6018 *-thread*) echo "...and architecture name already has -thread." >&4
6020 *) archname="$archname-thread"
6021 echo "...setting architecture name to $archname." >&4
6026 case "$usemultiplicity" in
6028 echo "Multiplicity selected." >&4
6030 *-multi*) echo "...and architecture name already has -multi." >&4
6032 *) archname="$archname-multi"
6033 echo "...setting architecture name to $archname." >&4
6038 case "$use64bitint$use64bitall" in
6040 case "$archname64" in
6042 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
6045 case "$use64bitint" in
6046 "$define") echo "64 bit integers selected." >&4 ;;
6048 case "$use64bitall" in
6049 "$define") echo "Maximal 64 bitness selected." >&4 ;;
6052 *-$archname64*) echo "...and architecture name already has $archname64." >&4
6054 *) archname="$archname-$archname64"
6055 echo "...setting architecture name to $archname." >&4
6061 case "$uselongdouble" in
6063 echo "Long doubles selected." >&4
6064 case "$longdblsize" in
6066 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
6070 *-ld*) echo "...and architecture name already has -ld." >&4
6072 *) archname="$archname-ld"
6073 echo "...setting architecture name to $archname." >&4
6080 if $test -f archname.cbu; then
6081 echo "Your platform has some specific hints for architecture name, using them..."
6085 : set the prefixit variable, to compute a suitable default value
6086 prefixit='case "$3" in
6088 case "$oldprefix" in
6089 "") eval "$1=\"\$$2\"";;
6096 ""|" ") eval "$1=\"\$$2\"";;
6102 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
6104 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
6105 /*-$oldprefix/*|\~*-$oldprefix/*)
6106 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
6107 *) eval "$1=\"\$$2\"";;
6111 : determine installation style
6112 : For now, try to deduce it from prefix unless it is already set.
6113 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
6114 case "$installstyle" in
6115 '') case "$prefix" in
6116 *perl*) dflt='lib';;
6117 *) dflt='lib/perl5' ;;
6120 *) dflt="$installstyle" ;;
6122 : Probably not worth prompting for this since we prompt for all
6123 : the directories individually, and the prompt would be too long and
6127 : determine where public executables go
6132 rp='Pathname where the public executables will reside?'
6134 if $test "X$ansexp" != "X$binexp"; then
6138 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
6139 : XXX If this is fixed, also fix the "start perl" hunk below, which relies on
6140 : this via initialinstalllocation
6143 case "$userelocatableinc" in
6144 $define|true|[yY]*) dflt='y' ;;
6149 Would you like to build Perl so that the installation is relocatable, so that
6150 library paths in @INC are determined relative to the path of the perl binary?
6151 This is not advised for system Perl installs, or if you need to run setid
6152 scripts or scripts under taint mode.
6154 If this doesn't make any sense to you, just accept the default '$dflt'.
6156 rp='Use relocatable @INC?'
6159 y|Y) val="$define" ;;
6162 set userelocatableinc
6165 initialinstalllocation="$binexp"
6166 : Default prefix is now "up one level from where the binaries are"
6167 case "$userelocatableinc" in
6173 installprefixexp=".../.."
6177 : determine where private library files go
6178 : Usual default is /usr/local/lib/perl5/$version.
6179 : Also allow things like /opt/perl/lib/$version, since
6180 : /opt/perl/lib/perl5... would be redundant.
6181 : The default "style" setting is made in installstyle.U
6182 case "$installstyle" in
6183 *lib/perl5*) set dflt privlib lib/$package/$version ;;
6184 *) set dflt privlib lib/$version ;;
6189 There are some auxiliary files for $package that need to be put into a
6190 private library directory that is accessible by everyone.
6195 rp='Pathname where the private library files will reside?'
6200 : set the prefixup variable, to restore leading tilda escape
6201 prefixup='case "$prefixexp" in
6203 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
6206 : determine where public architecture dependent libraries go
6209 : privlib default is /usr/local/lib/$package/$version
6210 : archlib default is /usr/local/lib/$package/$version/$archname
6211 : privlib may have an optional trailing /share.
6212 tdflt=`echo $privlib | $sed 's,/share$,,'`
6213 tdflt=$tdflt/$archname
6222 $spackage contains architecture-dependent library files. If you are
6223 sharing libraries in a heterogeneous environment, you might store
6224 these files in a separate location. Otherwise, you can just include
6225 them with the rest of the public library files.
6230 rp='Where do you want to put the public architecture-dependent libraries?'
6234 if $test X"$archlib" = X"$privlib"; then
6240 : see if setuid scripts can be secure
6243 Some kernels have a bug that prevents setuid #! scripts from being
6244 secure. Some sites have disabled setuid #! scripts because of this.
6246 First let's decide if your kernel supports secure setuid #! scripts.
6247 (If setuid #! scripts would be secure but have been disabled anyway,
6248 don't say that they are secure if asked.)
6253 if $test -d /dev/fd; then
6254 echo "#!$ls" >reflect
6255 chmod +x,u+s reflect
6256 ./reflect >flect 2>&1
6257 if $contains "/dev/fd" flect >/dev/null; then
6258 echo "Congratulations, your kernel has secure setuid scripts!" >&4
6262 If you are not sure if they are secure, I can check but I'll need a
6263 username and password different from the one you are using right now.
6264 If you don't have such a username or don't want me to test, simply
6268 rp='Other username to test security of setuid scripts with?'
6273 case "$d_suidsafe" in
6274 '') echo "I'll assume setuid scripts are *not* secure." >&4
6277 echo "Well, the $hint value is *not* secure." >&4
6279 *) echo "Well, the $hint value *is* secure." >&4
6284 $rm -f reflect flect
6285 echo "#!$ls" >reflect
6286 chmod +x,u+s reflect
6289 echo '"su" will (probably) prompt you for '"$ans's password."
6290 su $ans -c './reflect >flect'
6291 if $contains "/dev/fd" flect >/dev/null; then
6292 echo "Okay, it looks like setuid scripts are secure." >&4
6295 echo "I don't think setuid scripts are secure." >&4
6300 rp='Does your kernel have *secure* setuid scripts?'
6303 [yY]*) val="$define";;
6308 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
6309 echo "(That's for file descriptors, not floppy disks.)"
6315 $rm -f reflect flect
6317 : now see if they want to do setuid emulation
6318 if $test $patchlevel -lt 11; then
6321 case "$d_suidsafe" in
6324 echo "No need to emulate SUID scripts since they are secure here." >&4
6328 Some systems have disabled setuid scripts, especially systems where
6329 setuid scripts cannot be secure. On systems where setuid scripts have
6330 been disabled, the setuid/setgid bits on scripts are currently
6331 useless. It is possible for $package to detect those bits and emulate
6332 setuid/setgid in a secure fashion. This emulation will only work if
6333 setuid scripts have been disabled in your kernel.
6337 "$define") dflt=y ;;
6340 rp="Do you want to do setuid/setgid emulation?"
6343 [yY]*) val="$define";;
6355 SUID emulation has been removed for 5.12
6356 Please re-run Configure without -Dd_dosuid
6365 : Find perl5.005 or later.
6366 echo "Looking for a previously installed perl5.005 or later... "
6368 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
6369 : Check if this perl is recent and can load a simple module
6370 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6373 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6383 '') echo "None found. That's ok.";;
6384 *) echo "Using $perl5." ;;
6387 : Set the siteprefix variables
6390 After $package is installed, you may wish to install various
6391 add-on modules and utilities. Typically, these add-ons will
6392 be installed under $prefix with the rest
6393 of this package. However, you may wish to install such add-ons
6394 elsewhere under a different prefix.
6396 If you do not wish to put everything under a single prefix, that's
6397 ok. You will be prompted for the individual locations; this siteprefix
6398 is only used to suggest the defaults.
6400 The default should be fine for most people.
6404 rp='Installation prefix to use for add-on modules and utilities?'
6405 : XXX Here might be another good place for an installstyle setting.
6406 case "$siteprefix" in
6408 *) dflt=$siteprefix ;;
6411 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6413 case "$siteprefix" in
6417 *) oldsiteprefix="$prefix";;
6422 siteprefixexp="$ansexp"
6424 : determine where site specific libraries go.
6425 : Usual default is /usr/local/lib/perl5/site_perl/$version
6426 : The default "style" setting is made in installstyle.U
6427 : XXX No longer works with Prefixit stuff.
6428 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6430 '') case "$installstyle" in
6431 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
6432 *) dflt=$siteprefix/lib/site_$prog/$version ;;
6440 The installation process will create a directory for
6441 site-specific extensions and modules. Most users find it convenient
6442 to place all site-specific files in this directory rather than in the
6443 main distribution directory.
6447 rp='Pathname for the site-specific library files?'
6451 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6453 : Determine list of previous versions to include in @INC
6454 $cat > getverlist <<EOPL
6457 \$api_versionstring = "$api_versionstring";
6458 \$version = "$version";
6459 \$stem = "$sitelib_stem";
6460 \$archname = "$archname";
6462 $cat >> getverlist <<'EOPL'
6463 # The list found is store twice for each entry: the original name, and
6464 # the binary broken down version as pack "sss", so sorting is easy and
6465 # unambiguous. This will work for all versions that have a maximum of
6466 # three digit groups, separate by '.'s or '_'s. Names are extended with
6467 # ".0.0" to ensure at least three elements for the pack.
6468 # -- H.Merijn Brand (m)'06 23-10-2006
6470 # Can't have leading @ because metaconfig interprets it as a command!
6471 ;@inc_version_list=();
6472 # XXX Redo to do opendir/readdir?
6475 ;@candidates = map {
6476 [ $_, pack "sss", split m/[._]/, "$_.0.0" ] } glob("5.*");
6477 ;@candidates = sort { $a->[1] cmp $b->[1]} @candidates;
6483 ($pversion, $aversion, $vsn5005) = map {
6484 pack "sss", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005";
6485 foreach $d (@candidates) {
6486 if ($d->[1] lt $pversion) {
6487 if ($d->[1] ge $aversion) {
6488 unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]);
6490 elsif ($d->[1] ge $vsn5005) {
6491 unshift(@inc_version_list, grep { -d } $d->[0]);
6495 # Skip newer version. I.e. don't look in
6496 # 5.7.0 if we're installing 5.6.1.
6500 if (@inc_version_list) {
6501 print join(' ', @inc_version_list);
6504 # Blank space to preserve value for next Configure run.
6509 case "$inc_version_list" in
6510 '') if test -x "$perl5$exe_ext"; then
6511 dflt=`$perl5 getverlist`
6516 $undef) dflt='none' ;;
6517 *) eval dflt=\"$inc_version_list\" ;;
6520 ''|' ') dflt=none ;;
6527 In order to ease the process of upgrading, this version of perl
6528 can be configured to use modules built and installed with earlier
6529 versions of perl that were installed under $prefix. Specify here
6530 the list of earlier versions that this version of perl should check.
6531 If Configure detected no earlier versions of perl installed under
6532 $prefix, then the list will be empty. Answer 'none' to tell perl
6533 to not search earlier versions.
6535 The default should almost always be sensible, so if you're not sure,
6536 just accept the default.
6539 rp='List of earlier versions to include in @INC?'
6542 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
6543 *) inc_version_list="$ans" ;;
6545 case "$inc_version_list" in
6547 inc_version_list_init='0'
6548 d_inc_version_list="$undef"
6550 *) inc_version_list_init=`echo $inc_version_list |
6551 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
6552 d_inc_version_list="$define"
6557 : see if malloc/malloc.h has to be included
6558 set malloc/malloc.h i_mallocmalloc
6561 : see if this is a malloc.h system
6562 : we want a real compile instead of Inhdr because some systems have a
6563 : malloc.h that just gives a compile error saying to use stdlib.h instead
6568 #$i_mallocmalloc I_MALLOCMALLOC
6569 #ifdef I_MALLOCMALLOC
6570 # include <malloc/malloc.h>
6573 int main () { return 0; }
6576 if eval $compile; then
6577 echo "<malloc.h> found." >&4
6580 echo "<malloc.h> NOT found." >&4
6587 : check for void type
6589 echo "Checking to see how well your C compiler groks the void type..." >&4
6590 case "$voidflags" in
6602 extern void moo(); /* function returning void */
6603 void (*goo)(); /* ptr to func returning void */
6605 void *hue; /* generic ptr */
6618 int main() { sub(); }
6620 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
6621 voidflags=$defvoidused
6622 echo "Good. It appears to support void to the level $package wants.">&4
6623 if $contains warning .out >/dev/null 2>&1; then
6624 echo "However, you might get some warnings that look like this:"
6628 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
6629 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
6630 echo "It supports 1..."
6631 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
6632 echo "It also supports 2..."
6633 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
6635 echo "And it supports 4 but not 8 definitely."
6637 echo "It doesn't support 4..."
6638 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
6640 echo "But it supports 8."
6643 echo "Neither does it support 8."
6647 echo "It does not support 2..."
6648 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
6650 echo "But it supports 4 and 8."
6652 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
6654 echo "And it supports 4 but has not heard about 8."
6656 echo "However it supports 8 but not 4."
6661 echo "There is no support at all for void."
6666 case "$voidflags" in
6669 Support flag bits are:
6670 1: basic void declarations.
6671 2: arrays of pointers to functions returning void.
6672 4: operations between pointers to and addresses of void functions.
6673 8: generic void pointers.
6676 rp="Your void support flags add up to what?"
6683 : check for length of pointer
6687 echo "Checking to see how big your pointers are..." >&4
6688 if test "$voidflags" -gt 7; then
6689 echo '#define VOID_PTR char *' > try.c
6691 echo '#define VOID_PTR void *' > try.c
6701 printf("%d\n", (int)sizeof(VOID_PTR));
6706 if eval $compile_ok; then
6707 ptrsize=`$run ./try`
6708 echo "Your pointers are $ptrsize bytes long."
6711 echo "(I can't seem to compile the test program. Guessing...)" >&4
6712 rp="What is the size of a pointer (in bytes)?"
6719 case "$use64bitall" in
6720 "$define"|true|[yY]*)
6724 *** You have chosen a maximally 64-bit build,
6725 *** but your pointers are only 4 bytes wide.
6726 *** Please rerun Configure without -Duse64bitall.
6731 *** Since you have quads, you could possibly try with -Duse64bitint.
6736 *** Cannot continue, aborting.
6747 : determine whether to use malloc wrapping
6749 case "$usemallocwrap" in
6750 [yY]*|true|$define) dflt='y' ;;
6751 [nN]*|false|$undef) dflt='n' ;;
6752 *) case "$usedevel" in
6753 [yY]*|true|$define) dflt='y' ;;
6758 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
6760 usemallocwrap="$ans"
6763 usemallocwrap="$define" ;;
6765 usemallocwrap="$undef" ;;
6768 : determine which malloc to compile in
6770 case "$usemymalloc" in
6771 [yY]*|true|$define) dflt='y' ;;
6772 [nN]*|false|$undef) dflt='n' ;;
6773 *) case "$ptrsize" in
6777 if test "$useithreads" = "$define"; then dflt='n'; fi
6780 rp="Do you wish to attempt to use the malloc that comes with $package?"
6786 mallocsrc='malloc.c'
6787 mallocobj="malloc$_o"
6788 d_mymalloc="$define"
6791 : Remove malloc from list of libraries to use
6792 echo "Removing unneeded -lmalloc from library list" >&4
6793 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
6796 echo "libs = $libs" >&4
6808 : compute the return types of malloc and free
6810 $cat >malloc.c <<END
6814 #include <sys/types.h>
6828 case "$malloctype" in
6830 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
6837 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
6841 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
6848 echo "Your system uses $freetype free(), it would seem." >&4
6850 : determine where site specific architecture-dependent libraries go.
6851 : sitelib default is /usr/local/lib/perl5/site_perl/$version
6852 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6853 : sitelib may have an optional trailing /share.
6855 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
6856 dflt="$dflt/$archname"
6861 set sitearch sitearch none
6865 The installation process will also create a directory for
6866 architecture-dependent site-specific extensions and modules.
6870 rp='Pathname for the site-specific architecture-dependent library files?'
6874 if $test X"$sitearch" = X"$sitelib"; then
6877 d_sitearch="$define"
6880 : Set the vendorprefix variables
6883 The installation process will also create a directory for
6884 vendor-supplied add-ons. Vendors who supply perl with their system
6885 may find it convenient to place all vendor-supplied files in this
6886 directory rather than in the main distribution directory. This will
6887 ease upgrades between binary-compatible maintenance versions of perl.
6889 Of course you may also use these directories in whatever way you see
6890 fit. For example, you might use them to access modules shared over a
6891 company-wide network.
6893 The default answer should be fine for most people.
6894 This causes further questions about vendor add-ons to be skipped
6895 and no vendor-specific directories will be configured for perl.
6898 rp='Do you want to configure vendor-specific add-on directories?'
6899 case "$usevendorprefix" in
6900 define|true|[yY]*) dflt=y ;;
6901 *) : User may have set vendorprefix directly on Configure command line.
6902 case "$vendorprefix" in
6911 rp='Installation prefix to use for vendor-supplied add-ons?'
6912 case "$vendorprefix" in
6914 *) dflt=$vendorprefix ;;
6917 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6919 case "$vendorprefix" in
6923 *) oldvendorprefix="$prefix";;
6927 usevendorprefix="$define"
6929 vendorprefixexp="$ansexp"
6931 *) usevendorprefix="$undef"
6937 : Set the vendorlib variables
6938 case "$vendorprefix" in
6939 '') d_vendorlib="$undef"
6943 *) d_vendorlib="$define"
6944 : determine where vendor-supplied modules go.
6945 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
6946 case "$vendorlib" in
6948 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6949 case "$installstyle" in
6950 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
6951 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
6954 *) dflt="$vendorlib"
6958 rp='Pathname for the vendor-supplied library files?'
6961 vendorlibexp="$ansexp"
6964 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
6968 : Set the vendorarch variables
6969 case "$vendorprefix" in
6970 '') d_vendorarch="$undef"
6974 *) d_vendorarch="$define"
6975 : determine where vendor-supplied architecture-dependent libraries go.
6976 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
6977 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
6978 : vendorlib may have an optional trailing /share.
6979 case "$vendorarch" in
6980 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
6981 dflt="$dflt/$archname"
6983 *) dflt="$vendorarch" ;;
6986 rp='Pathname for vendor-supplied architecture-dependent files?'
6989 vendorarchexp="$ansexp"
6992 prefixvar=vendorarch
6994 if $test X"$vendorarch" = X"$vendorlib"; then
6995 d_vendorarch="$undef"
6997 d_vendorarch="$define"
7000 : Final catch-all directories to search
7003 Lastly, you can have perl look in other directories for extensions and
7004 modules in addition to those already specified.
7005 These directories will be searched after
7009 test X"$vendorlib" != "X" && echo ' ' $vendorlib
7010 test X"$vendorarch" != "X" && echo ' ' $vendorarch
7012 case "$otherlibdirs" in
7013 ''|' ') dflt='none' ;;
7014 *) dflt="$otherlibdirs" ;;
7017 Enter a colon-separated set of extra paths to include in perl's @INC
7018 search path, or enter 'none' for no extra paths.
7022 rp='Colon-separated list of additional directories for perl to search?'
7025 ' '|''|none) otherlibdirs=' ' ;;
7026 *) otherlibdirs="$ans" ;;
7028 case "$otherlibdirs" in
7032 set d_perl_otherlibdirs
7035 : Cruising for prototypes
7037 echo "Checking out function prototypes..." >&4
7038 $cat >prototype.c <<EOCP
7043 int main(int argc, char *argv[]) {
7046 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
7047 echo "Your C compiler appears to support function prototypes."
7050 echo "Your C compiler doesn't seem to understand function prototypes."
7057 : Check if ansi2knr is required
7058 case "$prototype" in
7060 *) ansi2knr='ansi2knr'
7065 This version of $package can only be compiled by a compiler that
7066 understands function prototypes. Unfortunately, your C compiler
7068 doesn't seem to understand them. Sorry about that.
7070 If GNU cc is available for your system, perhaps you could try that instead.
7072 Eventually, we hope to support building Perl with pre-ANSI compilers.
7073 If you would like to help in that effort, please contact <perlbug@perl.org>.
7075 Aborting Configure now.
7082 dflt_dtrace='/usr/sbin/dtrace'
7083 $test -x /usr/bin/dtrace && dflt_dtrace='/usr/bin/dtrace'
7087 Perl can be built to support DTrace on platforms that support it.
7088 DTrace is a diagnosis and performance analysis tool from Sun.
7090 If this doesn't make any sense to you, just accept the default '$dflt'.
7094 case "$usedtrace" in
7100 dflt_dtrace=$usedtrace
7107 rp='Support DTrace if available?'
7110 y|Y) val="$define" ;;
7116 test "X$usedtrace" != "X$define" && break
7119 rp='Where is the dtrace executable?'
7128 if $dtrace -h -s ../perldtrace.d \
7129 -o perldtrace.tmp >/dev/null 2>&1 \
7130 && rm -f perldtrace.tmp
7133 echo "Good: your $dtrace knows about the -h flag."
7137 *** $me: Fatal Error: $dtrace doesn't support -h flag
7139 *** Your installed dtrace doesn't support the -h switch to compile a D
7140 *** program into a C header. Can't continue.
7152 *** $me: Fatal Error: $dtrace not found.
7159 echo "*** $dtrace was not found."
7165 : See if we want extra modules installed
7172 Perl can be built with extra modules or bundles of modules which
7173 will be fetched from the CPAN and installed alongside Perl.
7175 Notice that you will need access to the CPAN; either via the Internet,
7176 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
7177 be asked later to configure the CPAN.pm module which will in turn do
7178 the installation of the rest of the extra modules or bundles.)
7180 Notice also that if the modules require any external software such as
7181 libraries and headers (the libz library and the zlib.h header for the
7182 Compress::Zlib module, for example) you MUST have any such software
7183 already installed, this configuration process will NOT install such
7186 If this doesn't make any sense to you, just accept the default '$dflt'.
7188 rp='Install any extra modules (y or n)?'
7194 Please list any extra modules or bundles to be installed from CPAN,
7195 with spaces between the names. The names can be in any format the
7196 'install' command of CPAN.pm will understand. (Answer 'none',
7197 without the quotes, to install no extra modules or bundles.)
7207 $rm -f ../extras.lst
7209 *) echo "(Saving the list of extras for later...)"
7210 echo "$extras" > ../extras.lst
7218 : determine where html pages for programs go
7219 set html1dir html1dir none
7223 If you wish to install html files for programs in $spackage, indicate
7224 the appropriate directory here. To skip installing html files,
7228 ''|none|$undef|' ') dflt=none ;;
7229 *) dflt=$html1dir ;;
7232 rp="Directory for the main $spackage html pages?"
7236 : Use ' ' for none so value is preserved next time through Configure
7237 $test X"$html1dir" = "X" && html1dir=' '
7239 : determine where html pages for libraries and modules go
7240 set html3dir html3dir none
7244 If you wish to install html files for modules associated with $spackage,
7245 indicate the appropriate directory here. To skip installing html files,
7248 : There is no obvious default. If they have specified html1dir, then
7249 : try to key off that, possibly changing .../html1 into .../html3.
7251 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
7252 *) dflt=$html3dir ;;
7255 rp="Directory for the $spackage module html pages?"
7259 : Use ' ' for none so value is preserved next time through Configure
7260 $test X"$html3dir" = "X" && html3dir=' '
7262 : determine whether to install perl also as /usr/bin/perl
7265 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
7267 Many scripts expect perl to be installed as /usr/bin/perl.
7269 If you want to, I can install the perl you are about to compile
7270 as /usr/bin/perl (in addition to $bin/perl).
7272 if test -f /usr/bin/perl; then
7275 However, please note that because you already have a /usr/bin/perl,
7276 overwriting that with a new Perl would very probably cause problems.
7277 Therefore I'm assuming you don't want to do that (unless you insist).
7280 case "$installusrbinperl" in
7281 "$define"|[yY]*) dflt='y';;
7287 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
7290 case "$installusrbinperl" in
7291 "$undef"|[nN]*) dflt='n';;
7295 rp="Do you want to install perl as /usr/bin/perl?"
7298 [yY]*) val="$define";;
7304 set installusrbinperl
7307 : Check if we are using the GNU C library
7309 echo "Checking for GNU C Library..." >&4
7311 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
7312 alone are insufficient to distinguish different versions, such as
7313 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
7314 libc version 2.1.0. A. Dougherty, June 3, 2002.
7320 # ifdef __GLIBC_MINOR__
7321 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus)
7322 # include <gnu/libc-version.h>
7323 printf("%s\n", gnu_get_libc_version());
7325 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
7328 printf("%d\n", __GLIBC__);
7337 if eval $compile_ok && $run ./try > glibc.ver; then
7339 gnulibc_version=`$cat glibc.ver`
7340 echo "You are using the GNU C Library version $gnulibc_version"
7344 echo "You are not using the GNU C Library"
7350 : see if nm is to be used to determine whether a symbol is defined or not
7354 case "$d_gnulibc" in
7357 echo "nm probably won't work on the GNU C Library." >&4
7363 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
7365 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
7366 echo "'nm' won't be sufficient on this sytem." >&4
7372 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
7373 if $test $dflt -gt 20; then
7383 true|$define) dflt=y;;
7390 I can use $nm to extract the symbols from your C libraries. This
7391 is a time consuming task which may generate huge output on the disk (up
7392 to 3 megabytes) but that should make the symbols extraction faster. The
7393 alternative is to skip the 'nm' extraction part and to compile a small
7394 test program instead to determine whether each symbol is present. If
7395 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
7396 this may be the best solution.
7398 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
7401 rp="Shall I use $nm to extract C symbols from the libraries?"
7404 [Nn]*) usenm=false;;
7413 : nm options which may be necessary
7415 '') if $test -f /mach_boot; then
7417 elif $test -d /usr/ccs/lib; then
7418 nm_opt='-p' # Solaris (and SunOS?)
7419 elif $test -f /dgux; then
7421 elif $test -f /lib64/rld; then
7422 nm_opt='-p' # 64-bit Irix
7428 : nm options which may be necessary for shared libraries but illegal
7429 : for archive libraries. Thank you, Linux.
7430 case "$nm_so_opt" in
7431 '') case "$myuname" in
7433 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
7434 nm_so_opt='--dynamic'
7441 : Figure out where the libc is located
7444 : get list of predefined functions in a handy place
7449 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
7455 *) for thislib in $libs; do
7458 : Handle C library specially below.
7461 thislib=`echo $thislib | $sed -e 's/^-l//'`
7462 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
7464 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
7466 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
7468 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
7470 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
7472 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
7474 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
7479 libnames="$libnames $try"
7481 *) libnames="$libnames $thislib" ;;
7490 for xxx in $libpth; do
7491 $test -r $1 || set $xxx/libc.$so
7492 : The messy sed command sorts on library version numbers.
7494 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
7495 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
7497 s/[0-9][0-9]*/0000&/g
7498 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
7501 $sort | $sed -e 's/^.* //'`
7504 $test -r $1 || set /usr/ccs/lib/libc.$so
7505 $test -r $1 || set /lib/libsys_s$_a
7511 if $test -r "$1"; then
7512 echo "Your (shared) C library seems to be in $1."
7514 elif $test -r /lib/libc && $test -r /lib/clib; then
7515 echo "Your C library seems to be in both /lib/clib and /lib/libc."
7517 libc='/lib/clib /lib/libc'
7518 if $test -r /lib/syslib; then
7519 echo "(Your math library is in /lib/syslib.)"
7520 libc="$libc /lib/syslib"
7522 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7523 echo "Your C library seems to be in $libc, as you said before."
7524 elif $test -r $incpath/usr/lib/libc$_a; then
7525 libc=$incpath/usr/lib/libc$_a;
7526 echo "Your C library seems to be in $libc. That's fine."
7527 elif $test -r /lib/libc$_a; then
7529 echo "Your C library seems to be in $libc. You're normal."
7531 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
7533 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
7534 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
7535 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
7537 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7539 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7542 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
7544 if $test -r "$tans"; then
7545 echo "Your C library seems to be in $tans, of all places."
7551 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7555 If the guess above is wrong (which it might be if you're using a strange
7556 compiler, or your machine supports multiple models), you can override it here.
7561 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
7563 I can't seem to find your C library. I've looked in the following places:
7566 $sed 's/^/ /' libpath
7569 None of these seems to contain your C library. I need to get its name...
7574 rp='Where is your C library?'
7579 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
7580 set X `cat libnames`
7583 case $# in 1) xxx=file; esac
7584 echo "Extracting names from the following $xxx for later perusal:" >&4
7586 $sed 's/^/ /' libnames >&4
7588 $echo $n "This may take a while...$c" >&4
7592 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
7593 *) $nm $nm_opt $file 2>/dev/null;;
7598 $grep fprintf libc.tmp > libc.ptf
7599 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
7600 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
7602 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
7604 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7606 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
7608 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7610 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
7612 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7614 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
7616 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7618 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
7620 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7622 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
7624 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7626 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
7627 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
7629 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7631 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
7633 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7635 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
7637 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7639 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
7641 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7643 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
7645 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7647 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
7649 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7651 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
7653 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7655 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
7657 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7660 $nm -p $* 2>/dev/null >libc.tmp
7661 $grep fprintf libc.tmp > libc.ptf
7662 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
7663 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
7669 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
7671 if $ar t $libc > libc.tmp && \
7672 $contains '^fprintf$' libc.tmp >/dev/null 2>&1
7674 for thisname in $libnames $libc; do
7675 $ar t $thisname >>libc.tmp
7677 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
7679 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
7680 for thisname in $libnames $libc; do
7681 $ar tv $thisname >>libc.tmp
7682 emximp -o tmp.imp $thisname \
7684 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
7685 < tmp.imp >>libc.tmp
7688 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
7691 echo "$ar didn't seem to work right." >&4
7692 echo "Maybe this is a Cray...trying bld instead..." >&4
7694 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list &&
7697 for thisname in $libnames; do
7699 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
7700 $ar t $thisname >>libc.tmp
7704 echo "That didn't work either. Giving up." >&4
7714 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
7715 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
7717 *) if $test -f /lib/syscalls.exp; then
7719 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
7720 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' \
7721 /lib/syscalls.exp >>libc.list
7727 $rm -f libnames libpath
7729 : see if dld is available
7733 : Check if we are using C++
7735 echo "Checking for C++..." >&4
7736 $cat >try.c <<'EOCP'
7748 if eval $compile_ok && $run ./try; then
7750 echo "You are using a C++ compiler."
7753 echo "You are not using a C++ compiler."
7759 : is a C symbol defined?
7762 -v) tf=libc.tmp; tdc="";;
7763 -a) tf=libc.tmp; tdc="[]";;
7764 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
7766 case "$d_cplusplus" in
7767 $define) extern_C="extern \"C\"" ;;
7768 *) extern_C="extern" ;;
7771 case "$reuseval-$4" in
7773 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
7778 if $test "$runnm" = true; then
7779 if $contains $tlook $tf >/dev/null 2>&1; then
7781 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
7782 echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7783 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
7784 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
7788 echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7789 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
7795 $define) tval=true;;
7802 : define an is-in-libc? function
7803 inlibc='echo " "; td=$define; tu=$undef;
7804 sym=$1; var=$2; eval "was=\$$2";
7806 case "$reuseval$was" in
7816 echo "$sym() found." >&4;
7817 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
7819 echo "$sym() NOT found." >&4;
7820 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
7824 $define) echo "$sym() found." >&4;;
7825 *) echo "$sym() NOT found." >&4;;
7829 : see if dlopen exists
7831 xxx_ccflags="$ccflags"
7833 : with g++ one needs -shared to get is-in-libc to work for dlopen
7834 case "$gccversion" in
7836 *) case "$d_cplusplus" in
7837 "$define") ccflags="$ccflags -shared" ;;
7844 ccflags="$xxx_ccflags"
7846 : see if this is a unistd.h system
7847 set unistd.h i_unistd
7850 : determine which dynamic loading, if any, to compile in
7852 dldir="ext/DynaLoader"
7865 $define) dflt='y' ;;
7868 $define) dflt='y' ;;
7870 : Does a dl_xxx.xs file exist for this operating system
7871 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
7874 rp="Do you wish to use dynamic loading?"
7882 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
7883 dflt="$dldir/dl_${osname}.xs"
7884 elif $test "$d_dlopen" = "$define" ; then
7885 dflt="$dldir/dl_dlopen.xs"
7886 elif $test "$i_dld" = "$define" ; then
7887 dflt="$dldir/dl_dld.xs"
7892 *) dflt="$dldir/$dlsrc"
7895 echo "The following dynamic loading files are available:"
7896 : Can not go over to $dldir because getfile has path hard-coded in.
7897 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
7898 rp="Source file to use for dynamic loading"
7904 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
7908 Some systems may require passing special flags to $cc -c to
7909 compile modules that will be used to create a shared library.
7910 To use no flags, say "none".
7913 case "$cccdlflags" in
7914 '') case "$gccversion" in
7915 '') case "$osname" in
7917 next) dflt='none' ;;
7918 irix*) dflt='-KPIC' ;;
7919 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
7920 sunos) dflt='-pic' ;;
7924 *) case "$osname" in
7925 darwin) dflt='none' ;;
7926 linux*|svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
7931 *) dflt="$cccdlflags" ;;
7933 rp="Any special flags to pass to $cc -c to compile shared library modules?"
7936 none) cccdlflags=' ' ;;
7937 *) cccdlflags="$ans" ;;
7942 Some systems use ld to create libraries that can be dynamically loaded,
7943 while other systems (such as those using ELF) use $cc.
7947 '') $cat >try.c <<EOM
7948 /* Test for whether ELF binaries are produced */
7960 int i = open("a.out",O_RDONLY);
7963 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
7964 exit(0); /* succeed (yes, it's ELF) */
7969 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
7971 You appear to have ELF support. I'll use $cc to build dynamic libraries.
7976 echo "I'll use ld to build dynamic libraries."
7985 rp="What command should be used to create dynamic libraries?"
7991 Some systems may require passing special flags to $ld to create a
7992 library that can be dynamically loaded. If your ld flags include
7993 -L/other/path options to locate libraries outside your loader's normal
7994 search path, you may need to specify those -L options here as well. To
7995 use no flags, say "none".
7998 case "$lddlflags" in
7999 '') case "$osname" in
8000 beos) dflt='-nostart' ;;
8001 haiku) dflt='-shared' ;;
8003 case "$gccversion" in
8004 '') dflt="$dflt +vnocompatwarnings" ;;
8007 linux|irix*|gnu*) dflt="-shared $optimize" ;;
8008 next) dflt='none' ;;
8009 solaris) dflt='-G' ;;
8010 sunos) dflt='-assert nodefinitions' ;;
8011 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
8015 *) dflt="$lddlflags" ;;
8018 : Try to guess additional flags to pick up local libraries.
8019 : Be careful not to append to a plain 'none'
8023 for thisflag in $ldflags; do
8028 *) dflt="$dflt $thisflag" ;;
8035 ''|' ') dflt='none' ;;
8039 *-fstack-protector*)
8041 *-fstack-protector*) ;; # Don't add it again
8042 *) dflt="$dflt -fstack-protector" ;;
8048 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
8051 none) lddlflags=' ' ;;
8052 *) lddlflags="$ans" ;;
8057 Some systems may require passing special flags to $cc to indicate that
8058 the resulting executable will use dynamic linking. To use no flags,
8062 case "$ccdlflags" in
8063 '') case "$osname" in
8064 linux|hpux|gnu*) dflt='-Wl,-E' ;;
8065 next|sunos) dflt='none' ;;
8069 *) dflt="$ccdlflags" ;;
8071 rp="Any special flags to pass to $cc to use dynamic linking?"
8074 none) ccdlflags=' ' ;;
8075 *) ccdlflags="$ans" ;;
8086 : Do we want a shared libperl?
8090 # No dynamic loading being used, so don't bother even to prompt.
8093 *) case "$useshrplib" in
8094 '') case "$osname" in
8095 svr4*|nonstopux|dgux|dynixptx|esix|powerux|beos|haiku|cygwin*)
8097 also='Building a shared libperl is required for dynamic loading to work on your system.'
8102 also='Building a shared libperl is needed for MAB support.'
8120 The perl executable is normally obtained by linking perlmain.c with
8121 libperl${_a}, any static extensions (usually just DynaLoader), and
8122 any other libraries needed on this system (such as -lm, etc.). Since
8123 your system supports dynamic loading, it is probably possible to build
8124 a shared libperl.$so. If you will have more than one executable linked
8125 to libperl.$so, this will significantly reduce the size of each
8126 executable, but it may have a noticeable effect on performance. The
8127 default is probably sensible for your system.
8131 rp="Build a shared libperl.$so (y/n)"
8135 useshrplib='true' ;;
8136 *) useshrplib='false' ;;
8141 case "$useshrplib" in
8143 case "$userelocatableinc" in
8145 echo "Cannot build with both -Duserelocatableinc and -Duseshrplib" >&4
8146 echo "See INSTALL for an explanation why that won't work." >&4
8152 # Figure out a good name for libperl.so. Since it gets stored in
8153 # a version-specific architecture-dependent library, the version
8154 # number isn't really that important, except for making cc/ld happy.
8156 # A name such as libperl.so.10.1
8157 majmin="libperl.$so.$patchlevel.$subversion"
8158 # A name such as libperl.so.100
8159 majonly=`echo $patchlevel $subversion |
8160 $awk '{printf "%d%02d", $1, $2}'`
8161 majonly=libperl.$so.$majonly
8162 # I'd prefer to keep the os-specific stuff here to a minimum, and
8163 # rely on figuring it out from the naming of libc.
8164 case "${osname}${osvers}" in
8167 # XXX How handle the --version stuff for MAB?
8169 linux*|gnu*) # ld won't link with a bare -lperl otherwise.
8172 cygwin*) # ld links now against the dll directly
8173 majmin="cygperl5_${patchlevel}_${subversion}.${so}"
8174 majonly=`echo $patchlevel $subversion |
8175 $awk '{printf "%03d%03d", $1, $2}'`
8176 majonly=cygperl5.$majonly.$so
8179 *) # Try to guess based on whether libc has major.minor.
8181 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
8182 *libc.$so.[0-9]*) dflt=$majonly ;;
8183 *) dflt=libperl.$so ;;
8193 I need to select a good name for the shared libperl. If your system uses
8194 library names with major and minor numbers, then you might want something
8195 like $majmin. Alternatively, if your system uses a single version
8196 number for shared libraries, then you might want to use $majonly.
8197 Or, your system might be quite happy with a simple libperl.$so.
8199 Since the shared libperl will get installed into a version-specific
8200 architecture-dependent directory, the version number of the shared perl
8201 library probably isn't important, so the default should be o.k.
8204 rp='What name do you want to give to the shared libperl?'
8207 echo "Ok, I'll use $libperl"
8210 libperl="libperl${_a}"
8214 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
8218 WARNING: Use of the shrpdir variable for the installation location of
8219 the shared $libperl is not supported. It was never documented and
8220 will not work in this version. Let me (perlbug@perl.org)
8221 know of any problems this may cause.
8227 But your current setting of $shrpdir is
8228 the default anyway, so it's harmless.
8233 Further, your current attempted setting of $shrpdir
8234 conflicts with the value of $archlibexp/CORE
8235 that installperl will use.
8242 # How will the perl executable find the installed shared $libperl?
8243 # Add $xxx to ccdlflags.
8244 # If we can't figure out a command-line option, use $shrpenv to
8245 # set env LD_RUN_PATH. The main perl makefile uses this.
8246 shrpdir=$archlibexp/CORE
8249 if "$useshrplib"; then
8252 # We'll set it in Makefile.SH...
8257 freebsd|mirbsd|netbsd|openbsd|interix|dragonfly)
8258 xxx="-Wl,-R$shrpdir"
8260 bsdos|linux|irix*|dec_osf|gnu*)
8261 xxx="-Wl,-rpath,$shrpdir"
8264 # next doesn't like the default...
8267 # beos doesn't like the default, either.
8270 # Haiku doesn't like the default, either.
8273 # hpux doesn't like the default, either.
8274 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
8277 # cygwin needs only ldlibpth
8280 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
8286 # Only add $xxx if it isn't already in ccdlflags.
8287 case " $ccdlflags " in
8289 *) ccdlflags="$ccdlflags $xxx"
8292 Adding $xxx to the flags
8293 passed to $ld so that the perl executable will find the
8294 installed shared $libperl.
8302 # Fix ccdlflags in AIX for building external extensions.
8303 # (For building Perl itself bare -bE:perl.exp is needed,
8304 # Makefile.SH takes care of this.)
8306 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8308 # Respect a hint or command-line value.
8310 '') shrpenv="$tmp_shrpenv" ;;
8312 case "$ldlibpthname" in
8313 '') ldlibpthname=LD_LIBRARY_PATH ;;
8314 none) ldlibpthname='' ;;
8317 : determine where manual pages are on this system
8321 syspath='/usr/share/man/man1 /usr/man/man1'
8322 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8323 syspath="$syspath /usr/man/u_man/man1"
8324 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8325 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8326 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8327 sysman=`./loc . /usr/man/man1 $syspath`
8330 if $test -d "$sysman"; then
8331 echo "System manual is in $sysman." >&4
8333 echo "Could not find manual pages in source form." >&4
8336 : determine where manual pages go
8337 set man1dir man1dir none
8341 $spackage has manual pages available in source form.
8345 echo "However, you don't have nroff, so they're probably useless to you."
8347 '') man1dir="none";;
8350 echo "If you don't want the manual sources installed, answer 'none'."
8355 lookpath="$prefixexp/share/man/man1"
8356 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8357 lookpath="$lookpath $prefixexp/man/p_man/man1"
8358 lookpath="$lookpath $prefixexp/man/u_man/man1"
8359 lookpath="$lookpath $prefixexp/man/man.1"
8361 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8362 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8372 rp="Where do the main $spackage manual pages (source) go?"
8374 if $test "X$man1direxp" != "X$ansexp"; then
8385 : What suffix to use on installed man pages
8392 rp="What suffix should be used for the main $spackage man pages?"
8394 '') case "$man1dir" in
8408 *) dflt="$man1ext";;
8415 : see if we can have long filenames
8417 first=123456789abcdef
8419 if (echo hi >$first) 2>/dev/null; then
8420 if $test -f 123456789abcde; then
8421 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8424 echo 'You can have filenames longer than 14 characters.'>&4
8429 You can't have filenames longer than 14 chars.
8430 You can't even think about them!
8436 $rm -rf 123456789abcde*
8438 : determine where library module manual pages go
8439 set man3dir man3dir none
8443 $spackage has manual pages for many of the library modules.
8449 However, you don't have nroff, so they're probably useless to you.
8452 '') man3dir="none";;
8456 case "$d_flexfnam" in
8459 However, your system can't handle the long file names like File::Basename.3.
8462 '') man3dir="none";;
8466 echo "If you don't want the manual sources installed, answer 'none'."
8467 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8469 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
8470 if $test -d "$privlib/man/man3"; then
8473 WARNING: Previous versions of perl installed man3 pages into
8474 $privlib/man/man3. This version will suggest a
8475 new default of $dflt.
8479 rp='Do you wish to preserve the old behavior?(y/n)'
8482 y*) dflt="$privlib/man/man3" ;;
8487 *) dflt="$man3dir" ;;
8494 rp="Where do the $package library man pages (source) go?"
8504 : What suffix to use on installed man pages
8510 rp="What suffix should be used for the $package library man pages?"
8512 '') case "$man3dir" in
8526 *) dflt="$man3ext";;
8533 : see if we have to deal with yellow pages, now NIS.
8534 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
8535 if $test -f /usr/etc/nibindd; then
8537 echo "I'm fairly confident you're on a NeXT."
8539 rp='Do you get the hosts file via NetInfo?'
8548 y*) hostcat='nidump hosts .';;
8549 *) case "$hostcat" in
8550 nidump*) hostcat='';;
8560 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
8568 rp='Are you getting the hosts file via yellow pages?'
8571 y*) hostcat='ypcat hosts';;
8572 *) hostcat='cat /etc/hosts';;
8578 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
8581 '') test -f /etc/group && groupcat='cat /etc/group';;
8584 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
8587 : now get the host name
8589 echo "Figuring out host name..." >&4
8590 case "$myhostname" in
8592 echo 'Maybe "hostname" will work...'
8593 if tans=`sh -c hostname 2>&1` ; then
8601 if $test "$cont"; then
8603 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
8604 if tans=`cat /etc/systemid 2>&1` ; then
8606 phostname='cat /etc/systemid'
8607 echo "Whadyaknow. Xenix always was a bit strange..."
8610 elif $test -r /etc/systemid; then
8611 echo "(What is a non-Xenix system doing with /etc/systemid?)"
8614 if $test "$cont"; then
8615 echo 'No, maybe "uuname -l" will work...'
8616 if tans=`sh -c 'uuname -l' 2>&1` ; then
8618 phostname='uuname -l'
8620 echo 'Strange. Maybe "uname -n" will work...'
8621 if tans=`sh -c 'uname -n' 2>&1` ; then
8623 phostname='uname -n'
8625 echo 'Oh well, maybe I can mine it out of whoami.h...'
8626 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
8627 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
8628 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
8630 case "$myhostname" in
8631 '') echo "Does this machine have an identity crisis or something?"
8634 echo "Well, you said $myhostname before..."
8635 phostname='echo $myhostname';;
8641 case "$myhostname" in
8642 '') myhostname=noname ;;
8644 : you do not want to know about this
8649 if $test "$myhostname" ; then
8651 rp='Your host name appears to be "'$myhostname'".'" Right?"
8659 : bad guess or no guess
8660 while $test "X$myhostname" = X ; do
8662 rp="Please type the (one word) name of your host:"
8667 : translate upper to lower if necessary
8668 case "$myhostname" in
8670 echo "(Normalizing case in your host name)"
8671 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
8675 case "$myhostname" in
8677 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
8678 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
8679 echo "(Trimming domain name from host name--host name is now $myhostname)"
8681 *) case "$mydomain" in
8684 test "X$hostcat" = "Xypcat hosts" &&
8685 ypmatch "$myhostname" hosts 2>/dev/null |\
8686 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
8689 test "X$hostcat" != "X" &&
8690 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
8691 /[ ]$myhostname[ . ]/p" > hosts
8694 if $test -f hosts; then
8695 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
8696 END { print sum }" hosts` = x1 || tmp_re="[ ]"
8697 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
8698 hosts | $sort | $uniq | \
8699 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
8700 case `$echo X$dflt` in
8701 X*\ *) echo "(Several hosts in the database matched hostname)"
8704 X.) echo "(You do not have fully-qualified names in the hosts database)"
8708 echo "(I cannot locate a hosts database anywhere)"
8713 tans=`./loc resolv.conf X /etc /usr/etc`
8714 if $test -f "$tans"; then
8715 echo "(Attempting domain name extraction from $tans)"
8716 dflt=.`$sed -n -e 's/ / /g' \
8717 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
8720 .) dflt=.`$sed -n -e 's/ / /g' \
8721 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
8729 .) echo "(No help from resolv.conf either -- attempting clever guess)"
8730 dflt=.`sh -c domainname 2>/dev/null`
8733 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
8737 case "$dflt$osname" in
8738 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
8739 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
8743 .) echo "(Lost all hope -- silly guess then)"
8749 *) dflt="$mydomain";;
8753 rp="What is your domain name?"
8763 : translate upper to lower if necessary
8766 echo "(Normalizing case in your domain name)"
8767 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
8771 : a little sanity check here
8772 case "$phostname" in
8775 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
8776 $myhostname$mydomain|$myhostname) ;;
8778 case "$phostname" in
8780 echo "(That doesn't agree with your whoami.h file, by the way.)"
8783 echo "(That doesn't agree with your $phostname command, by the way.)"
8791 : determine the e-mail address of the user who is running us
8794 I need to get your e-mail address in Internet format if possible, i.e.
8795 something like user@host.domain. Please answer accurately since I have
8796 no easy means to double check it. The default value provided below
8797 is most probably close to reality but may not be valid from outside
8798 your organization...
8802 while test "$cont"; do
8804 '') dflt="$cf_by@$myhostname$mydomain";;
8805 *) dflt="$cf_email";;
8807 rp='What is your e-mail address?'
8813 rp='Address does not look like an Internet one. Use it anyway?'
8827 : Ask e-mail of administrator
8830 If you or somebody else will be maintaining perl at your site, please
8831 fill in the correct e-mail address here so that they may be contacted
8832 if necessary. Currently, the "perlbug" program included with perl
8833 will send mail to this address in addition to perlbug@perl.org. You may
8834 enter "none" for no administrator.
8837 case "$perladmin" in
8838 '') dflt="$cf_email";;
8839 *) dflt="$perladmin";;
8841 rp='Perl administrator e-mail address'
8845 : determine whether to only install version-specific parts.
8848 Do you want to install only the version-specific parts of the perl
8849 distribution? Usually you do *not* want to do this.
8851 case "$versiononly" in
8852 "$define"|[Yy]*|true) dflt='y' ;;
8855 rp="Do you want to install only the version-specific parts of perl?"
8858 [yY]*) val="$define";;
8864 case "$versiononly" in
8865 "$define") inc_version_list=''
8866 inc_version_list_init=0
8870 : figure out how to guarantee perl startup
8871 : XXX Note that this currently takes advantage of the bug that binexp ignores
8872 : the Configure -Dinstallprefix setting, which in turn means that under
8873 : relocatable @INC, initialinstalllocation is what binexp started as.
8874 case "$startperl" in
8876 case "$sharpbang" in
8880 I can use the #! construct to start perl on your system. This will
8881 make startup of perl scripts faster, but may cause problems if you
8882 want to share those scripts and perl is not in a standard place
8883 ($initialinstalllocation/perl) on all your platforms. The alternative
8884 is to force a shell by starting the script with a single ':' character.
8887 case "$versiononly" in
8888 "$define") dflt="$initialinstalllocation/perl$version";;
8889 *) dflt="$initialinstalllocation/perl";;
8891 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
8894 none) startperl=": # use perl";;
8895 *) startperl="#!$ans"
8896 if $test 30 -lt `echo "$ans" | wc -c`; then
8899 WARNING: Some systems limit the #! command to 32 characters.
8900 If you experience difficulty running Perl scripts with #!, try
8901 installing Perl in a directory with a shorter pathname.
8907 *) startperl=": # use perl"
8912 echo "I'll use $startperl to start perl scripts."
8914 : figure best path for perl in scripts
8917 case "$versiononly" in
8918 "$define") perlpath="$initialinstalllocation/perl$version";;
8919 *) perlpath="$initialinstalllocation/perl";;
8921 case "$startperl" in
8926 I will use the "eval 'exec'" idiom to start Perl on your system.
8927 I can use the full path of your Perl binary for this purpose, but
8928 doing so may cause problems if you want to share those scripts and
8929 Perl is not always in a standard place ($initialinstalllocation/perl).
8932 dflt="$initialinstalllocation/perl"
8933 rp="What path shall I use in \"eval 'exec'\"?"
8940 case "$startperl" in
8942 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
8945 : determine where public executable scripts go
8946 set scriptdir scriptdir
8948 case "$scriptdir" in
8951 : guess some guesses
8952 $test -d /usr/share/scripts && dflt=/usr/share/scripts
8953 $test -d /usr/share/bin && dflt=/usr/share/bin
8954 $test -d /usr/local/script && dflt=/usr/local/script
8955 $test -d /usr/local/scripts && dflt=/usr/local/scripts
8956 $test -d $prefixexp/script && dflt=$prefixexp/script
8960 *) dflt="$scriptdir"
8965 Some installations have a separate directory just for executable scripts so
8966 that they can mount it across multiple architectures but keep the scripts in
8967 one spot. You might, for example, have a subdirectory of /usr/share for this.
8968 Or you might just lump your scripts in with all your other executables.
8972 rp='Where do you keep publicly executable scripts?'
8974 if $test "X$ansexp" != "X$scriptdirexp"; then
8980 : A little fix up for an irregularly named variable.
8981 installscript="$installscriptdir"
8983 : determine where add-on public executables go
8985 '') dflt=$siteprefix/bin ;;
8989 rp='Pathname where the add-on public executables should be installed?'
8994 : determine where add-on html pages go
8995 : There is no standard location, so try to copy the previously-selected
8996 : directory structure for the core html pages.
8997 case "$sitehtml1dir" in
8998 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
8999 *) dflt=$sitehtml1dir ;;
9002 ''|' ') dflt=none ;;
9005 rp='Pathname where the site-specific html pages should be installed?'
9007 prefixvar=sitehtml1dir
9010 : determine where add-on library html pages go
9011 : There is no standard location, so try to copy the previously-selected
9012 : directory structure for the core html pages.
9013 case "$sitehtml3dir" in
9014 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9015 *) dflt=$sitehtml3dir ;;
9018 ''|' ') dflt=none ;;
9021 rp='Pathname where the site-specific library html pages should be installed?'
9023 prefixvar=sitehtml3dir
9026 : determine where add-on manual pages go
9027 case "$siteman1dir" in
9028 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
9029 *) dflt=$siteman1dir ;;
9032 ''|' ') dflt=none ;;
9035 rp='Pathname where the site-specific manual pages should be installed?'
9037 prefixvar=siteman1dir
9040 : determine where add-on library man pages go
9041 case "$siteman3dir" in
9042 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
9043 *) dflt=$siteman3dir ;;
9046 ''|' ') dflt=none ;;
9049 rp='Pathname where the site-specific library manual pages should be installed?'
9051 prefixvar=siteman3dir
9054 : determine where add-on public executable scripts go
9055 case "$sitescript" in
9056 '') dflt=$siteprefix/script
9057 $test -d $dflt || dflt=$sitebin ;;
9058 *) dflt="$sitescript" ;;
9061 rp='Pathname where add-on public executable scripts should be installed?'
9063 prefixvar=sitescript
9066 : Check if faststdio is requested and available
9067 case "$usefaststdio" in
9068 $define|true|[yY]*|'')
9069 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
9079 Perl can be built to use 'fast stdio', which means using the stdio
9080 library but also directly manipulating the stdio buffers to enable
9081 faster I/O. Using stdio is better for backward compatibility (especially
9082 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
9083 interface has been preferred instead of stdio.
9085 If this doesn't make any sense to you, just accept the default '$dflt'.
9087 rp='Use the "fast stdio" if available?'
9090 y|Y) val="$define" ;;
9097 : define an is-a-typedef? function
9098 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9100 "") inclist="sys/types.h";;
9102 eval "varval=\$$var";
9106 for inc in $inclist; do
9107 echo "#include <$inc>" >>temp.c;
9109 echo "#ifdef $type" >> temp.c;
9110 echo "printf(\"We have $type\");" >> temp.c;
9111 echo "#endif" >> temp.c;
9112 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9113 if $contains $type temp.E >/dev/null 2>&1; then
9119 *) eval "$var=\$varval";;
9122 : define an is-a-typedef? function that prompts if the type is not available.
9123 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9125 "") inclist="sys/types.h";;
9127 eval "varval=\$$var";
9131 for inc in $inclist; do
9132 echo "#include <$inc>" >>temp.c;
9134 echo "#ifdef $type" >> temp.c;
9135 echo "printf(\"We have $type\");" >> temp.c;
9136 echo "#endif" >> temp.c;
9137 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9139 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
9140 if $contains $type temp.E >/dev/null 2>&1; then
9141 echo "$type found." >&4;
9144 echo "$type NOT found." >&4;
9150 *) eval "$var=\$varval";;
9153 : see what type lseek is declared as in the kernel
9154 rp="What is the type used for lseek's offset on this system?"
9155 set off_t lseektype long stdio.h sys/types.h
9159 echo "Checking to see how big your file offsets are..." >&4
9161 #include <sys/types.h>
9165 printf("%d\n", (int)sizeof($lseektype));
9170 if eval $compile_ok; then
9171 lseeksize=`$run ./try`
9172 echo "Your file offsets are $lseeksize bytes long."
9176 echo "(I can't seem to compile the test program. Guessing...)"
9177 rp="What is the size of your file offsets (in bytes)?"
9183 : see what type file positions are declared as in the library
9184 rp="What is the type for file position used by fsetpos()?"
9185 set fpos_t fpostype long stdio.h sys/types.h
9188 : Check size for Fpos_t
9191 *_t) zzz="$fpostype" ;;
9194 echo "Checking the size of $zzz..." >&4
9196 #include <sys/types.h>
9203 printf("%d\n", (int)sizeof($fpostype));
9208 if eval $compile_ok; then
9212 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9215 echo "Your $zzz is $fpossize bytes long."
9221 echo "(I can't compile the test program. Guessing...)" >&4
9222 rp="What is the size of your file positions (in bytes)?"
9227 : Check for large file support
9228 # Backward compatibility (uselfs is deprecated).
9230 "$define"|true|[yY]*)
9233 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
9235 uselargefiles="$define"
9239 case "$lseeksize:$fpossize" in
9242 You can have files larger than 2 gigabytes.
9245 *) case "$uselargefiles" in
9246 "$undef"|false|[nN]*) dflt='n' ;;
9251 Perl can be built to understand large files (files larger than 2 gigabytes)
9252 on some systems. To do so, Configure can be run with -Duselargefiles.
9254 If this doesn't make any sense to you, just accept the default '$dflt'.
9256 rp='Try to understand large files, if available?'
9259 y|Y) val="$define" ;;
9266 : Look for a hint-file generated 'call-back-unit'. If the
9267 : user has specified that a large files perl is to be built,
9268 : we may need to set or change some other defaults.
9269 if $test -f uselargefiles.cbu; then
9270 echo "Your platform has some specific hints regarding large file builds, using them..."
9271 . ./uselargefiles.cbu
9273 case "$uselargefiles" in
9275 if $test -f uselargefiles.cbu; then
9277 echo "Rechecking to see how big your file offsets are..." >&4
9279 #include <sys/types.h>
9283 printf("%d\n", (int)sizeof($lseektype));
9288 if eval $compile_ok; then
9289 lseeksize=`$run ./try`
9290 $echo "Your file offsets are now $lseeksize bytes long."
9294 echo "(I can't seem to compile the test program. Guessing...)"
9295 rp="What is the size of your file offsets (in bytes)?"
9300 *_t) zzz="$fpostype" ;;
9303 $echo $n "Rechecking the size of $zzz...$c" >&4
9305 #include <sys/types.h>
9312 printf("%d\n", (int)sizeof($fpostype));
9317 if eval $compile_ok; then
9322 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9325 echo " $fpossize bytes." >&4
9331 echo "(I can't compile the test program. Guessing...)" >&4
9332 rp="What is the size of your file positions (in bytes)?"
9341 : Check if we want perlio
9344 : Set the vendorbin variables
9345 case "$vendorprefix" in
9346 '') d_vendorbin="$undef"
9350 *) d_vendorbin="$define"
9351 : determine where vendor-supplied executables go.
9352 case "$vendorbin" in
9353 '') dflt=$vendorprefix/bin ;;
9354 *) dflt="$vendorbin" ;;
9357 rp='Pathname for the vendor-supplied executables directory?'
9360 vendorbinexp="$ansexp"
9366 : Set the vendorhtml1dir variables
9367 case "$vendorprefix" in
9368 '') vendorhtml1dir=''
9369 vendorhtml1direxp=''
9371 *) : determine where vendor-supplied html pages go.
9372 : There is no standard location, so try to copy the previously-selected
9373 : directory structure for the core html pages.
9374 : XXX Better default suggestions would be welcome.
9375 case "$vendorhtml1dir" in
9376 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9377 *) dflt=$vendorhtml1dir ;;
9380 ''|' ') dflt=none ;;
9383 rp='Pathname for the vendor-supplied html pages?'
9385 vendorhtml1dir="$ans"
9386 vendorhtml1direxp="$ansexp"
9389 : Use ' ' for none so value is preserved next time through Configure
9390 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9391 prefixvar=vendorhtml1dir
9394 : Set the vendorhtml3dir variables
9395 case "$vendorprefix" in
9396 '') vendorhtml3dir=''
9397 vendorhtml3direxp=''
9399 *) : determine where vendor-supplied module html pages go.
9400 : There is no standard location, so try to copy the previously-selected
9401 : directory structure for the core html pages.
9402 : XXX Better default suggestions would be welcome.
9403 case "$vendorhtml3dir" in
9404 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9405 *) dflt=$vendorhtml3dir ;;
9408 ''|' ') dflt=none ;;
9411 rp='Pathname for the vendor-supplied html pages?'
9413 vendorhtml3dir="$ans"
9414 vendorhtml3direxp="$ansexp"
9417 : Use ' ' for none so value is preserved next time through Configure
9418 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9419 prefixvar=vendorhtml3dir
9422 : Set the vendorman1dir variables
9423 case "$vendorprefix" in
9424 '') vendorman1dir=''
9427 *) : determine where vendor-supplied manual pages go.
9428 case "$vendorman1dir" in
9429 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9430 *) dflt=$vendorman1dir ;;
9433 ''|' ') dflt=none ;;
9436 rp='Pathname for the vendor-supplied manual section 1 pages?'
9438 vendorman1dir="$ans"
9439 vendorman1direxp="$ansexp"
9442 : Use ' ' for none so value is preserved next time through Configure
9443 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
9444 prefixvar=vendorman1dir
9447 : Set the vendorman3dir variables
9448 case "$vendorprefix" in
9449 '') vendorman3dir=''
9452 *) : determine where vendor-supplied module manual pages go.
9453 case "$vendorman3dir" in
9454 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9455 *) dflt=$vendorman3dir ;;
9458 ''|' ') dflt=none ;;
9461 rp='Pathname for the vendor-supplied manual section 3 pages?'
9463 vendorman3dir="$ans"
9464 vendorman3direxp="$ansexp"
9467 : Use ' ' for none so value is preserved next time through Configure
9468 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
9469 prefixvar=vendorman3dir
9472 : Set the vendorscript variables
9473 case "$vendorprefix" in
9474 '') d_vendorscript="$undef"
9478 *) d_vendorscript="$define"
9479 : determine where vendor-supplied scripts go.
9480 case "$vendorscript" in
9481 '') dflt=$vendorprefix/script
9482 $test -d $dflt || dflt=$vendorbin ;;
9483 *) dflt="$vendorscript" ;;
9487 The installation process will create a directory for
9488 vendor-supplied scripts.
9492 rp='Pathname for the vendor-supplied scripts directory?'
9495 vendorscriptexp="$ansexp"
9498 prefixvar=vendorscript
9501 : script used to emit important warnings
9504 if test \$# -gt 0; then
9509 echo "*** WARNING:" >&4
9510 sed -e 's/^/*** /' <msg >&4
9512 cat msg >>config.msg
9513 echo " " >>config.msg
9519 : see which of string.h or strings.h is needed
9521 strings=`./findhdr string.h`
9522 if $test "$strings" && $test -r "$strings"; then
9523 echo "Using <string.h> instead of <strings.h>." >&4
9527 strings=`./findhdr strings.h`
9528 if $test "$strings" && $test -r "$strings"; then
9529 echo "Using <strings.h> instead of <string.h>." >&4
9531 ./warn "No string header found -- You'll surely have problems."
9537 "$undef") strings=`./findhdr strings.h`;;
9538 *) strings=`./findhdr string.h`;;
9541 : see if qgcvt exists
9545 : Check print/scan long double stuff
9548 if $test X"$d_longdbl" = X"$define"; then
9550 echo "Checking how to print long doubles..." >&4
9552 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
9553 $cat >try.c <<'EOCP'
9554 #include <sys/types.h>
9558 printf("%.3f\n", d);
9562 if eval $compile; then
9566 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
9567 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
9568 echo "We will use %f."
9574 if $test X"$sPRIfldbl" = X; then
9575 $cat >try.c <<'EOCP'
9576 #include <sys/types.h>
9579 long double d = 123.456;
9580 printf("%.3Lf\n", d);
9584 if eval $compile; then
9588 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
9589 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
9590 echo "We will use %Lf."
9596 if $test X"$sPRIfldbl" = X; then
9597 $cat >try.c <<'EOCP'
9598 #include <sys/types.h>
9601 long double d = 123.456;
9602 printf("%.3llf\n", d);
9606 if eval $compile; then
9610 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
9611 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
9612 echo "We will use %llf."
9618 if $test X"$sPRIfldbl" = X; then
9619 $cat >try.c <<'EOCP'
9620 #include <sys/types.h>
9623 long double d = 123.456;
9624 printf("%.3lf\n", d);
9628 if eval $compile; then
9632 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
9633 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
9634 echo "We will use %lf."
9640 if $test X"$sPRIfldbl" = X; then
9641 echo "Cannot figure out how to print long doubles." >&4
9643 sSCNfldbl=$sPRIfldbl # expect consistency
9650 case "$sPRIfldbl" in
9651 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
9652 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
9653 d_SCNfldbl="$undef";
9655 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
9656 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
9657 d_SCNfldbl="$define";
9661 : Check how to convert floats to strings.
9663 if test "X$d_Gconvert" = X; then
9666 echo "Checking for an efficient way to convert floats to strings."
9668 case "$uselongdouble" in
9669 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
9671 case "$d_longdbl" in
9672 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
9674 case "$d_PRIgldbl" in
9675 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
9679 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
9680 char *myname = "gconvert";
9683 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
9684 char *myname = "gcvt";
9687 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
9688 char *myname = "qgcvt";
9689 #define DOUBLETYPE long double
9692 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9694 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
9696 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
9699 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
9701 char *myname = "sprintf";
9705 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9706 #define DOUBLETYPE long double
9708 #define DOUBLETYPE double
9720 # include <string.h>
9722 # include <strings.h>
9725 int checkit(char *expect, char *got)
9727 if (strcmp(expect, got)) {
9728 printf("%s oddity: Expected %s, got %s\n",
9729 myname, expect, got);
9739 /* This must be 1st test on (which?) platform */
9740 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
9741 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
9742 checkit("0.1", buf);
9744 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
9745 checkit("0.01", buf);
9747 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
9748 checkit("0.001", buf);
9750 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
9751 checkit("0.0001", buf);
9753 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
9754 if (strlen(buf) > 5)
9755 checkit("9e-005", buf); /* for Microsoft ?? */
9757 checkit("9e-05", buf);
9759 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
9762 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
9763 checkit("1.1", buf);
9765 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
9766 checkit("1.01", buf);
9768 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
9769 checkit("1.001", buf);
9771 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
9772 checkit("1.0001", buf);
9774 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
9775 checkit("1.00001", buf);
9777 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
9778 checkit("1.000001", buf);
9780 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
9783 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
9786 /* Some Linux gcvt's give 1.e+5 here. */
9787 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
9788 checkit("100000", buf);
9790 /* Some Linux gcvt's give -1.e+5 here. */
9791 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
9792 checkit("-100000", buf);
9794 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
9795 checkit("123.456", buf);
9797 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
9798 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
9799 /* 34 should be enough to scare even long double
9800 * places into using the e notation. */
9801 if (strlen(buf) > 5)
9802 checkit("1e+034", buf); /* for Microsoft */
9804 checkit("1e+34", buf);
9806 /* For Perl, if you add additional tests here, also add them to
9807 * t/base/num.t for benefit of platforms not using Configure or
9808 * overriding d_Gconvert */
9813 : first add preferred functions to our list
9815 for xxx_convert in $gconvert_preference; do
9816 case $xxx_convert in
9817 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
9818 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
9821 : then add any others
9822 for xxx_convert in gconvert gcvt sprintf; do
9825 *) xxx_list="$xxx_list $xxx_convert" ;;
9829 case "$d_longdbl$uselongdouble" in
9831 : again, add preferred functions to our list first
9833 for xxx_convert in $gconvert_ld_preference; do
9834 case $xxx_convert in
9835 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9836 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
9839 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
9840 for xxx_convert in qgcvt sprintf $xxx_list; do
9841 case "$xxx_ld_list" in
9842 $xxx_convert*|*" $xxx_convert"*) ;;
9843 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9846 : if sprintf cannot do long doubles, move it to the end
9847 if test "$d_PRIgldbl" != "$define"; then
9848 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
9850 : if no qgcvt, remove it
9851 if test "$d_qgcvt" != "$define"; then
9852 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
9855 xxx_list="$xxx_ld_list"
9859 for xxx_convert in $xxx_list; do
9860 echo "Trying $xxx_convert..."
9861 $rm -f try try$_o core
9862 set try -DTRY_$xxx_convert
9863 if eval $compile; then
9864 echo "$xxx_convert() found." >&4
9866 echo "I'll use $xxx_convert to convert floats into a string." >&4
9869 echo "...But $xxx_convert didn't work as I expected."
9873 echo "$xxx_convert NOT found." >&4
9877 if test X$xxx_convert = X; then
9878 echo "*** WHOA THERE!!! ***" >&4
9879 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
9883 case "$xxx_convert" in
9884 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
9885 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
9886 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
9887 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
9888 "$define$define$define")
9889 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
9890 "$define$define$undef")
9891 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
9892 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
9900 : see if _fwalk exists
9904 : Initialize h_fcntl
9907 : Initialize h_sysfile
9910 : access call always available on UNIX
9914 : locate the flags for 'access()'
9918 $cat >access.c <<EOCP
9919 #include <sys/types.h>
9924 #include <sys/file.h>
9937 : check sys/file.h first, no particular reason here
9938 if $test `./findhdr sys/file.h` && \
9939 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
9941 echo "<sys/file.h> defines the *_OK access constants." >&4
9942 elif $test `./findhdr fcntl.h` && \
9943 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
9945 echo "<fcntl.h> defines the *_OK access constants." >&4
9946 elif $test `./findhdr unistd.h` && \
9947 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
9948 echo "<unistd.h> defines the *_OK access constants." >&4
9950 echo "I can't find the four *_OK access constants--I'll use mine." >&4
9956 : see if accessx exists
9957 set accessx d_accessx
9960 : see if aintl exists
9964 : see if alarm exists
9968 : see if 64bit time functions exists
9970 set ctime64 d_ctime64
9973 set localtime64 d_localtime64
9976 set gmtime64 d_gmtime64
9979 set mktime64 d_mktime64
9982 set difftime64 d_difftime64
9985 set asctime64 d_asctime64
9988 : see if POSIX threads are available
9989 set pthread.h i_pthread
9992 : define a function to check prototypes
9993 $cat > protochk <<EOSH
9996 optimize="$optimize"
9998 prototype="$prototype"
10001 usethreads=$usethreads
10002 i_pthread=$i_pthread
10003 pthread_h_first=$pthread_h_first
10006 $cat >> protochk <<'EOSH'
10011 while test $# -ge 2; do
10013 $define) echo "#include <$2>" >> try.c ;;
10014 literal) echo "$2" >> try.c ;;
10016 # Extra magic for the benefit of systems that need pthread.h
10017 # to be included early to correctly detect threadsafe functions.
10018 # Such functions must guarantee themselves, though, that the usethreads
10019 # and i_pthread have been defined, before calling protochk.
10020 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
10021 echo "#include <pthread.h>" >> try.c
10026 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
10027 cat >> try.c <<'EOCP'
10028 #ifdef CAN_PROTOTYPE
10029 #define _(args) args
10034 echo "$foo" >> try.c
10035 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
10036 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
10042 $eunicefix protochk
10044 : Define hasproto macro for Configure internal use
10045 hasproto='varname=$1; func=$2; shift; shift;
10046 while $test $# -ge 2; do
10048 $define) echo "#include <$2>";;
10052 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
10053 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
10054 echo "$func() prototype found.";
10057 echo "$func() prototype NOT found.";
10064 : see if sys/types.h has to be included
10065 set sys/types.h i_systypes
10068 : see if sys/select.h has to be included
10069 set sys/select.h i_sysselct
10072 : Define hasfield macro for Configure internal use
10073 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
10074 while $test $# -ge 2; do
10076 $define) echo "#include <$2>";;
10080 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
10082 if eval $compile; then
10091 : see if we should include time.h, sys/time.h, or both
10093 if test "X$timeincl" = X; then
10094 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
10095 $echo $n "I'm now running the test program...$c"
10097 #include <sys/types.h>
10102 #ifdef SYSTIMEKERNEL
10105 #include <sys/time.h>
10108 #include <sys/select.h>
10110 #$i_stdlib I_STDLIB
10112 #include <stdlib.h>
10118 struct timeval bar;
10121 struct timezone tzp;
10123 if (foo.tm_sec == foo.tm_sec)
10126 if (bar.tv_sec == bar.tv_sec)
10133 for s_timezone in '-DS_TIMEZONE' ''; do
10135 for s_timeval in '-DS_TIMEVAL' ''; do
10136 for i_systimek in '' '-DSYSTIMEKERNEL'; do
10137 for i_time in '' '-DI_TIME'; do
10138 for i_systime in '-DI_SYSTIME' ''; do
10141 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
10142 if eval $compile; then
10143 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
10147 $echo $n "Succeeded with $flags$c"
10159 *SYSTIMEKERNEL*) i_systimek="$define"
10160 timeincl=`./findhdr sys/time.h`
10161 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
10162 *) i_systimek="$undef";;
10165 *I_TIME*) i_time="$define"
10166 timeincl=`./findhdr time.h`" $timeincl"
10167 echo "We'll include <time.h>." >&4;;
10168 *) i_time="$undef";;
10171 *I_SYSTIME*) i_systime="$define"
10172 timeincl=`./findhdr sys/time.h`" $timeincl"
10173 echo "We'll include <sys/time.h>." >&4;;
10174 *) i_systime="$undef";;
10178 : see if struct tm knows about tm_zone
10179 case "$i_systime$i_time" in
10182 echo "Checking to see if your struct tm has tm_zone field..." >&4
10183 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
10191 case "$d_tm_tm_zone" in
10192 "$define") echo "Yes, it does." ;;
10193 *) echo "No, it doesn't." ;;
10195 : see if struct tm knows about tm_gmtoff
10196 case "$i_systime$i_time" in
10199 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
10200 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
10208 case "$d_tm_tm_gmtoff" in
10209 "$define") echo "Yes, it does." ;;
10210 *) echo "No, it doesn't." ;;
10213 : see if asctime_r exists
10214 set asctime_r d_asctime_r
10216 case "$d_asctime_r" in
10218 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10219 case "$d_asctime_r_proto:$usethreads" in
10220 ":define") d_asctime_r_proto=define
10221 set d_asctime_r_proto asctime_r $hdrs
10225 case "$d_asctime_r_proto" in
10227 case "$asctime_r_proto" in
10228 ''|0) try='char* asctime_r(const struct tm*, char*);'
10229 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SB ;;
10231 case "$asctime_r_proto" in
10232 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
10233 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SBI ;;
10235 case "$asctime_r_proto" in
10236 ''|0) try='int asctime_r(const struct tm*, char*);'
10237 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SB ;;
10239 case "$asctime_r_proto" in
10240 ''|0) try='int asctime_r(const struct tm*, char*, int);'
10241 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SBI ;;
10243 case "$asctime_r_proto" in
10244 ''|0) d_asctime_r=undef
10246 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
10247 * ) case "$asctime_r_proto" in
10248 REENTRANT_PROTO*) ;;
10249 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
10251 echo "Prototype: $try" ;;
10254 *) case "$usethreads" in
10255 define) echo "asctime_r has no prototype, not using it." >&4 ;;
10262 *) asctime_r_proto=0
10266 : see if atolf exists
10270 : see if atoll exists
10274 : Look for GCC-style attribute format
10275 case "$d_attribute_format" in
10278 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
10279 $cat >attrib.c <<'EOCP'
10281 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
10283 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10284 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10285 echo "Your C compiler doesn't support __attribute__((format))."
10288 echo "Your C compiler supports __attribute__((format))."
10292 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10296 *) val="$d_attribute_format" ;;
10298 set d_attribute_format
10302 : Look for GCC-style attribute format with null format allowed
10303 case "$d_printf_format_null" in
10304 '') case "$d_attribute_format" in
10307 echo "Checking whether your compiler allows __printf__ format to be null ..." >&4
10308 $cat >attrib.c <<EOCP
10310 #$i_stdlib I_STDLIB
10312 #include <stdlib.h>
10314 int null_printf (char* pat,...) __attribute__((__format__(__printf__,1,2)));
10315 int null_printf (char* pat,...) { return (int)pat; }
10316 int main () { exit(null_printf(NULL)); }
10318 if $cc $ccflags -o attrib attrib.c >attrib.out 2>&1 ; then
10319 : run the executable in case it produces a run-time warning
10320 if $run ./attrib >>attrib.out 2>&1; then
10321 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10322 echo "Your C compiler doesn't allow __printf__ format to be null."
10325 echo "Your C compiler allows __printf__ format to be null."
10329 echo "Your C compiler executable failed with __printf__ format null."
10333 echo "Your C compiler fails with __printf__ format null."
10340 *) val="$d_printf_format_null" ;;
10342 set d_printf_format_null
10346 : Look for GCC-style attribute malloc
10347 case "$d_attribute_malloc" in
10350 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
10351 $cat >attrib.c <<'EOCP'
10353 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
10355 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10356 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10357 echo "Your C compiler doesn't support __attribute__((malloc))."
10360 echo "Your C compiler supports __attribute__((malloc))."
10364 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10368 *) val="$d_attribute_malloc" ;;
10370 set d_attribute_malloc
10374 : Look for GCC-style attribute nonnull
10375 case "$d_attribute_nonnull" in
10378 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
10379 $cat >attrib.c <<'EOCP'
10381 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
10383 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10384 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10385 echo "Your C compiler doesn't support __attribute__((nonnull))."
10388 echo "Your C compiler supports __attribute__((nonnull))."
10392 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10396 *) val="$d_attribute_nonnull" ;;
10398 set d_attribute_nonnull
10402 : Look for GCC-style attribute noreturn
10403 case "$d_attribute_noreturn" in
10406 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
10407 $cat >attrib.c <<'EOCP'
10409 void fall_over_dead( void ) __attribute__((noreturn));
10411 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10412 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10413 echo "Your C compiler doesn't support __attribute__((noreturn))."
10416 echo "Your C compiler supports __attribute__((noreturn))."
10420 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10424 *) val="$d_attribute_noreturn" ;;
10426 set d_attribute_noreturn
10430 : Look for GCC-style attribute pure
10431 case "$d_attribute_pure" in
10434 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
10435 $cat >attrib.c <<'EOCP'
10437 int square( int n ) __attribute__((pure));
10439 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10440 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10441 echo "Your C compiler doesn't support __attribute__((pure))."
10444 echo "Your C compiler supports __attribute__((pure))."
10448 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10452 *) val="$d_attribute_pure" ;;
10454 set d_attribute_pure
10458 : Look for GCC-style attribute unused
10459 case "$d_attribute_unused" in
10462 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
10463 $cat >attrib.c <<'EOCP'
10465 int do_something( int dummy __attribute__((unused)), int n );
10467 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10468 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10469 echo "Your C compiler doesn't support __attribute__((unused))."
10472 echo "Your C compiler supports __attribute__((unused))."
10476 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10480 *) val="$d_attribute_unused" ;;
10482 set d_attribute_unused
10486 : Look for GCC-style attribute deprecated
10487 case "$d_attribute_deprecated" in
10490 echo "Checking whether your compiler can handle __attribute__((deprecated)) ..." >&4
10491 $cat >attrib.c <<'EOCP'
10493 int I_am_deprecated(void) __attribute__((deprecated));
10495 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10496 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10497 echo "Your C compiler doesn't support __attribute__((deprecated))."
10500 echo "Your C compiler supports __attribute__((deprecated))."
10504 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10508 *) val="$d_attribute_deprecated" ;;
10510 set d_attribute_deprecated
10514 : Look for GCC-style attribute warn_unused_result
10515 case "$d_attribute_warn_unused_result" in
10518 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
10519 $cat >attrib.c <<'EOCP'
10521 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
10523 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10524 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10525 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
10528 echo "Your C compiler supports __attribute__((warn_unused_result))."
10532 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10536 *) val="$d_attribute_warn_unused_result" ;;
10538 set d_attribute_warn_unused_result
10542 : see if bcmp exists
10546 : see if bcopy exists
10550 : see if getpgrp exists
10551 set getpgrp d_getpgrp
10554 case "$d_getpgrp" in
10557 echo "Checking to see which flavor of getpgrp is in use..."
10559 #$i_unistd I_UNISTD
10560 #include <sys/types.h>
10562 # include <unistd.h>
10564 #$i_stdlib I_STDLIB
10566 #include <stdlib.h>
10570 if (getuid() == 0) {
10571 printf("(I see you are running Configure as super-user...)\n");
10574 #ifdef TRY_BSD_PGRP
10575 if (getpgrp(1) == 0)
10584 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10585 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
10587 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10588 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
10591 echo "I can't seem to compile and run the test program."
10593 xxx="a USG one, i.e. you use getpgrp()."
10595 # SVR4 systems can appear rather BSD-ish.
10596 case "$i_unistd" in
10598 xxx="a BSD one, i.e. you use getpgrp(pid)."
10602 xxx="probably a USG one, i.e. you use getpgrp()."
10607 echo "Assuming your getpgrp is $xxx" >&4
10616 : see if setpgrp exists
10617 set setpgrp d_setpgrp
10620 case "$d_setpgrp" in
10623 echo "Checking to see which flavor of setpgrp is in use..."
10625 #$i_unistd I_UNISTD
10626 #include <sys/types.h>
10628 # include <unistd.h>
10630 #$i_stdlib I_STDLIB
10632 #include <stdlib.h>
10636 if (getuid() == 0) {
10637 printf("(I see you are running Configure as super-user...)\n");
10640 #ifdef TRY_BSD_PGRP
10641 if (-1 == setpgrp(1, 1))
10644 if (setpgrp() != -1)
10650 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10651 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
10653 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10654 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
10657 echo "(I can't seem to compile and run the test program.)"
10659 xxx="a USG one, i.e. you use setpgrp()."
10661 # SVR4 systems can appear rather BSD-ish.
10662 case "$i_unistd" in
10664 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
10668 xxx="probably a USG one, i.e. you use setpgrp()."
10673 echo "Assuming your setpgrp is $xxx" >&4
10682 : Look for GCC-style __builtin_choose_expr
10683 case "$d_builtin_choose_expr" in
10686 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
10687 $cat >try.c <<'EOCP'
10688 #include <assert.h>
10689 #include <stdlib.h>
10692 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
10695 assert( SYRINX(1) == 2112 );
10696 assert( SYRINX(1) != 5150 );
10697 assert( SYRINX(0) == 5150 );
10698 assert( SYRINX(0) != 2112 );
10699 puts( "All good!" );
10705 if eval $compile && $run ./try; then
10706 echo "Your C compiler supports __builtin_choose_expr."
10709 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
10713 *) val="$d_builtin_choose_expr" ;;
10716 set d_builtin_choose_expr
10720 : Look for GCC-style __builtin_expect
10721 case "$d_builtin_expect" in
10724 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
10725 $cat >try.c <<'EOCP'
10728 if ( __builtin_expect(n, 0) ) n = 1;
10729 /* Remember shell exit code truth is 0, C truth is non-zero */
10734 if eval $compile && $run ./try; then
10735 echo "Your C compiler supports __builtin_expect."
10738 echo "Your C compiler doesn't seem to understand __builtin_expect."
10742 *) val="$d_builtin_expect" ;;
10745 set d_builtin_expect
10749 : see if bzero exists
10753 : see if stdarg is available
10755 if $test `./findhdr stdarg.h`; then
10756 echo "<stdarg.h> found." >&4
10759 echo "<stdarg.h> NOT found." >&4
10763 : see if varags is available
10765 if $test `./findhdr varargs.h`; then
10766 echo "<varargs.h> found." >&4
10768 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
10771 : set up the varargs testing programs
10772 $cat > varargs.c <<EOP
10774 #include <stdarg.h>
10777 #include <varargs.h>
10781 int f(char *p, ...)
10795 p = va_arg(ap, char *);
10801 $cat > varargs <<EOP
10803 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
10812 : now check which varargs header should be included
10817 if `./varargs I_STDARG`; then
10819 elif `./varargs I_VARARGS`; then
10824 if `./varargs I_VARARGS`; then
10831 echo "I could not find the definition for va_dcl... You have problems..." >&4
10832 val="$undef"; set i_stdarg; eval $setvar
10833 val="$undef"; set i_varargs; eval $setvar
10838 case "$i_varhdr" in
10840 val="$define"; set i_stdarg; eval $setvar
10841 val="$undef"; set i_varargs; eval $setvar
10844 val="$undef"; set i_stdarg; eval $setvar
10845 val="$define"; set i_varargs; eval $setvar
10848 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
10852 : see if the Compiler supports C99 variadic macros
10853 case "$i_stdarg$i_stdlib" in
10855 echo "You have <stdarg.h> and <stdlib.h>, so checking for C99 variadic macros." >&4
10858 #include <stdarg.h>
10860 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
10864 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
10870 if eval $compile && $run ./try 2>&1 >/dev/null; then
10871 case "`$run ./try`" in
10873 echo "You have C99 variadic macros." >&4
10874 d_c99_variadic_macros="$define"
10877 echo "You don't have functional C99 variadic macros." >&4
10878 d_c99_variadic_macros="$undef"
10882 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
10883 d_c99_variadic_macros="$undef"
10888 echo "You don't have <stdarg.h> and <stdlib.h>, so not checking for C99 variadic macros." >&4
10889 d_c99_variadic_macros="$undef"
10893 : see if signal is declared as pointer to function returning int or void
10895 xxx=`./findhdr signal.h`
10896 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
10897 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10898 echo "You have int (*signal())() instead of void." >&4
10900 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10901 echo "You have void (*signal())()." >&4
10903 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
10904 echo "You have int (*signal())() instead of void." >&4
10906 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
10907 echo "You have void (*signal())()." >&4
10910 case "$d_voidsig" in
10912 echo "I can't determine whether signal handler returns void or int..." >&4
10914 rp="What type does your signal handler return?"
10917 v*) val="$define";;
10921 echo "As you already told me, signal handler returns void." >&4
10924 *) echo "As you already told me, signal handler returns int." >&4
10931 case "$d_voidsig" in
10932 "$define") signal_t="void";;
10933 *) signal_t="int";;
10937 : check for ability to cast large floats to 32-bit ints.
10939 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
10940 if $test "$intsize" -ge 4; then
10947 #$i_stdlib I_STDLIB
10949 #include <stdlib.h>
10951 #include <sys/types.h>
10952 #include <signal.h>
10953 $signal_t blech(int s) { exit(3); }
10960 signal(SIGFPE, blech);
10962 /* Don't let compiler optimize the test away. Store the number
10963 in a writable string for gcc to pass to sscanf under HP-UX.
10965 sprintf(str, "2147483647");
10966 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
10970 /* x86 processors will probably give 0x8000 0000, which is a
10971 sign change. We don't want that. We want to mimic SPARC
10972 behavior here, which is to preserve the sign and give
10975 if (i32 != ($xxx) f)
10981 if eval $compile_ok; then
10985 echo "(I can't seem to compile the test program--assuming it can't)"
10990 echo "Yup, it can."
10993 echo "Nope, it can't."
11000 : check for ability to cast negative floats to unsigned
11002 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
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(7); }
11012 $signal_t blech_in_list(int s) { exit(4); }
11013 unsigned long dummy_long(unsigned long p) { return p; }
11014 unsigned int dummy_int(unsigned int p) { return p; }
11015 unsigned short dummy_short(unsigned short p) { return p; }
11019 unsigned long along;
11021 unsigned short ashort;
11025 /* Frustrate gcc-2.7.2's optimizer which failed this test with
11026 a direct f = -123. assignment. gcc-2.8.0 reportedly
11027 optimized the whole file away
11029 /* Store the number in a writable string for gcc to pass to
11030 sscanf under HP-UX.
11032 sprintf(str, "-123");
11033 sscanf(str, "%lf", &f); /* f = -123.; */
11035 signal(SIGFPE, blech);
11036 along = (unsigned long)f;
11037 aint = (unsigned int)f;
11038 ashort = (unsigned short)f;
11039 if (along != (unsigned long)-123)
11041 if (aint != (unsigned int)-123)
11043 if (ashort != (unsigned short)-123)
11045 sprintf(str, "1073741824.");
11046 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
11049 along = (unsigned long)f;
11050 if (along != 0x80000000)
11054 along = (unsigned long)f;
11055 if (along != 0x7fffffff)
11059 along = (unsigned long)f;
11060 if (along != 0x80000001)
11064 signal(SIGFPE, blech_in_list);
11065 sprintf(str, "123.");
11066 sscanf(str, "%lf", &f); /* f = 123.; */
11067 along = dummy_long((unsigned long)f);
11068 aint = dummy_int((unsigned int)f);
11069 ashort = dummy_short((unsigned short)f);
11070 if (along != (unsigned long)123)
11072 if (aint != (unsigned int)123)
11074 if (ashort != (unsigned short)123)
11081 if eval $compile_ok; then
11085 echo "(I can't seem to compile the test program--assuming it can't)"
11088 case "$castflags" in
11090 echo "Yup, it can."
11093 echo "Nope, it can't."
11100 : see if vprintf exists
11102 if set vprintf val -f d_vprintf; eval $csym; $val; then
11103 echo 'vprintf() found.' >&4
11106 #$i_stdarg I_STDARG /* Only one of these can be defined by i_varhrd */
11107 #$i_varargs I_VARARGS
11109 #$i_stdlib I_STDLIB
11110 #$i_unistd I_UNISTD
11113 # include <stdarg.h>
11114 #else /* I_VARARGS */
11115 # include <varargs.h>
11119 # include <unistd.h>
11123 # include <stdlib.h>
11126 #include <stdio.h> /* vsprintf prototype */
11129 void xxx(int n, ...)
11134 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11136 int main() { xxx(1, "foo"); }
11138 #else /* I_VARARGS */
11146 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11148 int main() { xxx("foo"); }
11154 if eval $compile_ok; then
11155 if $run ./try; then
11156 echo "Your vsprintf() returns (int)." >&4
11159 echo "Your vsprintf() returns (char*)." >&4
11163 echo 'I am unable to compile the vsprintf() test program.' >&4
11164 # We shouldn't get here. If we do, assume the standard signature,
11165 # not the old BSD one.
11166 echo 'Guessing that vsprintf() returns (int).' >&4
11170 echo 'vprintf() NOT found.' >&4
11181 : see if chown exists
11185 : see if chroot exists
11186 set chroot d_chroot
11189 : see if chsize exists
11190 set chsize d_chsize
11193 : see if class exists
11197 : see if clearenv exists
11198 set clearenv d_clearenv
11201 : Define hasstruct macro for Configure internal use
11202 hasstruct='varname=$1; struct=$2; shift; shift;
11203 while $test $# -ge 2; do
11205 $define) echo "#include <$2>";;
11209 echo "int main () { struct $struct foo; }" >> try.c;
11211 if eval $compile; then
11220 : see whether socket exists
11224 $echo $n "Hmm... $c" >&4
11225 if set socket val -f d_socket; eval $csym; $val; then
11226 echo "Looks like you have Berkeley networking support." >&4
11228 if set setsockopt val -f; eval $csym; $val; then
11231 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
11232 d_oldsock="$define"
11235 if $contains socklib libc.list >/dev/null 2>&1; then
11236 echo "Looks like you have Berkeley networking support." >&4
11238 : we will have to assume that it supports the 4.2 BSD interface
11241 echo "You don't have Berkeley networking in libc$_a..." >&4
11242 if test "X$d_socket" = "X$define"; then
11243 echo "...but you seem to believe that you have sockets." >&4
11245 for net in net socket
11247 if test -f /usr/lib/lib$net$_a; then
11248 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
11249 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
11250 if $contains socket libc.list >/dev/null 2>&1; then
11255 echo "...but the Wollongong group seems to have hacked it in." >&4
11256 sockethdr="-I/usr/netinclude"
11259 echo "Found Berkeley sockets interface in lib$net." >&4
11260 if $contains setsockopt libc.list >/dev/null 2>&1; then
11263 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
11264 d_oldsock="$define"
11270 if test "X$d_socket" != "X$define"; then
11271 echo "or anywhere else I see." >&4
11279 : see if socketpair exists
11280 set socketpair d_sockpair
11285 echo "Checking the availability sa_len in the sock struct ..." >&4
11287 #include <sys/types.h>
11288 #include <sys/socket.h>
11290 struct sockaddr sa;
11291 return (sa.sa_len);
11295 set try; if eval $compile; then
11298 set d_sockaddr_sa_len; eval $setvar
11302 echo "Checking the availability sin6_scope_id in struct sockaddr_in6 ..." >&4
11304 #include <sys/types.h>
11305 #include <sys/socket.h>
11306 #include <netinet/in.h>
11308 struct sockaddr_in6 sin6;
11309 return (sin6.sin6_scope_id);
11313 set try; if eval $compile; then
11316 set d_sin6_scope_id; eval $setvar
11320 echo "Checking the availability of certain socket constants..." >&4
11321 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
11322 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
11324 #include <sys/types.h>
11325 #include <sys/socket.h>
11331 set try; if eval $compile; then
11334 set d_${enum}; eval $setvar
11338 : see if this is a sys/uio.h system
11339 set sys/uio.h i_sysuio
11342 : Check for cmsghdr support
11344 echo "Checking to see if your system supports struct cmsghdr..." >&4
11345 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
11347 case "$d_cmsghdr_s" in
11348 "$define") echo "Yes, it does." ;;
11349 *) echo "No, it doesn't." ;;
11353 : check for const keyword
11355 echo 'Checking to see if your C compiler knows about "const"...' >&4
11356 $cat >const.c <<'EOCP'
11357 typedef struct spug { int drokk; } spug;
11361 const spug y = { 0 };
11364 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
11366 echo "Yup, it does."
11369 echo "Nope, it doesn't."
11374 : see if copysignl exists
11375 set copysignl d_copysignl
11378 : see if crypt exists
11383 $define) cryptlib='' ;;
11384 *) if set crypt val -f d_crypt; eval $csym; $val; then
11385 echo 'crypt() found.' >&4
11389 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
11390 if $test -z "$cryptlib"; then
11391 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
11395 if $test -z "$cryptlib"; then
11396 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
11400 if $test -z "$cryptlib"; then
11401 cryptlib=`./loc libcrypt$_a "" $libpth`
11405 if $test -z "$cryptlib"; then
11406 echo 'crypt() NOT found.' >&4
11417 : see if this is a crypt.h system
11418 set crypt.h i_crypt
11421 : see if crypt_r exists
11422 set crypt_r d_crypt_r
11424 case "$d_crypt_r" in
11426 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
11427 case "$d_crypt_r_proto:$usethreads" in
11428 ":define") d_crypt_r_proto=define
11429 set d_crypt_r_proto crypt_r $hdrs
11433 case "$d_crypt_r_proto" in
11435 case "$crypt_r_proto" in
11436 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
11437 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCS ;;
11439 case "$crypt_r_proto" in
11440 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
11441 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCD ;;
11443 case "$crypt_r_proto" in
11444 ''|0) d_crypt_r=undef
11446 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
11447 * ) case "$crypt_r_proto" in
11448 REENTRANT_PROTO*) ;;
11449 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
11451 echo "Prototype: $try" ;;
11454 *) case "$usethreads" in
11455 define) echo "crypt_r has no prototype, not using it." >&4 ;;
11466 : get csh whereabouts
11468 'csh') val="$undef" ;;
11469 *) val="$define" ;;
11473 : Respect a hint or command line value for full_csh.
11474 case "$full_csh" in
11475 '') full_csh=$csh ;;
11478 : see if ctermid exists
11479 set ctermid d_ctermid
11482 : see if ctermid_r exists
11483 set ctermid_r d_ctermid_r
11485 case "$d_ctermid_r" in
11487 hdrs="$i_systypes sys/types.h define stdio.h "
11488 case "$d_ctermid_r_proto:$usethreads" in
11489 ":define") d_ctermid_r_proto=define
11490 set d_ctermid_r_proto ctermid_r $hdrs
11494 case "$d_ctermid_r_proto" in
11496 case "$ctermid_r_proto" in
11497 ''|0) try='char* ctermid_r(char*);'
11498 ./protochk "$extern_C $try" $hdrs && ctermid_r_proto=B_B ;;
11500 case "$ctermid_r_proto" in
11501 ''|0) d_ctermid_r=undef
11503 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
11504 * ) case "$ctermid_r_proto" in
11505 REENTRANT_PROTO*) ;;
11506 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
11508 echo "Prototype: $try" ;;
11511 *) case "$usethreads" in
11512 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
11519 *) ctermid_r_proto=0
11523 : see if ctime_r exists
11524 set ctime_r d_ctime_r
11526 case "$d_ctime_r" in
11528 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
11529 case "$d_ctime_r_proto:$usethreads" in
11530 ":define") d_ctime_r_proto=define
11531 set d_ctime_r_proto ctime_r $hdrs
11535 case "$d_ctime_r_proto" in
11537 case "$ctime_r_proto" in
11538 ''|0) try='char* ctime_r(const time_t*, char*);'
11539 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SB ;;
11541 case "$ctime_r_proto" in
11542 ''|0) try='char* ctime_r(const time_t*, char*, int);'
11543 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SBI ;;
11545 case "$ctime_r_proto" in
11546 ''|0) try='int ctime_r(const time_t*, char*);'
11547 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SB ;;
11549 case "$ctime_r_proto" in
11550 ''|0) try='int ctime_r(const time_t*, char*, int);'
11551 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SBI ;;
11553 case "$ctime_r_proto" in
11554 ''|0) d_ctime_r=undef
11556 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
11557 * ) case "$ctime_r_proto" in
11558 REENTRANT_PROTO*) ;;
11559 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
11561 echo "Prototype: $try" ;;
11564 *) case "$usethreads" in
11565 define) echo "ctime_r has no prototype, not using it." >&4 ;;
11576 : see if cuserid exists
11577 set cuserid d_cuserid
11580 : see if this is a limits.h system
11581 set limits.h i_limits
11584 : see if this is a float.h system
11585 set float.h i_float
11588 : See if number of significant digits in a double precision number is known
11590 $cat >dbl_dig.c <<EOM
11591 #$i_limits I_LIMITS
11594 #include <limits.h>
11600 printf("Contains DBL_DIG");
11603 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
11604 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
11605 echo "DBL_DIG found." >&4
11608 echo "DBL_DIG NOT found." >&4
11615 : see if dbm.h is available
11616 : see if dbmclose exists
11617 set dbmclose d_dbmclose
11620 case "$d_dbmclose" in
11630 *) set rpcsvc/dbm.h i_rpcsvcdbm
11635 *) echo "We won't be including <dbm.h>"
11645 : see if prototype for dbminit is available
11647 set d_dbminitproto dbminit $i_dbm dbm.h
11650 : see if difftime exists
11651 set difftime d_difftime
11654 : see if this is a dirent system
11656 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
11658 echo "<dirent.h> found." >&4
11661 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
11662 echo "<sys/dir.h> found." >&4
11665 xinc=`./findhdr sys/ndir.h`
11667 echo "<dirent.h> NOT found." >&4
11672 : Look for type of directory structure.
11674 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11676 case "$direntrytype" in
11678 case "$i_dirent" in
11679 $define) guess1='struct dirent' ;;
11680 *) guess1='struct direct' ;;
11683 *) guess1="$direntrytype"
11688 'struct dirent') guess2='struct direct' ;;
11689 *) guess2='struct dirent' ;;
11692 if $contains "$guess1" try.c >/dev/null 2>&1; then
11693 direntrytype="$guess1"
11694 echo "Your directory entries are $direntrytype." >&4
11695 elif $contains "$guess2" try.c >/dev/null 2>&1; then
11696 direntrytype="$guess2"
11697 echo "Your directory entries seem to be $direntrytype." >&4
11699 echo "I don't recognize your system's directory entries." >&4
11700 rp="What type is used for directory entries on this system?"
11703 direntrytype="$ans"
11707 : see if the directory entry stores field length
11709 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11710 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
11711 echo "Good, your directory entry keeps length information in d_namlen." >&4
11714 echo "Your directory entry does not know about the d_namlen field." >&4
11721 : Look for DIR.dd_fd
11722 case "$i_dirent" in
11724 echo "Checking to see if DIR has a dd_fd member variable" >&4
11726 #$i_stdlib I_STDLIB
11728 #include <stdlib.h>
11730 #include <dirent.h>
11740 if eval $compile; then
11741 echo "Yes, it does."
11744 echo "No, it does not."
11749 echo "You don't have a <dirent.h>, so not checking for dd_fd." >&4
11757 : see if this is an sysdir system
11758 set sys/dir.h i_sysdir
11761 : see if this is an sysndir system
11762 set sys/ndir.h i_sysndir
11767 $cat >dirfd.c <<EOM
11769 #$i_stdlib I_STDLIB
11771 #include <stdlib.h>
11773 #$i_dirent I_DIRENT /**/
11774 #$i_sysdir I_SYS_DIR /**/
11775 #$i_sysndir I_SYS_NDIR /**/
11776 #$i_systypes I_SYS_TYPES /**/
11777 #if defined(I_SYS_TYPES)
11778 #include <sys/types.h>
11780 #if defined(I_DIRENT)
11781 #include <dirent.h>
11782 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
11783 #include <sys/dir.h>
11787 #include <sys/ndir.h>
11791 #include <ndir.h> /* may be wrong in the future */
11793 #include <sys/dir.h>
11799 DIR *dirp = opendir(".");
11800 if (dirfd(dirp) >= 0)
11808 if eval $compile; then
11812 $define) echo "dirfd() found." >&4 ;;
11813 *) echo "dirfd() NOT found." >&4 ;;
11819 : see if dlerror exists
11822 set dlerror d_dlerror
11826 : see if dlfcn is available
11827 set dlfcn.h i_dlfcn
11830 : Check what extension to use for shared libs
11835 On a few systems, the dynamically loaded modules that perl generates and uses
11836 will need a different extension than shared libs. The default will probably
11842 *) dflt="$dlext" ;;
11844 rp='What is the extension of dynamically loaded modules'
11853 : Check if dlsym need a leading underscore
11859 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
11860 $cat >dyna.c <<'EOM'
11867 #$i_stdlib I_STDLIB
11869 #include <stdlib.h>
11873 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
11875 #include <sys/types.h>
11880 extern int fred() ;
11889 int mode = RTLD_LAZY ;
11891 handle = dlopen("./dyna.$dlext", mode) ;
11892 if (handle == NULL) {
11897 symbol = dlsym(handle, "fred") ;
11898 if (symbol == NULL) {
11899 /* try putting a leading underscore */
11900 symbol = dlsym(handle, "_fred") ;
11901 if (symbol == NULL) {
11914 : Call the object file tmp-dyna.o in case dlext=o.
11915 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
11916 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
11917 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
11918 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
11921 1) echo "Test program failed using dlopen." >&4
11922 echo "Perhaps you should not use dynamic loading." >&4;;
11923 2) echo "Test program failed using dlsym." >&4
11924 echo "Perhaps you should not use dynamic loading." >&4;;
11925 3) echo "dlsym needs a leading underscore" >&4
11927 4) echo "dlsym doesn't need a leading underscore." >&4;;
11930 echo "I can't compile and run the test program." >&4
11931 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
11936 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
11941 : see if drand48_r exists
11942 set drand48_r d_drand48_r
11944 case "$d_drand48_r" in
11946 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
11947 case "$d_drand48_r_proto:$usethreads" in
11948 ":define") d_drand48_r_proto=define
11949 set d_drand48_r_proto drand48_r $hdrs
11953 case "$d_drand48_r_proto" in
11955 case "$drand48_r_proto" in
11956 ''|0) try='int drand48_r(struct drand48_data*, double*);'
11957 ./protochk "$extern_C $try" $hdrs && drand48_r_proto=I_ST ;;
11959 case "$drand48_r_proto" in
11960 ''|0) d_drand48_r=undef
11962 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
11963 * ) case "$drand48_r_proto" in
11964 REENTRANT_PROTO*) ;;
11965 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
11967 echo "Prototype: $try" ;;
11970 *) case "$usethreads" in
11971 define) echo "drand48_r has no prototype, not using it." >&4 ;;
11978 *) drand48_r_proto=0
11982 : see if prototype for drand48 is available
11984 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
11987 : see if dup2 exists
11991 : see if eaccess exists
11992 set eaccess d_eaccess
11995 : see if endgrent exists
11996 set endgrent d_endgrent
11999 : see if this is an grp system
12005 xxx=`./findhdr grp.h`
12006 $cppstdin $cppflags $cppminus < $xxx >$$.h
12008 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
12020 set d_grpasswd; eval $setvar
12024 : see if endgrent_r exists
12025 set endgrent_r d_endgrent_r
12027 case "$d_endgrent_r" in
12029 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12030 case "$d_endgrent_r_proto:$usethreads" in
12031 ":define") d_endgrent_r_proto=define
12032 set d_endgrent_r_proto endgrent_r $hdrs
12036 case "$d_endgrent_r_proto" in
12038 case "$endgrent_r_proto" in
12039 ''|0) try='int endgrent_r(FILE**);'
12040 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=I_H ;;
12042 case "$endgrent_r_proto" in
12043 ''|0) try='void endgrent_r(FILE**);'
12044 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=V_H ;;
12046 case "$endgrent_r_proto" in
12047 ''|0) d_endgrent_r=undef
12049 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
12050 * ) case "$endgrent_r_proto" in
12051 REENTRANT_PROTO*) ;;
12052 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
12054 echo "Prototype: $try" ;;
12057 *) case "$usethreads" in
12058 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
12065 *) endgrent_r_proto=0
12069 : see if endhostent exists
12070 set endhostent d_endhent
12073 : see if this is a netdb.h system
12074 set netdb.h i_netdb
12077 : see if endhostent_r exists
12078 set endhostent_r d_endhostent_r
12080 case "$d_endhostent_r" in
12082 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12083 case "$d_endhostent_r_proto:$usethreads" in
12084 ":define") d_endhostent_r_proto=define
12085 set d_endhostent_r_proto endhostent_r $hdrs
12089 case "$d_endhostent_r_proto" in
12091 case "$endhostent_r_proto" in
12092 ''|0) try='int endhostent_r(struct hostent_data*);'
12093 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=I_D ;;
12095 case "$endhostent_r_proto" in
12096 ''|0) try='void endhostent_r(struct hostent_data*);'
12097 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=V_D ;;
12099 case "$endhostent_r_proto" in
12100 ''|0) d_endhostent_r=undef
12101 endhostent_r_proto=0
12102 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
12103 * ) case "$endhostent_r_proto" in
12104 REENTRANT_PROTO*) ;;
12105 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
12107 echo "Prototype: $try" ;;
12110 *) case "$usethreads" in
12111 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
12113 d_endhostent_r=undef
12114 endhostent_r_proto=0
12118 *) endhostent_r_proto=0
12122 : see if endnetent exists
12123 set endnetent d_endnent
12126 : see if endnetent_r exists
12127 set endnetent_r d_endnetent_r
12129 case "$d_endnetent_r" in
12131 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12132 case "$d_endnetent_r_proto:$usethreads" in
12133 ":define") d_endnetent_r_proto=define
12134 set d_endnetent_r_proto endnetent_r $hdrs
12138 case "$d_endnetent_r_proto" in
12140 case "$endnetent_r_proto" in
12141 ''|0) try='int endnetent_r(struct netent_data*);'
12142 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=I_D ;;
12144 case "$endnetent_r_proto" in
12145 ''|0) try='void endnetent_r(struct netent_data*);'
12146 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=V_D ;;
12148 case "$endnetent_r_proto" in
12149 ''|0) d_endnetent_r=undef
12150 endnetent_r_proto=0
12151 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
12152 * ) case "$endnetent_r_proto" in
12153 REENTRANT_PROTO*) ;;
12154 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
12156 echo "Prototype: $try" ;;
12159 *) case "$usethreads" in
12160 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
12162 d_endnetent_r=undef
12163 endnetent_r_proto=0
12167 *) endnetent_r_proto=0
12171 : see if endprotoent exists
12172 set endprotoent d_endpent
12175 : see if endprotoent_r exists
12176 set endprotoent_r d_endprotoent_r
12178 case "$d_endprotoent_r" in
12180 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12181 case "$d_endprotoent_r_proto:$usethreads" in
12182 ":define") d_endprotoent_r_proto=define
12183 set d_endprotoent_r_proto endprotoent_r $hdrs
12187 case "$d_endprotoent_r_proto" in
12189 case "$endprotoent_r_proto" in
12190 ''|0) try='int endprotoent_r(struct protoent_data*);'
12191 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=I_D ;;
12193 case "$endprotoent_r_proto" in
12194 ''|0) try='void endprotoent_r(struct protoent_data*);'
12195 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=V_D ;;
12197 case "$endprotoent_r_proto" in
12198 ''|0) d_endprotoent_r=undef
12199 endprotoent_r_proto=0
12200 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
12201 * ) case "$endprotoent_r_proto" in
12202 REENTRANT_PROTO*) ;;
12203 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
12205 echo "Prototype: $try" ;;
12208 *) case "$usethreads" in
12209 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
12211 d_endprotoent_r=undef
12212 endprotoent_r_proto=0
12216 *) endprotoent_r_proto=0
12220 : see if endpwent exists
12221 set endpwent d_endpwent
12224 : see if this is a pwd.h system
12230 xxx=`./findhdr pwd.h`
12231 $cppstdin $cppflags $cppminus < $xxx >$$.h
12233 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
12241 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
12249 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
12257 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
12265 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
12273 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
12281 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
12289 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
12301 set d_pwquota; eval $setvar
12302 set d_pwage; eval $setvar
12303 set d_pwchange; eval $setvar
12304 set d_pwclass; eval $setvar
12305 set d_pwexpire; eval $setvar
12306 set d_pwcomment; eval $setvar
12307 set d_pwgecos; eval $setvar
12308 set d_pwpasswd; eval $setvar
12312 : see if endpwent_r exists
12313 set endpwent_r d_endpwent_r
12315 case "$d_endpwent_r" in
12317 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
12318 case "$d_endpwent_r_proto:$usethreads" in
12319 ":define") d_endpwent_r_proto=define
12320 set d_endpwent_r_proto endpwent_r $hdrs
12324 case "$d_endpwent_r_proto" in
12326 case "$endpwent_r_proto" in
12327 ''|0) try='int endpwent_r(FILE**);'
12328 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=I_H ;;
12330 case "$endpwent_r_proto" in
12331 ''|0) try='void endpwent_r(FILE**);'
12332 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=V_H ;;
12334 case "$endpwent_r_proto" in
12335 ''|0) d_endpwent_r=undef
12337 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
12338 * ) case "$endpwent_r_proto" in
12339 REENTRANT_PROTO*) ;;
12340 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
12342 echo "Prototype: $try" ;;
12345 *) case "$usethreads" in
12346 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
12353 *) endpwent_r_proto=0
12357 : see if endservent exists
12358 set endservent d_endsent
12361 : see if endservent_r exists
12362 set endservent_r d_endservent_r
12364 case "$d_endservent_r" in
12366 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12367 case "$d_endservent_r_proto:$usethreads" in
12368 ":define") d_endservent_r_proto=define
12369 set d_endservent_r_proto endservent_r $hdrs
12373 case "$d_endservent_r_proto" in
12375 case "$endservent_r_proto" in
12376 ''|0) try='int endservent_r(struct servent_data*);'
12377 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=I_D ;;
12379 case "$endservent_r_proto" in
12380 ''|0) try='void endservent_r(struct servent_data*);'
12381 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=V_D ;;
12383 case "$endservent_r_proto" in
12384 ''|0) d_endservent_r=undef
12385 endservent_r_proto=0
12386 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
12387 * ) case "$endservent_r_proto" in
12388 REENTRANT_PROTO*) ;;
12389 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
12391 echo "Prototype: $try" ;;
12394 *) case "$usethreads" in
12395 define) echo "endservent_r has no prototype, not using it." >&4 ;;
12397 d_endservent_r=undef
12398 endservent_r_proto=0
12402 *) endservent_r_proto=0
12406 : Locate the flags for 'open()'
12409 #include <sys/types.h>
12414 #include <sys/file.h>
12416 #$i_stdlib I_STDLIB
12418 #include <stdlib.h>
12429 : check sys/file.h first to get FREAD on Sun
12430 if $test `./findhdr sys/file.h` && \
12431 set try -DI_SYS_FILE && eval $compile; then
12433 echo "<sys/file.h> defines the O_* constants..." >&4
12434 if $run ./try; then
12435 echo "and you have the 3 argument form of open()." >&4
12438 echo "but not the 3 argument form of open(). Oh, well." >&4
12441 elif $test `./findhdr fcntl.h` && \
12442 set try -DI_FCNTL && eval $compile; then
12444 echo "<fcntl.h> defines the O_* constants..." >&4
12445 if $run ./try; then
12446 echo "and you have the 3 argument form of open()." >&4
12449 echo "but not the 3 argument form of open(). Oh, well." >&4
12454 echo "I can't find the O_* constant definitions! You got problems." >&4
12460 : see if this is a sys/file.h system
12465 : do we need to include sys/file.h ?
12469 if $h_sysfile; then
12471 echo "We'll be including <sys/file.h>." >&4
12474 echo "We won't be including <sys/file.h>." >&4
12484 : see if fcntl.h is there
12489 : see if we can include fcntl.h
12495 echo "We'll be including <fcntl.h>." >&4
12498 if $h_sysfile; then
12499 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
12501 echo "We won't be including <fcntl.h>." >&4
12513 : see if fork exists
12517 : see if pipe exists
12521 : check for non-blocking I/O stuff
12522 case "$h_sysfile" in
12523 true) echo "#include <sys/file.h>" > head.c;;
12526 true) echo "#include <fcntl.h>" > head.c;;
12527 *) echo "#include <sys/fcntl.h>" > head.c;;
12532 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
12533 case "$o_nonblock" in
12535 $cat head.c > try.c
12536 $cat >>try.c <<EOCP
12538 #$i_stdlib I_STDLIB
12540 #include <stdlib.h>
12548 printf("O_NONBLOCK\n");
12552 printf("O_NDELAY\n");
12556 printf("FNDELAY\n");
12563 if eval $compile_ok; then
12564 o_nonblock=`$run ./try`
12565 case "$o_nonblock" in
12566 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
12567 *) echo "Seems like we can use $o_nonblock.";;
12570 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
12573 *) echo "Using $hint value $o_nonblock.";;
12578 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
12581 case "$d_fork:$d_pipe" in
12583 $cat head.c > try.c
12584 $cat >>try.c <<EOCP
12586 #include <sys/types.h>
12587 #include <signal.h>
12589 #$i_stdlib I_STDLIB
12591 #include <stdlib.h>
12597 #define MY_O_NONBLOCK $o_nonblock
12598 #ifndef errno /* XXX need better Configure test */
12601 #$i_unistd I_UNISTD
12603 #include <unistd.h>
12605 #$i_string I_STRING
12607 #include <string.h>
12609 #include <strings.h>
12611 $signal_t blech(int x) { exit(3); }
12613 $cat >> try.c <<'EOCP'
12621 pipe(pd); /* Down: child -> parent */
12622 pipe(pu); /* Up: parent -> child */
12625 close(pd[1]); /* Parent reads from pd[0] */
12626 close(pu[0]); /* Parent writes (blocking) to pu[1] */
12628 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
12633 signal(SIGALRM, blech);
12635 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
12637 sprintf(string, "%d\n", ret);
12638 write(2, string, strlen(string));
12641 if (errno == EAGAIN) {
12642 printf("EAGAIN\n");
12647 if (errno == EWOULDBLOCK)
12648 printf("EWOULDBLOCK\n");
12651 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
12652 sleep(2); /* Give it time to close our pipe */
12654 ret = read(pd[0], buf, 1); /* Should read EOF */
12656 sprintf(string, "%d\n", ret);
12657 write(4, string, strlen(string));
12661 close(pd[0]); /* We write to pd[1] */
12662 close(pu[1]); /* We read from pu[0] */
12663 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
12664 close(pd[1]); /* Pipe pd is now fully closed! */
12665 exit(0); /* Bye bye, thank you for playing! */
12669 if eval $compile_ok; then
12670 echo "$startsh" >mtry
12671 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
12673 ./mtry >/dev/null 2>&1
12675 0) eagain=`$cat try.out`;;
12676 1) echo "Could not perform non-blocking setting!";;
12677 2) echo "I did a successful read() for something that was not there!";;
12678 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
12679 4) echo "Could not find F_SETFL!";;
12680 *) echo "Something terribly wrong happened during testing.";;
12682 rd_nodata=`$cat try.ret`
12683 echo "A read() system call with no data present returns $rd_nodata."
12684 case "$rd_nodata" in
12687 echo "(That's peculiar, fixing that to be -1.)"
12693 echo "Forcing errno EAGAIN on read() with no data available."
12697 echo "Your read() sets errno to $eagain when no data is available."
12700 status=`$cat try.err`
12702 0) echo "And it correctly returns 0 to signal EOF.";;
12703 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
12704 *) echo "However, your read() returns '$status' on EOF??";;
12707 if test "$status" = "$rd_nodata"; then
12708 echo "WARNING: you can't distinguish between EOF and no data!"
12712 echo "I can't compile the test program--assuming errno EAGAIN will do."
12716 *) echo "Can't figure out how to test this--assuming errno EAGAIN will do."
12725 echo "Using $hint value $eagain."
12726 echo "Your read() returns $rd_nodata when no data is present."
12727 case "$d_eofnblk" in
12728 "$define") echo "And you can see EOF because read() returns 0.";;
12729 "$undef") echo "But you can't see EOF status from read() returned value.";;
12731 echo "(Assuming you can't see EOF status from read anyway.)"
12737 $rm_try head.c mtry
12739 : see if _ptr and _cnt from stdio act std
12742 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
12743 echo "(Looks like you have stdio.h from BSD.)"
12744 case "$stdio_ptr" in
12745 '') stdio_ptr='((fp)->_p)'
12748 *) ptr_lval=$d_stdio_ptr_lval;;
12750 case "$stdio_cnt" in
12751 '') stdio_cnt='((fp)->_r)'
12754 *) cnt_lval=$d_stdio_cnt_lval;;
12756 case "$stdio_base" in
12757 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
12759 case "$stdio_bufsiz" in
12760 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
12762 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
12763 echo "(Looks like you have stdio.h from Linux.)"
12764 case "$stdio_ptr" in
12765 '') stdio_ptr='((fp)->_IO_read_ptr)'
12768 *) ptr_lval=$d_stdio_ptr_lval;;
12770 case "$stdio_cnt" in
12771 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
12774 *) cnt_lval=$d_stdio_cnt_lval;;
12776 case "$stdio_base" in
12777 '') stdio_base='((fp)->_IO_read_base)';;
12779 case "$stdio_bufsiz" in
12780 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
12783 case "$stdio_ptr" in
12784 '') stdio_ptr='((fp)->_ptr)'
12787 *) ptr_lval=$d_stdio_ptr_lval;;
12789 case "$stdio_cnt" in
12790 '') stdio_cnt='((fp)->_cnt)'
12793 *) cnt_lval=$d_stdio_cnt_lval;;
12795 case "$stdio_base" in
12796 '') stdio_base='((fp)->_base)';;
12798 case "$stdio_bufsiz" in
12799 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
12803 : test whether _ptr and _cnt really work
12804 echo "Checking how std your stdio is..." >&4
12807 #$i_stdlib I_STDLIB
12809 #include <stdlib.h>
12811 #define FILE_ptr(fp) $stdio_ptr
12812 #define FILE_cnt(fp) $stdio_cnt
12814 FILE *fp = fopen("try.c", "r");
12817 18 <= FILE_cnt(fp) &&
12818 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12826 if eval $compile && $to try.c; then
12827 if $run ./try; then
12828 echo "Your stdio acts pretty std."
12831 echo "Your stdio isn't very std."
12834 echo "Your stdio doesn't appear very std."
12838 # glibc 2.2.90 and above apparently change stdio streams so Perl's
12839 # direct buffer manipulation no longer works. The Configure tests
12840 # should be changed to correctly detect this, but until then,
12841 # the following check should at least let perl compile and run.
12842 # (This quick fix should be updated before 5.8.1.)
12843 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
12844 # A. Dougherty, June 3, 2002.
12845 case "$d_gnulibc" in
12847 case "$gnulibc_version" in
12851 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
12860 : Can _ptr be used as an lvalue?
12861 case "$d_stdstdio$ptr_lval" in
12862 $define$define) val=$define ;;
12865 set d_stdio_ptr_lval
12868 : Can _cnt be used as an lvalue?
12869 case "$d_stdstdio$cnt_lval" in
12870 $define$define) val=$define ;;
12873 set d_stdio_cnt_lval
12877 : test whether setting _ptr sets _cnt as a side effect
12878 d_stdio_ptr_lval_sets_cnt="$undef"
12879 d_stdio_ptr_lval_nochange_cnt="$undef"
12880 case "$d_stdio_ptr_lval$d_stdstdio" in
12882 echo "Checking to see what happens if we set the stdio ptr..." >&4
12885 /* Can we scream? */
12886 /* Eat dust sed :-) */
12887 /* In the buffer space, no one can hear you scream. */
12888 #$i_stdlib I_STDLIB
12890 #include <stdlib.h>
12892 #define FILE_ptr(fp) $stdio_ptr
12893 #define FILE_cnt(fp) $stdio_cnt
12894 #include <sys/types.h>
12896 FILE *fp = fopen("try.c", "r");
12901 puts("Fail even to read");
12904 c = getc(fp); /* Read away the first # */
12906 puts("Fail even to read");
12910 18 <= FILE_cnt(fp) &&
12911 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12913 puts("Fail even to read");
12916 ptr = (char*) FILE_ptr(fp);
12917 cnt = (size_t)FILE_cnt(fp);
12919 FILE_ptr(fp) += 42;
12921 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
12922 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
12925 if (FILE_cnt(fp) <= 20) {
12926 printf ("Fail (<20 chars to test)");
12929 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
12930 puts("Fail compare");
12933 if (cnt == FILE_cnt(fp)) {
12934 puts("Pass_unchanged");
12937 if (FILE_cnt(fp) == (cnt - 42)) {
12938 puts("Pass_changed");
12941 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
12947 if eval $compile && $to try.c; then
12948 case `$run ./try` in
12950 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
12951 d_stdio_ptr_lval_sets_cnt="$define" ;;
12953 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
12954 d_stdio_ptr_lval_nochange_cnt="$define" ;;
12956 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
12958 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
12961 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
12967 : see if _base is also standard
12969 case "$d_stdstdio" in
12973 #$i_stdlib I_STDLIB
12975 #include <stdlib.h>
12977 #define FILE_base(fp) $stdio_base
12978 #define FILE_bufsiz(fp) $stdio_bufsiz
12980 FILE *fp = fopen("try.c", "r");
12983 19 <= FILE_bufsiz(fp) &&
12984 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
12991 if eval $compile && $to try.c; then
12992 if $run ./try; then
12993 echo "And its _base field acts std."
12996 echo "But its _base field isn't std."
12999 echo "However, it seems to be lacking the _base field."
13007 : see if fast_stdio exists
13009 case "$d_stdstdio:$d_stdio_ptr_lval" in
13011 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
13013 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
13024 : see if fchdir exists
13025 set fchdir d_fchdir
13028 : see if fchmod exists
13029 set fchmod d_fchmod
13032 : see if fchown exists
13033 set fchown d_fchown
13036 : see if this is an fcntl system
13040 : See if fcntl-based locking works.
13043 #$i_stdlib I_STDLIB
13045 #include <stdlib.h>
13047 #include <unistd.h>
13049 #include <signal.h>
13050 $signal_t blech(int x) { exit(3); }
13052 #if defined(F_SETLK) && defined(F_SETLKW)
13053 struct flock flock;
13055 fd = open("try.c", O_RDONLY);
13056 flock.l_type = F_RDLCK;
13057 flock.l_whence = SEEK_SET;
13058 flock.l_start = flock.l_len = 0;
13059 signal(SIGALRM, blech);
13061 retval = fcntl(fd, F_SETLK, &flock);
13063 (retval < 0 ? exit(2) : exit(0));
13069 echo "Checking if fcntl-based file locking works... "
13073 if eval $compile_ok; then
13074 if $run ./try; then
13075 echo "Yes, it seems to work."
13078 echo "Nope, it didn't work."
13083 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
13084 *** This is (almost) impossible.
13085 *** If your NFS lock daemons are not feeling well, something like
13086 *** this may happen, please investigate. Cannot continue, aborting.
13094 echo "I'm unable to compile the test program, so I'll assume not."
13099 echo "Nope, since you don't even have fcntl()."
13102 set d_fcntl_can_lock
13106 : check for fd_set items
13109 Checking to see how well your C compiler handles fd_set and friends ...
13112 #$i_stdlib I_STDLIB
13114 #include <stdlib.h>
13116 #$i_systime I_SYS_TIME
13117 #$i_sysselct I_SYS_SELECT
13118 #$d_socket HAS_SOCKET
13119 #include <sys/types.h>
13121 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
13124 #include <sys/time.h>
13126 #ifdef I_SYS_SELECT
13127 #include <sys/select.h>
13136 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
13144 if eval $compile; then
13145 d_fds_bits="$define"
13147 echo "Well, your system knows about the normal fd_set typedef..." >&4
13148 if $run ./try; then
13149 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
13150 d_fd_macros="$define"
13153 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
13155 d_fd_macros="$undef"
13159 Hmm, your compiler has some difficulty with fd_set. Checking further...
13162 if eval $compile; then
13163 d_fds_bits="$undef"
13165 echo "Well, your system has some sort of fd_set available..." >&4
13166 if $run ./try; then
13167 echo "and you have the normal fd_set macros." >&4
13168 d_fd_macros="$define"
13171 but not the normal fd_set macros! Gross! More work for me...
13173 d_fd_macros="$undef"
13176 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
13178 d_fds_bits="$undef"
13179 d_fd_macros="$undef"
13184 : see if fgetpos exists
13185 set fgetpos d_fgetpos
13188 : see if finite exists
13189 set finite d_finite
13192 : see if finitel exists
13193 set finitel d_finitel
13196 : see if flock exists
13200 : see if prototype for flock is available
13202 set d_flockproto flock $i_sysfile sys/file.h
13205 : see if fp_class exists
13206 set fp_class d_fp_class
13209 : see if pathconf exists
13210 set pathconf d_pathconf
13213 : see if fpathconf exists
13214 set fpathconf d_fpathconf
13217 : see if fpclass exists
13218 set fpclass d_fpclass
13221 : see if fpclassify exists
13222 set fpclassify d_fpclassify
13225 : see if fpclassl exists
13226 set fpclassl d_fpclassl
13229 : check for fpos64_t
13231 echo "Checking to see if you have fpos64_t..." >&4
13234 int main() { fpos64_t x = 7; }
13237 if eval $compile; then
13239 echo "You have fpos64_t."
13242 echo "You do not have fpos64_t."
13243 case "$fpossize" in
13244 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
13251 : see if frexpl exists
13252 set frexpl d_frexpl
13255 : see if this is a sys/param system
13256 set sys/param.h i_sysparam
13259 : see if this is a sys/mount.h system
13260 set sys/mount.h i_sysmount
13263 : Check for fs_data_s
13265 echo "Checking to see if your system supports struct fs_data..." >&4
13266 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
13268 case "$d_fs_data_s" in
13269 "$define") echo "Yes, it does." ;;
13270 *) echo "No, it doesn't." ;;
13273 : see if fseeko exists
13274 set fseeko d_fseeko
13276 case "$longsize" in
13277 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
13280 : see if fsetpos exists
13281 set fsetpos d_fsetpos
13284 : see if fstatfs exists
13285 set fstatfs d_fstatfs
13288 : see if statvfs exists
13289 set statvfs d_statvfs
13292 : see if fstatvfs exists
13293 set fstatvfs d_fstatvfs
13297 : see if fsync exists
13301 : see if ftello exists
13302 set ftello d_ftello
13304 case "$longsize" in
13305 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
13308 : check for a working futimes
13311 echo "Checking if you have a working futimes()" >&4
13314 #include <sys/time.h>
13321 fd = open ("try.c", O_RDWR);
13322 if (-1 == fd) exit (1);
13323 rv = futimes (fd, NULL);
13324 exit (rv == -1 ? errno : 0);
13328 if eval $compile; then
13332 0) echo "Yes, you have" >&4
13333 d_futimes="$define"
13335 *) echo "No, you have futimes, but it isn't working ($rc) (probably harmless)" >&4
13339 echo "No, it does not (probably harmless)" >&4
13343 : see if ndbm.h is available
13346 : Compatibility location for RedHat 7.1
13347 set gdbm/ndbm.h i_gdbmndbm
13349 : Compatibility location for Debian 4.0
13350 set gdbm-ndbm.h i_gdbm_ndbm
13354 if $test "$i_ndbm" = "$define" -o "$i_gdbmndbm" = "$define" -o "$i_gdbm_ndbm" = "$define"; then
13355 : see if dbm_open exists
13356 set dbm_open d_dbm_open
13358 case "$d_dbm_open" in
13361 i_gdbmndbm="$undef"
13362 i_gdbm_ndbm="$undef"
13363 echo "We won't be including <ndbm.h>"
13373 ndbm_hdr_protochk='name=$1; hdr=$2;
13374 eval "ihdr=\$""i_$name";
13376 if $test "$ihdr" = "$define"; then
13377 $echo "Checking if your <$hdr> uses prototypes..." >&4;
13378 case "$d_cplusplus" in
13379 $define) ./protochk "$extern_C void dbm_close(DBM *);" literal "extern \"C\" {" $ihdr $hdr literal "}" && val="$define" ;;
13380 *) ./protochk "$extern_C void dbm_close(int, int);" $ihdr $hdr || val="$define" ;;
13383 $define) $echo "Your <$hdr> seems to have prototypes";;
13384 *) $echo "Your <$hdr> does not seem to have prototypes";;
13387 set "d_${name}_h_uses_prototypes";
13391 eval $ndbm_hdr_protochk
13392 set gdbmndbm gdbm/ndbm.h
13393 eval $ndbm_hdr_protochk
13394 set gdbm_ndbm gdbm-ndbm.h
13395 eval $ndbm_hdr_protochk
13397 : see if getaddrinfo exists
13398 set getaddrinfo d_getaddrinfo
13401 : see if getcwd exists
13402 set getcwd d_getcwd
13405 : see if getespwnam exists
13406 set getespwnam d_getespwnam
13409 : see if getfsstat exists
13410 set getfsstat d_getfsstat
13413 : see if getgrent exists
13414 set getgrent d_getgrent
13417 : see if getgrent_r exists
13418 set getgrent_r d_getgrent_r
13420 case "$d_getgrent_r" in
13422 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13423 case "$d_getgrent_r_proto:$usethreads" in
13424 ":define") d_getgrent_r_proto=define
13425 set d_getgrent_r_proto getgrent_r $hdrs
13429 case "$d_getgrent_r_proto" in
13431 case "$getgrent_r_proto" in
13432 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
13433 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBWR ;;
13435 case "$getgrent_r_proto" in
13436 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
13437 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIR ;;
13439 case "$getgrent_r_proto" in
13440 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
13441 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBW ;;
13443 case "$getgrent_r_proto" in
13444 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
13445 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBI ;;
13447 case "$getgrent_r_proto" in
13448 ''|0) try='int getgrent_r(struct group*, char*, int);'
13449 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBI ;;
13451 case "$getgrent_r_proto" in
13452 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
13453 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIH ;;
13455 case "$getgrent_r_proto" in
13456 ''|0) d_getgrent_r=undef
13458 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
13459 * ) case "$getgrent_r_proto" in
13460 REENTRANT_PROTO*) ;;
13461 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
13463 echo "Prototype: $try" ;;
13466 *) case "$usethreads" in
13467 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
13474 *) getgrent_r_proto=0
13478 : see if getgrgid_r exists
13479 set getgrgid_r d_getgrgid_r
13481 case "$d_getgrgid_r" in
13483 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13484 case "$d_getgrgid_r_proto:$usethreads" in
13485 ":define") d_getgrgid_r_proto=define
13486 set d_getgrgid_r_proto getgrgid_r $hdrs
13490 case "$d_getgrgid_r_proto" in
13492 case "$getgrgid_r_proto" in
13493 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
13494 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
13496 case "$getgrgid_r_proto" in
13497 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
13498 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
13500 case "$getgrgid_r_proto" in
13501 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
13502 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
13504 case "$getgrgid_r_proto" in
13505 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
13506 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
13508 case "$getgrgid_r_proto" in
13509 ''|0) d_getgrgid_r=undef
13511 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
13512 * ) case "$getgrgid_r_proto" in
13513 REENTRANT_PROTO*) ;;
13514 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
13516 echo "Prototype: $try" ;;
13519 *) case "$usethreads" in
13520 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
13527 *) getgrgid_r_proto=0
13531 : see if getgrnam_r exists
13532 set getgrnam_r d_getgrnam_r
13534 case "$d_getgrnam_r" in
13536 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13537 case "$d_getgrnam_r_proto:$usethreads" in
13538 ":define") d_getgrnam_r_proto=define
13539 set d_getgrnam_r_proto getgrnam_r $hdrs
13543 case "$d_getgrnam_r_proto" in
13545 case "$getgrnam_r_proto" in
13546 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
13547 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
13549 case "$getgrnam_r_proto" in
13550 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
13551 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
13553 case "$getgrnam_r_proto" in
13554 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
13555 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CBI ;;
13557 case "$getgrnam_r_proto" in
13558 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
13559 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
13561 case "$getgrnam_r_proto" in
13562 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
13563 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
13565 case "$getgrnam_r_proto" in
13566 ''|0) d_getgrnam_r=undef
13568 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
13569 * ) case "$getgrnam_r_proto" in
13570 REENTRANT_PROTO*) ;;
13571 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
13573 echo "Prototype: $try" ;;
13576 *) case "$usethreads" in
13577 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
13584 *) getgrnam_r_proto=0
13588 : see if gethostbyaddr exists
13589 set gethostbyaddr d_gethbyaddr
13592 : see if gethostbyname exists
13593 set gethostbyname d_gethbyname
13596 : see if gethostent exists
13597 set gethostent d_gethent
13600 : see how we will look up host name
13603 if set gethostname val -f d_gethname; eval $csym; $val; then
13604 echo 'gethostname() found.' >&4
13605 d_gethname="$define"
13608 if set uname val -f d_uname; eval $csym; $val; then
13611 uname() was found, but you're running xenix, and older versions of xenix
13612 have a broken uname(). If you don't really know whether your xenix is old
13613 enough to have a broken system call, use the default answer.
13618 "$define") dflt=n;;
13620 rp='Is your uname() broken?'
13623 n*) d_uname="$define"; call=uname;;
13626 echo 'uname() found.' >&4
13633 case "$d_gethname" in
13634 '') d_gethname="$undef";;
13637 '') d_uname="$undef";;
13639 case "$d_uname$d_gethname" in
13644 Every now and then someone has a $call() that lies about the hostname
13645 but can't be fixed for political or economic reasons. If you wish, I can
13646 pretend $call() isn't there and maybe compute hostname at run-time
13647 thanks to the '$phostname' command.
13650 rp="Shall I ignore $call() from now on?"
13653 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
13656 case "$phostname" in
13657 '') aphostname='';;
13658 *) case "$aphostname" in
13660 *) set X $phostname
13664 file=`./loc $file $file $pth`
13665 aphostname=`echo $file $*`
13670 case "$d_uname$d_gethname" in
13673 case "$phostname" in
13675 echo "There will be no way for $package to get your hostname." >&4;;
13677 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
13681 case "$d_phostname" in
13682 '') d_phostname="$undef";;
13685 : see if gethostbyaddr_r exists
13686 set gethostbyaddr_r d_gethostbyaddr_r
13688 case "$d_gethostbyaddr_r" in
13690 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13691 case "$d_gethostbyaddr_r_proto:$usethreads" in
13692 ":define") d_gethostbyaddr_r_proto=define
13693 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
13697 case "$d_gethostbyaddr_r_proto" in
13699 case "$gethostbyaddr_r_proto" in
13700 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13701 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
13703 case "$gethostbyaddr_r_proto" in
13704 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
13705 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
13707 case "$gethostbyaddr_r_proto" in
13708 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
13709 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
13711 case "$gethostbyaddr_r_proto" in
13712 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
13713 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
13715 case "$gethostbyaddr_r_proto" in
13716 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
13717 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
13719 case "$gethostbyaddr_r_proto" in
13720 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
13721 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
13723 case "$gethostbyaddr_r_proto" in
13724 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
13725 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
13727 case "$gethostbyaddr_r_proto" in
13728 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
13729 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
13731 case "$gethostbyaddr_r_proto" in
13732 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
13733 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
13735 case "$gethostbyaddr_r_proto" in
13736 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
13737 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
13739 case "$gethostbyaddr_r_proto" in
13740 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13741 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
13743 case "$gethostbyaddr_r_proto" in
13744 ''|0) d_gethostbyaddr_r=undef
13745 gethostbyaddr_r_proto=0
13746 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
13747 * ) case "$gethostbyaddr_r_proto" in
13748 REENTRANT_PROTO*) ;;
13749 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
13751 echo "Prototype: $try" ;;
13754 *) case "$usethreads" in
13755 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
13757 d_gethostbyaddr_r=undef
13758 gethostbyaddr_r_proto=0
13762 *) gethostbyaddr_r_proto=0
13766 : see if gethostbyname_r exists
13767 set gethostbyname_r d_gethostbyname_r
13769 case "$d_gethostbyname_r" in
13771 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13772 case "$d_gethostbyname_r_proto:$usethreads" in
13773 ":define") d_gethostbyname_r_proto=define
13774 set d_gethostbyname_r_proto gethostbyname_r $hdrs
13778 case "$d_gethostbyname_r_proto" in
13780 case "$gethostbyname_r_proto" in
13781 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
13782 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
13784 case "$gethostbyname_r_proto" in
13785 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
13786 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
13788 case "$gethostbyname_r_proto" in
13789 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
13790 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
13792 case "$gethostbyname_r_proto" in
13793 ''|0) d_gethostbyname_r=undef
13794 gethostbyname_r_proto=0
13795 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
13796 * ) case "$gethostbyname_r_proto" in
13797 REENTRANT_PROTO*) ;;
13798 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
13800 echo "Prototype: $try" ;;
13803 *) case "$usethreads" in
13804 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
13806 d_gethostbyname_r=undef
13807 gethostbyname_r_proto=0
13811 *) gethostbyname_r_proto=0
13815 : see if gethostent_r exists
13816 set gethostent_r d_gethostent_r
13818 case "$d_gethostent_r" in
13820 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13821 case "$d_gethostent_r_proto:$usethreads" in
13822 ":define") d_gethostent_r_proto=define
13823 set d_gethostent_r_proto gethostent_r $hdrs
13827 case "$d_gethostent_r_proto" in
13829 case "$gethostent_r_proto" in
13830 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
13831 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
13833 case "$gethostent_r_proto" in
13834 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
13835 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBIE ;;
13837 case "$gethostent_r_proto" in
13838 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
13839 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBIE ;;
13841 case "$gethostent_r_proto" in
13842 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
13843 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBI ;;
13845 case "$gethostent_r_proto" in
13846 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
13847 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBI ;;
13849 case "$gethostent_r_proto" in
13850 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
13851 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SD ;;
13853 case "$gethostent_r_proto" in
13854 ''|0) d_gethostent_r=undef
13855 gethostent_r_proto=0
13856 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
13857 * ) case "$gethostent_r_proto" in
13858 REENTRANT_PROTO*) ;;
13859 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
13861 echo "Prototype: $try" ;;
13864 *) case "$usethreads" in
13865 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
13867 d_gethostent_r=undef
13868 gethostent_r_proto=0
13872 *) gethostent_r_proto=0
13876 : see if prototypes for various gethostxxx netdb.h functions are available
13878 set d_gethostprotos gethostent $i_netdb netdb.h
13881 : see if getitimer exists
13882 set getitimer d_getitimer
13885 : see if getlogin exists
13886 set getlogin d_getlogin
13889 : see if getlogin_r exists
13890 set getlogin_r d_getlogin_r
13892 case "$d_getlogin_r" in
13894 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
13895 case "$d_getlogin_r_proto:$usethreads" in
13896 ":define") d_getlogin_r_proto=define
13897 set d_getlogin_r_proto getlogin_r $hdrs
13901 case "$d_getlogin_r_proto" in
13903 case "$getlogin_r_proto" in
13904 ''|0) try='int getlogin_r(char*, size_t);'
13905 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BW ;;
13907 case "$getlogin_r_proto" in
13908 ''|0) try='int getlogin_r(char*, int);'
13909 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BI ;;
13911 case "$getlogin_r_proto" in
13912 ''|0) try='char* getlogin_r(char*, size_t);'
13913 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BW ;;
13915 case "$getlogin_r_proto" in
13916 ''|0) try='char* getlogin_r(char*, int);'
13917 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BI ;;
13919 case "$getlogin_r_proto" in
13920 ''|0) d_getlogin_r=undef
13922 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
13923 * ) case "$getlogin_r_proto" in
13924 REENTRANT_PROTO*) ;;
13925 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
13927 echo "Prototype: $try" ;;
13930 *) case "$usethreads" in
13931 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
13938 *) getlogin_r_proto=0
13942 : see if getmnt exists
13943 set getmnt d_getmnt
13946 : see if getmntent exists
13947 set getmntent d_getmntent
13950 : see if getnameinfo exists
13951 set getnameinfo d_getnameinfo
13954 : see if getnetbyaddr exists
13955 set getnetbyaddr d_getnbyaddr
13958 : see if getnetbyname exists
13959 set getnetbyname d_getnbyname
13962 : see if getnetent exists
13963 set getnetent d_getnent
13966 : see if getnetbyaddr_r exists
13967 set getnetbyaddr_r d_getnetbyaddr_r
13969 case "$d_getnetbyaddr_r" in
13971 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13972 case "$d_getnetbyaddr_r_proto:$usethreads" in
13973 ":define") d_getnetbyaddr_r_proto=define
13974 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
13978 case "$d_getnetbyaddr_r_proto" in
13980 case "$getnetbyaddr_r_proto" in
13981 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
13982 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
13984 case "$getnetbyaddr_r_proto" in
13985 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
13986 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
13988 case "$getnetbyaddr_r_proto" in
13989 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
13990 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
13992 case "$getnetbyaddr_r_proto" in
13993 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
13994 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
13996 case "$getnetbyaddr_r_proto" in
13997 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
13998 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
14000 case "$getnetbyaddr_r_proto" in
14001 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
14002 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
14004 case "$getnetbyaddr_r_proto" in
14005 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
14006 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
14008 case "$getnetbyaddr_r_proto" in
14009 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
14010 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
14012 case "$getnetbyaddr_r_proto" in
14013 ''|0) d_getnetbyaddr_r=undef
14014 getnetbyaddr_r_proto=0
14015 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
14016 * ) case "$getnetbyaddr_r_proto" in
14017 REENTRANT_PROTO*) ;;
14018 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
14020 echo "Prototype: $try" ;;
14023 *) case "$usethreads" in
14024 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
14026 d_getnetbyaddr_r=undef
14027 getnetbyaddr_r_proto=0
14031 *) getnetbyaddr_r_proto=0
14035 : see if getnetbyname_r exists
14036 set getnetbyname_r d_getnetbyname_r
14038 case "$d_getnetbyname_r" in
14040 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14041 case "$d_getnetbyname_r_proto:$usethreads" in
14042 ":define") d_getnetbyname_r_proto=define
14043 set d_getnetbyname_r_proto getnetbyname_r $hdrs
14047 case "$d_getnetbyname_r_proto" in
14049 case "$getnetbyname_r_proto" in
14050 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
14051 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
14053 case "$getnetbyname_r_proto" in
14054 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
14055 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
14057 case "$getnetbyname_r_proto" in
14058 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
14059 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
14061 case "$getnetbyname_r_proto" in
14062 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
14063 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
14065 case "$getnetbyname_r_proto" in
14066 ''|0) d_getnetbyname_r=undef
14067 getnetbyname_r_proto=0
14068 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
14069 * ) case "$getnetbyname_r_proto" in
14070 REENTRANT_PROTO*) ;;
14071 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
14073 echo "Prototype: $try" ;;
14076 *) case "$usethreads" in
14077 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
14079 d_getnetbyname_r=undef
14080 getnetbyname_r_proto=0
14084 *) getnetbyname_r_proto=0
14088 : see if getnetent_r exists
14089 set getnetent_r d_getnetent_r
14091 case "$d_getnetent_r" in
14093 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14094 case "$d_getnetent_r_proto:$usethreads" in
14095 ":define") d_getnetent_r_proto=define
14096 set d_getnetent_r_proto getnetent_r $hdrs
14100 case "$d_getnetent_r_proto" in
14102 case "$getnetent_r_proto" in
14103 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
14104 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
14106 case "$getnetent_r_proto" in
14107 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
14108 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBIE ;;
14110 case "$getnetent_r_proto" in
14111 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
14112 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBIE ;;
14114 case "$getnetent_r_proto" in
14115 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
14116 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBI ;;
14118 case "$getnetent_r_proto" in
14119 ''|0) try='int getnetent_r(struct netent*, char*, int);'
14120 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBI ;;
14122 case "$getnetent_r_proto" in
14123 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
14124 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SD ;;
14126 case "$getnetent_r_proto" in
14127 ''|0) d_getnetent_r=undef
14128 getnetent_r_proto=0
14129 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
14130 * ) case "$getnetent_r_proto" in
14131 REENTRANT_PROTO*) ;;
14132 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
14134 echo "Prototype: $try" ;;
14137 *) case "$usethreads" in
14138 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
14140 d_getnetent_r=undef
14141 getnetent_r_proto=0
14145 *) getnetent_r_proto=0
14149 : see if prototypes for various getnetxxx netdb.h functions are available
14151 set d_getnetprotos getnetent $i_netdb netdb.h
14154 : see if getpagesize exists
14155 set getpagesize d_getpagsz
14158 : Optional checks for getprotobyname and getprotobynumber
14160 : see if getprotobyname exists
14161 set getprotobyname d_getpbyname
14164 : see if getprotobynumber exists
14165 set getprotobynumber d_getpbynumber
14168 : see if getprotoent exists
14169 set getprotoent d_getpent
14172 : see if getpgid exists
14173 set getpgid d_getpgid
14176 : see if getpgrp2 exists
14177 set getpgrp2 d_getpgrp2
14180 : see if getppid exists
14181 set getppid d_getppid
14184 : see if getpriority exists
14185 set getpriority d_getprior
14188 : see if getprotobyname_r exists
14189 set getprotobyname_r d_getprotobyname_r
14191 case "$d_getprotobyname_r" in
14193 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14194 case "$d_getprotobyname_r_proto:$usethreads" in
14195 ":define") d_getprotobyname_r_proto=define
14196 set d_getprotobyname_r_proto getprotobyname_r $hdrs
14200 case "$d_getprotobyname_r_proto" in
14202 case "$getprotobyname_r_proto" in
14203 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
14204 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
14206 case "$getprotobyname_r_proto" in
14207 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
14208 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
14210 case "$getprotobyname_r_proto" in
14211 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
14212 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
14214 case "$getprotobyname_r_proto" in
14215 ''|0) d_getprotobyname_r=undef
14216 getprotobyname_r_proto=0
14217 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
14218 * ) case "$getprotobyname_r_proto" in
14219 REENTRANT_PROTO*) ;;
14220 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
14222 echo "Prototype: $try" ;;
14225 *) case "$usethreads" in
14226 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
14228 d_getprotobyname_r=undef
14229 getprotobyname_r_proto=0
14233 *) getprotobyname_r_proto=0
14237 : see if getprotobynumber_r exists
14238 set getprotobynumber_r d_getprotobynumber_r
14240 case "$d_getprotobynumber_r" in
14242 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14243 case "$d_getprotobynumber_r_proto:$usethreads" in
14244 ":define") d_getprotobynumber_r_proto=define
14245 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
14249 case "$d_getprotobynumber_r_proto" in
14251 case "$getprotobynumber_r_proto" in
14252 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
14253 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
14255 case "$getprotobynumber_r_proto" in
14256 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
14257 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
14259 case "$getprotobynumber_r_proto" in
14260 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
14261 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
14263 case "$getprotobynumber_r_proto" in
14264 ''|0) d_getprotobynumber_r=undef
14265 getprotobynumber_r_proto=0
14266 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
14267 * ) case "$getprotobynumber_r_proto" in
14268 REENTRANT_PROTO*) ;;
14269 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
14271 echo "Prototype: $try" ;;
14274 *) case "$usethreads" in
14275 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
14277 d_getprotobynumber_r=undef
14278 getprotobynumber_r_proto=0
14282 *) getprotobynumber_r_proto=0
14286 : see if getprotoent_r exists
14287 set getprotoent_r d_getprotoent_r
14289 case "$d_getprotoent_r" in
14291 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14292 case "$d_getprotoent_r_proto:$usethreads" in
14293 ":define") d_getprotoent_r_proto=define
14294 set d_getprotoent_r_proto getprotoent_r $hdrs
14298 case "$d_getprotoent_r_proto" in
14300 case "$getprotoent_r_proto" in
14301 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
14302 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
14304 case "$getprotoent_r_proto" in
14305 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
14306 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBI ;;
14308 case "$getprotoent_r_proto" in
14309 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
14310 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=S_SBI ;;
14312 case "$getprotoent_r_proto" in
14313 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
14314 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SD ;;
14316 case "$getprotoent_r_proto" in
14317 ''|0) d_getprotoent_r=undef
14318 getprotoent_r_proto=0
14319 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
14320 * ) case "$getprotoent_r_proto" in
14321 REENTRANT_PROTO*) ;;
14322 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
14324 echo "Prototype: $try" ;;
14327 *) case "$usethreads" in
14328 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
14330 d_getprotoent_r=undef
14331 getprotoent_r_proto=0
14335 *) getprotoent_r_proto=0
14339 : see if prototypes for various getprotoxxx netdb.h functions are available
14341 set d_getprotoprotos getprotoent $i_netdb netdb.h
14344 : see if getprpwnam exists
14345 set getprpwnam d_getprpwnam
14348 : see if getpwent exists
14349 set getpwent d_getpwent
14352 : see if getpwent_r exists
14353 set getpwent_r d_getpwent_r
14355 case "$d_getpwent_r" in
14357 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14358 case "$d_getpwent_r_proto:$usethreads" in
14359 ":define") d_getpwent_r_proto=define
14360 set d_getpwent_r_proto getpwent_r $hdrs
14364 case "$d_getpwent_r_proto" in
14366 case "$getpwent_r_proto" in
14367 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
14368 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBWR ;;
14370 case "$getpwent_r_proto" in
14371 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
14372 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIR ;;
14374 case "$getpwent_r_proto" in
14375 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
14376 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBW ;;
14378 case "$getpwent_r_proto" in
14379 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
14380 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBI ;;
14382 case "$getpwent_r_proto" in
14383 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
14384 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBI ;;
14386 case "$getpwent_r_proto" in
14387 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
14388 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIH ;;
14390 case "$getpwent_r_proto" in
14391 ''|0) d_getpwent_r=undef
14393 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
14394 * ) case "$getpwent_r_proto" in
14395 REENTRANT_PROTO*) ;;
14396 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
14398 echo "Prototype: $try" ;;
14401 *) case "$usethreads" in
14402 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
14409 *) getpwent_r_proto=0
14413 : see if getpwnam_r exists
14414 set getpwnam_r d_getpwnam_r
14416 case "$d_getpwnam_r" in
14418 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14419 case "$d_getpwnam_r_proto:$usethreads" in
14420 ":define") d_getpwnam_r_proto=define
14421 set d_getpwnam_r_proto getpwnam_r $hdrs
14425 case "$d_getpwnam_r_proto" in
14427 case "$getpwnam_r_proto" in
14428 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
14429 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
14431 case "$getpwnam_r_proto" in
14432 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
14433 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
14435 case "$getpwnam_r_proto" in
14436 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
14437 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
14439 case "$getpwnam_r_proto" in
14440 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
14441 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
14443 case "$getpwnam_r_proto" in
14444 ''|0) d_getpwnam_r=undef
14446 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
14447 * ) case "$getpwnam_r_proto" in
14448 REENTRANT_PROTO*) ;;
14449 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
14451 echo "Prototype: $try" ;;
14454 *) case "$usethreads" in
14455 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
14462 *) getpwnam_r_proto=0
14466 : see if getpwuid_r exists
14467 set getpwuid_r d_getpwuid_r
14469 case "$d_getpwuid_r" in
14471 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14472 case "$d_getpwuid_r_proto:$usethreads" in
14473 ":define") d_getpwuid_r_proto=define
14474 set d_getpwuid_r_proto getpwuid_r $hdrs
14478 case "$d_getpwuid_r_proto" in
14480 case "$getpwuid_r_proto" in
14481 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
14482 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
14484 case "$getpwuid_r_proto" in
14485 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
14486 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
14488 case "$getpwuid_r_proto" in
14489 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
14490 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
14492 case "$getpwuid_r_proto" in
14493 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
14494 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
14496 case "$getpwuid_r_proto" in
14497 ''|0) d_getpwuid_r=undef
14499 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
14500 * ) case "$getpwuid_r_proto" in
14501 REENTRANT_PROTO*) ;;
14502 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
14504 echo "Prototype: $try" ;;
14507 *) case "$usethreads" in
14508 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
14515 *) getpwuid_r_proto=0
14519 : Optional checks for getsbyname and getsbyport
14521 : see if getservbyname exists
14522 set getservbyname d_getsbyname
14525 : see if getservbyport exists
14526 set getservbyport d_getsbyport
14529 : see if getservent exists
14530 set getservent d_getsent
14533 : see if getservbyname_r exists
14534 set getservbyname_r d_getservbyname_r
14536 case "$d_getservbyname_r" in
14538 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14539 case "$d_getservbyname_r_proto:$usethreads" in
14540 ":define") d_getservbyname_r_proto=define
14541 set d_getservbyname_r_proto getservbyname_r $hdrs
14545 case "$d_getservbyname_r_proto" in
14547 case "$getservbyname_r_proto" in
14548 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
14549 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
14551 case "$getservbyname_r_proto" in
14552 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
14553 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
14555 case "$getservbyname_r_proto" in
14556 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
14557 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
14559 case "$getservbyname_r_proto" in
14560 ''|0) d_getservbyname_r=undef
14561 getservbyname_r_proto=0
14562 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
14563 * ) case "$getservbyname_r_proto" in
14564 REENTRANT_PROTO*) ;;
14565 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
14567 echo "Prototype: $try" ;;
14570 *) case "$usethreads" in
14571 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
14573 d_getservbyname_r=undef
14574 getservbyname_r_proto=0
14578 *) getservbyname_r_proto=0
14582 : see if getservbyport_r exists
14583 set getservbyport_r d_getservbyport_r
14585 case "$d_getservbyport_r" in
14587 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14588 case "$d_getservbyport_r_proto:$usethreads" in
14589 ":define") d_getservbyport_r_proto=define
14590 set d_getservbyport_r_proto getservbyport_r $hdrs
14594 case "$d_getservbyport_r_proto" in
14596 case "$getservbyport_r_proto" in
14597 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
14598 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
14600 case "$getservbyport_r_proto" in
14601 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
14602 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
14604 case "$getservbyport_r_proto" in
14605 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
14606 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
14608 case "$getservbyport_r_proto" in
14609 ''|0) d_getservbyport_r=undef
14610 getservbyport_r_proto=0
14611 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
14612 * ) case "$getservbyport_r_proto" in
14613 REENTRANT_PROTO*) ;;
14614 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
14616 echo "Prototype: $try" ;;
14619 *) case "$usethreads" in
14620 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
14622 d_getservbyport_r=undef
14623 getservbyport_r_proto=0
14627 *) getservbyport_r_proto=0
14631 : see if getservent_r exists
14632 set getservent_r d_getservent_r
14634 case "$d_getservent_r" in
14636 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14637 case "$d_getservent_r_proto:$usethreads" in
14638 ":define") d_getservent_r_proto=define
14639 set d_getservent_r_proto getservent_r $hdrs
14643 case "$d_getservent_r_proto" in
14645 case "$getservent_r_proto" in
14646 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
14647 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBWR ;;
14649 case "$getservent_r_proto" in
14650 ''|0) try='int getservent_r(struct servent*, char*, int);'
14651 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBI ;;
14653 case "$getservent_r_proto" in
14654 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
14655 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=S_SBI ;;
14657 case "$getservent_r_proto" in
14658 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
14659 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SD ;;
14661 case "$getservent_r_proto" in
14662 ''|0) d_getservent_r=undef
14663 getservent_r_proto=0
14664 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
14665 * ) case "$getservent_r_proto" in
14666 REENTRANT_PROTO*) ;;
14667 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
14669 echo "Prototype: $try" ;;
14672 *) case "$usethreads" in
14673 define) echo "getservent_r has no prototype, not using it." >&4 ;;
14675 d_getservent_r=undef
14676 getservent_r_proto=0
14680 *) getservent_r_proto=0
14684 : see if prototypes for various getservxxx netdb.h functions are available
14686 set d_getservprotos getservent $i_netdb netdb.h
14689 : see if getspnam exists
14690 set getspnam d_getspnam
14693 : see if this is a shadow.h system
14694 set shadow.h i_shadow
14697 : see if getspnam_r exists
14698 set getspnam_r d_getspnam_r
14700 case "$d_getspnam_r" in
14702 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
14703 case "$d_getspnam_r_proto:$usethreads" in
14704 ":define") d_getspnam_r_proto=define
14705 set d_getspnam_r_proto getspnam_r $hdrs
14709 case "$d_getspnam_r_proto" in
14711 case "$getspnam_r_proto" in
14712 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
14713 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
14715 case "$getspnam_r_proto" in
14716 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
14717 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=S_CSBI ;;
14719 case "$getspnam_r_proto" in
14720 ''|0) d_getspnam_r=undef
14722 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
14723 * ) case "$getspnam_r_proto" in
14724 REENTRANT_PROTO*) ;;
14725 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
14727 echo "Prototype: $try" ;;
14730 *) case "$usethreads" in
14731 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
14738 *) getspnam_r_proto=0
14742 : see if gettimeofday or ftime exists
14743 set gettimeofday d_gettimeod
14745 case "$d_gettimeod" in
14751 val="$undef"; set d_ftime; eval $setvar
14754 case "$d_gettimeod$d_ftime" in
14757 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
14761 : see if gmtime_r exists
14762 set gmtime_r d_gmtime_r
14764 case "$d_gmtime_r" in
14766 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14767 case "$d_gmtime_r_proto:$usethreads" in
14768 ":define") d_gmtime_r_proto=define
14769 set d_gmtime_r_proto gmtime_r $hdrs
14773 case "$d_gmtime_r_proto" in
14775 case "$gmtime_r_proto" in
14776 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
14777 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=S_TS ;;
14779 case "$gmtime_r_proto" in
14780 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
14781 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=I_TS ;;
14783 case "$gmtime_r_proto" in
14784 ''|0) d_gmtime_r=undef
14786 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
14787 * ) case "$gmtime_r_proto" in
14788 REENTRANT_PROTO*) ;;
14789 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
14791 echo "Prototype: $try" ;;
14794 *) case "$usethreads" in
14795 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
14802 *) gmtime_r_proto=0
14806 : see if hasmntopt exists
14807 set hasmntopt d_hasmntopt
14810 : see if this is a netinet/in.h or sys/in.h system
14811 set netinet/in.h i_niin sys/in.h i_sysin
14814 : see if arpa/inet.h has to be included
14815 set arpa/inet.h i_arpainet
14818 : see if htonl --and friends-- exists
14823 : Maybe they are macros.
14826 $cat >htonl.c <<EOM
14828 #include <sys/types.h>
14829 #$i_niin I_NETINET_IN
14831 #$i_arpainet I_ARPA_INET
14832 #ifdef I_NETINET_IN
14833 #include <netinet/in.h>
14836 #include <sys/in.h>
14839 #include <arpa/inet.h>
14842 printf("Defined as a macro.");
14845 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
14846 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
14848 echo "But it seems to be defined as a macro." >&4
14856 : see if ilogbl exists
14857 set ilogbl d_ilogbl
14862 if set index val -f; eval $csym; $val; then
14863 if set strchr val -f d_strchr; eval $csym; $val; then
14864 if $contains strchr "$strings" >/dev/null 2>&1 ; then
14867 echo "strchr() found." >&4
14871 echo "index() found." >&4
14876 echo "index() found." >&4
14879 if set strchr val -f d_strchr; eval $csym; $val; then
14882 echo "strchr() found." >&4
14884 echo "No index() or strchr() found!" >&4
14889 set d_strchr; eval $setvar
14891 set d_index; eval $setvar
14893 : check whether inet_aton exists
14894 set inet_aton d_inetaton
14897 : see if inet_ntop exists
14898 set inet_ntop d_inetntop
14901 : see if inet_pton exists
14902 set inet_pton d_inetpton
14907 $cat >isascii.c <<EOCP
14910 #$i_stdlib I_STDLIB
14912 #include <stdlib.h>
14923 if eval $compile; then
14924 echo "isascii() found." >&4
14927 echo "isascii() NOT found." >&4
14936 $cat >isblank.c <<'EOCP'
14947 if $cc $ccflags $ldflags -o isblank isblank.c $libs >/dev/null 2>&1 ; then
14948 echo "isblank() found." >&4
14951 echo "isblank() NOT found." >&4
14958 : see if isfinite exists
14959 set isfinite d_isfinite
14962 : see if isinf exists
14966 : see if isnan exists
14970 : see if isnanl exists
14971 set isnanl d_isnanl
14974 : see if killpg exists
14975 set killpg d_killpg
14978 : see if lchown exists
14980 $cat > try.c <<'EOCP'
14981 /* System header to define __stub macros and hopefully few prototypes,
14982 which can conflict with char lchown(); below. */
14983 #include <assert.h>
14984 /* Override any gcc2 internal prototype to avoid an error. */
14985 /* We use char because int might match the return type of a gcc2
14986 builtin and then its argument prototype would still apply. */
14989 /* The GNU C library defines this for functions which it implements
14990 to always fail with ENOSYS. Some functions are actually named
14991 something starting with __ and the normal name is an alias. */
14992 #if defined (__stub_lchown) || defined (__stub___lchown)
15000 if eval $compile; then
15001 $echo "lchown() found." >&4
15004 $echo "lchown() NOT found." >&4
15010 : See if number of significant digits in a double precision number is known
15012 $cat >ldbl_dig.c <<EOM
15013 #$i_limits I_LIMITS
15016 #include <limits.h>
15022 printf("Contains LDBL_DIG");
15025 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
15026 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
15027 echo "LDBL_DIG found." >&4
15030 echo "LDBL_DIG NOT found." >&4
15037 : see if this is a math.h system
15041 : check to see if math.h defines _LIB_VERSION
15042 d_libm_lib_version="$undef"
15046 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
15048 #include <unistd.h>
15050 int main (int argc, char *argv[])
15052 printf ("%d\n", _LIB_VERSION);
15057 if eval $compile; then
15059 echo "Yes, it does ($foo)" >&4
15060 d_libm_lib_version="$define"
15062 echo "No, it does not (probably harmless)" >&4
15069 : see if link exists
15073 : see if localtime_r exists
15074 set localtime_r d_localtime_r
15076 case "$d_localtime_r" in
15078 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
15079 case "$d_localtime_r_proto:$usethreads" in
15080 ":define") d_localtime_r_proto=define
15081 set d_localtime_r_proto localtime_r $hdrs
15085 case "$d_localtime_r_proto" in
15087 case "$localtime_r_proto" in
15088 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
15089 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=S_TS ;;
15091 case "$localtime_r_proto" in
15092 ''|0) try='int localtime_r(const time_t*, struct tm*);'
15093 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=I_TS ;;
15095 case "$localtime_r_proto" in
15096 ''|0) d_localtime_r=undef
15097 localtime_r_proto=0
15098 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
15099 * ) case "$localtime_r_proto" in
15100 REENTRANT_PROTO*) ;;
15101 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
15103 echo "Prototype: $try" ;;
15106 *) case "$usethreads" in
15107 define) echo "localtime_r has no prototype, not using it." >&4 ;;
15109 d_localtime_r=undef
15110 localtime_r_proto=0
15114 *) localtime_r_proto=0
15118 : see if localtime_r calls tzset
15119 case "$localtime_r_proto" in
15122 /* Does our libc's localtime_r call tzset ?
15123 * return 0 if so, 1 otherwise.
15125 #$i_systypes I_SYS_TYPES
15126 #$i_unistd I_UNISTD
15128 #$i_stdlib I_STDLIB
15129 #$i_string I_STRING
15130 #$i_malloc I_MALLOC
15132 # include <sys/types.h>
15135 # include <unistd.h>
15141 #include <stdlib.h>
15144 # include <string.h>
15146 # include <strings.h>
15149 # include <malloc.h>
15153 time_t t = time(0L);
15154 char w_tz[]="TZ" "=GMT+5",
15155 e_tz[]="TZ" "=GMT-5",
15156 *tz_e = (char*)malloc(16),
15157 *tz_w = (char*)malloc(16);
15158 struct tm tm_e, tm_w;
15159 memset(&tm_e,'\0',sizeof(struct tm));
15160 memset(&tm_w,'\0',sizeof(struct tm));
15165 localtime_r(&t, &tm_e);
15168 localtime_r(&t, &tm_w);
15170 if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 )
15176 if eval $compile; then
15177 if $run ./try; then
15178 d_localtime_r_needs_tzset=undef;
15180 d_localtime_r_needs_tzset=define;
15183 d_localtime_r_needs_tzset=undef;
15187 d_localtime_r_needs_tzset=undef;
15192 : see if localeconv exists
15193 set localeconv d_locconv
15196 : see if lockf exists
15200 : see if prototype for lseek is available
15202 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
15205 : see if lstat exists
15209 : see if madvise exists
15210 set madvise d_madvise
15213 : see if malloc_size exists
15214 set malloc_size d_malloc_size
15217 : see if malloc_size_good exists
15218 set malloc_good_size d_malloc_good_size
15221 : see if mblen exists
15225 : see if mbstowcs exists
15226 set mbstowcs d_mbstowcs
15229 : see if mbtowc exists
15230 set mbtowc d_mbtowc
15233 : see if memchr exists
15234 set memchr d_memchr
15237 : see if memcmp exists
15238 set memcmp d_memcmp
15241 : see if memcpy exists
15242 set memcpy d_memcpy
15245 : see if memmove exists
15246 set memmove d_memmove
15249 : see if memset exists
15250 set memset d_memset
15253 : see if mkdir exists
15257 : see if mkdtemp exists
15258 set mkdtemp d_mkdtemp
15261 : see if mkfifo exists
15262 set mkfifo d_mkfifo
15265 : see if mkstemp exists
15266 set mkstemp d_mkstemp
15269 : see if mkstemps exists
15270 set mkstemps d_mkstemps
15273 : see if mktime exists
15274 set mktime d_mktime
15277 : see if this is a sys/mman.h system
15278 set sys/mman.h i_sysmman
15281 : see if mmap exists
15284 : see what shmat returns
15285 : default to something harmless
15287 case "$i_sysmman$d_mmap" in
15289 $cat >mmap.c <<'END'
15290 #include <sys/mman.h>
15293 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
15298 echo "and it returns ($mmaptype)." >&4
15304 : see if sqrtl exists
15308 : see if scalbnl exists
15309 set scalbnl d_scalbnl
15312 : see if modfl exists
15316 : see if prototype for modfl is available
15318 set d_modflproto modfl $i_math math.h
15321 d_modfl_pow32_bug="$undef"
15323 case "$d_longdbl$d_modfl" in
15326 Checking to see whether your modfl() is okay for large values...
15332 if $test "X$d_modflproto" != "X$define"; then
15333 $cat >>try.c <<EOCP
15334 /* Sigh. many current glibcs provide the function, but do not prototype it. */
15335 long double modfl (long double, long double *);
15338 $cat >>try.c <<EOCP
15340 long double nv = 4294967303.15;
15346 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
15350 case "$osname:$gccversion" in
15351 aix:) saveccflags="$ccflags"
15352 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
15355 if eval $compile; then
15358 *" 4294967303.150000 1.150000 4294967302.000000")
15359 echo >&4 "Your modfl() is broken for large values."
15360 d_modfl_pow32_bug="$define"
15362 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
15366 *" 4294967303.150000 0.150000 4294967303.000000")
15367 echo >&4 "Your modfl() seems okay for large values."
15369 *) echo >&4 "I don't understand your modfl() at all."
15375 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
15378 case "$osname:$gccversion" in
15379 aix:) ccflags="$saveccflags" ;; # restore
15384 if $test "$uselongdouble" = "$define"; then
15386 if $test "$d_sqrtl" != "$define"; then
15387 message="$message sqrtl"
15389 if $test "$d_modfl" != "$define"; then
15390 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
15391 echo "You have both aintl and copysignl, so I can emulate modfl."
15393 message="$message modfl"
15396 if $test "$d_frexpl" != "$define"; then
15397 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
15398 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
15400 message="$message frexpl"
15404 if $test "$message" != ""; then
15407 *** You requested the use of long doubles but you do not seem to have
15408 *** the following mathematical functions needed for long double support:
15410 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
15411 *** Cannot continue, aborting.
15419 : see if mprotect exists
15420 set mprotect d_mprotect
15423 : see if msgctl exists
15424 set msgctl d_msgctl
15427 : see if msgget exists
15428 set msgget d_msgget
15431 : see if msgsnd exists
15432 set msgsnd d_msgsnd
15435 : see if msgrcv exists
15436 set msgrcv d_msgrcv
15439 : see how much of the 'msg*(2)' library is present.
15442 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
15443 *"$undef"*) h_msg=false;;
15447 case "`ipcs 2>&1`" in
15448 "SVID messages"*"not configured"*)
15449 echo "Your $osname does not have the msg*(2) configured." >&4
15452 set msgctl d_msgctl
15454 set msgget d_msgget
15456 set msgsnd d_msgsnd
15458 set msgrcv d_msgrcv
15464 : we could also check for sys/ipc.h ...
15465 if $h_msg && $test `./findhdr sys/msg.h`; then
15466 echo "You have the full msg*(2) library." >&4
15469 echo "You don't have the full msg*(2) library." >&4
15475 : Check for msghdr_s
15477 echo "Checking to see if your system supports struct msghdr..." >&4
15478 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
15480 case "$d_msghdr_s" in
15481 "$define") echo "Yes, it does." ;;
15482 *) echo "No, it doesn't." ;;
15486 : see if msync exists
15490 : see if munmap exists
15491 set munmap d_munmap
15494 : see if nice exists
15498 : see if this is a langinfo.h system
15499 set langinfo.h i_langinfo
15502 : see if nl_langinfo exists
15503 set nl_langinfo d_nl_langinfo
15506 : check for volatile keyword
15508 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
15509 $cat >try.c <<'EOCP'
15512 typedef struct _goo_struct goo_struct;
15513 goo_struct * volatile goo = ((goo_struct *)0);
15514 struct _goo_struct {
15519 typedef unsigned short foo_t;
15520 char *volatile foo;
15522 volatile foo_t blech;
15526 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
15528 echo "Yup, it does."
15531 echo "Nope, it doesn't."
15537 : Check basic sizes
15539 $echo "Choosing the C types to be used for Perl's internal types..." >&4
15541 case "$use64bitint:$d_quad:$quadtype" in
15544 uvtype="$uquadtype"
15549 uvtype="unsigned long"
15555 case "$uselongdouble:$d_longdbl" in
15557 nvtype="long double"
15558 nvsize=$longdblsize
15565 $echo "(IV will be "$ivtype", $ivsize bytes)"
15566 $echo "(UV will be "$uvtype", $uvsize bytes)"
15567 $echo "(NV will be "$nvtype", $nvsize bytes)"
15570 #$i_inttypes I_INTTYPES
15572 #include <inttypes.h>
15577 int8_t i = INT8_MAX;
15578 uint8_t u = UINT8_MAX;
15579 printf("int8_t\n");
15582 int16_t i = INT16_MAX;
15583 uint16_t i = UINT16_MAX;
15584 printf("int16_t\n");
15587 int32_t i = INT32_MAX;
15588 uint32_t u = UINT32_MAX;
15589 printf("int32_t\n");
15594 i8type="signed char"
15595 u8type="unsigned char"
15600 '') case "$shortsize" in
15602 u16type="unsigned short"
15610 '') set try -DINT16
15611 if eval $compile; then
15612 case "`$run ./try`" in
15624 '') if $test $shortsize -ge 2; then
15626 u16type="unsigned short"
15634 '') case "$longsize" in
15636 u32type="unsigned long"
15640 *) case "$intsize" in
15642 u32type="unsigned int"
15652 '') set try -DINT32
15653 if eval $compile; then
15654 case "`$run ./try`" in
15666 '') if $test $intsize -ge 4; then
15668 u32type="unsigned int"
15676 '') case "$d_quad:$quadtype" in
15678 i64type="$quadtype"
15679 u64type="$uquadtype"
15687 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
15688 : volatile so that the compiler has to store it out to memory.
15689 if test X"$d_volatile" = X"$define"; then
15694 #$i_stdlib I_STDLIB
15696 #include <stdlib.h>
15698 #include <sys/types.h>
15699 #include <signal.h>
15701 $volatile int bletched = 0;
15702 $signal_t blech(int s) { bletched = 1; }
15707 int n = 8 * $uvsize;
15710 signal(SIGFPE, blech);
15713 for (i = 0; i < n; i++) {
15714 u = u << 1 | ($uvtype)1;
15716 if (($uvtype)d != u)
15720 d = ($nvtype)(u - 1);
15721 if (($uvtype)d != (u - 1))
15728 printf("%d\n", ((i == n) ? -n : i));
15734 d_nv_preserves_uv="$undef"
15735 if eval $compile; then
15736 nv_preserves_uv_bits="`$run ./try`"
15738 case "$nv_preserves_uv_bits" in
15740 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
15741 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
15742 d_nv_preserves_uv="$define"
15744 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
15745 d_nv_preserves_uv="$undef" ;;
15746 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
15747 nv_preserves_uv_bits="0" ;;
15751 $echo "Checking to find the largest integer value your NVs can hold..." >&4
15752 : volatile so that the compiler has to store it out to memory.
15753 if test X"$d_volatile" = X"$define"; then
15759 typedef $nvtype NV;
15766 while(count < 256) {
15767 $volatile NV up = value + 1.0;
15768 $volatile NV negated = -value;
15769 $volatile NV down = negated - 1.0;
15770 $volatile NV got_up = up - value;
15771 int up_good = got_up == 1.0;
15772 int got_down = down - negated;
15773 int down_good = got_down == -1.0;
15775 if (down_good != up_good) {
15777 "Inconsistency - up %d %f; down %d %f; for 2**%d (%.20f)\n",
15778 up_good, (double) got_up, down_good, (double) got_down,
15779 count, (double) value);
15786 fputs("256.0", stdout);
15789 fputs("2.0", stdout);
15795 fputs("*", stdout);
15801 fprintf(stderr, "Cannot overflow integer range, even at 2**%d (%.20f)\n",
15802 count, (double) value);
15808 nv_overflows_integers_at='0'
15809 if eval $compile; then
15815 The largest integer your NVs can preserve is equal to $xxx
15817 nv_overflows_integers_at="$xxx"
15820 Cannot determine the largest integer value your NVs can hold, unexpected output
15827 Cannot determine the largest integer value your NVs can hold
15834 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
15835 : volatile so that the compiler has to store it out to memory.
15836 if test X"$d_volatile" = X"$define"; then
15841 #$i_stdlib I_STDLIB
15843 #include <stdlib.h>
15845 #$i_string I_STRING
15847 # include <string.h>
15849 # include <strings.h>
15851 #include <sys/types.h>
15852 #include <signal.h>
15854 $volatile int bletched = 0;
15855 $signal_t blech(int s) { bletched = 1; }
15858 int checkit($nvtype d, char *where) {
15859 unsigned char *p = (char *)&d;
15860 unsigned char *end = p + sizeof(d);
15870 printf("No - %s: 0x", where);
15872 printf ("%02X", *p++);
15877 int main(int argc, char **argv) {
15880 fail += checkit(d, "0.0");
15882 /* The compiler shouldn't be assuming that bletched is 0 */
15885 fail += checkit(d, "bleched");
15888 signal(SIGFPE, blech);
15891 /* Paranoia - the compiler should have no way of knowing that ANSI says
15892 that argv[argc] will always be NULL. Actually, if it did assume this it
15893 would be buggy, as this is C and main() can be called from elsewhere in
15895 d = argv[argc] ? 1 : 0;
15898 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
15901 fail += checkit(d, "ternary");
15903 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
15906 printf("No - memset doesn't give 0.0\n");
15907 /* This might just blow up: */
15908 printf("(gives %g)\n", d);
15914 printf("No - something bleched\n");
15919 printf("No - %d fail(s)\n", fail);
15928 d_nv_zero_is_allbits_zero="$undef"
15929 if eval $compile; then
15935 0.0 is represented as all bits zero in memory
15937 d_nv_zero_is_allbits_zero="$define"
15940 0.0 is not represented as all bits zero in memory
15942 d_nv_zero_is_allbits_zero="$undef"
15947 0.0 is not represented as all bits zero in memory
15949 d_nv_zero_is_allbits_zero="$undef"
15955 : check for off64_t
15957 echo "Checking to see if you have off64_t..." >&4
15959 #include <sys/types.h>
15960 #include <unistd.h>
15961 int main() { off64_t x = 7; }
15964 if eval $compile; then
15966 echo "You have off64_t."
15969 echo "You do not have off64_t."
15970 case "$lseeksize" in
15971 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
15978 : how to create joinable pthreads
15979 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
15981 echo "Checking what constant to use for creating joinable pthreads..." >&4
15982 $cat >try.c <<'EOCP'
15983 #include <pthread.h>
15985 int detachstate = JOINABLE;
15988 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
15989 if eval $compile; then
15990 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
15991 val="$undef" # Yes, undef.
15992 set d_old_pthread_create_joinable
15995 set old_pthread_create_joinable
15998 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
15999 if eval $compile; then
16000 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
16002 set d_old_pthread_create_joinable
16004 val=PTHREAD_CREATE_UNDETACHED
16005 set old_pthread_create_joinable
16008 set try -DJOINABLE=__UNDETACHED
16009 if eval $compile; then
16010 echo "You seem to use __UNDETACHED." >&4
16012 set d_old_pthread_create_joinable
16015 set old_pthread_create_joinable
16018 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
16020 set d_old_pthread_create_joinable
16023 set old_pthread_create_joinable
16030 d_old_pthread_create_joinable="$undef"
16031 old_pthread_create_joinable=""
16034 : see if pause exists
16038 : see if poll exists
16042 : see if prctl exists
16046 : see if prctl supports PR_SET_NAME
16047 d_prctl_set_name=$undef
16051 #include <sys/prctl.h>
16053 int main (int argc, char *argv[])
16055 return (prctl (PR_SET_NAME, "Test"));
16059 if eval $compile_ok && $run ./try; then
16060 echo "Your prctl (PR_SET_NAME, ...) works"
16061 d_prctl_set_name=$define
16067 : see if readlink exists
16068 set readlink d_readlink
16071 : Check if exe is symlink to abs path of executing program
16075 case "$d_readlink" in
16077 : NetBSD first as /proc/self is a symlink to /proc/curproc, and it feels
16078 : more tidy to avoid an extra level of symlink
16079 set NetBSD /proc/curproc/exe Linux /proc/self/exe FreeBSD /proc/curproc/file Solaris /proc/self/path/a.out
16080 while test $# -gt 0; do
16083 if $issymlink $try; then
16084 $ls -l $try > reflect
16085 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
16086 echo "You have $type-like $try."
16087 procselfexe='"'$try'"'
16089 : This will break out of the loop
16100 : backward compatibility for d_hvfork
16101 if test X$d_hvfork != X; then
16102 d_vfork="$d_hvfork"
16105 : see if there is a vfork
16110 d_pseudofork=$undef
16112 : Ok, but do we want to use it. vfork is reportedly unreliable in
16113 : perl on Solaris 2.x, and probably elsewhere.
16117 case "$usevfork" in
16123 Perl can only use a vfork() that doesn't suffer from strict
16124 restrictions on calling functions or modifying global data in
16125 the child. For example, glibc-2.1 contains such a vfork()
16126 that is unsuitable. If your system provides a proper fork()
16127 call, chances are that you do NOT want perl to use vfork().
16130 rp="Do you still want to use vfork()?"
16135 echo "Ok, we won't use vfork()."
16144 $define) usevfork='true';;
16145 *) usevfork='false';;
16148 : see whether the pthread_atfork exists
16150 #include <pthread.h>
16153 #ifdef PTHREAD_ATFORK
16154 pthread_atfork(NULL,NULL,NULL);
16159 : see if pthread_atfork exists
16160 set try -DPTHREAD_ATFORK
16161 if eval $compile; then
16166 case "$usethreads" in
16169 $define) echo 'pthread_atfork found.' >&4 ;;
16170 *) echo 'pthread_atfork NOT found.' >&4 ;;
16173 set d_pthread_atfork
16176 : see if pthread_attr_setscope exists
16177 set pthread_attr_setscope d_pthread_attr_setscope
16180 : see whether the various POSIXish _yields exist
16182 #include <pthread.h>
16188 #ifdef PTHREAD_YIELD
16191 #ifdef PTHREAD_YIELD_NULL
16192 pthread_yield(NULL);
16198 : see if sched_yield exists
16199 set try -DSCHED_YIELD
16200 if eval $compile; then
16202 sched_yield='sched_yield()'
16206 case "$usethreads" in
16209 $define) echo 'sched_yield() found.' >&4 ;;
16210 *) echo 'sched_yield() NOT found.' >&4 ;;
16216 : see if pthread_yield exists
16217 set try -DPTHREAD_YIELD
16218 if eval $compile; then
16220 case "$sched_yield" in
16221 '') sched_yield='pthread_yield()' ;;
16224 set try -DPTHREAD_YIELD_NULL
16225 if eval $compile; then
16227 case "$sched_yield" in
16228 '') sched_yield='pthread_yield(NULL)' ;;
16234 case "$usethreads" in
16237 $define) echo 'pthread_yield() found.' >&4 ;;
16238 *) echo 'pthread_yield() NOT found.' >&4 ;;
16242 set d_pthread_yield
16244 case "$sched_yield" in
16245 '') sched_yield=undef ;;
16249 : see if random_r exists
16250 set random_r d_random_r
16252 case "$d_random_r" in
16254 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
16255 case "$d_random_r_proto:$usethreads" in
16256 ":define") d_random_r_proto=define
16257 set d_random_r_proto random_r $hdrs
16261 case "$d_random_r_proto" in
16263 case "$random_r_proto" in
16264 ''|0) try='int random_r(int*, struct random_data*);'
16265 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_iS ;;
16267 case "$random_r_proto" in
16268 ''|0) try='int random_r(long*, struct random_data*);'
16269 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_lS ;;
16271 case "$random_r_proto" in
16272 ''|0) try='int random_r(struct random_data*, int32_t*);'
16273 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_St ;;
16275 case "$random_r_proto" in
16276 ''|0) d_random_r=undef
16278 echo "Disabling random_r, cannot determine prototype." >&4 ;;
16279 * ) case "$random_r_proto" in
16280 REENTRANT_PROTO*) ;;
16281 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
16283 echo "Prototype: $try" ;;
16286 *) case "$usethreads" in
16287 define) echo "random_r has no prototype, not using it." >&4 ;;
16294 *) random_r_proto=0
16298 : see if readdir and friends exist
16299 set readdir d_readdir
16301 set seekdir d_seekdir
16303 set telldir d_telldir
16305 set rewinddir d_rewinddir
16308 : see if readdir64_r exists
16309 set readdir64_r d_readdir64_r
16311 case "$d_readdir64_r" in
16313 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
16314 case "$d_readdir64_r_proto:$usethreads" in
16315 ":define") d_readdir64_r_proto=define
16316 set d_readdir64_r_proto readdir64_r $hdrs
16320 case "$d_readdir64_r_proto" in
16322 case "$readdir64_r_proto" in
16323 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
16324 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TSR ;;
16326 case "$readdir64_r_proto" in
16327 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
16328 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TS ;;
16330 case "$readdir64_r_proto" in
16331 ''|0) d_readdir64_r=undef
16332 readdir64_r_proto=0
16333 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
16334 * ) case "$readdir64_r_proto" in
16335 REENTRANT_PROTO*) ;;
16336 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
16338 echo "Prototype: $try" ;;
16341 *) case "$usethreads" in
16342 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
16344 d_readdir64_r=undef
16345 readdir64_r_proto=0
16349 *) readdir64_r_proto=0
16353 : see if readdir_r exists
16354 set readdir_r d_readdir_r
16356 case "$d_readdir_r" in
16358 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
16359 case "$d_readdir_r_proto:$usethreads" in
16360 ":define") d_readdir_r_proto=define
16361 set d_readdir_r_proto readdir_r $hdrs
16365 case "$d_readdir_r_proto" in
16367 case "$readdir_r_proto" in
16368 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
16369 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TSR ;;
16371 case "$readdir_r_proto" in
16372 ''|0) try='int readdir_r(DIR*, struct dirent*);'
16373 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TS ;;
16375 case "$readdir_r_proto" in
16376 ''|0) d_readdir_r=undef
16378 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
16379 * ) case "$readdir_r_proto" in
16380 REENTRANT_PROTO*) ;;
16381 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
16383 echo "Prototype: $try" ;;
16386 *) case "$usethreads" in
16387 define) echo "readdir_r has no prototype, not using it." >&4 ;;
16394 *) readdir_r_proto=0
16398 : see if readv exists
16402 : see if recvmsg exists
16403 set recvmsg d_recvmsg
16406 : see if rename exists
16407 set rename d_rename
16410 : see if rmdir exists
16414 : see if memory.h is available.
16419 : See if it conflicts with string.h
16425 $cppstdin $cppflags $cppminus < $strings > mem.h
16426 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
16428 echo "We won't be including <memory.h>."
16438 : can bcopy handle overlapping blocks?
16441 case "$d_memmove" in
16442 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
16443 *) case "$d_bcopy" in
16445 echo "Checking to see if bcopy() can do overlapping copies..." >&4
16447 #$i_memory I_MEMORY
16448 #$i_stdlib I_STDLIB
16449 #$i_string I_STRING
16450 #$i_unistd I_UNISTD
16452 $cat >>try.c <<'EOCP'
16455 # include <memory.h>
16458 # include <stdlib.h>
16461 # include <string.h>
16463 # include <strings.h>
16466 # include <unistd.h> /* Needed for NetBSD */
16470 char buf[128], abc[128];
16476 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16477 try to store the string in read-only memory. */
16478 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
16480 for (align = 7; align >= 0; align--) {
16481 for (len = 36; len; len--) {
16483 bcopy(abc, b, len);
16484 for (off = 1; off <= len; off++) {
16485 bcopy(b, b+off, len);
16486 bcopy(b+off, b, len);
16487 if (bcmp(b, abc, len))
16496 if eval $compile_ok; then
16497 if $run ./try 2>/dev/null; then
16498 echo "Yes, it can."
16501 echo "It can't, sorry."
16504 echo "(I can't compile the test program, so we'll assume not...)"
16514 : can memcpy handle overlapping blocks?
16517 case "$d_memmove" in
16518 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
16519 *) case "$d_memcpy" in
16521 echo "Checking to see if memcpy() can do overlapping copies..." >&4
16523 #$i_memory I_MEMORY
16524 #$i_stdlib I_STDLIB
16525 #$i_string I_STRING
16526 #$i_unistd I_UNISTD
16528 $cat >>try.c <<'EOCP'
16531 # include <memory.h>
16534 # include <stdlib.h>
16537 # include <string.h>
16539 # include <strings.h>
16542 # include <unistd.h> /* Needed for NetBSD */
16546 char buf[128], abc[128];
16552 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16553 try to store the string in read-only memory. */
16554 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
16556 for (align = 7; align >= 0; align--) {
16557 for (len = 36; len; len--) {
16559 memcpy(b, abc, len);
16560 for (off = 1; off <= len; off++) {
16561 memcpy(b+off, b, len);
16562 memcpy(b, b+off, len);
16563 if (memcmp(b, abc, len))
16572 if eval $compile_ok; then
16573 if $run ./try 2>/dev/null; then
16574 echo "Yes, it can."
16577 echo "It can't, sorry."
16580 echo "(I can't compile the test program, so we'll assume not...)"
16590 : can memcmp be trusted to compare relative magnitude?
16592 case "$d_memcmp" in
16595 echo "Checking if your memcmp() can compare relative magnitude..." >&4
16597 #$i_memory I_MEMORY
16598 #$i_stdlib I_STDLIB
16599 #$i_string I_STRING
16600 #$i_unistd I_UNISTD
16602 $cat >>try.c <<'EOCP'
16605 # include <memory.h>
16608 # include <stdlib.h>
16611 # include <string.h>
16613 # include <strings.h>
16616 # include <unistd.h> /* Needed for NetBSD */
16622 if ((a < b) && memcmp(&a, &b, 1) < 0)
16628 if eval $compile_ok; then
16629 if $run ./try 2>/dev/null; then
16630 echo "Yes, it can."
16633 echo "No, it can't (it uses signed chars)."
16636 echo "(I can't compile the test program, so we'll assume not...)"
16644 : see if prototype for sbrk is available
16646 set d_sbrkproto sbrk $i_unistd unistd.h
16649 : see if select exists
16650 set select d_select
16653 : see if semctl exists
16654 set semctl d_semctl
16657 : see if semget exists
16658 set semget d_semget
16661 : see if semop exists
16665 : see how much of the 'sem*(2)' library is present.
16668 case "$d_semctl$d_semget$d_semop" in
16669 *"$undef"*) h_sem=false;;
16673 case "`ipcs 2>&1`" in
16674 "SVID messages"*"not configured"*)
16675 echo "Your $osname does not have the sem*(2) configured." >&4
16678 set semctl d_semctl
16680 set semget d_semget
16688 : we could also check for sys/ipc.h ...
16689 if $h_sem && $test `./findhdr sys/sem.h`; then
16690 echo "You have the full sem*(2) library." >&4
16693 echo "You don't have the full sem*(2) library." >&4
16699 : see whether sys/sem.h defines union semun
16701 $cat > try.c <<'END'
16702 #include <sys/types.h>
16703 #include <sys/ipc.h>
16704 #include <sys/sem.h>
16705 int main () { union semun semun; semun.buf = 0; }
16708 if eval $compile; then
16709 echo "You have union semun in <sys/sem.h>." >&4
16712 echo "You do not have union semun in <sys/sem.h>." >&4
16719 : see how to do semctl IPC_STAT
16723 $cat > tryh.h <<END
16726 # define S_IRUSR S_IREAD
16727 # define S_IWUSR S_IWRITE
16728 # define S_IXUSR S_IEXEC
16730 # define S_IRUSR 0400
16731 # define S_IWUSR 0200
16732 # define S_IXUSR 0100
16734 # define S_IRGRP (S_IRUSR>>3)
16735 # define S_IWGRP (S_IWUSR>>3)
16736 # define S_IXGRP (S_IXUSR>>3)
16737 # define S_IROTH (S_IRUSR>>6)
16738 # define S_IWOTH (S_IWUSR>>6)
16739 # define S_IXOTH (S_IXUSR>>6)
16742 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
16743 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
16744 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
16747 : see whether semctl IPC_STAT can use union semun
16748 case "$d_semctl_semun" in
16752 #include <sys/types.h>
16753 #include <sys/ipc.h>
16754 #include <sys/sem.h>
16755 #include <sys/stat.h>
16762 #$d_union_semun HAS_UNION_SEMUN
16765 #ifndef HAS_UNION_SEMUN
16768 struct semid_ds *buf;
16769 unsigned short *array;
16775 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16776 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16778 struct semid_ds argbuf;
16781 st = semctl(sem, 0, IPC_STAT, arg);
16785 # endif /* IPC_STAT */
16786 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16788 if (semctl(sem, 0, IPC_RMID, arg) != 0)
16789 # endif /* IPC_RMID */
16790 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16792 #endif /* IPC_PRIVATE && ... */
16793 printf("semget failed: errno = %d\n", errno);
16798 if eval $compile; then
16801 semun) val="$define" ;;
16809 case "$d_semctl_semun" in
16811 echo "You can use union semun for semctl IPC_STAT." >&4
16814 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
16819 : see whether semctl IPC_STAT can use struct semid_ds pointer
16820 case "$d_semctl_semid_ds" in
16823 $cat > try.c <<'END'
16824 #include <sys/types.h>
16825 #include <sys/ipc.h>
16826 #include <sys/sem.h>
16827 #include <sys/stat.h>
16835 struct semid_ds arg;
16838 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16839 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16842 st = semctl(sem, 0, IPC_STAT, &arg);
16844 printf("semid_ds\n");
16846 # endif /* IPC_STAT */
16847 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16849 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
16850 # endif /* IPC_RMID */
16851 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16853 #endif /* IPC_PRIVATE && ... */
16854 printf("semget failed: errno = %d\n", errno);
16860 if eval $compile; then
16863 semid_ds) val="$define" ;;
16867 set d_semctl_semid_ds
16871 case "$d_semctl_semid_ds" in
16873 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
16875 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
16881 # We do not have the full sem*(2) library, so assume we can not
16887 set d_semctl_semid_ds
16893 : see if sendmsg exists
16894 set sendmsg d_sendmsg
16897 : see if setegid exists
16898 set setegid d_setegid
16901 : see if seteuid exists
16902 set seteuid d_seteuid
16905 : see if setgrent exists
16906 set setgrent d_setgrent
16909 : see if setgrent_r exists
16910 set setgrent_r d_setgrent_r
16912 case "$d_setgrent_r" in
16914 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
16915 case "$d_setgrent_r_proto:$usethreads" in
16916 ":define") d_setgrent_r_proto=define
16917 set d_setgrent_r_proto setgrent_r $hdrs
16921 case "$d_setgrent_r_proto" in
16923 case "$setgrent_r_proto" in
16924 ''|0) try='int setgrent_r(FILE**);'
16925 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=I_H ;;
16927 case "$setgrent_r_proto" in
16928 ''|0) try='void setgrent_r(FILE**);'
16929 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=V_H ;;
16931 case "$setgrent_r_proto" in
16932 ''|0) d_setgrent_r=undef
16934 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
16935 * ) case "$setgrent_r_proto" in
16936 REENTRANT_PROTO*) ;;
16937 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
16939 echo "Prototype: $try" ;;
16942 *) case "$usethreads" in
16943 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
16950 *) setgrent_r_proto=0
16954 : see if sethostent exists
16955 set sethostent d_sethent
16958 : see if sethostent_r exists
16959 set sethostent_r d_sethostent_r
16961 case "$d_sethostent_r" in
16963 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16964 case "$d_sethostent_r_proto:$usethreads" in
16965 ":define") d_sethostent_r_proto=define
16966 set d_sethostent_r_proto sethostent_r $hdrs
16970 case "$d_sethostent_r_proto" in
16972 case "$sethostent_r_proto" in
16973 ''|0) try='int sethostent_r(int, struct hostent_data*);'
16974 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=I_ID ;;
16976 case "$sethostent_r_proto" in
16977 ''|0) try='void sethostent_r(int, struct hostent_data*);'
16978 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=V_ID ;;
16980 case "$sethostent_r_proto" in
16981 ''|0) d_sethostent_r=undef
16982 sethostent_r_proto=0
16983 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
16984 * ) case "$sethostent_r_proto" in
16985 REENTRANT_PROTO*) ;;
16986 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
16988 echo "Prototype: $try" ;;
16991 *) case "$usethreads" in
16992 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
16994 d_sethostent_r=undef
16995 sethostent_r_proto=0
16999 *) sethostent_r_proto=0
17003 : see if setitimer exists
17004 set setitimer d_setitimer
17007 : see if setlinebuf exists
17008 set setlinebuf d_setlinebuf
17011 : see if setlocale exists
17012 set setlocale d_setlocale
17015 : see if locale.h is available
17016 set locale.h i_locale
17019 : see if setlocale_r exists
17020 set setlocale_r d_setlocale_r
17022 case "$d_setlocale_r" in
17024 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
17025 case "$d_setlocale_r_proto:$usethreads" in
17026 ":define") d_setlocale_r_proto=define
17027 set d_setlocale_r_proto setlocale_r $hdrs
17031 case "$d_setlocale_r_proto" in
17033 case "$setlocale_r_proto" in
17034 ''|0) try='int setlocale_r(int, const char*, char*, int);'
17035 ./protochk "$extern_C $try" $hdrs && setlocale_r_proto=I_ICBI ;;
17037 case "$setlocale_r_proto" in
17038 ''|0) d_setlocale_r=undef
17039 setlocale_r_proto=0
17040 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
17041 * ) case "$setlocale_r_proto" in
17042 REENTRANT_PROTO*) ;;
17043 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
17045 echo "Prototype: $try" ;;
17048 *) case "$usethreads" in
17049 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
17051 d_setlocale_r=undef
17052 setlocale_r_proto=0
17056 *) setlocale_r_proto=0
17060 : see if setnetent exists
17061 set setnetent d_setnent
17064 : see if setnetent_r exists
17065 set setnetent_r d_setnetent_r
17067 case "$d_setnetent_r" in
17069 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17070 case "$d_setnetent_r_proto:$usethreads" in
17071 ":define") d_setnetent_r_proto=define
17072 set d_setnetent_r_proto setnetent_r $hdrs
17076 case "$d_setnetent_r_proto" in
17078 case "$setnetent_r_proto" in
17079 ''|0) try='int setnetent_r(int, struct netent_data*);'
17080 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=I_ID ;;
17082 case "$setnetent_r_proto" in
17083 ''|0) try='void setnetent_r(int, struct netent_data*);'
17084 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=V_ID ;;
17086 case "$setnetent_r_proto" in
17087 ''|0) d_setnetent_r=undef
17088 setnetent_r_proto=0
17089 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
17090 * ) case "$setnetent_r_proto" in
17091 REENTRANT_PROTO*) ;;
17092 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
17094 echo "Prototype: $try" ;;
17097 *) case "$usethreads" in
17098 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
17100 d_setnetent_r=undef
17101 setnetent_r_proto=0
17105 *) setnetent_r_proto=0
17109 : see if setprotoent exists
17110 set setprotoent d_setpent
17113 : see if setpgid exists
17114 set setpgid d_setpgid
17117 : see if setpgrp2 exists
17118 set setpgrp2 d_setpgrp2
17121 : see if setpriority exists
17122 set setpriority d_setprior
17125 : see if setproctitle exists
17126 set setproctitle d_setproctitle
17129 : see if setprotoent_r exists
17130 set setprotoent_r d_setprotoent_r
17132 case "$d_setprotoent_r" in
17134 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17135 case "$d_setprotoent_r_proto:$usethreads" in
17136 ":define") d_setprotoent_r_proto=define
17137 set d_setprotoent_r_proto setprotoent_r $hdrs
17141 case "$d_setprotoent_r_proto" in
17143 case "$setprotoent_r_proto" in
17144 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
17145 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=I_ID ;;
17147 case "$setprotoent_r_proto" in
17148 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
17149 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=V_ID ;;
17151 case "$setprotoent_r_proto" in
17152 ''|0) d_setprotoent_r=undef
17153 setprotoent_r_proto=0
17154 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
17155 * ) case "$setprotoent_r_proto" in
17156 REENTRANT_PROTO*) ;;
17157 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
17159 echo "Prototype: $try" ;;
17162 *) case "$usethreads" in
17163 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
17165 d_setprotoent_r=undef
17166 setprotoent_r_proto=0
17170 *) setprotoent_r_proto=0
17174 : see if setpwent exists
17175 set setpwent d_setpwent
17178 : see if setpwent_r exists
17179 set setpwent_r d_setpwent_r
17181 case "$d_setpwent_r" in
17183 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
17184 case "$d_setpwent_r_proto:$usethreads" in
17185 ":define") d_setpwent_r_proto=define
17186 set d_setpwent_r_proto setpwent_r $hdrs
17190 case "$d_setpwent_r_proto" in
17192 case "$setpwent_r_proto" in
17193 ''|0) try='int setpwent_r(FILE**);'
17194 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=I_H ;;
17196 case "$setpwent_r_proto" in
17197 ''|0) try='void setpwent_r(FILE**);'
17198 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=V_H ;;
17200 case "$setpwent_r_proto" in
17201 ''|0) d_setpwent_r=undef
17203 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
17204 * ) case "$setpwent_r_proto" in
17205 REENTRANT_PROTO*) ;;
17206 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
17208 echo "Prototype: $try" ;;
17211 *) case "$usethreads" in
17212 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
17219 *) setpwent_r_proto=0
17223 : see if setregid exists
17224 set setregid d_setregid
17226 set setresgid d_setresgid
17229 : see if setreuid exists
17230 set setreuid d_setreuid
17232 set setresuid d_setresuid
17235 : see if setrgid exists
17236 set setrgid d_setrgid
17239 : see if setruid exists
17240 set setruid d_setruid
17243 : see if setservent exists
17244 set setservent d_setsent
17247 : see if setservent_r exists
17248 set setservent_r d_setservent_r
17250 case "$d_setservent_r" in
17252 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17253 case "$d_setservent_r_proto:$usethreads" in
17254 ":define") d_setservent_r_proto=define
17255 set d_setservent_r_proto setservent_r $hdrs
17259 case "$d_setservent_r_proto" in
17261 case "$setservent_r_proto" in
17262 ''|0) try='int setservent_r(int, struct servent_data*);'
17263 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=I_ID ;;
17265 case "$setservent_r_proto" in
17266 ''|0) try='void setservent_r(int, struct servent_data*);'
17267 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=V_ID ;;
17269 case "$setservent_r_proto" in
17270 ''|0) d_setservent_r=undef
17271 setservent_r_proto=0
17272 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
17273 * ) case "$setservent_r_proto" in
17274 REENTRANT_PROTO*) ;;
17275 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
17277 echo "Prototype: $try" ;;
17280 *) case "$usethreads" in
17281 define) echo "setservent_r has no prototype, not using it." >&4 ;;
17283 d_setservent_r=undef
17284 setservent_r_proto=0
17288 *) setservent_r_proto=0
17292 : see if setsid exists
17293 set setsid d_setsid
17296 : see if setvbuf exists
17297 set setvbuf d_setvbuf
17300 : see if sfio.h is available
17304 : see if sfio library is available
17315 : Ok, but do we want to use it.
17319 true|$define|[yY]*) dflt='y';;
17322 echo "$package can use the sfio library, but it is experimental."
17323 rp="You seem to have sfio available, do you want to try using it?"
17326 y|Y) echo "Ok, turning on sfio then."
17329 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
17334 *) case "$usesfio" in
17335 true|$define|[yY]*)
17336 echo "Sorry, cannot find sfio on this machine." >&4
17337 echo "Ignoring your setting of usesfio=$usesfio." >&4
17346 $define) usesfio='true';;
17347 *) usesfio='false';;
17351 *) : Remove sfio from list of libraries to use
17354 echo "Removing unneeded -lsfio from library list" >&4
17355 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
17358 echo "libs = $libs" >&4
17365 : see if shmctl exists
17366 set shmctl d_shmctl
17369 : see if shmget exists
17370 set shmget d_shmget
17373 : see if shmat exists
17376 : see what shmat returns
17379 $cat >shmat.c <<'END'
17380 #include <sys/shm.h>
17383 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
17388 echo "and it returns ($shmattype)." >&4
17389 : see if a prototype for shmat is available
17390 xxx=`./findhdr sys/shm.h`
17391 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
17392 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
17403 set d_shmatprototype
17406 : see if shmdt exists
17410 : see how much of the 'shm*(2)' library is present.
17413 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
17414 *"$undef"*) h_shm=false;;
17418 case "`ipcs 2>&1`" in
17419 "SVID shared memory"*"not configured"*)
17420 echo "Your $osname does not have the shm*(2) configured." >&4
17423 set shmctl d_shmctl
17425 set shmget d_shmget
17435 : we could also check for sys/ipc.h ...
17436 if $h_shm && $test `./findhdr sys/shm.h`; then
17437 echo "You have the full shm*(2) library." >&4
17440 echo "You don't have the full shm*(2) library." >&4
17446 : see if we have sigaction
17448 if set sigaction val -f d_sigaction; eval $csym; $val; then
17449 echo 'sigaction() found.' >&4
17452 #include <sys/types.h>
17453 #include <signal.h>
17454 #$i_stdlib I_STDLIB
17456 #include <stdlib.h>
17460 struct sigaction act, oact;
17462 oact.sa_handler = 0;
17463 /* so that act and oact are used */
17464 exit(act.sa_flags == 0 && oact.sa_handler == 0);
17468 if eval $compile_ok; then
17471 echo "But you don't seem to have a useable struct sigaction." >&4
17475 echo 'sigaction NOT found.' >&4
17478 set d_sigaction; eval $setvar
17481 : see if this is a sunmath.h system
17482 set sunmath.h i_sunmath
17485 : see if signbit exists
17486 $echo $n "Checking to see if you have signbit() available to work on $nvtype... $c" >&4
17489 #$i_sunmath I_SUNMATH
17493 #ifdef I_SUNMATH /* Solaris special math library */
17494 # include <sunmath.h>
17497 int main(int argc, char **argv)
17501 if ((signbit(x) == 0) && (signbit(y) != 0))
17509 if eval $compile; then
17510 if $run ./try; then
17514 $echo "Signbit seems to be available, but doesn't work as I expected."
17515 $echo "I won't use it." >&4
17526 : see if sigprocmask exists
17527 set sigprocmask d_sigprocmask
17530 : see if sigsetjmp exists
17532 case "$d_sigsetjmp" in
17535 #include <setjmp.h>
17536 #$i_stdlib I_STDLIB
17538 #include <stdlib.h>
17544 if (sigsetjmp(env,1))
17547 siglongjmp(env, 1);
17552 if eval $compile; then
17553 if $run ./try >/dev/null 2>&1; then
17554 echo "POSIX sigsetjmp found." >&4
17558 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
17564 echo "sigsetjmp not found." >&4
17568 *) val="$d_sigsetjmp"
17569 case "$d_sigsetjmp" in
17570 $define) echo "POSIX sigsetjmp found." >&4;;
17571 $undef) echo "sigsetjmp not found." >&4;;
17579 : see if snprintf exists
17580 set snprintf d_snprintf
17583 : see if vsnprintf exists
17584 set vsnprintf d_vsnprintf
17587 case "$d_snprintf-$d_vsnprintf" in
17590 Checking whether your snprintf() and vsnprintf() work okay...
17592 $cat >try.c <<'EOCP'
17593 /* v?snprintf testing logic courtesy of Russ Allbery.
17594 * According to C99:
17595 * - if the buffer is too short it still must be \0-terminated
17596 * - if the buffer is too short the potentially required length
17597 * must be returned and not -1
17598 * - if the buffer is NULL the potentially required length
17599 * must be returned and not -1 or core dump
17602 #include <stdarg.h>
17606 int test (char *format, ...)
17611 va_start (args, format);
17612 count = vsnprintf (buf, sizeof buf, format, args);
17619 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
17620 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
17624 if eval $compile; then
17627 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
17629 Your snprintf() and snprintf() don't seem to be working okay.
17631 d_snprintf="$undef"
17632 d_vsnprintf="$undef"
17636 echo "(I can't seem to compile the test program--assuming they don't)"
17637 d_snprintf="$undef"
17638 d_vsnprintf="$undef"
17644 : see if sockatmark exists
17645 set sockatmark d_sockatmark
17648 : see if prototype for sockatmark is available
17650 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
17653 : see if socks5_init exists
17654 set socks5_init d_socks5_init
17657 : see if sprintf returns the length of the string in the buffer as per ANSI
17658 $echo "Checking whether sprintf returns the length of the string..." >&4
17661 #$i_stdlib I_STDLIB
17663 #include <stdlib.h>
17665 #$i_string I_STRING
17667 # include <string.h>
17669 # include <strings.h>
17678 int check (size_t expect, int test) {
17679 size_t got = strlen(buffer);
17683 printf("expected %ld, got %ld in test %d '%s'\n", (long) expect, (long) got,
17688 int main(int argc, char **argv) {
17691 check(sprintf(buffer, ""), ++test);
17692 check(sprintf(buffer, "%s %s", "perl", "rules"), ++test);
17693 check(sprintf(buffer, "I like %g", atan2(0,-1)), ++test);
17700 if eval $compile; then
17704 sprintf returns the length of the string (as ANSI says it should)
17706 d_sprintf_returns_strlen="$define"
17709 sprintf does not return the length of the string (how old is this system?)
17711 d_sprintf_returns_strlen="$undef"
17715 echo "(I can't seem to compile the test program--assuming it doesn't)" >&4
17716 d_sprintf_returns_strlen="$undef"
17720 : see if srand48_r exists
17721 set srand48_r d_srand48_r
17723 case "$d_srand48_r" in
17725 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17726 case "$d_srand48_r_proto:$usethreads" in
17727 ":define") d_srand48_r_proto=define
17728 set d_srand48_r_proto srand48_r $hdrs
17732 case "$d_srand48_r_proto" in
17734 case "$srand48_r_proto" in
17735 ''|0) try='int srand48_r(long, struct drand48_data*);'
17736 ./protochk "$extern_C $try" $hdrs && srand48_r_proto=I_LS ;;
17738 case "$srand48_r_proto" in
17739 ''|0) d_srand48_r=undef
17741 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
17742 * ) case "$srand48_r_proto" in
17743 REENTRANT_PROTO*) ;;
17744 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
17746 echo "Prototype: $try" ;;
17749 *) case "$usethreads" in
17750 define) echo "srand48_r has no prototype, not using it." >&4 ;;
17757 *) srand48_r_proto=0
17761 : see if srandom_r exists
17762 set srandom_r d_srandom_r
17764 case "$d_srandom_r" in
17766 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17767 case "$d_srandom_r_proto:$usethreads" in
17768 ":define") d_srandom_r_proto=define
17769 set d_srandom_r_proto srandom_r $hdrs
17773 case "$d_srandom_r_proto" in
17775 case "$srandom_r_proto" in
17776 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
17777 ./protochk "$extern_C $try" $hdrs && srandom_r_proto=I_TS ;;
17779 case "$srandom_r_proto" in
17780 ''|0) d_srandom_r=undef
17782 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
17783 * ) case "$srandom_r_proto" in
17784 REENTRANT_PROTO*) ;;
17785 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
17787 echo "Prototype: $try" ;;
17790 *) case "$usethreads" in
17791 define) echo "srandom_r has no prototype, not using it." >&4 ;;
17798 *) srandom_r_proto=0
17802 : see if prototype for setresgid is available
17804 set d_sresgproto setresgid $i_unistd unistd.h
17807 : see if prototype for setresuid is available
17809 set d_sresuproto setresuid $i_unistd unistd.h
17812 : see if sys/stat.h is available
17813 set sys/stat.h i_sysstat
17816 : see if stat knows about block sizes
17818 echo "Checking to see if your struct stat has st_blocks field..." >&4
17819 set d_statblks stat st_blocks $i_sysstat sys/stat.h
17822 : see if this is a sys/vfs.h system
17823 set sys/vfs.h i_sysvfs
17826 : see if this is a sys/statfs.h system
17827 set sys/statfs.h i_sysstatfs
17830 : Check for statfs_s
17832 echo "Checking to see if your system supports struct statfs..." >&4
17833 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
17835 case "$d_statfs_s" in
17836 "$define") echo "Yes, it does." ;;
17837 *) echo "No, it doesn't." ;;
17841 : see if struct statfs knows about f_flags
17842 case "$d_statfs_s" in
17845 echo "Checking to see if your struct statfs has f_flags field..." >&4
17846 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
17850 set d_statfs_f_flags
17854 case "$d_statfs_f_flags" in
17855 "$define") echo "Yes, it does." ;;
17856 *) echo "No, it doesn't." ;;
17859 : see what flavor, if any, of static inline is supported
17861 echo "Checking to see if your system supports static inline..."
17862 $cat > try.c <<'EOCP'
17863 #include <stdlib.h>
17864 extern int f_via_a(int x);
17865 extern int f_via_b(int x);
17866 int main(int argc, char **argv)
17875 return EXIT_SUCCESS;
17878 return EXIT_FAILURE;
17882 $cat > a.c <<'EOCP'
17883 static INLINE int f(int x) {
17894 $cat > b.c <<'EOCP'
17895 extern int f(int x);
17903 # Respect a hint (or previous) value for perl_static_inline, if there is one.
17904 case "$perl_static_inline" in
17905 '') # Check the various possibilities, and break out on success.
17906 # For gcc, prefer __inline__, which will still permit
17907 # cflags.SH to add in -ansi.
17908 case "$gccversion" in
17909 '') xxx="inline __inline__ __inline _inline";;
17910 *) xxx="__inline__ inline __inline _inline";;
17912 for inline in $xxx; do
17913 set try -DINLINE=$inline a.c
17914 if eval $compile && $run ./try; then
17915 # Now make sure there is no external linkage of static
17917 set try -DINLINE=$inline -DUSE_B a.c b.c
17918 if eval $compile && $run ./try; then
17919 $echo "Your compiler supports static $inline, " >&4
17920 $echo "but it also creates an external definition," >&4
17921 $echo "so I won't use it." >&4
17924 $echo "Your compiler supports static $inline." >&4
17926 perl_static_inline="static $inline";
17930 $echo "Your compiler does NOT support static $inline." >&4
17935 *inline*) # Some variant of inline exists.
17936 echo "Keeping your $hint value of $perl_static_inline."
17939 static) # No inline capabilities
17940 echo "Keeping your $hint value of $perl_static_inline."
17943 *) # Unrecognized previous value -- blindly trust the supplied
17944 # value and hope it makes sense. Use old value for
17945 # d_static_inline, if there is one.
17946 echo "Keeping your $hint value of $perl_static_inline."
17947 case "$d_static_inline" in
17949 *) val=$d_static_inline ;;
17953 # Fallback to plain 'static' if nothing worked.
17954 case "$perl_static_inline" in
17956 perl_static_inline="static"
17960 set d_static_inline
17962 $rm -f a.[co] b.[co]
17965 : Check stream access
17967 Checking how to access stdio streams by file descriptor number...
17969 case "$stdio_stream_array" in
17970 '') $cat >try.c <<EOCP
17973 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
17977 for s in _iob __iob __sF
17979 set try -DSTDIO_STREAM_ARRAY=$s
17980 if eval $compile; then
17981 case "`$run ./try`" in
17982 yes) stdio_stream_array=$s; break ;;
17988 case "$stdio_stream_array" in
17990 I can't figure out how to access stdio streams by file descriptor number.
17992 d_stdio_stream_array="$undef"
17995 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
17997 d_stdio_stream_array="$define"
18001 : see if strcoll exists
18002 set strcoll d_strcoll
18005 : check for structure copying
18007 echo "Checking to see if your C compiler can copy structs..." >&4
18008 $cat >try.c <<'EOCP'
18018 if $cc -c try.c >/dev/null 2>&1 ; then
18020 echo "Yup, it can."
18023 echo "Nope, it can't."
18029 : see if strerror and/or sys_errlist[] exist
18031 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
18032 if set strerror val -f d_strerror; eval $csym; $val; then
18033 echo 'strerror() found.' >&4
18034 d_strerror="$define"
18035 d_strerrm='strerror(e)'
18036 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
18037 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
18038 d_syserrlst="$define"
18040 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
18041 d_syserrlst="$undef"
18043 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
18044 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
18045 echo 'strerror() found in string header.' >&4
18046 d_strerror="$define"
18047 d_strerrm='strerror(e)'
18048 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
18049 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
18050 d_syserrlst="$define"
18052 echo "(You don't appear to have any sys_errlist[], how can this be?)"
18053 d_syserrlst="$undef"
18055 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
18056 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
18057 d_strerror="$undef"
18058 d_syserrlst="$define"
18059 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
18061 echo 'strerror() and sys_errlist[] NOT found.' >&4
18062 d_strerror="$undef"
18063 d_syserrlst="$undef"
18064 d_strerrm='"unknown"'
18068 : see if strerror_r exists
18069 set strerror_r d_strerror_r
18071 case "$d_strerror_r" in
18073 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
18074 case "$d_strerror_r_proto:$usethreads" in
18075 ":define") d_strerror_r_proto=define
18076 set d_strerror_r_proto strerror_r $hdrs
18080 case "$d_strerror_r_proto" in
18082 case "$strerror_r_proto" in
18083 ''|0) try='int strerror_r(int, char*, size_t);'
18084 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBW ;;
18086 case "$strerror_r_proto" in
18087 ''|0) try='int strerror_r(int, char*, int);'
18088 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBI ;;
18090 case "$strerror_r_proto" in
18091 ''|0) try='char* strerror_r(int, char*, size_t);'
18092 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=B_IBW ;;
18094 case "$strerror_r_proto" in
18095 ''|0) d_strerror_r=undef
18097 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
18098 * ) case "$strerror_r_proto" in
18099 REENTRANT_PROTO*) ;;
18100 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
18102 echo "Prototype: $try" ;;
18105 *) case "$usethreads" in
18106 define) echo "strerror_r has no prototype, not using it." >&4 ;;
18113 *) strerror_r_proto=0
18117 : see if strftime exists
18118 set strftime d_strftime
18121 : see if strlcat exists
18122 set strlcat d_strlcat
18125 : see if strlcpy exists
18126 set strlcpy d_strlcpy
18129 : see if strtod exists
18130 set strtod d_strtod
18133 : see if strtol exists
18134 set strtol d_strtol
18137 : see if strtold exists
18138 set strtold d_strtold
18141 : see if strtoll exists
18142 set strtoll d_strtoll
18145 case "$d_longlong-$d_strtoll" in
18148 Checking whether your strtoll() works okay...
18150 $cat >try.c <<'EOCP'
18153 #define strtoll __strtoll
18156 #define strtoll _strtoll
18159 extern long long int strtoll(char *s, char **, int);
18160 static int bad = 0;
18161 int check(char *s, long long ell, int een) {
18164 gll = strtoll(s, 0, 10);
18165 if (!((gll == ell) && (errno == een)))
18169 check(" 1", 1LL, 0);
18170 check(" 0", 0LL, 0);
18171 check("-1", -1LL, 0);
18172 check("-9223372036854775808", -9223372036854775808LL, 0);
18173 check("-9223372036854775808", -9223372036854775808LL, 0);
18174 check(" 9223372036854775807", 9223372036854775807LL, 0);
18175 check("-9223372036854775808", -9223372036854775808LL, 0);
18176 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
18177 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
18183 if eval $compile; then
18186 ok) echo "Your strtoll() seems to be working okay." ;;
18188 Your strtoll() doesn't seem to be working okay.
18194 echo "(I can't seem to compile the test program--assuming it doesn't)"
18200 : see if strtoq exists
18201 set strtoq d_strtoq
18204 : see if strtoul exists
18205 set strtoul d_strtoul
18208 case "$d_strtoul" in
18211 Checking whether your strtoul() works okay...
18213 $cat >try.c <<'EOCP'
18216 extern unsigned long int strtoul(char *s, char **, int);
18217 static int bad = 0;
18218 void check(char *s, unsigned long eul, int een) {
18221 gul = strtoul(s, 0, 10);
18222 if (!((gul == eul) && (errno == een)))
18226 check(" 1", 1L, 0);
18227 check(" 0", 0L, 0);
18229 case "$longsize" in
18231 $cat >>try.c <<'EOCP'
18232 check("18446744073709551615", 18446744073709551615UL, 0);
18233 check("18446744073709551616", 18446744073709551615UL, ERANGE);
18234 #if 0 /* strtoul() for /^-/ strings is undefined. */
18235 check("-1", 18446744073709551615UL, 0);
18236 check("-18446744073709551614", 2, 0);
18237 check("-18446744073709551615", 1, 0);
18238 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
18239 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
18244 $cat >>try.c <<'EOCP'
18245 check("4294967295", 4294967295UL, 0);
18246 check("4294967296", 4294967295UL, ERANGE);
18247 #if 0 /* strtoul() for /^-/ strings is undefined. */
18248 check("-1", 4294967295UL, 0);
18249 check("-4294967294", 2, 0);
18250 check("-4294967295", 1, 0);
18251 check("-4294967296", 4294967295UL, ERANGE);
18252 check("-4294967297", 4294967295UL, ERANGE);
18257 : Should we write these tests to be more portable by sprintf-ing
18258 : ~0 and then manipulating that char string as input for strtol?
18261 $cat >>try.c <<'EOCP'
18268 if eval $compile; then
18269 case "`$run ./try`" in
18270 ok) echo "Your strtoul() seems to be working okay." ;;
18272 Your strtoul() doesn't seem to be working okay.
18278 echo "(I can't seem to compile the test program--assuming it doesn't)"
18284 : see if strtoull exists
18285 set strtoull d_strtoull
18288 case "$d_longlong-$d_strtoull" in
18291 Checking whether your strtoull() works okay...
18293 $cat >try.c <<'EOCP'
18296 #define strtoull __strtoull
18299 extern unsigned long long int strtoull(char *s, char **, int);
18300 static int bad = 0;
18301 int check(char *s, long long eull, int een) {
18304 gull = strtoull(s, 0, 10);
18305 if (!((gull == eull) && (errno == een)))
18309 check(" 1", 1LL, 0);
18310 check(" 0", 0LL, 0);
18311 check("18446744073709551615", 18446744073709551615ULL, 0);
18312 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
18313 #if 0 /* strtoull() for /^-/ strings is undefined. */
18314 check("-1", 18446744073709551615ULL, 0);
18315 check("-18446744073709551614", 2LL, 0);
18316 check("-18446744073709551615", 1LL, 0);
18317 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
18318 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
18325 if eval $compile; then
18326 case "`$run ./try`" in
18327 ok) echo "Your strtoull() seems to be working okay." ;;
18329 Your strtoull() doesn't seem to be working okay.
18331 d_strtoull="$undef"
18335 echo "(I can't seem to compile the test program--assuming it doesn't)"
18336 d_strtoull="$undef"
18341 : see if strtouq exists
18342 set strtouq d_strtouq
18345 case "$d_strtouq" in
18348 Checking whether your strtouq() works okay...
18350 $cat >try.c <<'EOCP'
18353 extern unsigned long long int strtouq(char *s, char **, int);
18354 static int bad = 0;
18355 void check(char *s, unsigned long long eull, int een) {
18356 unsigned long long gull;
18358 gull = strtouq(s, 0, 10);
18359 if (!((gull == eull) && (errno == een)))
18363 check(" 1", 1LL, 0);
18364 check(" 0", 0LL, 0);
18365 check("18446744073709551615", 18446744073709551615ULL, 0);
18366 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
18367 #if 0 /* strtouq() for /^-/ strings is undefined. */
18368 check("-1", 18446744073709551615ULL, 0);
18369 check("-18446744073709551614", 2LL, 0);
18370 check("-18446744073709551615", 1LL, 0);
18371 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
18372 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
18380 if eval $compile; then
18381 case "`$run ./try`" in
18382 ok) echo "Your strtouq() seems to be working okay." ;;
18384 Your strtouq() doesn't seem to be working okay.
18390 echo "(I can't seem to compile the test program--assuming it doesn't)"
18396 : see if strxfrm exists
18397 set strxfrm d_strxfrm
18400 : see if symlink exists
18401 set symlink d_symlink
18404 : see if syscall exists
18405 set syscall d_syscall
18408 : see if prototype for syscall is available
18410 set d_syscallproto syscall $i_unistd unistd.h
18413 : see if sysconf exists
18414 set sysconf d_sysconf
18417 : see if system exists
18418 set system d_system
18421 : see if tcgetpgrp exists
18422 set tcgetpgrp d_tcgetpgrp
18425 : see if tcsetpgrp exists
18426 set tcsetpgrp d_tcsetpgrp
18429 : see if prototype for telldir is available
18431 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
18434 : see if time exists
18436 if test "X$d_time" = X -o X"$timetype" = X; then
18437 if set time val -f d_time; eval $csym; $val; then
18438 echo 'time() found.' >&4
18440 rp="What is the type returned by time() on this system?"
18441 set time_t timetype long stdio.h sys/types.h
18444 echo 'time() not found, hope that will do.' >&4
18452 : see if timegm exists
18453 set timegm d_timegm
18456 : see if this is a sys/times.h system
18457 set sys/times.h i_systimes
18460 : see if times exists
18462 if set times val -f d_times; eval $csym; $val; then
18463 echo 'times() found.' >&4
18466 case "$i_systimes" in
18467 "$define") inc='sys/times.h';;
18469 rp="What is the type returned by times() on this system?"
18470 set clock_t clocktype long stdio.h sys/types.h $inc
18473 echo 'times() NOT found, hope that will do.' >&4
18478 : see if tmpnam_r exists
18479 set tmpnam_r d_tmpnam_r
18481 case "$d_tmpnam_r" in
18483 hdrs="$i_systypes sys/types.h define stdio.h "
18484 case "$d_tmpnam_r_proto:$usethreads" in
18485 ":define") d_tmpnam_r_proto=define
18486 set d_tmpnam_r_proto tmpnam_r $hdrs
18490 case "$d_tmpnam_r_proto" in
18492 case "$tmpnam_r_proto" in
18493 ''|0) try='char* tmpnam_r(char*);'
18494 ./protochk "$extern_C $try" $hdrs && tmpnam_r_proto=B_B ;;
18496 case "$tmpnam_r_proto" in
18497 ''|0) d_tmpnam_r=undef
18499 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
18500 * ) case "$tmpnam_r_proto" in
18501 REENTRANT_PROTO*) ;;
18502 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
18504 echo "Prototype: $try" ;;
18507 *) case "$usethreads" in
18508 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
18515 *) tmpnam_r_proto=0
18519 : see if truncate exists
18520 set truncate d_truncate
18523 : see if ttyname_r exists
18524 set ttyname_r d_ttyname_r
18526 case "$d_ttyname_r" in
18528 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
18529 case "$d_ttyname_r_proto:$usethreads" in
18530 ":define") d_ttyname_r_proto=define
18531 set d_ttyname_r_proto ttyname_r $hdrs
18535 case "$d_ttyname_r_proto" in
18537 case "$ttyname_r_proto" in
18538 ''|0) try='int ttyname_r(int, char*, size_t);'
18539 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBW ;;
18541 case "$ttyname_r_proto" in
18542 ''|0) try='int ttyname_r(int, char*, int);'
18543 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBI ;;
18545 case "$ttyname_r_proto" in
18546 ''|0) try='char* ttyname_r(int, char*, int);'
18547 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=B_IBI ;;
18549 case "$ttyname_r_proto" in
18550 ''|0) d_ttyname_r=undef
18552 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
18553 * ) case "$ttyname_r_proto" in
18554 REENTRANT_PROTO*) ;;
18555 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
18557 echo "Prototype: $try" ;;
18560 *) case "$usethreads" in
18561 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
18568 *) ttyname_r_proto=0
18572 : see if tzname[] exists
18574 if set tzname val -a d_tzname; eval $csym; $val; then
18576 echo 'tzname[] found.' >&4
18579 echo 'tzname[] NOT found.' >&4
18584 : Check if is a multiplatform env
18586 next|rhapsody|darwin) multiarch="$define" ;;
18588 case "$multiarch" in
18589 ''|[nN]*) multiarch="$undef" ;;
18592 : check for ordering of bytes in a UV
18594 case "$usecrosscompile$multiarch" in
18597 You seem to be either cross-compiling or doing a multiarchitecture build,
18598 skipping the byteorder check.
18604 case "$byteorder" in
18607 In the following, larger digits indicate more significance. A big-endian
18608 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
18609 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
18610 machines may have weird orders like 3412. A Cray will report 87654321,
18611 an Alpha will report 12345678. If the test program works the default is
18613 I'm now running the test program...
18617 #$i_stdlib I_STDLIB
18619 #include <stdlib.h>
18621 #include <sys/types.h>
18622 typedef $uvtype UV;
18632 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
18634 u.l = (UV)0x04030201;
18635 for (i = 0; i < $uvsize; i++)
18636 printf("%c", u.c[i]+'0');
18643 if eval $compile && $run ./try > /dev/null; then
18646 [1-4][1-4][1-4][1-4]|12345678|87654321)
18647 echo "(The test program ran ok.)"
18648 echo "byteorder=$dflt"
18651 ????|????????) echo "(The test program ran ok.)" ;;
18652 *) echo "(The test program didn't run right for some reason.)" ;;
18657 (I can't seem to compile the test program. Guessing big-endian...)
18660 case "$xxx_prompt" in
18662 rp="What is the order of bytes in $uvtype?"
18675 : Checking 32bit alignedness
18678 Checking to see whether you can access character data unalignedly...
18680 case "$d_u32align" in
18681 '') $cat >try.c <<EOCP
18683 #$i_stdlib I_STDLIB
18685 #include <stdlib.h>
18687 #define U32 $u32type
18688 #define BYTEORDER 0x$byteorder
18690 #include <signal.h>
18692 $signal_t bletch(int s) { exit(4); }
18695 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
18696 volatile U8 buf[8];
18700 if (sizeof(U32) != 4) {
18701 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
18708 signal(SIGBUS, bletch);
18720 for (i = 0; i < 4; i++) {
18721 up = (U32*)(buf + i);
18722 if (! ((*up == 1 << (8*i)) || /* big-endian */
18723 (*up == 1 << (8*(3-i))) /* little-endian */
18727 printf("read failed (%x)\n", *up);
18733 for (i = 0; i < 4; i++) {
18734 up = (U32*)(buf + i);
18736 if (*up != 0xBeef) {
18737 printf("write failed (%x)\n", *up);
18751 if eval $compile_ok; then
18752 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
18753 $run ./try 2>&1 >/dev/null
18756 You can access character data pretty unalignedly.
18758 d_u32align="$undef"
18761 It seems that you must access character data in an aligned manner.
18763 d_u32align="$define"
18767 rp='Can you access character data at unaligned addresses?'
18771 [yY]*) d_u32align="$undef" ;;
18772 *) d_u32align="$define" ;;
18779 : see if ualarm exists
18780 set ualarm d_ualarm
18783 : see if umask exists
18787 : see if unordered exists
18788 set unordered d_unordered
18791 : see if unsetenv exists
18792 set unsetenv d_unsetenv
18795 : see if usleep exists
18796 set usleep d_usleep
18799 : see if prototype for usleep is available
18801 set d_usleepproto usleep $i_unistd unistd.h
18804 : see if ustat exists
18808 : see if closedir exists
18809 set closedir d_closedir
18812 case "$d_closedir" in
18815 echo "Checking whether closedir() returns a status..." >&4
18817 #$i_dirent I_DIRENT /**/
18818 #$i_sysdir I_SYS_DIR /**/
18819 #$i_sysndir I_SYS_NDIR /**/
18820 #$i_systypes I_SYS_TYPES /**/
18822 #if defined(I_SYS_TYPES)
18823 #include <sys/types.h>
18825 #if defined(I_DIRENT)
18826 #include <dirent.h>
18827 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
18828 #include <sys/dir.h>
18832 #include <sys/ndir.h>
18836 #include <ndir.h> /* may be wrong in the future */
18838 #include <sys/dir.h>
18843 int main() { return closedir(opendir(".")); }
18846 if eval $compile_ok; then
18847 if $run ./try > /dev/null 2>&1 ; then
18848 echo "Yes, it does."
18851 echo "No, it doesn't."
18855 echo "(I can't seem to compile the test program--assuming it doesn't)"
18863 set d_void_closedir
18867 : see if there is a wait4
18871 : see if waitpid exists
18872 set waitpid d_waitpid
18875 : see if wcstombs exists
18876 set wcstombs d_wcstombs
18879 : see if wctomb exists
18880 set wctomb d_wctomb
18883 : see if writev exists
18884 set writev d_writev
18887 : preserve RCS keywords in files with variable substitution, grrr
18892 Revision='$Revision'
18894 : check for alignment requirements
18896 case "$usecrosscompile$multiarch" in
18899 You seem to be either cross-compiling or doing a multiarchitecture build,
18900 skipping the memory alignment check.
18903 case "$alignbytes" in
18904 '') alignbytes=8 ;;
18908 case "$alignbytes" in
18909 '') echo "Checking alignment constraints..." >&4
18910 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
18911 $cat >try.c <<'EOCP'
18912 typedef long double NV;
18915 $cat >try.c <<'EOCP'
18919 $cat >>try.c <<'EOCP'
18927 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
18932 if eval $compile_ok; then
18936 echo "(I can't seem to compile the test program...)"
18939 *) dflt="$alignbytes"
18942 rp="Doubles must be aligned on a how-many-byte boundary?"
18950 : set the base revision
18953 : length of character in bytes. Is always 1, otherwise it isnt C
18954 : This used to be a test using sizeof
18957 : Check for the number of bits in a character
18958 case "$charbits" in
18959 '') echo "Checking how long a character is (in bits)..." >&4
18966 for (c = 1, n = 0; c; c <<= 1, n++) ;
18967 printf ("%d\n", n);
18972 if eval $compile_ok; then
18976 echo "(I can't seem to compile the test program. Guessing...)"
18983 rp="What is the length of a character (in bits)?"
18987 case "$charbits" in
18990 Your system has an unsigned character size of $charbits bits, which
18991 is rather unusual (normally it is 8 bits). Perl likely will not work
18992 correctly on your system, with subtle bugs in various places.
18994 rp='Do you really want to continue?'
18998 [yY]) echo >&4 "Okay, continuing." ;;
19003 : how do we concatenate cpp tokens here?
19005 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
19006 $cat >cpp_stuff.c <<'EOCP'
19007 #define RCAT(a,b)a/**/b
19008 #define ACAT(a,b)a ## b
19012 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
19013 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
19014 echo "Oh! Smells like ANSI's been here." >&4
19015 echo "We can catify or stringify, separately or together!"
19017 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
19018 echo "Ah, yes! The good old days!" >&4
19019 echo "However, in the good old days we don't know how to stringify and"
19020 echo "catify at the same time."
19024 Hmm, I don't seem to be able to concatenate tokens with your cpp.
19025 You're going to have to edit the values of CAT[2-5] in config.h...
19027 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
19031 : see if this is a db.h system
19037 : Check db version.
19039 echo "Checking Berkeley DB version ..." >&4
19045 #include <sys/types.h>
19047 #$i_stdlib I_STDLIB
19049 #include <stdlib.h>
19052 int main(int argc, char *argv[])
19054 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
19055 int Major, Minor, Patch ;
19056 unsigned long Version ;
19057 (void)db_version(&Major, &Minor, &Patch) ;
19059 printf("%d %d %d %d %d %d\n",
19060 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
19061 Major, Minor, Patch);
19064 printf("You have Berkeley DB Version 2 or greater.\n");
19066 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
19067 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
19068 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
19069 Major, Minor, Patch) ;
19071 /* check that db.h & libdb are compatible */
19072 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
19073 printf("db.h and libdb are incompatible.\n") ;
19077 printf("db.h and libdb are compatible.\n") ;
19079 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
19080 + DB_VERSION_PATCH ;
19082 /* needs to be >= 2.3.4 */
19083 if (Version < 2003004) {
19084 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
19085 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
19091 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
19096 printf("You have Berkeley DB Version 1.\n");
19097 exit(0); /* DB version < 2: the coast is clear. */
19099 exit(1); /* <db.h> not Berkeley DB? */
19105 if eval $compile_ok && $run ./try; then
19106 echo 'Looks OK.' >&4
19108 db_version_major=$1
19109 db_version_minor=$2
19110 db_version_patch=$3
19112 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
19116 : Remove db from list of libraries to use
19117 echo "Removing unusable -ldb from library list" >&4
19118 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
19121 echo "libs = $libs" >&4
19131 : Check the return type needed for hash
19133 echo "Checking return type needed for hash for Berkeley DB ..." >&4
19139 #include <sys/types.h>
19142 #ifndef DB_VERSION_MAJOR
19143 u_int32_t hash_cb (ptr, size)
19151 info.hash = hash_cb;
19155 if $cc $ccflags -c try.c >try.out 2>&1 ; then
19156 if $contains warning try.out >>/dev/null 2>&1 ; then
19159 db_hashtype='u_int32_t'
19162 : XXX Maybe we should just give up here.
19163 db_hashtype=u_int32_t
19165 echo "Help: I can't seem to compile the db test program." >&4
19166 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
19169 echo "Your version of Berkeley DB uses $db_hashtype for hash."
19171 *) db_hashtype=u_int32_t
19176 : Check the return type needed for prefix
19178 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
19184 #include <sys/types.h>
19187 #ifndef DB_VERSION_MAJOR
19188 size_t prefix_cb (key1, key2)
19196 info.prefix = prefix_cb;
19200 if $cc $ccflags -c try.c >try.out 2>&1 ; then
19201 if $contains warning try.out >>/dev/null 2>&1 ; then
19202 db_prefixtype='int'
19204 db_prefixtype='size_t'
19207 db_prefixtype='size_t'
19208 : XXX Maybe we should just give up here.
19210 echo "Help: I can't seem to compile the db test program." >&4
19211 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
19214 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
19216 *) db_prefixtype='size_t'
19220 : How can we generate normalized random numbers ?
19222 echo "Looking for a random number function..." >&4
19223 case "$randfunc" in
19225 if set drand48 val -f; eval $csym; $val; then
19227 echo "Good, found drand48()." >&4
19228 elif set random val -f; eval $csym; $val; then
19230 echo "OK, found random()." >&4
19233 echo "Yick, looks like I have to use rand()." >&4
19244 *-Dmy_rand=*|*-Dmy_srand=*)
19245 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
19246 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
19247 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
19248 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
19252 while $test "$cont"; do
19253 rp="Use which function to generate random numbers?"
19255 if $test "$ans" = "$dflt"; then
19261 if set $ans val -f; eval $csym; $val; then
19265 rp="I cannot find function $ans. Use that name anyway?"
19274 case "$randfunc" in
19276 drand01="drand48()"
19282 case "$randbits" in
19284 echo "Checking to see how many bits your $randfunc() function produces..." >&4
19286 #$i_unistd I_UNISTD
19287 #$i_stdlib I_STDLIB
19290 # include <unistd.h>
19293 # include <stdlib.h>
19298 register unsigned long tmp;
19299 register unsigned long max = 0L;
19301 for (i = 1000; i; i--) {
19302 tmp = (unsigned long) $randfunc();
19303 if (tmp > max) max = tmp;
19305 for (i = 0; max; i++)
19311 if eval $compile_ok; then
19315 echo "(I can't seem to compile the test program...)"
19322 rp="How many bits does your $randfunc() function produce?"
19326 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
19327 seedfunc="s$randfunc"
19328 randseedtype=unsigned
19332 rp="How many bits does your $randfunc() function produce?"
19335 seedfunc="s$randfunc"
19336 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
19337 if set $seedfunc val -f; eval $csym; $val; then
19338 echo "(Using $seedfunc() to seed random generator)"
19340 echo "(Warning: no $seedfunc() to seed random generator)"
19343 randseedtype=unsigned
19350 : Determine if this is an EBCDIC system
19352 echo "Determining whether or not we are on an EBCDIC system..." >&4
19353 $cat >try.c <<'EOM'
19356 if ('M'==0xd4) return 0;
19363 if eval $compile_ok; then
19364 if $run ./try; then
19365 echo "You seem to speak EBCDIC." >&4
19368 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
19371 echo "I'm unable to compile the test program." >&4
19372 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
19378 : Check how to flush
19381 Checking how to flush all pending stdio output...
19383 # I only know how to find the first 32 possibly open files on SunOS.
19384 # See also hints/sunos_4_1.sh and util.c --AD
19386 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
19388 $cat >>try.c <<EOCP
19390 #$i_stdlib I_STDLIB
19392 #include <stdlib.h>
19394 #$i_unistd I_UNISTD
19396 # include <unistd.h>
19398 #$d_sysconf HAS_SYSCONF
19399 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
19400 #ifdef HAS_STDIO_STREAM_ARRAY
19401 # define STDIO_STREAM_ARRAY $stdio_stream_array
19406 p = fopen("try.out", "w");
19410 # ifdef TRY_FPRINTF
19414 #ifdef TRY_FFLUSH_NULL
19417 #ifdef TRY_FFLUSH_ALL
19419 long open_max = -1;
19420 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
19421 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
19423 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
19424 open_max = sysconf(_SC_OPEN_MAX);
19427 open_max = FOPEN_MAX;
19430 open_max = OPEN_MAX;
19439 # ifdef HAS_STDIO_STREAM_ARRAY
19440 if (open_max > 0) {
19442 for (i = 0; i < open_max; i++)
19443 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
19444 STDIO_STREAM_ARRAY[i]._file < open_max &&
19445 STDIO_STREAM_ARRAY[i]._flag)
19446 fflush(&STDIO_STREAM_ARRAY[i]);
19454 : first we have to find out how _not_ to flush
19456 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
19458 set try -DTRY_FPUTC
19459 if eval $compile; then
19460 $run ./try 2>/dev/null
19463 if $test ! -s try.out -a "X$code" = X42; then
19469 set try -DTRY_FPRINTF
19470 if eval $compile; then
19471 $run ./try 2>/dev/null
19474 if $test ! -s try.out -a "X$code" = X42; then
19475 output=-DTRY_FPRINTF
19481 : check for fflush NULL behaviour
19482 case "$fflushNULL" in
19483 '') set try -DTRY_FFLUSH_NULL $output
19484 if eval $compile; then
19485 $run ./try 2>/dev/null
19488 if $test -s try.out -a "X$code" = X42; then
19489 fflushNULL="`$cat try.out`"
19491 if $test "X$code" != X42; then
19493 (If this test failed, don't worry, we'll try another method shortly.)
19498 $rm -f core try.core core.try.*
19499 case "$fflushNULL" in
19501 Your fflush(NULL) works okay for output streams.
19502 Let's see if it clobbers input pipes...
19504 # As of mid-March 2000 all versions of Solaris appear to have a stdio
19505 # bug that improperly flushes the input end of pipes. So we avoid the
19506 # autoflush on fork/system/exec support for now. :-(
19507 $cat >tryp.c <<EOCP
19510 main(int argc, char **argv)
19516 while ((i = getc(stdin)) != -1
19517 && (*bp++ = i) != '\n'
19518 && bp < &buf[1024])
19521 fprintf(stdout, "%s", buf);
19529 fflushNULL="$define"
19531 if eval $compile; then
19533 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
19534 if cmp tryp.c tryp.out >/dev/null 2>&1; then
19536 fflush(NULL) seems to behave okay with input streams.
19538 fflushNULL="$define"
19541 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
19543 fflushNULL="$undef"
19546 $rm -f core tryp.c tryp.core core.tryp.*
19549 Your fflush(NULL) isn't working (contrary to ANSI C).
19551 fflushNULL="$undef"
19554 Cannot figure out whether your fflush(NULL) works or not.
19555 I'm assuming it doesn't (contrary to ANSI C).
19557 fflushNULL="$undef"
19561 $define|true|[yY]*)
19562 fflushNULL="$define"
19565 fflushNULL="$undef"
19568 : check explicit looping only if NULL did not work, and if the pipe
19569 : bug does not show up on an explicit flush too
19570 case "$fflushNULL" in
19572 $cat >tryp.c <<EOCP
19575 main(int argc, char **argv)
19581 while ((i = getc(stdin)) != -1
19582 && (*bp++ = i) != '\n'
19583 && bp < &buf[1024])
19586 fprintf(stdout, "%s", buf);
19595 if eval $compile; then
19597 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
19598 if cmp tryp.c tryp.out >/dev/null 2>&1; then
19600 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
19602 : now check for fflushall behaviour
19603 case "$fflushall" in
19604 '') set try -DTRY_FFLUSH_ALL $output
19605 if eval $compile; then
19607 (Now testing the other method--but note that this also may fail.)
19609 $run ./try 2>/dev/null
19612 if $test -s try.out -a "X$code" = X42; then
19613 fflushall="`$cat try.out`"
19617 case "$fflushall" in
19619 Whew. Flushing explicitly all the stdio streams works.
19621 fflushall="$define"
19624 Sigh. Flushing explicitly all the stdio streams doesn't work.
19629 Cannot figure out whether flushing stdio streams explicitly works or not.
19630 I'm assuming it doesn't.
19636 "$define"|true|[yY]*)
19637 fflushall="$define"
19645 All is futile. Even fflush(stdin) clobbers input pipes!
19652 $rm -f core tryp.c tryp.core core.tryp.*
19654 *) fflushall="$undef"
19658 case "$fflushNULL$fflushall" in
19661 OK, I give up. I cannot figure out how to flush pending stdio output.
19662 We won't be flushing handles at all before fork/exec/popen.
19668 : Store the full pathname to the ar program for use in the C program
19669 : Respect a hint or command line value for full_ar.
19674 : Store the full pathname to the sed program for use in the C program
19677 : see what type gids are declared as in the kernel
19679 echo "Looking for the type for group ids returned by getgid()."
19680 set gid_t gidtype xxx stdio.h sys/types.h
19684 xxx=`./findhdr sys/user.h`
19685 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
19687 unsigned) dflt="$1 $2" ;;
19691 *) dflt="$gidtype";;
19694 gid_t) echo "gid_t found." ;;
19695 *) rp="What is the type for group ids returned by getgid()?"
19701 : Check the size of GID
19704 *_t) zzz="$gidtype" ;;
19707 echo "Checking the size of $zzz..." >&4
19709 #include <sys/types.h>
19711 #$i_stdlib I_STDLIB
19713 #include <stdlib.h>
19716 printf("%d\n", (int)sizeof($gidtype));
19721 if eval $compile_ok; then
19725 echo "(I can't execute the test program--guessing $gidsize.)" >&4
19728 echo "Your $zzz is $gidsize bytes long."
19733 echo "(I can't compile the test program--guessing $gidsize.)" >&4
19737 : Check if GID is signed
19740 *_t) zzz="$gidtype" ;;
19743 echo "Checking the sign of $zzz..." >&4
19745 #include <sys/types.h>
19756 if eval $compile; then
19760 echo "(I can't execute the test program--guessing unsigned.)" >&4
19764 1) echo "Your $zzz is unsigned." ;;
19765 -1) echo "Your $zzz is signed." ;;
19771 echo "(I can't compile the test program--guessing unsigned.)" >&4
19775 : Check 64bit sizes
19778 if $test X"$quadtype" != X; then
19780 echo "Checking how to print 64-bit integers..." >&4
19782 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
19783 $cat >try.c <<'EOCP'
19784 #include <sys/types.h>
19787 int q = 12345678901;
19788 printf("%ld\n", q);
19792 if eval $compile; then
19796 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
19797 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
19798 echo "We will use %d."
19804 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
19805 $cat >try.c <<'EOCP'
19806 #include <sys/types.h>
19809 long q = 12345678901;
19810 printf("%ld\n", q);
19814 if eval $compile; then
19818 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
19819 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
19820 echo "We will use %ld."
19826 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
19827 $cat >try.c <<'EOCP'
19828 #include <sys/types.h>
19829 #include <inttypes.h>
19832 int64_t q = 12345678901;
19833 printf("%" PRId64 "\n", q);
19837 if eval $compile; then
19841 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
19842 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
19843 echo "We will use the C9X style."
19849 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
19851 #include <sys/types.h>
19854 $quadtype q = 12345678901;
19855 printf("%Ld\n", q);
19859 if eval $compile; then
19863 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
19864 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
19865 echo "We will use %Ld."
19871 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
19872 $cat >try.c <<'EOCP'
19873 #include <sys/types.h>
19876 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
19877 printf("%lld\n", q);
19881 if eval $compile; then
19885 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
19886 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
19887 echo "We will use the %lld style."
19893 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
19895 #include <sys/types.h>
19898 $quadtype q = 12345678901;
19899 printf("%qd\n", q);
19903 if eval $compile; then
19907 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
19908 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
19909 echo "We will use %qd."
19915 if $test X"$sPRId64" = X; then
19916 echo "Cannot figure out how to print 64-bit integers." >&4
19923 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
19924 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
19926 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
19927 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
19931 : Check format strings for internal types
19933 $echo "Checking the format strings to be used for Perl's internal types..." >&4
19935 if $test X"$ivsize" = X8; then
19936 ivdformat="$sPRId64"
19937 uvuformat="$sPRIu64"
19938 uvoformat="$sPRIo64"
19939 uvxformat="$sPRIx64"
19940 uvXUformat="$sPRIXU64"
19942 if $test X"$ivsize" = X"$longsize"; then
19949 if $test X"$ivsize" = X"$intsize"; then
19957 if $test X"$ivsize" = X"$shortsize"; then
19968 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
19969 nveformat="$sPRIeldbl"
19970 nvfformat="$sPRIfldbl"
19971 nvgformat="$sPRIgldbl"
19972 nvEUformat="$sPRIEUldbl"
19973 nvFUformat="$sPRIFUldbl"
19974 nvGUformat="$sPRIGUldbl"
19984 case "$ivdformat" in
19985 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
19990 : Check format string for GID
19993 $echo "Checking the format string to be used for gids..." >&4
19996 -1) if $test X"$gidsize" = X"$ivsize"; then
19997 gidformat="$ivdformat"
19999 if $test X"$gidsize" = X"$longsize"; then
20002 if $test X"$gidsize" = X"$intsize"; then
20005 if $test X"$gidsize" = X"$shortsize"; then
20012 *) if $test X"$gidsize" = X"$uvsize"; then
20013 gidformat="$uvuformat"
20015 if $test X"$gidsize" = X"$longsize"; then
20018 if $test X"$gidsize" = X"$intsize"; then
20021 if $test X"$gidsize" = X"$shortsize"; then
20030 : see if getgroups exists
20031 set getgroups d_getgrps
20034 : see if setgroups exists
20035 set setgroups d_setgrps
20038 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
20040 case "$d_getgrps$d_setgrps" in
20042 case "$groupstype" in
20043 '') dflt="$gidtype" ;;
20044 *) dflt="$groupstype" ;;
20047 What type of pointer is the second argument to getgroups() and setgroups()?
20048 Usually this is the same as group ids, $gidtype, but not always.
20051 rp='What type pointer is the second argument to getgroups() and setgroups()?'
20055 *) groupstype="$gidtype";;
20058 : MAD = Misc Attribute Definition
20060 if $test $patchlevel -lt 9; then
20061 : MAD is not available in 5.8.x or earlier.
20065 $define|true|[yY]*) dflt='y' ;;
20070 Would you like to build with Misc Attribute Decoration? This is development
20071 work leading to a Perl 5 to Perl 6 convertor, which imposes a space and speed
20072 overhead on the interpreter.
20074 If this doesn't make any sense to you, just accept the default '$dflt'.
20076 rp='Build Perl with MAD?'
20081 madlyh='madly.h madly.act madly.tab'
20083 madlyobj="madly$_o" ;;
20092 : check whether make sets MAKE
20094 echo "Checking if your $make program sets \$(MAKE)..." >&4
20095 case "$make_set_make" in
20097 $sed 's/^X //' > testmake.mak << 'EOF'
20099 X @echo 'maketemp="$(MAKE)"'
20101 case "`$make -f testmake.mak 2>/dev/null`" in
20102 *maketemp=*) make_set_make='#' ;;
20103 *) make_set_make="MAKE=$make" ;;
20105 $rm -f testmake.mak
20108 case "$make_set_make" in
20109 '#') echo "Yup, it does.";;
20110 *) echo "Nope, it doesn't.";;
20113 : see what type is used for mode_t
20114 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
20115 set mode_t modetype int stdio.h sys/types.h
20118 : see if we need va_copy
20120 case "$i_stdarg" in
20123 #include <stdarg.h>
20125 #$i_stdlib I_STDLIB
20127 #include <stdlib.h>
20129 #include <signal.h>
20132 ivfprintf(FILE *f, const char *fmt, va_list *valp)
20134 return vfprintf(f, fmt, *valp);
20138 myvfprintf(FILE *f, const char *fmt, va_list val)
20140 return ivfprintf(f, fmt, &val);
20144 myprintf(char *fmt, ...)
20147 va_start(val, fmt);
20148 return myvfprintf(stdout, fmt, val);
20152 main(int ac, char **av)
20154 signal(SIGSEGV, exit);
20156 myprintf("%s%cs all right, then\n", "that", '\'');
20161 if eval $compile && $run ./try 2>&1 >/dev/null; then
20162 case "`$run ./try`" in
20163 "that's all right, then")
20169 yes) echo "It seems that you don't need va_copy()." >&4
20170 need_va_copy="$undef"
20172 *) echo "It seems that va_copy() or similar will be needed." >&4
20173 need_va_copy="$define"
20178 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
20182 : see what type is used for size_t
20183 rp="What is the type used for the length parameter for string functions?"
20184 set size_t sizetype 'unsigned int' stdio.h sys/types.h
20187 : check for type of arguments to gethostbyaddr.
20188 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
20189 case "$d_gethbyaddr" in
20193 Checking to see what type of arguments are accepted by gethostbyaddr().
20195 hdrs="$define sys/types.h
20196 $d_socket sys/socket.h
20197 $i_niin netinet/in.h
20199 $i_unistd unistd.h"
20200 : The first arg can 'char *' or 'void *'
20201 : The second arg is some of integral type
20202 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
20203 for yyy in size_t long int; do
20204 case "$netdb_host_type" in
20205 '') try="$extern_C struct hostent *gethostbyaddr($xxx, $yyy, int);"
20206 if ./protochk "$try" $hdrs; then
20207 echo "Your system accepts $xxx for the first arg."
20208 echo "...and $yyy for the second arg."
20209 netdb_host_type="$xxx"
20210 netdb_hlen_type="$yyy"
20216 : In case none of those worked, prompt the user.
20217 case "$netdb_host_type" in
20218 '') rp='What is the type for the 1st argument to gethostbyaddr?'
20221 netdb_host_type=$ans
20222 rp='What is the type for the 2nd argument to gethostbyaddr?'
20225 netdb_hlen_type=$ans
20229 *) : no gethostbyaddr, so pick harmless defaults
20230 netdb_host_type='char *'
20231 netdb_hlen_type="$sizetype"
20234 # Remove the "const" if needed. -- but then we'll have a
20236 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
20239 : check for type of argument to gethostbyname.
20240 if test "X$netdb_name_type" = X ; then
20241 case "$d_gethbyname" in
20245 Checking to see what type of argument is accepted by gethostbyname().
20247 hdrs="$define sys/types.h
20248 $d_socket sys/socket.h
20249 $i_niin netinet/in.h
20251 $i_unistd unistd.h"
20252 for xxx in "const char *" "char *"; do
20253 case "$netdb_name_type" in
20254 '') try="$extern_C struct hostent *gethostbyname($xxx);"
20255 if ./protochk "$try" $hdrs; then
20256 echo "Your system accepts $xxx."
20257 netdb_name_type="$xxx"
20262 : In case none of those worked, prompt the user.
20263 case "$netdb_name_type" in
20264 '') rp='What is the type for the 1st argument to gethostbyname?'
20267 netdb_name_type=$ans
20271 *) : no gethostbyname, so pick harmless default
20272 netdb_name_type='char *'
20277 : check for type of 1st argument to getnetbyaddr.
20278 if test "X$netdb_net_type" = X ; then
20279 case "$d_getnbyaddr" in
20283 Checking to see what type of 1st argument is accepted by getnetbyaddr().
20285 hdrs="$define sys/types.h
20286 $d_socket sys/socket.h
20287 $i_niin netinet/in.h
20289 $i_unistd unistd.h"
20290 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
20291 case "$netdb_net_type" in
20292 '') try="$extern_C struct netent *getnetbyaddr($xxx, int);"
20293 if ./protochk "$try" $hdrs; then
20294 echo "Your system accepts $xxx."
20295 netdb_net_type="$xxx"
20300 : In case none of those worked, prompt the user.
20301 case "$netdb_net_type" in
20302 '') rp='What is the type for the 1st argument to getnetbyaddr?'
20305 netdb_net_type=$ans
20309 *) : no getnetbyaddr, so pick harmless default
20310 netdb_net_type='long'
20314 : locate the preferred pager for this system
20321 [a-zA-Z]:/*) dflt=$pg;;
20325 [a-zA-Z]:/*) dflt=$more;;
20329 [a-zA-Z]:/*) dflt=$less;;
20332 '') dflt=/usr/ucb/more;;
20340 rp='What pager is used on your system?'
20344 : see what type pids are declared as in the kernel
20345 rp="What is the type of process ids on this system?"
20346 set pid_t pidtype int stdio.h sys/types.h
20349 : see if ar generates random libraries by itself
20351 echo "Checking how to generate random libraries on your machine..." >&4
20352 echo 'int bar1() { return bar2(); }' > bar1.c
20353 echo 'int bar2() { return 2; }' > bar2.c
20355 #$i_stdlib I_STDLIB
20357 #include <stdlib.h>
20359 int main() { printf("%d\n", bar1()); exit(0); }
20361 $cc $ccflags -c bar1.c >/dev/null 2>&1
20362 $cc $ccflags -c bar2.c >/dev/null 2>&1
20363 $cc $ccflags -c foo.c >/dev/null 2>&1
20364 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
20365 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20366 $run ./foobar >/dev/null 2>&1; then
20367 echo "$ar appears to generate random libraries itself."
20369 if [ "X$ranlib" = "X" ]; then
20372 elif $ar s bar$_a >/dev/null 2>&1 &&
20373 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20374 $run ./foobar >/dev/null 2>&1; then
20375 echo "a table of contents needs to be added with '$ar s'."
20378 elif $ar ts bar$_a >/dev/null 2>&1 &&
20379 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20380 $run ./foobar >/dev/null 2>&1; then
20381 echo "a table of contents needs to be added with '$ar ts'."
20388 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
20389 $test -f $ranlib || ranlib=''
20392 if $test -n "$ranlib"; then
20393 echo "your system has '$ranlib'; we'll use that."
20396 echo "your system doesn't seem to support random libraries"
20397 echo "so we'll use lorder and tsort to order the libraries."
20404 : see if this is a values.h system
20405 set values.h i_values
20408 : Check the max offset that gmtime and localtime accept
20409 echo "Checking max offsets that gmtime () accepts"
20412 define) yyy="#include <values.h>" ;;
20416 case "$sGMTIME_min/$sGMTIME_max" in
20419 #include <sys/types.h>
20428 void gm_check (time_t t, int min_year, int max_year)
20431 if ( tmp == NULL ||
20432 /* Check tm_year overflow */
20433 tmp->tm_year < min_year || tmp->tm_year > max_year)
20444 gm_check (MAXLONG, 69, 0x7fffffff);
20446 if (tmp == NULL || tmp->tm_year < 0) {
20447 for (i = 63; i >= 0; i--) {
20448 time_t x = pt | ((time_t)1 << i);
20449 if (x < 0 || x < pt) continue;
20450 gm_check (x, 69, 0x7fffffff);
20453 printf ("sGMTIME_max=%ld\n", pt);
20462 gm_check (MINLONG, -1900, 70);
20465 for (i = 36; i >= 0; i--) {
20466 time_t x = pt - ((time_t)1 << i);
20467 if (x > 0) continue;
20468 gm_check (x, -1900, 70);
20471 printf ("sGMTIME_min=%ld\n", pt);
20475 int main (int argc, char *argv[])
20477 fprintf (stderr, "Sizeof time_t = %ld\n", sizeof (time_t));
20484 if eval $compile; then
20487 echo "Cannot determine sGMTIME_max and sGMTIME_min." >&4
20493 echo "Checking max offsets that localtime () accepts"
20495 case "$sLOCALTIME_min/$sLOCALTIME_max" in
20498 #include <sys/types.h>
20507 void local_check (time_t t, int min_year, int max_year)
20509 if (sizeof (time_t) > 4 && t > 0x7ffffffffffff000LL)
20512 tmp = localtime (&t);
20513 if ( tmp == NULL ||
20514 /* Check tm_year overflow */
20515 tmp->tm_year < min_year || tmp->tm_year > max_year)
20519 } /* local_check */
20526 local_check (MAXLONG, 69, 0x7fffffff);
20528 if (tmp == NULL || tmp->tm_year < 0) {
20529 for (i = 63; i >= 0; i--) {
20530 time_t x = pt | ((time_t)1 << i);
20531 if (x < 0 || x < pt) continue;
20532 local_check (x, 69, 0x7fffffff);
20535 printf ("sLOCALTIME_max=%ld\n", pt);
20544 local_check (MINLONG, -1900, 70);
20547 for (i = 36; i >= 0; i--) {
20548 time_t x = pt - ((time_t)1 << i);
20549 if (x > 0) continue;
20550 local_check (x, -1900, 70);
20553 printf ("sLOCALTIME_min=%ld\n", pt);
20557 int main (int argc, char *argv[])
20565 if eval $compile; then
20568 echo "Cannot determine sLOCALTIME_max and sLOCALTIME_min." >&4
20574 : check for type of arguments to select.
20575 case "$selecttype" in
20576 '') case "$d_select" in
20580 Checking to see what type of arguments are accepted by select().
20582 hdrs="$define sys/types.h
20583 $i_systime sys/time.h
20584 $i_sysselct sys/select.h
20585 $d_socket sys/socket.h"
20586 : The first arg can be int, unsigned, or size_t
20587 : The last arg may or may not be 'const'
20589 : void pointer has been seen but using that
20590 : breaks the selectminbits test
20591 for xxx in 'fd_set *' 'int *'; do
20592 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
20593 for tmo in 'struct timeval *' 'const struct timeval *'; do
20595 '') try="$extern_C select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
20596 if ./protochk "$try" $hdrs; then
20597 echo "Your system accepts $xxx."
20606 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
20607 case "$d_fd_set" in
20608 $define) dflt="fd_set *" ;;
20617 *) : no select, so pick a harmless default
20624 : check for the select 'width'
20625 case "$selectminbits" in
20626 '') safebits=`expr $ptrsize \* 8`
20627 case "$d_select" in
20631 Checking to see on how many bits at a time your select() operates...
20634 #include <sys/types.h>
20636 #$i_systime I_SYS_TIME
20637 #$i_systimek I_SYS_TIME_KERNEL
20642 # ifdef I_SYS_TIME_KERNEL
20645 # include <sys/time.h>
20646 # ifdef I_SYS_TIME_KERNEL
20650 #$i_sysselct I_SYS_SELECT
20651 #ifdef I_SYS_SELECT
20652 #include <sys/select.h>
20654 #$d_socket HAS_SOCKET
20656 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
20659 #$i_stdlib I_STDLIB
20661 #include <stdlib.h>
20664 #define S sizeof(*(b))
20666 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
20667 #define NBITS (NBYTES * 8)
20669 char *s = (char *)malloc(NBYTES);
20678 fp = fopen("try.c", "r");
20684 b = ($selecttype)s;
20685 for (i = 0; i < NBITS; i++)
20689 select(fd + 1, b, 0, 0, &t);
20690 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
20692 printf("%d\n", i + 1);
20697 if eval $compile_ok; then
20698 selectminbits=`$run ./try`
20699 case "$selectminbits" in
20701 Cannot figure out on how many bits at a time your select() operates.
20702 I'll play safe and guess it is $safebits bits.
20704 selectminbits=$safebits
20705 bits="$safebits bits"
20708 *) bits="$selectminbits bits" ;;
20710 echo "Your select() operates on $bits at a time." >&4
20712 rp='What is the minimum number of bits your select() operates on?'
20713 case "$byteorder" in
20714 12345678) dflt=64 ;;
20720 selectminbits="$val"
20724 *) : no select, so pick a harmless default
20725 selectminbits=$safebits
20731 : Trace out the files included by signal.h, then look for SIGxxx names.
20732 if [ "X$fieldn" = X ]; then
20733 : Just make some guesses. We check them later.
20734 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
20736 xxx=`echo '#include <signal.h>' |
20737 $cppstdin $cppminus $cppflags 2>/dev/null |
20738 $grep '^[ ]*#.*include' |
20739 $awk "{print \\$$fieldn}" | $sed 's!"!!g' |\
20740 $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
20743 for xx in $xxx /dev/null ; do
20744 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
20746 case "$xxxfiles" in
20747 '') xxxfiles=`./findhdr signal.h` ;;
20750 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
20751 print substr($2, 4, 20)
20753 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
20754 print substr($3, 4, 20)
20756 : Append some common names just in case the awk scan failed.
20757 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
20758 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
20759 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
20760 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
20761 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
20763 : generate a few handy files for later
20764 $cat > signal.c <<EOCP
20765 #include <sys/types.h>
20766 #include <signal.h>
20767 #$i_stdlib I_STDLIB
20769 #include <stdlib.h>
20774 /* Strange style to avoid deeply-nested #if/#else/#endif */
20777 # define NSIG (_NSIG)
20783 # define NSIG (SIGMAX+1)
20789 # define NSIG (SIG_MAX+1)
20795 # define NSIG (_SIG_MAX+1)
20801 # define NSIG (MAXSIG+1)
20807 # define NSIG (MAX_SIG+1)
20812 # ifdef SIGARRAYSIZE
20813 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
20819 # define NSIG (_sys_nsig) /* Solaris 2.5 */
20823 /* Default to some arbitrary number that's big enough to get most
20824 of the common signals.
20830 printf("NSIG %d\n", NSIG);
20836 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
20838 printf "#ifdef SIG"; printf $1; printf "\n"
20839 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
20840 printf $1; printf ");\n"
20844 printf "#endif /* JUST_NSIG */\n";
20845 printf "exit(0);\n}\n";
20848 $cat >signal.awk <<'EOP'
20849 BEGIN { ndups = 0 }
20850 $1 ~ /^NSIG$/ { nsig = $2 }
20851 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
20852 if ($2 > maxsig) { maxsig = $2 }
20853 if (sig_name[$2]) {
20854 dup_name[ndups] = $1
20855 dup_num[ndups] = $2
20867 printf("NSIG %d\n", nsig);
20868 for (n = 1; n < nsig; n++) {
20870 printf("%s %d\n", sig_name[n], sig_num[n])
20873 printf("NUM%d %d\n", n, n)
20876 for (n = 0; n < ndups; n++) {
20877 printf("%s %d\n", dup_name[n], dup_num[n])
20881 $cat >signal_cmd <<EOS
20883 if $test -s signal.lst; then
20884 echo "Using your existing signal.lst file"
20889 $cat >>signal_cmd <<'EOS'
20892 if eval $compile_ok; then
20893 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) |\
20894 $uniq | $awk -f signal.awk >signal.lst
20896 echo "(I can't seem be able to compile the whole test program)" >&4
20897 echo "(I'll try it in little pieces.)" >&4
20898 set signal -DJUST_NSIG
20899 if eval $compile_ok; then
20900 $run ./signal$_exe > signal.nsg
20903 echo "I can't seem to figure out how many signals you have." >&4
20904 echo "Guessing 50." >&4
20905 echo 'NSIG 50' > signal.nsg
20907 : Now look at all the signal names, one at a time.
20908 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
20909 $cat > signal.c <<EOCP
20910 #include <sys/types.h>
20911 #include <signal.h>
20914 printf("$xx %d\n", SIG${xx});
20919 if eval $compile; then
20920 echo "SIG${xx} found."
20921 $run ./signal$_exe >> signal.ls1
20923 echo "SIG${xx} NOT found."
20926 if $test -s signal.ls1; then
20927 $cat signal.nsg signal.ls1 |
20928 $sort -n | $uniq | $awk -f signal.awk >signal.lst
20932 if $test -s signal.lst; then
20935 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
20936 echo 'kill -l' >signal
20937 set X `csh -f <signal`
20941 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
20943 echo $@ | $tr ' ' $trnl | \
20944 $awk '{ printf "%s %d\n", $1, ++s; }
20945 END { printf "NSIG %d\n", ++s }' >signal.lst
20947 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
20949 chmod a+x signal_cmd
20950 $eunicefix signal_cmd
20952 : generate list of signal names
20954 case "$sig_name_init" in
20956 *) case "$sig_num_init" in
20957 ''|*,*) doinit=yes ;;
20962 echo "Generating a list of signal names and numbers..." >&4
20964 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
20965 sig_name=`$awk 'BEGIN { printf "ZERO " }
20966 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
20967 sig_num=`$awk 'BEGIN { printf "0 " }
20968 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
20969 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
20970 !/^NSIG/ { printf "\"%s\", ", $1 }
20971 END { printf "0\n" }' signal.lst`
20972 sig_num_init=`$awk 'BEGIN { printf "0, " }
20973 !/^NSIG/ { printf "%d, ", $2}
20974 END { printf "0\n"}' signal.lst`
20977 echo "The following $sig_count signals are available:"
20979 echo $sig_name | $awk \
20980 'BEGIN { linelen = 0 }
20982 for (i = 1; i <= NF; i++) {
20983 name = "SIG" $i " "
20984 linelen = linelen + length(name)
20985 if (linelen > 70) {
20987 linelen = length(name)
20993 sig_size=`echo $sig_name | awk '{print NF}'`
20994 $rm -f signal signal.c signal.awk signal.lst signal_cmd
20996 : Check size of size
20998 case "$sizetype" in
20999 *_t) zzz="$sizetype" ;;
21000 *) zzz="filesize" ;;
21002 echo "Checking the size of $zzz..." >&4
21004 #include <sys/types.h>
21006 #$i_stdlib I_STDLIB
21008 #include <stdlib.h>
21011 printf("%d\n", (int)sizeof($sizetype));
21016 if eval $compile_ok; then
21020 echo "(I can't execute the test program--guessing $sizesize.)" >&4
21023 echo "Your $zzz size is $sizesize bytes."
21028 echo "(I can't compile the test program--guessing $sizesize.)" >&4
21032 : check for socklen_t
21034 echo "Checking to see if you have socklen_t..." >&4
21036 #include <sys/types.h>
21037 #$d_socket HAS_SOCKET
21039 #include <sys/socket.h>
21041 int main() { socklen_t x = 16; }
21044 if eval $compile; then
21046 echo "You have socklen_t."
21049 echo "You do not have socklen_t."
21050 case "$sizetype" in
21051 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
21058 : see if this is a socks.h system
21059 set socks.h i_socks
21062 : check for type of the size argument to socket calls
21063 case "$d_socket" in
21067 Checking to see what type is the last argument of accept().
21070 case "$d_socklen_t" in
21071 "$define") yyy="$yyy socklen_t"
21073 yyy="$yyy $sizetype int long unsigned"
21074 for xxx in $yyy; do
21075 case "$socksizetype" in
21076 '') try="$extern_C int accept(int, struct sockaddr *, $xxx *);"
21077 case "$usesocks" in
21079 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
21080 echo "Your system accepts '$xxx *' for the last argument of accept()."
21081 socksizetype="$xxx"
21084 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
21085 echo "Your system accepts '$xxx *' for the last argument of accept()."
21086 socksizetype="$xxx"
21093 : In case none of those worked, prompt the user.
21094 case "$socksizetype" in
21095 '') rp='What is the type for socket address structure sizes?'
21102 *) : no sockets, so pick relatively harmless default
21107 : see what type is used for signed size_t
21108 set ssize_t ssizetype int stdio.h sys/types.h
21113 #$i_stdlib I_STDLIB
21115 #include <stdlib.h>
21117 #include <sys/types.h>
21118 #define Size_t $sizetype
21119 #define SSize_t $dflt
21122 if (sizeof(Size_t) == sizeof(SSize_t))
21124 else if (sizeof(Size_t) == sizeof(int))
21133 if eval $compile_ok && $run ./try > /dev/null; then
21134 ssizetype=`$run ./try`
21135 echo "I'll be using $ssizetype for functions returning a byte count." >&4
21138 Help! I can't compile and run the ssize_t test program: please enlighten me!
21139 (This is probably a misconfiguration in your system or libraries, and
21140 you really ought to fix it. Still, I'll try anyway.)
21142 I need a type that is the same size as $sizetype, but is guaranteed to
21143 be signed. Common values are ssize_t, int and long.
21146 rp="What signed type is the same size as $sizetype?"
21152 : Check the size of st_ino
21154 $echo "Checking the size of st_ino..." >&4
21155 $cat > try.c <<EOCP
21156 #include <sys/stat.h>
21158 #$i_stdlib I_STDLIB
21160 #include <stdlib.h>
21164 printf("%d\n", (int)sizeof(st.st_ino));
21169 if eval $compile_ok; then
21173 $echo "(I can't execute the test program--guessing $st_ino_size.)" >&4
21175 *) st_ino_size=$val
21176 $echo "Your st_ino is $st_ino_size bytes long."
21181 $echo "(I can't compile the test program--guessing $st_ino_size.)" >&4
21185 : Check if st_ino is signed
21187 $echo "Checking the sign of st_ino..." >&4
21188 $cat > try.c <<EOCP
21189 #include <sys/stat.h>
21194 if (foo.st_ino < 0)
21201 if eval $compile; then
21205 $echo "(I can't execute the test program--guessing unsigned.)" >&4
21207 *) st_ino_sign=$val
21208 case "$st_ino_sign" in
21209 1) $echo "Your st_ino is unsigned." ;;
21210 -1) $echo "Your st_ino is signed." ;;
21216 $echo "(I can't compile the test program--guessing unsigned.)" >&4
21220 : see what type of char stdio uses.
21222 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
21223 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
21224 echo "Your stdio uses unsigned chars." >&4
21225 stdchar="unsigned char"
21227 echo "Your stdio uses signed chars." >&4
21232 : see what type uids are declared as in the kernel
21234 echo "Looking for the type for user ids returned by getuid()."
21235 set uid_t uidtype xxx stdio.h sys/types.h
21239 xxx=`./findhdr sys/user.h`
21240 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
21242 unsigned) dflt="$1 $2" ;;
21246 *) dflt="$uidtype";;
21249 uid_t) echo "uid_t found." ;;
21250 *) rp="What is the type for user ids returned by getuid()?"
21256 : Check size of UID
21259 *_t) zzz="$uidtype" ;;
21262 echo "Checking the size of $zzz..." >&4
21264 #include <sys/types.h>
21266 #$i_stdlib I_STDLIB
21268 #include <stdlib.h>
21271 printf("%d\n", (int)sizeof($uidtype));
21276 if eval $compile_ok; then
21280 echo "(I can't execute the test program--guessing $uidsize.)" >&4
21283 echo "Your $zzz is $uidsize bytes long."
21288 echo "(I can't compile the test program--guessing $uidsize.)" >&4
21291 : Check if UID is signed
21294 *_t) zzz="$uidtype" ;;
21297 echo "Checking the sign of $zzz..." >&4
21299 #include <sys/types.h>
21310 if eval $compile; then
21314 echo "(I can't execute the test program--guessing unsigned.)" >&4
21318 1) echo "Your $zzz is unsigned." ;;
21319 -1) echo "Your $zzz is signed." ;;
21325 echo "(I can't compile the test program--guessing unsigned.)" >&4
21329 : Check format string for UID
21331 $echo "Checking the format string to be used for uids..." >&4
21334 -1) if $test X"$uidsize" = X"$ivsize"; then
21335 uidformat="$ivdformat"
21337 if $test X"$uidsize" = X"$longsize"; then
21340 if $test X"$uidsize" = X"$intsize"; then
21343 if $test X"$uidsize" = X"$shortsize"; then
21350 *) if $test X"$uidsize" = X"$uvsize"; then
21351 uidformat="$uvuformat"
21353 if $test X"$uidsize" = X"$longsize"; then
21356 if $test X"$uidsize" = X"$intsize"; then
21359 if $test X"$uidsize" = X"$shortsize"; then
21368 : Determine if we can use sysctl with KERN_PROC_PATHNAME to find executing program
21370 echo "Determining whether we can use sysctl with KERN_PROC_PATHNAME to find executing program..." >&4
21371 $cat >try.c <<'EOM'
21372 /* Intentionally a long probe as I'd like to sanity check that the exact
21373 approach is going to work, as thinking it will work, but only having it
21374 part working at runtime is worse than not having it. */
21376 #include <sys/types.h>
21377 #include <sys/sysctl.h>
21378 #include <sys/param.h>
21380 #include <string.h>
21381 #include <stdlib.h>
21382 #include <unistd.h>
21385 main(int argc, char **argv) {
21387 char *argv_leaf = strrchr(argv[0], '/');
21393 mib[1] = KERN_PROC;
21394 mib[2] = KERN_PROC_PATHNAME;
21398 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
21402 if (sysctl(mib, 4, NULL, &size, NULL, 0)) {
21407 if (size < strlen(argv_leaf) + 1) {
21408 fprintf(stderr, "size %lu is too short for a path\n",
21409 (unsigned long) size);
21413 if (size > MAXPATHLEN * MAXPATHLEN) {
21414 fprintf(stderr, "size %lu is too long for a path\n",
21415 (unsigned long) size);
21419 buffer = malloc(size);
21425 if (sysctl(mib, 4, buffer, &size, NULL, 0)) {
21430 if (strlen(buffer) + 1 != size) {
21431 fprintf(stderr, "size != strlen(buffer) + 1 (%lu != %lu)\n",
21432 (unsigned long)size, (unsigned long)strlen(buffer) + 1);
21437 if (*buffer != '/') {
21438 fprintf(stderr, "Not an absolute path: '%s'\n", buffer);
21442 if (strstr(buffer, "/./")) {
21443 fprintf(stderr, "Contains /./: '%s'\n", buffer);
21447 if (strstr(buffer, "/../")) {
21448 fprintf(stderr, "Contains /../: '%s'\n", buffer);
21452 buffer_leaf = strrchr(buffer, '/');
21453 if (strcmp(buffer_leaf, argv_leaf) != 0) {
21454 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], buffer);
21466 if eval $compile_ok; then
21467 if $run ./try; then
21468 echo "You can use sysctl with KERN_PROC_PATHNAME to find the executing program." >&4
21471 echo "Nope, sysctl with KERN_PROC_PATHNAME doesn't work here." >&4
21475 echo "I'm unable to compile the test program." >&4
21476 echo "I'll assume no sysctl with KERN_PROC_PATHNAME here." >&4
21480 set usekernprocpathname
21483 : Determine if we can use _NSGetExecutablePath to find executing program
21485 echo "Determining whether we can use _NSGetExecutablePath to find executing program..." >&4
21486 $cat >try.c <<'EOM'
21487 /* Intentionally a long probe as I'd like to sanity check that the exact
21488 approach is going to work, as thinking it will work, but only having it
21489 part working at runtime is worse than not having it. */
21490 #include <mach-o/dyld.h>
21492 #include <stdlib.h>
21493 #include <sys/param.h>
21494 #include <string.h>
21497 main(int argc, char **argv) {
21499 uint32_t size = sizeof(buf);
21503 char *argv_leaf = strrchr(argv[0], '/');
21507 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
21511 _NSGetExecutablePath(buf, &size);
21512 if (size > MAXPATHLEN * MAXPATHLEN) {
21513 fprintf(stderr, "_NSGetExecutablePath size %u is too long for a path\n",
21514 (unsigned int) size);
21518 buffer = malloc(size);
21524 result = _NSGetExecutablePath(buffer, &size);
21526 fprintf(stderr, "_NSGetExecutablePath returned %i for a size of %u\n",
21527 result, (unsigned int) size);
21531 tidied = realpath(buffer, NULL);
21533 perror("realpath");
21539 if (*tidied != '/') {
21540 fprintf(stderr, "Not an absolute path: '%s'\n", tidied);
21544 if (strstr(tidied, "/./")) {
21545 fprintf(stderr, "Contains /./: '%s'\n", tidied);
21549 if (strstr(tidied, "/../")) {
21550 fprintf(stderr, "Contains /../: '%s'\n", tidied);
21554 tidied_leaf = strrchr(tidied, '/');
21555 if (strcmp(tidied_leaf, argv_leaf) != 0) {
21556 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], tidied);
21568 if eval $compile_ok; then
21569 if $run ./try; then
21570 echo "You can use _NSGetExecutablePath to find the executing program." >&4
21573 echo "Nope, _NSGetExecutablePath doesn't work here." >&4
21576 echo "I'm unable to compile the test program." >&4
21577 echo "I'll assume no _NSGetExecutablePath here." >&4
21580 set usensgetexecutablepath
21583 : Check if site customization support was requested
21584 case "$usesitecustomize" in
21585 $define|true|[Yy]*)
21586 usesitecustomize="$define"
21589 usesitecustomize="$undef"
21593 : see if prototypes support variable argument declarations
21595 case "$prototype$i_stdarg" in
21597 echo "It appears we'll be able to prototype varargs functions." >&4
21601 echo "Too bad... We won't be using prototyped varargs functions..." >&4
21608 : determine compiler compiler
21617 if $test -f "$byacc$_exe"; then
21619 comp="byacc or $comp"
21621 if $test -f "$bison$_exe"; then
21622 comp="$comp or bison -y"
21624 rp="Which compiler compiler ($comp) shall I use?"
21633 echo "(Adding -y option to bison to get yacc-compatible behaviour.)"
21639 : see if this is a assert.h system
21640 set assert.h i_assert
21643 : see if this is a fp.h system
21647 : see if this is a fp_class.h system
21648 set fp_class.h i_fp_class
21651 : see if gdbm.h is available
21656 : see if gdbm_open exists
21657 set gdbm_open d_gdbm_open
21659 case "$d_gdbm_open" in
21662 echo "We won't be including <gdbm.h>"
21671 : see if this is a ieeefp.h system
21672 case "$i_ieeefp" in
21673 '' ) set ieeefp.h i_ieeefp
21678 : see if this is a libutil.h system
21679 set libutil.h i_libutil
21682 : see if mach cthreads are available
21683 if test "X$usethreads" = "X$define"; then
21684 set mach/cthreads.h i_machcthr
21687 i_machcthr="$undef"
21690 : see if this is a mntent.h system
21691 set mntent.h i_mntent
21694 : see if net/errno.h is available
21696 set net/errno.h val
21699 : Unfortunately, it causes problems on some systems. Arrgh.
21702 cat > try.c <<'EOM'
21705 #include <net/errno.h>
21711 if $cc $ccflags -c try.c >/dev/null 2>&1; then
21712 echo "We'll be including <net/errno.h>." >&4
21714 echo "We won't be including <net/errno.h>." >&4
21723 : see if netinet/tcp.h is available
21724 set netinet/tcp.h i_netinettcp
21727 : see if this is a poll.h system
21731 : see if this is a prot.h system
21735 : Preprocessor symbols
21737 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
21738 $cat <<'EOSH' > Cppsym.know
21739 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
21740 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
21741 alliant alpha am29000 AM29000 AMD64 amd64 amiga AMIGAOS AMIX
21742 ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
21743 BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
21744 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
21745 bull c cadmus clipper CMU COFF COMPILER_VERSION
21746 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
21747 CYGWIN DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
21748 Dynix DynixPTX ELF encore EPI EXTENSIONS FAVOR_BSD
21749 FILE_OFFSET_BITS FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
21751 GNU_SOURCE GNUC GNUC_MINOR GNU_LIBRARY GO32 gould GOULD_PN
21752 H3050R H3050RX hbullx20 hcx host_mips
21753 hp200 hp300 hp700 HP700 hp800 hp9000
21754 hp9000s200 hp9000s300 hp9000s400 hp9000s500
21755 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
21756 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
21757 IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
21758 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
21759 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
21760 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
21761 LIBCATAMOUNT Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
21762 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
21763 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
21764 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
21765 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
21766 MATH_HAS_NO_SIDE_EFFECTS
21767 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
21768 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
21769 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
21770 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
21771 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
21772 NetBSD news1500 news1700 news1800 news1900 news3700
21773 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
21774 ns32016 ns32332 ns32k nsc32000
21775 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
21776 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
21777 pc532 pdp11 PGC PIC plexus PORTAR posix
21778 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
21779 POSIX_C_SOURCE POSIX_SOURCE POWER
21780 PROTOTYPES PWB pyr QNX QK_USER R3000 REENTRANT RES Rhapsody RISC6000
21781 riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
21782 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
21783 sony sony_news sonyrisc sparc sparclite spectrum
21784 stardent stdc STDC_EXT stratos sun sun3 sun386
21785 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
21786 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
21787 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
21788 sysV68 sysV88 Tek4132 Tek4300 titan
21789 TM3200 TM5400 TM5600
21790 tower tower32 tower32_200 tower32_600 tower32_700
21791 tower32_800 tower32_850 tss
21792 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
21793 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
21794 unix UNIX95 UNIX99 unixpc unos
21795 USE_BSD USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE USE_LARGEFILE64
21796 USE_MISC USE_POSIX USE_POSIX199309 USE_POSIX199506 USE_POSIX2
21797 USE_REENTRANT USE_SVID USE_UNIX98 USE_XOPEN USE_XOPEN_EXTENDED
21799 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms x86_64 xenix Xenix286
21800 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
21801 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
21804 # Maybe put other stuff here too.
21805 cat <<EOSH >>Cppsym.know
21808 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
21809 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
21810 $cat Cppsym.know > Cppsym.c
21811 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
21812 $rm -f Cppsym.a Cppsym.b Cppsym.c
21813 cat <<EOSH > Cppsym
21815 if $test \$# -gt 0; then
21816 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
21817 if $test -s Cppsym.got; then
21824 $tr " " "$trnl" | ./Cppsym.try
21830 cat <<EOSH > Cppsym.try
21832 cat <<'EOCP' > try.c
21835 #define STRINGIFY(a) "a"
21837 #if cpp_stuff == 42
21838 #define StGiFy(a) #a
21839 #define STRINGIFY(a) StGiFy(a)
21841 #if $cpp_stuff != 1 && $cpp_stuff != 42
21842 # include "Bletch: How does this C preprocessor stringify macros?"
21848 cat <<'EOSH' >> Cppsym.try
21850 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
21851 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
21852 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
21853 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
21855 echo 'return 0;}' >> try.c
21857 cat <<EOSH >> Cppsym.try
21859 case "$osname-$gccversion" in
21860 irix-) ccflags="\$ccflags -woff 1178" ;;
21861 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
21863 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs && $run ./try | $sed 's/ /\\\\ /g'
21865 chmod +x Cppsym.try
21866 $eunicefix Cppsym.try
21867 ./Cppsym < Cppsym.know > Cppsym.true
21868 : Add in any linux cpp "predefined macros":
21869 case "$osname::$gccversion" in
21870 *linux*::*.*|*gnukfreebsd*::*.*|gnu::*.*)
21872 rm -f $tHdrH'.h' $tHdrH
21874 if $cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
21875 sed 's/#define[\ \ ]*//;s/[\ \ ].*$//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
21876 if [ -s $tHdrH'_cppsym.real' ]; then
21877 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
21880 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
21883 : now check the C compiler for additional symbols
21884 postprocess_cc_v=''
21886 aix) postprocess_cc_v="|$tr , ' '" ;;
21893 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
21896 -D*) echo "\$i" | $sed 's/^-D//';;
21897 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
21902 postprocess_cc_v=''
21905 ./ccsym > ccsym1.raw
21906 if $test -s ccsym1.raw; then
21907 $sort ccsym1.raw | $uniq >ccsym.raw
21909 mv ccsym1.raw ccsym.raw
21912 $awk '/\=/ { print $0; next }
21913 { print $0"=1" }' ccsym.raw >ccsym.list
21914 $comm -13 Cppsym.true ccsym.list >ccsym.own
21915 $comm -12 Cppsym.true ccsym.list >ccsym.com
21916 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
21918 if $test -z ccsym.raw; then
21919 echo "Your C compiler doesn't seem to define any symbols!" >&4
21921 echo "However, your C preprocessor defines the following symbols:"
21924 cppsymbols=`$cat Cppsym.true`
21925 cppsymbols=`echo $cppsymbols`
21926 cppccsymbols="$cppsymbols"
21928 if $test -s ccsym.com; then
21929 echo "Your C compiler and pre-processor define these symbols:"
21930 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
21933 cppccsymbols=`$cat ccsym.com`
21934 cppccsymbols=`echo $cppccsymbols`
21935 $test "$silent" || sleep 1
21937 if $test -s ccsym.cpp; then
21938 $test "$also" && echo " "
21939 echo "Your C pre-processor ${also}defines the following symbols:"
21940 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
21942 cppsymbols=`$cat ccsym.cpp`
21943 cppsymbols=`echo $cppsymbols`
21944 $test "$silent" || sleep 1
21946 if $test -s ccsym.own; then
21947 $test "$also" && echo " "
21948 echo "Your C compiler ${also}defines the following cpp symbols:"
21949 $sed -e 's/\(..*\)=1/\1/' ccsym.own
21950 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
21951 ccsymbols=`$cat ccsym.own`
21952 ccsymbols=`echo $ccsymbols`
21953 $test "$silent" || sleep 1
21957 : see if this is a termio system
21961 if $test `./findhdr termios.h`; then
21962 set tcsetattr i_termios
21968 "$define") echo "You have POSIX termios.h... good!" >&4;;
21969 *) if ./Cppsym pyr; then
21970 case "`/bin/universe`" in
21971 ucb) if $test `./findhdr sgtty.h`; then
21973 echo "<sgtty.h> found." >&4
21975 echo "System is pyramid with BSD universe."
21976 ./warn "<sgtty.h> not found--you could have problems."
21978 *) if $test `./findhdr termio.h`; then
21980 echo "<termio.h> found." >&4
21982 echo "System is pyramid with USG universe."
21983 ./warn "<termio.h> not found--you could have problems."
21987 if $test `./findhdr termio.h`; then
21988 echo "<termio.h> found." >&4
21990 elif $test `./findhdr sgtty.h`; then
21991 echo "<sgtty.h> found." >&4
21994 ./warn "Neither <termio.h> nor <sgtty.h> found--cross fingers!"
21997 if $test `./findhdr sgtty.h`; then
21998 echo "<sgtty.h> found." >&4
22000 elif $test `./findhdr termio.h`; then
22001 echo "<termio.h> found." >&4
22004 ./warn "Neither <sgtty.h> nor <termio.h> found--cross fingers!"
22008 set i_termio; eval $setvar
22009 val=$val2; set i_sgtty; eval $setvar
22010 val=$val3; set i_termios; eval $setvar
22012 : see if stdbool is available
22013 : we want a real compile instead of Inhdr because some Solaris systems
22014 : have stdbool.h, but it can only be used if the compiler indicates it
22015 : is sufficiently c99-compliant.
22019 #include <stdbool.h>
22024 int main(int argc, char **argv)
22030 if eval $compile; then
22031 echo "<stdbool.h> found." >&4
22034 echo "<stdbool.h> NOT found." >&4
22041 : see if stddef is available
22042 set stddef.h i_stddef
22045 : see if sys/access.h is available
22046 set sys/access.h i_sysaccess
22049 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
22050 set sys/filio.h i_sysfilio
22053 if $test `./findhdr sys/ioctl.h`; then
22055 echo '<sys/ioctl.h> found.' >&4
22058 if $test $i_sysfilio = "$define"; then
22059 echo '<sys/ioctl.h> NOT found.' >&4
22061 $test $i_sgtty = "$define" && xxx="sgtty.h"
22062 $test $i_termio = "$define" && xxx="termio.h"
22063 $test $i_termios = "$define" && xxx="termios.h"
22064 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
22070 : see if socket ioctl defs are in sys/sockio.h
22072 xxx=`./findhdr sys/sockio.h`
22073 if $test "$xxx"; then
22074 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
22076 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
22079 echo "No socket ioctls found in <sys/sockio.h>." >&4
22084 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
22090 : see if this is a syslog.h system
22091 set syslog.h i_syslog
22094 : see if this is a sys/mode.h system
22095 set sys/mode.h i_sysmode
22098 : see if there is a sys/poll.h file
22099 set sys/poll.h i_syspoll
22102 : see if sys/resource.h has to be included
22103 set sys/resource.h i_sysresrc
22106 : see if sys/security.h is available
22107 set sys/security.h i_syssecrt
22110 : see if this is a sys/statvfs.h system
22111 set sys/statvfs.h i_sysstatvfs
22114 : see if this is a sys/un.h system
22115 set sys/un.h i_sysun
22118 : see if this is a sys/utsname.h system
22119 set sys/utsname.h i_sysutsname
22122 : see if this is a syswait system
22123 set sys/wait.h i_syswait
22126 : see if this is a ustat.h system
22127 set ustat.h i_ustat
22130 : see if this is an utime system
22131 set utime.h i_utime
22134 : see if this is a vfork system
22137 set vfork.h i_vfork
22147 echo "Looking for extensions..." >&4
22148 : If we are using the old config.sh, known_extensions may contain
22149 : old or inaccurate or duplicate values.
22150 known_extensions=''
22151 nonxs_extensions=''
22152 : We do not use find because it might not be available.
22153 : We do not just use MANIFEST because the user may have dropped
22154 : some additional extensions into the source tree and expect them
22157 : Function to recursively find available extensions, ignoring DynaLoader
22158 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
22159 : In 5.10.1 and later, extensions are stored in directories
22160 : like File-Glob instead of the older File/Glob/.
22164 DynaLoader|dynaload) ;;
22166 this_ext=`echo $xxx | $sed -e s/-/\\\//g`;
22167 leaf=`echo $xxx | $sed -e s/.*-//`;
22168 if $test -d File; then
22169 if $test -f $xxx/$leaf.xs -o -f $xxx/$leaf.c; then
22170 known_extensions="$known_extensions $1$this_ext";
22171 elif $test -f $xxx/Makefile.PL; then
22172 nonxs_extensions="$nonxs_extensions $1$this_ext";
22174 if $test -d $xxx -a $# -lt 10; then
22177 eval $find_extensions;
22183 echo " $known_extensions $nonxs_extensions" > $$.tmp;
22184 if $contains " $this_ext " $$.tmp; then
22186 echo "Duplicate directories detected for extension $xxx" >&4;
22187 echo "Configure cannot correctly recover from this - shall I abort?" >&4;
22188 case "$knowitall" in
22196 echo "Ok. Stopping Configure." >&4;
22197 echo "Please remove the duplicate directory (eg using git clean) and then re-run Configure" >&4;
22200 echo "Ok. You will need to correct config.sh before running make." >&4;
22202 $ls -1 $xxx > $$.tmp;
22203 if $contains "\.xs$" $$.tmp > /dev/null 2>&1; then
22204 known_extensions="$known_extensions $this_ext";
22205 elif $contains "\.c$" $$.tmp > /dev/null 2>&1; then
22206 known_extensions="$known_extensions $this_ext";
22207 elif $test -d $xxx; then
22208 nonxs_extensions="$nonxs_extensions $this_ext";
22219 eval $find_extensions
22223 eval $find_extensions
22227 eval $find_extensions
22228 if $test -d File-Glob; then
22229 : All ext/ flattened
22231 # Special case: Add in modules that nest beyond the first level.
22232 # Currently threads/shared and Hash/Util/FieldHash, since they are
22233 # not picked up by the recursive find above (and adding in general
22234 # recursive finding breaks SDBM_File/sdbm).
22235 # A.D. 20011025 (SDBM), ajgough 20071008 (FieldHash)
22236 known_extensions="$known_extensions threads/shared Hash/Util/FieldHash"
22238 set X $known_extensions
22240 known_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
22241 set X $nonxs_extensions
22243 nonxs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
22246 : Now see which are supported on this system.
22248 for xxx in $known_extensions ; do
22252 $define) avail_ext="$avail_ext $xxx" ;;
22255 GDBM_File|gdbm_fil)
22257 $define) avail_ext="$avail_ext $xxx" ;;
22260 I18N/Langinfo|i18n_lan)
22261 case "$i_langinfo$d_nl_langinfo" in
22262 $define$define) avail_ext="$avail_ext $xxx" ;;
22266 : XXX Do we need a useipcsysv variable here
22267 case "${d_msg}${d_sem}${d_shm}" in
22268 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
22271 NDBM_File|ndbm_fil)
22274 case "$osname-$use64bitint" in
22277 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
22280 *) avail_ext="$avail_ext $xxx" ;;
22285 ODBM_File|odbm_fil)
22286 case "${i_dbm}${i_rpcsvcdbm}" in
22288 case "$d_cplusplus" in
22289 define) ;; # delete as a function name will not work
22290 *) case "$osname-$use64bitint" in
22293 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
22296 *) avail_ext="$avail_ext $xxx" ;;
22304 case "$useopcode" in
22305 true|define|y) avail_ext="$avail_ext $xxx" ;;
22309 case "$useposix" in
22310 true|define|y) avail_ext="$avail_ext $xxx" ;;
22314 case "$d_socket" in
22317 beos) ;; # not unless BONE
22318 *) avail_ext="$avail_ext $xxx" ;;
22323 Sys/Syslog|sys/syslog)
22324 : XXX syslog requires socket
22325 case "$d_socket" in
22326 true|$define|y) avail_ext="$avail_ext $xxx" ;;
22330 case "$usethreads" in
22332 case "$use5005threads" in
22333 $define|true|[yY]*) avail_ext="$avail_ext $xxx" ;;
22337 threads|threads/shared)
22338 # threads and threads::shared are special cases.
22339 # To stop people from asking "Perl 5.8.0 was supposed
22340 # to have this new fancy threads implementation but my
22341 # perl doesn't have it" and from people trying to
22342 # (re)install the threads module using CPAN.pm and
22343 # CPAN.pm then offering to reinstall Perl 5.8.0,
22344 # the threads.pm and threads/shared.pm will always be
22345 # there, croaking informatively ("you need to rebuild
22346 # all of Perl with threads, sorry") when threads haven't
22347 # been compiled in.
22349 avail_ext="$avail_ext $xxx"
22355 cygwin) avail_ext="$avail_ext $xxx" ;;
22358 XS/APItest|xs/apitest)
22359 # This is just for testing. Skip it unless we have dynamic loading.
22362 $define) avail_ext="$avail_ext $xxx" ;;
22365 XS/Typemap|xs/typemap)
22366 # This is just for testing. Skip it unless we have dynamic loading.
22368 $define) avail_ext="$avail_ext $xxx" ;;
22371 *) avail_ext="$avail_ext $xxx"
22380 case "$onlyextensions" in
22382 *) keepextensions=''
22383 echo "You have requested that only certain extensions be included..." >&4
22384 for i in $onlyextensions; do
22385 case " $avail_ext " in
22387 echo "Keeping extension $i."
22388 keepextensions="$keepextensions $i"
22390 *) echo "Ignoring extension $i." ;;
22393 avail_ext="$keepextensions"
22397 case "$noextensions" in
22399 *) keepextensions=''
22400 echo "You have requested that certain extensions be ignored..." >&4
22401 for i in $avail_ext; do
22402 case " $noextensions " in
22403 *" $i "*) echo "Ignoring extension $i." ;;
22404 *) echo "Keeping extension $i.";
22405 keepextensions="$keepextensions $i"
22409 avail_ext="$keepextensions"
22413 : Now see which nonxs extensions are supported on this system.
22414 : For now assume all are.
22416 for xxx in $nonxs_extensions ; do
22418 *) nonxs_ext="$nonxs_ext $xxx"
22430 A number of extensions are supplied with $package. You may choose to
22431 compile these extensions for dynamic loading (the default), compile
22432 them into the $package executable (static loading), or not include
22433 them at all. Answer "none" to include no extensions.
22434 Note that DynaLoader is always built and need not be mentioned here.
22437 case "$dynamic_ext" in
22439 : Exclude those listed in static_ext
22441 for xxx in $avail_ext; do
22442 case " $static_ext " in
22444 *) dflt="$dflt $xxx" ;;
22451 *) dflt="$dynamic_ext"
22452 # Perhaps we are reusing an old out-of-date config.sh.
22455 if test X"$dynamic_ext" != X"$avail_ext"; then
22457 NOTICE: Your previous config.sh list may be incorrect.
22458 The extensions now available to you are
22460 but the default list from your previous config.sh is
22472 rp="What extensions do you wish to load dynamically?"
22475 none) dynamic_ext=' ' ;;
22476 *) dynamic_ext="$ans" ;;
22479 case "$static_ext" in
22481 : Exclude those already listed in dynamic linking
22483 for xxx in $avail_ext; do
22484 case " $dynamic_ext " in
22486 *) dflt="$dflt $xxx" ;;
22493 *) dflt="$static_ext"
22500 rp="What extensions do you wish to load statically?"
22503 none) static_ext=' ' ;;
22504 *) static_ext="$ans" ;;
22509 A number of extensions are supplied with $package. Answer "none"
22510 to include no extensions.
22511 Note that DynaLoader is always built and need not be mentioned here.
22514 case "$static_ext" in
22515 '') dflt="$avail_ext" ;;
22516 *) dflt="$static_ext"
22517 # Perhaps we are reusing an old out-of-date config.sh.
22520 if test X"$static_ext" != X"$avail_ext"; then
22522 NOTICE: Your previous config.sh list may be incorrect.
22523 The extensions now available to you are
22525 but the default list from your previous config.sh is
22534 : Exclude those that are not xs extensions
22538 rp="What extensions do you wish to include?"
22541 none) static_ext=' ' ;;
22542 *) static_ext="$ans" ;;
22547 # Encode is a special case. If we are building Encode as a static
22548 # extension, we need to explicitly list its subextensions as well.
22549 # For other nested extensions, this is handled automatically by
22550 # the appropriate Makefile.PL.
22551 case " $static_ext " in
22552 *" Encode "*) # Add the subextensions of Encode
22554 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
22555 static_ext="$static_ext Encode/$xxx"
22561 set X $dynamic_ext $static_ext $nonxs_ext
22565 # Sanity check: We require an extension suitable for use with
22566 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
22567 # should show up as failures in the test suite, but it's helpful to
22568 # catch them now.) The 'extensions' list is normally sorted
22569 # alphabetically, so we need to accept either
22570 # DB_File ... Fcntl ... IO ....
22571 # or something like
22572 # Fcntl ... NDBM_File ... IO ....
22573 case " $extensions" in
22574 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
22575 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
22576 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
22577 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
22578 echo "WARNING: The Perl you are building will be quite crippled." >& 4
22582 : Remove libraries needed only for extensions
22583 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
22584 : The exception is SunOS 4.x, which needs them.
22585 case "${osname}X${osvers}" in
22589 *) case "$usedl" in
22590 $define|true|[yY]*)
22591 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -lgdbm_compat @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
22595 *) perllibs="$libs"
22601 : Remove build directory name from cppstdin so it can be used from
22602 : either the present location or the final installed location.
22604 : Get out of the UU directory to get correct path name.
22606 case "$cppstdin" in
22608 echo "Stripping down cppstdin path name"
22614 : end of configuration questions
22616 echo "End of configuration questions."
22619 : back to where it started
22620 if test -d ../UU; then
22624 : configuration may be unconditionally patched via a 'config.arch' file
22625 if $test -f config.arch; then
22626 echo "I see a config.arch file, loading it." >&4
22630 : configuration may be patched via a 'config.over' file
22631 if $test -f config.over; then
22634 rp='I see a config.over file. Do you wish to load it?'
22637 n*) echo "OK, I'll ignore it.";;
22639 echo "Configuration override changes have been loaded."
22644 : in case they want portability, strip down executable paths
22645 case "$d_portable" in
22648 echo "Stripping down executable paths..." >&4
22649 for file in $loclist $trylist; do
22651 eval $file=`basename $temp`
22656 : create config.sh file
22658 echo "Creating config.sh..." >&4
22659 $spitshell <<EOT >config.sh
22662 # This file was produced by running the Configure script. It holds all the
22663 # definitions figured out by Configure. Should you modify one of these values,
22664 # do not forget to propagate your changes by running "Configure -der". You may
22665 # instead choose to run each of the .SH files by yourself, or "Configure -S".
22668 # Package name : $package
22669 # Source directory : $src
22670 # Configuration time: $cf_time
22671 # Configured by : $cf_by
22672 # Target system : $myuname
22675 : Add in command line options if available
22676 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
22678 $spitshell <<EOT >>config.sh
22687 Revision='$Revision'
22695 alignbytes='$alignbytes'
22696 ansi2knr='$ansi2knr'
22697 aphostname='$aphostname'
22698 api_revision='$api_revision'
22699 api_subversion='$api_subversion'
22700 api_version='$api_version'
22701 api_versionstring='$api_versionstring'
22704 archlibexp='$archlibexp'
22705 archname64='$archname64'
22706 archname='$archname'
22707 archobjs='$archobjs'
22708 asctime_r_proto='$asctime_r_proto'
22717 byteorder='$byteorder'
22719 castflags='$castflags'
22722 cccdlflags='$cccdlflags'
22723 ccdlflags='$ccdlflags'
22725 ccflags_uselargefiles='$ccflags_uselargefiles'
22727 ccsymbols='$ccsymbols'
22728 ccversion='$ccversion'
22730 cf_email='$cf_email'
22732 charbits='$charbits'
22733 charsize='$charsize'
22737 clocktype='$clocktype'
22739 compress='$compress'
22740 contains='$contains'
22744 cpp_stuff='$cpp_stuff'
22745 cppccsymbols='$cppccsymbols'
22746 cppflags='$cppflags'
22748 cppminus='$cppminus'
22750 cppstdin='$cppstdin'
22751 cppsymbols='$cppsymbols'
22752 crypt_r_proto='$crypt_r_proto'
22753 cryptlib='$cryptlib'
22755 ctermid_r_proto='$ctermid_r_proto'
22756 ctime_r_proto='$ctime_r_proto'
22757 d_Gconvert='$d_Gconvert'
22758 d_PRIEUldbl='$d_PRIEUldbl'
22759 d_PRIFUldbl='$d_PRIFUldbl'
22760 d_PRIGUldbl='$d_PRIGUldbl'
22761 d_PRIXU64='$d_PRIXU64'
22762 d_PRId64='$d_PRId64'
22763 d_PRIeldbl='$d_PRIeldbl'
22764 d_PRIfldbl='$d_PRIfldbl'
22765 d_PRIgldbl='$d_PRIgldbl'
22766 d_PRIi64='$d_PRIi64'
22767 d_PRIo64='$d_PRIo64'
22768 d_PRIu64='$d_PRIu64'
22769 d_PRIx64='$d_PRIx64'
22770 d_SCNfldbl='$d_SCNfldbl'
22771 d__fwalk='$d__fwalk'
22772 d_access='$d_access'
22773 d_accessx='$d_accessx'
22776 d_archlib='$d_archlib'
22777 d_asctime64='$d_asctime64'
22778 d_asctime_r='$d_asctime_r'
22781 d_attribute_deprecated='$d_attribute_deprecated'
22782 d_attribute_format='$d_attribute_format'
22783 d_attribute_malloc='$d_attribute_malloc'
22784 d_attribute_nonnull='$d_attribute_nonnull'
22785 d_attribute_noreturn='$d_attribute_noreturn'
22786 d_attribute_pure='$d_attribute_pure'
22787 d_attribute_unused='$d_attribute_unused'
22788 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
22792 d_bsdgetpgrp='$d_bsdgetpgrp'
22793 d_bsdsetpgrp='$d_bsdsetpgrp'
22794 d_builtin_choose_expr='$d_builtin_choose_expr'
22795 d_builtin_expect='$d_builtin_expect'
22797 d_c99_variadic_macros='$d_c99_variadic_macros'
22798 d_casti32='$d_casti32'
22799 d_castneg='$d_castneg'
22800 d_charvspr='$d_charvspr'
22802 d_chroot='$d_chroot'
22803 d_chsize='$d_chsize'
22805 d_clearenv='$d_clearenv'
22806 d_closedir='$d_closedir'
22807 d_cmsghdr_s='$d_cmsghdr_s'
22809 d_copysignl='$d_copysignl'
22810 d_cplusplus='$d_cplusplus'
22812 d_crypt_r='$d_crypt_r'
22814 d_ctermid='$d_ctermid'
22815 d_ctermid_r='$d_ctermid_r'
22816 d_ctime64='$d_ctime64'
22817 d_ctime_r='$d_ctime_r'
22818 d_cuserid='$d_cuserid'
22819 d_dbl_dig='$d_dbl_dig'
22820 d_dbminitproto='$d_dbminitproto'
22821 d_difftime64='$d_difftime64'
22822 d_difftime='$d_difftime'
22823 d_dir_dd_fd='$d_dir_dd_fd'
22825 d_dirnamlen='$d_dirnamlen'
22826 d_dlerror='$d_dlerror'
22827 d_dlopen='$d_dlopen'
22828 d_dlsymun='$d_dlsymun'
22829 d_dosuid='$d_dosuid'
22830 d_drand48_r='$d_drand48_r'
22831 d_drand48proto='$d_drand48proto'
22833 d_eaccess='$d_eaccess'
22834 d_endgrent='$d_endgrent'
22835 d_endgrent_r='$d_endgrent_r'
22836 d_endhent='$d_endhent'
22837 d_endhostent_r='$d_endhostent_r'
22838 d_endnent='$d_endnent'
22839 d_endnetent_r='$d_endnetent_r'
22840 d_endpent='$d_endpent'
22841 d_endprotoent_r='$d_endprotoent_r'
22842 d_endpwent='$d_endpwent'
22843 d_endpwent_r='$d_endpwent_r'
22844 d_endsent='$d_endsent'
22845 d_endservent_r='$d_endservent_r'
22846 d_eofnblk='$d_eofnblk'
22847 d_eunice='$d_eunice'
22848 d_faststdio='$d_faststdio'
22849 d_fchdir='$d_fchdir'
22850 d_fchmod='$d_fchmod'
22851 d_fchown='$d_fchown'
22853 d_fcntl_can_lock='$d_fcntl_can_lock'
22854 d_fd_macros='$d_fd_macros'
22855 d_fd_set='$d_fd_set'
22856 d_fds_bits='$d_fds_bits'
22857 d_fgetpos='$d_fgetpos'
22858 d_finite='$d_finite'
22859 d_finitel='$d_finitel'
22860 d_flexfnam='$d_flexfnam'
22862 d_flockproto='$d_flockproto'
22864 d_fp_class='$d_fp_class'
22865 d_fpathconf='$d_fpathconf'
22866 d_fpclass='$d_fpclass'
22867 d_fpclassify='$d_fpclassify'
22868 d_fpclassl='$d_fpclassl'
22869 d_fpos64_t='$d_fpos64_t'
22870 d_frexpl='$d_frexpl'
22871 d_fs_data_s='$d_fs_data_s'
22872 d_fseeko='$d_fseeko'
22873 d_fsetpos='$d_fsetpos'
22874 d_fstatfs='$d_fstatfs'
22875 d_fstatvfs='$d_fstatvfs'
22877 d_ftello='$d_ftello'
22879 d_futimes='$d_futimes'
22880 d_gdbm_ndbm_h_uses_prototypes='$d_gdbm_ndbm_h_uses_prototypes'
22881 d_gdbmndbm_h_uses_prototypes='$d_gdbmndbm_h_uses_prototypes'
22882 d_getaddrinfo='$d_getaddrinfo'
22883 d_getcwd='$d_getcwd'
22884 d_getespwnam='$d_getespwnam'
22885 d_getfsstat='$d_getfsstat'
22886 d_getgrent='$d_getgrent'
22887 d_getgrent_r='$d_getgrent_r'
22888 d_getgrgid_r='$d_getgrgid_r'
22889 d_getgrnam_r='$d_getgrnam_r'
22890 d_getgrps='$d_getgrps'
22891 d_gethbyaddr='$d_gethbyaddr'
22892 d_gethbyname='$d_gethbyname'
22893 d_gethent='$d_gethent'
22894 d_gethname='$d_gethname'
22895 d_gethostbyaddr_r='$d_gethostbyaddr_r'
22896 d_gethostbyname_r='$d_gethostbyname_r'
22897 d_gethostent_r='$d_gethostent_r'
22898 d_gethostprotos='$d_gethostprotos'
22899 d_getitimer='$d_getitimer'
22900 d_getlogin='$d_getlogin'
22901 d_getlogin_r='$d_getlogin_r'
22902 d_getmnt='$d_getmnt'
22903 d_getmntent='$d_getmntent'
22904 d_getnameinfo='$d_getnameinfo'
22905 d_getnbyaddr='$d_getnbyaddr'
22906 d_getnbyname='$d_getnbyname'
22907 d_getnent='$d_getnent'
22908 d_getnetbyaddr_r='$d_getnetbyaddr_r'
22909 d_getnetbyname_r='$d_getnetbyname_r'
22910 d_getnetent_r='$d_getnetent_r'
22911 d_getnetprotos='$d_getnetprotos'
22912 d_getpagsz='$d_getpagsz'
22913 d_getpbyname='$d_getpbyname'
22914 d_getpbynumber='$d_getpbynumber'
22915 d_getpent='$d_getpent'
22916 d_getpgid='$d_getpgid'
22917 d_getpgrp2='$d_getpgrp2'
22918 d_getpgrp='$d_getpgrp'
22919 d_getppid='$d_getppid'
22920 d_getprior='$d_getprior'
22921 d_getprotobyname_r='$d_getprotobyname_r'
22922 d_getprotobynumber_r='$d_getprotobynumber_r'
22923 d_getprotoent_r='$d_getprotoent_r'
22924 d_getprotoprotos='$d_getprotoprotos'
22925 d_getprpwnam='$d_getprpwnam'
22926 d_getpwent='$d_getpwent'
22927 d_getpwent_r='$d_getpwent_r'
22928 d_getpwnam_r='$d_getpwnam_r'
22929 d_getpwuid_r='$d_getpwuid_r'
22930 d_getsbyname='$d_getsbyname'
22931 d_getsbyport='$d_getsbyport'
22932 d_getsent='$d_getsent'
22933 d_getservbyname_r='$d_getservbyname_r'
22934 d_getservbyport_r='$d_getservbyport_r'
22935 d_getservent_r='$d_getservent_r'
22936 d_getservprotos='$d_getservprotos'
22937 d_getspnam='$d_getspnam'
22938 d_getspnam_r='$d_getspnam_r'
22939 d_gettimeod='$d_gettimeod'
22940 d_gmtime64='$d_gmtime64'
22941 d_gmtime_r='$d_gmtime_r'
22942 d_gnulibc='$d_gnulibc'
22943 d_grpasswd='$d_grpasswd'
22944 d_hasmntopt='$d_hasmntopt'
22946 d_ilogbl='$d_ilogbl'
22947 d_inc_version_list='$d_inc_version_list'
22949 d_inetaton='$d_inetaton'
22950 d_inetntop='$d_inetntop'
22951 d_inetpton='$d_inetpton'
22952 d_int64_t='$d_int64_t'
22953 d_isascii='$d_isascii'
22954 d_isblank='$d_isblank'
22955 d_isfinite='$d_isfinite'
22958 d_isnanl='$d_isnanl'
22959 d_killpg='$d_killpg'
22960 d_lchown='$d_lchown'
22961 d_ldbl_dig='$d_ldbl_dig'
22962 d_libm_lib_version='$d_libm_lib_version'
22964 d_localtime64='$d_localtime64'
22965 d_localtime_r='$d_localtime_r'
22966 d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset'
22967 d_locconv='$d_locconv'
22969 d_longdbl='$d_longdbl'
22970 d_longlong='$d_longlong'
22971 d_lseekproto='$d_lseekproto'
22973 d_madvise='$d_madvise'
22974 d_malloc_good_size='$d_malloc_good_size'
22975 d_malloc_size='$d_malloc_size'
22977 d_mbstowcs='$d_mbstowcs'
22978 d_mbtowc='$d_mbtowc'
22979 d_memchr='$d_memchr'
22980 d_memcmp='$d_memcmp'
22981 d_memcpy='$d_memcpy'
22982 d_memmove='$d_memmove'
22983 d_memset='$d_memset'
22985 d_mkdtemp='$d_mkdtemp'
22986 d_mkfifo='$d_mkfifo'
22987 d_mkstemp='$d_mkstemp'
22988 d_mkstemps='$d_mkstemps'
22989 d_mktime64='$d_mktime64'
22990 d_mktime='$d_mktime'
22993 d_modfl_pow32_bug='$d_modfl_pow32_bug'
22994 d_modflproto='$d_modflproto'
22995 d_mprotect='$d_mprotect'
22997 d_msg_ctrunc='$d_msg_ctrunc'
22998 d_msg_dontroute='$d_msg_dontroute'
22999 d_msg_oob='$d_msg_oob'
23000 d_msg_peek='$d_msg_peek'
23001 d_msg_proxy='$d_msg_proxy'
23002 d_msgctl='$d_msgctl'
23003 d_msgget='$d_msgget'
23004 d_msghdr_s='$d_msghdr_s'
23005 d_msgrcv='$d_msgrcv'
23006 d_msgsnd='$d_msgsnd'
23008 d_munmap='$d_munmap'
23009 d_mymalloc='$d_mymalloc'
23011 d_ndbm_h_uses_prototypes='$d_ndbm_h_uses_prototypes'
23013 d_nl_langinfo='$d_nl_langinfo'
23014 d_nv_preserves_uv='$d_nv_preserves_uv'
23015 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
23016 d_off64_t='$d_off64_t'
23017 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
23018 d_oldpthreads='$d_oldpthreads'
23019 d_oldsock='$d_oldsock'
23021 d_pathconf='$d_pathconf'
23023 d_perl_otherlibdirs='$d_perl_otherlibdirs'
23024 d_phostname='$d_phostname'
23027 d_portable='$d_portable'
23029 d_prctl_set_name='$d_prctl_set_name'
23030 d_printf_format_null='$d_printf_format_null'
23031 d_procselfexe='$d_procselfexe'
23032 d_pseudofork='$d_pseudofork'
23033 d_pthread_atfork='$d_pthread_atfork'
23034 d_pthread_attr_setscope='$d_pthread_attr_setscope'
23035 d_pthread_yield='$d_pthread_yield'
23037 d_pwchange='$d_pwchange'
23038 d_pwclass='$d_pwclass'
23039 d_pwcomment='$d_pwcomment'
23040 d_pwexpire='$d_pwexpire'
23041 d_pwgecos='$d_pwgecos'
23042 d_pwpasswd='$d_pwpasswd'
23043 d_pwquota='$d_pwquota'
23046 d_random_r='$d_random_r'
23047 d_readdir64_r='$d_readdir64_r'
23048 d_readdir='$d_readdir'
23049 d_readdir_r='$d_readdir_r'
23050 d_readlink='$d_readlink'
23052 d_recvmsg='$d_recvmsg'
23053 d_rename='$d_rename'
23054 d_rewinddir='$d_rewinddir'
23056 d_safebcpy='$d_safebcpy'
23057 d_safemcpy='$d_safemcpy'
23058 d_sanemcmp='$d_sanemcmp'
23059 d_sbrkproto='$d_sbrkproto'
23060 d_scalbnl='$d_scalbnl'
23061 d_sched_yield='$d_sched_yield'
23062 d_scm_rights='$d_scm_rights'
23063 d_seekdir='$d_seekdir'
23064 d_select='$d_select'
23066 d_semctl='$d_semctl'
23067 d_semctl_semid_ds='$d_semctl_semid_ds'
23068 d_semctl_semun='$d_semctl_semun'
23069 d_semget='$d_semget'
23071 d_sendmsg='$d_sendmsg'
23072 d_setegid='$d_setegid'
23073 d_seteuid='$d_seteuid'
23074 d_setgrent='$d_setgrent'
23075 d_setgrent_r='$d_setgrent_r'
23076 d_setgrps='$d_setgrps'
23077 d_sethent='$d_sethent'
23078 d_sethostent_r='$d_sethostent_r'
23079 d_setitimer='$d_setitimer'
23080 d_setlinebuf='$d_setlinebuf'
23081 d_setlocale='$d_setlocale'
23082 d_setlocale_r='$d_setlocale_r'
23083 d_setnent='$d_setnent'
23084 d_setnetent_r='$d_setnetent_r'
23085 d_setpent='$d_setpent'
23086 d_setpgid='$d_setpgid'
23087 d_setpgrp2='$d_setpgrp2'
23088 d_setpgrp='$d_setpgrp'
23089 d_setprior='$d_setprior'
23090 d_setproctitle='$d_setproctitle'
23091 d_setprotoent_r='$d_setprotoent_r'
23092 d_setpwent='$d_setpwent'
23093 d_setpwent_r='$d_setpwent_r'
23094 d_setregid='$d_setregid'
23095 d_setresgid='$d_setresgid'
23096 d_setresuid='$d_setresuid'
23097 d_setreuid='$d_setreuid'
23098 d_setrgid='$d_setrgid'
23099 d_setruid='$d_setruid'
23100 d_setsent='$d_setsent'
23101 d_setservent_r='$d_setservent_r'
23102 d_setsid='$d_setsid'
23103 d_setvbuf='$d_setvbuf'
23107 d_shmatprototype='$d_shmatprototype'
23108 d_shmctl='$d_shmctl'
23110 d_shmget='$d_shmget'
23111 d_sigaction='$d_sigaction'
23112 d_signbit='$d_signbit'
23113 d_sigprocmask='$d_sigprocmask'
23114 d_sigsetjmp='$d_sigsetjmp'
23115 d_sin6_scope_id='$d_sin6_scope_id'
23116 d_sitearch='$d_sitearch'
23117 d_snprintf='$d_snprintf'
23118 d_sockaddr_sa_len='$d_sockaddr_sa_len'
23119 d_sockatmark='$d_sockatmark'
23120 d_sockatmarkproto='$d_sockatmarkproto'
23121 d_socket='$d_socket'
23122 d_socklen_t='$d_socklen_t'
23123 d_sockpair='$d_sockpair'
23124 d_socks5_init='$d_socks5_init'
23125 d_sprintf_returns_strlen='$d_sprintf_returns_strlen'
23127 d_srand48_r='$d_srand48_r'
23128 d_srandom_r='$d_srandom_r'
23129 d_sresgproto='$d_sresgproto'
23130 d_sresuproto='$d_sresuproto'
23131 d_statblks='$d_statblks'
23132 d_statfs_f_flags='$d_statfs_f_flags'
23133 d_statfs_s='$d_statfs_s'
23134 d_static_inline='$d_static_inline'
23135 d_statvfs='$d_statvfs'
23136 d_stdio_cnt_lval='$d_stdio_cnt_lval'
23137 d_stdio_ptr_lval='$d_stdio_ptr_lval'
23138 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
23139 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
23140 d_stdio_stream_array='$d_stdio_stream_array'
23141 d_stdiobase='$d_stdiobase'
23142 d_stdstdio='$d_stdstdio'
23143 d_strchr='$d_strchr'
23144 d_strcoll='$d_strcoll'
23145 d_strctcpy='$d_strctcpy'
23146 d_strerrm='$d_strerrm'
23147 d_strerror='$d_strerror'
23148 d_strerror_r='$d_strerror_r'
23149 d_strftime='$d_strftime'
23150 d_strlcat='$d_strlcat'
23151 d_strlcpy='$d_strlcpy'
23152 d_strtod='$d_strtod'
23153 d_strtol='$d_strtol'
23154 d_strtold='$d_strtold'
23155 d_strtoll='$d_strtoll'
23156 d_strtoq='$d_strtoq'
23157 d_strtoul='$d_strtoul'
23158 d_strtoull='$d_strtoull'
23159 d_strtouq='$d_strtouq'
23160 d_strxfrm='$d_strxfrm'
23161 d_suidsafe='$d_suidsafe'
23162 d_symlink='$d_symlink'
23163 d_syscall='$d_syscall'
23164 d_syscallproto='$d_syscallproto'
23165 d_sysconf='$d_sysconf'
23166 d_sysernlst='$d_sysernlst'
23167 d_syserrlst='$d_syserrlst'
23168 d_system='$d_system'
23169 d_tcgetpgrp='$d_tcgetpgrp'
23170 d_tcsetpgrp='$d_tcsetpgrp'
23171 d_telldir='$d_telldir'
23172 d_telldirproto='$d_telldirproto'
23174 d_timegm='$d_timegm'
23176 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
23177 d_tm_tm_zone='$d_tm_tm_zone'
23178 d_tmpnam_r='$d_tmpnam_r'
23179 d_truncate='$d_truncate'
23180 d_ttyname_r='$d_ttyname_r'
23181 d_tzname='$d_tzname'
23182 d_u32align='$d_u32align'
23183 d_ualarm='$d_ualarm'
23186 d_union_semun='$d_union_semun'
23187 d_unordered='$d_unordered'
23188 d_unsetenv='$d_unsetenv'
23189 d_usleep='$d_usleep'
23190 d_usleepproto='$d_usleepproto'
23192 d_vendorarch='$d_vendorarch'
23193 d_vendorbin='$d_vendorbin'
23194 d_vendorlib='$d_vendorlib'
23195 d_vendorscript='$d_vendorscript'
23197 d_void_closedir='$d_void_closedir'
23198 d_voidsig='$d_voidsig'
23199 d_voidtty='$d_voidtty'
23200 d_volatile='$d_volatile'
23201 d_vprintf='$d_vprintf'
23202 d_vsnprintf='$d_vsnprintf'
23204 d_waitpid='$d_waitpid'
23205 d_wcstombs='$d_wcstombs'
23206 d_wctomb='$d_wctomb'
23207 d_writev='$d_writev'
23210 db_hashtype='$db_hashtype'
23211 db_prefixtype='$db_prefixtype'
23212 db_version_major='$db_version_major'
23213 db_version_minor='$db_version_minor'
23214 db_version_patch='$db_version_patch'
23215 defvoidused='$defvoidused'
23216 direntrytype='$direntrytype'
23219 doublesize='$doublesize'
23221 drand48_r_proto='$drand48_r_proto'
23223 dynamic_ext='$dynamic_ext'
23229 endgrent_r_proto='$endgrent_r_proto'
23230 endhostent_r_proto='$endhostent_r_proto'
23231 endnetent_r_proto='$endnetent_r_proto'
23232 endprotoent_r_proto='$endprotoent_r_proto'
23233 endpwent_r_proto='$endpwent_r_proto'
23234 endservent_r_proto='$endservent_r_proto'
23235 eunicefix='$eunicefix'
23238 extensions='$extensions'
23239 extern_C='$extern_C'
23241 fflushNULL='$fflushNULL'
23242 fflushall='$fflushall'
23244 firstmakefile='$firstmakefile'
23246 fpossize='$fpossize'
23247 fpostype='$fpostype'
23248 freetype='$freetype'
23251 full_csh='$full_csh'
23252 full_sed='$full_sed'
23253 gccansipedantic='$gccansipedantic'
23254 gccosandvers='$gccosandvers'
23255 gccversion='$gccversion'
23256 getgrent_r_proto='$getgrent_r_proto'
23257 getgrgid_r_proto='$getgrgid_r_proto'
23258 getgrnam_r_proto='$getgrnam_r_proto'
23259 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
23260 gethostbyname_r_proto='$gethostbyname_r_proto'
23261 gethostent_r_proto='$gethostent_r_proto'
23262 getlogin_r_proto='$getlogin_r_proto'
23263 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
23264 getnetbyname_r_proto='$getnetbyname_r_proto'
23265 getnetent_r_proto='$getnetent_r_proto'
23266 getprotobyname_r_proto='$getprotobyname_r_proto'
23267 getprotobynumber_r_proto='$getprotobynumber_r_proto'
23268 getprotoent_r_proto='$getprotoent_r_proto'
23269 getpwent_r_proto='$getpwent_r_proto'
23270 getpwnam_r_proto='$getpwnam_r_proto'
23271 getpwuid_r_proto='$getpwuid_r_proto'
23272 getservbyname_r_proto='$getservbyname_r_proto'
23273 getservbyport_r_proto='$getservbyport_r_proto'
23274 getservent_r_proto='$getservent_r_proto'
23275 getspnam_r_proto='$getspnam_r_proto'
23276 gidformat='$gidformat'
23282 gmtime_r_proto='$gmtime_r_proto'
23283 gnulibc_version='$gnulibc_version'
23285 groupcat='$groupcat'
23286 groupstype='$groupstype'
23289 h_sysfile='$h_sysfile'
23292 html1dir='$html1dir'
23293 html1direxp='$html1direxp'
23294 html3dir='$html3dir'
23295 html3direxp='$html3direxp'
23304 i_arpainet='$i_arpainet'
23305 i_assert='$i_assert'
23306 i_bsdioctl='$i_bsdioctl'
23310 i_dirent='$i_dirent'
23316 i_fp_class='$i_fp_class'
23318 i_gdbm_ndbm='$i_gdbm_ndbm'
23319 i_gdbmndbm='$i_gdbmndbm'
23321 i_ieeefp='$i_ieeefp'
23322 i_inttypes='$i_inttypes'
23323 i_langinfo='$i_langinfo'
23324 i_libutil='$i_libutil'
23325 i_limits='$i_limits'
23326 i_locale='$i_locale'
23327 i_machcthr='$i_machcthr'
23328 i_malloc='$i_malloc'
23329 i_mallocmalloc='$i_mallocmalloc'
23331 i_memory='$i_memory'
23332 i_mntent='$i_mntent'
23335 i_neterrno='$i_neterrno'
23336 i_netinettcp='$i_netinettcp'
23340 i_pthread='$i_pthread'
23342 i_rpcsvcdbm='$i_rpcsvcdbm'
23345 i_shadow='$i_shadow'
23347 i_stdarg='$i_stdarg'
23348 i_stdbool='$i_stdbool'
23349 i_stddef='$i_stddef'
23350 i_stdlib='$i_stdlib'
23351 i_string='$i_string'
23352 i_sunmath='$i_sunmath'
23353 i_sysaccess='$i_sysaccess'
23354 i_sysdir='$i_sysdir'
23355 i_sysfile='$i_sysfile'
23356 i_sysfilio='$i_sysfilio'
23358 i_sysioctl='$i_sysioctl'
23359 i_syslog='$i_syslog'
23360 i_sysmman='$i_sysmman'
23361 i_sysmode='$i_sysmode'
23362 i_sysmount='$i_sysmount'
23363 i_sysndir='$i_sysndir'
23364 i_sysparam='$i_sysparam'
23365 i_syspoll='$i_syspoll'
23366 i_sysresrc='$i_sysresrc'
23367 i_syssecrt='$i_syssecrt'
23368 i_sysselct='$i_sysselct'
23369 i_syssockio='$i_syssockio'
23370 i_sysstat='$i_sysstat'
23371 i_sysstatfs='$i_sysstatfs'
23372 i_sysstatvfs='$i_sysstatvfs'
23373 i_systime='$i_systime'
23374 i_systimek='$i_systimek'
23375 i_systimes='$i_systimes'
23376 i_systypes='$i_systypes'
23377 i_sysuio='$i_sysuio'
23379 i_sysutsname='$i_sysutsname'
23380 i_sysvfs='$i_sysvfs'
23381 i_syswait='$i_syswait'
23382 i_termio='$i_termio'
23383 i_termios='$i_termios'
23385 i_unistd='$i_unistd'
23388 i_values='$i_values'
23389 i_varargs='$i_varargs'
23390 i_varhdr='$i_varhdr'
23392 ignore_versioned_solibs='$ignore_versioned_solibs'
23393 inc_version_list='$inc_version_list'
23394 inc_version_list_init='$inc_version_list_init'
23397 initialinstalllocation='$initialinstalllocation'
23398 installarchlib='$installarchlib'
23399 installbin='$installbin'
23400 installhtml1dir='$installhtml1dir'
23401 installhtml3dir='$installhtml3dir'
23402 installman1dir='$installman1dir'
23403 installman3dir='$installman3dir'
23404 installprefix='$installprefix'
23405 installprefixexp='$installprefixexp'
23406 installprivlib='$installprivlib'
23407 installscript='$installscript'
23408 installsitearch='$installsitearch'
23409 installsitebin='$installsitebin'
23410 installsitehtml1dir='$installsitehtml1dir'
23411 installsitehtml3dir='$installsitehtml3dir'
23412 installsitelib='$installsitelib'
23413 installsiteman1dir='$installsiteman1dir'
23414 installsiteman3dir='$installsiteman3dir'
23415 installsitescript='$installsitescript'
23416 installstyle='$installstyle'
23417 installusrbinperl='$installusrbinperl'
23418 installvendorarch='$installvendorarch'
23419 installvendorbin='$installvendorbin'
23420 installvendorhtml1dir='$installvendorhtml1dir'
23421 installvendorhtml3dir='$installvendorhtml3dir'
23422 installvendorlib='$installvendorlib'
23423 installvendorman1dir='$installvendorman1dir'
23424 installvendorman3dir='$installvendorman3dir'
23425 installvendorscript='$installvendorscript'
23427 issymlink='$issymlink'
23428 ivdformat='$ivdformat'
23431 known_extensions='$known_extensions'
23434 lddlflags='$lddlflags'
23436 ldflags_uselargefiles='$ldflags_uselargefiles'
23437 ldlibpthname='$ldlibpthname'
23444 libsdirs='$libsdirs'
23445 libsfiles='$libsfiles'
23446 libsfound='$libsfound'
23447 libspath='$libspath'
23448 libswanted='$libswanted'
23449 libswanted_uselargefiles='$libswanted_uselargefiles'
23455 localtime_r_proto='$localtime_r_proto'
23456 locincpth='$locincpth'
23457 loclibpth='$loclibpth'
23458 longdblsize='$longdblsize'
23459 longlongsize='$longlongsize'
23460 longsize='$longsize'
23464 lseeksize='$lseeksize'
23465 lseektype='$lseektype'
23468 madlyobj='$madlyobj'
23469 madlysrc='$madlysrc'
23473 make_set_make='$make_set_make'
23474 mallocobj='$mallocobj'
23475 mallocsrc='$mallocsrc'
23476 malloctype='$malloctype'
23478 man1direxp='$man1direxp'
23481 man3direxp='$man3direxp'
23483 mips_type='$mips_type'
23484 mistrustnm='$mistrustnm'
23486 mmaptype='$mmaptype'
23487 modetype='$modetype'
23489 multiarch='$multiarch'
23491 myarchname='$myarchname'
23492 mydomain='$mydomain'
23493 myhostname='$myhostname'
23496 need_va_copy='$need_va_copy'
23497 netdb_hlen_type='$netdb_hlen_type'
23498 netdb_host_type='$netdb_host_type'
23499 netdb_name_type='$netdb_name_type'
23500 netdb_net_type='$netdb_net_type'
23503 nm_so_opt='$nm_so_opt'
23504 nonxs_ext='$nonxs_ext'
23506 nvEUformat='$nvEUformat'
23507 nvFUformat='$nvFUformat'
23508 nvGUformat='$nvGUformat'
23509 nv_overflows_integers_at='$nv_overflows_integers_at'
23510 nv_preserves_uv_bits='$nv_preserves_uv_bits'
23511 nveformat='$nveformat'
23512 nvfformat='$nvfformat'
23513 nvgformat='$nvgformat'
23516 o_nonblock='$o_nonblock'
23518 old_pthread_create_joinable='$old_pthread_create_joinable'
23519 optimize='$optimize'
23520 orderlib='$orderlib'
23523 otherlibdirs='$otherlibdirs'
23527 patchlevel='$patchlevel'
23528 path_sep='$path_sep'
23531 perl_patchlevel='$perl_patchlevel'
23532 perl_static_inline='$perl_static_inline'
23533 perladmin='$perladmin'
23534 perllibs='$perllibs'
23535 perlpath='$perlpath'
23537 phostname='$phostname'
23543 prefixexp='$prefixexp'
23545 privlibexp='$privlibexp'
23546 procselfexe='$procselfexe'
23547 prototype='$prototype'
23549 quadkind='$quadkind'
23550 quadtype='$quadtype'
23551 randbits='$randbits'
23552 randfunc='$randfunc'
23553 random_r_proto='$random_r_proto'
23554 randseedtype='$randseedtype'
23556 rd_nodata='$rd_nodata'
23557 readdir64_r_proto='$readdir64_r_proto'
23558 readdir_r_proto='$readdir_r_proto'
23559 revision='$revision'
23565 sGMTIME_max='$sGMTIME_max'
23566 sGMTIME_min='$sGMTIME_min'
23567 sLOCALTIME_max='$sLOCALTIME_max'
23568 sLOCALTIME_min='$sLOCALTIME_min'
23569 sPRIEUldbl='$sPRIEUldbl'
23570 sPRIFUldbl='$sPRIFUldbl'
23571 sPRIGUldbl='$sPRIGUldbl'
23572 sPRIXU64='$sPRIXU64'
23574 sPRIeldbl='$sPRIeldbl'
23575 sPRIfldbl='$sPRIfldbl'
23576 sPRIgldbl='$sPRIgldbl'
23581 sSCNfldbl='$sSCNfldbl'
23582 sched_yield='$sched_yield'
23583 scriptdir='$scriptdir'
23584 scriptdirexp='$scriptdirexp'
23586 seedfunc='$seedfunc'
23587 selectminbits='$selectminbits'
23588 selecttype='$selecttype'
23589 sendmail='$sendmail'
23590 setgrent_r_proto='$setgrent_r_proto'
23591 sethostent_r_proto='$sethostent_r_proto'
23592 setlocale_r_proto='$setlocale_r_proto'
23593 setnetent_r_proto='$setnetent_r_proto'
23594 setprotoent_r_proto='$setprotoent_r_proto'
23595 setpwent_r_proto='$setpwent_r_proto'
23596 setservent_r_proto='$setservent_r_proto'
23599 sharpbang='$sharpbang'
23600 shmattype='$shmattype'
23601 shortsize='$shortsize'
23604 sig_count='$sig_count'
23605 sig_name='$sig_name'
23606 sig_name_init='$sig_name_init'
23608 sig_num_init='$sig_num_init'
23609 sig_size='$sig_size'
23610 signal_t='$signal_t'
23611 sitearch='$sitearch'
23612 sitearchexp='$sitearchexp'
23614 sitebinexp='$sitebinexp'
23615 sitehtml1dir='$sitehtml1dir'
23616 sitehtml1direxp='$sitehtml1direxp'
23617 sitehtml3dir='$sitehtml3dir'
23618 sitehtml3direxp='$sitehtml3direxp'
23620 sitelib_stem='$sitelib_stem'
23621 sitelibexp='$sitelibexp'
23622 siteman1dir='$siteman1dir'
23623 siteman1direxp='$siteman1direxp'
23624 siteman3dir='$siteman3dir'
23625 siteman3direxp='$siteman3direxp'
23626 siteprefix='$siteprefix'
23627 siteprefixexp='$siteprefixexp'
23628 sitescript='$sitescript'
23629 sitescriptexp='$sitescriptexp'
23630 sizesize='$sizesize'
23631 sizetype='$sizetype'
23635 sockethdr='$sockethdr'
23636 socketlib='$socketlib'
23637 socksizetype='$socksizetype'
23639 spackage='$spackage'
23640 spitshell='$spitshell'
23641 srand48_r_proto='$srand48_r_proto'
23642 srandom_r_proto='$srandom_r_proto'
23644 ssizetype='$ssizetype'
23645 st_ino_sign='$st_ino_sign'
23646 st_ino_size='$st_ino_size'
23647 startperl='$startperl'
23649 static_ext='$static_ext'
23651 stdio_base='$stdio_base'
23652 stdio_bufsiz='$stdio_bufsiz'
23653 stdio_cnt='$stdio_cnt'
23654 stdio_filbuf='$stdio_filbuf'
23655 stdio_ptr='$stdio_ptr'
23656 stdio_stream_array='$stdio_stream_array'
23657 strerror_r_proto='$strerror_r_proto'
23660 subversion='$subversion'
23664 targetarch='$targetarch'
23668 timeincl='$timeincl'
23669 timetype='$timetype'
23670 tmpnam_r_proto='$tmpnam_r_proto'
23676 ttyname_r_proto='$ttyname_r_proto'
23685 uidformat='$uidformat'
23691 uquadtype='$uquadtype'
23692 use5005threads='$use5005threads'
23693 use64bitall='$use64bitall'
23694 use64bitint='$use64bitint'
23695 usecrosscompile='$usecrosscompile'
23696 usedevel='$usedevel'
23698 usedtrace='$usedtrace'
23699 usefaststdio='$usefaststdio'
23700 useithreads='$useithreads'
23701 usekernprocpathname='$usekernprocpathname'
23702 uselargefiles='$uselargefiles'
23703 uselongdouble='$uselongdouble'
23704 usemallocwrap='$usemallocwrap'
23705 usemorebits='$usemorebits'
23706 usemultiplicity='$usemultiplicity'
23707 usemymalloc='$usemymalloc'
23709 usensgetexecutablepath='$usensgetexecutablepath'
23710 useopcode='$useopcode'
23711 useperlio='$useperlio'
23712 useposix='$useposix'
23713 usereentrant='$usereentrant'
23714 userelocatableinc='$userelocatableinc'
23716 useshrplib='$useshrplib'
23717 usesitecustomize='$usesitecustomize'
23718 usesocks='$usesocks'
23719 usethreads='$usethreads'
23720 usevendorprefix='$usevendorprefix'
23721 usevfork='$usevfork'
23724 uvXUformat='$uvXUformat'
23725 uvoformat='$uvoformat'
23728 uvuformat='$uvuformat'
23729 uvxformat='$uvxformat'
23731 vendorarch='$vendorarch'
23732 vendorarchexp='$vendorarchexp'
23733 vendorbin='$vendorbin'
23734 vendorbinexp='$vendorbinexp'
23735 vendorhtml1dir='$vendorhtml1dir'
23736 vendorhtml1direxp='$vendorhtml1direxp'
23737 vendorhtml3dir='$vendorhtml3dir'
23738 vendorhtml3direxp='$vendorhtml3direxp'
23739 vendorlib='$vendorlib'
23740 vendorlib_stem='$vendorlib_stem'
23741 vendorlibexp='$vendorlibexp'
23742 vendorman1dir='$vendorman1dir'
23743 vendorman1direxp='$vendorman1direxp'
23744 vendorman3dir='$vendorman3dir'
23745 vendorman3direxp='$vendorman3direxp'
23746 vendorprefix='$vendorprefix'
23747 vendorprefixexp='$vendorprefixexp'
23748 vendorscript='$vendorscript'
23749 vendorscriptexp='$vendorscriptexp'
23751 version_patchlevel_string='$version_patchlevel_string'
23752 versiononly='$versiononly'
23754 voidflags='$voidflags'
23757 yaccflags='$yaccflags'
23762 : add special variables
23763 $test -f $src/patchlevel.h && \
23764 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
23765 echo "PERL_PATCHLEVEL='$perl_patchlevel'" >>config.sh
23766 echo "PERL_CONFIG_SH=true" >>config.sh
23768 : propagate old symbols
23769 if $test -f UU/config.sh; then
23770 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
23771 $sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' \
23772 config.sh config.sh UU/oldconfig.sh |\
23773 $sort | $uniq -u >UU/oldsyms
23774 set X `$cat UU/oldsyms`
23780 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
23782 echo ": Variables propagated from previous config.sh file." >>config.sh
23783 for sym in `$cat UU/oldsyms`; do
23784 echo " Propagating $hint variable "'$'"$sym..."
23785 eval 'tmp="$'"${sym}"'"'
23787 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
23793 : Finish up by extracting the .SH files
23797 echo "Extraction done."
23807 If you'd like to make any changes to the config.sh file before I begin
23808 to configure things, do it as a shell escape now (e.g. !vi config.sh).
23811 rp="Press return or use a shell escape to edit config.sh:"
23816 *) : in case they cannot read
23817 sh 1>&4 -c "$ans";;
23822 : if this fails, just run all the .SH files by hand
23831 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
23838 Now you need to generate make dependencies by running "$make depend".
23839 You might prefer to run it in background: "$make depend > makedepend.out &"
23840 It can take a while, so you might not want to run it right now.
23845 rp="Run $make depend now?"
23849 $make depend && echo "Now you must run '$make'."
23852 echo "You must run '$make depend' then '$make'."
23855 elif test -f [Mm]akefile; then
23857 echo "Now you must run a $make."
23859 echo "Configure done."
23862 if $test -f Policy.sh; then
23865 If you compile $package on a different machine or from a different object
23866 directory, copy the Policy.sh file from this object directory to the
23867 new one before you run Configure -- this will help you with most of
23868 the policy defaults.
23872 if $test -f config.msg; then
23873 echo "Hmm. I also noted the following information while running:"
23875 $cat config.msg >&4
23878 $rm -f kit*isdone ark*isdone