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.code.sf.net/p/dist/code/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 Tue Sep 17 10:34:33 CEST 2013 [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
335 useversionedarchname=''
341 initialinstalllocation=''
370 d_attribute_deprecated=''
371 d_attribute_format=''
372 d_attribute_malloc=''
373 d_attribute_nonnull=''
374 d_attribute_noreturn=''
376 d_attribute_unused=''
377 d_attribute_warn_unused_result=''
378 d_printf_format_null=''
381 d_builtin_choose_expr=''
384 d_c99_variadic_macros=''
431 endhostent_r_proto=''
437 endprotoent_r_proto=''
443 endservent_r_proto=''
496 gethostbyaddr_r_proto=''
498 gethostbyname_r_proto=''
500 gethostent_r_proto=''
513 getnetbyaddr_r_proto=''
515 getnetbyname_r_proto=''
529 d_getprotobyname_r=''
530 getprotobyname_r_proto=''
531 d_getprotobynumber_r=''
532 getprotobynumber_r_proto=''
534 getprotoent_r_proto=''
546 getservbyname_r_proto=''
548 getservbyport_r_proto=''
550 getservent_r_proto=''
577 d_libm_lib_version=''
580 d_localtime_r_needs_tzset=''
591 d_malloc_good_size=''
635 d_old_pthread_create_joinable=''
636 old_pthread_create_joinable=''
638 d_pthread_attr_setscope=''
677 sethostent_r_proto=''
694 setprotoent_r_proto=''
706 setservent_r_proto=''
730 d_ipv6_mreq_source=''
747 d_sprintf_returns_strlen=''
759 perl_static_inline=''
764 d_stdio_ptr_lval_nochange_cnt=''
765 d_stdio_ptr_lval_sets_cnt=''
910 d_gdbm_ndbm_h_uses_prototypes=''
911 d_gdbmndbm_h_uses_prototypes=''
913 d_ndbm_h_uses_prototypes=''
988 d_inc_version_list=''
990 inc_version_list_init=''
1009 ignore_versioned_solibs=''
1073 d_perl_otherlibdirs=''
1081 api_versionstring=''
1087 version_patchlevel_string=''
1091 d_nv_preserves_uv=''
1092 d_nv_zero_is_allbits_zero=''
1103 nv_overflows_integers_at=''
1104 nv_preserves_uv_bits=''
1176 installsitehtml1dir=''
1179 installsitehtml3dir=''
1186 installsiteman1dir=''
1189 installsiteman3dir=''
1194 installsitescript=''
1211 d_stdio_stream_array=''
1212 stdio_stream_array=''
1229 usekernprocpathname=''
1230 ccflags_uselargefiles=''
1231 ldflags_uselargefiles=''
1232 libswanted_uselargefiles=''
1241 usensgetexecutablepath=''
1254 installvendorarch=''
1261 installvendorhtml1dir=''
1263 vendorhtml1direxp=''
1264 installvendorhtml3dir=''
1266 vendorhtml3direxp=''
1272 installvendorman1dir=''
1275 installvendorman3dir=''
1282 installvendorscript=''
1293 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1296 : We must find out about Eunice early
1298 if test -f /etc/unixtovms; then
1299 eunicefix=/etc/unixtovms
1301 if test -f /etc/unixtovms.exe; then
1302 eunicefix=/etc/unixtovms.exe
1305 : Set executable suffix now -- needed before hints available
1306 if test -f "/libs/version.library"; then
1309 elif test -f "/system/gnu_library/bin/ar.pm"; then
1312 elif test -n "$DJGPP"; then
1315 elif test -f /kern/cookiejar; then
1318 elif test -d c:/. -o -n "$is_os2" ; then
1325 : Trailing extension. Override this in a hint file, if needed.
1326 : Extra object files, if any, needed on this platform.
1329 : Possible local include directories to search.
1330 : Set locincpth to "" in a hint file to defeat local include searches.
1331 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1332 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1334 : no include file wanted by default
1337 : Enable -DEBUGGING and -DDEBUGGING from the command line
1342 : change the next line if compiling for Xenix/286 on Xenix/386
1343 xlibpth='/usr/lib/386 /lib/386'
1344 : Possible local library directories to search.
1345 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1346 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1348 : general looking path for locating libraries
1349 glibpth="/lib /usr/lib $xlibpth"
1350 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1351 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1352 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1353 test -d /usr/lib64 && glibpth="$glibpth /lib64 /usr/lib64 /usr/local/lib64"
1355 : Private path used by Configure to find libraries. Its value
1356 : is prepended to libpth. This variable takes care of special
1357 : machines, like the mips. Usually, it should be empty.
1360 : default library list
1362 : some systems want to use only the non-versioned libso:s
1363 ignore_versioned_solibs=''
1364 : set usethreads on the Configure command line to enable threads.
1365 usereentrant='undef'
1369 : set useposix=false in your hint file to disable the POSIX extension.
1371 : set useopcode=false in your hint file to disable the Opcode extension.
1374 ccflags_uselargefiles=''
1375 ldflags_uselargefiles=''
1376 libswanted_uselargefiles=''
1377 : set usemultiplicity on the Configure command line to enable multiplicity.
1378 : set usesocks on the Configure command line to enable socks.
1379 : List of libraries we want.
1380 : If anyone needs extra -lxxx, put those in a hint file.
1381 libswanted="sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl ld sun"
1382 libswanted="$libswanted m crypt sec util c cposix posix ucb bsd BSD"
1383 : We probably want to search /usr/shlib before most other libraries.
1384 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1385 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1386 glibpth="/usr/shlib $glibpth"
1387 : Do not use vfork unless overridden by a hint file.
1390 : Find the basic shell for Bourne shell scripts
1394 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1397 if test -f "$xxx"; then
1400 : Build up a list and do a single loop so we can 'break' out.
1401 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1402 for xxx in sh bash ksh pdksh ash; do
1404 try="$try ${p}/${xxx}"
1408 if test -f "$xxx"; then
1411 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1414 elif test -f "$xxx.exe"; then
1425 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1427 Usually it's in /bin/sh. How did you even get this far?
1428 Please contact me (Perl Maintainers) at perlbug@perl.org and
1429 we'll try to straighten this all out.
1435 : see if sh knows # comments
1436 if `$sh -c '#' >/dev/null 2>&1`; then
1440 test -f $xcat$_exe || xcat=/usr/bin/cat
1441 if test ! -f $xcat$_exe; then
1442 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1443 if test -f $p/cat$_exe; then
1448 if test ! -f $xcat$_exe; then
1449 echo "Can't find cat anywhere!"
1453 echo "#!$xcat" >sharp
1456 ./sharp > today 2>/dev/null
1457 if test -s today; then
1460 echo "#! $xcat" > sharp
1463 ./sharp > today 2>/dev/null
1464 if test -s today; then
1472 echo "Your $sh doesn't grok # comments--I will strip them later on."
1475 echo "exec grep -v '^[ ]*#'" >spitshell
1477 $eunicefix spitshell
1478 spitshell=`pwd`/spitshell
1480 echo "I presume that if # doesn't work, #! won't work either!"
1485 : figure out how to guarantee sh startup
1487 '') startsh=${sharpbang}${sh} ;;
1499 : echo "Yup, it does."
1501 echo "Hmm... '$startsh' does not guarantee sh startup..."
1502 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1506 : Save command line options in file UU/cmdline.opt for later use in
1507 : generating config.sh.
1508 cat > cmdline.opt <<EOSH
1509 : Configure command line arguments.
1518 cat >>cmdline.opt <<EOSH
1519 config_arg$argn='$arg'
1521 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1524 arg_exp=`cat cmdl.opt`
1525 args_exp="$args_exp$args_sep'$arg_exp'"
1526 argn=`expr $argn + 1`
1531 : produce awk script to parse command line options
1532 cat >options.awk <<'EOF'
1534 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1536 len = length(optstr);
1537 for (i = 1; i <= len; i++) {
1538 c = substr(optstr, i, 1);
1539 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1550 if (substr(str, 1, 1) != "-") {
1551 printf("'%s'\n", str);
1555 for (i = 2; i <= len; i++) {
1556 c = substr(str, i, 1);
1558 printf("-%s\n", substr(str, i));
1564 printf("'%s'\n", substr(str, i + 1));
1577 : process the command line options
1578 set X `for arg in "$@"; do echo "X$arg"; done |
1579 sed -e s/X// | awk -f options.awk`
1584 : set up default values
1594 rm -f optdef.sh posthint.sh
1595 cat >optdef.sh <<EOS
1601 while test $# -gt 0; do
1603 -d) shift; fastread=yes;;
1604 -e) shift; alldone=cont;;
1608 if test -r "$1"; then
1611 echo "$me: cannot read config file $1." >&2
1617 -h) shift; error=true;;
1618 -r) shift; reuseval=true;;
1619 -s) shift; silent=true; realsilent=true;;
1620 -E) shift; alldone=exit;;
1621 -K) shift; knowitall=true;;
1622 -O) shift; override=true;;
1623 -S) shift; silent=true; extractsh=true;;
1628 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1629 echo "$me: ignoring -D $1" >&2
1632 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1633 *) echo "$1='define'" >> optdef.sh;;
1640 *=) echo "$1" >> optdef.sh;;
1642 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1643 echo "$me: ignoring -U $1" >&2
1645 *) echo "$1='undef'" >> optdef.sh;;
1656 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1660 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1661 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1667 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1668 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1669 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1670 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1671 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1672 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1678 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1680 echo "$yyy=''" >> posthint.sh ;;
1685 echo "$yyy='$zzz'" >> posthint.sh ;;
1687 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1689 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1694 echo "$yyy=$zzz" >> posthint.sh ;;
1695 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1699 -V) echo "$me generated by metaconfig 3.5 PL0." >&2
1702 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1710 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1711 [-U symbol] [-U symbol=] [-A command:symbol...]
1712 -d : use defaults for all answers.
1713 -e : go on without questioning past the production of config.sh.
1714 -f : specify an alternate default configuration file.
1715 -h : print this help message and exit (with an error status).
1716 -r : reuse C symbols value if possible (skips costly nm extraction).
1717 -s : silent mode, only echoes questions and essential information.
1718 -D : define symbol to have some value:
1719 -D symbol symbol gets the value 'define'
1720 -D symbol=value symbol gets the value 'value'
1721 common used examples (see INSTALL for more info):
1722 -Duse64bitint use 64bit integers
1723 -Duse64bitall use 64bit integers and pointers
1724 -Dusethreads use thread support
1725 -Dinc_version_list=none do not include older perl trees in @INC
1726 -DEBUGGING=none DEBUGGING options
1727 -Dcc=gcc choose your compiler
1728 -Dprefix=/opt/perl5 choose your destination
1729 -E : stop at the end of questions, after having produced config.sh.
1730 -K : do not use unless you know what you are doing.
1731 -O : let -D and -U override definitions from loaded configuration file.
1732 -S : perform variable substitutions on all .SH files (can mix with -f)
1733 -U : undefine symbol:
1734 -U symbol symbol gets the value 'undef'
1735 -U symbol= symbol gets completely empty
1737 -A : manipulate symbol after the platform specific hints have been applied:
1738 -A append:symbol=value append value to symbol
1739 -A symbol=value like append:, but with a separating space
1740 -A define:symbol=value define symbol to have value
1741 -A clear:symbol define symbol to be ''
1742 -A define:symbol define symbol to be 'define'
1743 -A eval:symbol=value define symbol to be eval of value
1744 -A prepend:symbol=value prepend value to symbol
1745 -A undef:symbol define symbol to be 'undef'
1746 -A undef:symbol= define symbol to be ''
1747 e.g.: -A prepend:libswanted='cl pthread '
1748 -A ccflags=-DSOME_MACRO
1749 -V : print version number and exit (with a zero status).
1756 case "$fastread$alldone" in
1759 case "$extractsh" in
1762 if test ! -t 0; then
1763 echo "Say 'sh Configure', not 'sh <Configure'"
1773 true) exec 1>/dev/null;;
1776 : run the defines and the undefines, if any, but leave the file out there...
1779 : create the posthint manipulation script and leave the file out there...
1784 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1785 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1786 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1787 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1788 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1791 : Some greps do not return status, grrr.
1792 echo "grimblepritz" >grimble
1793 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1795 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1801 : the following should work in any shell
1805 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1806 cat >contains <<'EOSS'
1807 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1812 : Find the path to the source tree
1815 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1819 *) src=`cd ../$src && pwd` ;;
1832 if test -f $rsrc/Configure && \
1833 $contains "^package='$package'\$" $rsrc/Configure >/dev/null 2>&1
1835 : found it, so we are ok.
1838 for src in . .. ../.. ../../.. ../../../..; do
1839 if test -f ../$src/Configure && \
1840 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1851 Sorry, I can't seem to locate the source dir for $package. Please start
1852 Configure with an explicit path -- i.e. /some/path/Configure.
1860 echo "Sources for $package found in \"$src\"." >&4
1864 : script used to extract .SH files with variable substitutions
1865 cat >extract <<'EOS'
1867 echo "Doing variable substitutions on .SH files..."
1868 if test -f MANIFEST; then
1869 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1871 echo "(Looking for .SH files under the source directory.)"
1872 set x `(cd "$src"; find . -name "*.SH" -print)`
1876 0) set x `(cd "$src"; echo *.SH)`; shift;;
1878 if test ! -f "$src/$1"; then
1884 while test $name; do
1885 if test ! -d "$name"; then
1886 create="$name $create";
1887 name=`echo $name | sed -e "s|^[^/]*$||"`;
1888 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1893 for file in $create; do
1902 dir=`expr X$file : 'X\(.*\)/'`
1903 file=`expr X$file : 'X.*/\(.*\)'`
1904 (cd "$dir" && . ./$file)
1914 dir=`expr X$file : 'X\(.*\)/'`
1915 file=`expr X$file : 'X.*/\(.*\)'`
1916 (set x $dir; shift; eval $mkdir_p)
1917 sh <"$src/$dir/$file"
1926 if test -f "$src/config_h.SH"; then
1927 if test ! -f config.h; then
1928 : oops, they left it out of MANIFEST, probably, so do it anyway.
1929 . "$src/config_h.SH"
1934 : extract files and exit if asked to do so
1935 case "$extractsh" in
1937 case "$realsilent" in
1941 case "$config_sh" in
1942 '') config_sh='config.sh';;
1945 echo "Fetching answers from $config_sh..."
1948 test "$override" && . ./optdef.sh
1952 echo "Extraction done."
1957 : Eunice requires " " instead of "", can you believe it
1960 echo "Beginning of configuration questions for $package."
1962 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1964 : first determine how to suppress newline on echo command
1966 echo "Checking echo to see how to suppress newlines..."
1967 (echo "hi there\c" ; echo " ") >.echotmp
1968 if $contains c .echotmp >/dev/null 2>&1 ; then
1979 echo $n "The star should be here-->$c"
1983 : Now test for existence of everything in MANIFEST
1985 if test -f "$rsrc/MANIFEST"; then
1986 echo "First let's make sure your kit is complete. Checking..." >&4
1987 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | \
1988 (split -l 50 2>/dev/null || split -50)
1991 for filelist in x??; do
1992 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` \
1993 >/dev/null 2>>"$tmppwd/missing")
1995 if test -s missing; then
1999 THIS PACKAGE SEEMS TO BE INCOMPLETE.
2001 You have the option of continuing the configuration process, despite the
2002 distinct possibility that your kit is damaged, by typing 'y'es. If you
2003 do, don't blame me if something goes wrong. I advise you to type 'n'o
2004 and contact the author (perlbug@perl.org).
2007 echo $n "Continue? [n] $c" >&4
2011 echo "Continuing..." >&4
2015 echo "ABORTING..." >&4
2020 echo "Looks good..."
2023 echo "There is no MANIFEST file. I hope your kit is complete !"
2027 : Find the appropriate value for a newline for tr
2029 if test -n "$DJGPP"; then
2032 if test X"$trnl" = X; then
2033 case "`echo foo|tr '\n' x 2>/dev/null`" in
2037 if test X"$trnl" = X; then
2038 case "`echo foo|tr '\012' x 2>/dev/null`" in
2039 foox) trnl='\012' ;;
2042 if test X"$trnl" = X; then
2043 case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
2044 fooxy) trnl='\n\r' ;;
2047 if test X"$trnl" = X; then
2050 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
2056 : compute the number of columns on the terminal for proper question formatting
2061 : set up the echo used in my read
2062 myecho="case \"\$xxxm\" in
2063 '') echo $n \"\$rp $c\" >&4;;
2065 '') echo $n \"[\$xxxm] $c\";;
2067 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
2069 echo $n \"[\$xxxm] $c\" >&4
2071 echo $n \"\$rp [\$xxxm] $c\" >&4
2077 : now set up to do reads with possible shell escape and default assignment
2083 case "\$fastread" in
2084 yes) case "\$dflt" in
2087 case "\$silent-\$rp" in
2092 *) case "\$silent" in
2093 true) case "\$rp" in
2098 while expr "X\$ans" : "X!" >/dev/null; do
2102 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2110 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2119 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2124 echo "(OK, I'll run with -d after this question.)" >&4
2127 echo "*** Sorry, \$1 not supported yet." >&4
2137 echo "*** Substitution done -- please confirm."
2139 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2144 echo "*** Error -- try again."
2151 case "\$ans\$xxxm\$nostick" in
2163 : create .config dir to save info across Configure sessions
2164 test -d ../.config || mkdir ../.config
2165 cat >../.config/README <<EOF
2166 This directory created by Configure to save information that should
2167 persist across sessions for $package.
2169 You may safely delete it if you wish.
2172 : See if we are using a devel version and want that
2173 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2176 usedevel="$define" ;;
2177 *) case "$xversion" in
2180 *** WHOA THERE!!! ***
2182 This is an UNSTABLE DEVELOPMENT release.
2183 The version of this $package distribution is $xversion, that is, odd,
2184 (as opposed to even) and that signifies a development release.
2185 If you want a maintenance release, you want an even-numbered version.
2187 Do ***NOT*** install this into production use.
2188 Data corruption and crashes are possible.
2190 It is most seriously suggested that you do not continue any further
2191 unless you want to help in developing and debugging Perl.
2193 If you *still* want to build perl, you can answer 'y' now,
2194 or pass -Dusedevel to Configure.
2197 rp='Do you really want to continue?'
2201 [yY]) echo >&4 "Okay, continuing."
2202 usedevel="$define" ;;
2203 *) echo >&4 "Okay, bye."
2214 case "$versiononly" in
2215 '') versiononly="$define" ;;
2217 case "$installusrbinperl" in
2218 '') installusrbinperl="$undef" ;;
2223 : general instructions
2226 user=`(logname) 2>/dev/null`
2228 '') user=`whoami 2>&1`;;
2230 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2233 rp='Would you like to see the instructions?'
2244 This installation shell script will examine your system and ask you questions
2245 to determine how the perl5 package should be installed. If you get
2246 stuck on a question, you may use a ! shell escape to start a subshell or
2247 execute a command. Many of the questions will have default answers in square
2248 brackets; typing carriage return will give you the default.
2250 On some of the questions which ask for file or directory names you are allowed
2251 to use the ~name construct to specify the login directory belonging to "name",
2252 even if you don't have a shell which knows about that. Questions where this is
2253 allowed will be marked "(~name ok)".
2257 dflt='Type carriage return to continue'
2261 The prompter used in this script allows you to use shell variables and
2262 backticks in your answers. You may use $1, $2, etc... to refer to the words
2263 in the default answer, as if the default line was a set of arguments given to a
2264 script shell. This means you may also use $* to repeat the whole default line,
2265 so you do not have to re-type everything to add something to the default.
2267 Every time there is a substitution, you will have to confirm. If there is an
2268 error (e.g. an unmatched backtick), the default answer will remain unchanged
2269 and you will be prompted again.
2271 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2272 the questions and use the computed defaults (or the previous answers if there
2273 was already a config.sh file). Type 'Configure -h' for a list of options.
2274 You may also start interactively and then answer '& -d' at any prompt to turn
2275 on the non-interactive behaviour for the remainder of the execution.
2281 Much effort has been expended to ensure that this shell script will run on any
2282 Unix system. If despite that it blows up on yours, your best bet is to edit
2283 Configure and run it again. If you can't run Configure for some reason,
2284 you'll have to generate a config.sh file by hand. Whatever problems you
2285 have, let me (perlbug@perl.org) know how I blew it.
2287 This installation script affects things in two ways:
2289 1) it may do direct variable substitutions on some of the files included
2291 2) it builds a config.h file for inclusion in C programs. You may edit
2292 any of these files as the need arises after running this script.
2294 If you make a mistake on a question, there is no easy way to back up to it
2295 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2296 files. Configure will offer to let you do this before it runs the SH files.
2299 dflt='Type carriage return to continue'
2301 case "$firsttime" in
2302 true) echo $user >>../.config/instruct;;
2306 : find out where common programs are
2308 echo "Locating common programs..." >&4
2321 if test -d \$dir/\$thing; then
2327 for thisthing in \$dir/\$thing; do
2328 : just loop through to pick last item
2330 if test -f \$thisthing; then
2333 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2336 elif test -f \$dir/\$thing.exe; then
2337 if test -n "$DJGPP"; then
2338 echo \$dir/\$thing.exe
2339 elif test "$eunicefix" != ":"; then
2340 : on Eunice apparently
2393 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2394 pth="$pth /lib /usr/lib"
2395 for file in $loclist; do
2399 if test -f "$xxx"; then
2402 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2403 xxx=`./loc $file $file $pth`
2406 '') xxx=`./loc $file $file $pth`;;
2407 *) xxx=`./loc $xxx $xxx $pth`;;
2409 eval $file=$xxx$_exe
2413 echo $file is in $xxx.
2416 echo $file is in $xxx.
2419 echo "I don't know where '$file' is, and my life depends on it." >&4
2420 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2426 echo "Don't worry if any of the following aren't found..."
2428 for file in $trylist; do
2432 if test -f "$xxx"; then
2435 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2436 xxx=`./loc $file $file $pth`
2439 '') xxx=`./loc $file $file $pth`;;
2440 *) xxx=`./loc $xxx $xxx $pth`;;
2442 eval $file=$xxx$_exe
2446 echo $file is in $xxx.
2449 echo $file is in $xxx.
2452 echo "I don't see $file out there, $say."
2459 echo "Substituting grep for egrep."
2466 *) if $less -R </dev/null >/dev/null; then
2467 echo "Substituting less -R for less."
2475 echo "Substituting cp for ln."
2484 echo "I can't find make or gmake, and my life depends on it." >&4
2485 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2493 *) # We can't have osname yet.
2494 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2495 # Assume that gmake, if found, is definitely GNU make
2496 # and prefer it over the system make.
2497 echo "Substituting gmake for make."
2505 echo "Hopefully test is built into your sh."
2508 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2509 echo "Using the test built into your sh."
2517 echo "Hopefully echo is built into your sh."
2522 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2523 $echo $n "hi there$c" >foo1
2524 echo $n "hi there$c" >foo2
2525 if cmp foo1 foo2 >/dev/null 2>&1; then
2526 echo "They are compatible. In fact, they may be identical."
2533 They are not compatible! You are probably running ksh on a non-USG system.
2534 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2535 have echo built in and we may have to run some Bourne shell scripts. That
2536 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2539 $echo $n "The star should be here-->$c"
2546 # This question was auctioned at YAPC::Europe-2007 in Vienna
2547 # I never promised you could answer it. I only auctioned the question.
2549 The following message is sponsored by
2551 Dresden.pm<--The stars should be here.
2553 Dear Perl user, system administrator or package
2554 maintainer, the Perl community sends greetings to
2555 you. Do you (emblematical) greet back [Y/n]? n
2559 : Check what type of C compiler we use
2563 cat <<'EOSC' >>trygcc
2568 int main(int argc, char *argv[]) {
2572 if $cc -o try $ccflags $ldflags try.c; then
2575 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2581 # Skip this test because it gives a false match on output like:
2582 # ./trygcc: line 23: cc: command not found
2583 # case "`$cc -v -c try.c 2>&1`" in
2584 # *gcc*) trygcc=no ;;
2586 if $test X"$trygcc" = Xyes; then
2587 if gcc -o try -c try.c; then
2589 echo "You seem to have a working gcc, though." >&4
2590 # Switching compilers may undo the work of hints files.
2591 # The most common problem is -D_REENTRANT for threads.
2592 # This heuristic catches that case, but gets false positives
2593 # if -Dusethreads was not actually specified. Better to
2594 # bail out here with a useful message than fail
2595 # mysteriously later. Should we perhaps just try to
2596 # re-invoke Configure -Dcc=gcc config_args ?
2597 if $test -f usethreads.cbu; then
2600 *** However, any setting of the C compiler flags (e.g. for thread support)
2601 *** will be lost. It may be necessary for you to restart Configure and
2602 *** add -Dcc=gcc to your Configure command line.
2605 rp="Would you like to go ahead and try gcc anyway?"
2608 rp="Would you like to use it?"
2611 if $test -f myread; then
2614 if $test -f UU/myread; then
2617 echo "Cannot find myread, sorry. Aborting." >&2
2622 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2635 cat <<'EOSC' >>checkcc
2640 int main(int argc, char *argv[]) {
2644 if $cc -o try $ccflags $ldflags try.c; then
2647 if $test X"$despair" = Xyes; then
2648 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2651 You need to find a working C compiler.
2652 Either (purchase and) install the C compiler supplied by your OS vendor,
2653 or for a free C compiler try http://gcc.gnu.org/
2654 I cannot continue any further, aborting.
2663 : determine whether symbolic links are supported
2666 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2667 echo "Symbolic links are supported." >&4
2670 echo "Symbolic links are NOT supported." >&4
2675 : determine whether symbolic links are supported
2679 echo "Checking how to test for symbolic links..." >&4
2681 if $test "X$issymlink" = X; then
2683 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2684 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2686 if test $? = 0; then
2689 echo "Your builtin 'test -h' may be broken." >&4
2692 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2695 if test -f "$p/$test"; then
2704 echo "Trying external '$test -h'." >&4
2705 issymlink="$test -h"
2706 if $test ! -h sym >/dev/null 2>&1; then
2707 echo "External '$test -h' is broken, too." >&4
2715 if $test "X$issymlink" = X; then
2716 if $test -L sym 2>/dev/null; then
2717 issymlink="$test -L"
2718 echo "The builtin '$test -L' worked." >&4
2721 if $test "X$issymlink" != X; then
2722 echo "You can test for symbolic links with '$issymlink'." >&4
2724 echo "I do not know how you can test for symbolic links." >&4
2728 *) echo "No symbolic links, so not testing for their testing..." >&4
2733 : Make symlinks util
2734 case "$mksymlinks" in
2737 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2740 *) case "$lns:$issymlink" in
2741 *"ln"*" -s:"*"test -"?)
2742 echo "Creating the symbolic links..." >&4
2743 echo "(First creating the subdirectories...)" >&4
2745 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2747 test -z "$directory" && break
2751 if test ! -d t/base; then
2752 echo "Failed to create the subdirectories. Aborting." >&4
2755 echo "(Then creating the symlinks...)" >&4
2756 awk '{print $1}' $src/MANIFEST | while true; do
2758 test -z "$filename" && break
2759 if test -f $filename; then
2760 if $issymlink $filename; then
2764 if test -f $filename; then
2765 echo "$filename already exists, not symlinking."
2767 ln -s $src/$filename $filename
2771 if test ! -f t/base/lex.t; then
2772 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2777 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2785 : Check for Cross-Compilation
2786 case "$usecrosscompile" in
2788 $echo "Cross-compiling..."
2791 *-*-gcc) # A cross-compiling gcc, probably.
2792 targetarch=`$echo $cc|$sed 's/-gcc$//'`
2794 # leave out ld, choosing it is more complex
2796 ranlib=$targetarch-ranlib
2797 $echo 'extern int foo;' > try.c
2798 set X `$cc -v -E try.c 2>&1 | $awk '/^#include </,/^End of search /'|$grep '/include'`
2800 if $test $# -gt 0; then
2802 incpth="`$echo $incpth|$sed 's/^ //'`"
2803 echo "Guessing incpth '$incpth'." >&4
2805 j="`$echo $i|$sed 's,/include$,/lib,'`"
2806 if $test -d $j; then
2810 libpth="`$echo $libpth|$sed 's/^ //'`"
2811 echo "Guessing libpth '$libpth'." >&4
2816 case "$targetarch" in
2817 '') echo "Targetarch not defined." >&4; croak=y ;;
2818 *) echo "Using targetarch $targetarch." >&4 ;;
2821 '') echo "Incpth not defined." >&4; croak=y ;;
2822 *) echo "Using incpth '$incpth'." >&4 ;;
2825 '') echo "Libpth not defined." >&4; croak=y ;;
2826 *) echo "Using libpth '$libpth'." >&4 ;;
2829 '') for i in $incpth; do
2830 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
2832 echo "Guessing usrinc $usrinc." >&4
2837 '') echo "Usrinc not defined." >&4; croak=y ;;
2840 *) echo "Using usrinc $usrinc." >&4 ;;
2842 case "$targethost" in
2843 '') echo "Targethost not defined." >&4; croak=y ;;
2844 *) echo "Using targethost $targethost." >&4
2849 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2852 /*) run=$src/Cross/run
2853 targetmkdir=$src/Cross/mkdir
2855 from=$src/Cross/from
2857 *) pwd=`$test -f ../Configure & cd ..; pwd`
2859 targetmkdir=$pwd/Cross/mkdir
2861 from=$pwd/Cross/from
2864 case "$targetrun" in
2865 '') targetrun=ssh ;;
2870 case "$targetfrom" in
2871 '') targetfrom=scp ;;
2875 from=$from-$targetfrom
2876 case "$targetdir" in
2878 echo "Guessing targetdir $targetdir." >&4
2881 case "$targetuser" in
2883 echo "Guessing targetuser $targetuser." >&4
2886 case "$targetfrom" in
2890 case "$targetrun" in
2902 '') cwd=$targetdir ;;
2906 if $test ! -f \$exe.xok; then
2910 $targetrun -l $targetuser $targethost "cd \$cwd && ./\$exe \$@"
2913 *) echo "Unknown targetrun '$targetrun'" >&4
2917 case "$targetmkdir" in
2919 cat >$targetmkdir <<EOF
2921 $targetrun -l $targetuser $targethost "mkdir -p \$@"
2923 $chmod a+rx $targetmkdir
2925 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
2937 $targetmkdir \`dirname \$f\`
2938 $targetto $q \$f $targetuser@$targethost:\$f || exit 1
2941 $targetmkdir $targetdir/\`dirname \$f\`
2942 $targetto $q \$f $targetuser@$targethost:$targetdir/\$f || exit 1
2955 $mkdir -p $targetdir/\`dirname \$f\`
2956 $cp \$f $targetdir/\$f || exit 1
2959 $targetmkdir $targetdir/\`dirname \$f\`
2960 $cp \$f $targetdir/\$f || exit 1
2967 *) echo "Unknown targetto '$targetto'" >&4
2971 case "$targetfrom" in
2978 $targetfrom $q $targetuser@$targethost:$targetdir/\$f . || exit 1
2983 cp) cat >$from <<EOF
2988 cp $targetdir/\$f . || exit 1
2993 *) echo "Unknown targetfrom '$targetfrom'" >&4
2997 if $test ! -f $run; then
2998 echo "Target 'run' script '$run' not found." >&4
3002 if $test ! -f $to; then
3003 echo "Target 'to' script '$to' not found." >&4
3007 if $test ! -f $from; then
3008 echo "Target 'from' script '$from' not found." >&4
3012 if $test ! -f $run -o ! -f $to -o ! -f $from; then
3016 Using '$run' for remote execution,
3017 and '$from' and '$to'
3018 for remote file transfer.
3024 usecrosscompile='undef'
3029 : see whether [:lower:] and [:upper:] are supported character classes
3031 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
3033 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
3037 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
3038 # (0xd9 and 0xe2), therefore that is a nice testing point.
3039 if test "X$up" = X -o "X$low" = X; then
3040 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
3046 if test "X$up" = X -o "X$low" = X; then
3047 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
3053 if test "X$up" = X -o "X$low" = X; then
3054 case "`echo RS | od -x 2>/dev/null`" in
3056 echo "Hey, this might be EBCDIC." >&4
3057 if test "X$up" = X -o "X$low" = X; then
3058 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
3059 rs) up='[A-IJ-RS-Z]'
3064 if test "X$up" = X -o "X$low" = X; then
3065 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
3075 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
3077 echo "Using $up and $low to convert case." >&4
3080 echo "I don't know how to translate letters from upper to lower case." >&4
3081 echo "Your tr is not acting any way I know of." >&4
3085 : set up the translation script tr, must be called with ./tr of course
3089 '[A-Z][a-z]') exec $tr '$up' '$low';;
3090 '[a-z][A-Z]') exec $tr '$low' '$up';;
3097 : Try to determine whether config.sh was made on this system
3098 case "$config_sh" in
3100 myuname=`$uname -a 2>/dev/null`
3101 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
3102 # Downcase everything to avoid ambiguity.
3103 # Remove slashes and single quotes so we can use parts of this in
3104 # directory and file names.
3105 # Remove newlines so myuname is sane to use elsewhere.
3106 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
3107 # because the A-Z/a-z are not consecutive.
3108 myuname=`echo $myuname | $sed -e "s,['/],,g" | \
3109 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
3110 newmyuname="$myuname"
3112 case "$knowitall" in
3114 if test -f ../config.sh; then
3115 if $contains myuname= ../config.sh >/dev/null 2>&1; then
3116 eval "`grep myuname= ../config.sh`"
3118 if test "X$myuname" = "X$newmyuname"; then
3126 : Get old answers from old config file if Configure was run on the
3127 : same system, otherwise use the hints.
3130 if test -f config.sh; then
3132 rp="I see a config.sh file. Shall I use it to set the defaults?"
3135 n*|N*) echo "OK, I'll ignore it."
3136 mv config.sh config.sh.old
3137 myuname="$newmyuname"
3139 *) echo "Fetching default answers from your old config.sh file..." >&4
3147 : Older versions did not always set $sh. Catch re-use of such
3157 if test ! -f config.sh; then
3160 First time through, eh? I have some defaults handy for some systems
3161 that need some extra help getting the Configure answers right:
3164 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3166 : Half the following guesses are probably wrong... If you have better
3167 : tests or hints, please send them to perlbug@perl.org
3168 : The metaconfig authors would also appreciate a copy...
3169 $test -f /irix && osname=irix
3170 $test -f /xenix && osname=sco_xenix
3171 $test -f /dynix && osname=dynix
3172 $test -f /dnix && osname=dnix
3173 $test -f /lynx.os && osname=lynxos
3174 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3175 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3176 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3177 $test -f /bin/mips && /bin/mips && osname=mips
3178 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
3179 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
3180 $test -d /usr/apollo/bin && osname=apollo
3181 $test -f /etc/saf/_sactab && osname=svr4
3182 $test -d /usr/include/minix && osname=minix
3183 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3184 if $test -d /MachTen -o -d /MachTen_Folder; then
3186 if $test -x /sbin/version; then
3187 osvers=`/sbin/version | $awk '{print $2}' |
3188 $sed -e 's/[A-Za-z]$//'`
3189 elif $test -x /usr/etc/version; then
3190 osvers=`/usr/etc/version | $awk '{print $2}' |
3191 $sed -e 's/[A-Za-z]$//'`
3197 $test -f /sys/posix.dll &&
3198 $test -f /usr/bin/what &&
3199 set X `/usr/bin/what /sys/posix.dll` &&
3200 $test "$3" = UWIN &&
3204 if $test -f $uname; then
3212 umips) osname=umips ;;
3215 [23]100) osname=mips ;;
3216 next*) osname=next ;;
3218 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3219 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3222 elif $test -f /etc/kconfig; then
3224 if test "$lns" = "$ln -s"; then
3226 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3228 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3235 if test -n "$DJGPP"; then
3244 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3246 # oslevel can fail with:
3247 # oslevel: Unable to acquire lock.
3248 *not\ found) osvers="$4"."$3" ;;
3249 '<3240'|'<>3240') osvers=3.2.0 ;;
3250 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3251 '=3250'|'>3250') osvers=3.2.5 ;;
3255 bitrig) osname=bitrig
3258 bsd386) osname=bsd386
3261 cygwin*) osname=cygwin
3264 *dc.osx) osname=dcosx
3270 domainos) osname=apollo
3276 dragonfly) osname=dragonfly
3279 dynixptx*) osname=dynixptx
3280 osvers=`echo "$4"|sed 's/^v//'`
3282 freebsd) osname=freebsd
3284 genix) osname=genix ;;
3288 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3304 netbsd*) osname=netbsd
3307 news-os) osvers="$3"
3309 4*) osname=newsos4 ;;
3313 next*) osname=next ;;
3314 nonstop-ux) osname=nonstopux ;;
3315 openbsd) osname=openbsd
3321 POSIX-BC | posix-bc ) osname=posix-bc
3324 powerux | power_ux | powermax_os | powermaxos | \
3325 powerunix | power_unix) osname=powerux
3331 solaris) osname=solaris
3333 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3340 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3344 titanos) osname=titanos
3353 ultrix) osname=ultrix
3356 osf1|mls+) case "$5" in
3359 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3362 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3365 hp*) osname=hp_osf1 ;;
3366 mips) osname=mips_osf1 ;;
3369 # UnixWare 7.1.2 is known as Open UNIX 8
3370 openunix|unixware) osname=svr5
3378 $2) case "$osname" in
3382 : svr4.x or possibly later
3392 if test -f /stand/boot ; then
3393 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3394 if test -n "$INITPROG" -a -f "$INITPROG"; then
3395 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3396 if test -n "$isesix"; then
3404 *) if test -f /etc/systemid; then
3406 set `echo $3 | $sed 's/\./ /g'` $4
3407 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3409 elif $test -f $src/hints/sco_$1_$2.sh; then
3411 elif $test -f $src/hints/sco_$1.sh; then
3416 '') : Still unknown. Probably a generic Sys V.
3425 *) case "$osname" in
3426 '') : Still unknown. Probably a generic BSD.
3434 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3435 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3436 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3439 $rm -f UU/kernel.what
3440 elif test -d c:/. -o -n "$is_os2" ; then
3447 case "$targetarch" in
3450 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3455 : Now look for a hint file osname_osvers, unless one has been
3456 : specified already.
3459 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3460 : Also try without trailing minor version numbers.
3461 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3462 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3463 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3464 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3467 *) case "$osvers" in
3470 *) if $test -f $src/hints/$file.sh ; then
3472 elif $test -f $src/hints/$xfile.sh ; then
3474 elif $test -f $src/hints/$xxfile.sh ; then
3476 elif $test -f $src/hints/$xxxfile.sh ; then
3478 elif $test -f $src/hints/$xxxxfile.sh ; then
3480 elif $test -f "$src/hints/${osname}.sh" ; then
3489 if $test -f Policy.sh ; then
3492 none) dflt="Policy" ;;
3493 *) dflt="Policy $dflt" ;;
3498 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3502 if $test -f Policy.sh ; then
3505 There's also a Policy hint file available, which should make the
3506 site-specific (policy) questions easier to answer.
3513 You may give one or more space-separated answers, or "none" if appropriate.
3514 If you have a handcrafted Policy.sh file or a Policy.sh file generated by a
3515 previous run of Configure, you may specify it as well as or instead of
3516 OS-specific hints. If hints are provided for your OS, you should use them:
3517 although Perl can probably be built without hints on many platforms, using
3518 hints often improve performance and may enable features that Configure can't
3519 set up on its own. If there are no hints that match your OS, specify "none";
3520 DO NOT give a wrong version or a wrong OS.
3524 rp="Which of these apply, if any?"
3527 for file in $tans; do
3528 if $test X$file = XPolicy -a -f Policy.sh; then
3530 $cat Policy.sh >> UU/config.sh
3531 elif $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"$tans" = X -o X"$tans" = Xnone ; then
3537 : Give one chance to correct a possible typo.
3538 echo "$file.sh does not exist"
3540 rp="hint to use instead?"
3542 for file in $ans; do
3543 if $test -f "$src/hints/$file.sh"; then
3544 . $src/hints/$file.sh
3545 $cat $src/hints/$file.sh >> UU/config.sh
3546 elif $test X$ans = X -o X$ans = Xnone ; then
3549 echo "$file.sh does not exist -- ignored."
3556 : Remember our hint file for later.
3557 if $test -f "$src/hints/$file.sh" ; then
3567 echo "Fetching default answers from $config_sh..." >&4
3571 cp $config_sh config.sh 2>/dev/null
3581 test "$override" && . ./optdef.sh
3583 : Restore computed paths
3584 for file in $loclist $trylist; do
3585 eval $file="\$_$file"
3590 Configure uses the operating system name and version to set some defaults.
3591 The default value is probably right if the name rings a bell. Otherwise,
3592 since spelling matters for me, either accept the default or answer "none"
3599 ''|' '|none) dflt=none ;;
3600 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3603 *) dflt="$osname" ;;
3605 rp="Operating system name?"
3609 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3615 ''|' '|none) dflt=none ;;
3616 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3617 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3619 ''|' ') dflt=none ;;
3624 *) dflt="$osvers" ;;
3626 rp="Operating system version?"
3636 : who configured the system
3637 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3640 cf_by=`(logname) 2>/dev/null`
3643 cf_by=`(whoami) 2>/dev/null`
3645 "") cf_by=unknown ;;
3650 : decide how portable to be. Allow command line overrides.
3651 case "$d_portable" in
3653 *) d_portable="$define" ;;
3656 : set up shell script to do ~ expansion
3662 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3665 if $test -f /bin/csh; then
3666 /bin/csh -f -c "glob \$1"
3671 name=\`$expr x\$1 : '..\([^/]*\)'\`
3672 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3673 if $test ! -d "\$dir"; then
3675 echo "\$me: can't locate home directory for: \$name" >&2
3680 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3696 : now set up to get a file name
3700 cat <<'EOSC' >>getfile
3716 : getfile will accept an answer from the comma-separated list
3717 : enclosed in parentheses even if it does not meet other criteria.
3718 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3719 fn=`echo $fn | sed 's/(.*)//'`
3725 loc_file=`expr $fn : '.*:\(.*\)'`
3726 fn=`expr $fn : '\(.*\):.*'`
3734 */*) fullpath=true;;
3743 *e*) exp_file=true;;
3746 *p*) nopath_ok=true;;
3751 *d*) type='Directory';;
3752 *l*) type='Locate';;
3757 Locate) what='File';;
3762 case "$d_portable" in
3770 while test "$type"; do
3775 true) rp="$rp (~name ok)";;
3778 if test -f UU/getfile.ok && \
3779 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3798 value=`UU/filexp $ans`
3801 if test "$ans" != "$value"; then
3802 echo "(That expands to $value on this system.)"
3816 /*) value="$ansexp" ;;
3817 [a-zA-Z]:/*) value="$ansexp" ;;
3822 echo "I shall only accept a full path name, as in /bin/ls." >&4
3823 echo "Use a ! shell escape if you wish to check pathnames." >&4
3826 echo "Please give a full path name, starting with slash." >&4
3829 echo "Note that using ~name is ok provided it expands well." >&4
3842 for fp in $gfpth; do
3843 if test "X$fp" = X.; then
3848 if test -f "$pf"; then
3850 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3852 echo "($value is not a plain file, but that's ok.)"
3855 if test X"$type" = X; then
3862 for fp in $gfpth; do
3863 if test "X$fp" = X.; then
3868 direxp="$fp/$ansexp"
3870 if test -d "$direxp"; then
3878 if test -d "$ansexp"; then
3879 echo "(Looking for $loc_file in directory $value.)"
3880 value="$value/$loc_file"
3881 ansexp="$ansexp/$loc_file"
3883 if test -f "$ansexp"; then
3886 case "$nopath_ok" in
3887 true) case "$value" in
3889 *) echo "Assuming $value will be in people's path."
3905 if test "$fastread" = yes; then
3910 rp="$what $value doesn't exist. Use that name anyway?"
3929 test "X$gfpthkeep" != Xy && gfpth=""
3932 : determine root of directory hierarchy where package will be installed.
3935 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
3938 dflt=`echo "$prefix" | sed 's/.$//'`
3946 By default, $package will be installed in $dflt/bin, manual pages
3947 under $dflt/man, etc..., i.e. with $dflt as prefix for all
3948 installation directories. Typically this is something like /usr/local.
3949 If you wish to have binaries under /usr/bin but other parts of the
3950 installation under /usr/local, that's ok: you will be prompted
3951 separately for each of the installation directories, the prefix being
3952 only used to set the defaults.
3956 rp='Installation prefix to use?'
3964 *) oldprefix="$prefix";;
3971 : allow them to override the AFS root
3974 *) afsroot=$afsroot ;;
3980 $define|true) afs=true ;;
3981 $undef|false) afs=false ;;
3982 *) if $test -d $afsroot; then
3990 echo "AFS may be running... I'll be extra cautious then..." >&4
3992 echo "AFS does not seem to be running..." >&4
3995 : determine installation prefix for where package is to be installed.
3999 Since you are running AFS, I need to distinguish the directory in which
4000 files will reside from the directory in which they are installed (and from
4001 which they are presumably copied to the former directory by occult means).
4004 case "$installprefix" in
4005 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
4006 *) dflt="$installprefix";;
4011 In some special cases, particularly when building $package for distribution,
4012 it is convenient to distinguish the directory in which files should be
4013 installed from the directory ($prefix) in which they will
4014 eventually reside. For most users, these two directories are the same.
4017 case "$installprefix" in
4019 *) dflt=$installprefix;;
4023 rp='What installation prefix should I use for installing files?'
4025 installprefix="$ans"
4026 installprefixexp="$ansexp"
4028 : Perform the prefixexp/installprefixexp correction if necessary
4029 cat <<EOS >installprefix
4032 cat <<'EOSC' >>installprefix
4033 : Change installation prefix, if necessary.
4034 if $test X"$prefix" != X"$installprefix"; then
4035 eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`"
4037 eval "install${prefixvar}=\"\$${prefixvar}exp\""
4040 chmod +x installprefix
4041 $eunicefix installprefix
4043 : Set variables such as privlib and privlibexp from the output of ./getfile
4044 : performing the prefixexp/installprefixexp correction if necessary.
4045 cat <<EOS >setprefixvar
4048 cat <<'EOSC' >>setprefixvar
4049 eval "${prefixvar}=\"\$ans\""
4050 eval "${prefixvar}exp=\"\$ansexp\""
4053 chmod +x setprefixvar
4054 $eunicefix setprefixvar
4056 : set up the script used to warn in case of inconsistency
4065 '') echo "The $hint value for \$$var on this machine was \"$was\"!" >&4
4067 *) echo "Hmm. Based on the hints in hints/$hintfile.sh, " >&4
4068 echo "the $hint value for \$$var on this machine was \"$was\"!" >&4
4073 echo "*** WHOA THERE!!! ***" >&4
4074 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
4077 rp=" Keep the $hint value?"
4080 y) td=$was; tu=$was;;
4084 : function used to set '$1' to '$val'
4085 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
4087 $define$undef) . ./whoa; eval "$var=\$td";;
4088 $undef$define) . ./whoa; eval "$var=\$tu";;
4089 *) eval "$var=$val";;
4092 : get the patchlevel
4094 echo "Getting the current patchlevel..." >&4
4095 if $test -r $rsrc/patchlevel.h;then
4096 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
4097 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
4098 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4099 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
4100 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
4101 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4102 perl_patchlevel=`egrep ',"(MAINT|SMOKE)[0-9][0-9]*"' $rsrc/patchlevel.h|tail -1|sed 's/[^0-9]//g'`
4111 $echo "(You do not have patchlevel.h. Eek.)"
4113 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
4114 version_patchlevel_string="version $patchlevel subversion $subversion"
4115 case "$perl_patchlevel" in
4117 *) perl_patchlevel=`echo $perl_patchlevel | sed 's/.* //'`
4118 version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel"
4122 $echo "(You have $package $version_patchlevel_string.)"
4126 : XXX Should be a Configure test for double-dots in filenames.
4127 version=`echo $revision $patchlevel $subversion | \
4128 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4129 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4130 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4133 version=`echo $revision $patchlevel $subversion | \
4134 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4135 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4136 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4139 : Special case the 5.005_xx maintenance series, which used 5.005
4140 : without any subversion label as a subdirectory in $sitelib
4141 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
4142 api_versionstring='5.005'
4145 : Do we want threads support and if so, what type
4146 case "$usethreads" in
4147 $define|true|[yY]*) dflt='y';;
4148 *) # Catch case where user specified ithreads or 5005threads but
4149 # forgot -Dusethreads (A.D. 4/2002)
4150 case "$useithreads$use5005threads" in
4151 *$define*) dflt='y';;
4158 Perl can be built to offer a form of threading support on some systems
4159 To do so, Configure can be run with -Dusethreads.
4161 Note that Perl built with threading support runs slightly slower
4162 and uses slightly more memory than plain Perl.
4164 If this doesn't make any sense to you, just accept the default '$dflt'.
4166 rp='Build a threading Perl?'
4169 y|Y) val="$define" ;;
4175 if $test $patchlevel -lt 9; then
4176 case "$usethreads" in
4178 : Default to ithreads unless overridden on command line or with
4181 case "$use5005threads" in
4183 echo "5.005 threads are no longer supported"
4187 case "$useithreads" in
4188 $undef|false|[nN]*) dflt='n';;
4190 rp='Use the newer interpreter-based ithreads?'
4193 y|Y) val="$define" ;;
4198 : Now set use5005threads to the opposite value.
4199 case "$useithreads" in
4200 $define) val="$undef" ;;
4207 useithreads="$undef"
4208 use5005threads="$undef"
4212 case "$useithreads$use5005threads" in
4216 You cannot have both the ithreads and the 5.005 threads enabled
4217 at the same time. Disabling the 5.005 threads since they are
4218 much less stable than the ithreads.
4221 use5005threads="$undef"
4226 : perl-5.9.x and later
4228 if test X"$usethreads" = "X$define"; then
4229 case "$use5005threads" in
4233 5.005 threads has been removed for 5.10. Perl will be built using ithreads.
4240 use5005threads="$undef"
4241 useithreads="$usethreads"
4244 case "$d_oldpthreads" in
4245 '') : Configure tests would be welcome here. For now, assume undef.
4247 *) val="$d_oldpthreads" ;;
4253 : Look for a hint-file generated 'call-back-unit'. If the
4254 : user has specified that a threading perl is to be built,
4255 : we may need to set or change some other defaults.
4256 if $test -f usethreads.cbu; then
4257 echo "Your platform has some specific hints regarding threaded builds, using them..."
4260 case "$usethreads" in
4261 "$define"|true|[yY]*)
4263 (Your platform does not have any specific hints for threaded builds.
4264 Assuming POSIX threads, then.)
4270 : Check if multiplicity is required
4273 Perl can be built so that multiple Perl interpreters can coexist
4274 within the same Perl executable.
4277 case "$useithreads" in
4280 This multiple interpreter support is required for interpreter-based threads.
4284 *) case "$usemultiplicity" in
4285 $define|true|[yY]*) dflt='y';;
4289 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
4290 rp='Build Perl for multiplicity?'
4293 y|Y) val="$define" ;;
4301 : Check if morebits is requested
4302 case "$usemorebits" in
4303 "$define"|true|[yY]*)
4304 use64bitint="$define"
4305 uselongdouble="$define"
4306 usemorebits="$define"
4308 *) usemorebits="$undef"
4312 : Determine the C compiler to be used
4318 rp="Use which C compiler?"
4322 : See whether they have no cc but they do have gcc
4324 if $test -f cc.cbu; then
4329 : make some quick guesses about what we are up against
4331 $echo $n "Hmm... $c"
4341 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
4342 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
4344 echo "Looks kind of like an OSF/1 system, but we'll see..."
4346 elif test `echo abc | $tr a-z A-Z` = Abc ; then
4347 xxx=`./loc addbib blurfl $pth`
4348 if $test -f $xxx; then
4349 echo "Looks kind of like a USG system with BSD features, but we'll see..."
4353 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
4354 echo "Looks kind of like an extended USG system, but we'll see..."
4356 echo "Looks kind of like a USG system, but we'll see..."
4360 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
4361 echo "Looks kind of like a BSD system, but we'll see..."
4365 echo "Looks kind of like a Version 7 system, but we'll see..."
4368 case "$eunicefix" in
4371 There is, however, a strange, musty smell in the air that reminds me of
4372 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
4376 : it so happens the Eunice I know will not run shell scripts in Unix format
4380 echo "Congratulations. You aren't running Eunice."
4384 : Detect OS2. The p_ variable is set above in the Head.U unit.
4385 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
4386 : semicolon as a patch separator
4391 I have the feeling something is not exactly right, however...don't tell me...
4392 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
4393 (Or you may be running DOS with DJGPP.)
4398 if test -f /xenix; then
4399 echo "Actually, this looks more like a XENIX system..."
4404 echo "It's not Xenix..."
4409 if test -f /venix; then
4410 echo "Actually, this looks more like a VENIX system..."
4417 echo "Nor is it Venix..."
4420 chmod +x bsd usg v7 osf1 eunice xenix venix os2
4421 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
4424 : Check if we are using GNU gcc and what its version is
4426 echo "Checking for GNU cc in disguise and/or its version number..." >&4
4430 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
4432 printf("%s\n", __VERSION__);
4434 printf("%s\n", "1");
4440 if $cc -o try $ccflags $ldflags try.c; then
4441 gccversion=`$run ./try`
4442 case "$gccversion" in
4443 '') echo "You are not using GNU cc." ;;
4444 *) echo "You are using GNU cc $gccversion."
4450 echo "*** WHOA THERE!!! ***" >&4
4451 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
4452 case "$knowitall" in
4454 echo " You'd better start hunting for one and let me know about it." >&4
4460 case "$gccversion" in
4461 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
4463 case "$gccversion" in
4464 '') gccosandvers='' ;;
4465 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
4466 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
4468 case "$gccosandvers" in
4469 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
4470 $osname$osvers) ;; # looking good
4471 $osname*) cat <<EOM >&4
4473 *** WHOA THERE!!! ***
4475 Your gcc has not been compiled for the exact release of
4476 your operating system ($gccosandvers versus $osname$osvers).
4478 In general it is a good idea to keep gcc synchronized with
4479 the operating system because otherwise serious problems
4480 may ensue when trying to compile software, like Perl.
4482 I'm trying to be optimistic here, though, and will continue.
4483 If later during the configuration and build icky compilation
4484 problems appear (headerfile conflicts being the most common
4485 manifestation), I suggest reinstalling the gcc to match
4486 your operating system release.
4490 *) gccosandvers='' ;; # failed to parse, better be silent
4498 # gcc 3.* complain about adding -Idirectories that they already know about,
4499 # so we will take those off from locincpth.
4500 case "$gccversion" in
4502 echo "main(){}">try.c
4503 for incdir in $locincpth; do
4504 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
4505 grep '^c[cp]p*[01]: warning: changing search order '`
4506 if test "X$warn" != X; then
4507 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
4513 : What should the include directory be ?
4515 $echo $n "Hmm... $c"
4519 if $test -f /bin/mips && /bin/mips; then
4520 echo "Looks like a MIPS system..."
4521 $cat >usr.c <<'EOCP'
4522 #ifdef SYSTYPE_BSD43
4526 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4527 dflt='/bsd43/usr/include'
4531 mips_type='System V'
4533 $rm -f usr.c usr.out
4534 echo "and you're compiling with the $mips_type compiler and libraries."
4538 echo "Doesn't look like a MIPS system."
4548 case "$xxx_prompt" in
4551 rp='Where are the include files you want to use?'
4559 : see how we invoke the C preprocessor
4561 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4562 cat <<'EOT' >testcpp.c
4568 if test ! -f cppstdin; then
4569 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4570 # AIX cc -E doesn't show the absolute headerfile
4571 # locations but we'll cheat by using the -M flag.
4572 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
4574 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4577 echo "Keeping your $hint cppstdin wrapper."
4580 wrapper=`pwd`/cppstdin
4584 if $test "X$cppstdin" != "X" && \
4585 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4586 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4588 echo "You used to use $cppstdin $cppminus so we'll use that again."
4590 '') echo "But let's see if we can live without a wrapper..." ;;
4592 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4593 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4595 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4598 echo "(However, $cpprun $cpplast does not work, let's see...)"
4606 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4613 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4614 $cc -E <testcpp.c >testcpp.out 2>&1; \
4615 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4616 echo "Yup, it does."
4619 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4620 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4621 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4622 echo "Yup, it does."
4625 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4626 $cc -P <testcpp.c >testcpp.out 2>&1; \
4627 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4628 echo "Yipee, that works!"
4631 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4632 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4633 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4634 echo "At long last!"
4637 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4638 $cpp <testcpp.c >testcpp.out 2>&1; \
4639 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4643 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4644 $cpp - <testcpp.c >testcpp.out 2>&1; \
4645 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4646 echo "Hooray, it works! I was beginning to wonder."
4649 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4650 $wrapper <testcpp.c >testcpp.out 2>&1; \
4651 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4657 rp="No dice. I can't find a C preprocessor. Name one:"
4661 $x_cpp <testcpp.c >testcpp.out 2>&1
4662 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4663 echo "OK, that will do." >&4
4665 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4680 echo "Perhaps can we force $cc -E using a wrapper..."
4681 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4682 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4688 echo "Nope, we'll have to live without it..."
4702 "$wrapper"|'cppstdin') ;;
4703 *) $rm -f $wrapper;;
4705 $rm -f testcpp.c testcpp.out
4707 : Set private lib path
4710 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4715 '') dlist="$loclibpth $plibpth $glibpth";;
4716 *) dlist="$libpth";;
4719 : Now check and see which directories actually exist, avoiding duplicates
4723 if $test -d $xxx; then
4726 *) libpth="$libpth $xxx";;
4732 Some systems have incompatible or broken versions of libraries. Among
4733 the directories listed in the question below, please remove any you
4734 know not to be holding relevant libraries, and add any that are needed.
4735 Say "none" for none.
4746 rp="Directories to use for library searches?"
4753 : compute shared library extension
4756 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4766 On some systems, shared libraries may be available. Answer 'none' if
4767 you want to suppress searching of shared libraries for the remainder
4768 of this configuration.
4771 rp='What is the file extension used for shared libraries?'
4775 : Define several unixisms.
4776 : Hints files or command line option can be used to override them.
4777 : The convoluted testing is in case hints files set either the old
4780 '') case "$exe_ext" in
4782 *) _exe="$exe_ext" ;;
4787 '') case "$lib_ext" in
4794 '') case "$obj_ext" in
4801 '') case "$path_sep" in
4812 rm_try="$rm -f try try$_exe a.out .out try.[cho] try.$_o core core.try* try.core*"
4814 : Which makefile gets called first. This is used by make depend.
4815 case "$firstmakefile" in
4816 '') firstmakefile='makefile';;
4819 : Check is we will use socks
4821 $define|true|[yY]*) dflt='y';;
4826 Perl can be built to use the SOCKS proxy protocol library. To do so,
4827 Configure must be run with -Dusesocks. If you use SOCKS you also need
4828 to use the PerlIO abstraction layer, this will be implicitly selected.
4830 If this doesn't make any sense to you, just accept the default '$dflt'.
4832 rp='Build Perl for SOCKS?'
4835 y|Y) val="$define" ;;
4841 : Check for uselongdouble support
4843 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
4846 case "$uselongdouble" in
4847 $define|true|[yY]*) dflt='y';;
4852 Perl can be built to take advantage of long doubles which
4853 (if available) may give more accuracy and range for floating point numbers.
4855 If this doesn't make any sense to you, just accept the default '$dflt'.
4857 rp='Try to use long doubles if available?'
4860 y|Y) val="$define" ;;
4866 case "$uselongdouble" in
4867 true|[yY]*) uselongdouble="$define" ;;
4870 : Look for a hint-file generated 'call-back-unit'. If the
4871 : user has specified that long doubles should be used,
4872 : we may need to set or change some other defaults.
4873 if $test -f uselongdouble.cbu; then
4874 echo "Your platform has some specific hints regarding long doubles, using them..."
4875 . ./uselongdouble.cbu
4877 case "$uselongdouble" in
4880 (Your platform does not have any specific hints for long doubles.)
4886 : Looking for optional libraries
4888 echo "Checking for optional libraries..." >&4
4893 case "$libswanted" in
4894 '') libswanted='c_s';;
4897 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
4903 for thisdir in $libpth $xlibpth; do
4904 test -d $thisdir && libspath="$libspath $thisdir"
4906 for thislib in $libswanted; do
4907 for thisdir in $libspath; do
4909 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4910 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
4911 $test -f "$xxx" && eval $libscheck
4912 $test -f "$xxx" && libstyle=shared
4914 if test ! -f "$xxx"; then
4915 xxx=$thisdir/lib$thislib.$so
4916 $test -f "$xxx" && eval $libscheck
4917 $test -f "$xxx" && libstyle=shared
4919 if test ! -f "$xxx"; then
4920 xxx=$thisdir/lib$thislib$_a
4921 $test -f "$xxx" && eval $libscheck
4922 $test -f "$xxx" && libstyle=static
4924 if test ! -f "$xxx"; then
4925 xxx=$thisdir/$thislib$_a
4926 $test -f "$xxx" && eval $libscheck
4927 $test -f "$xxx" && libstyle=static
4929 if test ! -f "$xxx"; then
4930 xxx=$thisdir/lib${thislib}_s$_a
4931 $test -f "$xxx" && eval $libscheck
4932 $test -f "$xxx" && libstyle=static
4933 $test -f "$xxx" && thislib=${thislib}_s
4935 if test ! -f "$xxx"; then
4936 xxx=$thisdir/Slib$thislib$_a
4937 $test -f "$xxx" && eval $libscheck
4938 $test -f "$xxx" && libstyle=static
4940 if $test -f "$xxx"; then
4942 shared) echo "Found -l$thislib (shared)." ;;
4943 static) echo "Found -l$thislib." ;;
4944 *) echo "Found -l$thislib ($libstyle)." ;;
4948 *) dflt="$dflt -l$thislib"
4949 libsfound="$libsfound $xxx"
4951 libsfiles="$libsfiles $yyy"
4952 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
4953 case " $libsdirs " in
4955 *) libsdirs="$libsdirs $yyy" ;;
4962 if $test ! -f "$xxx"; then
4963 echo "No -l$thislib."
4974 ' '|'') dflt='none';;
4979 In order to compile $package on your machine, a number of libraries
4980 are usually needed. Include any other special libraries here as well.
4981 Say "none" for none. The default list is almost always right.
4985 rp="What libraries to use?"
4992 : determine optimization, if desired, or use for debug flag also
4994 ' '|$undef) dflt='none';;
4996 *) dflt="$optimize";;
5000 By default, $package compiles with the -O flag to use the optimizer.
5001 Alternately, you might want to use the symbolic debugger, which uses
5002 the -g flag (on traditional Unix systems). Either flag can be
5003 specified here. To use neither flag, specify the word "none".
5006 rp="What optimizer/debugger flag should be used?"
5010 'none') optimize=" ";;
5013 : Check what DEBUGGING is required from the command line
5014 : -DEBUGGING or -DDEBUGGING or
5015 : -DEBUGGING=both = -g + -DDEBUGGING
5016 : -DEBUGGING=-g or -Doptimize=-g = -g
5017 : -DEBUGGING=none or -UDEBUGGING =
5018 : -DEBUGGING=old or -DEBUGGING=default = ? $optimize
5021 *) DEBUGGING=$EBUGGING ;;
5024 case "$DEBUGGING" in
5028 *) optimize="$optimize -g" ;;
5032 *-g*) set `echo "X $optimize " | sed 's/ -g / /'`
5040 case "$DEBUGGING" in
5041 both|$define) dflt='-DDEBUGGING'
5044 : argument order is deliberate, as the flag will start with - which set could
5045 : think is an option
5046 checkccflag='check=$1; flag=$2; callback=$3;
5048 echo "Checking if your compiler accepts $flag" 2>&1;
5049 echo "int main(void) { return 0; }" > gcctest.c;
5050 if $cc -O2 $flag -o gcctest gcctest.c 2>gcctest.out && ./gcctest; then
5051 echo "Yes, it does." 2>&1;
5052 if $test -s gcctest.out ; then
5053 echo "But your platform does not like it:";
5058 echo "Leaving current flags $ccflags alone." 2>&1
5060 *) dflt="$dflt $flag";
5066 echo "Nope, it does not, but that is ok." 2>&1;
5070 : We will not override a previous value, but we might want to
5071 : augment a hint file
5073 default|recommended)
5074 case "$gccversion" in
5075 1*) dflt="$dflt -fpcc-struct-return" ;;
5077 case "$optimize:$DEBUGGING" in
5078 *-g*:old) dflt="$dflt -DDEBUGGING";;
5080 case "$gccversion" in
5081 2*) if $test -d /etc/conf/kconfig.d &&
5082 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
5084 # Interactive Systems (ISC) POSIX mode.
5089 case "$gccversion" in
5092 ?*) set strict-aliasing -fno-strict-aliasing
5096 # For gcc, adding -pipe speeds up compilations for some, but apparently
5097 # some assemblers can't read from stdin. (It also slows down compilations
5098 # in other cases, but those are apparently rarer these days.) AD 5/2004.
5099 case "$gccversion" in
5105 # on x86_64 (at least) we require an extra library (libssp) in the
5106 # link command line. This library is not named, so I infer that it is
5107 # an implementation detail that may change. Hence the safest approach
5108 # is to add the flag to the flags passed to the compiler at link time,
5109 # as that way the compiler can do the right implementation dependant
5111 case "$gccversion" in
5112 ?*) set stack-protector -fstack-protector
5119 case "$mips_type" in
5120 *BSD*|'') inclwanted="$locincpth $usrinc";;
5121 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
5123 for thisincl in $inclwanted; do
5124 if $test -d $thisincl; then
5125 if $test x$thisincl != x$usrinc; then
5127 *" -I$thisincl "*);;
5128 *) dflt="$dflt -I$thisincl ";;
5134 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
5136 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
5144 *) dflt="$dflt -D$2";;
5148 set signal.h LANGUAGE_C; eval $inctest
5152 ccflags="$ccflags -DSOCKS"
5157 default|recommended) dflt="$ccflags $dflt" ;;
5158 *) dflt="$ccflags";;
5167 Your C compiler may want other flags. For this question you should include
5168 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
5169 but you should NOT include libraries or ld flags like -lwhatever. If you
5170 want $package to honor its debug switch, you should include -DDEBUGGING here.
5171 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
5173 To use no flags, specify the word "none".
5179 rp="Any additional cc flags?"
5186 : the following weeds options from ccflags that are of no interest to cpp
5188 '') cppflags="$ccflags" ;;
5189 *) cppflags="$cppflags $ccflags" ;;
5191 case "$gccversion" in
5192 1*) cppflags="$cppflags -D__GNUC__"
5194 case "$mips_type" in
5196 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
5202 echo "Let me guess what the preprocessor flags are..." >&4
5216 *) ftry="$previous $flag";;
5218 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
5219 >cpp1.out 2>/dev/null && \
5220 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
5221 >cpp2.out 2>/dev/null && \
5222 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
5223 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
5225 cppflags="$cppflags $ftry"
5235 *-*) echo "They appear to be: $cppflags";;
5237 $rm -f cpp.c cpp?.out
5241 : flags used in final linking phase
5243 '') if ./venix; then
5249 *-posix*) dflt="$dflt -posix" ;;
5252 *) dflt="$ldflags";;
5254 # See note above about -fstack-protector
5256 *-fstack-protector*)
5258 *-fstack-protector*) ;; # Don't add it again
5259 *) dflt="$dflt -fstack-protector" ;;
5264 : Try to guess additional flags to pick up local libraries.
5265 for thislibdir in $libpth; do
5266 case " $loclibpth " in
5269 *"-L$thislibdir "*) ;;
5270 *) dflt="$dflt -L$thislibdir" ;;
5282 Your C linker may need flags. For this question you should
5283 include -L/whatever and any other flags used by the C linker, but you
5284 should NOT include libraries like -lwhatever.
5286 Make sure you include the appropriate -L/path flags if your C linker
5287 does not normally search all of the directories you specified above,
5290 To use no flags, specify the word "none".
5294 rp="Any additional ld flags (NOT including libraries)?"
5300 rmlist="$rmlist pdp11"
5304 echo "Checking your choice of C compiler and flags for coherency..." >&4
5305 $cat > try.c <<'EOF'
5307 int main() { printf("Ok\n"); return(0); }
5309 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
5311 $cat >try.msg <<'EOM'
5312 I've tried to compile and run the following simple program:
5315 $cat try.c >> try.msg
5317 $cat >> try.msg <<EOM
5324 and I got the following output:
5328 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5329 if $sh -c "$run ./try " >>try.msg 2>&1; then
5333 *) echo 'The program compiled OK, but produced no output.' >> try.msg
5336 cat >> try.msg <<'EOQS'
5337 If $libs contains -lsfio, and sfio is mis-configured, then it
5338 sometimes (apparently) runs and exits with a 0 status, but with no
5339 output! It may have to do with sfio's use of _exit vs. exit.
5342 rp="You have a big problem. Shall I abort Configure"
5349 echo "The program compiled OK, but exited with status $?." >>try.msg
5350 rp="You have a problem. Shall I abort Configure"
5354 echo "I can't compile the test program." >>try.msg
5355 rp="You have a BIG problem. Shall I abort Configure"
5361 case "$knowitall" in
5363 echo "(The supplied flags or libraries might be incorrect.)"
5371 *) echo "Ok. Stopping Configure." >&4
5376 n) echo "OK, that should do.";;
5378 $rm_try gcctest gcctest.out
5380 : define a shorthand compile call
5384 case "$usedevel" in $define|true|[yY]*) if $test ! -f "${mc_file}.c"; then
5385 echo "Internal Configure script bug - compiler test file ${mc_file}.c is missing. Please report this to perlbug@perl.org" >&4;
5389 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5390 : define a shorthand compile call for compilations that should be ok.
5394 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5396 : determine filename position in cpp output
5398 echo "Computing filename position in cpp output for #include directives..." >&4
5400 vos) testaccess=-e ;;
5403 echo '#include <stdio.h>' > foo.c
5406 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5407 $grep '^[ ]*#.*stdio\.h' | \
5408 while read cline; do
5411 while $test \$# -gt 0; do
5412 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5417 pos=\`expr \$pos + 1\`
5429 *) pos="${fieldn}th";;
5431 echo "Your cpp writes the filename in the $pos field of the line."
5434 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
5435 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
5438 : locate header file
5443 for usrincdir in $usrinc
5445 if test -f \$usrincdir/\$wanted; then
5446 echo "\$usrincdir/\$wanted"
5450 awkprg='{ print \$$fieldn }'
5451 echo "#include <\$wanted>" > foo\$\$.c
5452 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5453 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5454 while read cline; do
5455 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5457 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5458 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5463 # status = 0: grep returned 0 lines, case statement not executed
5464 # status = 1: headerfile found
5465 # status = 2: while loop executed, no headerfile found
5469 if test \$status -eq 1; then
5476 : define an alternate in-header-list? function
5477 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5478 cont=true; xxf="echo \"<\$1> found.\" >&4";
5479 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5480 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5482 case $# in 4) instead=instead;; *) instead="at last";; esac;
5483 while $test "$cont"; do
5485 var=$2; eval "was=\$$2";
5486 if $test "$xxx" && $test -r "$xxx";
5488 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5491 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5492 set $yyy; shift; shift; yyy=$@;
5493 case $# in 0) cont="";;
5494 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5495 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5496 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5497 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5501 do set $yyy; var=$2; eval "was=\$$2";
5502 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5503 set $yyy; shift; shift; yyy=$@;
5506 : see if stdlib is available
5507 set stdlib.h i_stdlib
5510 : check for lengths of integral types
5514 echo "Checking to see how big your integers are..." >&4
5523 printf("intsize=%d;\n", (int)sizeof(int));
5524 printf("longsize=%d;\n", (int)sizeof(long));
5525 printf("shortsize=%d;\n", (int)sizeof(short));
5530 if eval $compile_ok && $run ./try > /dev/null; then
5532 echo "Your integers are $intsize bytes long."
5533 echo "Your long integers are $longsize bytes long."
5534 echo "Your short integers are $shortsize bytes long."
5538 Help! I can't compile and run the intsize test program: please enlighten me!
5539 (This is probably a misconfiguration in your system or libraries, and
5540 you really ought to fix it. Still, I'll try anyway.)
5544 rp="What is the size of an integer (in bytes)?"
5548 rp="What is the size of a long integer (in bytes)?"
5552 rp="What is the size of a short integer (in bytes)?"
5560 : check for long long
5562 echo "Checking to see if you have long long..." >&4
5563 echo 'int main() { long long x = 7; return 0; }' > try.c
5565 if eval $compile; then
5567 echo "You have long long."
5570 echo "You do not have long long."
5576 : check for length of long long
5577 case "${d_longlong}${longlongsize}" in
5580 echo "Checking to see how big your long longs are..." >&4
5581 $cat >try.c <<'EOCP'
5585 printf("%d\n", (int)sizeof(long long));
5590 if eval $compile_ok; then
5591 longlongsize=`$run ./try`
5592 echo "Your long longs are $longlongsize bytes long."
5596 echo "(I can't seem to compile the test program. Guessing...)"
5597 rp="What is the size of a long long (in bytes)?"
5601 if $test "X$longsize" = "X$longlongsize"; then
5602 echo "(That isn't any different from an ordinary long.)"
5608 : see if inttypes.h is available
5609 : we want a real compile instead of Inhdr because some systems
5610 : have an inttypes.h which includes non-existent headers
5613 #include <inttypes.h>
5615 static int32_t foo32 = 0x12345678;
5619 if eval $compile; then
5620 echo "<inttypes.h> found." >&4
5623 echo "<inttypes.h> NOT found." >&4
5632 echo "Checking to see if you have int64_t..." >&4
5634 #include <sys/types.h>
5635 #$i_inttypes I_INTTYPES
5637 #include <inttypes.h>
5639 int main() { int64_t x = 7; }
5642 if eval $compile; then
5644 echo "You have int64_t."
5647 echo "You do not have int64_t."
5653 : Check if 64bit ints have a quad type
5655 echo "Checking which 64-bit integer type we could use..." >&4
5661 val='"unsigned int"'
5666 *) case "$longsize" in
5670 val='"unsigned long"'
5675 *) case "$d_longlong:$longlongsize" in
5680 val='"unsigned long long"'
5685 *) case "$d_int64_t" in
5704 '') echo "Alas, no 64-bit integer types in sight." >&4
5707 *) echo "We could use '$quadtype' for 64-bit integers." >&4
5712 : Do we want 64bit support
5713 case "$uselonglong" in
5714 "$define"|true|[yY]*)
5717 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
5719 use64bitint="$define"
5722 case "$use64bits" in
5723 "$define"|true|[yY]*)
5726 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
5728 use64bitint="$define"
5731 case "$use64bitints" in
5732 "$define"|true|[yY]*)
5735 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
5737 use64bitint="$define"
5740 case "$use64bitsint" in
5741 "$define"|true|[yY]*)
5744 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
5746 use64bitint="$define"
5749 case "$uselonglongs" in
5750 "$define"|true|[yY]*)
5753 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
5755 use64bitint="$define"
5758 case "$use64bitsall" in
5759 "$define"|true|[yY]*)
5762 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
5764 use64bitall="$define"
5769 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
5771 case "$use64bitall" in
5772 "$define"|true|[yY]*) use64bitint="$define" ;;
5778 You have natively 64-bit long integers.
5782 *) case "$use64bitint" in
5783 "$define"|true|[yY]*) dflt='y';;
5792 Perl can be built to take advantage of 64-bit integer types
5793 on some systems. To do so, Configure can be run with -Duse64bitint.
5794 Choosing this option will most probably introduce binary incompatibilities.
5796 If this doesn't make any sense to you, just accept the default '$dflt'.
5797 (The default has been chosen based on your configuration.)
5799 rp='Try to use 64-bit integers, if available?'
5802 [yY]*) val="$define" ;;
5810 case "$use64bitall" in
5811 "$define"|true|[yY]*) dflt='y' ;;
5812 *) case "$longsize" in
5820 You may also choose to try maximal 64-bitness. It means using as much
5821 64-bitness as possible on the platform. This in turn means even more
5822 binary incompatibilities. On the other hand, your platform may not
5823 have any more 64-bitness available than what you already have chosen.
5825 If this doesn't make any sense to you, just accept the default '$dflt'.
5826 (The default has been chosen based on your configuration.)
5828 rp='Try to use maximal 64-bit support, if available?'
5831 [yY]*) val="$define" ;;
5836 case "$use64bitall" in
5838 case "$use64bitint" in
5842 Since you have chosen a maximally 64-bit build, I'm also turning on
5843 the use of 64-bit integers.
5845 use64bitint="$define" ;;
5850 : Look for a hint-file generated 'call-back-unit'. If the
5851 : user has specified that a 64-bit perl is to be built,
5852 : we may need to set or change some other defaults.
5853 if $test -f use64bitint.cbu; then
5854 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
5857 case "$use64bitint" in
5858 "$define"|true|[yY]*)
5859 : This test was common to all the OpenBSD forks, and seems harmless for
5862 echo "Checking if your C library has broken 64-bit functions..." >&4
5865 typedef $uquadtype myULL;
5872 {4294967303.15, 4294967303ULL},
5873 {4294967294.2, 4294967294ULL},
5874 {4294967295.7, 4294967295ULL},
5877 for (p = test; p->u; p++) {
5878 myULL x = (myULL)p->d;
5889 if eval $compile_ok; then
5891 echo "Your C library's 64-bit functions are $libcquad."
5893 echo "(I can't seem to compile the test program.)"
5894 echo "Assuming that your C library's 64-bit functions are ok."
5903 *** You have a C library with broken 64-bit functions.
5904 *** 64-bit support does not work reliably in this configuration.
5905 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
5906 *** Cannot continue, aborting.
5913 4) case "$archname64" in
5914 '') archname64=64int ;;
5921 : Look for a hint-file generated 'call-back-unit'. If the
5922 : user has specified that a maximally 64-bit perl is to be built,
5923 : we may need to set or change some other defaults.
5924 if $test -f use64bitall.cbu; then
5925 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
5928 case "$use64bitall" in
5929 "$define"|true|[yY]*)
5931 4) case "$archname64" in
5932 ''|64int) archname64=64all ;;
5939 case "$d_quad:$use64bitint" in
5943 *** You have chosen to use 64-bit integers,
5944 *** but none can be found.
5945 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
5946 *** Cannot continue, aborting.
5953 : check for length of double
5955 case "$doublesize" in
5957 echo "Checking to see how big your double precision numbers are..." >&4
5966 printf("%d\n", (int)sizeof(double));
5971 if eval $compile_ok; then
5972 doublesize=`$run ./try`
5973 echo "Your double is $doublesize bytes long."
5976 echo "(I can't seem to compile the test program. Guessing...)"
5977 rp="What is the size of a double precision number (in bytes)?"
5985 : check for long doubles
5987 echo "Checking to see if you have long double..." >&4
5988 echo 'int main() { long double x = 7.0; }' > try.c
5990 if eval $compile; then
5992 echo "You have long double."
5995 echo "You do not have long double."
6001 : check for length of long double
6002 case "${d_longdbl}${longdblsize}" in
6005 echo "Checking to see how big your long doubles are..." >&4
6006 $cat >try.c <<'EOCP'
6010 printf("%d\n", sizeof(long double));
6015 if eval $compile; then
6016 longdblsize=`$run ./try`
6017 echo "Your long doubles are $longdblsize bytes long."
6021 echo "(I can't seem to compile the test program. Guessing...)" >&4
6022 rp="What is the size of a long double (in bytes)?"
6026 if $test "X$doublesize" = "X$longdblsize"; then
6027 echo "That isn't any different from an ordinary double."
6028 echo "I'll keep your setting anyway, but you may see some"
6029 echo "harmless compilation warnings."
6035 : determine the architecture name
6037 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
6038 tarch=`arch`"-$osname"
6039 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
6040 if uname -m > tmparch 2>&1 ; then
6041 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
6042 -e 's/$/'"-$osname/" tmparch`
6050 case "$myarchname" in
6053 echo "(Your architecture name used to be $myarchname.)"
6057 case "$targetarch" in
6059 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
6064 *) dflt="$archname";;
6066 rp='What is your architecture name'
6070 : optionally add API version to the architecture for versioned archlibs
6071 case "$useversionedarchname" in
6072 $define|true|[yY]*) dflt='y';;
6075 rp='Add the Perl API version to your archname?'
6078 y|Y) useversionedarchname="$define" ;;
6079 *) useversionedarchname="$undef" ;;
6081 case "$useversionedarchname" in
6084 *-$api_versionstring)
6085 echo "...and architecture name already has -$api_versionstring" >&4
6088 archname="$archname-$api_versionstring"
6089 echo "...setting architecture name to $archname." >&4
6095 case "$usethreads" in
6097 echo "Threads selected." >&4
6099 *-thread*) echo "...and architecture name already has -thread." >&4
6101 *) archname="$archname-thread"
6102 echo "...setting architecture name to $archname." >&4
6107 case "$usemultiplicity" in
6109 echo "Multiplicity selected." >&4
6111 *-multi*) echo "...and architecture name already has -multi." >&4
6113 *) archname="$archname-multi"
6114 echo "...setting architecture name to $archname." >&4
6119 case "$use64bitint$use64bitall" in
6121 case "$archname64" in
6123 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
6126 case "$use64bitint" in
6127 "$define") echo "64 bit integers selected." >&4 ;;
6129 case "$use64bitall" in
6130 "$define") echo "Maximal 64 bitness selected." >&4 ;;
6133 *-$archname64*) echo "...and architecture name already has $archname64." >&4
6135 *) archname="$archname-$archname64"
6136 echo "...setting architecture name to $archname." >&4
6142 case "$uselongdouble" in
6144 echo "Long doubles selected." >&4
6145 case "$longdblsize" in
6147 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
6151 *-ld*) echo "...and architecture name already has -ld." >&4
6153 *) archname="$archname-ld"
6154 echo "...setting architecture name to $archname." >&4
6161 if $test -f archname.cbu; then
6162 echo "Your platform has some specific hints for architecture name, using them..."
6166 : set the prefixit variable, to compute a suitable default value
6167 prefixit='case "$3" in
6169 case "$oldprefix" in
6170 "") eval "$1=\"\$$2\"";;
6177 ""|" ") eval "$1=\"\$$2\"";;
6183 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
6185 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
6186 /*-$oldprefix/*|\~*-$oldprefix/*)
6187 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
6188 *) eval "$1=\"\$$2\"";;
6192 : determine installation style
6193 : For now, try to deduce it from prefix unless it is already set.
6194 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
6195 case "$installstyle" in
6196 '') case "$prefix" in
6197 *perl*) dflt='lib';;
6198 *) dflt='lib/perl5' ;;
6201 *) dflt="$installstyle" ;;
6203 : Probably not worth prompting for this since we prompt for all
6204 : the directories individually, and the prompt would be too long and
6208 : determine where public executables go
6213 rp='Pathname where the public executables will reside?'
6215 if $test "X$ansexp" != "X$binexp"; then
6219 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
6220 : XXX If this is fixed, also fix the "start perl" hunk below, which relies on
6221 : this via initialinstalllocation
6224 case "$userelocatableinc" in
6225 $define|true|[yY]*) dflt='y' ;;
6230 Would you like to build Perl so that the installation is relocatable, so that
6231 library paths in @INC are determined relative to the path of the perl binary?
6232 This is not advised for system Perl installs, or if you need to run setid
6233 scripts or scripts under taint mode.
6235 If this doesn't make any sense to you, just accept the default '$dflt'.
6237 rp='Use relocatable @INC?'
6240 y|Y) val="$define" ;;
6243 set userelocatableinc
6246 initialinstalllocation="$binexp"
6247 : Default prefix is now "up one level from where the binaries are"
6248 case "$userelocatableinc" in
6254 installprefixexp=".../.."
6258 : determine where private library files go
6259 : Usual default is /usr/local/lib/perl5/$version.
6260 : Also allow things like /opt/perl/lib/$version, since
6261 : /opt/perl/lib/perl5... would be redundant.
6262 : The default "style" setting is made in installstyle.U
6263 case "$installstyle" in
6264 *lib/perl5*) set dflt privlib lib/$package/$version ;;
6265 *) set dflt privlib lib/$version ;;
6270 There are some auxiliary files for $package that need to be put into a
6271 private library directory that is accessible by everyone.
6276 rp='Pathname where the private library files will reside?'
6281 : set the prefixup variable, to restore leading tilda escape
6282 prefixup='case "$prefixexp" in
6284 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
6287 : determine where public architecture dependent libraries go
6290 : privlib default is /usr/local/lib/$package/$version
6291 : archlib default is /usr/local/lib/$package/$version/$archname
6292 : privlib may have an optional trailing /share.
6293 tdflt=`echo $privlib | $sed 's,/share$,,'`
6294 tdflt=$tdflt/$archname
6303 $spackage contains architecture-dependent library files. If you are
6304 sharing libraries in a heterogeneous environment, you might store
6305 these files in a separate location. Otherwise, you can just include
6306 them with the rest of the public library files.
6311 rp='Where do you want to put the public architecture-dependent libraries?'
6315 if $test X"$archlib" = X"$privlib"; then
6321 : see if setuid scripts can be secure
6324 Some kernels have a bug that prevents setuid #! scripts from being
6325 secure. Some sites have disabled setuid #! scripts because of this.
6327 First let's decide if your kernel supports secure setuid #! scripts.
6328 (If setuid #! scripts would be secure but have been disabled anyway,
6329 don't say that they are secure if asked.)
6334 if $test -d /dev/fd; then
6335 echo "#!$ls" >reflect
6336 chmod +x,u+s reflect
6337 ./reflect >flect 2>&1
6338 if $contains "/dev/fd" flect >/dev/null; then
6339 echo "Congratulations, your kernel has secure setuid scripts!" >&4
6343 If you are not sure if they are secure, I can check but I'll need a
6344 username and password different from the one you are using right now.
6345 If you don't have such a username or don't want me to test, simply
6349 rp='Other username to test security of setuid scripts with?'
6354 case "$d_suidsafe" in
6355 '') echo "I'll assume setuid scripts are *not* secure." >&4
6358 echo "Well, the $hint value is *not* secure." >&4
6360 *) echo "Well, the $hint value *is* secure." >&4
6365 $rm -f reflect flect
6366 echo "#!$ls" >reflect
6367 chmod +x,u+s reflect
6370 echo '"su" will (probably) prompt you for '"$ans's password."
6371 su $ans -c './reflect >flect'
6372 if $contains "/dev/fd" flect >/dev/null; then
6373 echo "Okay, it looks like setuid scripts are secure." >&4
6376 echo "I don't think setuid scripts are secure." >&4
6381 rp='Does your kernel have *secure* setuid scripts?'
6384 [yY]*) val="$define";;
6389 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
6390 echo "(That's for file descriptors, not floppy disks.)"
6396 $rm -f reflect flect
6398 : now see if they want to do setuid emulation
6399 if $test $patchlevel -lt 11; then
6402 case "$d_suidsafe" in
6405 echo "No need to emulate SUID scripts since they are secure here." >&4
6409 Some systems have disabled setuid scripts, especially systems where
6410 setuid scripts cannot be secure. On systems where setuid scripts have
6411 been disabled, the setuid/setgid bits on scripts are currently
6412 useless. It is possible for $package to detect those bits and emulate
6413 setuid/setgid in a secure fashion. This emulation will only work if
6414 setuid scripts have been disabled in your kernel.
6418 "$define") dflt=y ;;
6421 rp="Do you want to do setuid/setgid emulation?"
6424 [yY]*) val="$define";;
6436 SUID emulation has been removed for 5.12
6437 Please re-run Configure without -Dd_dosuid
6446 : Find perl5.005 or later.
6447 echo "Looking for a previously installed perl5.005 or later... "
6449 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
6450 : Check if this perl is recent and can load a simple module
6451 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6454 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6464 '') echo "None found. That's ok.";;
6465 *) echo "Using $perl5." ;;
6468 : Set the siteprefix variables
6471 After $package is installed, you may wish to install various
6472 add-on modules and utilities. Typically, these add-ons will
6473 be installed under $prefix with the rest
6474 of this package. However, you may wish to install such add-ons
6475 elsewhere under a different prefix.
6477 If you do not wish to put everything under a single prefix, that's
6478 ok. You will be prompted for the individual locations; this siteprefix
6479 is only used to suggest the defaults.
6481 The default should be fine for most people.
6485 rp='Installation prefix to use for add-on modules and utilities?'
6486 : XXX Here might be another good place for an installstyle setting.
6487 case "$siteprefix" in
6489 *) dflt=$siteprefix ;;
6492 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6494 case "$siteprefix" in
6498 *) oldsiteprefix="$prefix";;
6503 siteprefixexp="$ansexp"
6505 : determine where site specific libraries go.
6506 : Usual default is /usr/local/lib/perl5/site_perl/$version
6507 : The default "style" setting is made in installstyle.U
6508 : XXX No longer works with Prefixit stuff.
6509 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6511 '') case "$installstyle" in
6512 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
6513 *) dflt=$siteprefix/lib/site_$prog/$version ;;
6521 The installation process will create a directory for
6522 site-specific extensions and modules. Most users find it convenient
6523 to place all site-specific files in this directory rather than in the
6524 main distribution directory.
6528 rp='Pathname for the site-specific library files?'
6532 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6534 : Determine list of previous versions to include in @INC
6535 $cat > getverlist <<EOPL
6538 \$api_versionstring = "$api_versionstring";
6539 \$version = "$version";
6540 \$stem = "$sitelib_stem";
6541 \$archname = "$archname";
6543 $cat >> getverlist <<'EOPL'
6544 # The list found is store twice for each entry: the original name, and
6545 # the binary broken down version as pack "sss", so sorting is easy and
6546 # unambiguous. This will work for all versions that have a maximum of
6547 # three digit groups, separate by '.'s or '_'s. Names are extended with
6548 # ".0.0" to ensure at least three elements for the pack.
6549 # -- H.Merijn Brand (m)'06 23-10-2006
6551 # Can't have leading @ because metaconfig interprets it as a command!
6552 ;@inc_version_list=();
6553 # XXX Redo to do opendir/readdir?
6556 ;@candidates = map {
6557 [ $_, pack "sss", split m/[._]/, "$_.0.0" ] } glob("5.*");
6558 ;@candidates = sort { $a->[1] cmp $b->[1]} @candidates;
6564 ($pversion, $aversion, $vsn5005) = map {
6565 pack "sss", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005";
6566 foreach $d (@candidates) {
6567 if ($d->[1] lt $pversion) {
6568 if ($d->[1] ge $aversion) {
6569 unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]);
6571 elsif ($d->[1] ge $vsn5005) {
6572 unshift(@inc_version_list, grep { -d } $d->[0]);
6576 # Skip newer version. I.e. don't look in
6577 # 5.7.0 if we're installing 5.6.1.
6581 if (@inc_version_list) {
6582 print join(' ', @inc_version_list);
6585 # Blank space to preserve value for next Configure run.
6590 case "$inc_version_list" in
6591 '') if test -x "$perl5$exe_ext"; then
6592 dflt=`$perl5 getverlist`
6597 $undef) dflt='none' ;;
6598 *) eval dflt=\"$inc_version_list\" ;;
6601 ''|' ') dflt=none ;;
6608 In order to ease the process of upgrading, this version of perl
6609 can be configured to use modules built and installed with earlier
6610 versions of perl that were installed under $prefix. Specify here
6611 the list of earlier versions that this version of perl should check.
6612 If Configure detected no earlier versions of perl installed under
6613 $prefix, then the list will be empty. Answer 'none' to tell perl
6614 to not search earlier versions.
6616 The default should almost always be sensible, so if you're not sure,
6617 just accept the default.
6620 rp='List of earlier versions to include in @INC?'
6623 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
6624 *) inc_version_list="$ans" ;;
6626 case "$inc_version_list" in
6628 inc_version_list_init='0'
6629 d_inc_version_list="$undef"
6631 *) inc_version_list_init=`echo $inc_version_list |
6632 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
6633 d_inc_version_list="$define"
6638 : see if malloc/malloc.h has to be included
6639 set malloc/malloc.h i_mallocmalloc
6642 : see if this is a malloc.h system
6643 : we want a real compile instead of Inhdr because some systems have a
6644 : malloc.h that just gives a compile error saying to use stdlib.h instead
6649 #$i_mallocmalloc I_MALLOCMALLOC
6650 #ifdef I_MALLOCMALLOC
6651 # include <malloc/malloc.h>
6654 int main () { return 0; }
6657 if eval $compile; then
6658 echo "<malloc.h> found." >&4
6661 echo "<malloc.h> NOT found." >&4
6668 : check for length of pointer
6672 echo "Checking to see how big your pointers are..." >&4
6681 printf("%d\n", (int)sizeof(void *));
6686 if eval $compile_ok; then
6687 ptrsize=`$run ./try`
6688 echo "Your pointers are $ptrsize bytes long."
6691 echo "(I can't seem to compile the test program. Guessing...)" >&4
6692 rp="What is the size of a pointer (in bytes)?"
6699 case "$use64bitall" in
6700 "$define"|true|[yY]*)
6704 *** You have chosen a maximally 64-bit build,
6705 *** but your pointers are only 4 bytes wide.
6706 *** Please rerun Configure without -Duse64bitall.
6711 *** Since you have quads, you could possibly try with -Duse64bitint.
6716 *** Cannot continue, aborting.
6727 : determine whether to use malloc wrapping
6729 case "$usemallocwrap" in
6730 [yY]*|true|$define) dflt='y' ;;
6731 [nN]*|false|$undef) dflt='n' ;;
6732 *) case "$usedevel" in
6733 [yY]*|true|$define) dflt='y' ;;
6738 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
6740 usemallocwrap="$ans"
6743 usemallocwrap="$define" ;;
6745 usemallocwrap="$undef" ;;
6748 : determine which malloc to compile in
6750 case "$usemymalloc" in
6751 [yY]*|true|$define) dflt='y' ;;
6752 [nN]*|false|$undef) dflt='n' ;;
6753 *) case "$ptrsize" in
6757 if test "$useithreads" = "$define"; then dflt='n'; fi
6760 rp="Do you wish to attempt to use the malloc that comes with $package?"
6766 mallocsrc='malloc.c'
6767 mallocobj="malloc$_o"
6768 d_mymalloc="$define"
6771 : Remove malloc from list of libraries to use
6772 echo "Removing unneeded -lmalloc from library list" >&4
6773 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
6776 echo "libs = $libs" >&4
6788 : compute the return types of malloc and free
6790 $cat >malloc.c <<END
6794 #include <sys/types.h>
6808 case "$malloctype" in
6810 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
6817 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
6821 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
6828 echo "Your system uses $freetype free(), it would seem." >&4
6830 : determine where site specific architecture-dependent libraries go.
6831 : sitelib default is /usr/local/lib/perl5/site_perl/$version
6832 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6833 : sitelib may have an optional trailing /share.
6835 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
6836 dflt="$dflt/$archname"
6841 set sitearch sitearch none
6845 The installation process will also create a directory for
6846 architecture-dependent site-specific extensions and modules.
6850 rp='Pathname for the site-specific architecture-dependent library files?'
6854 if $test X"$sitearch" = X"$sitelib"; then
6857 d_sitearch="$define"
6860 : Set the vendorprefix variables
6863 The installation process will also create a directory for
6864 vendor-supplied add-ons. Vendors who supply perl with their system
6865 may find it convenient to place all vendor-supplied files in this
6866 directory rather than in the main distribution directory. This will
6867 ease upgrades between binary-compatible maintenance versions of perl.
6869 Of course you may also use these directories in whatever way you see
6870 fit. For example, you might use them to access modules shared over a
6871 company-wide network.
6873 The default answer should be fine for most people.
6874 This causes further questions about vendor add-ons to be skipped
6875 and no vendor-specific directories will be configured for perl.
6878 rp='Do you want to configure vendor-specific add-on directories?'
6879 case "$usevendorprefix" in
6880 define|true|[yY]*) dflt=y ;;
6881 *) : User may have set vendorprefix directly on Configure command line.
6882 case "$vendorprefix" in
6891 rp='Installation prefix to use for vendor-supplied add-ons?'
6892 case "$vendorprefix" in
6893 '') dflt="$prefix" ;;
6894 *) dflt=$vendorprefix ;;
6897 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6899 case "$vendorprefix" in
6903 *) oldvendorprefix="$prefix";;
6907 usevendorprefix="$define"
6909 vendorprefixexp="$ansexp"
6911 *) usevendorprefix="$undef"
6917 : Set the vendorlib variables
6918 case "$vendorprefix" in
6919 '') d_vendorlib="$undef"
6923 *) d_vendorlib="$define"
6924 : determine where vendor-supplied modules go.
6925 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
6926 case "$vendorlib" in
6928 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6929 case "$installstyle" in
6930 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
6931 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
6934 *) dflt="$vendorlib"
6938 rp='Pathname for the vendor-supplied library files?'
6941 vendorlibexp="$ansexp"
6944 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
6948 : Set the vendorarch variables
6949 case "$vendorprefix" in
6950 '') d_vendorarch="$undef"
6954 *) d_vendorarch="$define"
6955 : determine where vendor-supplied architecture-dependent libraries go.
6956 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
6957 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
6958 : vendorlib may have an optional trailing /share.
6959 case "$vendorarch" in
6960 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
6961 dflt="$dflt/$archname"
6963 *) dflt="$vendorarch" ;;
6966 rp='Pathname for vendor-supplied architecture-dependent files?'
6969 vendorarchexp="$ansexp"
6972 prefixvar=vendorarch
6974 if $test X"$vendorarch" = X"$vendorlib"; then
6975 d_vendorarch="$undef"
6977 d_vendorarch="$define"
6980 : Final catch-all directories to search
6983 Lastly, you can have perl look in other directories for extensions and
6984 modules in addition to those already specified.
6985 These directories will be searched after
6989 test X"$vendorlib" != "X" && echo ' ' $vendorlib
6990 test X"$vendorarch" != "X" && echo ' ' $vendorarch
6992 case "$otherlibdirs" in
6993 ''|' ') dflt='none' ;;
6994 *) dflt="$otherlibdirs" ;;
6997 Enter a colon-separated set of extra paths to include in perl's @INC
6998 search path, or enter 'none' for no extra paths.
7002 rp='Colon-separated list of additional directories for perl to search?'
7005 ' '|''|none) otherlibdirs=' ' ;;
7006 *) otherlibdirs="$ans" ;;
7008 case "$otherlibdirs" in
7012 set d_perl_otherlibdirs
7015 : Cruising for prototypes
7017 echo "Checking out function prototypes..." >&4
7018 $cat >prototype.c <<EOCP
7023 int main(int argc, char *argv[]) {
7026 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
7027 echo "Your C compiler appears to support function prototypes."
7030 echo "Your C compiler doesn't seem to understand function prototypes."
7037 : Check if ansi2knr is required
7038 case "$prototype" in
7040 *) ansi2knr='ansi2knr'
7045 This version of $package can only be compiled by a compiler that
7046 understands function prototypes. Unfortunately, your C compiler
7048 doesn't seem to understand them. Sorry about that.
7050 If GNU cc is available for your system, perhaps you could try that instead.
7052 Eventually, we hope to support building Perl with pre-ANSI compilers.
7053 If you would like to help in that effort, please contact <perlbug@perl.org>.
7055 Aborting Configure now.
7062 dflt_dtrace='/usr/sbin/dtrace'
7063 $test -x /usr/bin/dtrace && dflt_dtrace='/usr/bin/dtrace'
7067 Perl can be built to support DTrace on platforms that support it.
7068 DTrace is a diagnosis and performance analysis tool from Sun.
7070 If this doesn't make any sense to you, just accept the default '$dflt'.
7074 case "$usedtrace" in
7080 dflt_dtrace=$usedtrace
7087 rp='Support DTrace if available?'
7090 y|Y) val="$define" ;;
7096 test "X$usedtrace" != "X$define" && break
7099 rp='Where is the dtrace executable?'
7108 if $dtrace -h -s ../perldtrace.d \
7109 -o perldtrace.tmp >/dev/null 2>&1 \
7110 && rm -f perldtrace.tmp
7113 echo "Good: your $dtrace knows about the -h flag."
7117 *** $me: Fatal Error: $dtrace doesn't support -h flag
7119 *** Your installed dtrace doesn't support the -h switch to compile a D
7120 *** program into a C header. Can't continue.
7132 *** $me: Fatal Error: $dtrace not found.
7139 echo "*** $dtrace was not found."
7145 : See if we want extra modules installed
7152 Perl can be built with extra modules or bundles of modules which
7153 will be fetched from the CPAN and installed alongside Perl.
7155 Notice that you will need access to the CPAN; either via the Internet,
7156 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
7157 be asked later to configure the CPAN.pm module which will in turn do
7158 the installation of the rest of the extra modules or bundles.)
7160 Notice also that if the modules require any external software such as
7161 libraries and headers (the libz library and the zlib.h header for the
7162 Compress::Zlib module, for example) you MUST have any such software
7163 already installed, this configuration process will NOT install such
7166 If this doesn't make any sense to you, just accept the default '$dflt'.
7168 rp='Install any extra modules (y or n)?'
7174 Please list any extra modules or bundles to be installed from CPAN,
7175 with spaces between the names. The names can be in any format the
7176 'install' command of CPAN.pm will understand. (Answer 'none',
7177 without the quotes, to install no extra modules or bundles.)
7187 $rm -f ../extras.lst
7189 *) echo "(Saving the list of extras for later...)"
7190 echo "$extras" > ../extras.lst
7198 : determine where html pages for programs go
7199 set html1dir html1dir none
7203 If you wish to install html files for programs in $spackage, indicate
7204 the appropriate directory here. To skip installing html files,
7208 ''|none|$undef|' ') dflt=none ;;
7209 *) dflt=$html1dir ;;
7212 rp="Directory for the main $spackage html pages?"
7216 : Use ' ' for none so value is preserved next time through Configure
7217 $test X"$html1dir" = "X" && html1dir=' '
7219 : determine where html pages for libraries and modules go
7220 set html3dir html3dir none
7224 If you wish to install html files for modules associated with $spackage,
7225 indicate the appropriate directory here. To skip installing html files,
7228 : There is no obvious default. If they have specified html1dir, then
7229 : try to key off that, possibly changing .../html1 into .../html3.
7231 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
7232 *) dflt=$html3dir ;;
7235 rp="Directory for the $spackage module html pages?"
7239 : Use ' ' for none so value is preserved next time through Configure
7240 $test X"$html3dir" = "X" && html3dir=' '
7242 : determine whether to install perl also as /usr/bin/perl
7245 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
7247 Many scripts expect perl to be installed as /usr/bin/perl.
7249 If you want to, I can install the perl you are about to compile
7250 as /usr/bin/perl (in addition to $bin/perl).
7252 if test -f /usr/bin/perl; then
7255 However, please note that because you already have a /usr/bin/perl,
7256 overwriting that with a new Perl would very probably cause problems.
7257 Therefore I'm assuming you don't want to do that (unless you insist).
7260 case "$installusrbinperl" in
7261 "$define"|[yY]*) dflt='y';;
7267 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
7270 case "$installusrbinperl" in
7271 "$undef"|[nN]*) dflt='n';;
7275 rp="Do you want to install perl as /usr/bin/perl?"
7278 [yY]*) val="$define";;
7284 set installusrbinperl
7287 : Check if we are using the GNU C library
7289 echo "Checking for GNU C Library..." >&4
7291 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
7292 alone are insufficient to distinguish different versions, such as
7293 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
7294 libc version 2.1.0. A. Dougherty, June 3, 2002.
7300 # ifdef __GLIBC_MINOR__
7301 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus)
7302 # include <gnu/libc-version.h>
7303 printf("%s\n", gnu_get_libc_version());
7305 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
7308 printf("%d\n", __GLIBC__);
7317 if eval $compile_ok && $run ./try > glibc.ver; then
7319 gnulibc_version=`$cat glibc.ver`
7320 echo "You are using the GNU C Library version $gnulibc_version"
7324 echo "You are not using the GNU C Library"
7330 : see if nm is to be used to determine whether a symbol is defined or not
7334 case "$d_gnulibc" in
7337 echo "nm probably won't work on the GNU C Library." >&4
7343 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
7345 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
7346 echo "'nm' won't be sufficient on this system." >&4
7352 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
7353 if $test $dflt -gt 20; then
7363 true|$define) dflt=y;;
7370 I can use $nm to extract the symbols from your C libraries. This
7371 is a time consuming task which may generate huge output on the disk (up
7372 to 3 megabytes) but that should make the symbols extraction faster. The
7373 alternative is to skip the 'nm' extraction part and to compile a small
7374 test program instead to determine whether each symbol is present. If
7375 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
7376 this may be the best solution.
7378 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
7381 rp="Shall I use $nm to extract C symbols from the libraries?"
7384 [Nn]*) usenm=false;;
7393 : nm options which may be necessary
7395 '') if $test -f /mach_boot; then
7397 elif $test -d /usr/ccs/lib; then
7398 nm_opt='-p' # Solaris (and SunOS?)
7399 elif $test -f /dgux; then
7401 elif $test -f /lib64/rld; then
7402 nm_opt='-p' # 64-bit Irix
7408 : nm options which may be necessary for shared libraries but illegal
7409 : for archive libraries. Thank you, Linux.
7410 case "$nm_so_opt" in
7411 '') case "$myuname" in
7413 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
7414 nm_so_opt='--dynamic'
7421 : Figure out where the libc is located
7424 : get list of predefined functions in a handy place
7429 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
7435 *) for thislib in $libs; do
7438 : Handle C library specially below.
7441 thislib=`echo $thislib | $sed -e 's/^-l//'`
7442 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
7444 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
7446 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
7448 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
7450 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
7452 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
7454 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
7459 libnames="$libnames $try"
7461 *) libnames="$libnames $thislib" ;;
7470 for xxx in $libpth; do
7471 $test -r $1 || set $xxx/libc.$so
7472 : The messy sed command sorts on library version numbers.
7474 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
7475 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
7477 s/[0-9][0-9]*/0000&/g
7478 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
7481 $sort | $sed -e 's/^.* //'`
7484 $test -r $1 || set /usr/ccs/lib/libc.$so
7485 $test -r $1 || set /lib/libsys_s$_a
7491 if $test -r "$1"; then
7492 echo "Your (shared) C library seems to be in $1."
7494 elif $test -r /lib/libc && $test -r /lib/clib; then
7495 echo "Your C library seems to be in both /lib/clib and /lib/libc."
7497 libc='/lib/clib /lib/libc'
7498 if $test -r /lib/syslib; then
7499 echo "(Your math library is in /lib/syslib.)"
7500 libc="$libc /lib/syslib"
7502 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7503 echo "Your C library seems to be in $libc, as you said before."
7504 elif $test -r $incpath/usr/lib/libc$_a; then
7505 libc=$incpath/usr/lib/libc$_a;
7506 echo "Your C library seems to be in $libc. That's fine."
7507 elif $test -r /lib/libc$_a; then
7509 echo "Your C library seems to be in $libc. You're normal."
7511 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
7513 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
7514 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
7515 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
7517 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7519 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7522 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
7524 if $test -r "$tans"; then
7525 echo "Your C library seems to be in $tans, of all places."
7531 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7535 If the guess above is wrong (which it might be if you're using a strange
7536 compiler, or your machine supports multiple models), you can override it here.
7541 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
7543 I can't seem to find your C library. I've looked in the following places:
7546 $sed 's/^/ /' libpath
7549 None of these seems to contain your C library. I need to get its name...
7554 rp='Where is your C library?'
7559 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
7560 set X `cat libnames`
7563 case $# in 1) xxx=file; esac
7564 echo "Extracting names from the following $xxx for later perusal:" >&4
7566 $sed 's/^/ /' libnames >&4
7568 $echo $n "This may take a while...$c" >&4
7572 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
7573 *) $nm $nm_opt $file 2>/dev/null;;
7578 $grep fprintf libc.tmp > libc.ptf
7579 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
7580 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
7582 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
7584 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7586 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
7588 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7590 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
7592 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7594 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
7596 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7598 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
7600 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7602 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
7604 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7606 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
7607 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
7609 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7611 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
7613 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7615 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
7617 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7619 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
7621 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7623 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
7625 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7627 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
7629 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7631 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
7633 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7635 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
7637 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7640 $nm -p $* 2>/dev/null >libc.tmp
7641 $grep fprintf libc.tmp > libc.ptf
7642 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
7643 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
7649 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
7651 if $ar t $libc > libc.tmp && \
7652 $contains '^fprintf$' libc.tmp >/dev/null 2>&1
7654 for thisname in $libnames $libc; do
7655 $ar t $thisname >>libc.tmp
7657 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
7659 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
7660 for thisname in $libnames $libc; do
7661 $ar tv $thisname >>libc.tmp
7662 emximp -o tmp.imp $thisname \
7664 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
7665 < tmp.imp >>libc.tmp
7668 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
7671 echo "$ar didn't seem to work right." >&4
7672 echo "Maybe this is a Cray...trying bld instead..." >&4
7674 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list &&
7677 for thisname in $libnames; do
7679 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
7680 $ar t $thisname >>libc.tmp
7684 echo "That didn't work either. Giving up." >&4
7694 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
7695 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
7697 *) if $test -f /lib/syscalls.exp; then
7699 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
7700 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' \
7701 /lib/syscalls.exp >>libc.list
7707 $rm -f libnames libpath
7709 : Check if we are using C++
7711 echo "Checking for C++..." >&4
7712 $cat >try.c <<'EOCP'
7724 if eval $compile_ok && $run ./try; then
7726 echo "You are using a C++ compiler."
7729 echo "You are not using a C++ compiler."
7735 : is a C symbol defined?
7738 -v) tf=libc.tmp; tdc="";;
7739 -a) tf=libc.tmp; tdc="[]";;
7740 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
7742 case "$d_cplusplus" in
7743 $define) extern_C="extern \"C\"" ;;
7744 *) extern_C="extern" ;;
7747 case "$reuseval-$4" in
7749 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
7754 if $test "$runnm" = true; then
7755 if $contains $tlook $tf >/dev/null 2>&1; then
7757 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
7758 echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7759 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
7760 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
7764 echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7765 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
7771 $define) tval=true;;
7778 : define an is-in-libc? function
7779 inlibc='echo " "; td=$define; tu=$undef;
7780 sym=$1; var=$2; eval "was=\$$2";
7782 case "$reuseval$was" in
7792 echo "$sym() found." >&4;
7793 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
7795 echo "$sym() NOT found." >&4;
7796 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
7800 $define) echo "$sym() found." >&4;;
7801 *) echo "$sym() NOT found." >&4;;
7805 : see if dlopen exists
7807 xxx_ccflags="$ccflags"
7809 : with g++ one needs -shared to get is-in-libc to work for dlopen
7810 case "$gccversion" in
7812 *) case "$d_cplusplus" in
7813 "$define") ccflags="$ccflags -shared" ;;
7820 ccflags="$xxx_ccflags"
7822 : see if this is a unistd.h system
7823 set unistd.h i_unistd
7826 : determine which dynamic loading, if any, to compile in
7828 dldir="ext/DynaLoader"
7841 $define) dflt='y' ;;
7843 : Does a dl_xxx.xs file exist for this operating system
7844 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
7847 rp="Do you wish to use dynamic loading?"
7855 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
7856 dflt="$dldir/dl_${osname}.xs"
7857 elif $test "$d_dlopen" = "$define" ; then
7858 dflt="$dldir/dl_dlopen.xs"
7863 *) dflt="$dldir/$dlsrc"
7866 echo "The following dynamic loading files are available:"
7867 : Can not go over to $dldir because getfile has path hard-coded in.
7868 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
7869 rp="Source file to use for dynamic loading"
7875 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
7879 Some systems may require passing special flags to $cc -c to
7880 compile modules that will be used to create a shared library.
7881 To use no flags, say "none".
7884 case "$cccdlflags" in
7885 '') case "$gccversion" in
7886 '') case "$osname" in
7888 next) dflt='none' ;;
7889 irix*) dflt='-KPIC' ;;
7890 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
7891 sunos) dflt='-pic' ;;
7895 *) case "$osname" in
7896 darwin) dflt='none' ;;
7897 linux*|svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
7902 *) dflt="$cccdlflags" ;;
7904 rp="Any special flags to pass to $cc -c to compile shared library modules?"
7907 none) cccdlflags=' ' ;;
7908 *) cccdlflags="$ans" ;;
7913 Some systems use ld to create libraries that can be dynamically loaded,
7914 while other systems (such as those using ELF) use $cc.
7918 : Determine if this is ELF
7920 /* Test for whether ELF binaries are produced */
7932 int i = open("a.out",O_RDONLY);
7935 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
7936 exit(0); /* succeed (yes, it is ELF) */
7941 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
7947 '') if $test $bin_ELF = "$define"; then
7949 You appear to have ELF support. I'll use $cc to build dynamic libraries.
7953 echo "I'll use ld to build dynamic libraries."
7961 rp="What command should be used to create dynamic libraries?"
7967 Some systems may require passing special flags to $ld to create a
7968 library that can be dynamically loaded. If your ld flags include
7969 -L/other/path options to locate libraries outside your loader's normal
7970 search path, you may need to specify those -L options here as well. To
7971 use no flags, say "none".
7974 case "$lddlflags" in
7975 '') case "$osname" in
7976 haiku) dflt='-shared' ;;
7978 case "$gccversion" in
7979 '') dflt="$dflt +vnocompatwarnings" ;;
7982 linux|irix*|gnu*) dflt="-shared $optimize" ;;
7983 next) dflt='none' ;;
7984 solaris) # See [perl #66604].
7985 # On Solaris 11, gcc -m64 on amd64
7986 # appears not to understand -G. gcc versions at
7987 # least as old as 3.4.3 support -shared, so just
7988 # use that with Solaris 11 and later, but keep
7989 # the old behavior for older Solaris versions.
7990 case "$gccversion" in
7992 *) case "$osvers" in
7993 2.?|2.10) dflt='-G' ;;
7994 *) dflt='-shared' ;;
7999 sunos) dflt='-assert nodefinitions' ;;
8000 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
8004 *) dflt="$lddlflags" ;;
8007 : Try to guess additional flags to pick up local libraries.
8008 : Be careful not to append to a plain 'none'
8012 for thisflag in $ldflags; do
8017 *) dflt="$dflt $thisflag" ;;
8024 ''|' ') dflt='none' ;;
8028 *-fstack-protector*)
8030 *-fstack-protector*) ;; # Don't add it again
8031 *) dflt="$dflt -fstack-protector" ;;
8037 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
8040 none) lddlflags=' ' ;;
8041 *) lddlflags="$ans" ;;
8046 Some systems may require passing special flags to $cc to indicate that
8047 the resulting executable will use dynamic linking. To use no flags,
8051 case "$ccdlflags" in
8052 '') case "$osname" in
8053 linux|hpux|gnu*) dflt='-Wl,-E' ;;
8054 next|sunos) dflt='none' ;;
8058 *) dflt="$ccdlflags" ;;
8060 rp="Any special flags to pass to $cc to use dynamic linking?"
8063 none) ccdlflags=' ' ;;
8064 *) ccdlflags="$ans" ;;
8075 ld_can_script="$undef"
8076 case "$bin_ELF$usedl" in
8078 # Abuse try.h and a.out names for neat cleanup
8090 if $cc $cccdlflags $ccdlflags $ccflags \
8091 $ldflags $lddlflags -o a.out try.c \
8092 -Wl,--version-script=try.h >/dev/null 2>&1 \
8093 && $test -s a.out ; then
8094 echo "ld supports scripting" >&4
8095 ld_can_script="$define"
8097 echo "ld does not support scripting" >&4
8103 : Do we want a shared libperl?
8107 # No dynamic loading being used, so don't bother even to prompt.
8110 *) case "$useshrplib" in
8111 '') case "$osname" in
8112 svr4*|nonstopux|dgux|dynixptx|esix|powerux|haiku|cygwin*)
8114 also='Building a shared libperl is required for dynamic loading to work on your system.'
8119 also='Building a shared libperl is needed for MAB support.'
8137 The perl executable is normally obtained by linking perlmain.c with
8138 libperl${_a}, any static extensions (usually just DynaLoader), and
8139 any other libraries needed on this system (such as -lm, etc.). Since
8140 your system supports dynamic loading, it is probably possible to build
8141 a shared libperl.$so. If you will have more than one executable linked
8142 to libperl.$so, this will significantly reduce the size of each
8143 executable, but it may have a noticeable effect on performance. The
8144 default is probably sensible for your system.
8148 rp="Build a shared libperl.$so (y/n)"
8152 useshrplib='true' ;;
8153 *) useshrplib='false' ;;
8158 case "$useshrplib" in
8160 case "$userelocatableinc" in
8162 echo "Cannot build with both -Duserelocatableinc and -Duseshrplib" >&4
8163 echo "See INSTALL for an explanation why that won't work." >&4
8169 # Figure out a good name for libperl.so. Since it gets stored in
8170 # a version-specific architecture-dependent library, the version
8171 # number isn't really that important, except for making cc/ld happy.
8173 # A name such as libperl.so.10.1
8174 majmin="libperl.$so.$patchlevel.$subversion"
8175 # A name such as libperl.so.100
8176 majonly=`echo $patchlevel $subversion |
8177 $awk '{printf "%d%02d", $1, $2}'`
8178 majonly=libperl.$so.$majonly
8179 # I'd prefer to keep the os-specific stuff here to a minimum, and
8180 # rely on figuring it out from the naming of libc.
8181 case "${osname}${osvers}" in
8184 # XXX How handle the --version stuff for MAB?
8186 linux*|gnu*) # ld won't link with a bare -lperl otherwise.
8189 cygwin*) # ld links now against the dll directly
8190 majmin="cygperl5_${patchlevel}_${subversion}.${so}"
8191 majonly=`echo $patchlevel $subversion |
8192 $awk '{printf "%03d%03d", $1, $2}'`
8193 majonly=cygperl5.$majonly.$so
8196 *) # Try to guess based on whether libc has major.minor.
8198 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
8199 *libc.$so.[0-9]*) dflt=$majonly ;;
8200 *) dflt=libperl.$so ;;
8210 I need to select a good name for the shared libperl. If your system uses
8211 library names with major and minor numbers, then you might want something
8212 like $majmin. Alternatively, if your system uses a single version
8213 number for shared libraries, then you might want to use $majonly.
8214 Or, your system might be quite happy with a simple libperl.$so.
8216 Since the shared libperl will get installed into a version-specific
8217 architecture-dependent directory, the version number of the shared perl
8218 library probably isn't important, so the default should be o.k.
8221 rp='What name do you want to give to the shared libperl?'
8224 echo "Ok, I'll use $libperl"
8227 libperl="libperl${_a}"
8231 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
8235 WARNING: Use of the shrpdir variable for the installation location of
8236 the shared $libperl is not supported. It was never documented and
8237 will not work in this version. Let me (perlbug@perl.org)
8238 know of any problems this may cause.
8244 But your current setting of $shrpdir is
8245 the default anyway, so it's harmless.
8250 Further, your current attempted setting of $shrpdir
8251 conflicts with the value of $archlibexp/CORE
8252 that installperl will use.
8259 # How will the perl executable find the installed shared $libperl?
8260 # Add $xxx to ccdlflags.
8261 # If we can't figure out a command-line option, use $shrpenv to
8262 # set env LD_RUN_PATH. The main perl makefile uses this.
8263 shrpdir=$archlibexp/CORE
8266 if "$useshrplib"; then
8269 # We'll set it in Makefile.SH...
8274 freebsd|mirbsd|netbsd|openbsd|interix|dragonfly|bitrig)
8275 xxx="-Wl,-R$shrpdir"
8277 bsdos|linux|irix*|dec_osf|gnu*)
8278 xxx="-Wl,-rpath,$shrpdir"
8281 # next doesn't like the default...
8284 # Haiku doesn't like the default, either.
8287 # hpux doesn't like the default, either.
8288 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
8291 # cygwin needs only ldlibpth
8294 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
8300 # Only add $xxx if it isn't already in ccdlflags.
8301 case " $ccdlflags " in
8303 *) ccdlflags="$ccdlflags $xxx"
8306 Adding $xxx to the flags
8307 passed to $ld so that the perl executable will find the
8308 installed shared $libperl.
8316 # Fix ccdlflags in AIX for building external extensions.
8317 # (For building Perl itself bare -bE:perl.exp is needed,
8318 # Makefile.SH takes care of this.)
8320 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8322 # Respect a hint or command-line value.
8324 '') shrpenv="$tmp_shrpenv" ;;
8326 case "$ldlibpthname" in
8327 '') ldlibpthname=LD_LIBRARY_PATH ;;
8328 none) ldlibpthname='' ;;
8331 : determine where manual pages are on this system
8335 syspath='/usr/share/man/man1 /usr/man/man1'
8336 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8337 syspath="$syspath /usr/man/u_man/man1"
8338 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8339 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8340 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8341 sysman=`./loc . /usr/man/man1 $syspath`
8344 if $test -d "$sysman"; then
8345 echo "System manual is in $sysman." >&4
8347 echo "Could not find manual pages in source form." >&4
8350 : determine where manual pages go
8351 set man1dir man1dir none
8355 $spackage has manual pages available in source form.
8359 echo "However, you don't have nroff, so they're probably useless to you."
8361 '') man1dir="none";;
8364 echo "If you don't want the manual sources installed, answer 'none'."
8369 lookpath="$prefixexp/share/man/man1"
8370 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8371 lookpath="$lookpath $prefixexp/man/p_man/man1"
8372 lookpath="$lookpath $prefixexp/man/u_man/man1"
8373 lookpath="$lookpath $prefixexp/man/man.1"
8375 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8376 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8386 rp="Where do the main $spackage manual pages (source) go?"
8388 if $test "X$man1direxp" != "X$ansexp"; then
8399 : What suffix to use on installed man pages
8406 rp="What suffix should be used for the main $spackage man pages?"
8408 '') case "$man1dir" in
8422 *) dflt="$man1ext";;
8429 : see if we can have long filenames
8431 first=123456789abcdef
8433 if (echo hi >$first) 2>/dev/null; then
8434 if $test -f 123456789abcde; then
8435 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8438 echo 'You can have filenames longer than 14 characters.'>&4
8443 You can't have filenames longer than 14 chars.
8444 You can't even think about them!
8450 $rm -rf 123456789abcde*
8452 : determine where library module manual pages go
8453 set man3dir man3dir none
8457 $spackage has manual pages for many of the library modules.
8463 However, you don't have nroff, so they're probably useless to you.
8466 '') man3dir="none";;
8470 case "$d_flexfnam" in
8473 However, your system can't handle the long file names like File::Basename.3.
8476 '') man3dir="none";;
8480 echo "If you don't want the manual sources installed, answer 'none'."
8481 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8483 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
8484 if $test -d "$privlib/man/man3"; then
8487 WARNING: Previous versions of perl installed man3 pages into
8488 $privlib/man/man3. This version will suggest a
8489 new default of $dflt.
8493 rp='Do you wish to preserve the old behavior?(y/n)'
8496 y*) dflt="$privlib/man/man3" ;;
8501 *) dflt="$man3dir" ;;
8508 rp="Where do the $package library man pages (source) go?"
8518 : What suffix to use on installed man pages
8524 rp="What suffix should be used for the $package library man pages?"
8526 '') case "$man3dir" in
8540 *) dflt="$man3ext";;
8547 : see if we have to deal with yellow pages, now NIS.
8548 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
8549 if $test -f /usr/etc/nibindd; then
8551 echo "I'm fairly confident you're on a NeXT."
8553 rp='Do you get the hosts file via NetInfo?'
8562 y*) hostcat='nidump hosts .';;
8563 *) case "$hostcat" in
8564 nidump*) hostcat='';;
8574 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
8582 rp='Are you getting the hosts file via yellow pages?'
8585 y*) hostcat='ypcat hosts';;
8586 *) hostcat='cat /etc/hosts';;
8592 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
8595 '') test -f /etc/group && groupcat='cat /etc/group';;
8598 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
8601 : now get the host name
8603 echo "Figuring out host name..." >&4
8604 case "$myhostname" in
8606 echo 'Maybe "hostname" will work...'
8607 if tans=`sh -c hostname 2>&1` ; then
8615 if $test "$cont"; then
8617 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
8618 if tans=`cat /etc/systemid 2>&1` ; then
8620 phostname='cat /etc/systemid'
8621 echo "Whadyaknow. Xenix always was a bit strange..."
8624 elif $test -r /etc/systemid; then
8625 echo "(What is a non-Xenix system doing with /etc/systemid?)"
8628 if $test "$cont"; then
8629 echo 'No, maybe "uuname -l" will work...'
8630 if tans=`sh -c 'uuname -l' 2>&1` ; then
8632 phostname='uuname -l'
8634 echo 'Strange. Maybe "uname -n" will work...'
8635 if tans=`sh -c 'uname -n' 2>&1` ; then
8637 phostname='uname -n'
8639 echo 'Oh well, maybe I can mine it out of whoami.h...'
8640 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
8641 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
8642 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
8644 case "$myhostname" in
8645 '') echo "Does this machine have an identity crisis or something?"
8648 echo "Well, you said $myhostname before..."
8649 phostname='echo $myhostname';;
8655 case "$myhostname" in
8656 '') myhostname=noname ;;
8658 : you do not want to know about this
8663 if $test "$myhostname" ; then
8665 rp='Your host name appears to be "'$myhostname'".'" Right?"
8673 : bad guess or no guess
8674 while $test "X$myhostname" = X ; do
8676 rp="Please type the (one word) name of your host:"
8681 : translate upper to lower if necessary
8682 case "$myhostname" in
8684 echo "(Normalizing case in your host name)"
8685 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
8689 case "$myhostname" in
8691 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
8692 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
8693 echo "(Trimming domain name from host name--host name is now $myhostname)"
8695 *) case "$mydomain" in
8698 test "X$hostcat" = "Xypcat hosts" &&
8699 ypmatch "$myhostname" hosts 2>/dev/null |\
8700 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
8703 test "X$hostcat" != "X" &&
8704 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
8705 /[ ]$myhostname[ . ]/p" > hosts
8708 if $test -f hosts; then
8709 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
8710 END { print sum }" hosts` = x1 || tmp_re="[ ]"
8711 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
8712 hosts | $sort | $uniq | \
8713 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
8714 case `$echo X$dflt` in
8715 X*\ *) echo "(Several hosts in the database matched hostname)"
8718 X.) echo "(You do not have fully-qualified names in the hosts database)"
8722 echo "(I cannot locate a hosts database anywhere)"
8727 tans=`./loc resolv.conf X /etc /usr/etc`
8728 if $test -f "$tans"; then
8729 echo "(Attempting domain name extraction from $tans)"
8730 dflt=.`$sed -n -e 's/ / /g' \
8731 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
8734 .) dflt=.`$sed -n -e 's/ / /g' \
8735 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
8743 .) echo "(No help from resolv.conf either -- attempting clever guess)"
8744 dflt=.`sh -c domainname 2>/dev/null`
8747 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
8751 case "$dflt$osname" in
8752 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
8753 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
8757 .) echo "(Lost all hope -- silly guess then)"
8763 *) dflt="$mydomain";;
8767 rp="What is your domain name?"
8777 : translate upper to lower if necessary
8780 echo "(Normalizing case in your domain name)"
8781 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
8785 : a little sanity check here
8786 case "$phostname" in
8789 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
8790 $myhostname$mydomain|$myhostname) ;;
8792 case "$phostname" in
8794 echo "(That doesn't agree with your whoami.h file, by the way.)"
8797 echo "(That doesn't agree with your $phostname command, by the way.)"
8805 : determine the e-mail address of the user who is running us
8808 I need to get your e-mail address in Internet format if possible, i.e.
8809 something like user@host.domain. Please answer accurately since I have
8810 no easy means to double check it. The default value provided below
8811 is most probably close to reality but may not be valid from outside
8812 your organization...
8816 while test "$cont"; do
8817 case "$MAILDOMAIN" in
8819 if $test -s /etc/mailname; then
8820 maildomain=`$cat /etc/mailname`
8822 maildomain="$myhostname$mydomain"
8825 *) maildomain="$MAILDOMAIN";;
8828 '') dflt="$cf_by@$maildomain";;
8829 *) dflt="$cf_email";;
8831 rp='What is your e-mail address?'
8837 rp='Address does not look like an Internet one. Use it anyway?'
8851 : Ask e-mail of administrator
8854 If you or somebody else will be maintaining perl at your site, please
8855 fill in the correct e-mail address here so that they may be contacted
8856 if necessary. Currently, the "perlbug" program included with perl
8857 will send mail to this address in addition to perlbug@perl.org. You may
8858 enter "none" for no administrator.
8861 case "$perladmin" in
8862 '') dflt="$cf_email";;
8863 *) dflt="$perladmin";;
8865 rp='Perl administrator e-mail address'
8869 : determine whether to only install version-specific parts.
8872 Do you want to install only the version-specific parts of the perl
8873 distribution? Usually you do *not* want to do this.
8875 case "$versiononly" in
8876 "$define"|[Yy]*|true) dflt='y' ;;
8879 rp="Do you want to install only the version-specific parts of perl?"
8882 [yY]*) val="$define";;
8888 case "$versiononly" in
8889 "$define") inc_version_list=''
8890 inc_version_list_init=0
8894 : figure out how to guarantee perl startup
8895 : XXX Note that this currently takes advantage of the bug that binexp ignores
8896 : the Configure -Dinstallprefix setting, which in turn means that under
8897 : relocatable @INC, initialinstalllocation is what binexp started as.
8898 case "$startperl" in
8900 case "$sharpbang" in
8904 I can use the #! construct to start perl on your system. This will
8905 make startup of perl scripts faster, but may cause problems if you
8906 want to share those scripts and perl is not in a standard place
8907 ($initialinstalllocation/perl) on all your platforms. The alternative
8908 is to force a shell by starting the script with a single ':' character.
8911 case "$versiononly" in
8912 "$define") dflt="$initialinstalllocation/perl$version";;
8913 *) dflt="$initialinstalllocation/perl";;
8915 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
8918 none) startperl=": # use perl";;
8919 *) startperl="#!$ans"
8920 if $test 30 -lt `echo "$ans" | wc -c`; then
8923 WARNING: Some systems limit the #! command to 32 characters.
8924 If you experience difficulty running Perl scripts with #!, try
8925 installing Perl in a directory with a shorter pathname.
8931 *) startperl=": # use perl"
8936 echo "I'll use $startperl to start perl scripts."
8938 : figure best path for perl in scripts
8941 case "$versiononly" in
8942 "$define") perlpath="$initialinstalllocation/perl$version";;
8943 *) perlpath="$initialinstalllocation/perl";;
8945 case "$startperl" in
8950 I will use the "eval 'exec'" idiom to start Perl on your system.
8951 I can use the full path of your Perl binary for this purpose, but
8952 doing so may cause problems if you want to share those scripts and
8953 Perl is not always in a standard place ($initialinstalllocation/perl).
8956 dflt="$initialinstalllocation/perl"
8957 rp="What path shall I use in \"eval 'exec'\"?"
8964 case "$startperl" in
8966 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
8969 : determine where public executable scripts go
8970 set scriptdir scriptdir
8972 case "$scriptdir" in
8975 : guess some guesses
8976 $test -d /usr/share/scripts && dflt=/usr/share/scripts
8977 $test -d /usr/share/bin && dflt=/usr/share/bin
8978 $test -d /usr/local/script && dflt=/usr/local/script
8979 $test -d /usr/local/scripts && dflt=/usr/local/scripts
8980 $test -d $prefixexp/script && dflt=$prefixexp/script
8984 *) dflt="$scriptdir"
8989 Some installations have a separate directory just for executable scripts so
8990 that they can mount it across multiple architectures but keep the scripts in
8991 one spot. You might, for example, have a subdirectory of /usr/share for this.
8992 Or you might just lump your scripts in with all your other executables.
8996 rp='Where do you keep publicly executable scripts?'
8998 if $test "X$ansexp" != "X$scriptdirexp"; then
9004 : A little fix up for an irregularly named variable.
9005 installscript="$installscriptdir"
9007 : determine where add-on public executables go
9009 '') dflt=$siteprefix/bin ;;
9013 rp='Pathname where the add-on public executables should be installed?'
9018 : determine where add-on html pages go
9019 : There is no standard location, so try to copy the previously-selected
9020 : directory structure for the core html pages.
9021 case "$sitehtml1dir" in
9022 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9023 *) dflt=$sitehtml1dir ;;
9026 ''|' ') dflt=none ;;
9029 rp='Pathname where the site-specific html pages should be installed?'
9031 prefixvar=sitehtml1dir
9034 : determine where add-on library html pages go
9035 : There is no standard location, so try to copy the previously-selected
9036 : directory structure for the core html pages.
9037 case "$sitehtml3dir" in
9038 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9039 *) dflt=$sitehtml3dir ;;
9042 ''|' ') dflt=none ;;
9045 rp='Pathname where the site-specific library html pages should be installed?'
9047 prefixvar=sitehtml3dir
9050 : determine where add-on manual pages go
9051 case "$siteman1dir" in
9052 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
9053 *) dflt=$siteman1dir ;;
9056 ''|' ') dflt=none ;;
9059 rp='Pathname where the site-specific manual pages should be installed?'
9061 prefixvar=siteman1dir
9064 : determine where add-on library man pages go
9065 case "$siteman3dir" in
9066 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
9067 *) dflt=$siteman3dir ;;
9070 ''|' ') dflt=none ;;
9073 rp='Pathname where the site-specific library manual pages should be installed?'
9075 prefixvar=siteman3dir
9078 : determine where add-on public executable scripts go
9079 case "$sitescript" in
9080 '') dflt=$siteprefix/script
9081 $test -d $dflt || dflt=$sitebin ;;
9082 *) dflt="$sitescript" ;;
9085 rp='Pathname where add-on public executable scripts should be installed?'
9087 prefixvar=sitescript
9090 : Check if faststdio is requested and available
9091 case "$usefaststdio" in
9092 $define|true|[yY]*|'')
9093 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
9103 Perl can be built to use 'fast stdio', which means using the stdio
9104 library but also directly manipulating the stdio buffers to enable
9105 faster I/O. Using stdio is better for backward compatibility (especially
9106 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
9107 interface has been preferred instead of stdio.
9109 If this doesn't make any sense to you, just accept the default '$dflt'.
9111 rp='Use the "fast stdio" if available?'
9114 y|Y) val="$define" ;;
9121 : define an is-a-typedef? function
9122 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9124 "") inclist="sys/types.h";;
9126 eval "varval=\$$var";
9130 for inc in $inclist; do
9131 echo "#include <$inc>" >>temp.c;
9133 echo "#ifdef $type" >> temp.c;
9134 echo "printf(\"We have $type\");" >> temp.c;
9135 echo "#endif" >> temp.c;
9136 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9137 if $contains $type temp.E >/dev/null 2>&1; then
9143 *) eval "$var=\$varval";;
9146 : define an is-a-typedef? function that prompts if the type is not available.
9147 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9149 "") inclist="sys/types.h";;
9151 eval "varval=\$$var";
9155 for inc in $inclist; do
9156 echo "#include <$inc>" >>temp.c;
9158 echo "#ifdef $type" >> temp.c;
9159 echo "printf(\"We have $type\");" >> temp.c;
9160 echo "#endif" >> temp.c;
9161 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9163 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
9164 if $contains $type temp.E >/dev/null 2>&1; then
9165 echo "$type found." >&4;
9168 echo "$type NOT found." >&4;
9174 *) eval "$var=\$varval";;
9177 : see what type lseek is declared as in the kernel
9178 rp="What is the type used for lseek's offset on this system?"
9179 set off_t lseektype long stdio.h sys/types.h
9183 echo "Checking to see how big your file offsets are..." >&4
9185 #include <sys/types.h>
9189 printf("%d\n", (int)sizeof($lseektype));
9194 if eval $compile_ok; then
9195 lseeksize=`$run ./try`
9196 echo "Your file offsets are $lseeksize bytes long."
9200 echo "(I can't seem to compile the test program. Guessing...)"
9201 rp="What is the size of your file offsets (in bytes)?"
9207 : see what type file positions are declared as in the library
9208 rp="What is the type for file position used by fsetpos()?"
9209 set fpos_t fpostype long stdio.h sys/types.h
9212 : Check size for Fpos_t
9215 *_t) zzz="$fpostype" ;;
9218 echo "Checking the size of $zzz..." >&4
9220 #include <sys/types.h>
9227 printf("%d\n", (int)sizeof($fpostype));
9232 if eval $compile_ok; then
9236 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9239 echo "Your $zzz is $fpossize bytes long."
9245 echo "(I can't compile the test program. Guessing...)" >&4
9246 rp="What is the size of your file positions (in bytes)?"
9251 : Check for large file support
9252 # Backward compatibility (uselfs is deprecated).
9254 "$define"|true|[yY]*)
9257 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
9259 uselargefiles="$define"
9263 case "$lseeksize:$fpossize" in
9266 You can have files larger than 2 gigabytes.
9269 *) case "$uselargefiles" in
9270 "$undef"|false|[nN]*) dflt='n' ;;
9275 Perl can be built to understand large files (files larger than 2 gigabytes)
9276 on some systems. To do so, Configure can be run with -Duselargefiles.
9278 If this doesn't make any sense to you, just accept the default '$dflt'.
9280 rp='Try to understand large files, if available?'
9283 y|Y) val="$define" ;;
9290 : Look for a hint-file generated 'call-back-unit'. If the
9291 : user has specified that a large files perl is to be built,
9292 : we may need to set or change some other defaults.
9293 if $test -f uselargefiles.cbu; then
9294 echo "Your platform has some specific hints regarding large file builds, using them..."
9295 . ./uselargefiles.cbu
9297 case "$uselargefiles" in
9299 if $test -f uselargefiles.cbu; then
9301 echo "Rechecking to see how big your file offsets are..." >&4
9303 #include <sys/types.h>
9307 printf("%d\n", (int)sizeof($lseektype));
9312 if eval $compile_ok; then
9313 lseeksize=`$run ./try`
9314 $echo "Your file offsets are now $lseeksize bytes long."
9318 echo "(I can't seem to compile the test program. Guessing...)"
9319 rp="What is the size of your file offsets (in bytes)?"
9324 *_t) zzz="$fpostype" ;;
9327 $echo $n "Rechecking the size of $zzz...$c" >&4
9329 #include <sys/types.h>
9336 printf("%d\n", (int)sizeof($fpostype));
9341 if eval $compile_ok; then
9346 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9349 echo " $fpossize bytes." >&4
9355 echo "(I can't compile the test program. Guessing...)" >&4
9356 rp="What is the size of your file positions (in bytes)?"
9365 : Check if we want perlio
9368 : Set the vendorbin variables
9369 case "$vendorprefix" in
9370 '') d_vendorbin="$undef"
9374 *) d_vendorbin="$define"
9375 : determine where vendor-supplied executables go.
9376 case "$vendorbin" in
9377 '') dflt=$vendorprefix/bin ;;
9378 *) dflt="$vendorbin" ;;
9381 rp='Pathname for the vendor-supplied executables directory?'
9384 vendorbinexp="$ansexp"
9390 : Set the vendorhtml1dir variables
9391 case "$vendorprefix" in
9392 '') vendorhtml1dir=''
9393 vendorhtml1direxp=''
9395 *) : determine where vendor-supplied html pages go.
9396 : There is no standard location, so try to copy the previously-selected
9397 : directory structure for the core html pages.
9398 : XXX Better default suggestions would be welcome.
9399 case "$vendorhtml1dir" in
9400 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9401 *) dflt=$vendorhtml1dir ;;
9404 ''|' ') dflt=none ;;
9407 rp='Pathname for the vendor-supplied html pages?'
9409 vendorhtml1dir="$ans"
9410 vendorhtml1direxp="$ansexp"
9413 : Use ' ' for none so value is preserved next time through Configure
9414 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9415 prefixvar=vendorhtml1dir
9418 : Set the vendorhtml3dir variables
9419 case "$vendorprefix" in
9420 '') vendorhtml3dir=''
9421 vendorhtml3direxp=''
9423 *) : determine where vendor-supplied module html pages go.
9424 : There is no standard location, so try to copy the previously-selected
9425 : directory structure for the core html pages.
9426 : XXX Better default suggestions would be welcome.
9427 case "$vendorhtml3dir" in
9428 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9429 *) dflt=$vendorhtml3dir ;;
9432 ''|' ') dflt=none ;;
9435 rp='Pathname for the vendor-supplied html pages?'
9437 vendorhtml3dir="$ans"
9438 vendorhtml3direxp="$ansexp"
9441 : Use ' ' for none so value is preserved next time through Configure
9442 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9443 prefixvar=vendorhtml3dir
9446 : Set the vendorman1dir variables
9447 case "$vendorprefix" in
9448 '') vendorman1dir=''
9451 *) : determine where vendor-supplied manual pages go.
9452 case "$vendorman1dir" in
9453 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9454 *) dflt=$vendorman1dir ;;
9457 ''|' ') dflt=none ;;
9460 rp='Pathname for the vendor-supplied manual section 1 pages?'
9462 vendorman1dir="$ans"
9463 vendorman1direxp="$ansexp"
9466 : Use ' ' for none so value is preserved next time through Configure
9467 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
9468 prefixvar=vendorman1dir
9471 : Set the vendorman3dir variables
9472 case "$vendorprefix" in
9473 '') vendorman3dir=''
9476 *) : determine where vendor-supplied module manual pages go.
9477 case "$vendorman3dir" in
9478 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9479 *) dflt=$vendorman3dir ;;
9482 ''|' ') dflt=none ;;
9485 rp='Pathname for the vendor-supplied manual section 3 pages?'
9487 vendorman3dir="$ans"
9488 vendorman3direxp="$ansexp"
9491 : Use ' ' for none so value is preserved next time through Configure
9492 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
9493 prefixvar=vendorman3dir
9496 : Set the vendorscript variables
9497 case "$vendorprefix" in
9498 '') d_vendorscript="$undef"
9502 *) d_vendorscript="$define"
9503 : determine where vendor-supplied scripts go.
9504 case "$vendorscript" in
9505 '') dflt=$vendorprefix/script
9506 $test -d $dflt || dflt=$vendorbin ;;
9507 *) dflt="$vendorscript" ;;
9511 The installation process will create a directory for
9512 vendor-supplied scripts.
9516 rp='Pathname for the vendor-supplied scripts directory?'
9519 vendorscriptexp="$ansexp"
9522 prefixvar=vendorscript
9525 : script used to emit important warnings
9528 if test \$# -gt 0; then
9533 echo "*** WARNING:" >&4
9534 sed -e 's/^/*** /' <msg >&4
9536 cat msg >>config.msg
9537 echo " " >>config.msg
9543 : see which of string.h or strings.h is needed
9545 strings=`./findhdr string.h`
9546 if $test "$strings" && $test -r "$strings"; then
9547 echo "Using <string.h> instead of <strings.h>." >&4
9551 strings=`./findhdr strings.h`
9552 if $test "$strings" && $test -r "$strings"; then
9553 echo "Using <strings.h> instead of <string.h>." >&4
9555 ./warn "No string header found -- You'll surely have problems."
9561 "$undef") strings=`./findhdr strings.h`;;
9562 *) strings=`./findhdr string.h`;;
9565 : see if qgcvt exists
9569 : Check print/scan long double stuff
9572 if $test X"$d_longdbl" = X"$define"; then
9574 echo "Checking how to print long doubles..." >&4
9576 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
9577 $cat >try.c <<'EOCP'
9578 #include <sys/types.h>
9582 printf("%.3f\n", d);
9586 if eval $compile; then
9590 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
9591 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
9592 echo "We will use %f."
9598 if $test X"$sPRIfldbl" = X; then
9599 $cat >try.c <<'EOCP'
9600 #include <sys/types.h>
9603 long double d = 123.456;
9604 printf("%.3Lf\n", d);
9608 if eval $compile; then
9612 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
9613 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
9614 echo "We will use %Lf."
9620 if $test X"$sPRIfldbl" = X; then
9621 $cat >try.c <<'EOCP'
9622 #include <sys/types.h>
9625 long double d = 123.456;
9626 printf("%.3llf\n", d);
9630 if eval $compile; then
9634 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
9635 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
9636 echo "We will use %llf."
9642 if $test X"$sPRIfldbl" = X; then
9643 $cat >try.c <<'EOCP'
9644 #include <sys/types.h>
9647 long double d = 123.456;
9648 printf("%.3lf\n", d);
9652 if eval $compile; then
9656 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
9657 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
9658 echo "We will use %lf."
9664 if $test X"$sPRIfldbl" = X; then
9665 echo "Cannot figure out how to print long doubles." >&4
9667 sSCNfldbl=$sPRIfldbl # expect consistency
9674 case "$sPRIfldbl" in
9675 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
9676 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
9677 d_SCNfldbl="$undef";
9679 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
9680 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
9681 d_SCNfldbl="$define";
9685 : Check how to convert floats to strings.
9687 if test "X$d_Gconvert" = X; then
9690 echo "Checking for an efficient way to convert floats to strings."
9692 case "$uselongdouble" in
9693 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
9695 case "$d_longdbl" in
9696 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
9698 case "$d_PRIgldbl" in
9699 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
9703 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
9704 char *myname = "gconvert";
9707 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
9708 char *myname = "gcvt";
9711 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
9712 char *myname = "qgcvt";
9713 #define DOUBLETYPE long double
9716 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9718 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
9720 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
9723 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
9725 char *myname = "sprintf";
9729 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9730 #define DOUBLETYPE long double
9732 #define DOUBLETYPE double
9744 # include <string.h>
9746 # include <strings.h>
9749 int checkit(char *expect, char *got)
9751 if (strcmp(expect, got)) {
9752 printf("%s oddity: Expected %s, got %s\n",
9753 myname, expect, got);
9763 /* This must be 1st test on (which?) platform */
9764 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
9765 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
9766 checkit("0.1", buf);
9768 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
9769 checkit("0.01", buf);
9771 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
9772 checkit("0.001", buf);
9774 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
9775 checkit("0.0001", buf);
9777 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
9778 if (strlen(buf) > 5)
9779 checkit("9e-005", buf); /* for Microsoft ?? */
9781 checkit("9e-05", buf);
9783 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
9786 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
9787 checkit("1.1", buf);
9789 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
9790 checkit("1.01", buf);
9792 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
9793 checkit("1.001", buf);
9795 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
9796 checkit("1.0001", buf);
9798 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
9799 checkit("1.00001", buf);
9801 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
9802 checkit("1.000001", buf);
9804 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
9807 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
9810 /* Some Linux gcvt's give 1.e+5 here. */
9811 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
9812 checkit("100000", buf);
9814 /* Some Linux gcvt's give -1.e+5 here. */
9815 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
9816 checkit("-100000", buf);
9818 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
9819 checkit("123.456", buf);
9821 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
9822 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
9823 /* 34 should be enough to scare even long double
9824 * places into using the e notation. */
9825 if (strlen(buf) > 5)
9826 checkit("1e+034", buf); /* for Microsoft */
9828 checkit("1e+34", buf);
9830 /* For Perl, if you add additional tests here, also add them to
9831 * t/base/num.t for benefit of platforms not using Configure or
9832 * overriding d_Gconvert */
9837 : first add preferred functions to our list
9839 for xxx_convert in $gconvert_preference; do
9840 case $xxx_convert in
9841 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
9842 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
9845 : then add any others
9846 for xxx_convert in gconvert gcvt sprintf; do
9849 *) xxx_list="$xxx_list $xxx_convert" ;;
9853 case "$d_longdbl$uselongdouble" in
9855 : again, add preferred functions to our list first
9857 for xxx_convert in $gconvert_ld_preference; do
9858 case $xxx_convert in
9859 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9860 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
9863 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
9864 for xxx_convert in qgcvt sprintf $xxx_list; do
9865 case "$xxx_ld_list" in
9866 $xxx_convert*|*" $xxx_convert"*) ;;
9867 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9870 : if sprintf cannot do long doubles, move it to the end
9871 if test "$d_PRIgldbl" != "$define"; then
9872 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
9874 : if no qgcvt, remove it
9875 if test "$d_qgcvt" != "$define"; then
9876 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
9879 xxx_list="$xxx_ld_list"
9883 for xxx_convert in $xxx_list; do
9884 echo "Trying $xxx_convert..."
9885 $rm -f try try$_o core
9886 set try -DTRY_$xxx_convert
9887 if eval $compile; then
9888 echo "$xxx_convert() found." >&4
9890 echo "I'll use $xxx_convert to convert floats into a string." >&4
9893 echo "...But $xxx_convert didn't work as I expected."
9897 echo "$xxx_convert NOT found." >&4
9901 if test X$xxx_convert = X; then
9902 echo "*** WHOA THERE!!! ***" >&4
9903 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
9907 case "$xxx_convert" in
9908 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
9909 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
9910 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
9911 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
9912 "$define$define$define")
9913 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
9914 "$define$define$undef")
9915 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
9916 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
9924 : see if _fwalk exists
9928 : Initialize h_fcntl
9931 : Initialize h_sysfile
9934 : access call always available on UNIX
9938 : locate the flags for 'access()'
9942 $cat >access.c <<EOCP
9943 #include <sys/types.h>
9948 #include <sys/file.h>
9961 : check sys/file.h first, no particular reason here
9962 if $test `./findhdr sys/file.h` && \
9963 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
9965 echo "<sys/file.h> defines the *_OK access constants." >&4
9966 elif $test `./findhdr fcntl.h` && \
9967 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
9969 echo "<fcntl.h> defines the *_OK access constants." >&4
9970 elif $test `./findhdr unistd.h` && \
9971 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
9972 echo "<unistd.h> defines the *_OK access constants." >&4
9974 echo "I can't find the four *_OK access constants--I'll use mine." >&4
9980 : see if accessx exists
9981 set accessx d_accessx
9984 : see if aintl exists
9988 : see if alarm exists
9992 : see if 64bit time functions exists
9994 set ctime64 d_ctime64
9997 set localtime64 d_localtime64
10000 set gmtime64 d_gmtime64
10003 set mktime64 d_mktime64
10006 set difftime64 d_difftime64
10009 set asctime64 d_asctime64
10012 : see if POSIX threads are available
10013 set pthread.h i_pthread
10016 : define a function to check prototypes
10017 $cat > protochk <<EOSH
10020 optimize="$optimize"
10022 prototype="$prototype"
10025 usethreads=$usethreads
10026 i_pthread=$i_pthread
10027 pthread_h_first=$pthread_h_first
10030 $cat >> protochk <<'EOSH'
10035 while test $# -ge 2; do
10037 $define) echo "#include <$2>" >> try.c ;;
10038 literal) echo "$2" >> try.c ;;
10040 # Extra magic for the benefit of systems that need pthread.h
10041 # to be included early to correctly detect threadsafe functions.
10042 # Such functions must guarantee themselves, though, that the usethreads
10043 # and i_pthread have been defined, before calling protochk.
10044 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
10045 echo "#include <pthread.h>" >> try.c
10050 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
10051 cat >> try.c <<'EOCP'
10052 #ifdef CAN_PROTOTYPE
10053 #define _(args) args
10058 echo "$foo" >> try.c
10059 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
10060 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
10066 $eunicefix protochk
10068 : Define hasproto macro for Configure internal use
10069 hasproto='varname=$1; func=$2; shift; shift;
10070 while $test $# -ge 2; do
10072 $define) echo "#include <$2>";;
10076 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
10077 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
10078 echo "$func() prototype found.";
10081 echo "$func() prototype NOT found.";
10088 : see if sys/types.h has to be included
10089 set sys/types.h i_systypes
10092 : see if sys/select.h has to be included
10093 set sys/select.h i_sysselct
10096 : Define hasfield macro for Configure internal use
10097 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
10098 while $test $# -ge 2; do
10100 $define) echo "#include <$2>";;
10104 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
10106 if eval $compile; then
10115 : see if we should include time.h, sys/time.h, or both
10117 if test "X$timeincl" = X; then
10118 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
10119 $echo $n "I'm now running the test program...$c"
10121 #include <sys/types.h>
10126 #ifdef SYSTIMEKERNEL
10129 #include <sys/time.h>
10132 #include <sys/select.h>
10134 #$i_stdlib I_STDLIB
10136 #include <stdlib.h>
10142 struct timeval bar;
10145 struct timezone tzp;
10147 if (foo.tm_sec == foo.tm_sec)
10150 if (bar.tv_sec == bar.tv_sec)
10157 for s_timezone in '-DS_TIMEZONE' ''; do
10159 for s_timeval in '-DS_TIMEVAL' ''; do
10160 for i_systimek in '' '-DSYSTIMEKERNEL'; do
10161 for i_time in '' '-DI_TIME'; do
10162 for i_systime in '-DI_SYSTIME' ''; do
10165 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
10166 if eval $compile; then
10167 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
10171 $echo $n "Succeeded with $flags$c"
10183 *SYSTIMEKERNEL*) i_systimek="$define"
10184 timeincl=`./findhdr sys/time.h`
10185 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
10186 *) i_systimek="$undef";;
10189 *I_TIME*) i_time="$define"
10190 timeincl=`./findhdr time.h`" $timeincl"
10191 echo "We'll include <time.h>." >&4;;
10192 *) i_time="$undef";;
10195 *I_SYSTIME*) i_systime="$define"
10196 timeincl=`./findhdr sys/time.h`" $timeincl"
10197 echo "We'll include <sys/time.h>." >&4;;
10198 *) i_systime="$undef";;
10202 : see if struct tm knows about tm_zone
10203 case "$i_systime$i_time" in
10206 echo "Checking to see if your struct tm has tm_zone field..." >&4
10207 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
10215 case "$d_tm_tm_zone" in
10216 "$define") echo "Yes, it does." ;;
10217 *) echo "No, it doesn't." ;;
10219 : see if struct tm knows about tm_gmtoff
10220 case "$i_systime$i_time" in
10223 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
10224 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
10232 case "$d_tm_tm_gmtoff" in
10233 "$define") echo "Yes, it does." ;;
10234 *) echo "No, it doesn't." ;;
10237 : see if asctime_r exists
10238 set asctime_r d_asctime_r
10240 case "$d_asctime_r" in
10242 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10243 case "$d_asctime_r_proto:$usethreads" in
10244 ":define") d_asctime_r_proto=define
10245 set d_asctime_r_proto asctime_r $hdrs
10249 case "$d_asctime_r_proto" in
10251 case "$asctime_r_proto" in
10252 ''|0) try='char* asctime_r(const struct tm*, char*);'
10253 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SB ;;
10255 case "$asctime_r_proto" in
10256 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
10257 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SBI ;;
10259 case "$asctime_r_proto" in
10260 ''|0) try='int asctime_r(const struct tm*, char*);'
10261 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SB ;;
10263 case "$asctime_r_proto" in
10264 ''|0) try='int asctime_r(const struct tm*, char*, int);'
10265 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SBI ;;
10267 case "$asctime_r_proto" in
10268 ''|0) d_asctime_r=undef
10270 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
10271 * ) case "$asctime_r_proto" in
10272 REENTRANT_PROTO*) ;;
10273 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
10275 echo "Prototype: $try" ;;
10278 *) case "$usethreads" in
10279 define) echo "asctime_r has no prototype, not using it." >&4 ;;
10286 *) asctime_r_proto=0
10290 : see if atolf exists
10294 : see if atoll exists
10298 : Look for GCC-style attribute format
10299 case "$d_attribute_format" in
10302 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
10303 $cat >attrib.c <<'EOCP'
10305 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
10307 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10308 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10309 echo "Your C compiler doesn't support __attribute__((format))."
10312 echo "Your C compiler supports __attribute__((format))."
10316 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10320 *) val="$d_attribute_format" ;;
10322 set d_attribute_format
10326 : Look for GCC-style attribute format with null format allowed
10327 case "$d_printf_format_null" in
10328 '') case "$d_attribute_format" in
10331 echo "Checking whether your compiler allows __printf__ format to be null ..." >&4
10332 $cat >attrib.c <<EOCP
10334 #$i_stdlib I_STDLIB
10336 #include <stdlib.h>
10338 int null_printf (char* pat,...) __attribute__((__format__(__printf__,1,2)));
10339 int null_printf (char* pat,...) { return (int)pat; }
10340 int main () { exit(null_printf(NULL)); }
10342 if $cc $ccflags -o attrib attrib.c >attrib.out 2>&1 ; then
10343 : run the executable in case it produces a run-time warning
10344 if $run ./attrib >>attrib.out 2>&1; then
10345 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10346 echo "Your C compiler doesn't allow __printf__ format to be null."
10349 echo "Your C compiler allows __printf__ format to be null."
10353 echo "Your C compiler executable failed with __printf__ format null."
10357 echo "Your C compiler fails with __printf__ format null."
10364 *) val="$d_printf_format_null" ;;
10366 set d_printf_format_null
10370 : Look for GCC-style attribute malloc
10371 case "$d_attribute_malloc" in
10374 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
10375 $cat >attrib.c <<'EOCP'
10377 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
10379 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10380 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10381 echo "Your C compiler doesn't support __attribute__((malloc))."
10384 echo "Your C compiler supports __attribute__((malloc))."
10388 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10392 *) val="$d_attribute_malloc" ;;
10394 set d_attribute_malloc
10398 : Look for GCC-style attribute nonnull
10399 case "$d_attribute_nonnull" in
10402 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
10403 $cat >attrib.c <<'EOCP'
10405 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
10407 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10408 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10409 echo "Your C compiler doesn't support __attribute__((nonnull))."
10412 echo "Your C compiler supports __attribute__((nonnull))."
10416 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10420 *) val="$d_attribute_nonnull" ;;
10422 set d_attribute_nonnull
10426 : Look for GCC-style attribute noreturn
10427 case "$d_attribute_noreturn" in
10430 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
10431 $cat >attrib.c <<'EOCP'
10433 void fall_over_dead( void ) __attribute__((noreturn));
10435 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10436 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10437 echo "Your C compiler doesn't support __attribute__((noreturn))."
10440 echo "Your C compiler supports __attribute__((noreturn))."
10444 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10448 *) val="$d_attribute_noreturn" ;;
10450 set d_attribute_noreturn
10454 : Look for GCC-style attribute pure
10455 case "$d_attribute_pure" in
10458 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
10459 $cat >attrib.c <<'EOCP'
10461 int square( int n ) __attribute__((pure));
10463 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10464 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10465 echo "Your C compiler doesn't support __attribute__((pure))."
10468 echo "Your C compiler supports __attribute__((pure))."
10472 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10476 *) val="$d_attribute_pure" ;;
10478 set d_attribute_pure
10482 : Look for GCC-style attribute unused
10483 case "$d_attribute_unused" in
10486 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
10487 $cat >attrib.c <<'EOCP'
10489 int do_something( int dummy __attribute__((unused)), int n );
10491 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10492 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10493 echo "Your C compiler doesn't support __attribute__((unused))."
10496 echo "Your C compiler supports __attribute__((unused))."
10500 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10504 *) val="$d_attribute_unused" ;;
10506 set d_attribute_unused
10510 : Look for GCC-style attribute deprecated
10511 case "$d_attribute_deprecated" in
10514 echo "Checking whether your compiler can handle __attribute__((deprecated)) ..." >&4
10515 $cat >attrib.c <<'EOCP'
10517 int I_am_deprecated(void) __attribute__((deprecated));
10519 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10520 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10521 echo "Your C compiler doesn't support __attribute__((deprecated))."
10524 echo "Your C compiler supports __attribute__((deprecated))."
10528 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10532 *) val="$d_attribute_deprecated" ;;
10534 set d_attribute_deprecated
10538 : Look for GCC-style attribute warn_unused_result
10539 case "$d_attribute_warn_unused_result" in
10542 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
10543 $cat >attrib.c <<'EOCP'
10545 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
10547 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10548 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10549 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
10552 echo "Your C compiler supports __attribute__((warn_unused_result))."
10556 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10560 *) val="$d_attribute_warn_unused_result" ;;
10562 set d_attribute_warn_unused_result
10566 : see if bcmp exists
10570 : see if bcopy exists
10574 : see if getpgrp exists
10575 set getpgrp d_getpgrp
10578 case "$d_getpgrp" in
10581 echo "Checking to see which flavor of getpgrp is in use..."
10583 #$i_unistd I_UNISTD
10584 #include <sys/types.h>
10586 # include <unistd.h>
10588 #$i_stdlib I_STDLIB
10590 #include <stdlib.h>
10594 if (getuid() == 0) {
10595 printf("(I see you are running Configure as super-user...)\n");
10598 #ifdef TRY_BSD_PGRP
10599 if (getpgrp(1) == 0)
10608 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10609 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
10611 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10612 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
10615 echo "I can't seem to compile and run the test program."
10617 xxx="a USG one, i.e. you use getpgrp()."
10619 # SVR4 systems can appear rather BSD-ish.
10620 case "$i_unistd" in
10622 xxx="a BSD one, i.e. you use getpgrp(pid)."
10626 xxx="probably a USG one, i.e. you use getpgrp()."
10631 echo "Assuming your getpgrp is $xxx" >&4
10640 : see if setpgrp exists
10641 set setpgrp d_setpgrp
10644 case "$d_setpgrp" in
10647 echo "Checking to see which flavor of setpgrp is in use..."
10649 #$i_unistd I_UNISTD
10650 #include <sys/types.h>
10652 # include <unistd.h>
10654 #$i_stdlib I_STDLIB
10656 #include <stdlib.h>
10660 if (getuid() == 0) {
10661 printf("(I see you are running Configure as super-user...)\n");
10664 #ifdef TRY_BSD_PGRP
10665 if (-1 == setpgrp(1, 1))
10668 if (setpgrp() != -1)
10674 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10675 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
10677 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10678 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
10681 echo "(I can't seem to compile and run the test program.)"
10683 xxx="a USG one, i.e. you use setpgrp()."
10685 # SVR4 systems can appear rather BSD-ish.
10686 case "$i_unistd" in
10688 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
10692 xxx="probably a USG one, i.e. you use setpgrp()."
10697 echo "Assuming your setpgrp is $xxx" >&4
10706 : Look for GCC-style __builtin_choose_expr
10707 case "$d_builtin_choose_expr" in
10710 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
10711 $cat >try.c <<'EOCP'
10712 #include <assert.h>
10713 #include <stdlib.h>
10716 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
10719 assert( SYRINX(1) == 2112 );
10720 assert( SYRINX(1) != 5150 );
10721 assert( SYRINX(0) == 5150 );
10722 assert( SYRINX(0) != 2112 );
10723 puts( "All good!" );
10729 if eval $compile && $run ./try; then
10730 echo "Your C compiler supports __builtin_choose_expr."
10733 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
10737 *) val="$d_builtin_choose_expr" ;;
10740 set d_builtin_choose_expr
10744 : Look for GCC-style __builtin_expect
10745 case "$d_builtin_expect" in
10748 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
10749 $cat >try.c <<'EOCP'
10752 if ( __builtin_expect(n, 0) ) n = 1;
10753 /* Remember shell exit code truth is 0, C truth is non-zero */
10758 if eval $compile && $run ./try; then
10759 echo "Your C compiler supports __builtin_expect."
10762 echo "Your C compiler doesn't seem to understand __builtin_expect."
10766 *) val="$d_builtin_expect" ;;
10769 set d_builtin_expect
10773 : see if bzero exists
10777 : see if stdarg is available
10779 if $test `./findhdr stdarg.h`; then
10780 echo "<stdarg.h> found." >&4
10783 echo "<stdarg.h> NOT found." >&4
10787 : see if varargs is available
10789 if $test `./findhdr varargs.h`; then
10790 echo "<varargs.h> found." >&4
10792 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
10795 : set up the varargs testing programs
10796 $cat > varargs.c <<EOP
10798 #include <stdarg.h>
10801 #include <varargs.h>
10805 int f(char *p, ...)
10819 p = va_arg(ap, char *);
10825 $cat > varargs <<EOP
10827 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
10836 : now check which varargs header should be included
10842 if `./varargs I_STDARG`; then
10844 elif `./varargs I_VARARGS`; then
10849 if `./varargs I_VARARGS`; then
10857 echo "*** WHOA THERE!!! ***" >&4
10858 echo " Your C compiler \"$cc\" doesn't seem to support stdarg or varargs!" >&4
10859 case "$knowitall" in
10861 echo " I'm giving up; maybe you can try again with a different compiler?" >&4
10865 echo "I could not find the definition for va_dcl... You have problems..." >&4
10866 val="$undef"; set i_stdarg; eval $setvar
10867 val="$undef"; set i_varargs; eval $setvar
10872 case "$i_varhdr" in
10874 val="$define"; set i_stdarg; eval $setvar
10875 val="$undef"; set i_varargs; eval $setvar
10878 val="$undef"; set i_stdarg; eval $setvar
10879 val="$define"; set i_varargs; eval $setvar
10882 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
10886 : see if the Compiler supports C99 variadic macros
10887 case "$i_stdarg$i_stdlib" in
10889 echo "You have <stdarg.h> and <stdlib.h>, so checking for C99 variadic macros." >&4
10892 #include <stdarg.h>
10894 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
10898 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
10904 if eval $compile && $run ./try 2>&1 >/dev/null; then
10905 case "`$run ./try`" in
10907 echo "You have C99 variadic macros." >&4
10908 d_c99_variadic_macros="$define"
10911 echo "You don't have functional C99 variadic macros." >&4
10912 d_c99_variadic_macros="$undef"
10916 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
10917 d_c99_variadic_macros="$undef"
10922 echo "You don't have <stdarg.h> and <stdlib.h>, so not checking for C99 variadic macros." >&4
10923 d_c99_variadic_macros="$undef"
10927 : see if signal is declared as pointer to function returning int or void
10929 xxx=`./findhdr signal.h`
10930 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
10931 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10932 echo "You have int (*signal())() instead of void." >&4
10934 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10935 echo "You have void (*signal())()." >&4
10937 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
10938 echo "You have int (*signal())() instead of void." >&4
10940 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
10941 echo "You have void (*signal())()." >&4
10944 case "$d_voidsig" in
10946 echo "I can't determine whether signal handler returns void or int..." >&4
10948 rp="What type does your signal handler return?"
10951 v*) val="$define";;
10955 echo "As you already told me, signal handler returns void." >&4
10958 *) echo "As you already told me, signal handler returns int." >&4
10965 case "$d_voidsig" in
10966 "$define") signal_t="void";;
10967 *) signal_t="int";;
10971 : check for ability to cast large floats to 32-bit ints.
10973 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
10974 if $test "$intsize" -ge 4; then
10981 #$i_stdlib I_STDLIB
10983 #include <stdlib.h>
10985 #include <sys/types.h>
10986 #include <signal.h>
10987 $signal_t blech(int s) { exit(3); }
10994 signal(SIGFPE, blech);
10996 /* Don't let compiler optimize the test away. Store the number
10997 in a writable string for gcc to pass to sscanf under HP-UX.
10999 sprintf(str, "2147483647");
11000 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
11004 /* x86 processors will probably give 0x8000 0000, which is a
11005 sign change. We don't want that. We want to mimic SPARC
11006 behavior here, which is to preserve the sign and give
11009 if (i32 != ($xxx) f)
11015 if eval $compile_ok; then
11019 echo "(I can't seem to compile the test program--assuming it can't)"
11024 echo "Yup, it can."
11027 echo "Nope, it can't."
11034 : check for ability to cast negative floats to unsigned
11036 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
11039 #$i_stdlib I_STDLIB
11041 #include <stdlib.h>
11043 #include <sys/types.h>
11044 #include <signal.h>
11045 $signal_t blech(int s) { exit(7); }
11046 $signal_t blech_in_list(int s) { exit(4); }
11047 unsigned long dummy_long(unsigned long p) { return p; }
11048 unsigned int dummy_int(unsigned int p) { return p; }
11049 unsigned short dummy_short(unsigned short p) { return p; }
11053 unsigned long along;
11055 unsigned short ashort;
11059 /* Frustrate gcc-2.7.2's optimizer which failed this test with
11060 a direct f = -123. assignment. gcc-2.8.0 reportedly
11061 optimized the whole file away
11063 /* Store the number in a writable string for gcc to pass to
11064 sscanf under HP-UX.
11066 sprintf(str, "-123");
11067 sscanf(str, "%lf", &f); /* f = -123.; */
11069 signal(SIGFPE, blech);
11070 along = (unsigned long)f;
11071 aint = (unsigned int)f;
11072 ashort = (unsigned short)f;
11073 if (along != (unsigned long)-123)
11075 if (aint != (unsigned int)-123)
11077 if (ashort != (unsigned short)-123)
11079 sprintf(str, "1073741824.");
11080 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
11083 along = (unsigned long)f;
11084 if (along != 0x80000000)
11088 along = (unsigned long)f;
11089 if (along != 0x7fffffff)
11093 along = (unsigned long)f;
11094 if (along != 0x80000001)
11098 signal(SIGFPE, blech_in_list);
11099 sprintf(str, "123.");
11100 sscanf(str, "%lf", &f); /* f = 123.; */
11101 along = dummy_long((unsigned long)f);
11102 aint = dummy_int((unsigned int)f);
11103 ashort = dummy_short((unsigned short)f);
11104 if (along != (unsigned long)123)
11106 if (aint != (unsigned int)123)
11108 if (ashort != (unsigned short)123)
11115 if eval $compile_ok; then
11119 echo "(I can't seem to compile the test program--assuming it can't)"
11122 case "$castflags" in
11124 echo "Yup, it can."
11127 echo "Nope, it can't."
11134 : see if vprintf exists
11136 if set vprintf val -f d_vprintf; eval $csym; $val; then
11137 echo 'vprintf() found.' >&4
11140 #$i_stdarg I_STDARG /* Only one of these can be defined by i_varhrd */
11141 #$i_varargs I_VARARGS
11143 #$i_stdlib I_STDLIB
11144 #$i_unistd I_UNISTD
11147 # include <stdarg.h>
11148 #else /* I_VARARGS */
11149 # include <varargs.h>
11153 # include <unistd.h>
11157 # include <stdlib.h>
11160 #include <stdio.h> /* vsprintf prototype */
11163 void xxx(int n, ...)
11168 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11170 int main() { xxx(1, "foo"); }
11172 #else /* I_VARARGS */
11180 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11182 int main() { xxx("foo"); }
11188 if eval $compile_ok; then
11189 if $run ./try; then
11190 echo "Your vsprintf() returns (int)." >&4
11193 echo "Your vsprintf() returns (char*)." >&4
11197 echo 'I am unable to compile the vsprintf() test program.' >&4
11198 # We shouldn't get here. If we do, assume the standard signature,
11199 # not the old BSD one.
11200 echo 'Guessing that vsprintf() returns (int).' >&4
11204 echo 'vprintf() NOT found.' >&4
11215 : see if chown exists
11219 : see if chroot exists
11220 set chroot d_chroot
11223 : see if chsize exists
11224 set chsize d_chsize
11227 : see if class exists
11231 : see if clearenv exists
11232 set clearenv d_clearenv
11235 : Define hasstruct macro for Configure internal use
11236 hasstruct='varname=$1; struct=$2; shift; shift;
11237 while $test $# -ge 2; do
11239 $define) echo "#include <$2>";;
11243 echo "int main () { struct $struct foo; }" >> try.c;
11245 if eval $compile; then
11254 : see whether socket exists
11258 $echo $n "Hmm... $c" >&4
11259 if set socket val -f d_socket; eval $csym; $val; then
11260 echo "Looks like you have Berkeley networking support." >&4
11262 if set setsockopt val -f; eval $csym; $val; then
11265 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
11266 d_oldsock="$define"
11269 if $contains socklib libc.list >/dev/null 2>&1; then
11270 echo "Looks like you have Berkeley networking support." >&4
11272 : we will have to assume that it supports the 4.2 BSD interface
11275 echo "You don't have Berkeley networking in libc$_a..." >&4
11276 if test "X$d_socket" = "X$define"; then
11277 echo "...but you seem to believe that you have sockets." >&4
11279 for net in net socket
11281 if test -f /usr/lib/lib$net$_a; then
11282 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
11283 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
11284 if $contains socket libc.list >/dev/null 2>&1; then
11289 echo "...but the Wollongong group seems to have hacked it in." >&4
11290 sockethdr="-I/usr/netinclude"
11293 echo "Found Berkeley sockets interface in lib$net." >&4
11294 if $contains setsockopt libc.list >/dev/null 2>&1; then
11297 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
11298 d_oldsock="$define"
11304 if test "X$d_socket" != "X$define"; then
11305 echo "or anywhere else I see." >&4
11313 : see if socketpair exists
11314 set socketpair d_sockpair
11319 echo "Checking the availability sa_len in the sock struct ..." >&4
11321 #include <sys/types.h>
11322 #include <sys/socket.h>
11324 struct sockaddr sa;
11325 return (sa.sa_len);
11329 set try; if eval $compile; then
11332 set d_sockaddr_sa_len; eval $setvar
11336 echo "Checking the availability struct sockaddr_in6 ..." >&4
11338 #include <sys/types.h>
11339 #include <sys/socket.h>
11340 #include <netinet/in.h>
11342 struct sockaddr_in6 sin6;
11343 return (sin6.sin6_family);
11347 set try; if eval $compile; then
11350 set d_sockaddr_in6; eval $setvar
11354 echo "Checking the availability sin6_scope_id in struct sockaddr_in6 ..." >&4
11356 #include <sys/types.h>
11357 #include <sys/socket.h>
11358 #include <netinet/in.h>
11360 struct sockaddr_in6 sin6;
11361 return (sin6.sin6_scope_id);
11365 set try; if eval $compile; then
11368 set d_sin6_scope_id; eval $setvar
11372 echo "Checking the availability struct ip_mreq ..." >&4
11374 #include <sys/types.h>
11375 #include <sys/socket.h>
11376 #include <netinet/in.h>
11378 struct ip_mreq mreq;
11379 return (mreq.imr_multiaddr.s_addr);
11383 set try; if eval $compile; then
11386 set d_ip_mreq; eval $setvar
11390 echo "Checking the availability struct ip_mreq_source ..." >&4
11392 #include <sys/types.h>
11393 #include <sys/socket.h>
11394 #include <netinet/in.h>
11396 struct ip_mreq_source mreq;
11397 return (mreq.imr_multiaddr.s_addr);
11401 set try; if eval $compile; then
11404 set d_ip_mreq_source; eval $setvar
11408 echo "Checking the availability struct ipv6_mreq ..." >&4
11410 #include <sys/types.h>
11411 #include <sys/socket.h>
11412 #include <netinet/in.h>
11414 struct ipv6_mreq mreq;
11415 return (mreq.ipv6mr_interface);
11419 set try; if eval $compile; then
11422 set d_ipv6_mreq; eval $setvar
11426 echo "Checking the availability struct ipv6_mreq_source ..." >&4
11428 #include <sys/types.h>
11429 #include <sys/socket.h>
11430 #include <netinet/in.h>
11432 struct ipv6_mreq_source mreq;
11433 return (mreq.imr_multiaddr.s_addr);
11437 set try; if eval $compile; then
11440 set d_ipv6_mreq_source; eval $setvar
11444 echo "Checking the availability of certain socket constants..." >&4
11445 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
11446 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
11448 #include <sys/types.h>
11449 #include <sys/socket.h>
11455 set try; if eval $compile; then
11458 set d_${enum}; eval $setvar
11462 : see if this is a sys/uio.h system
11463 set sys/uio.h i_sysuio
11466 : Check for cmsghdr support
11468 echo "Checking to see if your system supports struct cmsghdr..." >&4
11469 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
11471 case "$d_cmsghdr_s" in
11472 "$define") echo "Yes, it does." ;;
11473 *) echo "No, it doesn't." ;;
11477 : check for const keyword
11479 echo 'Checking to see if your C compiler knows about "const"...' >&4
11480 $cat >const.c <<'EOCP'
11481 typedef struct spug { int drokk; } spug;
11485 const spug y = { 0 };
11488 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
11490 echo "Yup, it does."
11493 echo "Nope, it doesn't."
11498 : see if copysignl exists
11499 set copysignl d_copysignl
11502 : see if crypt exists
11507 $define) cryptlib='' ;;
11508 *) if set crypt val -f d_crypt; eval $csym; $val; then
11509 echo 'crypt() found.' >&4
11513 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
11514 if $test -z "$cryptlib"; then
11515 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
11519 if $test -z "$cryptlib"; then
11520 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
11524 if $test -z "$cryptlib"; then
11525 cryptlib=`./loc libcrypt$_a "" $libpth`
11529 if $test -z "$cryptlib"; then
11530 echo 'crypt() NOT found.' >&4
11541 : see if this is a crypt.h system
11542 set crypt.h i_crypt
11545 : see if crypt_r exists
11546 set crypt_r d_crypt_r
11548 case "$d_crypt_r" in
11550 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
11551 case "$d_crypt_r_proto:$usethreads" in
11552 ":define") d_crypt_r_proto=define
11553 set d_crypt_r_proto crypt_r $hdrs
11557 case "$d_crypt_r_proto" in
11559 case "$crypt_r_proto" in
11560 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
11561 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCS ;;
11563 case "$crypt_r_proto" in
11564 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
11565 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCD ;;
11567 case "$crypt_r_proto" in
11568 ''|0) d_crypt_r=undef
11570 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
11571 * ) case "$crypt_r_proto" in
11572 REENTRANT_PROTO*) ;;
11573 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
11575 echo "Prototype: $try" ;;
11578 *) case "$usethreads" in
11579 define) echo "crypt_r has no prototype, not using it." >&4 ;;
11590 : get csh whereabouts
11592 'csh') val="$undef" ;;
11593 *) val="$define" ;;
11597 : Respect a hint or command line value for full_csh.
11598 case "$full_csh" in
11599 '') full_csh=$csh ;;
11602 : see if ctermid exists
11603 set ctermid d_ctermid
11606 : see if ctermid_r exists
11607 set ctermid_r d_ctermid_r
11609 case "$d_ctermid_r" in
11611 hdrs="$i_systypes sys/types.h define stdio.h "
11612 case "$d_ctermid_r_proto:$usethreads" in
11613 ":define") d_ctermid_r_proto=define
11614 set d_ctermid_r_proto ctermid_r $hdrs
11618 case "$d_ctermid_r_proto" in
11620 case "$ctermid_r_proto" in
11621 ''|0) try='char* ctermid_r(char*);'
11622 ./protochk "$extern_C $try" $hdrs && ctermid_r_proto=B_B ;;
11624 case "$ctermid_r_proto" in
11625 ''|0) d_ctermid_r=undef
11627 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
11628 * ) case "$ctermid_r_proto" in
11629 REENTRANT_PROTO*) ;;
11630 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
11632 echo "Prototype: $try" ;;
11635 *) case "$usethreads" in
11636 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
11643 *) ctermid_r_proto=0
11647 : see if ctime_r exists
11648 set ctime_r d_ctime_r
11650 case "$d_ctime_r" in
11652 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
11653 case "$d_ctime_r_proto:$usethreads" in
11654 ":define") d_ctime_r_proto=define
11655 set d_ctime_r_proto ctime_r $hdrs
11659 case "$d_ctime_r_proto" in
11661 case "$ctime_r_proto" in
11662 ''|0) try='char* ctime_r(const time_t*, char*);'
11663 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SB ;;
11665 case "$ctime_r_proto" in
11666 ''|0) try='char* ctime_r(const time_t*, char*, int);'
11667 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SBI ;;
11669 case "$ctime_r_proto" in
11670 ''|0) try='int ctime_r(const time_t*, char*);'
11671 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SB ;;
11673 case "$ctime_r_proto" in
11674 ''|0) try='int ctime_r(const time_t*, char*, int);'
11675 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SBI ;;
11677 case "$ctime_r_proto" in
11678 ''|0) d_ctime_r=undef
11680 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
11681 * ) case "$ctime_r_proto" in
11682 REENTRANT_PROTO*) ;;
11683 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
11685 echo "Prototype: $try" ;;
11688 *) case "$usethreads" in
11689 define) echo "ctime_r has no prototype, not using it." >&4 ;;
11700 : see if cuserid exists
11701 set cuserid d_cuserid
11704 : see if this is a limits.h system
11705 set limits.h i_limits
11708 : see if this is a float.h system
11709 set float.h i_float
11712 : See if number of significant digits in a double precision number is known
11714 $cat >dbl_dig.c <<EOM
11715 #$i_limits I_LIMITS
11718 #include <limits.h>
11724 printf("Contains DBL_DIG");
11727 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
11728 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
11729 echo "DBL_DIG found." >&4
11732 echo "DBL_DIG NOT found." >&4
11739 : see if dbm.h is available
11740 : see if dbmclose exists
11741 set dbmclose d_dbmclose
11744 case "$d_dbmclose" in
11754 *) set rpcsvc/dbm.h i_rpcsvcdbm
11759 *) echo "We won't be including <dbm.h>"
11769 : see if prototype for dbminit is available
11771 set d_dbminitproto dbminit $i_dbm dbm.h
11774 : see if difftime exists
11775 set difftime d_difftime
11778 : see if this is a dirent system
11780 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
11782 echo "<dirent.h> found." >&4
11785 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
11786 echo "<sys/dir.h> found." >&4
11789 xinc=`./findhdr sys/ndir.h`
11791 echo "<dirent.h> NOT found." >&4
11796 : Look for type of directory structure.
11798 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11800 case "$direntrytype" in
11802 case "$i_dirent" in
11803 $define) guess1='struct dirent' ;;
11804 *) guess1='struct direct' ;;
11807 *) guess1="$direntrytype"
11812 'struct dirent') guess2='struct direct' ;;
11813 *) guess2='struct dirent' ;;
11816 if $contains "$guess1" try.c >/dev/null 2>&1; then
11817 direntrytype="$guess1"
11818 echo "Your directory entries are $direntrytype." >&4
11819 elif $contains "$guess2" try.c >/dev/null 2>&1; then
11820 direntrytype="$guess2"
11821 echo "Your directory entries seem to be $direntrytype." >&4
11823 echo "I don't recognize your system's directory entries." >&4
11824 rp="What type is used for directory entries on this system?"
11827 direntrytype="$ans"
11831 : see if the directory entry stores field length
11833 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11834 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
11835 echo "Good, your directory entry keeps length information in d_namlen." >&4
11838 echo "Your directory entry does not know about the d_namlen field." >&4
11845 : Look for DIR.dd_fd
11846 case "$i_dirent" in
11848 echo "Checking to see if DIR has a dd_fd member variable" >&4
11850 #$i_stdlib I_STDLIB
11852 #include <stdlib.h>
11854 #include <dirent.h>
11864 if eval $compile; then
11865 echo "Yes, it does."
11868 echo "No, it does not."
11873 echo "You don't have a <dirent.h>, so not checking for dd_fd." >&4
11881 : see if this is an sysdir system
11882 set sys/dir.h i_sysdir
11885 : see if this is an sysndir system
11886 set sys/ndir.h i_sysndir
11891 $cat >dirfd.c <<EOM
11893 #$i_stdlib I_STDLIB
11895 #include <stdlib.h>
11897 #$i_dirent I_DIRENT /**/
11898 #$i_sysdir I_SYS_DIR /**/
11899 #$i_sysndir I_SYS_NDIR /**/
11900 #$i_systypes I_SYS_TYPES /**/
11901 #if defined(I_SYS_TYPES)
11902 #include <sys/types.h>
11904 #if defined(I_DIRENT)
11905 #include <dirent.h>
11906 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
11907 #include <sys/dir.h>
11911 #include <sys/ndir.h>
11915 #include <ndir.h> /* may be wrong in the future */
11917 #include <sys/dir.h>
11923 DIR *dirp = opendir(".");
11924 if (dirfd(dirp) >= 0)
11932 if eval $compile; then
11936 $define) echo "dirfd() found." >&4 ;;
11937 *) echo "dirfd() NOT found." >&4 ;;
11943 : see if dlerror exists
11946 set dlerror d_dlerror
11950 : see if dlfcn is available
11951 set dlfcn.h i_dlfcn
11954 : Check what extension to use for shared libs
11959 On a few systems, the dynamically loaded modules that perl generates and uses
11960 will need a different extension than shared libs. The default will probably
11966 *) dflt="$dlext" ;;
11968 rp='What is the extension of dynamically loaded modules'
11977 : Check if dlsym need a leading underscore
11983 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
11984 $cat >dyna.c <<'EOM'
11991 #$i_stdlib I_STDLIB
11993 #include <stdlib.h>
11997 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
11999 #include <sys/types.h>
12004 extern int fred() ;
12013 int mode = RTLD_LAZY ;
12015 handle = dlopen("./dyna.$dlext", mode) ;
12016 if (handle == NULL) {
12021 symbol = dlsym(handle, "fred") ;
12022 if (symbol == NULL) {
12023 /* try putting a leading underscore */
12024 symbol = dlsym(handle, "_fred") ;
12025 if (symbol == NULL) {
12038 : Call the object file tmp-dyna.o in case dlext=o.
12039 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
12040 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
12041 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
12042 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
12045 1) echo "Test program failed using dlopen." >&4
12046 echo "Perhaps you should not use dynamic loading." >&4;;
12047 2) echo "Test program failed using dlsym." >&4
12048 echo "Perhaps you should not use dynamic loading." >&4;;
12049 3) echo "dlsym needs a leading underscore" >&4
12051 4) echo "dlsym doesn't need a leading underscore." >&4;;
12054 echo "I can't compile and run the test program." >&4
12055 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
12060 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
12065 : see if drand48_r exists
12066 set drand48_r d_drand48_r
12068 case "$d_drand48_r" in
12070 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
12071 case "$d_drand48_r_proto:$usethreads" in
12072 ":define") d_drand48_r_proto=define
12073 set d_drand48_r_proto drand48_r $hdrs
12077 case "$d_drand48_r_proto" in
12079 case "$drand48_r_proto" in
12080 ''|0) try='int drand48_r(struct drand48_data*, double*);'
12081 ./protochk "$extern_C $try" $hdrs && drand48_r_proto=I_ST ;;
12083 case "$drand48_r_proto" in
12084 ''|0) d_drand48_r=undef
12086 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
12087 * ) case "$drand48_r_proto" in
12088 REENTRANT_PROTO*) ;;
12089 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
12091 echo "Prototype: $try" ;;
12094 *) case "$usethreads" in
12095 define) echo "drand48_r has no prototype, not using it." >&4 ;;
12102 *) drand48_r_proto=0
12106 : see if prototype for drand48 is available
12108 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
12111 : see if dup2 exists
12115 : see if eaccess exists
12116 set eaccess d_eaccess
12119 : see if endgrent exists
12120 set endgrent d_endgrent
12123 : see if this is an grp system
12129 xxx=`./findhdr grp.h`
12130 $cppstdin $cppflags $cppminus < $xxx >$$.h
12132 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
12144 set d_grpasswd; eval $setvar
12148 : see if endgrent_r exists
12149 set endgrent_r d_endgrent_r
12151 case "$d_endgrent_r" in
12153 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12154 case "$d_endgrent_r_proto:$usethreads" in
12155 ":define") d_endgrent_r_proto=define
12156 set d_endgrent_r_proto endgrent_r $hdrs
12160 case "$d_endgrent_r_proto" in
12162 case "$endgrent_r_proto" in
12163 ''|0) try='int endgrent_r(FILE**);'
12164 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=I_H ;;
12166 case "$endgrent_r_proto" in
12167 ''|0) try='void endgrent_r(FILE**);'
12168 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=V_H ;;
12170 case "$endgrent_r_proto" in
12171 ''|0) d_endgrent_r=undef
12173 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
12174 * ) case "$endgrent_r_proto" in
12175 REENTRANT_PROTO*) ;;
12176 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
12178 echo "Prototype: $try" ;;
12181 *) case "$usethreads" in
12182 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
12189 *) endgrent_r_proto=0
12193 : see if endhostent exists
12194 set endhostent d_endhent
12197 : see if this is a netdb.h system
12198 set netdb.h i_netdb
12201 : see if endhostent_r exists
12202 set endhostent_r d_endhostent_r
12204 case "$d_endhostent_r" in
12206 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12207 case "$d_endhostent_r_proto:$usethreads" in
12208 ":define") d_endhostent_r_proto=define
12209 set d_endhostent_r_proto endhostent_r $hdrs
12213 case "$d_endhostent_r_proto" in
12215 case "$endhostent_r_proto" in
12216 ''|0) try='int endhostent_r(struct hostent_data*);'
12217 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=I_D ;;
12219 case "$endhostent_r_proto" in
12220 ''|0) try='void endhostent_r(struct hostent_data*);'
12221 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=V_D ;;
12223 case "$endhostent_r_proto" in
12224 ''|0) d_endhostent_r=undef
12225 endhostent_r_proto=0
12226 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
12227 * ) case "$endhostent_r_proto" in
12228 REENTRANT_PROTO*) ;;
12229 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
12231 echo "Prototype: $try" ;;
12234 *) case "$usethreads" in
12235 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
12237 d_endhostent_r=undef
12238 endhostent_r_proto=0
12242 *) endhostent_r_proto=0
12246 : see if endnetent exists
12247 set endnetent d_endnent
12250 : see if endnetent_r exists
12251 set endnetent_r d_endnetent_r
12253 case "$d_endnetent_r" in
12255 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12256 case "$d_endnetent_r_proto:$usethreads" in
12257 ":define") d_endnetent_r_proto=define
12258 set d_endnetent_r_proto endnetent_r $hdrs
12262 case "$d_endnetent_r_proto" in
12264 case "$endnetent_r_proto" in
12265 ''|0) try='int endnetent_r(struct netent_data*);'
12266 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=I_D ;;
12268 case "$endnetent_r_proto" in
12269 ''|0) try='void endnetent_r(struct netent_data*);'
12270 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=V_D ;;
12272 case "$endnetent_r_proto" in
12273 ''|0) d_endnetent_r=undef
12274 endnetent_r_proto=0
12275 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
12276 * ) case "$endnetent_r_proto" in
12277 REENTRANT_PROTO*) ;;
12278 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
12280 echo "Prototype: $try" ;;
12283 *) case "$usethreads" in
12284 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
12286 d_endnetent_r=undef
12287 endnetent_r_proto=0
12291 *) endnetent_r_proto=0
12295 : see if endprotoent exists
12296 set endprotoent d_endpent
12299 : see if endprotoent_r exists
12300 set endprotoent_r d_endprotoent_r
12302 case "$d_endprotoent_r" in
12304 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12305 case "$d_endprotoent_r_proto:$usethreads" in
12306 ":define") d_endprotoent_r_proto=define
12307 set d_endprotoent_r_proto endprotoent_r $hdrs
12311 case "$d_endprotoent_r_proto" in
12313 case "$endprotoent_r_proto" in
12314 ''|0) try='int endprotoent_r(struct protoent_data*);'
12315 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=I_D ;;
12317 case "$endprotoent_r_proto" in
12318 ''|0) try='void endprotoent_r(struct protoent_data*);'
12319 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=V_D ;;
12321 case "$endprotoent_r_proto" in
12322 ''|0) d_endprotoent_r=undef
12323 endprotoent_r_proto=0
12324 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
12325 * ) case "$endprotoent_r_proto" in
12326 REENTRANT_PROTO*) ;;
12327 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
12329 echo "Prototype: $try" ;;
12332 *) case "$usethreads" in
12333 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
12335 d_endprotoent_r=undef
12336 endprotoent_r_proto=0
12340 *) endprotoent_r_proto=0
12344 : see if endpwent exists
12345 set endpwent d_endpwent
12348 : see if this is a pwd.h system
12354 xxx=`./findhdr pwd.h`
12355 $cppstdin $cppflags $cppminus < $xxx >$$.h
12357 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
12365 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
12373 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
12381 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
12389 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
12397 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
12405 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
12413 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
12425 set d_pwquota; eval $setvar
12426 set d_pwage; eval $setvar
12427 set d_pwchange; eval $setvar
12428 set d_pwclass; eval $setvar
12429 set d_pwexpire; eval $setvar
12430 set d_pwcomment; eval $setvar
12431 set d_pwgecos; eval $setvar
12432 set d_pwpasswd; eval $setvar
12436 : see if endpwent_r exists
12437 set endpwent_r d_endpwent_r
12439 case "$d_endpwent_r" in
12441 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
12442 case "$d_endpwent_r_proto:$usethreads" in
12443 ":define") d_endpwent_r_proto=define
12444 set d_endpwent_r_proto endpwent_r $hdrs
12448 case "$d_endpwent_r_proto" in
12450 case "$endpwent_r_proto" in
12451 ''|0) try='int endpwent_r(FILE**);'
12452 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=I_H ;;
12454 case "$endpwent_r_proto" in
12455 ''|0) try='void endpwent_r(FILE**);'
12456 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=V_H ;;
12458 case "$endpwent_r_proto" in
12459 ''|0) d_endpwent_r=undef
12461 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
12462 * ) case "$endpwent_r_proto" in
12463 REENTRANT_PROTO*) ;;
12464 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
12466 echo "Prototype: $try" ;;
12469 *) case "$usethreads" in
12470 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
12477 *) endpwent_r_proto=0
12481 : see if endservent exists
12482 set endservent d_endsent
12485 : see if endservent_r exists
12486 set endservent_r d_endservent_r
12488 case "$d_endservent_r" in
12490 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12491 case "$d_endservent_r_proto:$usethreads" in
12492 ":define") d_endservent_r_proto=define
12493 set d_endservent_r_proto endservent_r $hdrs
12497 case "$d_endservent_r_proto" in
12499 case "$endservent_r_proto" in
12500 ''|0) try='int endservent_r(struct servent_data*);'
12501 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=I_D ;;
12503 case "$endservent_r_proto" in
12504 ''|0) try='void endservent_r(struct servent_data*);'
12505 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=V_D ;;
12507 case "$endservent_r_proto" in
12508 ''|0) d_endservent_r=undef
12509 endservent_r_proto=0
12510 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
12511 * ) case "$endservent_r_proto" in
12512 REENTRANT_PROTO*) ;;
12513 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
12515 echo "Prototype: $try" ;;
12518 *) case "$usethreads" in
12519 define) echo "endservent_r has no prototype, not using it." >&4 ;;
12521 d_endservent_r=undef
12522 endservent_r_proto=0
12526 *) endservent_r_proto=0
12530 : Locate the flags for 'open()'
12533 #include <sys/types.h>
12538 #include <sys/file.h>
12540 #$i_stdlib I_STDLIB
12542 #include <stdlib.h>
12553 : check sys/file.h first to get FREAD on Sun
12554 if $test `./findhdr sys/file.h` && \
12555 set try -DI_SYS_FILE && eval $compile; then
12557 echo "<sys/file.h> defines the O_* constants..." >&4
12558 if $run ./try; then
12559 echo "and you have the 3 argument form of open()." >&4
12562 echo "but not the 3 argument form of open(). Oh, well." >&4
12565 elif $test `./findhdr fcntl.h` && \
12566 set try -DI_FCNTL && eval $compile; then
12568 echo "<fcntl.h> defines the O_* constants..." >&4
12569 if $run ./try; then
12570 echo "and you have the 3 argument form of open()." >&4
12573 echo "but not the 3 argument form of open(). Oh, well." >&4
12578 echo "I can't find the O_* constant definitions! You got problems." >&4
12584 : see if this is a sys/file.h system
12589 : do we need to include sys/file.h ?
12593 if $h_sysfile; then
12595 echo "We'll be including <sys/file.h>." >&4
12598 echo "We won't be including <sys/file.h>." >&4
12608 : see if fcntl.h is there
12613 : see if we can include fcntl.h
12619 echo "We'll be including <fcntl.h>." >&4
12622 if $h_sysfile; then
12623 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
12625 echo "We won't be including <fcntl.h>." >&4
12637 : see if fork exists
12641 : see if pipe exists
12645 : check for non-blocking I/O stuff
12646 case "$h_sysfile" in
12647 true) echo "#include <sys/file.h>" > head.c;;
12650 true) echo "#include <fcntl.h>" > head.c;;
12651 *) echo "#include <sys/fcntl.h>" > head.c;;
12656 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
12657 case "$o_nonblock" in
12659 $cat head.c > try.c
12660 $cat >>try.c <<EOCP
12662 #$i_stdlib I_STDLIB
12664 #include <stdlib.h>
12672 printf("O_NONBLOCK\n");
12676 printf("O_NDELAY\n");
12680 printf("FNDELAY\n");
12687 if eval $compile_ok; then
12688 o_nonblock=`$run ./try`
12689 case "$o_nonblock" in
12690 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
12691 *) echo "Seems like we can use $o_nonblock.";;
12694 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
12697 *) echo "Using $hint value $o_nonblock.";;
12702 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
12705 case "$d_fork:$d_pipe" in
12707 $cat head.c > try.c
12708 $cat >>try.c <<EOCP
12710 #include <sys/types.h>
12711 #include <signal.h>
12713 #$i_stdlib I_STDLIB
12715 #include <stdlib.h>
12721 #define MY_O_NONBLOCK $o_nonblock
12722 #ifndef errno /* XXX need better Configure test */
12725 #$i_unistd I_UNISTD
12727 #include <unistd.h>
12729 #$i_string I_STRING
12731 #include <string.h>
12733 #include <strings.h>
12735 $signal_t blech(int x) { exit(3); }
12737 $cat >> try.c <<'EOCP'
12745 pipe(pd); /* Down: child -> parent */
12746 pipe(pu); /* Up: parent -> child */
12749 close(pd[1]); /* Parent reads from pd[0] */
12750 close(pu[0]); /* Parent writes (blocking) to pu[1] */
12752 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
12757 signal(SIGALRM, blech);
12759 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
12761 sprintf(string, "%d\n", ret);
12762 write(2, string, strlen(string));
12765 if (errno == EAGAIN) {
12766 printf("EAGAIN\n");
12771 if (errno == EWOULDBLOCK)
12772 printf("EWOULDBLOCK\n");
12775 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
12776 sleep(2); /* Give it time to close our pipe */
12778 ret = read(pd[0], buf, 1); /* Should read EOF */
12780 sprintf(string, "%d\n", ret);
12781 write(4, string, strlen(string));
12785 close(pd[0]); /* We write to pd[1] */
12786 close(pu[1]); /* We read from pu[0] */
12787 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
12788 close(pd[1]); /* Pipe pd is now fully closed! */
12789 exit(0); /* Bye bye, thank you for playing! */
12793 if eval $compile_ok; then
12794 echo "$startsh" >mtry
12795 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
12797 ./mtry >/dev/null 2>&1
12799 0) eagain=`$cat try.out`;;
12800 1) echo "Could not perform non-blocking setting!";;
12801 2) echo "I did a successful read() for something that was not there!";;
12802 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
12803 4) echo "Could not find F_SETFL!";;
12804 *) echo "Something terribly wrong happened during testing.";;
12806 rd_nodata=`$cat try.ret`
12807 echo "A read() system call with no data present returns $rd_nodata."
12808 case "$rd_nodata" in
12811 echo "(That's peculiar, fixing that to be -1.)"
12817 echo "Forcing errno EAGAIN on read() with no data available."
12821 echo "Your read() sets errno to $eagain when no data is available."
12824 status=`$cat try.err`
12826 0) echo "And it correctly returns 0 to signal EOF.";;
12827 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
12828 *) echo "However, your read() returns '$status' on EOF??";;
12831 if test "$status" = "$rd_nodata"; then
12832 echo "WARNING: you can't distinguish between EOF and no data!"
12836 echo "I can't compile the test program--assuming errno EAGAIN will do."
12840 *) echo "Can't figure out how to test this--assuming errno EAGAIN will do."
12849 echo "Using $hint value $eagain."
12850 echo "Your read() returns $rd_nodata when no data is present."
12851 case "$d_eofnblk" in
12852 "$define") echo "And you can see EOF because read() returns 0.";;
12853 "$undef") echo "But you can't see EOF status from read() returned value.";;
12855 echo "(Assuming you can't see EOF status from read anyway.)"
12861 $rm_try head.c mtry
12863 : see if _ptr and _cnt from stdio act std
12866 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
12867 echo "(Looks like you have stdio.h from BSD.)"
12868 case "$stdio_ptr" in
12869 '') stdio_ptr='((fp)->_p)'
12872 *) ptr_lval=$d_stdio_ptr_lval;;
12874 case "$stdio_cnt" in
12875 '') stdio_cnt='((fp)->_r)'
12878 *) cnt_lval=$d_stdio_cnt_lval;;
12880 case "$stdio_base" in
12881 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
12883 case "$stdio_bufsiz" in
12884 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
12886 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
12887 echo "(Looks like you have stdio.h from Linux.)"
12888 case "$stdio_ptr" in
12889 '') stdio_ptr='((fp)->_IO_read_ptr)'
12892 *) ptr_lval=$d_stdio_ptr_lval;;
12894 case "$stdio_cnt" in
12895 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
12898 *) cnt_lval=$d_stdio_cnt_lval;;
12900 case "$stdio_base" in
12901 '') stdio_base='((fp)->_IO_read_base)';;
12903 case "$stdio_bufsiz" in
12904 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
12907 case "$stdio_ptr" in
12908 '') stdio_ptr='((fp)->_ptr)'
12911 *) ptr_lval=$d_stdio_ptr_lval;;
12913 case "$stdio_cnt" in
12914 '') stdio_cnt='((fp)->_cnt)'
12917 *) cnt_lval=$d_stdio_cnt_lval;;
12919 case "$stdio_base" in
12920 '') stdio_base='((fp)->_base)';;
12922 case "$stdio_bufsiz" in
12923 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
12927 : test whether _ptr and _cnt really work
12928 echo "Checking how std your stdio is..." >&4
12931 #$i_stdlib I_STDLIB
12933 #include <stdlib.h>
12935 #define FILE_ptr(fp) $stdio_ptr
12936 #define FILE_cnt(fp) $stdio_cnt
12938 FILE *fp = fopen("try.c", "r");
12941 18 <= FILE_cnt(fp) &&
12942 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12950 if eval $compile && $to try.c; then
12951 if $run ./try; then
12952 echo "Your stdio acts pretty std."
12955 echo "Your stdio isn't very std."
12958 echo "Your stdio doesn't appear very std."
12962 # glibc 2.2.90 and above apparently change stdio streams so Perl's
12963 # direct buffer manipulation no longer works. The Configure tests
12964 # should be changed to correctly detect this, but until then,
12965 # the following check should at least let perl compile and run.
12966 # (This quick fix should be updated before 5.8.1.)
12967 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
12968 # A. Dougherty, June 3, 2002.
12969 case "$d_gnulibc" in
12971 case "$gnulibc_version" in
12975 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
12984 : Can _ptr be used as an lvalue?
12985 case "$d_stdstdio$ptr_lval" in
12986 $define$define) val=$define ;;
12989 set d_stdio_ptr_lval
12992 : Can _cnt be used as an lvalue?
12993 case "$d_stdstdio$cnt_lval" in
12994 $define$define) val=$define ;;
12997 set d_stdio_cnt_lval
13001 : test whether setting _ptr sets _cnt as a side effect
13002 d_stdio_ptr_lval_sets_cnt="$undef"
13003 d_stdio_ptr_lval_nochange_cnt="$undef"
13004 case "$d_stdio_ptr_lval$d_stdstdio" in
13006 echo "Checking to see what happens if we set the stdio ptr..." >&4
13009 /* Can we scream? */
13010 /* Eat dust sed :-) */
13011 /* In the buffer space, no one can hear you scream. */
13012 #$i_stdlib I_STDLIB
13014 #include <stdlib.h>
13016 #define FILE_ptr(fp) $stdio_ptr
13017 #define FILE_cnt(fp) $stdio_cnt
13018 #include <sys/types.h>
13020 FILE *fp = fopen("try.c", "r");
13025 puts("Fail even to read");
13028 c = getc(fp); /* Read away the first # */
13030 puts("Fail even to read");
13034 18 <= FILE_cnt(fp) &&
13035 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
13037 puts("Fail even to read");
13040 ptr = (char*) FILE_ptr(fp);
13041 cnt = (size_t)FILE_cnt(fp);
13043 FILE_ptr(fp) += 42;
13045 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
13046 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
13049 if (FILE_cnt(fp) <= 20) {
13050 printf ("Fail (<20 chars to test)");
13053 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
13054 puts("Fail compare");
13057 if (cnt == FILE_cnt(fp)) {
13058 puts("Pass_unchanged");
13061 if (FILE_cnt(fp) == (cnt - 42)) {
13062 puts("Pass_changed");
13065 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
13071 if eval $compile && $to try.c; then
13072 case `$run ./try` in
13074 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
13075 d_stdio_ptr_lval_sets_cnt="$define" ;;
13077 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
13078 d_stdio_ptr_lval_nochange_cnt="$define" ;;
13080 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
13082 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
13085 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
13091 : see if _base is also standard
13093 case "$d_stdstdio" in
13097 #$i_stdlib I_STDLIB
13099 #include <stdlib.h>
13101 #define FILE_base(fp) $stdio_base
13102 #define FILE_bufsiz(fp) $stdio_bufsiz
13104 FILE *fp = fopen("try.c", "r");
13107 19 <= FILE_bufsiz(fp) &&
13108 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
13115 if eval $compile && $to try.c; then
13116 if $run ./try; then
13117 echo "And its _base field acts std."
13120 echo "But its _base field isn't std."
13123 echo "However, it seems to be lacking the _base field."
13131 : see if fast_stdio exists
13133 case "$d_stdstdio:$d_stdio_ptr_lval" in
13135 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
13137 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
13148 : see if fchdir exists
13149 set fchdir d_fchdir
13152 : see if fchmod exists
13153 set fchmod d_fchmod
13156 : see if fchown exists
13157 set fchown d_fchown
13160 : see if this is an fcntl system
13164 : See if fcntl-based locking works.
13167 #$i_stdlib I_STDLIB
13169 #include <stdlib.h>
13171 #include <unistd.h>
13173 #include <signal.h>
13174 $signal_t blech(int x) { exit(3); }
13176 #if defined(F_SETLK) && defined(F_SETLKW)
13177 struct flock flock;
13179 fd = open("try.c", O_RDONLY);
13180 flock.l_type = F_RDLCK;
13181 flock.l_whence = SEEK_SET;
13182 flock.l_start = flock.l_len = 0;
13183 signal(SIGALRM, blech);
13185 retval = fcntl(fd, F_SETLK, &flock);
13187 (retval < 0 ? exit(2) : exit(0));
13193 echo "Checking if fcntl-based file locking works... "
13197 if eval $compile_ok; then
13198 if $run ./try; then
13199 echo "Yes, it seems to work."
13202 echo "Nope, it didn't work."
13207 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
13208 *** This is (almost) impossible.
13209 *** If your NFS lock daemons are not feeling well, something like
13210 *** this may happen, please investigate. Cannot continue, aborting.
13218 echo "I'm unable to compile the test program, so I'll assume not."
13223 echo "Nope, since you don't even have fcntl()."
13226 set d_fcntl_can_lock
13230 : check for fd_set items
13233 Checking to see how well your C compiler handles fd_set and friends ...
13236 #$i_stdlib I_STDLIB
13238 #include <stdlib.h>
13240 #$i_systime I_SYS_TIME
13241 #$i_sysselct I_SYS_SELECT
13242 #$d_socket HAS_SOCKET
13243 #include <sys/types.h>
13245 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
13248 #include <sys/time.h>
13250 #ifdef I_SYS_SELECT
13251 #include <sys/select.h>
13260 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
13268 if eval $compile; then
13269 d_fds_bits="$define"
13271 echo "Well, your system knows about the normal fd_set typedef..." >&4
13272 if $run ./try; then
13273 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
13274 d_fd_macros="$define"
13277 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
13279 d_fd_macros="$undef"
13283 Hmm, your compiler has some difficulty with fd_set. Checking further...
13286 if eval $compile; then
13287 d_fds_bits="$undef"
13289 echo "Well, your system has some sort of fd_set available..." >&4
13290 if $run ./try; then
13291 echo "and you have the normal fd_set macros." >&4
13292 d_fd_macros="$define"
13295 but not the normal fd_set macros! Gross! More work for me...
13297 d_fd_macros="$undef"
13300 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
13302 d_fds_bits="$undef"
13303 d_fd_macros="$undef"
13308 : see if fgetpos exists
13309 set fgetpos d_fgetpos
13312 : see if finite exists
13313 set finite d_finite
13316 : see if finitel exists
13317 set finitel d_finitel
13320 : see if flock exists
13324 : see if prototype for flock is available
13326 set d_flockproto flock $i_sysfile sys/file.h
13329 : see if fp_class exists
13330 set fp_class d_fp_class
13333 : see if pathconf exists
13334 set pathconf d_pathconf
13337 : see if fpathconf exists
13338 set fpathconf d_fpathconf
13341 : see if fpclass exists
13342 set fpclass d_fpclass
13345 : see if fpclassify exists
13346 set fpclassify d_fpclassify
13349 : see if fpclassl exists
13350 set fpclassl d_fpclassl
13353 : check for fpos64_t
13355 echo "Checking to see if you have fpos64_t..." >&4
13358 int main() { fpos64_t x = 7; }
13361 if eval $compile; then
13363 echo "You have fpos64_t."
13366 echo "You do not have fpos64_t."
13367 case "$fpossize" in
13368 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
13375 : see if frexpl exists
13376 set frexpl d_frexpl
13379 : see if this is a sys/param system
13380 set sys/param.h i_sysparam
13383 : see if this is a sys/mount.h system
13384 set sys/mount.h i_sysmount
13387 : Check for fs_data_s
13389 echo "Checking to see if your system supports struct fs_data..." >&4
13390 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
13392 case "$d_fs_data_s" in
13393 "$define") echo "Yes, it does." ;;
13394 *) echo "No, it doesn't." ;;
13397 : see if fseeko exists
13398 set fseeko d_fseeko
13400 case "$longsize" in
13401 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
13404 : see if fsetpos exists
13405 set fsetpos d_fsetpos
13408 : see if fstatfs exists
13409 set fstatfs d_fstatfs
13412 : see if statvfs exists
13413 set statvfs d_statvfs
13416 : see if fstatvfs exists
13417 set fstatvfs d_fstatvfs
13421 : see if fsync exists
13425 : see if ftello exists
13426 set ftello d_ftello
13428 case "$longsize" in
13429 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
13432 : check for a working futimes
13435 echo "Checking if you have a working futimes()" >&4
13438 #include <sys/time.h>
13445 fd = open ("try.c", O_RDWR);
13446 if (-1 == fd) exit (1);
13447 rv = futimes (fd, NULL);
13448 exit (rv == -1 ? errno : 0);
13452 if eval $compile; then
13456 0) echo "Yes, you have" >&4
13457 d_futimes="$define"
13459 *) echo "No, you have futimes, but it isn't working ($rc) (probably harmless)" >&4
13463 echo "No, it does not (probably harmless)" >&4
13467 : see if ndbm.h is available
13470 : Compatibility location for RedHat 7.1
13471 set gdbm/ndbm.h i_gdbmndbm
13473 : Compatibility location for Debian 4.0
13474 set gdbm-ndbm.h i_gdbm_ndbm
13478 if $test "$i_ndbm" = "$define" -o "$i_gdbmndbm" = "$define" -o "$i_gdbm_ndbm" = "$define"; then
13479 : see if dbm_open exists
13480 set dbm_open d_dbm_open
13482 case "$d_dbm_open" in
13485 i_gdbmndbm="$undef"
13486 i_gdbm_ndbm="$undef"
13487 echo "We won't be including <ndbm.h>"
13497 ndbm_hdr_protochk='name=$1; hdr=$2;
13498 eval "ihdr=\$""i_$name";
13500 if $test "$ihdr" = "$define"; then
13501 $echo "Checking if your <$hdr> uses prototypes..." >&4;
13502 case "$d_cplusplus" in
13503 $define) ./protochk "$extern_C void dbm_close(DBM *);" literal "extern \"C\" {" $ihdr $hdr literal "}" && val="$define" ;;
13504 *) ./protochk "$extern_C void dbm_close(int, int);" $ihdr $hdr || val="$define" ;;
13507 $define) $echo "Your <$hdr> seems to have prototypes";;
13508 *) $echo "Your <$hdr> does not seem to have prototypes";;
13511 set "d_${name}_h_uses_prototypes";
13515 eval $ndbm_hdr_protochk
13516 set gdbmndbm gdbm/ndbm.h
13517 eval $ndbm_hdr_protochk
13518 set gdbm_ndbm gdbm-ndbm.h
13519 eval $ndbm_hdr_protochk
13521 : see if getaddrinfo exists
13522 set getaddrinfo d_getaddrinfo
13525 : see if getcwd exists
13526 set getcwd d_getcwd
13529 : see if getespwnam exists
13530 set getespwnam d_getespwnam
13533 : see if getfsstat exists
13534 set getfsstat d_getfsstat
13537 : see if getgrent exists
13538 set getgrent d_getgrent
13541 : see if getgrent_r exists
13542 set getgrent_r d_getgrent_r
13544 case "$d_getgrent_r" in
13546 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13547 case "$d_getgrent_r_proto:$usethreads" in
13548 ":define") d_getgrent_r_proto=define
13549 set d_getgrent_r_proto getgrent_r $hdrs
13553 case "$d_getgrent_r_proto" in
13555 case "$getgrent_r_proto" in
13556 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
13557 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBWR ;;
13559 case "$getgrent_r_proto" in
13560 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
13561 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIR ;;
13563 case "$getgrent_r_proto" in
13564 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
13565 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBW ;;
13567 case "$getgrent_r_proto" in
13568 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
13569 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBI ;;
13571 case "$getgrent_r_proto" in
13572 ''|0) try='int getgrent_r(struct group*, char*, int);'
13573 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBI ;;
13575 case "$getgrent_r_proto" in
13576 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
13577 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIH ;;
13579 case "$getgrent_r_proto" in
13580 ''|0) d_getgrent_r=undef
13582 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
13583 * ) case "$getgrent_r_proto" in
13584 REENTRANT_PROTO*) ;;
13585 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
13587 echo "Prototype: $try" ;;
13590 *) case "$usethreads" in
13591 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
13598 *) getgrent_r_proto=0
13602 : see if getgrgid_r exists
13603 set getgrgid_r d_getgrgid_r
13605 case "$d_getgrgid_r" in
13607 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13608 case "$d_getgrgid_r_proto:$usethreads" in
13609 ":define") d_getgrgid_r_proto=define
13610 set d_getgrgid_r_proto getgrgid_r $hdrs
13614 case "$d_getgrgid_r_proto" in
13616 case "$getgrgid_r_proto" in
13617 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
13618 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
13620 case "$getgrgid_r_proto" in
13621 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
13622 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
13624 case "$getgrgid_r_proto" in
13625 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
13626 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
13628 case "$getgrgid_r_proto" in
13629 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
13630 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
13632 case "$getgrgid_r_proto" in
13633 ''|0) d_getgrgid_r=undef
13635 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
13636 * ) case "$getgrgid_r_proto" in
13637 REENTRANT_PROTO*) ;;
13638 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
13640 echo "Prototype: $try" ;;
13643 *) case "$usethreads" in
13644 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
13651 *) getgrgid_r_proto=0
13655 : see if getgrnam_r exists
13656 set getgrnam_r d_getgrnam_r
13658 case "$d_getgrnam_r" in
13660 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13661 case "$d_getgrnam_r_proto:$usethreads" in
13662 ":define") d_getgrnam_r_proto=define
13663 set d_getgrnam_r_proto getgrnam_r $hdrs
13667 case "$d_getgrnam_r_proto" in
13669 case "$getgrnam_r_proto" in
13670 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
13671 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
13673 case "$getgrnam_r_proto" in
13674 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
13675 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
13677 case "$getgrnam_r_proto" in
13678 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
13679 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CBI ;;
13681 case "$getgrnam_r_proto" in
13682 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
13683 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
13685 case "$getgrnam_r_proto" in
13686 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
13687 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
13689 case "$getgrnam_r_proto" in
13690 ''|0) d_getgrnam_r=undef
13692 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
13693 * ) case "$getgrnam_r_proto" in
13694 REENTRANT_PROTO*) ;;
13695 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
13697 echo "Prototype: $try" ;;
13700 *) case "$usethreads" in
13701 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
13708 *) getgrnam_r_proto=0
13712 : see if gethostbyaddr exists
13713 set gethostbyaddr d_gethbyaddr
13716 : see if gethostbyname exists
13717 set gethostbyname d_gethbyname
13720 : see if gethostent exists
13721 set gethostent d_gethent
13724 : see how we will look up host name
13727 if set gethostname val -f d_gethname; eval $csym; $val; then
13728 echo 'gethostname() found.' >&4
13729 d_gethname="$define"
13732 if set uname val -f d_uname; eval $csym; $val; then
13735 uname() was found, but you're running xenix, and older versions of xenix
13736 have a broken uname(). If you don't really know whether your xenix is old
13737 enough to have a broken system call, use the default answer.
13742 "$define") dflt=n;;
13744 rp='Is your uname() broken?'
13747 n*) d_uname="$define"; call=uname;;
13750 echo 'uname() found.' >&4
13757 case "$d_gethname" in
13758 '') d_gethname="$undef";;
13761 '') d_uname="$undef";;
13763 case "$d_uname$d_gethname" in
13768 Every now and then someone has a $call() that lies about the hostname
13769 but can't be fixed for political or economic reasons. If you wish, I can
13770 pretend $call() isn't there and maybe compute hostname at run-time
13771 thanks to the '$phostname' command.
13774 rp="Shall I ignore $call() from now on?"
13777 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
13780 case "$phostname" in
13781 '') aphostname='';;
13782 *) case "$aphostname" in
13784 *) set X $phostname
13788 file=`./loc $file $file $pth`
13789 aphostname=`echo $file $*`
13794 case "$d_uname$d_gethname" in
13797 case "$phostname" in
13799 echo "There will be no way for $package to get your hostname." >&4;;
13801 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
13805 case "$d_phostname" in
13806 '') d_phostname="$undef";;
13809 : see if gethostbyaddr_r exists
13810 set gethostbyaddr_r d_gethostbyaddr_r
13812 case "$d_gethostbyaddr_r" in
13814 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13815 case "$d_gethostbyaddr_r_proto:$usethreads" in
13816 ":define") d_gethostbyaddr_r_proto=define
13817 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
13821 case "$d_gethostbyaddr_r_proto" in
13823 case "$gethostbyaddr_r_proto" in
13824 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13825 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
13827 case "$gethostbyaddr_r_proto" in
13828 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
13829 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
13831 case "$gethostbyaddr_r_proto" in
13832 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
13833 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
13835 case "$gethostbyaddr_r_proto" in
13836 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
13837 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
13839 case "$gethostbyaddr_r_proto" in
13840 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
13841 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
13843 case "$gethostbyaddr_r_proto" in
13844 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
13845 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
13847 case "$gethostbyaddr_r_proto" in
13848 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
13849 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
13851 case "$gethostbyaddr_r_proto" in
13852 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
13853 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
13855 case "$gethostbyaddr_r_proto" in
13856 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
13857 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
13859 case "$gethostbyaddr_r_proto" in
13860 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
13861 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
13863 case "$gethostbyaddr_r_proto" in
13864 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13865 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
13867 case "$gethostbyaddr_r_proto" in
13868 ''|0) d_gethostbyaddr_r=undef
13869 gethostbyaddr_r_proto=0
13870 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
13871 * ) case "$gethostbyaddr_r_proto" in
13872 REENTRANT_PROTO*) ;;
13873 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
13875 echo "Prototype: $try" ;;
13878 *) case "$usethreads" in
13879 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
13881 d_gethostbyaddr_r=undef
13882 gethostbyaddr_r_proto=0
13886 *) gethostbyaddr_r_proto=0
13890 : see if gethostbyname_r exists
13891 set gethostbyname_r d_gethostbyname_r
13893 case "$d_gethostbyname_r" in
13895 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13896 case "$d_gethostbyname_r_proto:$usethreads" in
13897 ":define") d_gethostbyname_r_proto=define
13898 set d_gethostbyname_r_proto gethostbyname_r $hdrs
13902 case "$d_gethostbyname_r_proto" in
13904 case "$gethostbyname_r_proto" in
13905 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
13906 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
13908 case "$gethostbyname_r_proto" in
13909 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
13910 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
13912 case "$gethostbyname_r_proto" in
13913 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
13914 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
13916 case "$gethostbyname_r_proto" in
13917 ''|0) d_gethostbyname_r=undef
13918 gethostbyname_r_proto=0
13919 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
13920 * ) case "$gethostbyname_r_proto" in
13921 REENTRANT_PROTO*) ;;
13922 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
13924 echo "Prototype: $try" ;;
13927 *) case "$usethreads" in
13928 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
13930 d_gethostbyname_r=undef
13931 gethostbyname_r_proto=0
13935 *) gethostbyname_r_proto=0
13939 : see if gethostent_r exists
13940 set gethostent_r d_gethostent_r
13942 case "$d_gethostent_r" in
13944 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13945 case "$d_gethostent_r_proto:$usethreads" in
13946 ":define") d_gethostent_r_proto=define
13947 set d_gethostent_r_proto gethostent_r $hdrs
13951 case "$d_gethostent_r_proto" in
13953 case "$gethostent_r_proto" in
13954 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
13955 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
13957 case "$gethostent_r_proto" in
13958 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
13959 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBIE ;;
13961 case "$gethostent_r_proto" in
13962 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
13963 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBIE ;;
13965 case "$gethostent_r_proto" in
13966 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
13967 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBI ;;
13969 case "$gethostent_r_proto" in
13970 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
13971 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBI ;;
13973 case "$gethostent_r_proto" in
13974 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
13975 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SD ;;
13977 case "$gethostent_r_proto" in
13978 ''|0) d_gethostent_r=undef
13979 gethostent_r_proto=0
13980 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
13981 * ) case "$gethostent_r_proto" in
13982 REENTRANT_PROTO*) ;;
13983 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
13985 echo "Prototype: $try" ;;
13988 *) case "$usethreads" in
13989 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
13991 d_gethostent_r=undef
13992 gethostent_r_proto=0
13996 *) gethostent_r_proto=0
14000 : see if prototypes for various gethostxxx netdb.h functions are available
14002 set d_gethostprotos gethostent $i_netdb netdb.h
14005 : see if getitimer exists
14006 set getitimer d_getitimer
14009 : see if getlogin exists
14010 set getlogin d_getlogin
14013 : see if getlogin_r exists
14014 set getlogin_r d_getlogin_r
14016 case "$d_getlogin_r" in
14018 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
14019 case "$d_getlogin_r_proto:$usethreads" in
14020 ":define") d_getlogin_r_proto=define
14021 set d_getlogin_r_proto getlogin_r $hdrs
14025 case "$d_getlogin_r_proto" in
14027 case "$getlogin_r_proto" in
14028 ''|0) try='int getlogin_r(char*, size_t);'
14029 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BW ;;
14031 case "$getlogin_r_proto" in
14032 ''|0) try='int getlogin_r(char*, int);'
14033 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BI ;;
14035 case "$getlogin_r_proto" in
14036 ''|0) try='char* getlogin_r(char*, size_t);'
14037 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BW ;;
14039 case "$getlogin_r_proto" in
14040 ''|0) try='char* getlogin_r(char*, int);'
14041 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BI ;;
14043 case "$getlogin_r_proto" in
14044 ''|0) d_getlogin_r=undef
14046 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
14047 * ) case "$getlogin_r_proto" in
14048 REENTRANT_PROTO*) ;;
14049 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
14051 echo "Prototype: $try" ;;
14054 *) case "$usethreads" in
14055 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
14062 *) getlogin_r_proto=0
14066 : see if getmnt exists
14067 set getmnt d_getmnt
14070 : see if getmntent exists
14071 set getmntent d_getmntent
14074 : see if getnameinfo exists
14075 set getnameinfo d_getnameinfo
14078 : see if getnetbyaddr exists
14079 set getnetbyaddr d_getnbyaddr
14082 : see if getnetbyname exists
14083 set getnetbyname d_getnbyname
14086 : see if getnetent exists
14087 set getnetent d_getnent
14090 : see if getnetbyaddr_r exists
14091 set getnetbyaddr_r d_getnetbyaddr_r
14093 case "$d_getnetbyaddr_r" in
14095 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14096 case "$d_getnetbyaddr_r_proto:$usethreads" in
14097 ":define") d_getnetbyaddr_r_proto=define
14098 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
14102 case "$d_getnetbyaddr_r_proto" in
14104 case "$getnetbyaddr_r_proto" in
14105 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
14106 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
14108 case "$getnetbyaddr_r_proto" in
14109 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
14110 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
14112 case "$getnetbyaddr_r_proto" in
14113 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
14114 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
14116 case "$getnetbyaddr_r_proto" in
14117 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
14118 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
14120 case "$getnetbyaddr_r_proto" in
14121 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
14122 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
14124 case "$getnetbyaddr_r_proto" in
14125 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
14126 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
14128 case "$getnetbyaddr_r_proto" in
14129 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
14130 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
14132 case "$getnetbyaddr_r_proto" in
14133 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
14134 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
14136 case "$getnetbyaddr_r_proto" in
14137 ''|0) d_getnetbyaddr_r=undef
14138 getnetbyaddr_r_proto=0
14139 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
14140 * ) case "$getnetbyaddr_r_proto" in
14141 REENTRANT_PROTO*) ;;
14142 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
14144 echo "Prototype: $try" ;;
14147 *) case "$usethreads" in
14148 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
14150 d_getnetbyaddr_r=undef
14151 getnetbyaddr_r_proto=0
14155 *) getnetbyaddr_r_proto=0
14159 : see if getnetbyname_r exists
14160 set getnetbyname_r d_getnetbyname_r
14162 case "$d_getnetbyname_r" in
14164 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14165 case "$d_getnetbyname_r_proto:$usethreads" in
14166 ":define") d_getnetbyname_r_proto=define
14167 set d_getnetbyname_r_proto getnetbyname_r $hdrs
14171 case "$d_getnetbyname_r_proto" in
14173 case "$getnetbyname_r_proto" in
14174 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
14175 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
14177 case "$getnetbyname_r_proto" in
14178 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
14179 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
14181 case "$getnetbyname_r_proto" in
14182 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
14183 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
14185 case "$getnetbyname_r_proto" in
14186 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
14187 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
14189 case "$getnetbyname_r_proto" in
14190 ''|0) d_getnetbyname_r=undef
14191 getnetbyname_r_proto=0
14192 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
14193 * ) case "$getnetbyname_r_proto" in
14194 REENTRANT_PROTO*) ;;
14195 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
14197 echo "Prototype: $try" ;;
14200 *) case "$usethreads" in
14201 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
14203 d_getnetbyname_r=undef
14204 getnetbyname_r_proto=0
14208 *) getnetbyname_r_proto=0
14212 : see if getnetent_r exists
14213 set getnetent_r d_getnetent_r
14215 case "$d_getnetent_r" in
14217 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14218 case "$d_getnetent_r_proto:$usethreads" in
14219 ":define") d_getnetent_r_proto=define
14220 set d_getnetent_r_proto getnetent_r $hdrs
14224 case "$d_getnetent_r_proto" in
14226 case "$getnetent_r_proto" in
14227 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
14228 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
14230 case "$getnetent_r_proto" in
14231 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
14232 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBIE ;;
14234 case "$getnetent_r_proto" in
14235 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
14236 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBIE ;;
14238 case "$getnetent_r_proto" in
14239 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
14240 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBI ;;
14242 case "$getnetent_r_proto" in
14243 ''|0) try='int getnetent_r(struct netent*, char*, int);'
14244 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBI ;;
14246 case "$getnetent_r_proto" in
14247 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
14248 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SD ;;
14250 case "$getnetent_r_proto" in
14251 ''|0) d_getnetent_r=undef
14252 getnetent_r_proto=0
14253 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
14254 * ) case "$getnetent_r_proto" in
14255 REENTRANT_PROTO*) ;;
14256 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
14258 echo "Prototype: $try" ;;
14261 *) case "$usethreads" in
14262 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
14264 d_getnetent_r=undef
14265 getnetent_r_proto=0
14269 *) getnetent_r_proto=0
14273 : see if prototypes for various getnetxxx netdb.h functions are available
14275 set d_getnetprotos getnetent $i_netdb netdb.h
14278 : see if getpagesize exists
14279 set getpagesize d_getpagsz
14282 : Optional checks for getprotobyname and getprotobynumber
14284 : see if getprotobyname exists
14285 set getprotobyname d_getpbyname
14288 : see if getprotobynumber exists
14289 set getprotobynumber d_getpbynumber
14292 : see if getprotoent exists
14293 set getprotoent d_getpent
14296 : see if getpgid exists
14297 set getpgid d_getpgid
14300 : see if getpgrp2 exists
14301 set getpgrp2 d_getpgrp2
14304 : see if getppid exists
14305 set getppid d_getppid
14308 : see if getpriority exists
14309 set getpriority d_getprior
14312 : see if getprotobyname_r exists
14313 set getprotobyname_r d_getprotobyname_r
14315 case "$d_getprotobyname_r" in
14317 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14318 case "$d_getprotobyname_r_proto:$usethreads" in
14319 ":define") d_getprotobyname_r_proto=define
14320 set d_getprotobyname_r_proto getprotobyname_r $hdrs
14324 case "$d_getprotobyname_r_proto" in
14326 case "$getprotobyname_r_proto" in
14327 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
14328 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
14330 case "$getprotobyname_r_proto" in
14331 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
14332 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
14334 case "$getprotobyname_r_proto" in
14335 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
14336 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
14338 case "$getprotobyname_r_proto" in
14339 ''|0) d_getprotobyname_r=undef
14340 getprotobyname_r_proto=0
14341 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
14342 * ) case "$getprotobyname_r_proto" in
14343 REENTRANT_PROTO*) ;;
14344 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
14346 echo "Prototype: $try" ;;
14349 *) case "$usethreads" in
14350 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
14352 d_getprotobyname_r=undef
14353 getprotobyname_r_proto=0
14357 *) getprotobyname_r_proto=0
14361 : see if getprotobynumber_r exists
14362 set getprotobynumber_r d_getprotobynumber_r
14364 case "$d_getprotobynumber_r" in
14366 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14367 case "$d_getprotobynumber_r_proto:$usethreads" in
14368 ":define") d_getprotobynumber_r_proto=define
14369 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
14373 case "$d_getprotobynumber_r_proto" in
14375 case "$getprotobynumber_r_proto" in
14376 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
14377 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
14379 case "$getprotobynumber_r_proto" in
14380 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
14381 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
14383 case "$getprotobynumber_r_proto" in
14384 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
14385 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
14387 case "$getprotobynumber_r_proto" in
14388 ''|0) d_getprotobynumber_r=undef
14389 getprotobynumber_r_proto=0
14390 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
14391 * ) case "$getprotobynumber_r_proto" in
14392 REENTRANT_PROTO*) ;;
14393 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
14395 echo "Prototype: $try" ;;
14398 *) case "$usethreads" in
14399 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
14401 d_getprotobynumber_r=undef
14402 getprotobynumber_r_proto=0
14406 *) getprotobynumber_r_proto=0
14410 : see if getprotoent_r exists
14411 set getprotoent_r d_getprotoent_r
14413 case "$d_getprotoent_r" in
14415 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14416 case "$d_getprotoent_r_proto:$usethreads" in
14417 ":define") d_getprotoent_r_proto=define
14418 set d_getprotoent_r_proto getprotoent_r $hdrs
14422 case "$d_getprotoent_r_proto" in
14424 case "$getprotoent_r_proto" in
14425 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
14426 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
14428 case "$getprotoent_r_proto" in
14429 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
14430 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBI ;;
14432 case "$getprotoent_r_proto" in
14433 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
14434 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=S_SBI ;;
14436 case "$getprotoent_r_proto" in
14437 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
14438 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SD ;;
14440 case "$getprotoent_r_proto" in
14441 ''|0) d_getprotoent_r=undef
14442 getprotoent_r_proto=0
14443 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
14444 * ) case "$getprotoent_r_proto" in
14445 REENTRANT_PROTO*) ;;
14446 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
14448 echo "Prototype: $try" ;;
14451 *) case "$usethreads" in
14452 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
14454 d_getprotoent_r=undef
14455 getprotoent_r_proto=0
14459 *) getprotoent_r_proto=0
14463 : see if prototypes for various getprotoxxx netdb.h functions are available
14465 set d_getprotoprotos getprotoent $i_netdb netdb.h
14468 : see if getprpwnam exists
14469 set getprpwnam d_getprpwnam
14472 : see if getpwent exists
14473 set getpwent d_getpwent
14476 : see if getpwent_r exists
14477 set getpwent_r d_getpwent_r
14479 case "$d_getpwent_r" in
14481 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14482 case "$d_getpwent_r_proto:$usethreads" in
14483 ":define") d_getpwent_r_proto=define
14484 set d_getpwent_r_proto getpwent_r $hdrs
14488 case "$d_getpwent_r_proto" in
14490 case "$getpwent_r_proto" in
14491 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
14492 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBWR ;;
14494 case "$getpwent_r_proto" in
14495 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
14496 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIR ;;
14498 case "$getpwent_r_proto" in
14499 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
14500 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBW ;;
14502 case "$getpwent_r_proto" in
14503 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
14504 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBI ;;
14506 case "$getpwent_r_proto" in
14507 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
14508 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBI ;;
14510 case "$getpwent_r_proto" in
14511 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
14512 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIH ;;
14514 case "$getpwent_r_proto" in
14515 ''|0) d_getpwent_r=undef
14517 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
14518 * ) case "$getpwent_r_proto" in
14519 REENTRANT_PROTO*) ;;
14520 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
14522 echo "Prototype: $try" ;;
14525 *) case "$usethreads" in
14526 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
14533 *) getpwent_r_proto=0
14537 : see if getpwnam_r exists
14538 set getpwnam_r d_getpwnam_r
14540 case "$d_getpwnam_r" in
14542 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14543 case "$d_getpwnam_r_proto:$usethreads" in
14544 ":define") d_getpwnam_r_proto=define
14545 set d_getpwnam_r_proto getpwnam_r $hdrs
14549 case "$d_getpwnam_r_proto" in
14551 case "$getpwnam_r_proto" in
14552 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
14553 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
14555 case "$getpwnam_r_proto" in
14556 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
14557 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
14559 case "$getpwnam_r_proto" in
14560 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
14561 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
14563 case "$getpwnam_r_proto" in
14564 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
14565 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
14567 case "$getpwnam_r_proto" in
14568 ''|0) d_getpwnam_r=undef
14570 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
14571 * ) case "$getpwnam_r_proto" in
14572 REENTRANT_PROTO*) ;;
14573 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
14575 echo "Prototype: $try" ;;
14578 *) case "$usethreads" in
14579 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
14586 *) getpwnam_r_proto=0
14590 : see if getpwuid_r exists
14591 set getpwuid_r d_getpwuid_r
14593 case "$d_getpwuid_r" in
14595 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14596 case "$d_getpwuid_r_proto:$usethreads" in
14597 ":define") d_getpwuid_r_proto=define
14598 set d_getpwuid_r_proto getpwuid_r $hdrs
14602 case "$d_getpwuid_r_proto" in
14604 case "$getpwuid_r_proto" in
14605 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
14606 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
14608 case "$getpwuid_r_proto" in
14609 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
14610 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
14612 case "$getpwuid_r_proto" in
14613 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
14614 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
14616 case "$getpwuid_r_proto" in
14617 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
14618 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
14620 case "$getpwuid_r_proto" in
14621 ''|0) d_getpwuid_r=undef
14623 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
14624 * ) case "$getpwuid_r_proto" in
14625 REENTRANT_PROTO*) ;;
14626 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
14628 echo "Prototype: $try" ;;
14631 *) case "$usethreads" in
14632 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
14639 *) getpwuid_r_proto=0
14643 : Optional checks for getsbyname and getsbyport
14645 : see if getservbyname exists
14646 set getservbyname d_getsbyname
14649 : see if getservbyport exists
14650 set getservbyport d_getsbyport
14653 : see if getservent exists
14654 set getservent d_getsent
14657 : see if getservbyname_r exists
14658 set getservbyname_r d_getservbyname_r
14660 case "$d_getservbyname_r" in
14662 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14663 case "$d_getservbyname_r_proto:$usethreads" in
14664 ":define") d_getservbyname_r_proto=define
14665 set d_getservbyname_r_proto getservbyname_r $hdrs
14669 case "$d_getservbyname_r_proto" in
14671 case "$getservbyname_r_proto" in
14672 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
14673 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
14675 case "$getservbyname_r_proto" in
14676 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
14677 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
14679 case "$getservbyname_r_proto" in
14680 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
14681 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
14683 case "$getservbyname_r_proto" in
14684 ''|0) d_getservbyname_r=undef
14685 getservbyname_r_proto=0
14686 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
14687 * ) case "$getservbyname_r_proto" in
14688 REENTRANT_PROTO*) ;;
14689 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
14691 echo "Prototype: $try" ;;
14694 *) case "$usethreads" in
14695 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
14697 d_getservbyname_r=undef
14698 getservbyname_r_proto=0
14702 *) getservbyname_r_proto=0
14706 : see if getservbyport_r exists
14707 set getservbyport_r d_getservbyport_r
14709 case "$d_getservbyport_r" in
14711 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14712 case "$d_getservbyport_r_proto:$usethreads" in
14713 ":define") d_getservbyport_r_proto=define
14714 set d_getservbyport_r_proto getservbyport_r $hdrs
14718 case "$d_getservbyport_r_proto" in
14720 case "$getservbyport_r_proto" in
14721 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
14722 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
14724 case "$getservbyport_r_proto" in
14725 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
14726 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
14728 case "$getservbyport_r_proto" in
14729 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
14730 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
14732 case "$getservbyport_r_proto" in
14733 ''|0) d_getservbyport_r=undef
14734 getservbyport_r_proto=0
14735 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
14736 * ) case "$getservbyport_r_proto" in
14737 REENTRANT_PROTO*) ;;
14738 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
14740 echo "Prototype: $try" ;;
14743 *) case "$usethreads" in
14744 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
14746 d_getservbyport_r=undef
14747 getservbyport_r_proto=0
14751 *) getservbyport_r_proto=0
14755 : see if getservent_r exists
14756 set getservent_r d_getservent_r
14758 case "$d_getservent_r" in
14760 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14761 case "$d_getservent_r_proto:$usethreads" in
14762 ":define") d_getservent_r_proto=define
14763 set d_getservent_r_proto getservent_r $hdrs
14767 case "$d_getservent_r_proto" in
14769 case "$getservent_r_proto" in
14770 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
14771 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBWR ;;
14773 case "$getservent_r_proto" in
14774 ''|0) try='int getservent_r(struct servent*, char*, int);'
14775 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBI ;;
14777 case "$getservent_r_proto" in
14778 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
14779 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=S_SBI ;;
14781 case "$getservent_r_proto" in
14782 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
14783 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SD ;;
14785 case "$getservent_r_proto" in
14786 ''|0) d_getservent_r=undef
14787 getservent_r_proto=0
14788 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
14789 * ) case "$getservent_r_proto" in
14790 REENTRANT_PROTO*) ;;
14791 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
14793 echo "Prototype: $try" ;;
14796 *) case "$usethreads" in
14797 define) echo "getservent_r has no prototype, not using it." >&4 ;;
14799 d_getservent_r=undef
14800 getservent_r_proto=0
14804 *) getservent_r_proto=0
14808 : see if prototypes for various getservxxx netdb.h functions are available
14810 set d_getservprotos getservent $i_netdb netdb.h
14813 : see if getspnam exists
14814 set getspnam d_getspnam
14817 : see if this is a shadow.h system
14818 set shadow.h i_shadow
14821 : see if getspnam_r exists
14822 set getspnam_r d_getspnam_r
14824 case "$d_getspnam_r" in
14826 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
14827 case "$d_getspnam_r_proto:$usethreads" in
14828 ":define") d_getspnam_r_proto=define
14829 set d_getspnam_r_proto getspnam_r $hdrs
14833 case "$d_getspnam_r_proto" in
14835 case "$getspnam_r_proto" in
14836 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
14837 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
14839 case "$getspnam_r_proto" in
14840 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
14841 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=S_CSBI ;;
14843 case "$getspnam_r_proto" in
14844 ''|0) d_getspnam_r=undef
14846 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
14847 * ) case "$getspnam_r_proto" in
14848 REENTRANT_PROTO*) ;;
14849 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
14851 echo "Prototype: $try" ;;
14854 *) case "$usethreads" in
14855 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
14862 *) getspnam_r_proto=0
14866 : see if gettimeofday or ftime exists
14867 set gettimeofday d_gettimeod
14869 case "$d_gettimeod" in
14875 val="$undef"; set d_ftime; eval $setvar
14878 case "$d_gettimeod$d_ftime" in
14881 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
14885 : see if gmtime_r exists
14886 set gmtime_r d_gmtime_r
14888 case "$d_gmtime_r" in
14890 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14891 case "$d_gmtime_r_proto:$usethreads" in
14892 ":define") d_gmtime_r_proto=define
14893 set d_gmtime_r_proto gmtime_r $hdrs
14897 case "$d_gmtime_r_proto" in
14899 case "$gmtime_r_proto" in
14900 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
14901 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=S_TS ;;
14903 case "$gmtime_r_proto" in
14904 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
14905 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=I_TS ;;
14907 case "$gmtime_r_proto" in
14908 ''|0) d_gmtime_r=undef
14910 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
14911 * ) case "$gmtime_r_proto" in
14912 REENTRANT_PROTO*) ;;
14913 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
14915 echo "Prototype: $try" ;;
14918 *) case "$usethreads" in
14919 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
14926 *) gmtime_r_proto=0
14930 : see if hasmntopt exists
14931 set hasmntopt d_hasmntopt
14934 : see if this is a netinet/in.h or sys/in.h system
14935 set netinet/in.h i_niin sys/in.h i_sysin
14938 : see if arpa/inet.h has to be included
14939 set arpa/inet.h i_arpainet
14942 : see if htonl --and friends-- exists
14947 : Maybe they are macros.
14950 $cat >htonl.c <<EOM
14952 #include <sys/types.h>
14953 #$i_niin I_NETINET_IN
14955 #$i_arpainet I_ARPA_INET
14956 #ifdef I_NETINET_IN
14957 #include <netinet/in.h>
14960 #include <sys/in.h>
14963 #include <arpa/inet.h>
14966 printf("Defined as a macro.");
14969 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
14970 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
14972 echo "But it seems to be defined as a macro." >&4
14980 : see if ilogbl exists
14981 set ilogbl d_ilogbl
14986 if set index val -f; eval $csym; $val; then
14987 if set strchr val -f d_strchr; eval $csym; $val; then
14988 if $contains strchr "$strings" >/dev/null 2>&1 ; then
14991 echo "strchr() found." >&4
14995 echo "index() found." >&4
15000 echo "index() found." >&4
15003 if set strchr val -f d_strchr; eval $csym; $val; then
15006 echo "strchr() found." >&4
15008 echo "No index() or strchr() found!" >&4
15013 set d_strchr; eval $setvar
15015 set d_index; eval $setvar
15017 : check whether inet_aton exists
15018 set inet_aton d_inetaton
15021 : see if inet_ntop exists
15022 set inet_ntop d_inetntop
15025 : see if inet_pton exists
15026 set inet_pton d_inetpton
15031 $cat >isascii.c <<EOCP
15034 #$i_stdlib I_STDLIB
15036 #include <stdlib.h>
15047 if eval $compile; then
15048 echo "isascii() found." >&4
15051 echo "isascii() NOT found." >&4
15060 $cat >isblank.c <<'EOCP'
15071 if $cc $ccflags $ldflags -o isblank isblank.c $libs >/dev/null 2>&1 ; then
15072 echo "isblank() found." >&4
15075 echo "isblank() NOT found." >&4
15082 : see if isfinite exists
15083 set isfinite d_isfinite
15086 : see if isinf exists
15090 : see if isnan exists
15094 : see if isnanl exists
15095 set isnanl d_isnanl
15098 : see if killpg exists
15099 set killpg d_killpg
15102 : see if lchown exists
15104 $cat > try.c <<'EOCP'
15105 /* System header to define __stub macros and hopefully few prototypes,
15106 which can conflict with char lchown(); below. */
15107 #include <assert.h>
15108 /* Override any gcc2 internal prototype to avoid an error. */
15109 /* We use char because int might match the return type of a gcc2
15110 builtin and then its argument prototype would still apply. */
15113 /* The GNU C library defines this for functions which it implements
15114 to always fail with ENOSYS. Some functions are actually named
15115 something starting with __ and the normal name is an alias. */
15116 #if defined (__stub_lchown) || defined (__stub___lchown)
15124 if eval $compile; then
15125 $echo "lchown() found." >&4
15128 $echo "lchown() NOT found." >&4
15134 : See if number of significant digits in a double precision number is known
15136 $cat >ldbl_dig.c <<EOM
15137 #$i_limits I_LIMITS
15140 #include <limits.h>
15146 printf("Contains LDBL_DIG");
15149 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
15150 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
15151 echo "LDBL_DIG found." >&4
15154 echo "LDBL_DIG NOT found." >&4
15161 : see if this is a math.h system
15165 : check to see if math.h defines _LIB_VERSION
15166 d_libm_lib_version="$undef"
15170 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
15172 #include <unistd.h>
15174 int main (int argc, char *argv[])
15176 printf ("%d\n", _LIB_VERSION);
15181 if eval $compile; then
15183 echo "Yes, it does ($foo)" >&4
15184 d_libm_lib_version="$define"
15186 echo "No, it does not (probably harmless)" >&4
15193 : see if link exists
15197 : see if localtime_r exists
15198 set localtime_r d_localtime_r
15200 case "$d_localtime_r" in
15202 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
15203 case "$d_localtime_r_proto:$usethreads" in
15204 ":define") d_localtime_r_proto=define
15205 set d_localtime_r_proto localtime_r $hdrs
15209 case "$d_localtime_r_proto" in
15211 case "$localtime_r_proto" in
15212 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
15213 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=S_TS ;;
15215 case "$localtime_r_proto" in
15216 ''|0) try='int localtime_r(const time_t*, struct tm*);'
15217 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=I_TS ;;
15219 case "$localtime_r_proto" in
15220 ''|0) d_localtime_r=undef
15221 localtime_r_proto=0
15222 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
15223 * ) case "$localtime_r_proto" in
15224 REENTRANT_PROTO*) ;;
15225 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
15227 echo "Prototype: $try" ;;
15230 *) case "$usethreads" in
15231 define) echo "localtime_r has no prototype, not using it." >&4 ;;
15233 d_localtime_r=undef
15234 localtime_r_proto=0
15238 *) localtime_r_proto=0
15242 : see if localtime_r calls tzset
15243 case "$localtime_r_proto" in
15246 /* Does our libc's localtime_r call tzset ?
15247 * return 0 if so, 1 otherwise.
15249 #$i_systypes I_SYS_TYPES
15250 #$i_unistd I_UNISTD
15252 #$i_stdlib I_STDLIB
15253 #$i_string I_STRING
15254 #$i_malloc I_MALLOC
15256 # include <sys/types.h>
15259 # include <unistd.h>
15265 #include <stdlib.h>
15268 # include <string.h>
15270 # include <strings.h>
15273 # include <malloc.h>
15277 time_t t = time(0L);
15278 char w_tz[]="TZ" "=GMT+5",
15279 e_tz[]="TZ" "=GMT-5",
15280 *tz_e = (char*)malloc(16),
15281 *tz_w = (char*)malloc(16);
15282 struct tm tm_e, tm_w;
15283 memset(&tm_e,'\0',sizeof(struct tm));
15284 memset(&tm_w,'\0',sizeof(struct tm));
15289 localtime_r(&t, &tm_e);
15292 localtime_r(&t, &tm_w);
15294 if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 )
15300 if eval $compile; then
15301 if $run ./try; then
15302 d_localtime_r_needs_tzset=undef;
15304 d_localtime_r_needs_tzset=define;
15307 d_localtime_r_needs_tzset=undef;
15311 d_localtime_r_needs_tzset=undef;
15316 : see if localeconv exists
15317 set localeconv d_locconv
15320 : see if lockf exists
15324 : see if prototype for lseek is available
15326 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
15329 : see if lstat exists
15333 : see if madvise exists
15334 set madvise d_madvise
15337 : see if malloc_size exists
15338 set malloc_size d_malloc_size
15341 : see if malloc_size_good exists
15342 set malloc_good_size d_malloc_good_size
15345 : see if mblen exists
15349 : see if mbstowcs exists
15350 set mbstowcs d_mbstowcs
15353 : see if mbtowc exists
15354 set mbtowc d_mbtowc
15357 : see if memchr exists
15358 set memchr d_memchr
15361 : see if memcmp exists
15362 set memcmp d_memcmp
15365 : see if memcpy exists
15366 set memcpy d_memcpy
15369 : see if memmove exists
15370 set memmove d_memmove
15373 : see if memset exists
15374 set memset d_memset
15377 : see if mkdir exists
15381 : see if mkdtemp exists
15382 set mkdtemp d_mkdtemp
15385 : see if mkfifo exists
15386 set mkfifo d_mkfifo
15389 : see if mkstemp exists
15390 set mkstemp d_mkstemp
15393 : see if mkstemps exists
15394 set mkstemps d_mkstemps
15397 : see if mktime exists
15398 set mktime d_mktime
15401 : see if this is a sys/mman.h system
15402 set sys/mman.h i_sysmman
15405 : see if mmap exists
15408 : see what shmat returns
15409 : default to something harmless
15411 case "$i_sysmman$d_mmap" in
15413 $cat >mmap.c <<'END'
15414 #include <sys/mman.h>
15417 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
15422 echo "and it returns ($mmaptype)." >&4
15428 : see if sqrtl exists
15432 : see if scalbnl exists
15433 set scalbnl d_scalbnl
15436 : see if modfl exists
15440 : see if prototype for modfl is available
15442 set d_modflproto modfl $i_math math.h
15445 d_modfl_pow32_bug="$undef"
15447 case "$d_longdbl$d_modfl" in
15450 Checking to see whether your modfl() is okay for large values...
15456 if $test "X$d_modflproto" != "X$define"; then
15457 $cat >>try.c <<EOCP
15458 /* Sigh. many current glibcs provide the function, but do not prototype it. */
15459 long double modfl (long double, long double *);
15462 $cat >>try.c <<EOCP
15464 long double nv = 4294967303.15;
15470 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
15474 case "$osname:$gccversion" in
15475 aix:) saveccflags="$ccflags"
15476 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
15479 if eval $compile; then
15482 *" 4294967303.150000 1.150000 4294967302.000000")
15483 echo >&4 "Your modfl() is broken for large values."
15484 d_modfl_pow32_bug="$define"
15486 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
15490 *" 4294967303.150000 0.150000 4294967303.000000")
15491 echo >&4 "Your modfl() seems okay for large values."
15493 *) echo >&4 "I don't understand your modfl() at all."
15499 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
15502 case "$osname:$gccversion" in
15503 aix:) ccflags="$saveccflags" ;; # restore
15508 if $test "$uselongdouble" = "$define"; then
15510 if $test "$d_sqrtl" != "$define"; then
15511 message="$message sqrtl"
15513 if $test "$d_modfl" != "$define"; then
15514 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
15515 echo "You have both aintl and copysignl, so I can emulate modfl."
15517 message="$message modfl"
15520 if $test "$d_frexpl" != "$define"; then
15521 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
15522 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
15524 message="$message frexpl"
15528 if $test "$message" != ""; then
15531 *** You requested the use of long doubles but you do not seem to have
15532 *** the following mathematical functions needed for long double support:
15534 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
15535 *** Cannot continue, aborting.
15543 : see if mprotect exists
15544 set mprotect d_mprotect
15547 : see if msgctl exists
15548 set msgctl d_msgctl
15551 : see if msgget exists
15552 set msgget d_msgget
15555 : see if msgsnd exists
15556 set msgsnd d_msgsnd
15559 : see if msgrcv exists
15560 set msgrcv d_msgrcv
15563 : see how much of the 'msg*(2)' library is present.
15566 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
15567 *"$undef"*) h_msg=false;;
15571 case "`ipcs 2>&1`" in
15572 "SVID messages"*"not configured"*)
15573 echo "Your $osname does not have the msg*(2) configured." >&4
15576 set msgctl d_msgctl
15578 set msgget d_msgget
15580 set msgsnd d_msgsnd
15582 set msgrcv d_msgrcv
15588 : we could also check for sys/ipc.h ...
15589 if $h_msg && $test `./findhdr sys/msg.h`; then
15590 echo "You have the full msg*(2) library." >&4
15593 echo "You don't have the full msg*(2) library." >&4
15599 : Check for msghdr_s
15601 echo "Checking to see if your system supports struct msghdr..." >&4
15602 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
15604 case "$d_msghdr_s" in
15605 "$define") echo "Yes, it does." ;;
15606 *) echo "No, it doesn't." ;;
15610 : see if msync exists
15614 : see if munmap exists
15615 set munmap d_munmap
15618 : see if nice exists
15622 : see if this is a langinfo.h system
15623 set langinfo.h i_langinfo
15626 : see if nl_langinfo exists
15627 set nl_langinfo d_nl_langinfo
15630 : check for volatile keyword
15632 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
15633 $cat >try.c <<'EOCP'
15636 typedef struct _goo_struct goo_struct;
15637 goo_struct * volatile goo = ((goo_struct *)0);
15638 struct _goo_struct {
15643 typedef unsigned short foo_t;
15644 char *volatile foo;
15646 volatile foo_t blech;
15650 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
15652 echo "Yup, it does."
15655 echo "Nope, it doesn't."
15661 : Check basic sizes
15663 $echo "Choosing the C types to be used for Perl's internal types..." >&4
15665 case "$use64bitint:$d_quad:$quadtype" in
15668 uvtype="$uquadtype"
15673 uvtype="unsigned long"
15679 case "$uselongdouble:$d_longdbl" in
15681 nvtype="long double"
15682 nvsize=$longdblsize
15689 $echo "(IV will be "$ivtype", $ivsize bytes)"
15690 $echo "(UV will be "$uvtype", $uvsize bytes)"
15691 $echo "(NV will be "$nvtype", $nvsize bytes)"
15694 #$i_inttypes I_INTTYPES
15696 #include <inttypes.h>
15701 int8_t i = INT8_MAX;
15702 uint8_t u = UINT8_MAX;
15703 printf("int8_t\n");
15706 int16_t i = INT16_MAX;
15707 uint16_t u = UINT16_MAX;
15708 printf("int16_t\n");
15711 int32_t i = INT32_MAX;
15712 uint32_t u = UINT32_MAX;
15713 printf("int32_t\n");
15718 i8type="signed char"
15719 u8type="unsigned char"
15724 '') case "$shortsize" in
15726 u16type="unsigned short"
15734 '') set try -DINT16
15735 if eval $compile; then
15736 case "`$run ./try`" in
15748 '') if $test $shortsize -ge 2; then
15750 u16type="unsigned short"
15758 '') case "$longsize" in
15760 u32type="unsigned long"
15764 *) case "$intsize" in
15766 u32type="unsigned int"
15776 '') set try -DINT32
15777 if eval $compile; then
15778 case "`$run ./try`" in
15790 '') if $test $intsize -ge 4; then
15792 u32type="unsigned int"
15800 '') case "$d_quad:$quadtype" in
15802 i64type="$quadtype"
15803 u64type="$uquadtype"
15811 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
15812 : volatile so that the compiler has to store it out to memory.
15813 if test X"$d_volatile" = X"$define"; then
15818 #$i_stdlib I_STDLIB
15820 #include <stdlib.h>
15822 #include <sys/types.h>
15823 #include <signal.h>
15825 $volatile int bletched = 0;
15826 $signal_t blech(int s) { bletched = 1; }
15831 int n = 8 * $uvsize;
15834 signal(SIGFPE, blech);
15837 for (i = 0; i < n; i++) {
15838 u = u << 1 | ($uvtype)1;
15840 if (($uvtype)d != u)
15844 d = ($nvtype)(u - 1);
15845 if (($uvtype)d != (u - 1))
15852 printf("%d\n", ((i == n) ? -n : i));
15858 d_nv_preserves_uv="$undef"
15859 if eval $compile; then
15860 nv_preserves_uv_bits="`$run ./try`"
15862 case "$nv_preserves_uv_bits" in
15864 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
15865 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
15866 d_nv_preserves_uv="$define"
15868 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
15869 d_nv_preserves_uv="$undef" ;;
15870 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
15871 nv_preserves_uv_bits="0" ;;
15875 $echo "Checking to find the largest integer value your NVs can hold..." >&4
15876 : volatile so that the compiler has to store it out to memory.
15877 if test X"$d_volatile" = X"$define"; then
15883 typedef $nvtype NV;
15890 while(count < 256) {
15891 $volatile NV up = value + 1.0;
15892 $volatile NV negated = -value;
15893 $volatile NV down = negated - 1.0;
15894 $volatile NV got_up = up - value;
15895 int up_good = got_up == 1.0;
15896 int got_down = down - negated;
15897 int down_good = got_down == -1.0;
15899 if (down_good != up_good) {
15901 "Inconsistency - up %d %f; down %d %f; for 2**%d (%.20f)\n",
15902 up_good, (double) got_up, down_good, (double) got_down,
15903 count, (double) value);
15910 fputs("256.0", stdout);
15913 fputs("2.0", stdout);
15919 fputs("*", stdout);
15925 fprintf(stderr, "Cannot overflow integer range, even at 2**%d (%.20f)\n",
15926 count, (double) value);
15932 nv_overflows_integers_at='0'
15933 if eval $compile; then
15939 The largest integer your NVs can preserve is equal to $xxx
15941 nv_overflows_integers_at="$xxx"
15944 Cannot determine the largest integer value your NVs can hold, unexpected output
15951 Cannot determine the largest integer value your NVs can hold
15958 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
15959 : volatile so that the compiler has to store it out to memory.
15960 if test X"$d_volatile" = X"$define"; then
15965 #$i_stdlib I_STDLIB
15967 #include <stdlib.h>
15969 #$i_string I_STRING
15971 # include <string.h>
15973 # include <strings.h>
15975 #include <sys/types.h>
15976 #include <signal.h>
15978 $volatile int bletched = 0;
15979 $signal_t blech(int s) { bletched = 1; }
15982 int checkit($nvtype d, char *where) {
15983 unsigned char *p = (char *)&d;
15984 unsigned char *end = p + sizeof(d);
15994 printf("No - %s: 0x", where);
15996 printf ("%02X", *p++);
16001 int main(int argc, char **argv) {
16004 fail += checkit(d, "0.0");
16006 /* The compiler shouldn't be assuming that bletched is 0 */
16009 fail += checkit(d, "bleched");
16012 signal(SIGFPE, blech);
16015 /* Paranoia - the compiler should have no way of knowing that ANSI says
16016 that argv[argc] will always be NULL. Actually, if it did assume this it
16017 would be buggy, as this is C and main() can be called from elsewhere in
16019 d = argv[argc] ? 1 : 0;
16022 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
16025 fail += checkit(d, "ternary");
16027 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
16030 printf("No - memset doesn't give 0.0\n");
16031 /* This might just blow up: */
16032 printf("(gives %g)\n", d);
16038 printf("No - something bleched\n");
16043 printf("No - %d fail(s)\n", fail);
16052 d_nv_zero_is_allbits_zero="$undef"
16053 if eval $compile; then
16059 0.0 is represented as all bits zero in memory
16061 d_nv_zero_is_allbits_zero="$define"
16064 0.0 is not represented as all bits zero in memory
16066 d_nv_zero_is_allbits_zero="$undef"
16071 0.0 is not represented as all bits zero in memory
16073 d_nv_zero_is_allbits_zero="$undef"
16079 : check for off64_t
16081 echo "Checking to see if you have off64_t..." >&4
16083 #include <sys/types.h>
16084 #include <unistd.h>
16085 int main() { off64_t x = 7; }
16088 if eval $compile; then
16090 echo "You have off64_t."
16093 echo "You do not have off64_t."
16094 case "$lseeksize" in
16095 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
16102 : how to create joinable pthreads
16103 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
16105 echo "Checking what constant to use for creating joinable pthreads..." >&4
16106 $cat >try.c <<'EOCP'
16107 #include <pthread.h>
16109 int detachstate = JOINABLE;
16112 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
16113 if eval $compile; then
16114 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
16115 val="$undef" # Yes, undef.
16116 set d_old_pthread_create_joinable
16119 set old_pthread_create_joinable
16122 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
16123 if eval $compile; then
16124 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
16126 set d_old_pthread_create_joinable
16128 val=PTHREAD_CREATE_UNDETACHED
16129 set old_pthread_create_joinable
16132 set try -DJOINABLE=__UNDETACHED
16133 if eval $compile; then
16134 echo "You seem to use __UNDETACHED." >&4
16136 set d_old_pthread_create_joinable
16139 set old_pthread_create_joinable
16142 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
16144 set d_old_pthread_create_joinable
16147 set old_pthread_create_joinable
16154 d_old_pthread_create_joinable="$undef"
16155 old_pthread_create_joinable=""
16158 : see if pause exists
16162 : see if poll exists
16166 : see if prctl exists
16170 : see if prctl supports PR_SET_NAME
16171 d_prctl_set_name=$undef
16175 #include <sys/prctl.h>
16177 int main (int argc, char *argv[])
16179 return (prctl (PR_SET_NAME, "Test"));
16183 if eval $compile_ok && $run ./try; then
16184 echo "Your prctl (PR_SET_NAME, ...) works"
16185 d_prctl_set_name=$define
16191 : see if readlink exists
16192 set readlink d_readlink
16195 : Check if exe is symlink to abs path of executing program
16199 case "$d_readlink" in
16201 : NetBSD first as /proc/self is a symlink to /proc/curproc, and it feels
16202 : more tidy to avoid an extra level of symlink
16203 set NetBSD /proc/curproc/exe Linux /proc/self/exe FreeBSD /proc/curproc/file Solaris /proc/self/path/a.out
16204 while test $# -gt 0; do
16207 if $issymlink $try; then
16208 $ls -l $try > reflect
16209 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
16210 echo "You have $type-like $try."
16211 procselfexe='"'$try'"'
16213 : This will break out of the loop
16224 : backward compatibility for d_hvfork
16225 if test X$d_hvfork != X; then
16226 d_vfork="$d_hvfork"
16229 : see if there is a vfork
16234 d_pseudofork=$undef
16236 : Ok, but do we want to use it. vfork is reportedly unreliable in
16237 : perl on Solaris 2.x, and probably elsewhere.
16241 case "$usevfork" in
16247 Perl can only use a vfork() that doesn't suffer from strict
16248 restrictions on calling functions or modifying global data in
16249 the child. For example, glibc-2.1 contains such a vfork()
16250 that is unsuitable. If your system provides a proper fork()
16251 call, chances are that you do NOT want perl to use vfork().
16254 rp="Do you still want to use vfork()?"
16259 echo "Ok, we won't use vfork()."
16268 $define) usevfork='true';;
16269 *) usevfork='false';;
16272 : see whether the pthread_atfork exists
16274 #include <pthread.h>
16277 #ifdef PTHREAD_ATFORK
16278 pthread_atfork(NULL,NULL,NULL);
16283 : see if pthread_atfork exists
16284 set try -DPTHREAD_ATFORK
16285 if eval $compile; then
16290 case "$usethreads" in
16293 $define) echo 'pthread_atfork found.' >&4 ;;
16294 *) echo 'pthread_atfork NOT found.' >&4 ;;
16297 set d_pthread_atfork
16300 : see if pthread_attr_setscope exists
16301 set pthread_attr_setscope d_pthread_attr_setscope
16304 : see whether the various POSIXish _yields exist
16306 #include <pthread.h>
16312 #ifdef PTHREAD_YIELD
16315 #ifdef PTHREAD_YIELD_NULL
16316 pthread_yield(NULL);
16322 : see if sched_yield exists
16323 set try -DSCHED_YIELD
16324 if eval $compile; then
16326 sched_yield='sched_yield()'
16330 case "$usethreads" in
16333 $define) echo 'sched_yield() found.' >&4 ;;
16334 *) echo 'sched_yield() NOT found.' >&4 ;;
16340 : see if pthread_yield exists
16341 set try -DPTHREAD_YIELD
16342 if eval $compile; then
16344 case "$sched_yield" in
16345 '') sched_yield='pthread_yield()' ;;
16348 set try -DPTHREAD_YIELD_NULL
16349 if eval $compile; then
16351 case "$sched_yield" in
16352 '') sched_yield='pthread_yield(NULL)' ;;
16358 case "$usethreads" in
16361 $define) echo 'pthread_yield() found.' >&4 ;;
16362 *) echo 'pthread_yield() NOT found.' >&4 ;;
16366 set d_pthread_yield
16368 case "$sched_yield" in
16369 '') sched_yield=undef ;;
16373 : see if random_r exists
16374 set random_r d_random_r
16376 case "$d_random_r" in
16378 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
16379 case "$d_random_r_proto:$usethreads" in
16380 ":define") d_random_r_proto=define
16381 set d_random_r_proto random_r $hdrs
16385 case "$d_random_r_proto" in
16387 case "$random_r_proto" in
16388 ''|0) try='int random_r(int*, struct random_data*);'
16389 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_iS ;;
16391 case "$random_r_proto" in
16392 ''|0) try='int random_r(long*, struct random_data*);'
16393 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_lS ;;
16395 case "$random_r_proto" in
16396 ''|0) try='int random_r(struct random_data*, int32_t*);'
16397 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_St ;;
16399 case "$random_r_proto" in
16400 ''|0) d_random_r=undef
16402 echo "Disabling random_r, cannot determine prototype." >&4 ;;
16403 * ) case "$random_r_proto" in
16404 REENTRANT_PROTO*) ;;
16405 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
16407 echo "Prototype: $try" ;;
16410 *) case "$usethreads" in
16411 define) echo "random_r has no prototype, not using it." >&4 ;;
16418 *) random_r_proto=0
16422 : see if readdir and friends exist
16423 set readdir d_readdir
16425 set seekdir d_seekdir
16427 set telldir d_telldir
16429 set rewinddir d_rewinddir
16432 : see if readdir64_r exists
16433 set readdir64_r d_readdir64_r
16435 case "$d_readdir64_r" in
16437 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
16438 case "$d_readdir64_r_proto:$usethreads" in
16439 ":define") d_readdir64_r_proto=define
16440 set d_readdir64_r_proto readdir64_r $hdrs
16444 case "$d_readdir64_r_proto" in
16446 case "$readdir64_r_proto" in
16447 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
16448 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TSR ;;
16450 case "$readdir64_r_proto" in
16451 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
16452 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TS ;;
16454 case "$readdir64_r_proto" in
16455 ''|0) d_readdir64_r=undef
16456 readdir64_r_proto=0
16457 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
16458 * ) case "$readdir64_r_proto" in
16459 REENTRANT_PROTO*) ;;
16460 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
16462 echo "Prototype: $try" ;;
16465 *) case "$usethreads" in
16466 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
16468 d_readdir64_r=undef
16469 readdir64_r_proto=0
16473 *) readdir64_r_proto=0
16477 : see if readdir_r exists
16478 set readdir_r d_readdir_r
16480 case "$d_readdir_r" in
16482 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
16483 case "$d_readdir_r_proto:$usethreads" in
16484 ":define") d_readdir_r_proto=define
16485 set d_readdir_r_proto readdir_r $hdrs
16489 case "$d_readdir_r_proto" in
16491 case "$readdir_r_proto" in
16492 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
16493 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TSR ;;
16495 case "$readdir_r_proto" in
16496 ''|0) try='int readdir_r(DIR*, struct dirent*);'
16497 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TS ;;
16499 case "$readdir_r_proto" in
16500 ''|0) d_readdir_r=undef
16502 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
16503 * ) case "$readdir_r_proto" in
16504 REENTRANT_PROTO*) ;;
16505 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
16507 echo "Prototype: $try" ;;
16510 *) case "$usethreads" in
16511 define) echo "readdir_r has no prototype, not using it." >&4 ;;
16518 *) readdir_r_proto=0
16522 : see if readv exists
16526 : see if recvmsg exists
16527 set recvmsg d_recvmsg
16530 : see if rename exists
16531 set rename d_rename
16534 : see if rmdir exists
16538 : see if memory.h is available.
16543 : See if it conflicts with string.h
16549 $cppstdin $cppflags $cppminus < $strings > mem.h
16550 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
16552 echo "We won't be including <memory.h>."
16562 : can bcopy handle overlapping blocks?
16565 case "$d_memmove" in
16566 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
16567 *) case "$d_bcopy" in
16569 echo "Checking to see if bcopy() can do overlapping copies..." >&4
16571 #$i_memory I_MEMORY
16572 #$i_stdlib I_STDLIB
16573 #$i_string I_STRING
16574 #$i_unistd I_UNISTD
16576 $cat >>try.c <<'EOCP'
16579 # include <memory.h>
16582 # include <stdlib.h>
16585 # include <string.h>
16587 # include <strings.h>
16590 # include <unistd.h> /* Needed for NetBSD */
16594 char buf[128], abc[128];
16600 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16601 try to store the string in read-only memory. */
16602 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
16604 for (align = 7; align >= 0; align--) {
16605 for (len = 36; len; len--) {
16607 bcopy(abc, b, len);
16608 for (off = 1; off <= len; off++) {
16609 bcopy(b, b+off, len);
16610 bcopy(b+off, b, len);
16611 if (bcmp(b, abc, len))
16620 if eval $compile_ok; then
16621 if $run ./try 2>/dev/null; then
16622 echo "Yes, it can."
16625 echo "It can't, sorry."
16628 echo "(I can't compile the test program, so we'll assume not...)"
16638 : can memcpy handle overlapping blocks?
16641 case "$d_memmove" in
16642 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
16643 *) case "$d_memcpy" in
16645 echo "Checking to see if memcpy() can do overlapping copies..." >&4
16647 #$i_memory I_MEMORY
16648 #$i_stdlib I_STDLIB
16649 #$i_string I_STRING
16650 #$i_unistd I_UNISTD
16652 $cat >>try.c <<'EOCP'
16655 # include <memory.h>
16658 # include <stdlib.h>
16661 # include <string.h>
16663 # include <strings.h>
16666 # include <unistd.h> /* Needed for NetBSD */
16670 char buf[128], abc[128];
16676 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16677 try to store the string in read-only memory. */
16678 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
16680 for (align = 7; align >= 0; align--) {
16681 for (len = 36; len; len--) {
16683 memcpy(b, abc, len);
16684 for (off = 1; off <= len; off++) {
16685 memcpy(b+off, b, len);
16686 memcpy(b, b+off, len);
16687 if (memcmp(b, abc, len))
16696 if eval $compile_ok; then
16697 if $run ./try 2>/dev/null; then
16698 echo "Yes, it can."
16701 echo "It can't, sorry."
16704 echo "(I can't compile the test program, so we'll assume not...)"
16714 : can memcmp be trusted to compare relative magnitude?
16716 case "$d_memcmp" in
16719 echo "Checking if your memcmp() can compare relative magnitude..." >&4
16721 #$i_memory I_MEMORY
16722 #$i_stdlib I_STDLIB
16723 #$i_string I_STRING
16724 #$i_unistd I_UNISTD
16726 $cat >>try.c <<'EOCP'
16729 # include <memory.h>
16732 # include <stdlib.h>
16735 # include <string.h>
16737 # include <strings.h>
16740 # include <unistd.h> /* Needed for NetBSD */
16746 if ((a < b) && memcmp(&a, &b, 1) < 0)
16752 if eval $compile_ok; then
16753 if $run ./try 2>/dev/null; then
16754 echo "Yes, it can."
16757 echo "No, it can't (it uses signed chars)."
16760 echo "(I can't compile the test program, so we'll assume not...)"
16768 : see if prototype for sbrk is available
16770 set d_sbrkproto sbrk $i_unistd unistd.h
16773 : see if select exists
16774 set select d_select
16777 : see if semctl exists
16778 set semctl d_semctl
16781 : see if semget exists
16782 set semget d_semget
16785 : see if semop exists
16789 : see how much of the 'sem*(2)' library is present.
16792 case "$d_semctl$d_semget$d_semop" in
16793 *"$undef"*) h_sem=false;;
16797 case "`ipcs 2>&1`" in
16798 "SVID messages"*"not configured"*)
16799 echo "Your $osname does not have the sem*(2) configured." >&4
16802 set semctl d_semctl
16804 set semget d_semget
16812 : we could also check for sys/ipc.h ...
16813 if $h_sem && $test `./findhdr sys/sem.h`; then
16814 echo "You have the full sem*(2) library." >&4
16817 echo "You don't have the full sem*(2) library." >&4
16823 : see whether sys/sem.h defines union semun
16825 $cat > try.c <<'END'
16826 #include <sys/types.h>
16827 #include <sys/ipc.h>
16828 #include <sys/sem.h>
16829 int main () { union semun semun; semun.buf = 0; }
16832 if eval $compile; then
16833 echo "You have union semun in <sys/sem.h>." >&4
16836 echo "You do not have union semun in <sys/sem.h>." >&4
16843 : see how to do semctl IPC_STAT
16847 $cat > tryh.h <<END
16850 # define S_IRUSR S_IREAD
16851 # define S_IWUSR S_IWRITE
16852 # define S_IXUSR S_IEXEC
16854 # define S_IRUSR 0400
16855 # define S_IWUSR 0200
16856 # define S_IXUSR 0100
16858 # define S_IRGRP (S_IRUSR>>3)
16859 # define S_IWGRP (S_IWUSR>>3)
16860 # define S_IXGRP (S_IXUSR>>3)
16861 # define S_IROTH (S_IRUSR>>6)
16862 # define S_IWOTH (S_IWUSR>>6)
16863 # define S_IXOTH (S_IXUSR>>6)
16866 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
16867 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
16868 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
16871 : see whether semctl IPC_STAT can use union semun
16872 case "$d_semctl_semun" in
16876 #include <sys/types.h>
16877 #include <sys/ipc.h>
16878 #include <sys/sem.h>
16879 #include <sys/stat.h>
16886 #$d_union_semun HAS_UNION_SEMUN
16889 #ifndef HAS_UNION_SEMUN
16892 struct semid_ds *buf;
16893 unsigned short *array;
16899 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16900 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16902 struct semid_ds argbuf;
16905 st = semctl(sem, 0, IPC_STAT, arg);
16909 # endif /* IPC_STAT */
16910 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16912 if (semctl(sem, 0, IPC_RMID, arg) != 0)
16913 # endif /* IPC_RMID */
16914 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16916 #endif /* IPC_PRIVATE && ... */
16917 printf("semget failed: errno = %d\n", errno);
16922 if eval $compile; then
16925 semun) val="$define" ;;
16933 case "$d_semctl_semun" in
16935 echo "You can use union semun for semctl IPC_STAT." >&4
16938 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
16943 : see whether semctl IPC_STAT can use struct semid_ds pointer
16944 case "$d_semctl_semid_ds" in
16947 $cat > try.c <<'END'
16948 #include <sys/types.h>
16949 #include <sys/ipc.h>
16950 #include <sys/sem.h>
16951 #include <sys/stat.h>
16959 struct semid_ds arg;
16962 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16963 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16966 st = semctl(sem, 0, IPC_STAT, &arg);
16968 printf("semid_ds\n");
16970 # endif /* IPC_STAT */
16971 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16973 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
16974 # endif /* IPC_RMID */
16975 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16977 #endif /* IPC_PRIVATE && ... */
16978 printf("semget failed: errno = %d\n", errno);
16984 if eval $compile; then
16987 semid_ds) val="$define" ;;
16991 set d_semctl_semid_ds
16995 case "$d_semctl_semid_ds" in
16997 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
16999 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
17005 # We do not have the full sem*(2) library, so assume we can not
17011 set d_semctl_semid_ds
17017 : see if sendmsg exists
17018 set sendmsg d_sendmsg
17021 : see if setegid exists
17022 set setegid d_setegid
17025 : see if seteuid exists
17026 set seteuid d_seteuid
17029 : see if setgrent exists
17030 set setgrent d_setgrent
17033 : see if setgrent_r exists
17034 set setgrent_r d_setgrent_r
17036 case "$d_setgrent_r" in
17038 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
17039 case "$d_setgrent_r_proto:$usethreads" in
17040 ":define") d_setgrent_r_proto=define
17041 set d_setgrent_r_proto setgrent_r $hdrs
17045 case "$d_setgrent_r_proto" in
17047 case "$setgrent_r_proto" in
17048 ''|0) try='int setgrent_r(FILE**);'
17049 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=I_H ;;
17051 case "$setgrent_r_proto" in
17052 ''|0) try='void setgrent_r(FILE**);'
17053 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=V_H ;;
17055 case "$setgrent_r_proto" in
17056 ''|0) d_setgrent_r=undef
17058 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
17059 * ) case "$setgrent_r_proto" in
17060 REENTRANT_PROTO*) ;;
17061 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
17063 echo "Prototype: $try" ;;
17066 *) case "$usethreads" in
17067 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
17074 *) setgrent_r_proto=0
17078 : see if sethostent exists
17079 set sethostent d_sethent
17082 : see if sethostent_r exists
17083 set sethostent_r d_sethostent_r
17085 case "$d_sethostent_r" in
17087 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17088 case "$d_sethostent_r_proto:$usethreads" in
17089 ":define") d_sethostent_r_proto=define
17090 set d_sethostent_r_proto sethostent_r $hdrs
17094 case "$d_sethostent_r_proto" in
17096 case "$sethostent_r_proto" in
17097 ''|0) try='int sethostent_r(int, struct hostent_data*);'
17098 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=I_ID ;;
17100 case "$sethostent_r_proto" in
17101 ''|0) try='void sethostent_r(int, struct hostent_data*);'
17102 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=V_ID ;;
17104 case "$sethostent_r_proto" in
17105 ''|0) d_sethostent_r=undef
17106 sethostent_r_proto=0
17107 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
17108 * ) case "$sethostent_r_proto" in
17109 REENTRANT_PROTO*) ;;
17110 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
17112 echo "Prototype: $try" ;;
17115 *) case "$usethreads" in
17116 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
17118 d_sethostent_r=undef
17119 sethostent_r_proto=0
17123 *) sethostent_r_proto=0
17127 : see if setitimer exists
17128 set setitimer d_setitimer
17131 : see if setlinebuf exists
17132 set setlinebuf d_setlinebuf
17135 : see if setlocale exists
17136 set setlocale d_setlocale
17139 : see if locale.h is available
17140 set locale.h i_locale
17143 : see if setlocale_r exists
17144 set setlocale_r d_setlocale_r
17146 case "$d_setlocale_r" in
17148 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
17149 case "$d_setlocale_r_proto:$usethreads" in
17150 ":define") d_setlocale_r_proto=define
17151 set d_setlocale_r_proto setlocale_r $hdrs
17155 case "$d_setlocale_r_proto" in
17157 case "$setlocale_r_proto" in
17158 ''|0) try='int setlocale_r(int, const char*, char*, int);'
17159 ./protochk "$extern_C $try" $hdrs && setlocale_r_proto=I_ICBI ;;
17161 case "$setlocale_r_proto" in
17162 ''|0) d_setlocale_r=undef
17163 setlocale_r_proto=0
17164 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
17165 * ) case "$setlocale_r_proto" in
17166 REENTRANT_PROTO*) ;;
17167 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
17169 echo "Prototype: $try" ;;
17172 *) case "$usethreads" in
17173 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
17175 d_setlocale_r=undef
17176 setlocale_r_proto=0
17180 *) setlocale_r_proto=0
17184 : see if setnetent exists
17185 set setnetent d_setnent
17188 : see if setnetent_r exists
17189 set setnetent_r d_setnetent_r
17191 case "$d_setnetent_r" in
17193 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17194 case "$d_setnetent_r_proto:$usethreads" in
17195 ":define") d_setnetent_r_proto=define
17196 set d_setnetent_r_proto setnetent_r $hdrs
17200 case "$d_setnetent_r_proto" in
17202 case "$setnetent_r_proto" in
17203 ''|0) try='int setnetent_r(int, struct netent_data*);'
17204 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=I_ID ;;
17206 case "$setnetent_r_proto" in
17207 ''|0) try='void setnetent_r(int, struct netent_data*);'
17208 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=V_ID ;;
17210 case "$setnetent_r_proto" in
17211 ''|0) d_setnetent_r=undef
17212 setnetent_r_proto=0
17213 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
17214 * ) case "$setnetent_r_proto" in
17215 REENTRANT_PROTO*) ;;
17216 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
17218 echo "Prototype: $try" ;;
17221 *) case "$usethreads" in
17222 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
17224 d_setnetent_r=undef
17225 setnetent_r_proto=0
17229 *) setnetent_r_proto=0
17233 : see if setprotoent exists
17234 set setprotoent d_setpent
17237 : see if setpgid exists
17238 set setpgid d_setpgid
17241 : see if setpgrp2 exists
17242 set setpgrp2 d_setpgrp2
17245 : see if setpriority exists
17246 set setpriority d_setprior
17249 : see if setproctitle exists
17250 set setproctitle d_setproctitle
17253 : see if setprotoent_r exists
17254 set setprotoent_r d_setprotoent_r
17256 case "$d_setprotoent_r" in
17258 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17259 case "$d_setprotoent_r_proto:$usethreads" in
17260 ":define") d_setprotoent_r_proto=define
17261 set d_setprotoent_r_proto setprotoent_r $hdrs
17265 case "$d_setprotoent_r_proto" in
17267 case "$setprotoent_r_proto" in
17268 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
17269 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=I_ID ;;
17271 case "$setprotoent_r_proto" in
17272 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
17273 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=V_ID ;;
17275 case "$setprotoent_r_proto" in
17276 ''|0) d_setprotoent_r=undef
17277 setprotoent_r_proto=0
17278 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
17279 * ) case "$setprotoent_r_proto" in
17280 REENTRANT_PROTO*) ;;
17281 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
17283 echo "Prototype: $try" ;;
17286 *) case "$usethreads" in
17287 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
17289 d_setprotoent_r=undef
17290 setprotoent_r_proto=0
17294 *) setprotoent_r_proto=0
17298 : see if setpwent exists
17299 set setpwent d_setpwent
17302 : see if setpwent_r exists
17303 set setpwent_r d_setpwent_r
17305 case "$d_setpwent_r" in
17307 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
17308 case "$d_setpwent_r_proto:$usethreads" in
17309 ":define") d_setpwent_r_proto=define
17310 set d_setpwent_r_proto setpwent_r $hdrs
17314 case "$d_setpwent_r_proto" in
17316 case "$setpwent_r_proto" in
17317 ''|0) try='int setpwent_r(FILE**);'
17318 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=I_H ;;
17320 case "$setpwent_r_proto" in
17321 ''|0) try='void setpwent_r(FILE**);'
17322 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=V_H ;;
17324 case "$setpwent_r_proto" in
17325 ''|0) d_setpwent_r=undef
17327 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
17328 * ) case "$setpwent_r_proto" in
17329 REENTRANT_PROTO*) ;;
17330 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
17332 echo "Prototype: $try" ;;
17335 *) case "$usethreads" in
17336 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
17343 *) setpwent_r_proto=0
17347 : see if setregid exists
17348 set setregid d_setregid
17350 set setresgid d_setresgid
17353 : see if setreuid exists
17354 set setreuid d_setreuid
17356 set setresuid d_setresuid
17359 : see if setrgid exists
17360 set setrgid d_setrgid
17363 : see if setruid exists
17364 set setruid d_setruid
17367 : see if setservent exists
17368 set setservent d_setsent
17371 : see if setservent_r exists
17372 set setservent_r d_setservent_r
17374 case "$d_setservent_r" in
17376 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17377 case "$d_setservent_r_proto:$usethreads" in
17378 ":define") d_setservent_r_proto=define
17379 set d_setservent_r_proto setservent_r $hdrs
17383 case "$d_setservent_r_proto" in
17385 case "$setservent_r_proto" in
17386 ''|0) try='int setservent_r(int, struct servent_data*);'
17387 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=I_ID ;;
17389 case "$setservent_r_proto" in
17390 ''|0) try='void setservent_r(int, struct servent_data*);'
17391 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=V_ID ;;
17393 case "$setservent_r_proto" in
17394 ''|0) d_setservent_r=undef
17395 setservent_r_proto=0
17396 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
17397 * ) case "$setservent_r_proto" in
17398 REENTRANT_PROTO*) ;;
17399 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
17401 echo "Prototype: $try" ;;
17404 *) case "$usethreads" in
17405 define) echo "setservent_r has no prototype, not using it." >&4 ;;
17407 d_setservent_r=undef
17408 setservent_r_proto=0
17412 *) setservent_r_proto=0
17416 : see if setsid exists
17417 set setsid d_setsid
17420 : see if setvbuf exists
17421 set setvbuf d_setvbuf
17424 : see if sfio.h is available
17428 : see if sfio library is available
17439 : Ok, but do we want to use it.
17443 true|$define|[yY]*) dflt='y';;
17446 echo "$package can use the sfio library, but it is experimental."
17447 rp="You seem to have sfio available, do you want to try using it?"
17450 y|Y) echo "Ok, turning on sfio then."
17453 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
17458 *) case "$usesfio" in
17459 true|$define|[yY]*)
17460 echo "Sorry, cannot find sfio on this machine." >&4
17461 echo "Ignoring your setting of usesfio=$usesfio." >&4
17470 $define) usesfio='true';;
17471 *) usesfio='false';;
17475 *) : Remove sfio from list of libraries to use
17478 echo "Removing unneeded -lsfio from library list" >&4
17479 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
17482 echo "libs = $libs" >&4
17489 : see if shmctl exists
17490 set shmctl d_shmctl
17493 : see if shmget exists
17494 set shmget d_shmget
17497 : see if shmat exists
17500 : see what shmat returns
17503 $cat >shmat.c <<'END'
17504 #include <sys/shm.h>
17507 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
17512 echo "and it returns ($shmattype)." >&4
17513 : see if a prototype for shmat is available
17514 xxx=`./findhdr sys/shm.h`
17515 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
17516 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
17527 set d_shmatprototype
17530 : see if shmdt exists
17534 : see how much of the 'shm*(2)' library is present.
17537 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
17538 *"$undef"*) h_shm=false;;
17542 case "`ipcs 2>&1`" in
17543 "SVID shared memory"*"not configured"*)
17544 echo "Your $osname does not have the shm*(2) configured." >&4
17547 set shmctl d_shmctl
17549 set shmget d_shmget
17559 : we could also check for sys/ipc.h ...
17560 if $h_shm && $test `./findhdr sys/shm.h`; then
17561 echo "You have the full shm*(2) library." >&4
17564 echo "You don't have the full shm*(2) library." >&4
17570 : see if we have sigaction
17572 if set sigaction val -f d_sigaction; eval $csym; $val; then
17573 echo 'sigaction() found.' >&4
17576 #include <sys/types.h>
17577 #include <signal.h>
17578 #$i_stdlib I_STDLIB
17580 #include <stdlib.h>
17584 struct sigaction act, oact;
17586 oact.sa_handler = 0;
17587 /* so that act and oact are used */
17588 exit(act.sa_flags == 0 && oact.sa_handler == 0);
17592 if eval $compile_ok; then
17595 echo "But you don't seem to have a usable struct sigaction." >&4
17599 echo 'sigaction NOT found.' >&4
17602 set d_sigaction; eval $setvar
17605 : see if this is a sunmath.h system
17606 set sunmath.h i_sunmath
17609 : see if signbit exists
17610 $echo $n "Checking to see if you have signbit() available to work on $nvtype... $c" >&4
17613 #$i_sunmath I_SUNMATH
17617 #ifdef I_SUNMATH /* Solaris special math library */
17618 # include <sunmath.h>
17621 int main(int argc, char **argv)
17625 if ((signbit(x) == 0) && (signbit(y) != 0))
17633 if eval $compile; then
17634 if $run ./try; then
17638 $echo "Signbit seems to be available, but doesn't work as I expected."
17639 $echo "I won't use it." >&4
17650 : see if sigprocmask exists
17651 set sigprocmask d_sigprocmask
17654 : see if sigsetjmp exists
17656 case "$d_sigsetjmp" in
17659 #include <setjmp.h>
17660 #$i_stdlib I_STDLIB
17662 #include <stdlib.h>
17668 if (sigsetjmp(env,1))
17671 siglongjmp(env, 1);
17676 if eval $compile; then
17677 if $run ./try >/dev/null 2>&1; then
17678 echo "POSIX sigsetjmp found." >&4
17682 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
17688 echo "sigsetjmp not found." >&4
17692 *) val="$d_sigsetjmp"
17693 case "$d_sigsetjmp" in
17694 $define) echo "POSIX sigsetjmp found." >&4;;
17695 $undef) echo "sigsetjmp not found." >&4;;
17703 : see if snprintf exists
17704 set snprintf d_snprintf
17707 : see if vsnprintf exists
17708 set vsnprintf d_vsnprintf
17711 case "$d_snprintf-$d_vsnprintf" in
17714 Checking whether your snprintf() and vsnprintf() work okay...
17716 $cat >try.c <<'EOCP'
17717 /* v?snprintf testing logic courtesy of Russ Allbery.
17718 * According to C99:
17719 * - if the buffer is too short it still must be \0-terminated
17720 * - if the buffer is too short the potentially required length
17721 * must be returned and not -1
17722 * - if the buffer is NULL the potentially required length
17723 * must be returned and not -1 or core dump
17726 #include <stdarg.h>
17730 int test (char *format, ...)
17735 va_start (args, format);
17736 count = vsnprintf (buf, sizeof buf, format, args);
17743 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
17744 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
17748 if eval $compile; then
17751 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
17753 Your snprintf() and snprintf() don't seem to be working okay.
17755 d_snprintf="$undef"
17756 d_vsnprintf="$undef"
17760 echo "(I can't seem to compile the test program--assuming they don't)"
17761 d_snprintf="$undef"
17762 d_vsnprintf="$undef"
17768 : see if sockatmark exists
17769 set sockatmark d_sockatmark
17772 : see if prototype for sockatmark is available
17774 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
17777 : see if socks5_init exists
17778 set socks5_init d_socks5_init
17781 : see if sprintf returns the length of the string in the buffer as per ANSI
17782 $echo "Checking whether sprintf returns the length of the string..." >&4
17785 #$i_stdlib I_STDLIB
17787 #include <stdlib.h>
17789 #$i_string I_STRING
17791 # include <string.h>
17793 # include <strings.h>
17802 int check (size_t expect, int test) {
17803 size_t got = strlen(buffer);
17807 printf("expected %ld, got %ld in test %d '%s'\n", (long) expect, (long) got,
17812 int main(int argc, char **argv) {
17815 check(sprintf(buffer, ""), ++test);
17816 check(sprintf(buffer, "%s %s", "perl", "rules"), ++test);
17817 check(sprintf(buffer, "I like %g", atan2(0,-1)), ++test);
17824 if eval $compile; then
17828 sprintf returns the length of the string (as ANSI says it should)
17830 d_sprintf_returns_strlen="$define"
17833 sprintf does not return the length of the string (how old is this system?)
17835 d_sprintf_returns_strlen="$undef"
17839 echo "(I can't seem to compile the test program--assuming it doesn't)" >&4
17840 d_sprintf_returns_strlen="$undef"
17844 : see if srand48_r exists
17845 set srand48_r d_srand48_r
17847 case "$d_srand48_r" in
17849 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17850 case "$d_srand48_r_proto:$usethreads" in
17851 ":define") d_srand48_r_proto=define
17852 set d_srand48_r_proto srand48_r $hdrs
17856 case "$d_srand48_r_proto" in
17858 case "$srand48_r_proto" in
17859 ''|0) try='int srand48_r(long, struct drand48_data*);'
17860 ./protochk "$extern_C $try" $hdrs && srand48_r_proto=I_LS ;;
17862 case "$srand48_r_proto" in
17863 ''|0) d_srand48_r=undef
17865 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
17866 * ) case "$srand48_r_proto" in
17867 REENTRANT_PROTO*) ;;
17868 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
17870 echo "Prototype: $try" ;;
17873 *) case "$usethreads" in
17874 define) echo "srand48_r has no prototype, not using it." >&4 ;;
17881 *) srand48_r_proto=0
17885 : see if srandom_r exists
17886 set srandom_r d_srandom_r
17888 case "$d_srandom_r" in
17890 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17891 case "$d_srandom_r_proto:$usethreads" in
17892 ":define") d_srandom_r_proto=define
17893 set d_srandom_r_proto srandom_r $hdrs
17897 case "$d_srandom_r_proto" in
17899 case "$srandom_r_proto" in
17900 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
17901 ./protochk "$extern_C $try" $hdrs && srandom_r_proto=I_TS ;;
17903 case "$srandom_r_proto" in
17904 ''|0) d_srandom_r=undef
17906 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
17907 * ) case "$srandom_r_proto" in
17908 REENTRANT_PROTO*) ;;
17909 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
17911 echo "Prototype: $try" ;;
17914 *) case "$usethreads" in
17915 define) echo "srandom_r has no prototype, not using it." >&4 ;;
17922 *) srandom_r_proto=0
17926 : see if prototype for setresgid is available
17928 set d_sresgproto setresgid $i_unistd unistd.h
17931 : see if prototype for setresuid is available
17933 set d_sresuproto setresuid $i_unistd unistd.h
17936 : see if sys/stat.h is available
17937 set sys/stat.h i_sysstat
17940 : see if stat knows about block sizes
17942 echo "Checking to see if your struct stat has st_blocks field..." >&4
17943 set d_statblks stat st_blocks $i_sysstat sys/stat.h
17946 : see if this is a sys/vfs.h system
17947 set sys/vfs.h i_sysvfs
17950 : see if this is a sys/statfs.h system
17951 set sys/statfs.h i_sysstatfs
17954 : Check for statfs_s
17956 echo "Checking to see if your system supports struct statfs..." >&4
17957 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
17959 case "$d_statfs_s" in
17960 "$define") echo "Yes, it does." ;;
17961 *) echo "No, it doesn't." ;;
17965 : see if struct statfs knows about f_flags
17966 case "$d_statfs_s" in
17969 echo "Checking to see if your struct statfs has f_flags field..." >&4
17970 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
17974 set d_statfs_f_flags
17978 case "$d_statfs_f_flags" in
17979 "$define") echo "Yes, it does." ;;
17980 *) echo "No, it doesn't." ;;
17983 : see what flavor, if any, of static inline is supported
17985 echo "Checking to see if your system supports static inline..."
17986 $cat > try.c <<'EOCP'
17987 #include <stdlib.h>
17988 extern int f_via_a(int x);
17989 extern int f_via_b(int x);
17990 int main(int argc, char **argv)
17999 return EXIT_SUCCESS;
18002 return EXIT_FAILURE;
18006 $cat > a.c <<'EOCP'
18007 static INLINE int f(int x) {
18018 $cat > b.c <<'EOCP'
18019 extern int f(int x);
18027 # Respect a hint (or previous) value for perl_static_inline, if there is one.
18028 case "$perl_static_inline" in
18029 '') # Check the various possibilities, and break out on success.
18030 # For gcc, prefer __inline__, which will still permit
18031 # cflags.SH to add in -ansi.
18032 case "$gccversion" in
18033 '') xxx="inline __inline__ __inline _inline";;
18034 *) xxx="__inline__ inline __inline _inline";;
18036 for inline in $xxx; do
18037 set try -DINLINE=$inline a.c
18038 if eval $compile && $run ./try; then
18039 # Now make sure there is no external linkage of static
18041 set try -DINLINE=$inline -DUSE_B a.c b.c
18042 if eval $compile && $run ./try; then
18043 $echo "Your compiler supports static $inline, " >&4
18044 $echo "but it also creates an external definition," >&4
18045 $echo "so I won't use it." >&4
18048 $echo "Your compiler supports static $inline." >&4
18050 perl_static_inline="static $inline";
18054 $echo "Your compiler does NOT support static $inline." >&4
18059 *inline*) # Some variant of inline exists.
18060 echo "Keeping your $hint value of $perl_static_inline."
18063 static) # No inline capabilities
18064 echo "Keeping your $hint value of $perl_static_inline."
18067 *) # Unrecognized previous value -- blindly trust the supplied
18068 # value and hope it makes sense. Use old value for
18069 # d_static_inline, if there is one.
18070 echo "Keeping your $hint value of $perl_static_inline."
18071 case "$d_static_inline" in
18073 *) val=$d_static_inline ;;
18077 # Fallback to plain 'static' if nothing worked.
18078 case "$perl_static_inline" in
18080 perl_static_inline="static"
18084 set d_static_inline
18086 $rm -f a.[co] b.[co]
18089 : Check stream access
18091 Checking how to access stdio streams by file descriptor number...
18093 case "$stdio_stream_array" in
18094 '') $cat >try.c <<EOCP
18097 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
18101 for s in _iob __iob __sF
18103 set try -DSTDIO_STREAM_ARRAY=$s
18104 if eval $compile; then
18105 case "`$run ./try`" in
18106 yes) stdio_stream_array=$s; break ;;
18112 case "$stdio_stream_array" in
18114 I can't figure out how to access stdio streams by file descriptor number.
18116 d_stdio_stream_array="$undef"
18119 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
18121 d_stdio_stream_array="$define"
18125 : see if strcoll exists
18126 set strcoll d_strcoll
18129 : check for structure copying
18131 echo "Checking to see if your C compiler can copy structs..." >&4
18132 $cat >try.c <<'EOCP'
18142 if $cc -c try.c >/dev/null 2>&1 ; then
18144 echo "Yup, it can."
18147 echo "Nope, it can't."
18153 : see if strerror and/or sys_errlist[] exist
18155 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
18156 if set strerror val -f d_strerror; eval $csym; $val; then
18157 echo 'strerror() found.' >&4
18158 d_strerror="$define"
18159 d_strerrm='strerror(e)'
18160 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
18161 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
18162 d_syserrlst="$define"
18164 echo "(Since you don't have sys_errlist[], strerror() is welcome.)"
18165 d_syserrlst="$undef"
18167 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
18168 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
18169 echo 'strerror() found in string header.' >&4
18170 d_strerror="$define"
18171 d_strerrm='strerror(e)'
18172 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
18173 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
18174 d_syserrlst="$define"
18176 echo "(You don't appear to have any sys_errlist[], how can this be?)"
18177 d_syserrlst="$undef"
18179 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
18180 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
18181 d_strerror="$undef"
18182 d_syserrlst="$define"
18183 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
18185 echo 'strerror() and sys_errlist[] NOT found.' >&4
18186 d_strerror="$undef"
18187 d_syserrlst="$undef"
18188 d_strerrm='"unknown"'
18192 : see if strerror_r exists
18193 set strerror_r d_strerror_r
18195 case "$d_strerror_r" in
18197 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
18198 case "$d_strerror_r_proto:$usethreads" in
18199 ":define") d_strerror_r_proto=define
18200 set d_strerror_r_proto strerror_r $hdrs
18204 case "$d_strerror_r_proto" in
18206 case "$strerror_r_proto" in
18207 ''|0) try='int strerror_r(int, char*, size_t);'
18208 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBW ;;
18210 case "$strerror_r_proto" in
18211 ''|0) try='int strerror_r(int, char*, int);'
18212 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBI ;;
18214 case "$strerror_r_proto" in
18215 ''|0) try='char* strerror_r(int, char*, size_t);'
18216 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=B_IBW ;;
18218 case "$strerror_r_proto" in
18219 ''|0) d_strerror_r=undef
18221 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
18222 * ) case "$strerror_r_proto" in
18223 REENTRANT_PROTO*) ;;
18224 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
18226 echo "Prototype: $try" ;;
18229 *) case "$usethreads" in
18230 define) echo "strerror_r has no prototype, not using it." >&4 ;;
18237 *) strerror_r_proto=0
18241 : see if strftime exists
18242 set strftime d_strftime
18245 : see if strlcat exists
18246 set strlcat d_strlcat
18249 : see if strlcpy exists
18250 set strlcpy d_strlcpy
18253 : see if strtod exists
18254 set strtod d_strtod
18257 : see if strtol exists
18258 set strtol d_strtol
18261 : see if strtold exists
18262 set strtold d_strtold
18265 : see if strtoll exists
18266 set strtoll d_strtoll
18269 case "$d_longlong-$d_strtoll" in
18272 Checking whether your strtoll() works okay...
18274 $cat >try.c <<'EOCP'
18277 #define strtoll __strtoll
18280 #define strtoll _strtoll
18283 extern long long int strtoll(char *s, char **, int);
18284 static int bad = 0;
18285 int check(char *s, long long ell, int een) {
18288 gll = strtoll(s, 0, 10);
18289 if (!((gll == ell) && (errno == een)))
18293 check(" 1", 1LL, 0);
18294 check(" 0", 0LL, 0);
18295 check("-1", -1LL, 0);
18296 check("-9223372036854775808", -9223372036854775808LL, 0);
18297 check("-9223372036854775808", -9223372036854775808LL, 0);
18298 check(" 9223372036854775807", 9223372036854775807LL, 0);
18299 check("-9223372036854775808", -9223372036854775808LL, 0);
18300 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
18301 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
18307 if eval $compile; then
18310 ok) echo "Your strtoll() seems to be working okay." ;;
18312 Your strtoll() doesn't seem to be working okay.
18318 echo "(I can't seem to compile the test program--assuming it doesn't)"
18324 : see if strtoq exists
18325 set strtoq d_strtoq
18328 : see if strtoul exists
18329 set strtoul d_strtoul
18332 case "$d_strtoul" in
18335 Checking whether your strtoul() works okay...
18337 $cat >try.c <<'EOCP'
18340 extern unsigned long int strtoul(char *s, char **, int);
18341 static int bad = 0;
18342 void check(char *s, unsigned long eul, int een) {
18345 gul = strtoul(s, 0, 10);
18346 if (!((gul == eul) && (errno == een)))
18350 check(" 1", 1L, 0);
18351 check(" 0", 0L, 0);
18353 case "$longsize" in
18355 $cat >>try.c <<'EOCP'
18356 check("18446744073709551615", 18446744073709551615UL, 0);
18357 check("18446744073709551616", 18446744073709551615UL, ERANGE);
18358 #if 0 /* strtoul() for /^-/ strings is undefined. */
18359 check("-1", 18446744073709551615UL, 0);
18360 check("-18446744073709551614", 2, 0);
18361 check("-18446744073709551615", 1, 0);
18362 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
18363 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
18368 $cat >>try.c <<'EOCP'
18369 check("4294967295", 4294967295UL, 0);
18370 check("4294967296", 4294967295UL, ERANGE);
18371 #if 0 /* strtoul() for /^-/ strings is undefined. */
18372 check("-1", 4294967295UL, 0);
18373 check("-4294967294", 2, 0);
18374 check("-4294967295", 1, 0);
18375 check("-4294967296", 4294967295UL, ERANGE);
18376 check("-4294967297", 4294967295UL, ERANGE);
18381 : Should we write these tests to be more portable by sprintf-ing
18382 : ~0 and then manipulating that char string as input for strtol?
18385 $cat >>try.c <<'EOCP'
18392 if eval $compile; then
18393 case "`$run ./try`" in
18394 ok) echo "Your strtoul() seems to be working okay." ;;
18396 Your strtoul() doesn't seem to be working okay.
18402 echo "(I can't seem to compile the test program--assuming it doesn't)"
18408 : see if strtoull exists
18409 set strtoull d_strtoull
18412 case "$d_longlong-$d_strtoull" in
18415 Checking whether your strtoull() works okay...
18417 $cat >try.c <<'EOCP'
18420 #define strtoull __strtoull
18423 extern unsigned long long int strtoull(char *s, char **, int);
18424 static int bad = 0;
18425 int check(char *s, long long eull, int een) {
18428 gull = strtoull(s, 0, 10);
18429 if (!((gull == eull) && (errno == een)))
18433 check(" 1", 1LL, 0);
18434 check(" 0", 0LL, 0);
18435 check("18446744073709551615", 18446744073709551615ULL, 0);
18436 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
18437 #if 0 /* strtoull() for /^-/ strings is undefined. */
18438 check("-1", 18446744073709551615ULL, 0);
18439 check("-18446744073709551614", 2LL, 0);
18440 check("-18446744073709551615", 1LL, 0);
18441 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
18442 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
18449 if eval $compile; then
18450 case "`$run ./try`" in
18451 ok) echo "Your strtoull() seems to be working okay." ;;
18453 Your strtoull() doesn't seem to be working okay.
18455 d_strtoull="$undef"
18459 echo "(I can't seem to compile the test program--assuming it doesn't)"
18460 d_strtoull="$undef"
18465 : see if strtouq exists
18466 set strtouq d_strtouq
18469 case "$d_strtouq" in
18472 Checking whether your strtouq() works okay...
18474 $cat >try.c <<'EOCP'
18477 extern unsigned long long int strtouq(char *s, char **, int);
18478 static int bad = 0;
18479 void check(char *s, unsigned long long eull, int een) {
18480 unsigned long long gull;
18482 gull = strtouq(s, 0, 10);
18483 if (!((gull == eull) && (errno == een)))
18487 check(" 1", 1LL, 0);
18488 check(" 0", 0LL, 0);
18489 check("18446744073709551615", 18446744073709551615ULL, 0);
18490 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
18491 #if 0 /* strtouq() for /^-/ strings is undefined. */
18492 check("-1", 18446744073709551615ULL, 0);
18493 check("-18446744073709551614", 2LL, 0);
18494 check("-18446744073709551615", 1LL, 0);
18495 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
18496 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
18504 if eval $compile; then
18505 case "`$run ./try`" in
18506 ok) echo "Your strtouq() seems to be working okay." ;;
18508 Your strtouq() doesn't seem to be working okay.
18514 echo "(I can't seem to compile the test program--assuming it doesn't)"
18520 : see if strxfrm exists
18521 set strxfrm d_strxfrm
18524 : see if symlink exists
18525 set symlink d_symlink
18528 : see if syscall exists
18529 set syscall d_syscall
18532 : see if prototype for syscall is available
18534 set d_syscallproto syscall $i_unistd unistd.h
18537 : see if sysconf exists
18538 set sysconf d_sysconf
18541 : see if system exists
18542 set system d_system
18545 : see if tcgetpgrp exists
18546 set tcgetpgrp d_tcgetpgrp
18549 : see if tcsetpgrp exists
18550 set tcsetpgrp d_tcsetpgrp
18553 : see if prototype for telldir is available
18555 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
18558 : see if time exists
18560 if test "X$d_time" = X -o X"$timetype" = X; then
18561 if set time val -f d_time; eval $csym; $val; then
18562 echo 'time() found.' >&4
18564 rp="What is the type returned by time() on this system?"
18565 set time_t timetype long stdio.h sys/types.h
18568 echo 'time() not found, hope that will do.' >&4
18576 : see if timegm exists
18577 set timegm d_timegm
18580 : see if this is a sys/times.h system
18581 set sys/times.h i_systimes
18584 : see if times exists
18586 if set times val -f d_times; eval $csym; $val; then
18587 echo 'times() found.' >&4
18590 case "$i_systimes" in
18591 "$define") inc='sys/times.h';;
18593 rp="What is the type returned by times() on this system?"
18594 set clock_t clocktype long stdio.h sys/types.h $inc
18597 echo 'times() NOT found, hope that will do.' >&4
18602 : see if tmpnam_r exists
18603 set tmpnam_r d_tmpnam_r
18605 case "$d_tmpnam_r" in
18607 hdrs="$i_systypes sys/types.h define stdio.h "
18608 case "$d_tmpnam_r_proto:$usethreads" in
18609 ":define") d_tmpnam_r_proto=define
18610 set d_tmpnam_r_proto tmpnam_r $hdrs
18614 case "$d_tmpnam_r_proto" in
18616 case "$tmpnam_r_proto" in
18617 ''|0) try='char* tmpnam_r(char*);'
18618 ./protochk "$extern_C $try" $hdrs && tmpnam_r_proto=B_B ;;
18620 case "$tmpnam_r_proto" in
18621 ''|0) d_tmpnam_r=undef
18623 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
18624 * ) case "$tmpnam_r_proto" in
18625 REENTRANT_PROTO*) ;;
18626 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
18628 echo "Prototype: $try" ;;
18631 *) case "$usethreads" in
18632 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
18639 *) tmpnam_r_proto=0
18643 : see if truncate exists
18644 set truncate d_truncate
18647 : see if ttyname_r exists
18648 set ttyname_r d_ttyname_r
18650 case "$d_ttyname_r" in
18652 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
18653 case "$d_ttyname_r_proto:$usethreads" in
18654 ":define") d_ttyname_r_proto=define
18655 set d_ttyname_r_proto ttyname_r $hdrs
18659 case "$d_ttyname_r_proto" in
18661 case "$ttyname_r_proto" in
18662 ''|0) try='int ttyname_r(int, char*, size_t);'
18663 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBW ;;
18665 case "$ttyname_r_proto" in
18666 ''|0) try='int ttyname_r(int, char*, int);'
18667 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBI ;;
18669 case "$ttyname_r_proto" in
18670 ''|0) try='char* ttyname_r(int, char*, int);'
18671 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=B_IBI ;;
18673 case "$ttyname_r_proto" in
18674 ''|0) d_ttyname_r=undef
18676 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
18677 * ) case "$ttyname_r_proto" in
18678 REENTRANT_PROTO*) ;;
18679 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
18681 echo "Prototype: $try" ;;
18684 *) case "$usethreads" in
18685 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
18692 *) ttyname_r_proto=0
18696 : see if tzname[] exists
18698 if set tzname val -a d_tzname; eval $csym; $val; then
18700 echo 'tzname[] found.' >&4
18703 echo 'tzname[] NOT found.' >&4
18708 : Check if is a multiplatform env
18710 next|darwin) multiarch="$define" ;;
18712 case "$multiarch" in
18713 ''|[nN]*) multiarch="$undef" ;;
18716 : check for ordering of bytes in a UV
18718 case "$usecrosscompile$multiarch" in
18721 You seem to be either cross-compiling or doing a multiarchitecture build,
18722 skipping the byteorder check.
18728 case "$byteorder" in
18731 In the following, larger digits indicate more significance. A big-endian
18732 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
18733 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
18734 machines may have weird orders like 3412. A Cray will report 87654321,
18735 an Alpha will report 12345678. If the test program works the default is
18737 I'm now running the test program...
18741 #$i_stdlib I_STDLIB
18743 #include <stdlib.h>
18745 #include <sys/types.h>
18746 typedef $uvtype UV;
18756 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
18758 u.l = (UV)0x04030201;
18759 for (i = 0; i < $uvsize; i++)
18760 printf("%c", u.c[i]+'0');
18767 if eval $compile && $run ./try > /dev/null; then
18770 [1-4][1-4][1-4][1-4]|12345678|87654321)
18771 echo "(The test program ran ok.)"
18772 echo "byteorder=$dflt"
18775 ????|????????) echo "(The test program ran ok.)" ;;
18776 *) echo "(The test program didn't run right for some reason.)" ;;
18781 (I can't seem to compile the test program. Guessing big-endian...)
18784 case "$xxx_prompt" in
18786 rp="What is the order of bytes in $uvtype?"
18799 : Checking 32bit alignedness
18802 Checking to see whether you can access character data unalignedly...
18804 case "$d_u32align" in
18805 '') $cat >try.c <<EOCP
18807 #$i_stdlib I_STDLIB
18809 #include <stdlib.h>
18811 #define U32 $u32type
18812 #define BYTEORDER 0x$byteorder
18814 #include <signal.h>
18816 $signal_t bletch(int s) { exit(4); }
18819 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
18820 volatile U8 buf[8];
18824 if (sizeof(U32) != 4) {
18825 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
18832 signal(SIGBUS, bletch);
18844 for (i = 0; i < 4; i++) {
18845 up = (U32*)(buf + i);
18846 if (! ((*up == 1 << (8*i)) || /* big-endian */
18847 (*up == 1 << (8*(3-i))) /* little-endian */
18851 printf("read failed (%x)\n", *up);
18857 for (i = 0; i < 4; i++) {
18858 up = (U32*)(buf + i);
18860 if (*up != 0xBeef) {
18861 printf("write failed (%x)\n", *up);
18875 if eval $compile_ok; then
18876 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
18877 $run ./try 2>&1 >/dev/null
18880 You can access character data pretty unalignedly.
18882 d_u32align="$undef"
18885 It seems that you must access character data in an aligned manner.
18887 d_u32align="$define"
18891 rp='Can you access character data at unaligned addresses?'
18895 [yY]*) d_u32align="$undef" ;;
18896 *) d_u32align="$define" ;;
18903 : see if ualarm exists
18904 set ualarm d_ualarm
18907 : see if umask exists
18911 : see if unordered exists
18912 set unordered d_unordered
18915 : see if unsetenv exists
18916 set unsetenv d_unsetenv
18919 : see if usleep exists
18920 set usleep d_usleep
18923 : see if prototype for usleep is available
18925 set d_usleepproto usleep $i_unistd unistd.h
18928 : see if ustat exists
18932 : see if closedir exists
18933 set closedir d_closedir
18936 case "$d_closedir" in
18939 echo "Checking whether closedir() returns a status..." >&4
18941 #$i_dirent I_DIRENT /**/
18942 #$i_sysdir I_SYS_DIR /**/
18943 #$i_sysndir I_SYS_NDIR /**/
18944 #$i_systypes I_SYS_TYPES /**/
18946 #if defined(I_SYS_TYPES)
18947 #include <sys/types.h>
18949 #if defined(I_DIRENT)
18950 #include <dirent.h>
18951 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
18952 #include <sys/dir.h>
18956 #include <sys/ndir.h>
18960 #include <ndir.h> /* may be wrong in the future */
18962 #include <sys/dir.h>
18967 int main() { return closedir(opendir(".")); }
18970 if eval $compile_ok; then
18971 if $run ./try > /dev/null 2>&1 ; then
18972 echo "Yes, it does."
18975 echo "No, it doesn't."
18979 echo "(I can't seem to compile the test program--assuming it doesn't)"
18987 set d_void_closedir
18991 : see if there is a wait4
18995 : see if waitpid exists
18996 set waitpid d_waitpid
18999 : see if wcstombs exists
19000 set wcstombs d_wcstombs
19003 : see if wctomb exists
19004 set wctomb d_wctomb
19007 : see if writev exists
19008 set writev d_writev
19011 : preserve RCS keywords in files with variable substitution, grrr
19016 Revision='$Revision'
19018 : check for alignment requirements
19020 case "$usecrosscompile" in
19023 You seem to be cross-compiling. Skipping the memory alignment check.
19026 case "$alignbytes" in
19027 '') alignbytes=8 ;;
19031 case "$alignbytes" in
19032 '') echo "Checking alignment constraints..." >&4
19033 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
19034 $cat >try.c <<'EOCP'
19035 typedef long double NV;
19038 $cat >try.c <<'EOCP'
19042 $cat >>try.c <<'EOCP'
19050 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
19055 if eval $compile_ok; then
19059 echo "(I can't seem to compile the test program...)"
19061 case "$multiarch" in
19063 : The usual safe value is 8, but Darwin with -Duselongdouble
19064 : needs 16. Hence, we will take 8 as a minimum, but allow
19065 : Configure to pick a larger value if needed.
19066 if $test "$dflt" -lt 8; then
19068 echo "Setting alignment to 8 for multiarch support.">&4
19073 *) dflt="$alignbytes"
19076 rp="Doubles must be aligned on a how-many-byte boundary?"
19084 : set the base revision
19087 : Determine if this is an EBCDIC system
19089 echo "Determining whether or not we are on an EBCDIC system..." >&4
19090 $cat >try.c <<'EOM'
19093 if ('M'==0xd4) return 0;
19098 case "$BOOTSTRAP_CHARSET" in
19099 Y|y|define) bootstrap_charset=$define ;;
19100 *) bootstrap_charset=$undef ;;
19105 if eval $compile_ok; then
19106 if $run ./try; then
19107 echo "You seem to speak EBCDIC." >&4
19110 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
19113 echo "I'm unable to compile the test program." >&4
19114 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
19120 : length of character in bytes. Is always 1, otherwise it is not C
19121 : This used to be a test using sizeof
19124 : Check for the number of bits in a character
19125 case "$charbits" in
19126 '') echo "Checking how long a character is (in bits)..." >&4
19133 for (c = 1, n = 0; c; c <<= 1, n++) ;
19134 printf ("%d\n", n);
19139 if eval $compile_ok; then
19143 echo "(I can't seem to compile the test program. Guessing...)"
19150 rp="What is the length of a character (in bits)?"
19154 case "$charbits" in
19157 Your system has an unsigned character size of $charbits bits, which
19158 is rather unusual (normally it is 8 bits). Perl likely will not work
19159 correctly on your system, with subtle bugs in various places.
19161 rp='Do you really want to continue?'
19165 [yY]) echo >&4 "Okay, continuing." ;;
19170 : how do we concatenate cpp tokens here?
19172 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
19173 $cat >cpp_stuff.c <<'EOCP'
19174 #define RCAT(a,b)a/**/b
19175 #define ACAT(a,b)a ## b
19179 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
19180 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
19181 echo "Oh! Smells like ANSI's been here." >&4
19182 echo "We can catify or stringify, separately or together!"
19184 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
19185 echo "Ah, yes! The good old days!" >&4
19186 echo "However, in the good old days we don't know how to stringify and"
19187 echo "catify at the same time."
19191 Hmm, I don't seem to be able to concatenate tokens with your cpp.
19192 You're going to have to edit the values of CAT[2-5] in config.h...
19194 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
19198 : see if this is a db.h system
19204 : Check db version.
19206 echo "Checking Berkeley DB version ..." >&4
19212 #include <sys/types.h>
19214 #$i_stdlib I_STDLIB
19216 #include <stdlib.h>
19219 int main(int argc, char *argv[])
19221 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
19222 int Major, Minor, Patch ;
19223 unsigned long Version ;
19224 (void)db_version(&Major, &Minor, &Patch) ;
19226 printf("%d %d %d %d %d %d\n",
19227 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
19228 Major, Minor, Patch);
19231 printf("You have Berkeley DB Version 2 or greater.\n");
19233 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
19234 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
19235 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
19236 Major, Minor, Patch) ;
19238 /* check that db.h & libdb are compatible */
19239 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
19240 printf("db.h and libdb are incompatible.\n") ;
19244 printf("db.h and libdb are compatible.\n") ;
19246 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
19247 + DB_VERSION_PATCH ;
19249 /* needs to be >= 2.3.4 */
19250 if (Version < 2003004) {
19251 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
19252 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
19258 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
19263 printf("You have Berkeley DB Version 1.\n");
19264 exit(0); /* DB version < 2: the coast is clear. */
19266 exit(1); /* <db.h> not Berkeley DB? */
19272 if eval $compile_ok && $run ./try; then
19273 echo 'Looks OK.' >&4
19275 db_version_major=$1
19276 db_version_minor=$2
19277 db_version_patch=$3
19279 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
19283 : Remove db from list of libraries to use
19284 echo "Removing unusable -ldb from library list" >&4
19285 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
19288 echo "libs = $libs" >&4
19298 : Check the return type needed for hash
19300 echo "Checking return type needed for hash for Berkeley DB ..." >&4
19306 #include <sys/types.h>
19309 #ifndef DB_VERSION_MAJOR
19310 u_int32_t hash_cb (ptr, size)
19318 info.hash = hash_cb;
19322 if $cc $ccflags -c try.c >try.out 2>&1 ; then
19323 if $contains warning try.out >>/dev/null 2>&1 ; then
19326 db_hashtype='u_int32_t'
19329 : XXX Maybe we should just give up here.
19330 db_hashtype=u_int32_t
19332 echo "Help: I can't seem to compile the db test program." >&4
19333 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
19336 echo "Your version of Berkeley DB uses $db_hashtype for hash."
19338 *) db_hashtype=u_int32_t
19343 : Check the return type needed for prefix
19345 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
19351 #include <sys/types.h>
19354 #ifndef DB_VERSION_MAJOR
19355 size_t prefix_cb (key1, key2)
19363 info.prefix = prefix_cb;
19367 if $cc $ccflags -c try.c >try.out 2>&1 ; then
19368 if $contains warning try.out >>/dev/null 2>&1 ; then
19369 db_prefixtype='int'
19371 db_prefixtype='size_t'
19374 db_prefixtype='size_t'
19375 : XXX Maybe we should just give up here.
19377 echo "Help: I can't seem to compile the db test program." >&4
19378 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
19381 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
19383 *) db_prefixtype='size_t'
19387 : How can we generate normalized random numbers ?
19389 echo "Using our internal random number implementation..." >&4
19392 *-Dmy_rand=*|*-Dmy_srand=*)
19393 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
19394 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
19395 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
19396 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
19400 randfunc=Perl_drand48
19401 drand01="Perl_drand48()"
19402 seedfunc="Perl_drand48_init"
19406 : Check how to flush
19409 Checking how to flush all pending stdio output...
19411 # I only know how to find the first 32 possibly open files on SunOS.
19412 # See also hints/sunos_4_1.sh and util.c --AD
19414 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
19416 $cat >>try.c <<EOCP
19418 #$i_stdlib I_STDLIB
19420 #include <stdlib.h>
19422 #$i_unistd I_UNISTD
19424 # include <unistd.h>
19426 #$d_sysconf HAS_SYSCONF
19427 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
19428 #ifdef HAS_STDIO_STREAM_ARRAY
19429 # define STDIO_STREAM_ARRAY $stdio_stream_array
19434 p = fopen("try.out", "w");
19438 # ifdef TRY_FPRINTF
19442 #ifdef TRY_FFLUSH_NULL
19445 #ifdef TRY_FFLUSH_ALL
19447 long open_max = -1;
19448 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
19449 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
19451 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
19452 open_max = sysconf(_SC_OPEN_MAX);
19455 open_max = FOPEN_MAX;
19458 open_max = OPEN_MAX;
19467 # ifdef HAS_STDIO_STREAM_ARRAY
19468 if (open_max > 0) {
19470 for (i = 0; i < open_max; i++)
19471 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
19472 STDIO_STREAM_ARRAY[i]._file < open_max &&
19473 STDIO_STREAM_ARRAY[i]._flag)
19474 fflush(&STDIO_STREAM_ARRAY[i]);
19482 : first we have to find out how _not_ to flush
19484 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
19486 set try -DTRY_FPUTC
19487 if eval $compile; then
19488 $run ./try 2>/dev/null
19491 if $test ! -s try.out -a "X$code" = X42; then
19497 set try -DTRY_FPRINTF
19498 if eval $compile; then
19499 $run ./try 2>/dev/null
19502 if $test ! -s try.out -a "X$code" = X42; then
19503 output=-DTRY_FPRINTF
19509 : check for fflush NULL behavior
19510 case "$fflushNULL" in
19511 '') set try -DTRY_FFLUSH_NULL $output
19512 if eval $compile; then
19513 $run ./try 2>/dev/null
19516 if $test -s try.out -a "X$code" = X42; then
19517 fflushNULL="`$cat try.out`"
19519 if $test "X$code" != X42; then
19521 (If this test failed, don't worry, we'll try another method shortly.)
19526 $rm -f core try.core core.try.*
19527 case "$fflushNULL" in
19529 Your fflush(NULL) works okay for output streams.
19530 Let's see if it clobbers input pipes...
19532 # As of mid-March 2000 all versions of Solaris appear to have a stdio
19533 # bug that improperly flushes the input end of pipes. So we avoid the
19534 # autoflush on fork/system/exec support for now. :-(
19535 $cat >tryp.c <<EOCP
19538 main(int argc, char **argv)
19544 while ((i = getc(stdin)) != -1
19545 && (*bp++ = i) != '\n'
19546 && bp < &buf[1024])
19549 fprintf(stdout, "%s", buf);
19557 fflushNULL="$define"
19559 if eval $compile; then
19561 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
19562 if cmp tryp.c tryp.out >/dev/null 2>&1; then
19564 fflush(NULL) seems to behave okay with input streams.
19566 fflushNULL="$define"
19569 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
19571 fflushNULL="$undef"
19574 $rm -f core tryp.c tryp.core core.tryp.*
19577 Your fflush(NULL) isn't working (contrary to ANSI C).
19579 fflushNULL="$undef"
19582 Cannot figure out whether your fflush(NULL) works or not.
19583 I'm assuming it doesn't (contrary to ANSI C).
19585 fflushNULL="$undef"
19589 $define|true|[yY]*)
19590 fflushNULL="$define"
19593 fflushNULL="$undef"
19596 : check explicit looping only if NULL did not work, and if the pipe
19597 : bug does not show up on an explicit flush too
19598 case "$fflushNULL" in
19600 $cat >tryp.c <<EOCP
19603 main(int argc, char **argv)
19609 while ((i = getc(stdin)) != -1
19610 && (*bp++ = i) != '\n'
19611 && bp < &buf[1024])
19614 fprintf(stdout, "%s", buf);
19623 if eval $compile; then
19625 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
19626 if cmp tryp.c tryp.out >/dev/null 2>&1; then
19628 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
19630 : now check for fflushall behaviour
19631 case "$fflushall" in
19632 '') set try -DTRY_FFLUSH_ALL $output
19633 if eval $compile; then
19635 (Now testing the other method--but note that this also may fail.)
19637 $run ./try 2>/dev/null
19640 if $test -s try.out -a "X$code" = X42; then
19641 fflushall="`$cat try.out`"
19645 case "$fflushall" in
19647 Whew. Flushing explicitly all the stdio streams works.
19649 fflushall="$define"
19652 Sigh. Flushing explicitly all the stdio streams doesn't work.
19657 Cannot figure out whether flushing stdio streams explicitly works or not.
19658 I'm assuming it doesn't.
19664 "$define"|true|[yY]*)
19665 fflushall="$define"
19673 All is futile. Even fflush(stdin) clobbers input pipes!
19680 $rm -f core tryp.c tryp.core core.tryp.*
19682 *) fflushall="$undef"
19686 case "$fflushNULL$fflushall" in
19689 OK, I give up. I cannot figure out how to flush pending stdio output.
19690 We won't be flushing handles at all before fork/exec/popen.
19696 : Store the full pathname to the ar program for use in the C program
19697 : Respect a hint or command line value for full_ar.
19702 : Store the full pathname to the sed program for use in the C program
19705 : see what type gids are declared as in the kernel
19707 echo "Looking for the type for group ids returned by getgid()."
19708 set gid_t gidtype xxx stdio.h sys/types.h
19712 xxx=`./findhdr sys/user.h`
19713 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
19715 unsigned) dflt="$1 $2" ;;
19719 *) dflt="$gidtype";;
19722 gid_t) echo "gid_t found." ;;
19723 *) rp="What is the type for group ids returned by getgid()?"
19729 : Check the size of GID
19732 *_t) zzz="$gidtype" ;;
19735 echo "Checking the size of $zzz..." >&4
19737 #include <sys/types.h>
19739 #$i_stdlib I_STDLIB
19741 #include <stdlib.h>
19744 printf("%d\n", (int)sizeof($gidtype));
19749 if eval $compile_ok; then
19753 echo "(I can't execute the test program--guessing $gidsize.)" >&4
19756 echo "Your $zzz is $gidsize bytes long."
19761 echo "(I can't compile the test program--guessing $gidsize.)" >&4
19765 : Check if GID is signed
19768 *_t) zzz="$gidtype" ;;
19771 echo "Checking the sign of $zzz..." >&4
19773 #include <sys/types.h>
19784 if eval $compile; then
19788 echo "(I can't execute the test program--guessing unsigned.)" >&4
19792 1) echo "Your $zzz is unsigned." ;;
19793 -1) echo "Your $zzz is signed." ;;
19799 echo "(I can't compile the test program--guessing unsigned.)" >&4
19803 : Check 64bit sizes
19806 if $test X"$quadtype" != X; then
19808 echo "Checking how to print 64-bit integers..." >&4
19810 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
19811 $cat >try.c <<'EOCP'
19812 #include <sys/types.h>
19815 int q = 12345678901;
19816 printf("%ld\n", q);
19820 if eval $compile; then
19824 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
19825 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
19826 echo "We will use %d."
19832 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
19833 $cat >try.c <<'EOCP'
19834 #include <sys/types.h>
19837 long q = 12345678901;
19838 printf("%ld\n", q);
19842 if eval $compile; then
19846 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
19847 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
19848 echo "We will use %ld."
19854 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
19855 $cat >try.c <<'EOCP'
19856 #include <sys/types.h>
19857 #include <inttypes.h>
19860 int64_t q = 12345678901;
19861 printf("%" PRId64 "\n", q);
19865 if eval $compile; then
19869 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
19870 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
19871 echo "We will use the C9X style."
19877 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
19879 #include <sys/types.h>
19882 $quadtype q = 12345678901;
19883 printf("%Ld\n", q);
19887 if eval $compile; then
19891 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
19892 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
19893 echo "We will use %Ld."
19899 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
19900 $cat >try.c <<'EOCP'
19901 #include <sys/types.h>
19904 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
19905 printf("%lld\n", q);
19909 if eval $compile; then
19913 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
19914 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
19915 echo "We will use the %lld style."
19921 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
19923 #include <sys/types.h>
19926 $quadtype q = 12345678901;
19927 printf("%qd\n", q);
19931 if eval $compile; then
19935 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
19936 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
19937 echo "We will use %qd."
19943 if $test X"$sPRId64" = X; then
19944 echo "Cannot figure out how to print 64-bit integers." >&4
19951 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
19952 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
19954 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
19955 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
19959 : Check format strings for internal types
19961 $echo "Checking the format strings to be used for Perl's internal types..." >&4
19963 if $test X"$ivsize" = X8; then
19964 ivdformat="$sPRId64"
19965 uvuformat="$sPRIu64"
19966 uvoformat="$sPRIo64"
19967 uvxformat="$sPRIx64"
19968 uvXUformat="$sPRIXU64"
19970 if $test X"$ivsize" = X"$longsize"; then
19977 if $test X"$ivsize" = X"$intsize"; then
19985 if $test X"$ivsize" = X"$shortsize"; then
19996 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
19997 nveformat="$sPRIeldbl"
19998 nvfformat="$sPRIfldbl"
19999 nvgformat="$sPRIgldbl"
20000 nvEUformat="$sPRIEUldbl"
20001 nvFUformat="$sPRIFUldbl"
20002 nvGUformat="$sPRIGUldbl"
20012 case "$ivdformat" in
20013 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
20018 : Check format string for GID
20021 $echo "Checking the format string to be used for gids..." >&4
20024 -1) if $test X"$gidsize" = X"$ivsize"; then
20025 gidformat="$ivdformat"
20027 if $test X"$gidsize" = X"$longsize"; then
20030 if $test X"$gidsize" = X"$intsize"; then
20033 if $test X"$gidsize" = X"$shortsize"; then
20040 *) if $test X"$gidsize" = X"$uvsize"; then
20041 gidformat="$uvuformat"
20043 if $test X"$gidsize" = X"$longsize"; then
20046 if $test X"$gidsize" = X"$intsize"; then
20049 if $test X"$gidsize" = X"$shortsize"; then
20058 : see if getgroups exists
20059 set getgroups d_getgrps
20062 : see if setgroups exists
20063 set setgroups d_setgrps
20066 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
20068 case "$d_getgrps$d_setgrps" in
20070 case "$groupstype" in
20071 '') dflt="$gidtype" ;;
20072 *) dflt="$groupstype" ;;
20075 What type of pointer is the second argument to getgroups() and setgroups()?
20076 Usually this is the same as group ids, $gidtype, but not always.
20079 rp='What type pointer is the second argument to getgroups() and setgroups()?'
20083 *) groupstype="$gidtype";;
20086 : MAD = Misc Attribute Definition
20088 if $test $patchlevel -lt 9; then
20089 : MAD is not available in 5.8.x or earlier.
20093 $define|true|[yY]*) dflt='y' ;;
20098 Would you like to build with Misc Attribute Decoration? This is development
20099 work leading to a Perl 5 to Perl 6 convertor, which imposes a space and speed
20100 overhead on the interpreter.
20102 If this doesn't make any sense to you, just accept the default '$dflt'.
20104 rp='Build Perl with MAD?'
20109 madlyh='madly.h madly.act madly.tab'
20111 madlyobj="madly$_o" ;;
20120 : check whether make sets MAKE
20122 echo "Checking if your $make program sets \$(MAKE)..." >&4
20123 case "$make_set_make" in
20125 $sed 's/^X //' > testmake.mak << 'EOF'
20127 X @echo 'maketemp="$(MAKE)"'
20129 case "`$make -f testmake.mak 2>/dev/null`" in
20130 *maketemp=*) make_set_make='#' ;;
20131 *) make_set_make="MAKE=$make" ;;
20133 $rm -f testmake.mak
20136 case "$make_set_make" in
20137 '#') echo "Yup, it does.";;
20138 *) echo "Nope, it doesn't.";;
20141 : see what type is used for mode_t
20142 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
20143 set mode_t modetype int stdio.h sys/types.h
20146 : see if we need va_copy
20148 case "$i_stdarg" in
20151 #include <stdarg.h>
20153 #$i_stdlib I_STDLIB
20155 #include <stdlib.h>
20157 #include <signal.h>
20160 ivfprintf(FILE *f, const char *fmt, va_list *valp)
20162 return vfprintf(f, fmt, *valp);
20166 myvfprintf(FILE *f, const char *fmt, va_list val)
20168 return ivfprintf(f, fmt, &val);
20172 myprintf(char *fmt, ...)
20175 va_start(val, fmt);
20176 return myvfprintf(stdout, fmt, val);
20180 main(int ac, char **av)
20182 signal(SIGSEGV, exit);
20184 myprintf("%s%cs all right, then\n", "that", '\'');
20189 if eval $compile && $run ./try 2>&1 >/dev/null; then
20190 case "`$run ./try`" in
20191 "that's all right, then")
20197 yes) echo "It seems that you don't need va_copy()." >&4
20198 need_va_copy="$undef"
20200 *) echo "It seems that va_copy() or similar will be needed." >&4
20201 need_va_copy="$define"
20206 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
20207 need_va_copy="$undef"
20211 : see what type is used for size_t
20212 rp="What is the type used for the length parameter for string functions?"
20213 set size_t sizetype 'unsigned int' stdio.h sys/types.h
20216 : check for type of arguments to gethostbyaddr.
20217 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
20218 case "$d_gethbyaddr" in
20222 Checking to see what type of arguments are accepted by gethostbyaddr().
20224 hdrs="$define sys/types.h
20225 $d_socket sys/socket.h
20226 $i_niin netinet/in.h
20228 $i_unistd unistd.h"
20229 : The first arg can 'char *' or 'void *'
20230 : The second arg is some of integral type
20231 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
20232 for yyy in size_t long int; do
20233 case "$netdb_host_type" in
20234 '') try="$extern_C struct hostent *gethostbyaddr($xxx, $yyy, int);"
20235 if ./protochk "$try" $hdrs; then
20236 echo "Your system accepts $xxx for the first arg."
20237 echo "...and $yyy for the second arg."
20238 netdb_host_type="$xxx"
20239 netdb_hlen_type="$yyy"
20245 : In case none of those worked, prompt the user.
20246 case "$netdb_host_type" in
20247 '') rp='What is the type for the 1st argument to gethostbyaddr?'
20250 netdb_host_type=$ans
20251 rp='What is the type for the 2nd argument to gethostbyaddr?'
20254 netdb_hlen_type=$ans
20258 *) : no gethostbyaddr, so pick harmless defaults
20259 netdb_host_type='char *'
20260 netdb_hlen_type="$sizetype"
20263 # Remove the "const" if needed. -- but then we'll have a
20265 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
20268 : check for type of argument to gethostbyname.
20269 if test "X$netdb_name_type" = X ; then
20270 case "$d_gethbyname" in
20274 Checking to see what type of argument is accepted by gethostbyname().
20276 hdrs="$define sys/types.h
20277 $d_socket sys/socket.h
20278 $i_niin netinet/in.h
20280 $i_unistd unistd.h"
20281 for xxx in "const char *" "char *"; do
20282 case "$netdb_name_type" in
20283 '') try="$extern_C struct hostent *gethostbyname($xxx);"
20284 if ./protochk "$try" $hdrs; then
20285 echo "Your system accepts $xxx."
20286 netdb_name_type="$xxx"
20291 : In case none of those worked, prompt the user.
20292 case "$netdb_name_type" in
20293 '') rp='What is the type for the 1st argument to gethostbyname?'
20296 netdb_name_type=$ans
20300 *) : no gethostbyname, so pick harmless default
20301 netdb_name_type='char *'
20306 : check for type of 1st argument to getnetbyaddr.
20307 if test "X$netdb_net_type" = X ; then
20308 case "$d_getnbyaddr" in
20312 Checking to see what type of 1st argument is accepted by getnetbyaddr().
20314 hdrs="$define sys/types.h
20315 $d_socket sys/socket.h
20316 $i_niin netinet/in.h
20318 $i_unistd unistd.h"
20319 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
20320 case "$netdb_net_type" in
20321 '') try="$extern_C struct netent *getnetbyaddr($xxx, int);"
20322 if ./protochk "$try" $hdrs; then
20323 echo "Your system accepts $xxx."
20324 netdb_net_type="$xxx"
20329 : In case none of those worked, prompt the user.
20330 case "$netdb_net_type" in
20331 '') rp='What is the type for the 1st argument to getnetbyaddr?'
20334 netdb_net_type=$ans
20338 *) : no getnetbyaddr, so pick harmless default
20339 netdb_net_type='long'
20343 : locate the preferred pager for this system
20350 [a-zA-Z]:/*) dflt=$pg;;
20354 [a-zA-Z]:/*) dflt=$more;;
20358 [a-zA-Z]:/*) dflt=$less;;
20361 '') dflt=/usr/ucb/more;;
20369 rp='What pager is used on your system?'
20373 : see what type pids are declared as in the kernel
20374 rp="What is the type of process ids on this system?"
20375 set pid_t pidtype int stdio.h sys/types.h
20378 : see if ar generates random libraries by itself
20380 echo "Checking how to generate random libraries on your machine..." >&4
20381 echo 'int bar1() { return bar2(); }' > bar1.c
20382 echo 'int bar2() { return 2; }' > bar2.c
20384 #$i_stdlib I_STDLIB
20386 #include <stdlib.h>
20388 int main() { printf("%d\n", bar1()); exit(0); }
20390 $cc $ccflags -c bar1.c >/dev/null 2>&1
20391 $cc $ccflags -c bar2.c >/dev/null 2>&1
20392 $cc $ccflags -c foo.c >/dev/null 2>&1
20393 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
20394 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20395 $run ./foobar >/dev/null 2>&1; then
20396 echo "$ar appears to generate random libraries itself."
20398 if [ "X$ranlib" = "X" ]; then
20401 elif $ar s bar$_a >/dev/null 2>&1 &&
20402 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20403 $run ./foobar >/dev/null 2>&1; then
20404 echo "a table of contents needs to be added with '$ar s'."
20407 elif $ar ts bar$_a >/dev/null 2>&1 &&
20408 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20409 $run ./foobar >/dev/null 2>&1; then
20410 echo "a table of contents needs to be added with '$ar ts'."
20417 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
20418 $test -f $ranlib || ranlib=''
20421 if $test -n "$ranlib"; then
20422 echo "your system has '$ranlib'; we'll use that."
20425 echo "your system doesn't seem to support random libraries"
20426 echo "so we'll use lorder and tsort to order the libraries."
20433 : see if this is a values.h system
20434 set values.h i_values
20437 : Check the max offset that gmtime and localtime accept
20438 echo "Checking max offsets that gmtime () accepts"
20441 define) yyy="#include <values.h>" ;;
20445 case "$sGMTIME_min/$sGMTIME_max" in
20448 #include <sys/types.h>
20457 void gm_check (time_t t, int min_year, int max_year)
20460 if ( tmp == NULL ||
20461 /* Check tm_year overflow */
20462 tmp->tm_year < min_year || tmp->tm_year > max_year)
20473 gm_check (MAXLONG, 69, 0x7fffffff);
20475 if (tmp == NULL || tmp->tm_year < 0) {
20476 for (i = 63; i >= 0; i--) {
20477 time_t x = pt | ((time_t)1 << i);
20478 if (x < 0 || x < pt) continue;
20479 gm_check (x, 69, 0x7fffffff);
20482 printf ("sGMTIME_max=%ld\n", pt);
20491 gm_check (MINLONG, -1900, 70);
20494 for (i = 36; i >= 0; i--) {
20495 time_t x = pt - ((time_t)1 << i);
20496 if (x > 0) continue;
20497 gm_check (x, -1900, 70);
20500 printf ("sGMTIME_min=%ld\n", pt);
20504 int main (int argc, char *argv[])
20506 fprintf (stderr, "Sizeof time_t = %ld\n", sizeof (time_t));
20513 if eval $compile; then
20516 echo "Cannot determine sGMTIME_max and sGMTIME_min." >&4
20522 echo "Checking max offsets that localtime () accepts"
20524 case "$sLOCALTIME_min/$sLOCALTIME_max" in
20527 #include <sys/types.h>
20536 void local_check (time_t t, int min_year, int max_year)
20538 if (sizeof (time_t) > 4 && t > 0x7ffffffffffff000LL)
20541 tmp = localtime (&t);
20542 if ( tmp == NULL ||
20543 /* Check tm_year overflow */
20544 tmp->tm_year < min_year || tmp->tm_year > max_year)
20548 } /* local_check */
20555 local_check (MAXLONG, 69, 0x7fffffff);
20557 if (tmp == NULL || tmp->tm_year < 0) {
20558 for (i = 63; i >= 0; i--) {
20559 time_t x = pt | ((time_t)1 << i);
20560 if (x < 0 || x < pt) continue;
20561 local_check (x, 69, 0x7fffffff);
20564 printf ("sLOCALTIME_max=%ld\n", pt);
20573 local_check (MINLONG, -1900, 70);
20576 for (i = 36; i >= 0; i--) {
20577 time_t x = pt - ((time_t)1 << i);
20578 if (x > 0) continue;
20579 local_check (x, -1900, 70);
20582 printf ("sLOCALTIME_min=%ld\n", pt);
20586 int main (int argc, char *argv[])
20594 if eval $compile; then
20597 echo "Cannot determine sLOCALTIME_max and sLOCALTIME_min." >&4
20603 : check for type of arguments to select.
20604 case "$selecttype" in
20605 '') case "$d_select" in
20609 Checking to see what type of arguments are accepted by select().
20611 hdrs="$define sys/types.h
20612 $i_systime sys/time.h
20613 $i_sysselct sys/select.h
20614 $d_socket sys/socket.h"
20615 : The first arg can be int, unsigned, or size_t
20616 : The last arg may or may not be 'const'
20618 : void pointer has been seen but using that
20619 : breaks the selectminbits test
20620 for xxx in 'fd_set *' 'int *'; do
20621 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
20622 for tmo in 'struct timeval *' 'const struct timeval *'; do
20624 '') try="$extern_C select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
20625 if ./protochk "$try" $hdrs; then
20626 echo "Your system accepts $xxx."
20635 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
20636 case "$d_fd_set" in
20637 $define) dflt="fd_set *" ;;
20646 *) : no select, so pick a harmless default
20653 : check for the select 'width'
20654 case "$selectminbits" in
20655 '') safebits=`expr $ptrsize \* 8`
20656 case "$d_select" in
20660 Checking to see on how many bits at a time your select() operates...
20663 #include <sys/types.h>
20665 #$i_systime I_SYS_TIME
20666 #$i_systimek I_SYS_TIME_KERNEL
20671 # ifdef I_SYS_TIME_KERNEL
20674 # include <sys/time.h>
20675 # ifdef I_SYS_TIME_KERNEL
20679 #$i_sysselct I_SYS_SELECT
20680 #ifdef I_SYS_SELECT
20681 #include <sys/select.h>
20683 #$d_socket HAS_SOCKET
20685 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
20688 #$i_stdlib I_STDLIB
20690 #include <stdlib.h>
20693 #define S sizeof(*(b))
20695 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
20696 #define NBITS (NBYTES * 8)
20698 char *s = (char *)malloc(NBYTES);
20707 fp = fopen("try.c", "r");
20713 b = ($selecttype)s;
20714 for (i = 0; i < NBITS; i++)
20718 select(fd + 1, b, 0, 0, &t);
20719 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
20721 printf("%d\n", i + 1);
20726 if eval $compile_ok; then
20727 selectminbits=`$run ./try`
20728 case "$selectminbits" in
20730 Cannot figure out on how many bits at a time your select() operates.
20731 I'll play safe and guess it is $safebits bits.
20733 selectminbits=$safebits
20734 bits="$safebits bits"
20737 *) bits="$selectminbits bits" ;;
20739 echo "Your select() operates on $bits at a time." >&4
20741 rp='What is the minimum number of bits your select() operates on?'
20742 case "$byteorder" in
20743 12345678) dflt=64 ;;
20749 selectminbits="$val"
20753 *) : no select, so pick a harmless default
20754 selectminbits=$safebits
20760 : Trace out the files included by signal.h, then look for SIGxxx names.
20761 if [ "X$fieldn" = X ]; then
20762 : Just make some guesses. We check them later.
20763 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
20765 xxx=`echo '#include <signal.h>' |
20766 $cppstdin $cppminus $cppflags 2>/dev/null |
20767 $grep '^[ ]*#.*include' |
20768 $awk "{print \\$$fieldn}" | $sed 's!"!!g' |\
20769 $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
20772 for xx in $xxx /dev/null ; do
20773 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
20775 case "$xxxfiles" in
20776 '') xxxfiles=`./findhdr signal.h` ;;
20779 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
20780 print substr($2, 4, 20)
20782 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
20783 print substr($3, 4, 20)
20785 : Append some common names just in case the awk scan failed.
20786 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
20787 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
20788 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
20789 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
20790 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
20792 : generate a few handy files for later
20793 $cat > signal.c <<EOCP
20794 #include <sys/types.h>
20795 #include <signal.h>
20796 #$i_stdlib I_STDLIB
20798 #include <stdlib.h>
20803 /* Strange style to avoid deeply-nested #if/#else/#endif */
20806 # define NSIG (_NSIG)
20812 # define NSIG (SIGMAX+1)
20818 # define NSIG (SIG_MAX+1)
20824 # define NSIG (_SIG_MAX+1)
20830 # define NSIG (MAXSIG+1)
20836 # define NSIG (MAX_SIG+1)
20841 # ifdef SIGARRAYSIZE
20842 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
20848 # define NSIG (_sys_nsig) /* Solaris 2.5 */
20852 /* Default to some arbitrary number that's big enough to get most
20853 of the common signals.
20859 printf("NSIG %d\n", NSIG);
20865 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
20867 printf "#ifdef SIG"; printf $1; printf "\n"
20868 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
20869 printf $1; printf ");\n"
20873 printf "#endif /* JUST_NSIG */\n";
20874 printf "exit(0);\n}\n";
20877 $cat >signal.awk <<'EOP'
20878 BEGIN { ndups = 0 }
20879 $1 ~ /^NSIG$/ { nsig = $2 }
20880 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
20881 if ($2 > maxsig) { maxsig = $2 }
20882 if (sig_name[$2]) {
20883 dup_name[ndups] = $1
20884 dup_num[ndups] = $2
20896 printf("NSIG %d\n", nsig);
20897 for (n = 1; n < nsig; n++) {
20899 printf("%s %d\n", sig_name[n], sig_num[n])
20902 printf("NUM%d %d\n", n, n)
20905 for (n = 0; n < ndups; n++) {
20906 printf("%s %d\n", dup_name[n], dup_num[n])
20910 $cat >signal_cmd <<EOS
20912 if $test -s signal.lst; then
20913 echo "Using your existing signal.lst file"
20918 $cat >>signal_cmd <<'EOS'
20921 if eval $compile_ok; then
20922 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) |\
20923 $uniq | $awk -f signal.awk >signal.lst
20925 echo "(I can't seem be able to compile the whole test program)" >&4
20926 echo "(I'll try it in little pieces.)" >&4
20927 set signal -DJUST_NSIG
20928 if eval $compile_ok; then
20929 $run ./signal$_exe > signal.nsg
20932 echo "I can't seem to figure out how many signals you have." >&4
20933 echo "Guessing 50." >&4
20934 echo 'NSIG 50' > signal.nsg
20936 : Now look at all the signal names, one at a time.
20937 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
20938 $cat > signal.c <<EOCP
20939 #include <sys/types.h>
20940 #include <signal.h>
20943 printf("$xx %d\n", SIG${xx});
20948 if eval $compile; then
20949 echo "SIG${xx} found."
20950 $run ./signal$_exe >> signal.ls1
20952 echo "SIG${xx} NOT found."
20955 if $test -s signal.ls1; then
20956 $cat signal.nsg signal.ls1 |
20957 $sort -n | $uniq | $awk -f signal.awk >signal.lst
20961 if $test -s signal.lst; then
20964 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
20965 echo 'kill -l' >signal
20966 set X `csh -f <signal`
20970 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
20972 echo $@ | $tr ' ' $trnl | \
20973 $awk '{ printf "%s %d\n", $1, ++s; }
20974 END { printf "NSIG %d\n", ++s }' >signal.lst
20976 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
20978 chmod a+x signal_cmd
20979 $eunicefix signal_cmd
20981 : generate list of signal names
20983 case "$sig_name_init" in
20985 *) case "$sig_num_init" in
20986 ''|*,*) doinit=yes ;;
20991 echo "Generating a list of signal names and numbers..." >&4
20993 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
20994 sig_name=`$awk 'BEGIN { printf "ZERO " }
20995 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
20996 sig_num=`$awk 'BEGIN { printf "0 " }
20997 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
20998 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
20999 !/^NSIG/ { printf "\"%s\", ", $1 }
21000 END { printf "0\n" }' signal.lst`
21001 sig_num_init=`$awk 'BEGIN { printf "0, " }
21002 !/^NSIG/ { printf "%d, ", $2}
21003 END { printf "0\n"}' signal.lst`
21006 echo "The following $sig_count signals are available:"
21008 echo $sig_name | $awk \
21009 'BEGIN { linelen = 0 }
21011 for (i = 1; i <= NF; i++) {
21012 name = "SIG" $i " "
21013 linelen = linelen + length(name)
21014 if (linelen > 70) {
21016 linelen = length(name)
21022 sig_size=`echo $sig_name | awk '{print NF}'`
21023 $rm -f signal signal.c signal.awk signal.lst signal_cmd
21025 : Check size of size
21027 case "$sizetype" in
21028 *_t) zzz="$sizetype" ;;
21029 *) zzz="filesize" ;;
21031 echo "Checking the size of $zzz..." >&4
21033 #include <sys/types.h>
21035 #$i_stdlib I_STDLIB
21037 #include <stdlib.h>
21040 printf("%d\n", (int)sizeof($sizetype));
21045 if eval $compile_ok; then
21049 echo "(I can't execute the test program--guessing $sizesize.)" >&4
21052 echo "Your $zzz size is $sizesize bytes."
21057 echo "(I can't compile the test program--guessing $sizesize.)" >&4
21061 : check for socklen_t
21063 echo "Checking to see if you have socklen_t..." >&4
21065 #include <sys/types.h>
21066 #$d_socket HAS_SOCKET
21068 #include <sys/socket.h>
21070 int main() { socklen_t x = 16; }
21073 if eval $compile; then
21075 echo "You have socklen_t."
21078 echo "You do not have socklen_t."
21079 case "$sizetype" in
21080 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
21087 : see if this is a socks.h system
21088 set socks.h i_socks
21091 : check for type of the size argument to socket calls
21092 case "$d_socket" in
21096 Checking to see what type is the last argument of accept().
21099 case "$d_socklen_t" in
21100 "$define") yyy="$yyy socklen_t"
21102 yyy="$yyy $sizetype int long unsigned"
21103 for xxx in $yyy; do
21104 case "$socksizetype" in
21105 '') try="$extern_C int accept(int, struct sockaddr *, $xxx *);"
21106 case "$usesocks" in
21108 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
21109 echo "Your system accepts '$xxx *' for the last argument of accept()."
21110 socksizetype="$xxx"
21113 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
21114 echo "Your system accepts '$xxx *' for the last argument of accept()."
21115 socksizetype="$xxx"
21122 : In case none of those worked, prompt the user.
21123 case "$socksizetype" in
21124 '') rp='What is the type for socket address structure sizes?'
21131 *) : no sockets, so pick relatively harmless default
21136 : see what type is used for signed size_t
21137 set ssize_t ssizetype int stdio.h sys/types.h
21142 #$i_stdlib I_STDLIB
21144 #include <stdlib.h>
21146 #include <sys/types.h>
21147 #define Size_t $sizetype
21148 #define SSize_t $dflt
21151 if (sizeof(Size_t) == sizeof(SSize_t))
21153 else if (sizeof(Size_t) == sizeof(int))
21162 if eval $compile_ok && $run ./try > /dev/null; then
21163 ssizetype=`$run ./try`
21164 echo "I'll be using $ssizetype for functions returning a byte count." >&4
21167 Help! I can't compile and run the ssize_t test program: please enlighten me!
21168 (This is probably a misconfiguration in your system or libraries, and
21169 you really ought to fix it. Still, I'll try anyway.)
21171 I need a type that is the same size as $sizetype, but is guaranteed to
21172 be signed. Common values are ssize_t, int and long.
21175 rp="What signed type is the same size as $sizetype?"
21181 : Check the size of st_ino
21183 $echo "Checking the size of st_ino..." >&4
21184 $cat > try.c <<EOCP
21185 #include <sys/stat.h>
21187 #$i_stdlib I_STDLIB
21189 #include <stdlib.h>
21193 printf("%d\n", (int)sizeof(st.st_ino));
21198 if eval $compile_ok; then
21202 $echo "(I can't execute the test program--guessing $st_ino_size.)" >&4
21204 *) st_ino_size=$val
21205 $echo "Your st_ino is $st_ino_size bytes long."
21210 $echo "(I can't compile the test program--guessing $st_ino_size.)" >&4
21214 : Check if st_ino is signed
21216 $echo "Checking the sign of st_ino..." >&4
21217 $cat > try.c <<EOCP
21218 #include <sys/stat.h>
21223 if (foo.st_ino < 0)
21230 if eval $compile; then
21234 $echo "(I can't execute the test program--guessing unsigned.)" >&4
21236 *) st_ino_sign=$val
21237 case "$st_ino_sign" in
21238 1) $echo "Your st_ino is unsigned." ;;
21239 -1) $echo "Your st_ino is signed." ;;
21245 $echo "(I can't compile the test program--guessing unsigned.)" >&4
21249 : see what type of char stdio uses.
21251 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
21252 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
21253 echo "Your stdio uses unsigned chars." >&4
21254 stdchar="unsigned char"
21256 echo "Your stdio uses signed chars." >&4
21261 : see what type uids are declared as in the kernel
21263 echo "Looking for the type for user ids returned by getuid()."
21264 set uid_t uidtype xxx stdio.h sys/types.h
21268 xxx=`./findhdr sys/user.h`
21269 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
21271 unsigned) dflt="$1 $2" ;;
21275 *) dflt="$uidtype";;
21278 uid_t) echo "uid_t found." ;;
21279 *) rp="What is the type for user ids returned by getuid()?"
21285 : Check size of UID
21288 *_t) zzz="$uidtype" ;;
21291 echo "Checking the size of $zzz..." >&4
21293 #include <sys/types.h>
21295 #$i_stdlib I_STDLIB
21297 #include <stdlib.h>
21300 printf("%d\n", (int)sizeof($uidtype));
21305 if eval $compile_ok; then
21309 echo "(I can't execute the test program--guessing $uidsize.)" >&4
21312 echo "Your $zzz is $uidsize bytes long."
21317 echo "(I can't compile the test program--guessing $uidsize.)" >&4
21320 : Check if UID is signed
21323 *_t) zzz="$uidtype" ;;
21326 echo "Checking the sign of $zzz..." >&4
21328 #include <sys/types.h>
21339 if eval $compile; then
21343 echo "(I can't execute the test program--guessing unsigned.)" >&4
21347 1) echo "Your $zzz is unsigned." ;;
21348 -1) echo "Your $zzz is signed." ;;
21354 echo "(I can't compile the test program--guessing unsigned.)" >&4
21358 : Check format string for UID
21360 $echo "Checking the format string to be used for uids..." >&4
21363 -1) if $test X"$uidsize" = X"$ivsize"; then
21364 uidformat="$ivdformat"
21366 if $test X"$uidsize" = X"$longsize"; then
21369 if $test X"$uidsize" = X"$intsize"; then
21372 if $test X"$uidsize" = X"$shortsize"; then
21379 *) if $test X"$uidsize" = X"$uvsize"; then
21380 uidformat="$uvuformat"
21382 if $test X"$uidsize" = X"$longsize"; then
21385 if $test X"$uidsize" = X"$intsize"; then
21388 if $test X"$uidsize" = X"$shortsize"; then
21397 : Determine if we can use sysctl with KERN_PROC_PATHNAME to find executing program
21399 echo "Determining whether we can use sysctl with KERN_PROC_PATHNAME to find executing program..." >&4
21400 $cat >try.c <<'EOM'
21401 /* Intentionally a long probe as I'd like to sanity check that the exact
21402 approach is going to work, as thinking it will work, but only having it
21403 part working at runtime is worse than not having it. */
21405 #include <sys/types.h>
21406 #include <sys/sysctl.h>
21407 #include <sys/param.h>
21409 #include <string.h>
21410 #include <stdlib.h>
21411 #include <unistd.h>
21414 main(int argc, char **argv) {
21416 char *argv_leaf = strrchr(argv[0], '/');
21422 mib[1] = KERN_PROC;
21423 mib[2] = KERN_PROC_PATHNAME;
21427 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
21431 if (sysctl(mib, 4, NULL, &size, NULL, 0)) {
21436 if (size < strlen(argv_leaf) + 1) {
21437 fprintf(stderr, "size %lu is too short for a path\n",
21438 (unsigned long) size);
21442 if (size > MAXPATHLEN * MAXPATHLEN) {
21443 fprintf(stderr, "size %lu is too long for a path\n",
21444 (unsigned long) size);
21448 buffer = malloc(size);
21454 if (sysctl(mib, 4, buffer, &size, NULL, 0)) {
21459 if (strlen(buffer) + 1 != size) {
21460 fprintf(stderr, "size != strlen(buffer) + 1 (%lu != %lu)\n",
21461 (unsigned long)size, (unsigned long)strlen(buffer) + 1);
21466 if (*buffer != '/') {
21467 fprintf(stderr, "Not an absolute path: '%s'\n", buffer);
21471 if (strstr(buffer, "/./")) {
21472 fprintf(stderr, "Contains /./: '%s'\n", buffer);
21476 if (strstr(buffer, "/../")) {
21477 fprintf(stderr, "Contains /../: '%s'\n", buffer);
21481 buffer_leaf = strrchr(buffer, '/');
21482 if (strcmp(buffer_leaf, argv_leaf) != 0) {
21483 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], buffer);
21495 if eval $compile; then
21496 if $run ./try; then
21497 echo "You can use sysctl with KERN_PROC_PATHNAME to find the executing program." >&4
21500 echo "Nope, sysctl with KERN_PROC_PATHNAME doesn't work here." >&4
21504 echo "I'm unable to compile the test program." >&4
21505 echo "I'll assume no sysctl with KERN_PROC_PATHNAME here." >&4
21509 set usekernprocpathname
21512 : Determine if we can use _NSGetExecutablePath to find executing program
21514 echo "Determining whether we can use _NSGetExecutablePath to find executing program..." >&4
21515 $cat >try.c <<'EOM'
21516 /* Intentionally a long probe as I'd like to sanity check that the exact
21517 approach is going to work, as thinking it will work, but only having it
21518 part working at runtime is worse than not having it. */
21519 #include <mach-o/dyld.h>
21521 #include <stdlib.h>
21522 #include <sys/param.h>
21523 #include <string.h>
21526 main(int argc, char **argv) {
21528 uint32_t size = sizeof(buf);
21532 char *argv_leaf = strrchr(argv[0], '/');
21536 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
21540 _NSGetExecutablePath(buf, &size);
21541 if (size > MAXPATHLEN * MAXPATHLEN) {
21542 fprintf(stderr, "_NSGetExecutablePath size %u is too long for a path\n",
21543 (unsigned int) size);
21547 buffer = malloc(size);
21553 result = _NSGetExecutablePath(buffer, &size);
21555 fprintf(stderr, "_NSGetExecutablePath returned %i for a size of %u\n",
21556 result, (unsigned int) size);
21560 tidied = realpath(buffer, NULL);
21562 perror("realpath");
21568 if (*tidied != '/') {
21569 fprintf(stderr, "Not an absolute path: '%s'\n", tidied);
21573 if (strstr(tidied, "/./")) {
21574 fprintf(stderr, "Contains /./: '%s'\n", tidied);
21578 if (strstr(tidied, "/../")) {
21579 fprintf(stderr, "Contains /../: '%s'\n", tidied);
21583 tidied_leaf = strrchr(tidied, '/');
21584 if (strcmp(tidied_leaf, argv_leaf) != 0) {
21585 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], tidied);
21597 if eval $compile; then
21598 if $run ./try; then
21599 echo "You can use _NSGetExecutablePath to find the executing program." >&4
21602 echo "Nope, _NSGetExecutablePath doesn't work here." >&4
21605 echo "I'm unable to compile the test program." >&4
21606 echo "I'll assume no _NSGetExecutablePath here." >&4
21609 set usensgetexecutablepath
21612 : Check if site customization support was requested
21613 case "$usesitecustomize" in
21614 $define|true|[Yy]*)
21615 usesitecustomize="$define"
21618 usesitecustomize="$undef"
21622 : see if prototypes support variable argument declarations
21624 case "$prototype$i_stdarg" in
21626 echo "It appears we'll be able to prototype varargs functions." >&4
21630 echo "Too bad... We won't be using prototyped varargs functions..." >&4
21637 : determine compiler compiler
21646 if $test -f "$byacc$_exe"; then
21648 comp="byacc or $comp"
21650 if $test -f "$bison$_exe"; then
21651 comp="$comp or bison -y"
21653 rp="Which compiler compiler ($comp) shall I use?"
21662 echo "(Adding -y option to bison to get yacc-compatible behavior.)"
21668 : see if this is a assert.h system
21669 set assert.h i_assert
21672 : see if this is a fp.h system
21676 : see if this is a fp_class.h system
21677 set fp_class.h i_fp_class
21680 : see if gdbm.h is available
21685 : see if gdbm_open exists
21686 set gdbm_open d_gdbm_open
21688 case "$d_gdbm_open" in
21691 echo "We won't be including <gdbm.h>"
21700 : see if this is a ieeefp.h system
21701 case "$i_ieeefp" in
21702 '' ) set ieeefp.h i_ieeefp
21707 : see if this is a libutil.h system
21708 set libutil.h i_libutil
21711 : see if mach cthreads are available
21712 if test "X$usethreads" = "X$define"; then
21713 set mach/cthreads.h i_machcthr
21716 i_machcthr="$undef"
21719 : see if this is a mntent.h system
21720 set mntent.h i_mntent
21723 : see if net/errno.h is available
21725 set net/errno.h val
21728 : Unfortunately, it causes problems on some systems. Arrgh.
21731 cat > try.c <<'EOM'
21734 #include <net/errno.h>
21740 if $cc $ccflags -c try.c >/dev/null 2>&1; then
21741 echo "We'll be including <net/errno.h>." >&4
21743 echo "We won't be including <net/errno.h>." >&4
21752 : see if netinet/tcp.h is available
21753 set netinet/tcp.h i_netinettcp
21756 : see if this is a poll.h system
21760 : see if this is a prot.h system
21764 : Preprocessor symbols
21766 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
21767 $cat <<'EOSH' > Cppsym.know
21768 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
21769 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
21770 alliant alpha am29000 AM29000 AMD64 amd64 amiga AMIGAOS AMIX
21771 ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
21772 BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
21773 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
21774 bull c cadmus clipper CMU COFF COMPILER_VERSION
21775 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
21776 CYGWIN DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
21777 Dynix DynixPTX ELF encore EPI EXTENSIONS FAVOR_BSD
21778 FILE_OFFSET_BITS FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
21780 GNU_SOURCE GNUC GNUC_MINOR GNU_LIBRARY GO32 gould GOULD_PN
21781 H3050R H3050RX hbullx20 hcx host_mips
21782 hp200 hp300 hp700 HP700 hp800 hp9000
21783 hp9000s200 hp9000s300 hp9000s400 hp9000s500
21784 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
21785 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
21786 IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
21787 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
21788 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
21789 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
21790 LIBCATAMOUNT Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
21791 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
21792 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
21793 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
21794 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
21795 MATH_HAS_NO_SIDE_EFFECTS
21796 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
21797 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
21798 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
21799 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
21800 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
21801 NetBSD news1500 news1700 news1800 news1900 news3700
21802 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
21803 ns32016 ns32332 ns32k nsc32000
21804 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
21805 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
21806 pc532 pdp11 PGC PIC plexus PORTAR posix
21807 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
21808 POSIX_C_SOURCE POSIX_SOURCE POWER
21809 PROTOTYPES PWB pyr QNX QK_USER R3000 REENTRANT RES Rhapsody RISC6000
21810 riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
21811 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
21812 sony sony_news sonyrisc sparc sparclite spectrum
21813 stardent stdc STDC_EXT stratos sun sun3 sun386
21814 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
21815 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
21816 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
21817 sysV68 sysV88 Tek4132 Tek4300 titan
21818 TM3200 TM5400 TM5600
21819 tower tower32 tower32_200 tower32_600 tower32_700
21820 tower32_800 tower32_850 tss
21821 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
21822 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
21823 unix UNIX95 UNIX99 unixpc unos
21824 USE_BSD USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE USE_LARGEFILE64
21825 USE_MISC USE_POSIX USE_POSIX199309 USE_POSIX199506 USE_POSIX2
21826 USE_REENTRANT USE_SVID USE_UNIX98 USE_XOPEN USE_XOPEN_EXTENDED
21828 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms x86_64 xenix Xenix286
21829 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
21830 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
21833 # Maybe put other stuff here too.
21834 cat <<EOSH >>Cppsym.know
21837 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
21838 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
21839 $cat Cppsym.know > Cppsym.c
21840 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
21841 $rm -f Cppsym.a Cppsym.b Cppsym.c
21842 cat <<EOSH > Cppsym
21844 if $test \$# -gt 0; then
21845 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
21846 if $test -s Cppsym.got; then
21853 $tr " " "$trnl" | ./Cppsym.try
21859 cat <<EOSH > Cppsym.try
21861 cat <<'EOCP' > try.c
21864 #define STRINGIFY(a) "a"
21866 #if cpp_stuff == 42
21867 #define StGiFy(a) #a
21868 #define STRINGIFY(a) StGiFy(a)
21870 #if $cpp_stuff != 1 && $cpp_stuff != 42
21871 # include "Bletch: How does this C preprocessor stringify macros?"
21877 cat <<'EOSH' >> Cppsym.try
21879 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
21880 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
21881 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
21882 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
21884 echo 'return 0;}' >> try.c
21886 cat <<EOSH >> Cppsym.try
21888 case "$osname-$gccversion" in
21889 irix-) ccflags="\$ccflags -woff 1178" ;;
21890 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
21892 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs && $run ./try | $sed 's/ /\\\\ /g'
21894 chmod +x Cppsym.try
21895 $eunicefix Cppsym.try
21896 ./Cppsym < Cppsym.know | $sort | $uniq > Cppsym.true
21897 : Add in any Linux cpp "predefined macros":
21898 case "$osname::$gccversion" in
21899 *linux*::*.*|*gnukfreebsd*::*.*|gnu::*.*)
21901 rm -f $tHdrH'.h' $tHdrH
21903 # Filter out macro arguments, such as Linux's __INT8_C(c)
21904 if $cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
21905 sed -e 's/#define[\ \ ]*//;s/[\ \ ].*$//' -e 's/(.*//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
21906 if [ -s $tHdrH'_cppsym.real' ]; then
21907 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
21910 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
21913 : now check the C compiler for additional symbols
21914 postprocess_cc_v=''
21916 aix) postprocess_cc_v="|$tr , ' '" ;;
21923 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
21926 -D*) echo "\$i" | $sed 's/^-D//';;
21927 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
21932 postprocess_cc_v=''
21935 ./ccsym > ccsym1.raw
21936 if $test -s ccsym1.raw; then
21937 $sort ccsym1.raw | $uniq >ccsym.raw
21939 mv ccsym1.raw ccsym.raw
21942 $awk '/\=/ { print $0; next }
21943 { print $0"=1" }' ccsym.raw >ccsym.list
21944 $comm -13 Cppsym.true ccsym.list >ccsym.own
21945 $comm -12 Cppsym.true ccsym.list >ccsym.com
21946 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
21948 if $test -z ccsym.raw; then
21949 echo "Your C compiler doesn't seem to define any symbols!" >&4
21951 echo "However, your C preprocessor defines the following symbols:"
21954 cppsymbols=`$cat Cppsym.true`
21955 cppsymbols=`echo $cppsymbols`
21956 cppccsymbols="$cppsymbols"
21958 if $test -s ccsym.com; then
21959 echo "Your C compiler and pre-processor define these symbols:"
21960 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
21963 cppccsymbols=`$cat ccsym.com`
21964 cppccsymbols=`echo $cppccsymbols`
21965 $test "$silent" || sleep 1
21967 if $test -s ccsym.cpp; then
21968 $test "$also" && echo " "
21969 echo "Your C pre-processor ${also}defines the following symbols:"
21970 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
21972 cppsymbols=`$cat ccsym.cpp`
21973 cppsymbols=`echo $cppsymbols`
21974 $test "$silent" || sleep 1
21976 if $test -s ccsym.own; then
21977 $test "$also" && echo " "
21978 echo "Your C compiler ${also}defines the following cpp symbols:"
21979 $sed -e 's/\(..*\)=1/\1/' ccsym.own
21980 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
21981 ccsymbols=`$cat ccsym.own`
21982 ccsymbols=`echo $ccsymbols`
21983 $test "$silent" || sleep 1
21987 : see if this is a termio system
21991 if $test `./findhdr termios.h`; then
21992 set tcsetattr i_termios
21998 "$define") echo "You have POSIX termios.h... good!" >&4;;
21999 *) if ./Cppsym pyr; then
22000 case "`/bin/universe`" in
22001 ucb) if $test `./findhdr sgtty.h`; then
22003 echo "<sgtty.h> found." >&4
22005 echo "System is pyramid with BSD universe."
22006 ./warn "<sgtty.h> not found--you could have problems."
22008 *) if $test `./findhdr termio.h`; then
22010 echo "<termio.h> found." >&4
22012 echo "System is pyramid with USG universe."
22013 ./warn "<termio.h> not found--you could have problems."
22017 if $test `./findhdr termio.h`; then
22018 echo "<termio.h> found." >&4
22020 elif $test `./findhdr sgtty.h`; then
22021 echo "<sgtty.h> found." >&4
22024 ./warn "Neither <termio.h> nor <sgtty.h> found--cross fingers!"
22027 if $test `./findhdr sgtty.h`; then
22028 echo "<sgtty.h> found." >&4
22030 elif $test `./findhdr termio.h`; then
22031 echo "<termio.h> found." >&4
22034 ./warn "Neither <sgtty.h> nor <termio.h> found--cross fingers!"
22038 set i_termio; eval $setvar
22039 val=$val2; set i_sgtty; eval $setvar
22040 val=$val3; set i_termios; eval $setvar
22042 : see if stdbool is available
22043 : we want a real compile instead of Inhdr because some Solaris systems
22044 : have stdbool.h, but it can only be used if the compiler indicates it
22045 : is sufficiently c99-compliant.
22049 #include <stdbool.h>
22054 int main(int argc, char **argv)
22060 if eval $compile; then
22061 echo "<stdbool.h> found." >&4
22064 echo "<stdbool.h> NOT found." >&4
22071 : see if stddef is available
22072 set stddef.h i_stddef
22075 : see if sys/access.h is available
22076 set sys/access.h i_sysaccess
22079 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
22080 set sys/filio.h i_sysfilio
22083 if $test `./findhdr sys/ioctl.h`; then
22085 echo '<sys/ioctl.h> found.' >&4
22088 if $test $i_sysfilio = "$define"; then
22089 echo '<sys/ioctl.h> NOT found.' >&4
22091 $test $i_sgtty = "$define" && xxx="sgtty.h"
22092 $test $i_termio = "$define" && xxx="termio.h"
22093 $test $i_termios = "$define" && xxx="termios.h"
22094 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
22100 : see if socket ioctl defs are in sys/sockio.h
22102 xxx=`./findhdr sys/sockio.h`
22103 if $test "$xxx"; then
22104 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
22106 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
22109 echo "No socket ioctls found in <sys/sockio.h>." >&4
22114 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
22120 : see if this is a syslog.h system
22121 set syslog.h i_syslog
22124 : see if this is a sys/mode.h system
22125 set sys/mode.h i_sysmode
22128 : see if there is a sys/poll.h file
22129 set sys/poll.h i_syspoll
22132 : see if sys/resource.h has to be included
22133 set sys/resource.h i_sysresrc
22136 : see if sys/security.h is available
22137 set sys/security.h i_syssecrt
22140 : see if this is a sys/statvfs.h system
22141 set sys/statvfs.h i_sysstatvfs
22144 : see if this is a sys/un.h system
22145 set sys/un.h i_sysun
22148 : see if this is a sys/utsname.h system
22149 set sys/utsname.h i_sysutsname
22152 : see if this is a syswait system
22153 set sys/wait.h i_syswait
22156 : see if this is a ustat.h system
22157 set ustat.h i_ustat
22160 : see if this is an utime system
22161 set utime.h i_utime
22164 : see if this is a vfork system
22167 set vfork.h i_vfork
22177 echo "Looking for extensions..." >&4
22178 : If we are using the old config.sh, nonxs_extensions and xs_extensions may
22179 : contain old or inaccurate or duplicate values.
22180 nonxs_extensions=''
22182 : We do not use find because it might not be available.
22183 : We do not just use MANIFEST because the user may have dropped
22184 : some additional extensions into the source tree and expect them
22187 : Function to recursively find available extensions, ignoring DynaLoader
22188 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
22189 : In 5.10.1 and later, extensions are stored in directories
22190 : like File-Glob instead of the older File/Glob/.
22194 DynaLoader|dynaload) ;;
22196 this_ext=`echo $xxx | $sed -e s/-/\\\//g`;
22197 case "$this_ext" in
22198 Scalar/List/Utils) this_ext="List/Util";;
22199 PathTools) this_ext="Cwd";;
22201 echo " $xs_extensions $nonxs_extensions" > $$.tmp;
22202 if $contains " $this_ext " $$.tmp; then
22204 echo "Duplicate directories detected for extension $xxx" >&4;
22205 echo "Configure cannot correctly recover from this - shall I abort?" >&4;
22206 case "$knowitall" in
22214 echo "Ok. Stopping Configure." >&4;
22215 echo "Please remove the duplicate directory (e.g. using git clean) and then re-run Configure" >&4;
22218 echo "Ok. You will need to correct config.sh before running make." >&4;
22220 $ls -1 $xxx > $$.tmp;
22221 if $contains "\.xs$" $$.tmp > /dev/null 2>&1; then
22222 xs_extensions="$xs_extensions $this_ext";
22223 elif $contains "\.c$" $$.tmp > /dev/null 2>&1; then
22224 xs_extensions="$xs_extensions $this_ext";
22225 elif $test -d $xxx; then
22226 nonxs_extensions="$nonxs_extensions $this_ext";
22236 eval $find_extensions
22240 eval $find_extensions
22244 eval $find_extensions
22245 set X $xs_extensions
22247 xs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
22248 set X $nonxs_extensions
22250 nonxs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
22252 known_extensions=`echo $nonxs_extensions $xs_extensions | tr ' ' $trnl | $sort | tr $trnl ' '`
22254 : Now see which are supported on this system.
22256 for xxx in $xs_extensions ; do
22260 $define) avail_ext="$avail_ext $xxx" ;;
22263 GDBM_File|gdbm_fil)
22265 $define) avail_ext="$avail_ext $xxx" ;;
22268 I18N/Langinfo|i18n_lan)
22269 case "$i_langinfo$d_nl_langinfo" in
22270 $define$define) avail_ext="$avail_ext $xxx" ;;
22274 : XXX Do we need a useipcsysv variable here
22275 case "${d_msg}${d_sem}${d_shm}" in
22276 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
22279 NDBM_File|ndbm_fil)
22282 case "$osname-$use64bitint" in
22285 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
22288 *) avail_ext="$avail_ext $xxx" ;;
22293 ODBM_File|odbm_fil)
22294 case "${i_dbm}${i_rpcsvcdbm}" in
22296 case "$d_cplusplus" in
22297 define) ;; # delete as a function name will not work
22298 *) case "$osname-$use64bitint" in
22301 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
22304 *) avail_ext="$avail_ext $xxx" ;;
22312 case "$useopcode" in
22313 true|define|y) avail_ext="$avail_ext $xxx" ;;
22317 case "$useposix" in
22318 true|define|y) avail_ext="$avail_ext $xxx" ;;
22322 case "$d_socket" in
22323 true|$define|y) avail_ext="$avail_ext $xxx" ;;
22326 Sys/Syslog|sys/syslog)
22327 : XXX syslog requires socket
22328 case "$d_socket" in
22329 true|$define|y) avail_ext="$avail_ext $xxx" ;;
22333 case "$usethreads" in
22335 case "$use5005threads" in
22336 $define|true|[yY]*) avail_ext="$avail_ext $xxx" ;;
22340 threads|threads/shared)
22341 # threads and threads::shared are special cases.
22342 # To stop people from asking "Perl 5.8.0 was supposed
22343 # to have this new fancy threads implementation but my
22344 # perl doesn't have it" and from people trying to
22345 # (re)install the threads module using CPAN.pm and
22346 # CPAN.pm then offering to reinstall Perl 5.8.0,
22347 # the threads.pm and threads/shared.pm will always be
22348 # there, croaking informatively ("you need to rebuild
22349 # all of Perl with threads, sorry") when threads haven't
22350 # been compiled in.
22352 avail_ext="$avail_ext $xxx"
22358 cygwin) avail_ext="$avail_ext $xxx" ;;
22361 XS/APItest|xs/apitest)
22362 # This is just for testing. Skip it unless we have dynamic loading.
22365 $define) avail_ext="$avail_ext $xxx" ;;
22368 XS/Typemap|xs/typemap)
22369 # This is just for testing. Skip it unless we have dynamic loading.
22371 $define) avail_ext="$avail_ext $xxx" ;;
22374 *) avail_ext="$avail_ext $xxx"
22383 case "$onlyextensions" in
22385 *) keepextensions=''
22386 echo "You have requested that only certain extensions be included..." >&4
22387 for i in $onlyextensions; do
22388 case " $avail_ext " in
22390 echo "Keeping extension $i."
22391 keepextensions="$keepextensions $i"
22393 *) echo "Ignoring extension $i." ;;
22396 avail_ext="$keepextensions"
22400 case "$noextensions" in
22402 *) keepextensions=''
22403 echo "You have requested that certain extensions be ignored..." >&4
22404 for i in $avail_ext; do
22405 case " $noextensions " in
22406 *" $i "*) echo "Ignoring extension $i." ;;
22407 *) echo "Keeping extension $i.";
22408 keepextensions="$keepextensions $i"
22412 avail_ext="$keepextensions"
22416 : Now see which nonxs extensions are supported on this system.
22417 : For now assume all are.
22419 for xxx in $nonxs_extensions ; do
22423 *) nonxs_ext="$nonxs_ext $xxx"
22435 A number of extensions are supplied with $package. You may choose to
22436 compile these extensions for dynamic loading (the default), compile
22437 them into the $package executable (static loading), or not include
22438 them at all. Answer "none" to include no extensions.
22439 Note that DynaLoader is always built and need not be mentioned here.
22442 case "$dynamic_ext" in
22444 : Exclude those listed in static_ext
22446 for xxx in $avail_ext; do
22447 case " $static_ext " in
22449 *) dflt="$dflt $xxx" ;;
22456 *) dflt="$dynamic_ext"
22457 # Perhaps we are reusing an old out-of-date config.sh.
22460 if test X"$dynamic_ext" != X"$avail_ext"; then
22462 NOTICE: Your previous config.sh list may be incorrect.
22463 The extensions now available to you are
22465 but the default list from your previous config.sh is
22477 rp="What extensions do you wish to load dynamically?"
22480 none) dynamic_ext=' ' ;;
22481 *) dynamic_ext="$ans" ;;
22484 case "$static_ext" in
22486 : Exclude those already listed in dynamic linking
22488 for xxx in $avail_ext; do
22489 case " $dynamic_ext " in
22491 *) dflt="$dflt $xxx" ;;
22498 *) dflt="$static_ext"
22505 rp="What extensions do you wish to load statically?"
22508 none) static_ext=' ' ;;
22509 *) static_ext="$ans" ;;
22514 A number of extensions are supplied with $package. Answer "none"
22515 to include no extensions.
22516 Note that DynaLoader is always built and need not be mentioned here.
22519 case "$static_ext" in
22520 '') dflt="$avail_ext" ;;
22521 *) dflt="$static_ext"
22522 # Perhaps we are reusing an old out-of-date config.sh.
22525 if test X"$static_ext" != X"$avail_ext"; then
22527 NOTICE: Your previous config.sh list may be incorrect.
22528 The extensions now available to you are
22530 but the default list from your previous config.sh is
22539 : Exclude those that are not xs extensions
22543 rp="What extensions do you wish to include?"
22546 none) static_ext=' ' ;;
22547 *) static_ext="$ans" ;;
22552 # Encode is a special case. If we are building Encode as a static
22553 # extension, we need to explicitly list its subextensions as well.
22554 # For other nested extensions, this is handled automatically by
22555 # the appropriate Makefile.PL.
22556 case " $static_ext " in
22557 *" Encode "*) # Add the subextensions of Encode
22559 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
22560 static_ext="$static_ext Encode/$xxx"
22561 known_extensions="$known_extensions Encode/$xxx"
22567 set X $dynamic_ext $static_ext $nonxs_ext
22571 # Sanity check: We require an extension suitable for use with
22572 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
22573 # should show up as failures in the test suite, but it's helpful to
22574 # catch them now.) The 'extensions' list is normally sorted
22575 # alphabetically, so we need to accept either
22576 # DB_File ... Fcntl ... IO ....
22577 # or something like
22578 # Fcntl ... NDBM_File ... IO ....
22579 case " $extensions" in
22580 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
22581 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
22582 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
22583 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
22584 echo "WARNING: The Perl you are building will be quite crippled." >& 4
22588 : Remove libraries needed only for extensions
22589 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
22590 : The exception is SunOS 4.x, which needs them.
22591 case "${osname}X${osvers}" in
22595 *) case "$usedl" in
22596 $define|true|[yY]*)
22597 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -lgdbm_compat @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
22601 *) perllibs="$libs"
22607 : Remove build directory name from cppstdin so it can be used from
22608 : either the present location or the final installed location.
22610 : Get out of the UU directory to get correct path name.
22612 case "$cppstdin" in
22614 echo "Stripping down cppstdin path name"
22620 : end of configuration questions
22622 echo "End of configuration questions."
22625 : back to where it started
22626 if test -d ../UU; then
22630 : configuration may be unconditionally patched via a 'config.arch' file
22631 if $test -f config.arch; then
22632 echo "I see a config.arch file, loading it." >&4
22636 : configuration may be patched via a 'config.over' file
22637 if $test -f config.over; then
22640 rp='I see a config.over file. Do you wish to load it?'
22643 n*) echo "OK, I'll ignore it.";;
22645 echo "Configuration override changes have been loaded."
22650 : in case they want portability, strip down executable paths
22651 case "$d_portable" in
22654 echo "Stripping down executable paths..." >&4
22655 for file in $loclist $trylist; do
22657 eval $file=`basename $temp`
22662 : create config.sh file
22664 echo "Creating config.sh..." >&4
22665 $spitshell <<EOT >config.sh
22668 # This file was produced by running the Configure script. It holds all the
22669 # definitions figured out by Configure. Should you modify one of these values,
22670 # do not forget to propagate your changes by running "Configure -der". You may
22671 # instead choose to run each of the .SH files by yourself, or "Configure -S".
22674 # Package name : $package
22675 # Source directory : $src
22676 # Configuration time: $cf_time
22677 # Configured by : $cf_by
22678 # Target system : $myuname
22681 : Add in command line options if available
22682 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
22684 $spitshell <<EOT >>config.sh
22693 Revision='$Revision'
22701 alignbytes='$alignbytes'
22702 ansi2knr='$ansi2knr'
22703 aphostname='$aphostname'
22704 api_revision='$api_revision'
22705 api_subversion='$api_subversion'
22706 api_version='$api_version'
22707 api_versionstring='$api_versionstring'
22710 archlibexp='$archlibexp'
22711 archname64='$archname64'
22712 archname='$archname'
22713 archobjs='$archobjs'
22714 asctime_r_proto='$asctime_r_proto'
22722 bootstrap_charset='$bootstrap_charset'
22724 byteorder='$byteorder'
22726 castflags='$castflags'
22729 cccdlflags='$cccdlflags'
22730 ccdlflags='$ccdlflags'
22732 ccflags_uselargefiles='$ccflags_uselargefiles'
22734 ccsymbols='$ccsymbols'
22735 ccversion='$ccversion'
22737 cf_email='$cf_email'
22739 charbits='$charbits'
22740 charsize='$charsize'
22744 clocktype='$clocktype'
22746 compress='$compress'
22747 contains='$contains'
22751 cpp_stuff='$cpp_stuff'
22752 cppccsymbols='$cppccsymbols'
22753 cppflags='$cppflags'
22755 cppminus='$cppminus'
22757 cppstdin='$cppstdin'
22758 cppsymbols='$cppsymbols'
22759 crypt_r_proto='$crypt_r_proto'
22760 cryptlib='$cryptlib'
22762 ctermid_r_proto='$ctermid_r_proto'
22763 ctime_r_proto='$ctime_r_proto'
22764 d_Gconvert='$d_Gconvert'
22765 d_PRIEUldbl='$d_PRIEUldbl'
22766 d_PRIFUldbl='$d_PRIFUldbl'
22767 d_PRIGUldbl='$d_PRIGUldbl'
22768 d_PRIXU64='$d_PRIXU64'
22769 d_PRId64='$d_PRId64'
22770 d_PRIeldbl='$d_PRIeldbl'
22771 d_PRIfldbl='$d_PRIfldbl'
22772 d_PRIgldbl='$d_PRIgldbl'
22773 d_PRIi64='$d_PRIi64'
22774 d_PRIo64='$d_PRIo64'
22775 d_PRIu64='$d_PRIu64'
22776 d_PRIx64='$d_PRIx64'
22777 d_SCNfldbl='$d_SCNfldbl'
22778 d__fwalk='$d__fwalk'
22779 d_access='$d_access'
22780 d_accessx='$d_accessx'
22783 d_archlib='$d_archlib'
22784 d_asctime64='$d_asctime64'
22785 d_asctime_r='$d_asctime_r'
22788 d_attribute_deprecated='$d_attribute_deprecated'
22789 d_attribute_format='$d_attribute_format'
22790 d_attribute_malloc='$d_attribute_malloc'
22791 d_attribute_nonnull='$d_attribute_nonnull'
22792 d_attribute_noreturn='$d_attribute_noreturn'
22793 d_attribute_pure='$d_attribute_pure'
22794 d_attribute_unused='$d_attribute_unused'
22795 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
22799 d_bsdgetpgrp='$d_bsdgetpgrp'
22800 d_bsdsetpgrp='$d_bsdsetpgrp'
22801 d_builtin_choose_expr='$d_builtin_choose_expr'
22802 d_builtin_expect='$d_builtin_expect'
22804 d_c99_variadic_macros='$d_c99_variadic_macros'
22805 d_casti32='$d_casti32'
22806 d_castneg='$d_castneg'
22807 d_charvspr='$d_charvspr'
22809 d_chroot='$d_chroot'
22810 d_chsize='$d_chsize'
22812 d_clearenv='$d_clearenv'
22813 d_closedir='$d_closedir'
22814 d_cmsghdr_s='$d_cmsghdr_s'
22816 d_copysignl='$d_copysignl'
22817 d_cplusplus='$d_cplusplus'
22819 d_crypt_r='$d_crypt_r'
22821 d_ctermid='$d_ctermid'
22822 d_ctermid_r='$d_ctermid_r'
22823 d_ctime64='$d_ctime64'
22824 d_ctime_r='$d_ctime_r'
22825 d_cuserid='$d_cuserid'
22826 d_dbl_dig='$d_dbl_dig'
22827 d_dbminitproto='$d_dbminitproto'
22828 d_difftime64='$d_difftime64'
22829 d_difftime='$d_difftime'
22830 d_dir_dd_fd='$d_dir_dd_fd'
22832 d_dirnamlen='$d_dirnamlen'
22833 d_dlerror='$d_dlerror'
22834 d_dlopen='$d_dlopen'
22835 d_dlsymun='$d_dlsymun'
22836 d_dosuid='$d_dosuid'
22837 d_drand48_r='$d_drand48_r'
22838 d_drand48proto='$d_drand48proto'
22840 d_eaccess='$d_eaccess'
22841 d_endgrent='$d_endgrent'
22842 d_endgrent_r='$d_endgrent_r'
22843 d_endhent='$d_endhent'
22844 d_endhostent_r='$d_endhostent_r'
22845 d_endnent='$d_endnent'
22846 d_endnetent_r='$d_endnetent_r'
22847 d_endpent='$d_endpent'
22848 d_endprotoent_r='$d_endprotoent_r'
22849 d_endpwent='$d_endpwent'
22850 d_endpwent_r='$d_endpwent_r'
22851 d_endsent='$d_endsent'
22852 d_endservent_r='$d_endservent_r'
22853 d_eofnblk='$d_eofnblk'
22854 d_eunice='$d_eunice'
22855 d_faststdio='$d_faststdio'
22856 d_fchdir='$d_fchdir'
22857 d_fchmod='$d_fchmod'
22858 d_fchown='$d_fchown'
22860 d_fcntl_can_lock='$d_fcntl_can_lock'
22861 d_fd_macros='$d_fd_macros'
22862 d_fd_set='$d_fd_set'
22863 d_fds_bits='$d_fds_bits'
22864 d_fgetpos='$d_fgetpos'
22865 d_finite='$d_finite'
22866 d_finitel='$d_finitel'
22867 d_flexfnam='$d_flexfnam'
22869 d_flockproto='$d_flockproto'
22871 d_fp_class='$d_fp_class'
22872 d_fpathconf='$d_fpathconf'
22873 d_fpclass='$d_fpclass'
22874 d_fpclassify='$d_fpclassify'
22875 d_fpclassl='$d_fpclassl'
22876 d_fpos64_t='$d_fpos64_t'
22877 d_frexpl='$d_frexpl'
22878 d_fs_data_s='$d_fs_data_s'
22879 d_fseeko='$d_fseeko'
22880 d_fsetpos='$d_fsetpos'
22881 d_fstatfs='$d_fstatfs'
22882 d_fstatvfs='$d_fstatvfs'
22884 d_ftello='$d_ftello'
22886 d_futimes='$d_futimes'
22887 d_gdbm_ndbm_h_uses_prototypes='$d_gdbm_ndbm_h_uses_prototypes'
22888 d_gdbmndbm_h_uses_prototypes='$d_gdbmndbm_h_uses_prototypes'
22889 d_getaddrinfo='$d_getaddrinfo'
22890 d_getcwd='$d_getcwd'
22891 d_getespwnam='$d_getespwnam'
22892 d_getfsstat='$d_getfsstat'
22893 d_getgrent='$d_getgrent'
22894 d_getgrent_r='$d_getgrent_r'
22895 d_getgrgid_r='$d_getgrgid_r'
22896 d_getgrnam_r='$d_getgrnam_r'
22897 d_getgrps='$d_getgrps'
22898 d_gethbyaddr='$d_gethbyaddr'
22899 d_gethbyname='$d_gethbyname'
22900 d_gethent='$d_gethent'
22901 d_gethname='$d_gethname'
22902 d_gethostbyaddr_r='$d_gethostbyaddr_r'
22903 d_gethostbyname_r='$d_gethostbyname_r'
22904 d_gethostent_r='$d_gethostent_r'
22905 d_gethostprotos='$d_gethostprotos'
22906 d_getitimer='$d_getitimer'
22907 d_getlogin='$d_getlogin'
22908 d_getlogin_r='$d_getlogin_r'
22909 d_getmnt='$d_getmnt'
22910 d_getmntent='$d_getmntent'
22911 d_getnameinfo='$d_getnameinfo'
22912 d_getnbyaddr='$d_getnbyaddr'
22913 d_getnbyname='$d_getnbyname'
22914 d_getnent='$d_getnent'
22915 d_getnetbyaddr_r='$d_getnetbyaddr_r'
22916 d_getnetbyname_r='$d_getnetbyname_r'
22917 d_getnetent_r='$d_getnetent_r'
22918 d_getnetprotos='$d_getnetprotos'
22919 d_getpagsz='$d_getpagsz'
22920 d_getpbyname='$d_getpbyname'
22921 d_getpbynumber='$d_getpbynumber'
22922 d_getpent='$d_getpent'
22923 d_getpgid='$d_getpgid'
22924 d_getpgrp2='$d_getpgrp2'
22925 d_getpgrp='$d_getpgrp'
22926 d_getppid='$d_getppid'
22927 d_getprior='$d_getprior'
22928 d_getprotobyname_r='$d_getprotobyname_r'
22929 d_getprotobynumber_r='$d_getprotobynumber_r'
22930 d_getprotoent_r='$d_getprotoent_r'
22931 d_getprotoprotos='$d_getprotoprotos'
22932 d_getprpwnam='$d_getprpwnam'
22933 d_getpwent='$d_getpwent'
22934 d_getpwent_r='$d_getpwent_r'
22935 d_getpwnam_r='$d_getpwnam_r'
22936 d_getpwuid_r='$d_getpwuid_r'
22937 d_getsbyname='$d_getsbyname'
22938 d_getsbyport='$d_getsbyport'
22939 d_getsent='$d_getsent'
22940 d_getservbyname_r='$d_getservbyname_r'
22941 d_getservbyport_r='$d_getservbyport_r'
22942 d_getservent_r='$d_getservent_r'
22943 d_getservprotos='$d_getservprotos'
22944 d_getspnam='$d_getspnam'
22945 d_getspnam_r='$d_getspnam_r'
22946 d_gettimeod='$d_gettimeod'
22947 d_gmtime64='$d_gmtime64'
22948 d_gmtime_r='$d_gmtime_r'
22949 d_gnulibc='$d_gnulibc'
22950 d_grpasswd='$d_grpasswd'
22951 d_hasmntopt='$d_hasmntopt'
22953 d_ilogbl='$d_ilogbl'
22954 d_inc_version_list='$d_inc_version_list'
22956 d_inetaton='$d_inetaton'
22957 d_inetntop='$d_inetntop'
22958 d_inetpton='$d_inetpton'
22959 d_int64_t='$d_int64_t'
22960 d_ip_mreq='$d_ip_mreq'
22961 d_ip_mreq_source='$d_ip_mreq_source'
22962 d_ipv6_mreq='$d_ipv6_mreq'
22963 d_ipv6_mreq_source='$d_ipv6_mreq_source'
22964 d_isascii='$d_isascii'
22965 d_isblank='$d_isblank'
22966 d_isfinite='$d_isfinite'
22969 d_isnanl='$d_isnanl'
22970 d_killpg='$d_killpg'
22971 d_lchown='$d_lchown'
22972 d_ldbl_dig='$d_ldbl_dig'
22973 d_libm_lib_version='$d_libm_lib_version'
22975 d_localtime64='$d_localtime64'
22976 d_localtime_r='$d_localtime_r'
22977 d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset'
22978 d_locconv='$d_locconv'
22980 d_longdbl='$d_longdbl'
22981 d_longlong='$d_longlong'
22982 d_lseekproto='$d_lseekproto'
22984 d_madvise='$d_madvise'
22985 d_malloc_good_size='$d_malloc_good_size'
22986 d_malloc_size='$d_malloc_size'
22988 d_mbstowcs='$d_mbstowcs'
22989 d_mbtowc='$d_mbtowc'
22990 d_memchr='$d_memchr'
22991 d_memcmp='$d_memcmp'
22992 d_memcpy='$d_memcpy'
22993 d_memmove='$d_memmove'
22994 d_memset='$d_memset'
22996 d_mkdtemp='$d_mkdtemp'
22997 d_mkfifo='$d_mkfifo'
22998 d_mkstemp='$d_mkstemp'
22999 d_mkstemps='$d_mkstemps'
23000 d_mktime64='$d_mktime64'
23001 d_mktime='$d_mktime'
23004 d_modfl_pow32_bug='$d_modfl_pow32_bug'
23005 d_modflproto='$d_modflproto'
23006 d_mprotect='$d_mprotect'
23008 d_msg_ctrunc='$d_msg_ctrunc'
23009 d_msg_dontroute='$d_msg_dontroute'
23010 d_msg_oob='$d_msg_oob'
23011 d_msg_peek='$d_msg_peek'
23012 d_msg_proxy='$d_msg_proxy'
23013 d_msgctl='$d_msgctl'
23014 d_msgget='$d_msgget'
23015 d_msghdr_s='$d_msghdr_s'
23016 d_msgrcv='$d_msgrcv'
23017 d_msgsnd='$d_msgsnd'
23019 d_munmap='$d_munmap'
23020 d_mymalloc='$d_mymalloc'
23022 d_ndbm_h_uses_prototypes='$d_ndbm_h_uses_prototypes'
23024 d_nl_langinfo='$d_nl_langinfo'
23025 d_nv_preserves_uv='$d_nv_preserves_uv'
23026 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
23027 d_off64_t='$d_off64_t'
23028 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
23029 d_oldpthreads='$d_oldpthreads'
23030 d_oldsock='$d_oldsock'
23032 d_pathconf='$d_pathconf'
23034 d_perl_otherlibdirs='$d_perl_otherlibdirs'
23035 d_phostname='$d_phostname'
23038 d_portable='$d_portable'
23040 d_prctl_set_name='$d_prctl_set_name'
23041 d_printf_format_null='$d_printf_format_null'
23042 d_procselfexe='$d_procselfexe'
23043 d_pseudofork='$d_pseudofork'
23044 d_pthread_atfork='$d_pthread_atfork'
23045 d_pthread_attr_setscope='$d_pthread_attr_setscope'
23046 d_pthread_yield='$d_pthread_yield'
23048 d_pwchange='$d_pwchange'
23049 d_pwclass='$d_pwclass'
23050 d_pwcomment='$d_pwcomment'
23051 d_pwexpire='$d_pwexpire'
23052 d_pwgecos='$d_pwgecos'
23053 d_pwpasswd='$d_pwpasswd'
23054 d_pwquota='$d_pwquota'
23057 d_random_r='$d_random_r'
23058 d_readdir64_r='$d_readdir64_r'
23059 d_readdir='$d_readdir'
23060 d_readdir_r='$d_readdir_r'
23061 d_readlink='$d_readlink'
23063 d_recvmsg='$d_recvmsg'
23064 d_rename='$d_rename'
23065 d_rewinddir='$d_rewinddir'
23067 d_safebcpy='$d_safebcpy'
23068 d_safemcpy='$d_safemcpy'
23069 d_sanemcmp='$d_sanemcmp'
23070 d_sbrkproto='$d_sbrkproto'
23071 d_scalbnl='$d_scalbnl'
23072 d_sched_yield='$d_sched_yield'
23073 d_scm_rights='$d_scm_rights'
23074 d_seekdir='$d_seekdir'
23075 d_select='$d_select'
23077 d_semctl='$d_semctl'
23078 d_semctl_semid_ds='$d_semctl_semid_ds'
23079 d_semctl_semun='$d_semctl_semun'
23080 d_semget='$d_semget'
23082 d_sendmsg='$d_sendmsg'
23083 d_setegid='$d_setegid'
23084 d_seteuid='$d_seteuid'
23085 d_setgrent='$d_setgrent'
23086 d_setgrent_r='$d_setgrent_r'
23087 d_setgrps='$d_setgrps'
23088 d_sethent='$d_sethent'
23089 d_sethostent_r='$d_sethostent_r'
23090 d_setitimer='$d_setitimer'
23091 d_setlinebuf='$d_setlinebuf'
23092 d_setlocale='$d_setlocale'
23093 d_setlocale_r='$d_setlocale_r'
23094 d_setnent='$d_setnent'
23095 d_setnetent_r='$d_setnetent_r'
23096 d_setpent='$d_setpent'
23097 d_setpgid='$d_setpgid'
23098 d_setpgrp2='$d_setpgrp2'
23099 d_setpgrp='$d_setpgrp'
23100 d_setprior='$d_setprior'
23101 d_setproctitle='$d_setproctitle'
23102 d_setprotoent_r='$d_setprotoent_r'
23103 d_setpwent='$d_setpwent'
23104 d_setpwent_r='$d_setpwent_r'
23105 d_setregid='$d_setregid'
23106 d_setresgid='$d_setresgid'
23107 d_setresuid='$d_setresuid'
23108 d_setreuid='$d_setreuid'
23109 d_setrgid='$d_setrgid'
23110 d_setruid='$d_setruid'
23111 d_setsent='$d_setsent'
23112 d_setservent_r='$d_setservent_r'
23113 d_setsid='$d_setsid'
23114 d_setvbuf='$d_setvbuf'
23118 d_shmatprototype='$d_shmatprototype'
23119 d_shmctl='$d_shmctl'
23121 d_shmget='$d_shmget'
23122 d_sigaction='$d_sigaction'
23123 d_signbit='$d_signbit'
23124 d_sigprocmask='$d_sigprocmask'
23125 d_sigsetjmp='$d_sigsetjmp'
23126 d_sin6_scope_id='$d_sin6_scope_id'
23127 d_sitearch='$d_sitearch'
23128 d_snprintf='$d_snprintf'
23129 d_sockaddr_in6='$d_sockaddr_in6'
23130 d_sockaddr_sa_len='$d_sockaddr_sa_len'
23131 d_sockatmark='$d_sockatmark'
23132 d_sockatmarkproto='$d_sockatmarkproto'
23133 d_socket='$d_socket'
23134 d_socklen_t='$d_socklen_t'
23135 d_sockpair='$d_sockpair'
23136 d_socks5_init='$d_socks5_init'
23137 d_sprintf_returns_strlen='$d_sprintf_returns_strlen'
23139 d_srand48_r='$d_srand48_r'
23140 d_srandom_r='$d_srandom_r'
23141 d_sresgproto='$d_sresgproto'
23142 d_sresuproto='$d_sresuproto'
23143 d_statblks='$d_statblks'
23144 d_statfs_f_flags='$d_statfs_f_flags'
23145 d_statfs_s='$d_statfs_s'
23146 d_static_inline='$d_static_inline'
23147 d_statvfs='$d_statvfs'
23148 d_stdio_cnt_lval='$d_stdio_cnt_lval'
23149 d_stdio_ptr_lval='$d_stdio_ptr_lval'
23150 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
23151 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
23152 d_stdio_stream_array='$d_stdio_stream_array'
23153 d_stdiobase='$d_stdiobase'
23154 d_stdstdio='$d_stdstdio'
23155 d_strchr='$d_strchr'
23156 d_strcoll='$d_strcoll'
23157 d_strctcpy='$d_strctcpy'
23158 d_strerrm='$d_strerrm'
23159 d_strerror='$d_strerror'
23160 d_strerror_r='$d_strerror_r'
23161 d_strftime='$d_strftime'
23162 d_strlcat='$d_strlcat'
23163 d_strlcpy='$d_strlcpy'
23164 d_strtod='$d_strtod'
23165 d_strtol='$d_strtol'
23166 d_strtold='$d_strtold'
23167 d_strtoll='$d_strtoll'
23168 d_strtoq='$d_strtoq'
23169 d_strtoul='$d_strtoul'
23170 d_strtoull='$d_strtoull'
23171 d_strtouq='$d_strtouq'
23172 d_strxfrm='$d_strxfrm'
23173 d_suidsafe='$d_suidsafe'
23174 d_symlink='$d_symlink'
23175 d_syscall='$d_syscall'
23176 d_syscallproto='$d_syscallproto'
23177 d_sysconf='$d_sysconf'
23178 d_sysernlst='$d_sysernlst'
23179 d_syserrlst='$d_syserrlst'
23180 d_system='$d_system'
23181 d_tcgetpgrp='$d_tcgetpgrp'
23182 d_tcsetpgrp='$d_tcsetpgrp'
23183 d_telldir='$d_telldir'
23184 d_telldirproto='$d_telldirproto'
23186 d_timegm='$d_timegm'
23188 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
23189 d_tm_tm_zone='$d_tm_tm_zone'
23190 d_tmpnam_r='$d_tmpnam_r'
23191 d_truncate='$d_truncate'
23192 d_ttyname_r='$d_ttyname_r'
23193 d_tzname='$d_tzname'
23194 d_u32align='$d_u32align'
23195 d_ualarm='$d_ualarm'
23198 d_union_semun='$d_union_semun'
23199 d_unordered='$d_unordered'
23200 d_unsetenv='$d_unsetenv'
23201 d_usleep='$d_usleep'
23202 d_usleepproto='$d_usleepproto'
23204 d_vendorarch='$d_vendorarch'
23205 d_vendorbin='$d_vendorbin'
23206 d_vendorlib='$d_vendorlib'
23207 d_vendorscript='$d_vendorscript'
23209 d_void_closedir='$d_void_closedir'
23210 d_voidsig='$d_voidsig'
23211 d_voidtty='$d_voidtty'
23212 d_volatile='$d_volatile'
23213 d_vprintf='$d_vprintf'
23214 d_vsnprintf='$d_vsnprintf'
23216 d_waitpid='$d_waitpid'
23217 d_wcstombs='$d_wcstombs'
23218 d_wctomb='$d_wctomb'
23219 d_writev='$d_writev'
23222 db_hashtype='$db_hashtype'
23223 db_prefixtype='$db_prefixtype'
23224 db_version_major='$db_version_major'
23225 db_version_minor='$db_version_minor'
23226 db_version_patch='$db_version_patch'
23227 direntrytype='$direntrytype'
23230 doublesize='$doublesize'
23232 drand48_r_proto='$drand48_r_proto'
23234 dynamic_ext='$dynamic_ext'
23240 endgrent_r_proto='$endgrent_r_proto'
23241 endhostent_r_proto='$endhostent_r_proto'
23242 endnetent_r_proto='$endnetent_r_proto'
23243 endprotoent_r_proto='$endprotoent_r_proto'
23244 endpwent_r_proto='$endpwent_r_proto'
23245 endservent_r_proto='$endservent_r_proto'
23246 eunicefix='$eunicefix'
23249 extensions='$extensions'
23250 extern_C='$extern_C'
23252 fflushNULL='$fflushNULL'
23253 fflushall='$fflushall'
23255 firstmakefile='$firstmakefile'
23257 fpossize='$fpossize'
23258 fpostype='$fpostype'
23259 freetype='$freetype'
23262 full_csh='$full_csh'
23263 full_sed='$full_sed'
23264 gccansipedantic='$gccansipedantic'
23265 gccosandvers='$gccosandvers'
23266 gccversion='$gccversion'
23267 getgrent_r_proto='$getgrent_r_proto'
23268 getgrgid_r_proto='$getgrgid_r_proto'
23269 getgrnam_r_proto='$getgrnam_r_proto'
23270 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
23271 gethostbyname_r_proto='$gethostbyname_r_proto'
23272 gethostent_r_proto='$gethostent_r_proto'
23273 getlogin_r_proto='$getlogin_r_proto'
23274 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
23275 getnetbyname_r_proto='$getnetbyname_r_proto'
23276 getnetent_r_proto='$getnetent_r_proto'
23277 getprotobyname_r_proto='$getprotobyname_r_proto'
23278 getprotobynumber_r_proto='$getprotobynumber_r_proto'
23279 getprotoent_r_proto='$getprotoent_r_proto'
23280 getpwent_r_proto='$getpwent_r_proto'
23281 getpwnam_r_proto='$getpwnam_r_proto'
23282 getpwuid_r_proto='$getpwuid_r_proto'
23283 getservbyname_r_proto='$getservbyname_r_proto'
23284 getservbyport_r_proto='$getservbyport_r_proto'
23285 getservent_r_proto='$getservent_r_proto'
23286 getspnam_r_proto='$getspnam_r_proto'
23287 gidformat='$gidformat'
23293 gmtime_r_proto='$gmtime_r_proto'
23294 gnulibc_version='$gnulibc_version'
23296 groupcat='$groupcat'
23297 groupstype='$groupstype'
23300 h_sysfile='$h_sysfile'
23303 html1dir='$html1dir'
23304 html1direxp='$html1direxp'
23305 html3dir='$html3dir'
23306 html3direxp='$html3direxp'
23315 i_arpainet='$i_arpainet'
23316 i_assert='$i_assert'
23317 i_bsdioctl='$i_bsdioctl'
23321 i_dirent='$i_dirent'
23326 i_fp_class='$i_fp_class'
23328 i_gdbm_ndbm='$i_gdbm_ndbm'
23329 i_gdbmndbm='$i_gdbmndbm'
23331 i_ieeefp='$i_ieeefp'
23332 i_inttypes='$i_inttypes'
23333 i_langinfo='$i_langinfo'
23334 i_libutil='$i_libutil'
23335 i_limits='$i_limits'
23336 i_locale='$i_locale'
23337 i_machcthr='$i_machcthr'
23338 i_malloc='$i_malloc'
23339 i_mallocmalloc='$i_mallocmalloc'
23341 i_memory='$i_memory'
23342 i_mntent='$i_mntent'
23345 i_neterrno='$i_neterrno'
23346 i_netinettcp='$i_netinettcp'
23350 i_pthread='$i_pthread'
23352 i_rpcsvcdbm='$i_rpcsvcdbm'
23355 i_shadow='$i_shadow'
23357 i_stdarg='$i_stdarg'
23358 i_stdbool='$i_stdbool'
23359 i_stddef='$i_stddef'
23360 i_stdlib='$i_stdlib'
23361 i_string='$i_string'
23362 i_sunmath='$i_sunmath'
23363 i_sysaccess='$i_sysaccess'
23364 i_sysdir='$i_sysdir'
23365 i_sysfile='$i_sysfile'
23366 i_sysfilio='$i_sysfilio'
23368 i_sysioctl='$i_sysioctl'
23369 i_syslog='$i_syslog'
23370 i_sysmman='$i_sysmman'
23371 i_sysmode='$i_sysmode'
23372 i_sysmount='$i_sysmount'
23373 i_sysndir='$i_sysndir'
23374 i_sysparam='$i_sysparam'
23375 i_syspoll='$i_syspoll'
23376 i_sysresrc='$i_sysresrc'
23377 i_syssecrt='$i_syssecrt'
23378 i_sysselct='$i_sysselct'
23379 i_syssockio='$i_syssockio'
23380 i_sysstat='$i_sysstat'
23381 i_sysstatfs='$i_sysstatfs'
23382 i_sysstatvfs='$i_sysstatvfs'
23383 i_systime='$i_systime'
23384 i_systimek='$i_systimek'
23385 i_systimes='$i_systimes'
23386 i_systypes='$i_systypes'
23387 i_sysuio='$i_sysuio'
23389 i_sysutsname='$i_sysutsname'
23390 i_sysvfs='$i_sysvfs'
23391 i_syswait='$i_syswait'
23392 i_termio='$i_termio'
23393 i_termios='$i_termios'
23395 i_unistd='$i_unistd'
23398 i_values='$i_values'
23399 i_varargs='$i_varargs'
23400 i_varhdr='$i_varhdr'
23402 ignore_versioned_solibs='$ignore_versioned_solibs'
23403 inc_version_list='$inc_version_list'
23404 inc_version_list_init='$inc_version_list_init'
23407 initialinstalllocation='$initialinstalllocation'
23408 installarchlib='$installarchlib'
23409 installbin='$installbin'
23410 installhtml1dir='$installhtml1dir'
23411 installhtml3dir='$installhtml3dir'
23412 installman1dir='$installman1dir'
23413 installman3dir='$installman3dir'
23414 installprefix='$installprefix'
23415 installprefixexp='$installprefixexp'
23416 installprivlib='$installprivlib'
23417 installscript='$installscript'
23418 installsitearch='$installsitearch'
23419 installsitebin='$installsitebin'
23420 installsitehtml1dir='$installsitehtml1dir'
23421 installsitehtml3dir='$installsitehtml3dir'
23422 installsitelib='$installsitelib'
23423 installsiteman1dir='$installsiteman1dir'
23424 installsiteman3dir='$installsiteman3dir'
23425 installsitescript='$installsitescript'
23426 installstyle='$installstyle'
23427 installusrbinperl='$installusrbinperl'
23428 installvendorarch='$installvendorarch'
23429 installvendorbin='$installvendorbin'
23430 installvendorhtml1dir='$installvendorhtml1dir'
23431 installvendorhtml3dir='$installvendorhtml3dir'
23432 installvendorlib='$installvendorlib'
23433 installvendorman1dir='$installvendorman1dir'
23434 installvendorman3dir='$installvendorman3dir'
23435 installvendorscript='$installvendorscript'
23437 issymlink='$issymlink'
23438 ivdformat='$ivdformat'
23441 known_extensions='$known_extensions'
23444 ld_can_script='$ld_can_script'
23445 lddlflags='$lddlflags'
23447 ldflags_uselargefiles='$ldflags_uselargefiles'
23448 ldlibpthname='$ldlibpthname'
23455 libsdirs='$libsdirs'
23456 libsfiles='$libsfiles'
23457 libsfound='$libsfound'
23458 libspath='$libspath'
23459 libswanted='$libswanted'
23460 libswanted_uselargefiles='$libswanted_uselargefiles'
23466 localtime_r_proto='$localtime_r_proto'
23467 locincpth='$locincpth'
23468 loclibpth='$loclibpth'
23469 longdblsize='$longdblsize'
23470 longlongsize='$longlongsize'
23471 longsize='$longsize'
23475 lseeksize='$lseeksize'
23476 lseektype='$lseektype'
23479 madlyobj='$madlyobj'
23480 madlysrc='$madlysrc'
23484 make_set_make='$make_set_make'
23485 mallocobj='$mallocobj'
23486 mallocsrc='$mallocsrc'
23487 malloctype='$malloctype'
23489 man1direxp='$man1direxp'
23492 man3direxp='$man3direxp'
23494 mips_type='$mips_type'
23495 mistrustnm='$mistrustnm'
23497 mmaptype='$mmaptype'
23498 modetype='$modetype'
23500 multiarch='$multiarch'
23502 myarchname='$myarchname'
23503 mydomain='$mydomain'
23504 myhostname='$myhostname'
23507 need_va_copy='$need_va_copy'
23508 netdb_hlen_type='$netdb_hlen_type'
23509 netdb_host_type='$netdb_host_type'
23510 netdb_name_type='$netdb_name_type'
23511 netdb_net_type='$netdb_net_type'
23514 nm_so_opt='$nm_so_opt'
23515 nonxs_ext='$nonxs_ext'
23517 nvEUformat='$nvEUformat'
23518 nvFUformat='$nvFUformat'
23519 nvGUformat='$nvGUformat'
23520 nv_overflows_integers_at='$nv_overflows_integers_at'
23521 nv_preserves_uv_bits='$nv_preserves_uv_bits'
23522 nveformat='$nveformat'
23523 nvfformat='$nvfformat'
23524 nvgformat='$nvgformat'
23527 o_nonblock='$o_nonblock'
23529 old_pthread_create_joinable='$old_pthread_create_joinable'
23530 optimize='$optimize'
23531 orderlib='$orderlib'
23534 otherlibdirs='$otherlibdirs'
23538 patchlevel='$patchlevel'
23539 path_sep='$path_sep'
23542 perl_patchlevel='$perl_patchlevel'
23543 perl_static_inline='$perl_static_inline'
23544 perladmin='$perladmin'
23545 perllibs='$perllibs'
23546 perlpath='$perlpath'
23548 phostname='$phostname'
23554 prefixexp='$prefixexp'
23556 privlibexp='$privlibexp'
23557 procselfexe='$procselfexe'
23558 prototype='$prototype'
23560 quadkind='$quadkind'
23561 quadtype='$quadtype'
23562 randbits='$randbits'
23563 randfunc='$randfunc'
23564 random_r_proto='$random_r_proto'
23565 randseedtype='$randseedtype'
23567 rd_nodata='$rd_nodata'
23568 readdir64_r_proto='$readdir64_r_proto'
23569 readdir_r_proto='$readdir_r_proto'
23570 revision='$revision'
23576 sGMTIME_max='$sGMTIME_max'
23577 sGMTIME_min='$sGMTIME_min'
23578 sLOCALTIME_max='$sLOCALTIME_max'
23579 sLOCALTIME_min='$sLOCALTIME_min'
23580 sPRIEUldbl='$sPRIEUldbl'
23581 sPRIFUldbl='$sPRIFUldbl'
23582 sPRIGUldbl='$sPRIGUldbl'
23583 sPRIXU64='$sPRIXU64'
23585 sPRIeldbl='$sPRIeldbl'
23586 sPRIfldbl='$sPRIfldbl'
23587 sPRIgldbl='$sPRIgldbl'
23592 sSCNfldbl='$sSCNfldbl'
23593 sched_yield='$sched_yield'
23594 scriptdir='$scriptdir'
23595 scriptdirexp='$scriptdirexp'
23597 seedfunc='$seedfunc'
23598 selectminbits='$selectminbits'
23599 selecttype='$selecttype'
23600 sendmail='$sendmail'
23601 setgrent_r_proto='$setgrent_r_proto'
23602 sethostent_r_proto='$sethostent_r_proto'
23603 setlocale_r_proto='$setlocale_r_proto'
23604 setnetent_r_proto='$setnetent_r_proto'
23605 setprotoent_r_proto='$setprotoent_r_proto'
23606 setpwent_r_proto='$setpwent_r_proto'
23607 setservent_r_proto='$setservent_r_proto'
23610 sharpbang='$sharpbang'
23611 shmattype='$shmattype'
23612 shortsize='$shortsize'
23615 sig_count='$sig_count'
23616 sig_name='$sig_name'
23617 sig_name_init='$sig_name_init'
23619 sig_num_init='$sig_num_init'
23620 sig_size='$sig_size'
23621 signal_t='$signal_t'
23622 sitearch='$sitearch'
23623 sitearchexp='$sitearchexp'
23625 sitebinexp='$sitebinexp'
23626 sitehtml1dir='$sitehtml1dir'
23627 sitehtml1direxp='$sitehtml1direxp'
23628 sitehtml3dir='$sitehtml3dir'
23629 sitehtml3direxp='$sitehtml3direxp'
23631 sitelib_stem='$sitelib_stem'
23632 sitelibexp='$sitelibexp'
23633 siteman1dir='$siteman1dir'
23634 siteman1direxp='$siteman1direxp'
23635 siteman3dir='$siteman3dir'
23636 siteman3direxp='$siteman3direxp'
23637 siteprefix='$siteprefix'
23638 siteprefixexp='$siteprefixexp'
23639 sitescript='$sitescript'
23640 sitescriptexp='$sitescriptexp'
23641 sizesize='$sizesize'
23642 sizetype='$sizetype'
23646 sockethdr='$sockethdr'
23647 socketlib='$socketlib'
23648 socksizetype='$socksizetype'
23650 spackage='$spackage'
23651 spitshell='$spitshell'
23652 srand48_r_proto='$srand48_r_proto'
23653 srandom_r_proto='$srandom_r_proto'
23655 ssizetype='$ssizetype'
23656 st_ino_sign='$st_ino_sign'
23657 st_ino_size='$st_ino_size'
23658 startperl='$startperl'
23660 static_ext='$static_ext'
23662 stdio_base='$stdio_base'
23663 stdio_bufsiz='$stdio_bufsiz'
23664 stdio_cnt='$stdio_cnt'
23665 stdio_filbuf='$stdio_filbuf'
23666 stdio_ptr='$stdio_ptr'
23667 stdio_stream_array='$stdio_stream_array'
23668 strerror_r_proto='$strerror_r_proto'
23671 subversion='$subversion'
23675 targetarch='$targetarch'
23679 timeincl='$timeincl'
23680 timetype='$timetype'
23681 tmpnam_r_proto='$tmpnam_r_proto'
23687 ttyname_r_proto='$ttyname_r_proto'
23696 uidformat='$uidformat'
23702 uquadtype='$uquadtype'
23703 use5005threads='$use5005threads'
23704 use64bitall='$use64bitall'
23705 use64bitint='$use64bitint'
23706 usecrosscompile='$usecrosscompile'
23707 usedevel='$usedevel'
23709 usedtrace='$usedtrace'
23710 usefaststdio='$usefaststdio'
23711 useithreads='$useithreads'
23712 usekernprocpathname='$usekernprocpathname'
23713 uselargefiles='$uselargefiles'
23714 uselongdouble='$uselongdouble'
23715 usemallocwrap='$usemallocwrap'
23716 usemorebits='$usemorebits'
23717 usemultiplicity='$usemultiplicity'
23718 usemymalloc='$usemymalloc'
23720 usensgetexecutablepath='$usensgetexecutablepath'
23721 useopcode='$useopcode'
23722 useperlio='$useperlio'
23723 useposix='$useposix'
23724 usereentrant='$usereentrant'
23725 userelocatableinc='$userelocatableinc'
23727 useshrplib='$useshrplib'
23728 usesitecustomize='$usesitecustomize'
23729 usesocks='$usesocks'
23730 usethreads='$usethreads'
23731 usevendorprefix='$usevendorprefix'
23732 useversionedarchname='$useversionedarchname'
23733 usevfork='$usevfork'
23736 uvXUformat='$uvXUformat'
23737 uvoformat='$uvoformat'
23740 uvuformat='$uvuformat'
23741 uvxformat='$uvxformat'
23743 vendorarch='$vendorarch'
23744 vendorarchexp='$vendorarchexp'
23745 vendorbin='$vendorbin'
23746 vendorbinexp='$vendorbinexp'
23747 vendorhtml1dir='$vendorhtml1dir'
23748 vendorhtml1direxp='$vendorhtml1direxp'
23749 vendorhtml3dir='$vendorhtml3dir'
23750 vendorhtml3direxp='$vendorhtml3direxp'
23751 vendorlib='$vendorlib'
23752 vendorlib_stem='$vendorlib_stem'
23753 vendorlibexp='$vendorlibexp'
23754 vendorman1dir='$vendorman1dir'
23755 vendorman1direxp='$vendorman1direxp'
23756 vendorman3dir='$vendorman3dir'
23757 vendorman3direxp='$vendorman3direxp'
23758 vendorprefix='$vendorprefix'
23759 vendorprefixexp='$vendorprefixexp'
23760 vendorscript='$vendorscript'
23761 vendorscriptexp='$vendorscriptexp'
23763 version_patchlevel_string='$version_patchlevel_string'
23764 versiononly='$versiononly'
23768 yaccflags='$yaccflags'
23773 : add special variables
23774 $test -f $src/patchlevel.h && \
23775 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
23776 echo "PERL_PATCHLEVEL='$perl_patchlevel'" >>config.sh
23777 echo "PERL_CONFIG_SH=true" >>config.sh
23779 : propagate old symbols
23780 if $test -f UU/config.sh; then
23781 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
23782 $sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' \
23783 config.sh config.sh UU/oldconfig.sh |\
23784 $sort | $uniq -u >UU/oldsyms
23785 set X `$cat UU/oldsyms`
23791 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
23793 echo ": Variables propagated from previous config.sh file." >>config.sh
23794 for sym in `$cat UU/oldsyms`; do
23795 echo " Propagating $hint variable "'$'"$sym..."
23796 eval 'tmp="$'"${sym}"'"'
23798 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
23804 : Finish up by extracting the .SH files
23808 echo "Extraction done."
23818 If you'd like to make any changes to the config.sh file before I begin
23819 to configure things, do it as a shell escape now (e.g. !vi config.sh).
23822 rp="Press return or use a shell escape to edit config.sh:"
23827 *) : in case they cannot read
23828 sh 1>&4 -c "$ans";;
23833 : if this fails, just run all the .SH files by hand
23842 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
23849 Now you need to generate make dependencies by running "$make depend".
23850 You might prefer to run it in background: "$make depend > makedepend.out &"
23851 It can take a while, so you might not want to run it right now.
23856 rp="Run $make depend now?"
23860 $make depend && echo "Now you must run '$make'."
23863 echo "You must run '$make depend' then '$make'."
23866 elif test -f [Mm]akefile; then
23868 echo "Now you must run a $make."
23870 echo "Configure done."
23873 if $test -f Policy.sh; then
23876 If you compile $package on a different machine or from a different object
23877 directory, copy the Policy.sh file from this object directory to the
23878 new one before you run Configure -- this will help you with most of
23879 the policy defaults.
23883 if $test -f config.msg; then
23884 echo "Hmm. I also noted the following information while running:"
23886 $cat config.msg >&4
23889 $rm -f kit*isdone ark*isdone