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 May 7 23:44:53 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=''
911 d_gdbm_ndbm_h_uses_prototypes=''
912 d_gdbmndbm_h_uses_prototypes=''
914 d_ndbm_h_uses_prototypes=''
989 d_inc_version_list=''
991 inc_version_list_init=''
1010 ignore_versioned_solibs=''
1074 d_perl_otherlibdirs=''
1082 api_versionstring=''
1088 version_patchlevel_string=''
1092 d_nv_preserves_uv=''
1093 d_nv_zero_is_allbits_zero=''
1104 nv_overflows_integers_at=''
1105 nv_preserves_uv_bits=''
1177 installsitehtml1dir=''
1180 installsitehtml3dir=''
1187 installsiteman1dir=''
1190 installsiteman3dir=''
1195 installsitescript=''
1212 d_stdio_stream_array=''
1213 stdio_stream_array=''
1230 usekernprocpathname=''
1231 ccflags_uselargefiles=''
1232 ldflags_uselargefiles=''
1233 libswanted_uselargefiles=''
1242 usensgetexecutablepath=''
1255 installvendorarch=''
1262 installvendorhtml1dir=''
1264 vendorhtml1direxp=''
1265 installvendorhtml3dir=''
1267 vendorhtml3direxp=''
1273 installvendorman1dir=''
1276 installvendorman3dir=''
1283 installvendorscript=''
1296 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1299 : We must find out about Eunice early
1301 if test -f /etc/unixtovms; then
1302 eunicefix=/etc/unixtovms
1304 if test -f /etc/unixtovms.exe; then
1305 eunicefix=/etc/unixtovms.exe
1308 : Set executable suffix now -- needed before hints available
1309 if test -f "/libs/version.library"; then
1312 elif test -f "/system/gnu_library/bin/ar.pm"; then
1315 elif test -n "$DJGPP"; 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'
1366 : full support for void wanted by default
1372 : set useposix=false in your hint file to disable the POSIX extension.
1374 : set useopcode=false in your hint file to disable the Opcode extension.
1377 ccflags_uselargefiles=''
1378 ldflags_uselargefiles=''
1379 libswanted_uselargefiles=''
1380 : set usemultiplicity on the Configure command line to enable multiplicity.
1381 : set usesocks on the Configure command line to enable socks.
1382 : List of libraries we want.
1383 : If anyone needs extra -lxxx, put those in a hint file.
1384 libswanted="sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun"
1385 libswanted="$libswanted m crypt sec util c cposix posix ucb bsd BSD"
1386 : We probably want to search /usr/shlib before most other libraries.
1387 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1388 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1389 glibpth="/usr/shlib $glibpth"
1390 : Do not use vfork unless overridden by a hint file.
1393 : Find the basic shell for Bourne shell scripts
1397 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1400 if test -f "$xxx"; then
1403 : Build up a list and do a single loop so we can 'break' out.
1404 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1405 for xxx in sh bash ksh pdksh ash; do
1407 try="$try ${p}/${xxx}"
1411 if test -f "$xxx"; then
1414 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1417 elif test -f "$xxx.exe"; then
1428 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1430 Usually it's in /bin/sh. How did you even get this far?
1431 Please contact me (Perl Maintainers) at perlbug@perl.org and
1432 we'll try to straighten this all out.
1438 : see if sh knows # comments
1439 if `$sh -c '#' >/dev/null 2>&1`; then
1443 test -f $xcat$_exe || xcat=/usr/bin/cat
1444 if test ! -f $xcat$_exe; then
1445 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1446 if test -f $p/cat$_exe; then
1451 if test ! -f $xcat$_exe; then
1452 echo "Can't find cat anywhere!"
1456 echo "#!$xcat" >sharp
1459 ./sharp > today 2>/dev/null
1460 if test -s today; then
1463 echo "#! $xcat" > sharp
1466 ./sharp > today 2>/dev/null
1467 if test -s today; then
1475 echo "Your $sh doesn't grok # comments--I will strip them later on."
1478 echo "exec grep -v '^[ ]*#'" >spitshell
1480 $eunicefix spitshell
1481 spitshell=`pwd`/spitshell
1483 echo "I presume that if # doesn't work, #! won't work either!"
1488 : figure out how to guarantee sh startup
1490 '') startsh=${sharpbang}${sh} ;;
1502 : echo "Yup, it does."
1504 echo "Hmm... '$startsh' does not guarantee sh startup..."
1505 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1509 : Save command line options in file UU/cmdline.opt for later use in
1510 : generating config.sh.
1511 cat > cmdline.opt <<EOSH
1512 : Configure command line arguments.
1521 cat >>cmdline.opt <<EOSH
1522 config_arg$argn='$arg'
1524 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1527 arg_exp=`cat cmdl.opt`
1528 args_exp="$args_exp$args_sep'$arg_exp'"
1529 argn=`expr $argn + 1`
1534 : produce awk script to parse command line options
1535 cat >options.awk <<'EOF'
1537 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1539 len = length(optstr);
1540 for (i = 1; i <= len; i++) {
1541 c = substr(optstr, i, 1);
1542 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1553 if (substr(str, 1, 1) != "-") {
1554 printf("'%s'\n", str);
1558 for (i = 2; i <= len; i++) {
1559 c = substr(str, i, 1);
1561 printf("-%s\n", substr(str, i));
1567 printf("'%s'\n", substr(str, i + 1));
1580 : process the command line options
1581 set X `for arg in "$@"; do echo "X$arg"; done |
1582 sed -e s/X// | awk -f options.awk`
1587 : set up default values
1597 rm -f optdef.sh posthint.sh
1598 cat >optdef.sh <<EOS
1604 while test $# -gt 0; do
1606 -d) shift; fastread=yes;;
1607 -e) shift; alldone=cont;;
1611 if test -r "$1"; then
1614 echo "$me: cannot read config file $1." >&2
1620 -h) shift; error=true;;
1621 -r) shift; reuseval=true;;
1622 -s) shift; silent=true; realsilent=true;;
1623 -E) shift; alldone=exit;;
1624 -K) shift; knowitall=true;;
1625 -O) shift; override=true;;
1626 -S) shift; silent=true; extractsh=true;;
1631 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1632 echo "$me: ignoring -D $1" >&2
1635 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1636 *) echo "$1='define'" >> optdef.sh;;
1643 *=) echo "$1" >> optdef.sh;;
1645 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1646 echo "$me: ignoring -U $1" >&2
1648 *) echo "$1='undef'" >> optdef.sh;;
1659 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1663 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1664 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1670 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1671 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1672 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1673 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1674 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1675 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1681 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1683 echo "$yyy=''" >> posthint.sh ;;
1688 echo "$yyy='$zzz'" >> posthint.sh ;;
1690 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1692 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1697 echo "$yyy=$zzz" >> posthint.sh ;;
1698 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1702 -V) echo "$me generated by metaconfig 3.5 PL0." >&2
1705 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1713 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1714 [-U symbol] [-U symbol=] [-A command:symbol...]
1715 -d : use defaults for all answers.
1716 -e : go on without questioning past the production of config.sh.
1717 -f : specify an alternate default configuration file.
1718 -h : print this help message and exit (with an error status).
1719 -r : reuse C symbols value if possible (skips costly nm extraction).
1720 -s : silent mode, only echoes questions and essential information.
1721 -D : define symbol to have some value:
1722 -D symbol symbol gets the value 'define'
1723 -D symbol=value symbol gets the value 'value'
1724 common used examples (see INSTALL for more info):
1725 -Duse64bitint use 64bit integers
1726 -Duse64bitall use 64bit integers and pointers
1727 -Dusethreads use thread support
1728 -Dinc_version_list=none do not include older perl trees in @INC
1729 -DEBUGGING=none DEBUGGING options
1730 -Dcc=gcc choose your compiler
1731 -Dprefix=/opt/perl5 choose your destination
1732 -E : stop at the end of questions, after having produced config.sh.
1733 -K : do not use unless you know what you are doing.
1734 -O : let -D and -U override definitions from loaded configuration file.
1735 -S : perform variable substitutions on all .SH files (can mix with -f)
1736 -U : undefine symbol:
1737 -U symbol symbol gets the value 'undef'
1738 -U symbol= symbol gets completely empty
1740 -A : manipulate symbol after the platform specific hints have been applied:
1741 -A append:symbol=value append value to symbol
1742 -A symbol=value like append:, but with a separating space
1743 -A define:symbol=value define symbol to have value
1744 -A clear:symbol define symbol to be ''
1745 -A define:symbol define symbol to be 'define'
1746 -A eval:symbol=value define symbol to be eval of value
1747 -A prepend:symbol=value prepend value to symbol
1748 -A undef:symbol define symbol to be 'undef'
1749 -A undef:symbol= define symbol to be ''
1750 e.g.: -A prepend:libswanted='cl pthread '
1751 -A ccflags=-DSOME_MACRO
1752 -V : print version number and exit (with a zero status).
1759 case "$fastread$alldone" in
1762 case "$extractsh" in
1765 if test ! -t 0; then
1766 echo "Say 'sh Configure', not 'sh <Configure'"
1776 true) exec 1>/dev/null;;
1779 : run the defines and the undefines, if any, but leave the file out there...
1782 : create the posthint manipulation script and leave the file out there...
1787 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1788 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1789 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1790 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1791 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1794 : Some greps do not return status, grrr.
1795 echo "grimblepritz" >grimble
1796 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1798 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1804 : the following should work in any shell
1808 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1809 cat >contains <<'EOSS'
1810 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1815 : Find the path to the source tree
1818 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1822 *) src=`cd ../$src && pwd` ;;
1835 if test -f $rsrc/Configure && \
1836 $contains "^package='$package'\$" $rsrc/Configure >/dev/null 2>&1
1838 : found it, so we are ok.
1841 for src in . .. ../.. ../../.. ../../../..; do
1842 if test -f ../$src/Configure && \
1843 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1854 Sorry, I can't seem to locate the source dir for $package. Please start
1855 Configure with an explicit path -- i.e. /some/path/Configure.
1863 echo "Sources for $package found in \"$src\"." >&4
1867 : script used to extract .SH files with variable substitutions
1868 cat >extract <<'EOS'
1870 echo "Doing variable substitutions on .SH files..."
1871 if test -f MANIFEST; then
1872 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1874 echo "(Looking for .SH files under the source directory.)"
1875 set x `(cd "$src"; find . -name "*.SH" -print)`
1879 0) set x `(cd "$src"; echo *.SH)`; shift;;
1881 if test ! -f "$src/$1"; then
1887 while test $name; do
1888 if test ! -d "$name"; then
1889 create="$name $create";
1890 name=`echo $name | sed -e "s|^[^/]*$||"`;
1891 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1896 for file in $create; do
1905 dir=`expr X$file : 'X\(.*\)/'`
1906 file=`expr X$file : 'X.*/\(.*\)'`
1907 (cd "$dir" && . ./$file)
1917 dir=`expr X$file : 'X\(.*\)/'`
1918 file=`expr X$file : 'X.*/\(.*\)'`
1919 (set x $dir; shift; eval $mkdir_p)
1920 sh <"$src/$dir/$file"
1929 if test -f "$src/config_h.SH"; then
1930 if test ! -f config.h; then
1931 : oops, they left it out of MANIFEST, probably, so do it anyway.
1932 . "$src/config_h.SH"
1937 : extract files and exit if asked to do so
1938 case "$extractsh" in
1940 case "$realsilent" in
1944 case "$config_sh" in
1945 '') config_sh='config.sh';;
1948 echo "Fetching answers from $config_sh..."
1951 test "$override" && . ./optdef.sh
1955 echo "Extraction done."
1960 : Eunice requires " " instead of "", can you believe it
1963 echo "Beginning of configuration questions for $package."
1965 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1967 : first determine how to suppress newline on echo command
1969 echo "Checking echo to see how to suppress newlines..."
1970 (echo "hi there\c" ; echo " ") >.echotmp
1971 if $contains c .echotmp >/dev/null 2>&1 ; then
1982 echo $n "The star should be here-->$c"
1986 : Now test for existence of everything in MANIFEST
1988 if test -f "$rsrc/MANIFEST"; then
1989 echo "First let's make sure your kit is complete. Checking..." >&4
1990 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | \
1991 (split -l 50 2>/dev/null || split -50)
1994 for filelist in x??; do
1995 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` \
1996 >/dev/null 2>>"$tmppwd/missing")
1998 if test -s missing; then
2002 THIS PACKAGE SEEMS TO BE INCOMPLETE.
2004 You have the option of continuing the configuration process, despite the
2005 distinct possibility that your kit is damaged, by typing 'y'es. If you
2006 do, don't blame me if something goes wrong. I advise you to type 'n'o
2007 and contact the author (perlbug@perl.org).
2010 echo $n "Continue? [n] $c" >&4
2014 echo "Continuing..." >&4
2018 echo "ABORTING..." >&4
2023 echo "Looks good..."
2026 echo "There is no MANIFEST file. I hope your kit is complete !"
2030 : Find the appropriate value for a newline for tr
2032 if test -n "$DJGPP"; then
2035 if test X"$trnl" = X; then
2036 case "`echo foo|tr '\n' x 2>/dev/null`" in
2040 if test X"$trnl" = X; then
2041 case "`echo foo|tr '\012' x 2>/dev/null`" in
2042 foox) trnl='\012' ;;
2045 if test X"$trnl" = X; then
2046 case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
2047 fooxy) trnl='\n\r' ;;
2050 if test X"$trnl" = X; then
2053 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
2059 : compute the number of columns on the terminal for proper question formatting
2064 : set up the echo used in my read
2065 myecho="case \"\$xxxm\" in
2066 '') echo $n \"\$rp $c\" >&4;;
2068 '') echo $n \"[\$xxxm] $c\";;
2070 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
2072 echo $n \"[\$xxxm] $c\" >&4
2074 echo $n \"\$rp [\$xxxm] $c\" >&4
2080 : now set up to do reads with possible shell escape and default assignment
2086 case "\$fastread" in
2087 yes) case "\$dflt" in
2090 case "\$silent-\$rp" in
2095 *) case "\$silent" in
2096 true) case "\$rp" in
2101 while expr "X\$ans" : "X!" >/dev/null; do
2105 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2113 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2122 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2127 echo "(OK, I'll run with -d after this question.)" >&4
2130 echo "*** Sorry, \$1 not supported yet." >&4
2140 echo "*** Substitution done -- please confirm."
2142 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2147 echo "*** Error -- try again."
2154 case "\$ans\$xxxm\$nostick" in
2166 : create .config dir to save info across Configure sessions
2167 test -d ../.config || mkdir ../.config
2168 cat >../.config/README <<EOF
2169 This directory created by Configure to save information that should
2170 persist across sessions for $package.
2172 You may safely delete it if you wish.
2175 : See if we are using a devel version and want that
2176 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2179 usedevel="$define" ;;
2180 *) case "$xversion" in
2183 *** WHOA THERE!!! ***
2185 This is an UNSTABLE DEVELOPMENT release.
2186 The version of this $package distribution is $xversion, that is, odd,
2187 (as opposed to even) and that signifies a development release.
2188 If you want a maintenance release, you want an even-numbered version.
2190 Do ***NOT*** install this into production use.
2191 Data corruption and crashes are possible.
2193 It is most seriously suggested that you do not continue any further
2194 unless you want to help in developing and debugging Perl.
2196 If you *still* want to build perl, you can answer 'y' now,
2197 or pass -Dusedevel to Configure.
2200 rp='Do you really want to continue?'
2204 [yY]) echo >&4 "Okay, continuing."
2205 usedevel="$define" ;;
2206 *) echo >&4 "Okay, bye."
2217 case "$versiononly" in
2218 '') versiononly="$define" ;;
2220 case "$installusrbinperl" in
2221 '') installusrbinperl="$undef" ;;
2226 : general instructions
2229 user=`(logname) 2>/dev/null`
2231 '') user=`whoami 2>&1`;;
2233 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2236 rp='Would you like to see the instructions?'
2247 This installation shell script will examine your system and ask you questions
2248 to determine how the perl5 package should be installed. If you get
2249 stuck on a question, you may use a ! shell escape to start a subshell or
2250 execute a command. Many of the questions will have default answers in square
2251 brackets; typing carriage return will give you the default.
2253 On some of the questions which ask for file or directory names you are allowed
2254 to use the ~name construct to specify the login directory belonging to "name",
2255 even if you don't have a shell which knows about that. Questions where this is
2256 allowed will be marked "(~name ok)".
2260 dflt='Type carriage return to continue'
2264 The prompter used in this script allows you to use shell variables and
2265 backticks in your answers. You may use $1, $2, etc... to refer to the words
2266 in the default answer, as if the default line was a set of arguments given to a
2267 script shell. This means you may also use $* to repeat the whole default line,
2268 so you do not have to re-type everything to add something to the default.
2270 Every time there is a substitution, you will have to confirm. If there is an
2271 error (e.g. an unmatched backtick), the default answer will remain unchanged
2272 and you will be prompted again.
2274 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2275 the questions and use the computed defaults (or the previous answers if there
2276 was already a config.sh file). Type 'Configure -h' for a list of options.
2277 You may also start interactively and then answer '& -d' at any prompt to turn
2278 on the non-interactive behaviour for the remainder of the execution.
2284 Much effort has been expended to ensure that this shell script will run on any
2285 Unix system. If despite that it blows up on yours, your best bet is to edit
2286 Configure and run it again. If you can't run Configure for some reason,
2287 you'll have to generate a config.sh file by hand. Whatever problems you
2288 have, let me (perlbug@perl.org) know how I blew it.
2290 This installation script affects things in two ways:
2292 1) it may do direct variable substitutions on some of the files included
2294 2) it builds a config.h file for inclusion in C programs. You may edit
2295 any of these files as the need arises after running this script.
2297 If you make a mistake on a question, there is no easy way to back up to it
2298 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2299 files. Configure will offer to let you do this before it runs the SH files.
2302 dflt='Type carriage return to continue'
2304 case "$firsttime" in
2305 true) echo $user >>../.config/instruct;;
2309 : find out where common programs are
2311 echo "Locating common programs..." >&4
2324 if test -d \$dir/\$thing; then
2330 for thisthing in \$dir/\$thing; do
2331 : just loop through to pick last item
2333 if test -f \$thisthing; then
2336 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2339 elif test -f \$dir/\$thing.exe; then
2340 if test -n "$DJGPP"; then
2341 echo \$dir/\$thing.exe
2342 elif test "$eunicefix" != ":"; then
2343 : on Eunice apparently
2396 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2397 pth="$pth /lib /usr/lib"
2398 for file in $loclist; do
2402 if test -f "$xxx"; then
2405 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2406 xxx=`./loc $file $file $pth`
2409 '') xxx=`./loc $file $file $pth`;;
2410 *) xxx=`./loc $xxx $xxx $pth`;;
2412 eval $file=$xxx$_exe
2416 echo $file is in $xxx.
2419 echo $file is in $xxx.
2422 echo "I don't know where '$file' is, and my life depends on it." >&4
2423 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2429 echo "Don't worry if any of the following aren't found..."
2431 for file in $trylist; do
2435 if test -f "$xxx"; then
2438 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2439 xxx=`./loc $file $file $pth`
2442 '') xxx=`./loc $file $file $pth`;;
2443 *) xxx=`./loc $xxx $xxx $pth`;;
2445 eval $file=$xxx$_exe
2449 echo $file is in $xxx.
2452 echo $file is in $xxx.
2455 echo "I don't see $file out there, $say."
2462 echo "Substituting grep for egrep."
2469 *) if $less -R </dev/null >/dev/null; then
2470 echo "Substituting less -R for less."
2478 echo "Substituting cp for ln."
2487 echo "I can't find make or gmake, and my life depends on it." >&4
2488 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2496 *) # We can't have osname yet.
2497 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2498 # Assume that gmake, if found, is definitely GNU make
2499 # and prefer it over the system make.
2500 echo "Substituting gmake for make."
2508 echo "Hopefully test is built into your sh."
2511 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2512 echo "Using the test built into your sh."
2520 echo "Hopefully echo is built into your sh."
2525 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2526 $echo $n "hi there$c" >foo1
2527 echo $n "hi there$c" >foo2
2528 if cmp foo1 foo2 >/dev/null 2>&1; then
2529 echo "They are compatible. In fact, they may be identical."
2536 They are not compatible! You are probably running ksh on a non-USG system.
2537 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2538 have echo built in and we may have to run some Bourne shell scripts. That
2539 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2542 $echo $n "The star should be here-->$c"
2549 # This question was auctioned at YAPC::Europe-2007 in Vienna
2550 # I never promised you could answer it. I only auctioned the question.
2552 The following message is sponsored by
2554 Dresden.pm<--The stars should be here.
2556 Dear Perl user, system administrator or package
2557 maintainer, the Perl community sends greetings to
2558 you. Do you (emblematical) greet back [Y/n]? n
2562 : Check what type of C compiler we use
2566 cat <<'EOSC' >>trygcc
2571 int main(int argc, char *argv[]) {
2575 if $cc -o try $ccflags $ldflags try.c; then
2578 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2584 # Skip this test because it gives a false match on output like:
2585 # ./trygcc: line 23: cc: command not found
2586 # case "`$cc -v -c try.c 2>&1`" in
2587 # *gcc*) trygcc=no ;;
2589 if $test X"$trygcc" = Xyes; then
2590 if gcc -o try -c try.c; then
2592 echo "You seem to have a working gcc, though." >&4
2593 # Switching compilers may undo the work of hints files.
2594 # The most common problem is -D_REENTRANT for threads.
2595 # This heuristic catches that case, but gets false positives
2596 # if -Dusethreads was not actually specified. Better to
2597 # bail out here with a useful message than fail
2598 # mysteriously later. Should we perhaps just try to
2599 # re-invoke Configure -Dcc=gcc config_args ?
2600 if $test -f usethreads.cbu; then
2603 *** However, any setting of the C compiler flags (e.g. for thread support)
2604 *** will be lost. It may be necessary for you to restart Configure and
2605 *** add -Dcc=gcc to your Configure command line.
2608 rp="Would you like to go ahead and try gcc anyway?"
2611 rp="Would you like to use it?"
2614 if $test -f myread; then
2617 if $test -f UU/myread; then
2620 echo "Cannot find myread, sorry. Aborting." >&2
2625 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2638 cat <<'EOSC' >>checkcc
2643 int main(int argc, char *argv[]) {
2647 if $cc -o try $ccflags $ldflags try.c; then
2650 if $test X"$despair" = Xyes; then
2651 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2654 You need to find a working C compiler.
2655 Either (purchase and) install the C compiler supplied by your OS vendor,
2656 or for a free C compiler try http://gcc.gnu.org/
2657 I cannot continue any further, aborting.
2666 : determine whether symbolic links are supported
2669 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2670 echo "Symbolic links are supported." >&4
2673 echo "Symbolic links are NOT supported." >&4
2678 : determine whether symbolic links are supported
2682 echo "Checking how to test for symbolic links..." >&4
2684 if $test "X$issymlink" = X; then
2686 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2687 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2689 if test $? = 0; then
2692 echo "Your builtin 'test -h' may be broken." >&4
2695 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2698 if test -f "$p/$test"; then
2707 echo "Trying external '$test -h'." >&4
2708 issymlink="$test -h"
2709 if $test ! -h sym >/dev/null 2>&1; then
2710 echo "External '$test -h' is broken, too." >&4
2718 if $test "X$issymlink" = X; then
2719 if $test -L sym 2>/dev/null; then
2720 issymlink="$test -L"
2721 echo "The builtin '$test -L' worked." >&4
2724 if $test "X$issymlink" != X; then
2725 echo "You can test for symbolic links with '$issymlink'." >&4
2727 echo "I do not know how you can test for symbolic links." >&4
2731 *) echo "No symbolic links, so not testing for their testing..." >&4
2736 : Make symlinks util
2737 case "$mksymlinks" in
2740 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2743 *) case "$lns:$issymlink" in
2744 *"ln"*" -s:"*"test -"?)
2745 echo "Creating the symbolic links..." >&4
2746 echo "(First creating the subdirectories...)" >&4
2748 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2750 test -z "$directory" && break
2754 if test ! -d t/base; then
2755 echo "Failed to create the subdirectories. Aborting." >&4
2758 echo "(Then creating the symlinks...)" >&4
2759 awk '{print $1}' $src/MANIFEST | while true; do
2761 test -z "$filename" && break
2762 if test -f $filename; then
2763 if $issymlink $filename; then
2767 if test -f $filename; then
2768 echo "$filename already exists, not symlinking."
2770 ln -s $src/$filename $filename
2774 if test ! -f t/base/lex.t; then
2775 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2780 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2788 : Check for Cross-Compilation
2789 case "$usecrosscompile" in
2791 $echo "Cross-compiling..."
2794 *-*-gcc) # A cross-compiling gcc, probably.
2795 targetarch=`$echo $cc|$sed 's/-gcc$//'`
2797 # leave out ld, choosing it is more complex
2799 ranlib=$targetarch-ranlib
2800 $echo 'extern int foo;' > try.c
2801 set X `$cc -v -E try.c 2>&1 | $awk '/^#include </,/^End of search /'|$grep '/include'`
2803 if $test $# -gt 0; then
2805 incpth="`$echo $incpth|$sed 's/^ //'`"
2806 echo "Guessing incpth '$incpth'." >&4
2808 j="`$echo $i|$sed 's,/include$,/lib,'`"
2809 if $test -d $j; then
2813 libpth="`$echo $libpth|$sed 's/^ //'`"
2814 echo "Guessing libpth '$libpth'." >&4
2819 case "$targetarch" in
2820 '') echo "Targetarch not defined." >&4; croak=y ;;
2821 *) echo "Using targetarch $targetarch." >&4 ;;
2824 '') echo "Incpth not defined." >&4; croak=y ;;
2825 *) echo "Using incpth '$incpth'." >&4 ;;
2828 '') echo "Libpth not defined." >&4; croak=y ;;
2829 *) echo "Using libpth '$libpth'." >&4 ;;
2832 '') for i in $incpth; do
2833 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
2835 echo "Guessing usrinc $usrinc." >&4
2840 '') echo "Usrinc not defined." >&4; croak=y ;;
2843 *) echo "Using usrinc $usrinc." >&4 ;;
2845 case "$targethost" in
2846 '') echo "Targethost not defined." >&4; croak=y ;;
2847 *) echo "Using targethost $targethost." >&4
2852 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2855 /*) run=$src/Cross/run
2856 targetmkdir=$src/Cross/mkdir
2858 from=$src/Cross/from
2860 *) pwd=`$test -f ../Configure & cd ..; pwd`
2862 targetmkdir=$pwd/Cross/mkdir
2864 from=$pwd/Cross/from
2867 case "$targetrun" in
2868 '') targetrun=ssh ;;
2873 case "$targetfrom" in
2874 '') targetfrom=scp ;;
2878 from=$from-$targetfrom
2879 case "$targetdir" in
2881 echo "Guessing targetdir $targetdir." >&4
2884 case "$targetuser" in
2886 echo "Guessing targetuser $targetuser." >&4
2889 case "$targetfrom" in
2893 case "$targetrun" in
2905 '') cwd=$targetdir ;;
2909 if $test ! -f \$exe.xok; then
2913 $targetrun -l $targetuser $targethost "cd \$cwd && ./\$exe \$@"
2916 *) echo "Unknown targetrun '$targetrun'" >&4
2920 case "$targetmkdir" in
2922 cat >$targetmkdir <<EOF
2924 $targetrun -l $targetuser $targethost "mkdir -p \$@"
2926 $chmod a+rx $targetmkdir
2928 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
2940 $targetmkdir \`dirname \$f\`
2941 $targetto $q \$f $targetuser@$targethost:\$f || exit 1
2944 $targetmkdir $targetdir/\`dirname \$f\`
2945 $targetto $q \$f $targetuser@$targethost:$targetdir/\$f || exit 1
2958 $mkdir -p $targetdir/\`dirname \$f\`
2959 $cp \$f $targetdir/\$f || exit 1
2962 $targetmkdir $targetdir/\`dirname \$f\`
2963 $cp \$f $targetdir/\$f || exit 1
2970 *) echo "Unknown targetto '$targetto'" >&4
2974 case "$targetfrom" in
2981 $targetfrom $q $targetuser@$targethost:$targetdir/\$f . || exit 1
2986 cp) cat >$from <<EOF
2991 cp $targetdir/\$f . || exit 1
2996 *) echo "Unknown targetfrom '$targetfrom'" >&4
3000 if $test ! -f $run; then
3001 echo "Target 'run' script '$run' not found." >&4
3005 if $test ! -f $to; then
3006 echo "Target 'to' script '$to' not found." >&4
3010 if $test ! -f $from; then
3011 echo "Target 'from' script '$from' not found." >&4
3015 if $test ! -f $run -o ! -f $to -o ! -f $from; then
3019 Using '$run' for remote execution,
3020 and '$from' and '$to'
3021 for remote file transfer.
3027 usecrosscompile='undef'
3032 : see whether [:lower:] and [:upper:] are supported character classes
3034 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
3036 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
3040 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
3041 # (0xd9 and 0xe2), therefore that is a nice testing point.
3042 if test "X$up" = X -o "X$low" = X; then
3043 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
3049 if test "X$up" = X -o "X$low" = X; then
3050 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
3056 if test "X$up" = X -o "X$low" = X; then
3057 case "`echo RS | od -x 2>/dev/null`" in
3059 echo "Hey, this might be EBCDIC." >&4
3060 if test "X$up" = X -o "X$low" = X; then
3061 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
3062 rs) up='[A-IJ-RS-Z]'
3067 if test "X$up" = X -o "X$low" = X; then
3068 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
3078 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
3080 echo "Using $up and $low to convert case." >&4
3083 echo "I don't know how to translate letters from upper to lower case." >&4
3084 echo "Your tr is not acting any way I know of." >&4
3088 : set up the translation script tr, must be called with ./tr of course
3092 '[A-Z][a-z]') exec $tr '$up' '$low';;
3093 '[a-z][A-Z]') exec $tr '$low' '$up';;
3100 : Try to determine whether config.sh was made on this system
3101 case "$config_sh" in
3103 myuname=`$uname -a 2>/dev/null`
3104 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
3105 # Downcase everything to avoid ambiguity.
3106 # Remove slashes and single quotes so we can use parts of this in
3107 # directory and file names.
3108 # Remove newlines so myuname is sane to use elsewhere.
3109 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
3110 # because the A-Z/a-z are not consecutive.
3111 myuname=`echo $myuname | $sed -e "s,['/],,g" | \
3112 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
3113 newmyuname="$myuname"
3115 case "$knowitall" in
3117 if test -f ../config.sh; then
3118 if $contains myuname= ../config.sh >/dev/null 2>&1; then
3119 eval "`grep myuname= ../config.sh`"
3121 if test "X$myuname" = "X$newmyuname"; then
3129 : Get old answers from old config file if Configure was run on the
3130 : same system, otherwise use the hints.
3133 if test -f config.sh; then
3135 rp="I see a config.sh file. Shall I use it to set the defaults?"
3138 n*|N*) echo "OK, I'll ignore it."
3139 mv config.sh config.sh.old
3140 myuname="$newmyuname"
3142 *) echo "Fetching default answers from your old config.sh file..." >&4
3150 : Older versions did not always set $sh. Catch re-use of such
3160 if test ! -f config.sh; then
3163 First time through, eh? I have some defaults handy for some systems
3164 that need some extra help getting the Configure answers right:
3167 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3169 : Half the following guesses are probably wrong... If you have better
3170 : tests or hints, please send them to perlbug@perl.org
3171 : The metaconfig authors would also appreciate a copy...
3172 $test -f /irix && osname=irix
3173 $test -f /xenix && osname=sco_xenix
3174 $test -f /dynix && osname=dynix
3175 $test -f /dnix && osname=dnix
3176 $test -f /lynx.os && osname=lynxos
3177 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3178 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3179 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3180 $test -f /bin/mips && /bin/mips && osname=mips
3181 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
3182 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
3183 $test -d /usr/apollo/bin && osname=apollo
3184 $test -f /etc/saf/_sactab && osname=svr4
3185 $test -d /usr/include/minix && osname=minix
3186 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3187 if $test -d /MachTen -o -d /MachTen_Folder; then
3189 if $test -x /sbin/version; then
3190 osvers=`/sbin/version | $awk '{print $2}' |
3191 $sed -e 's/[A-Za-z]$//'`
3192 elif $test -x /usr/etc/version; then
3193 osvers=`/usr/etc/version | $awk '{print $2}' |
3194 $sed -e 's/[A-Za-z]$//'`
3200 $test -f /sys/posix.dll &&
3201 $test -f /usr/bin/what &&
3202 set X `/usr/bin/what /sys/posix.dll` &&
3203 $test "$3" = UWIN &&
3207 if $test -f $uname; then
3215 umips) osname=umips ;;
3218 [23]100) osname=mips ;;
3219 next*) osname=next ;;
3221 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3222 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3225 elif $test -f /etc/kconfig; then
3227 if test "$lns" = "$ln -s"; then
3229 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3231 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3238 if test -n "$DJGPP"; then
3247 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3249 # oslevel can fail with:
3250 # oslevel: Unable to acquire lock.
3251 *not\ found) osvers="$4"."$3" ;;
3252 '<3240'|'<>3240') osvers=3.2.0 ;;
3253 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3254 '=3250'|'>3250') osvers=3.2.5 ;;
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 take advantage of threads 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 more memory than plain Perl. The current implementation
4163 is believed to be stable, but it is fairly new, and so should be
4164 treated with caution.
4166 If this doesn't make any sense to you, just accept the default '$dflt'.
4168 rp='Build a threading Perl?'
4171 y|Y) val="$define" ;;
4177 if $test $patchlevel -lt 9; then
4178 case "$usethreads" in
4182 Since release 5.6, Perl has had two different threading implementations,
4183 the newer interpreter-based version (ithreads) with one interpreter per
4184 thread, and the older 5.005 version (5005threads).
4185 The 5005threads version is effectively unmaintained and will probably be
4186 removed in Perl 5.10, so there should be no need to build a Perl using it
4187 unless needed for backwards compatibility with some existing 5.005threads
4191 : Default to ithreads unless overridden on command line or with
4194 case "$use5005threads" in
4195 $define|true|[yY]*) dflt='n';;
4197 case "$useithreads" in
4198 $undef|false|[nN]*) dflt='n';;
4200 rp='Use the newer interpreter-based ithreads?'
4203 y|Y) val="$define" ;;
4208 : Now set use5005threads to the opposite value.
4209 case "$useithreads" in
4210 $define) val="$undef" ;;
4217 useithreads="$undef"
4218 use5005threads="$undef"
4222 case "$useithreads$use5005threads" in
4226 You cannot have both the ithreads and the 5.005 threads enabled
4227 at the same time. Disabling the 5.005 threads since they are
4228 much less stable than the ithreads.
4231 use5005threads="$undef"
4236 : perl-5.9.x and later
4238 if test X"$usethreads" = "X$define"; then
4239 case "$use5005threads" in
4243 5.005 threads has been removed for 5.10. Perl will be built using ithreads.
4250 use5005threads="$undef"
4251 useithreads="$usethreads"
4254 case "$d_oldpthreads" in
4255 '') : Configure tests would be welcome here. For now, assume undef.
4257 *) val="$d_oldpthreads" ;;
4263 : Look for a hint-file generated 'call-back-unit'. If the
4264 : user has specified that a threading perl is to be built,
4265 : we may need to set or change some other defaults.
4266 if $test -f usethreads.cbu; then
4267 echo "Your platform has some specific hints regarding threaded builds, using them..."
4270 case "$usethreads" in
4271 "$define"|true|[yY]*)
4273 (Your platform does not have any specific hints for threaded builds.
4274 Assuming POSIX threads, then.)
4280 : Check if multiplicity is required
4283 Perl can be built so that multiple Perl interpreters can coexist
4284 within the same Perl executable.
4287 case "$useithreads" in
4290 This multiple interpreter support is required for interpreter-based threads.
4294 *) case "$usemultiplicity" in
4295 $define|true|[yY]*) dflt='y';;
4299 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
4300 rp='Build Perl for multiplicity?'
4303 y|Y) val="$define" ;;
4311 : Check if morebits is requested
4312 case "$usemorebits" in
4313 "$define"|true|[yY]*)
4314 use64bitint="$define"
4315 uselongdouble="$define"
4316 usemorebits="$define"
4318 *) usemorebits="$undef"
4322 : Determine the C compiler to be used
4328 rp="Use which C compiler?"
4332 : See whether they have no cc but they do have gcc
4334 if $test -f cc.cbu; then
4339 : make some quick guesses about what we are up against
4341 $echo $n "Hmm... $c"
4351 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
4352 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
4354 echo "Looks kind of like an OSF/1 system, but we'll see..."
4356 elif test `echo abc | $tr a-z A-Z` = Abc ; then
4357 xxx=`./loc addbib blurfl $pth`
4358 if $test -f $xxx; then
4359 echo "Looks kind of like a USG system with BSD features, but we'll see..."
4363 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
4364 echo "Looks kind of like an extended USG system, but we'll see..."
4366 echo "Looks kind of like a USG system, but we'll see..."
4370 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
4371 echo "Looks kind of like a BSD system, but we'll see..."
4375 echo "Looks kind of like a Version 7 system, but we'll see..."
4378 case "$eunicefix" in
4381 There is, however, a strange, musty smell in the air that reminds me of
4382 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
4386 : it so happens the Eunice I know will not run shell scripts in Unix format
4390 echo "Congratulations. You aren't running Eunice."
4394 : Detect OS2. The p_ variable is set above in the Head.U unit.
4395 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
4396 : semicolon as a patch separator
4401 I have the feeling something is not exactly right, however...don't tell me...
4402 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
4403 (Or you may be running DOS with DJGPP.)
4408 if test -f /xenix; then
4409 echo "Actually, this looks more like a XENIX system..."
4414 echo "It's not Xenix..."
4419 if test -f /venix; then
4420 echo "Actually, this looks more like a VENIX system..."
4427 echo "Nor is it Venix..."
4430 chmod +x bsd usg v7 osf1 eunice xenix venix os2
4431 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
4434 : Check if we are using GNU gcc and what its version is
4436 echo "Checking for GNU cc in disguise and/or its version number..." >&4
4440 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
4442 printf("%s\n", __VERSION__);
4444 printf("%s\n", "1");
4450 if $cc -o try $ccflags $ldflags try.c; then
4451 gccversion=`$run ./try`
4452 case "$gccversion" in
4453 '') echo "You are not using GNU cc." ;;
4454 *) echo "You are using GNU cc $gccversion."
4460 echo "*** WHOA THERE!!! ***" >&4
4461 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
4462 case "$knowitall" in
4464 echo " You'd better start hunting for one and let me know about it." >&4
4470 case "$gccversion" in
4471 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
4473 case "$gccversion" in
4474 '') gccosandvers='' ;;
4475 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
4476 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
4478 case "$gccosandvers" in
4479 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
4480 $osname$osvers) ;; # looking good
4481 $osname*) cat <<EOM >&4
4483 *** WHOA THERE!!! ***
4485 Your gcc has not been compiled for the exact release of
4486 your operating system ($gccosandvers versus $osname$osvers).
4488 In general it is a good idea to keep gcc synchronized with
4489 the operating system because otherwise serious problems
4490 may ensue when trying to compile software, like Perl.
4492 I'm trying to be optimistic here, though, and will continue.
4493 If later during the configuration and build icky compilation
4494 problems appear (headerfile conflicts being the most common
4495 manifestation), I suggest reinstalling the gcc to match
4496 your operating system release.
4500 *) gccosandvers='' ;; # failed to parse, better be silent
4508 # gcc 3.* complain about adding -Idirectories that they already know about,
4509 # so we will take those off from locincpth.
4510 case "$gccversion" in
4512 echo "main(){}">try.c
4513 for incdir in $locincpth; do
4514 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
4515 grep '^c[cp]p*[01]: warning: changing search order '`
4516 if test "X$warn" != X; then
4517 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
4523 : What should the include directory be ?
4525 $echo $n "Hmm... $c"
4529 if $test -f /bin/mips && /bin/mips; then
4530 echo "Looks like a MIPS system..."
4531 $cat >usr.c <<'EOCP'
4532 #ifdef SYSTYPE_BSD43
4536 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4537 dflt='/bsd43/usr/include'
4541 mips_type='System V'
4543 $rm -f usr.c usr.out
4544 echo "and you're compiling with the $mips_type compiler and libraries."
4548 echo "Doesn't look like a MIPS system."
4558 case "$xxx_prompt" in
4561 rp='Where are the include files you want to use?'
4569 : see how we invoke the C preprocessor
4571 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4572 cat <<'EOT' >testcpp.c
4578 if test ! -f cppstdin; then
4579 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4580 # AIX cc -E doesn't show the absolute headerfile
4581 # locations but we'll cheat by using the -M flag.
4582 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
4584 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4587 echo "Keeping your $hint cppstdin wrapper."
4590 wrapper=`pwd`/cppstdin
4594 if $test "X$cppstdin" != "X" && \
4595 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4596 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4598 echo "You used to use $cppstdin $cppminus so we'll use that again."
4600 '') echo "But let's see if we can live without a wrapper..." ;;
4602 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4603 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4605 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4608 echo "(However, $cpprun $cpplast does not work, let's see...)"
4616 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4623 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4624 $cc -E <testcpp.c >testcpp.out 2>&1; \
4625 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4626 echo "Yup, it does."
4629 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4630 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4631 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4632 echo "Yup, it does."
4635 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4636 $cc -P <testcpp.c >testcpp.out 2>&1; \
4637 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4638 echo "Yipee, that works!"
4641 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4642 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4643 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4644 echo "At long last!"
4647 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4648 $cpp <testcpp.c >testcpp.out 2>&1; \
4649 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4653 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4654 $cpp - <testcpp.c >testcpp.out 2>&1; \
4655 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4656 echo "Hooray, it works! I was beginning to wonder."
4659 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4660 $wrapper <testcpp.c >testcpp.out 2>&1; \
4661 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4667 rp="No dice. I can't find a C preprocessor. Name one:"
4671 $x_cpp <testcpp.c >testcpp.out 2>&1
4672 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4673 echo "OK, that will do." >&4
4675 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4690 echo "Perhaps can we force $cc -E using a wrapper..."
4691 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4692 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4698 echo "Nope, we'll have to live without it..."
4712 "$wrapper"|'cppstdin') ;;
4713 *) $rm -f $wrapper;;
4715 $rm -f testcpp.c testcpp.out
4717 : Set private lib path
4720 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4725 '') dlist="$loclibpth $plibpth $glibpth";;
4726 *) dlist="$libpth";;
4729 : Now check and see which directories actually exist, avoiding duplicates
4733 if $test -d $xxx; then
4736 *) libpth="$libpth $xxx";;
4742 Some systems have incompatible or broken versions of libraries. Among
4743 the directories listed in the question below, please remove any you
4744 know not to be holding relevant libraries, and add any that are needed.
4745 Say "none" for none.
4756 rp="Directories to use for library searches?"
4763 : compute shared library extension
4766 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4776 On some systems, shared libraries may be available. Answer 'none' if
4777 you want to suppress searching of shared libraries for the remainder
4778 of this configuration.
4781 rp='What is the file extension used for shared libraries?'
4785 : Define several unixisms.
4786 : Hints files or command line option can be used to override them.
4787 : The convoluted testing is in case hints files set either the old
4790 '') case "$exe_ext" in
4792 *) _exe="$exe_ext" ;;
4797 '') case "$lib_ext" in
4804 '') case "$obj_ext" in
4811 '') case "$path_sep" in
4822 rm_try="$rm -f try try$_exe a.out .out try.[cho] try.$_o core core.try* try.core*"
4824 : Which makefile gets called first. This is used by make depend.
4825 case "$firstmakefile" in
4826 '') firstmakefile='makefile';;
4829 : Check is we will use socks
4831 $define|true|[yY]*) dflt='y';;
4836 Perl can be built to use the SOCKS proxy protocol library. To do so,
4837 Configure must be run with -Dusesocks. If you use SOCKS you also need
4838 to use the PerlIO abstraction layer, this will be implicitly selected.
4840 If this doesn't make any sense to you, just accept the default '$dflt'.
4842 rp='Build Perl for SOCKS?'
4845 y|Y) val="$define" ;;
4851 : Check for uselongdouble support
4853 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
4856 case "$uselongdouble" in
4857 $define|true|[yY]*) dflt='y';;
4862 Perl can be built to take advantage of long doubles which
4863 (if available) may give more accuracy and range for floating point numbers.
4865 If this doesn't make any sense to you, just accept the default '$dflt'.
4867 rp='Try to use long doubles if available?'
4870 y|Y) val="$define" ;;
4876 case "$uselongdouble" in
4877 true|[yY]*) uselongdouble="$define" ;;
4880 : Look for a hint-file generated 'call-back-unit'. If the
4881 : user has specified that long doubles should be used,
4882 : we may need to set or change some other defaults.
4883 if $test -f uselongdouble.cbu; then
4884 echo "Your platform has some specific hints regarding long doubles, using them..."
4885 . ./uselongdouble.cbu
4887 case "$uselongdouble" in
4890 (Your platform does not have any specific hints for long doubles.)
4896 : Looking for optional libraries
4898 echo "Checking for optional libraries..." >&4
4903 case "$libswanted" in
4904 '') libswanted='c_s';;
4907 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
4913 for thisdir in $libpth $xlibpth; do
4914 test -d $thisdir && libspath="$libspath $thisdir"
4916 for thislib in $libswanted; do
4917 for thisdir in $libspath; do
4919 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4920 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
4921 $test -f "$xxx" && eval $libscheck
4922 $test -f "$xxx" && libstyle=shared
4924 if test ! -f "$xxx"; then
4925 xxx=$thisdir/lib$thislib.$so
4926 $test -f "$xxx" && eval $libscheck
4927 $test -f "$xxx" && libstyle=shared
4929 if test ! -f "$xxx"; then
4930 xxx=$thisdir/lib$thislib$_a
4931 $test -f "$xxx" && eval $libscheck
4932 $test -f "$xxx" && libstyle=static
4934 if test ! -f "$xxx"; then
4935 xxx=$thisdir/$thislib$_a
4936 $test -f "$xxx" && eval $libscheck
4937 $test -f "$xxx" && libstyle=static
4939 if test ! -f "$xxx"; then
4940 xxx=$thisdir/lib${thislib}_s$_a
4941 $test -f "$xxx" && eval $libscheck
4942 $test -f "$xxx" && libstyle=static
4943 $test -f "$xxx" && thislib=${thislib}_s
4945 if test ! -f "$xxx"; then
4946 xxx=$thisdir/Slib$thislib$_a
4947 $test -f "$xxx" && eval $libscheck
4948 $test -f "$xxx" && libstyle=static
4950 if $test -f "$xxx"; then
4952 shared) echo "Found -l$thislib (shared)." ;;
4953 static) echo "Found -l$thislib." ;;
4954 *) echo "Found -l$thislib ($libstyle)." ;;
4958 *) dflt="$dflt -l$thislib"
4959 libsfound="$libsfound $xxx"
4961 libsfiles="$libsfiles $yyy"
4962 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
4963 case " $libsdirs " in
4965 *) libsdirs="$libsdirs $yyy" ;;
4972 if $test ! -f "$xxx"; then
4973 echo "No -l$thislib."
4984 ' '|'') dflt='none';;
4989 In order to compile $package on your machine, a number of libraries
4990 are usually needed. Include any other special libraries here as well.
4991 Say "none" for none. The default list is almost always right.
4995 rp="What libraries to use?"
5002 : determine optimization, if desired, or use for debug flag also
5004 ' '|$undef) dflt='none';;
5006 *) dflt="$optimize";;
5010 By default, $package compiles with the -O flag to use the optimizer.
5011 Alternately, you might want to use the symbolic debugger, which uses
5012 the -g flag (on traditional Unix systems). Either flag can be
5013 specified here. To use neither flag, specify the word "none".
5016 rp="What optimizer/debugger flag should be used?"
5020 'none') optimize=" ";;
5023 : Check what DEBUGGING is required from the command line
5024 : -DEBUGGING or -DDEBUGGING or
5025 : -DEBUGGING=both = -g + -DDEBUGGING
5026 : -DEBUGGING=-g or -Doptimize=-g = -g
5027 : -DEBUGGING=none or -UDEBUGGING =
5028 : -DEBUGGING=old or -DEBUGGING=default = ? $optimize
5031 *) DEBUGGING=$EBUGGING ;;
5034 case "$DEBUGGING" in
5038 *) optimize="$optimize -g" ;;
5042 *-g*) set `echo "X $optimize " | sed 's/ -g / /'`
5050 case "$DEBUGGING" in
5051 both|$define) dflt='-DDEBUGGING'
5054 : argument order is deliberate, as the flag will start with - which set could
5055 : think is an option
5056 checkccflag='check=$1; flag=$2; callback=$3;
5058 echo "Checking if your compiler accepts $flag" 2>&1;
5059 echo "int main(void) { return 0; }" > gcctest.c;
5060 if $cc -O2 $flag -o gcctest gcctest.c 2>gcctest.out && ./gcctest; then
5061 echo "Yes, it does." 2>&1;
5062 if $test -s gcctest.out ; then
5063 echo "But your platform does not like it:";
5068 echo "Leaving current flags $ccflags alone." 2>&1
5070 *) dflt="$dflt $flag";
5076 echo "Nope, it does not, but that is ok." 2>&1;
5080 : We will not override a previous value, but we might want to
5081 : augment a hint file
5083 default|recommended)
5084 case "$gccversion" in
5085 1*) dflt="$dflt -fpcc-struct-return" ;;
5087 case "$optimize:$DEBUGGING" in
5088 *-g*:old) dflt="$dflt -DDEBUGGING";;
5090 case "$gccversion" in
5091 2*) if $test -d /etc/conf/kconfig.d &&
5092 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
5094 # Interactive Systems (ISC) POSIX mode.
5099 case "$gccversion" in
5102 ?*) set strict-aliasing -fno-strict-aliasing
5106 # For gcc, adding -pipe speeds up compilations for some, but apparently
5107 # some assemblers can't read from stdin. (It also slows down compilations
5108 # in other cases, but those are apparently rarer these days.) AD 5/2004.
5109 case "$gccversion" in
5115 # on x86_64 (at least) we require an extra library (libssp) in the
5116 # link command line. This library is not named, so I infer that it is
5117 # an implementation detail that may change. Hence the safest approach
5118 # is to add the flag to the flags passed to the compiler at link time,
5119 # as that way the compiler can do the right implementation dependant
5121 case "$gccversion" in
5122 ?*) set stack-protector -fstack-protector
5129 case "$mips_type" in
5130 *BSD*|'') inclwanted="$locincpth $usrinc";;
5131 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
5133 for thisincl in $inclwanted; do
5134 if $test -d $thisincl; then
5135 if $test x$thisincl != x$usrinc; then
5137 *" -I$thisincl "*);;
5138 *) dflt="$dflt -I$thisincl ";;
5144 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
5146 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
5154 *) dflt="$dflt -D$2";;
5158 set signal.h LANGUAGE_C; eval $inctest
5162 ccflags="$ccflags -DSOCKS"
5167 default|recommended) dflt="$ccflags $dflt" ;;
5168 *) dflt="$ccflags";;
5177 Your C compiler may want other flags. For this question you should include
5178 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
5179 but you should NOT include libraries or ld flags like -lwhatever. If you
5180 want $package to honor its debug switch, you should include -DDEBUGGING here.
5181 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
5183 To use no flags, specify the word "none".
5189 rp="Any additional cc flags?"
5196 : the following weeds options from ccflags that are of no interest to cpp
5198 '') cppflags="$ccflags" ;;
5199 *) cppflags="$cppflags $ccflags" ;;
5201 case "$gccversion" in
5202 1*) cppflags="$cppflags -D__GNUC__"
5204 case "$mips_type" in
5206 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
5212 echo "Let me guess what the preprocessor flags are..." >&4
5226 *) ftry="$previous $flag";;
5228 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
5229 >cpp1.out 2>/dev/null && \
5230 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
5231 >cpp2.out 2>/dev/null && \
5232 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
5233 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
5235 cppflags="$cppflags $ftry"
5245 *-*) echo "They appear to be: $cppflags";;
5247 $rm -f cpp.c cpp?.out
5251 : flags used in final linking phase
5253 '') if ./venix; then
5259 *-posix*) dflt="$dflt -posix" ;;
5262 *) dflt="$ldflags";;
5264 # See note above about -fstack-protector
5266 *-fstack-protector*)
5268 *-fstack-protector*) ;; # Don't add it again
5269 *) dflt="$dflt -fstack-protector" ;;
5274 : Try to guess additional flags to pick up local libraries.
5275 for thislibdir in $libpth; do
5276 case " $loclibpth " in
5279 *"-L$thislibdir "*) ;;
5280 *) dflt="$dflt -L$thislibdir" ;;
5292 Your C linker may need flags. For this question you should
5293 include -L/whatever and any other flags used by the C linker, but you
5294 should NOT include libraries like -lwhatever.
5296 Make sure you include the appropriate -L/path flags if your C linker
5297 does not normally search all of the directories you specified above,
5300 To use no flags, specify the word "none".
5304 rp="Any additional ld flags (NOT including libraries)?"
5310 rmlist="$rmlist pdp11"
5314 echo "Checking your choice of C compiler and flags for coherency..." >&4
5315 $cat > try.c <<'EOF'
5317 int main() { printf("Ok\n"); return(0); }
5319 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
5321 $cat >try.msg <<'EOM'
5322 I've tried to compile and run the following simple program:
5325 $cat try.c >> try.msg
5327 $cat >> try.msg <<EOM
5334 and I got the following output:
5338 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5339 if $sh -c "$run ./try " >>try.msg 2>&1; then
5343 *) echo 'The program compiled OK, but produced no output.' >> try.msg
5346 cat >> try.msg <<'EOQS'
5347 If $libs contains -lsfio, and sfio is mis-configured, then it
5348 sometimes (apparently) runs and exits with a 0 status, but with no
5349 output! It may have to do with sfio's use of _exit vs. exit.
5352 rp="You have a big problem. Shall I abort Configure"
5359 echo "The program compiled OK, but exited with status $?." >>try.msg
5360 rp="You have a problem. Shall I abort Configure"
5364 echo "I can't compile the test program." >>try.msg
5365 rp="You have a BIG problem. Shall I abort Configure"
5371 case "$knowitall" in
5373 echo "(The supplied flags or libraries might be incorrect.)"
5381 *) echo "Ok. Stopping Configure." >&4
5386 n) echo "OK, that should do.";;
5388 $rm_try gcctest gcctest.out
5390 : define a shorthand compile call
5394 case "$usedevel" in $define|true|[yY]*) if $test ! -f "${mc_file}.c"; then
5395 echo "Internal Configure script bug - compiler test file ${mc_file}.c is missing. Please report this to perlbug@perl.org" >&4;
5399 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5400 : define a shorthand compile call for compilations that should be ok.
5404 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5406 : determine filename position in cpp output
5408 echo "Computing filename position in cpp output for #include directives..." >&4
5410 vos) testaccess=-e ;;
5413 echo '#include <stdio.h>' > foo.c
5416 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5417 $grep '^[ ]*#.*stdio\.h' | \
5418 while read cline; do
5421 while $test \$# -gt 0; do
5422 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5427 pos=\`expr \$pos + 1\`
5439 *) pos="${fieldn}th";;
5441 echo "Your cpp writes the filename in the $pos field of the line."
5444 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
5445 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
5448 : locate header file
5453 for usrincdir in $usrinc
5455 if test -f \$usrincdir/\$wanted; then
5456 echo "\$usrincdir/\$wanted"
5460 awkprg='{ print \$$fieldn }'
5461 echo "#include <\$wanted>" > foo\$\$.c
5462 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5463 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5464 while read cline; do
5465 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5467 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5468 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5473 # status = 0: grep returned 0 lines, case statement not executed
5474 # status = 1: headerfile found
5475 # status = 2: while loop executed, no headerfile found
5479 if test \$status -eq 1; then
5486 : define an alternate in-header-list? function
5487 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5488 cont=true; xxf="echo \"<\$1> found.\" >&4";
5489 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5490 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5492 case $# in 4) instead=instead;; *) instead="at last";; esac;
5493 while $test "$cont"; do
5495 var=$2; eval "was=\$$2";
5496 if $test "$xxx" && $test -r "$xxx";
5498 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5501 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5502 set $yyy; shift; shift; yyy=$@;
5503 case $# in 0) cont="";;
5504 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5505 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5506 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5507 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5511 do set $yyy; var=$2; eval "was=\$$2";
5512 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5513 set $yyy; shift; shift; yyy=$@;
5516 : see if stdlib is available
5517 set stdlib.h i_stdlib
5520 : check for lengths of integral types
5524 echo "Checking to see how big your integers are..." >&4
5533 printf("intsize=%d;\n", (int)sizeof(int));
5534 printf("longsize=%d;\n", (int)sizeof(long));
5535 printf("shortsize=%d;\n", (int)sizeof(short));
5540 if eval $compile_ok && $run ./try > /dev/null; then
5542 echo "Your integers are $intsize bytes long."
5543 echo "Your long integers are $longsize bytes long."
5544 echo "Your short integers are $shortsize bytes long."
5548 Help! I can't compile and run the intsize test program: please enlighten me!
5549 (This is probably a misconfiguration in your system or libraries, and
5550 you really ought to fix it. Still, I'll try anyway.)
5554 rp="What is the size of an integer (in bytes)?"
5558 rp="What is the size of a long integer (in bytes)?"
5562 rp="What is the size of a short integer (in bytes)?"
5570 : check for long long
5572 echo "Checking to see if you have long long..." >&4
5573 echo 'int main() { long long x = 7; return 0; }' > try.c
5575 if eval $compile; then
5577 echo "You have long long."
5580 echo "You do not have long long."
5586 : check for length of long long
5587 case "${d_longlong}${longlongsize}" in
5590 echo "Checking to see how big your long longs are..." >&4
5591 $cat >try.c <<'EOCP'
5595 printf("%d\n", (int)sizeof(long long));
5600 if eval $compile_ok; then
5601 longlongsize=`$run ./try`
5602 echo "Your long longs are $longlongsize bytes long."
5606 echo "(I can't seem to compile the test program. Guessing...)"
5607 rp="What is the size of a long long (in bytes)?"
5611 if $test "X$longsize" = "X$longlongsize"; then
5612 echo "(That isn't any different from an ordinary long.)"
5618 : see if inttypes.h is available
5619 : we want a real compile instead of Inhdr because some systems
5620 : have an inttypes.h which includes non-existent headers
5623 #include <inttypes.h>
5625 static int32_t foo32 = 0x12345678;
5629 if eval $compile; then
5630 echo "<inttypes.h> found." >&4
5633 echo "<inttypes.h> NOT found." >&4
5642 echo "Checking to see if you have int64_t..." >&4
5644 #include <sys/types.h>
5645 #$i_inttypes I_INTTYPES
5647 #include <inttypes.h>
5649 int main() { int64_t x = 7; }
5652 if eval $compile; then
5654 echo "You have int64_t."
5657 echo "You do not have int64_t."
5663 : Check if 64bit ints have a quad type
5665 echo "Checking which 64-bit integer type we could use..." >&4
5671 val='"unsigned int"'
5676 *) case "$longsize" in
5680 val='"unsigned long"'
5685 *) case "$d_longlong:$longlongsize" in
5690 val='"unsigned long long"'
5695 *) case "$d_int64_t" in
5714 '') echo "Alas, no 64-bit integer types in sight." >&4
5717 *) echo "We could use '$quadtype' for 64-bit integers." >&4
5722 : Do we want 64bit support
5723 case "$uselonglong" in
5724 "$define"|true|[yY]*)
5727 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
5729 use64bitint="$define"
5732 case "$use64bits" in
5733 "$define"|true|[yY]*)
5736 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
5738 use64bitint="$define"
5741 case "$use64bitints" in
5742 "$define"|true|[yY]*)
5745 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
5747 use64bitint="$define"
5750 case "$use64bitsint" in
5751 "$define"|true|[yY]*)
5754 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
5756 use64bitint="$define"
5759 case "$uselonglongs" in
5760 "$define"|true|[yY]*)
5763 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
5765 use64bitint="$define"
5768 case "$use64bitsall" in
5769 "$define"|true|[yY]*)
5772 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
5774 use64bitall="$define"
5779 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
5781 case "$use64bitall" in
5782 "$define"|true|[yY]*) use64bitint="$define" ;;
5788 You have natively 64-bit long integers.
5792 *) case "$use64bitint" in
5793 "$define"|true|[yY]*) dflt='y';;
5802 Perl can be built to take advantage of 64-bit integer types
5803 on some systems. To do so, Configure can be run with -Duse64bitint.
5804 Choosing this option will most probably introduce binary incompatibilities.
5806 If this doesn't make any sense to you, just accept the default '$dflt'.
5807 (The default has been chosen based on your configuration.)
5809 rp='Try to use 64-bit integers, if available?'
5812 [yY]*) val="$define" ;;
5820 case "$use64bitall" in
5821 "$define"|true|[yY]*) dflt='y' ;;
5822 *) case "$longsize" in
5830 You may also choose to try maximal 64-bitness. It means using as much
5831 64-bitness as possible on the platform. This in turn means even more
5832 binary incompatibilities. On the other hand, your platform may not
5833 have any more 64-bitness available than what you already have chosen.
5835 If this doesn't make any sense to you, just accept the default '$dflt'.
5836 (The default has been chosen based on your configuration.)
5838 rp='Try to use maximal 64-bit support, if available?'
5841 [yY]*) val="$define" ;;
5846 case "$use64bitall" in
5848 case "$use64bitint" in
5852 Since you have chosen a maximally 64-bit build, I'm also turning on
5853 the use of 64-bit integers.
5855 use64bitint="$define" ;;
5860 : Look for a hint-file generated 'call-back-unit'. If the
5861 : user has specified that a 64-bit perl is to be built,
5862 : we may need to set or change some other defaults.
5863 if $test -f use64bitint.cbu; then
5864 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
5867 case "$use64bitint" in
5868 "$define"|true|[yY]*)
5870 4) case "$archname64" in
5871 '') archname64=64int ;;
5878 : Look for a hint-file generated 'call-back-unit'. If the
5879 : user has specified that a maximally 64-bit perl is to be built,
5880 : we may need to set or change some other defaults.
5881 if $test -f use64bitall.cbu; then
5882 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
5885 case "$use64bitall" in
5886 "$define"|true|[yY]*)
5888 4) case "$archname64" in
5889 ''|64int) archname64=64all ;;
5896 case "$d_quad:$use64bitint" in
5900 *** You have chosen to use 64-bit integers,
5901 *** but none can be found.
5902 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
5903 *** Cannot continue, aborting.
5910 : check for length of double
5912 case "$doublesize" in
5914 echo "Checking to see how big your double precision numbers are..." >&4
5923 printf("%d\n", (int)sizeof(double));
5928 if eval $compile_ok; then
5929 doublesize=`$run ./try`
5930 echo "Your double is $doublesize bytes long."
5933 echo "(I can't seem to compile the test program. Guessing...)"
5934 rp="What is the size of a double precision number (in bytes)?"
5942 : check for long doubles
5944 echo "Checking to see if you have long double..." >&4
5945 echo 'int main() { long double x = 7.0; }' > try.c
5947 if eval $compile; then
5949 echo "You have long double."
5952 echo "You do not have long double."
5958 : check for length of long double
5959 case "${d_longdbl}${longdblsize}" in
5962 echo "Checking to see how big your long doubles are..." >&4
5963 $cat >try.c <<'EOCP'
5967 printf("%d\n", sizeof(long double));
5972 if eval $compile; then
5973 longdblsize=`$run ./try`
5974 echo "Your long doubles are $longdblsize bytes long."
5978 echo "(I can't seem to compile the test program. Guessing...)" >&4
5979 rp="What is the size of a long double (in bytes)?"
5983 if $test "X$doublesize" = "X$longdblsize"; then
5984 echo "That isn't any different from an ordinary double."
5985 echo "I'll keep your setting anyway, but you may see some"
5986 echo "harmless compilation warnings."
5992 : determine the architecture name
5994 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
5995 tarch=`arch`"-$osname"
5996 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
5997 if uname -m > tmparch 2>&1 ; then
5998 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
5999 -e 's/$/'"-$osname/" tmparch`
6007 case "$myarchname" in
6010 echo "(Your architecture name used to be $myarchname.)"
6014 case "$targetarch" in
6016 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
6021 *) dflt="$archname";;
6023 rp='What is your architecture name'
6027 : optionally add api version to the architecture for versioned archlibs
6028 case "$useversionedarchname" in
6029 $define|true|[yY]*) dflt='y';;
6032 rp='Add the Perl API version to your archname?'
6035 y|Y) useversionedarchname="$define" ;;
6036 *) useversionedarchname="$undef" ;;
6038 case "$useversionedarchname" in
6041 *-$api_versionstring)
6042 echo "...and architecture name already has -$api_versionstring" >&4
6045 archname="$archname-$api_versionstring"
6046 echo "...setting architecture name to $archname." >&4
6052 case "$usethreads" in
6054 echo "Threads selected." >&4
6056 *-thread*) echo "...and architecture name already has -thread." >&4
6058 *) archname="$archname-thread"
6059 echo "...setting architecture name to $archname." >&4
6064 case "$usemultiplicity" in
6066 echo "Multiplicity selected." >&4
6068 *-multi*) echo "...and architecture name already has -multi." >&4
6070 *) archname="$archname-multi"
6071 echo "...setting architecture name to $archname." >&4
6076 case "$use64bitint$use64bitall" in
6078 case "$archname64" in
6080 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
6083 case "$use64bitint" in
6084 "$define") echo "64 bit integers selected." >&4 ;;
6086 case "$use64bitall" in
6087 "$define") echo "Maximal 64 bitness selected." >&4 ;;
6090 *-$archname64*) echo "...and architecture name already has $archname64." >&4
6092 *) archname="$archname-$archname64"
6093 echo "...setting architecture name to $archname." >&4
6099 case "$uselongdouble" in
6101 echo "Long doubles selected." >&4
6102 case "$longdblsize" in
6104 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
6108 *-ld*) echo "...and architecture name already has -ld." >&4
6110 *) archname="$archname-ld"
6111 echo "...setting architecture name to $archname." >&4
6118 if $test -f archname.cbu; then
6119 echo "Your platform has some specific hints for architecture name, using them..."
6123 : set the prefixit variable, to compute a suitable default value
6124 prefixit='case "$3" in
6126 case "$oldprefix" in
6127 "") eval "$1=\"\$$2\"";;
6134 ""|" ") eval "$1=\"\$$2\"";;
6140 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
6142 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
6143 /*-$oldprefix/*|\~*-$oldprefix/*)
6144 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
6145 *) eval "$1=\"\$$2\"";;
6149 : determine installation style
6150 : For now, try to deduce it from prefix unless it is already set.
6151 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
6152 case "$installstyle" in
6153 '') case "$prefix" in
6154 *perl*) dflt='lib';;
6155 *) dflt='lib/perl5' ;;
6158 *) dflt="$installstyle" ;;
6160 : Probably not worth prompting for this since we prompt for all
6161 : the directories individually, and the prompt would be too long and
6165 : determine where public executables go
6170 rp='Pathname where the public executables will reside?'
6172 if $test "X$ansexp" != "X$binexp"; then
6176 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
6177 : XXX If this is fixed, also fix the "start perl" hunk below, which relies on
6178 : this via initialinstalllocation
6181 case "$userelocatableinc" in
6182 $define|true|[yY]*) dflt='y' ;;
6187 Would you like to build Perl so that the installation is relocatable, so that
6188 library paths in @INC are determined relative to the path of the perl binary?
6189 This is not advised for system Perl installs, or if you need to run setid
6190 scripts or scripts under taint mode.
6192 If this doesn't make any sense to you, just accept the default '$dflt'.
6194 rp='Use relocatable @INC?'
6197 y|Y) val="$define" ;;
6200 set userelocatableinc
6203 initialinstalllocation="$binexp"
6204 : Default prefix is now "up one level from where the binaries are"
6205 case "$userelocatableinc" in
6211 installprefixexp=".../.."
6215 : determine where private library files go
6216 : Usual default is /usr/local/lib/perl5/$version.
6217 : Also allow things like /opt/perl/lib/$version, since
6218 : /opt/perl/lib/perl5... would be redundant.
6219 : The default "style" setting is made in installstyle.U
6220 case "$installstyle" in
6221 *lib/perl5*) set dflt privlib lib/$package/$version ;;
6222 *) set dflt privlib lib/$version ;;
6227 There are some auxiliary files for $package that need to be put into a
6228 private library directory that is accessible by everyone.
6233 rp='Pathname where the private library files will reside?'
6238 : set the prefixup variable, to restore leading tilda escape
6239 prefixup='case "$prefixexp" in
6241 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
6244 : determine where public architecture dependent libraries go
6247 : privlib default is /usr/local/lib/$package/$version
6248 : archlib default is /usr/local/lib/$package/$version/$archname
6249 : privlib may have an optional trailing /share.
6250 tdflt=`echo $privlib | $sed 's,/share$,,'`
6251 tdflt=$tdflt/$archname
6260 $spackage contains architecture-dependent library files. If you are
6261 sharing libraries in a heterogeneous environment, you might store
6262 these files in a separate location. Otherwise, you can just include
6263 them with the rest of the public library files.
6268 rp='Where do you want to put the public architecture-dependent libraries?'
6272 if $test X"$archlib" = X"$privlib"; then
6278 : see if setuid scripts can be secure
6281 Some kernels have a bug that prevents setuid #! scripts from being
6282 secure. Some sites have disabled setuid #! scripts because of this.
6284 First let's decide if your kernel supports secure setuid #! scripts.
6285 (If setuid #! scripts would be secure but have been disabled anyway,
6286 don't say that they are secure if asked.)
6291 if $test -d /dev/fd; then
6292 echo "#!$ls" >reflect
6293 chmod +x,u+s reflect
6294 ./reflect >flect 2>&1
6295 if $contains "/dev/fd" flect >/dev/null; then
6296 echo "Congratulations, your kernel has secure setuid scripts!" >&4
6300 If you are not sure if they are secure, I can check but I'll need a
6301 username and password different from the one you are using right now.
6302 If you don't have such a username or don't want me to test, simply
6306 rp='Other username to test security of setuid scripts with?'
6311 case "$d_suidsafe" in
6312 '') echo "I'll assume setuid scripts are *not* secure." >&4
6315 echo "Well, the $hint value is *not* secure." >&4
6317 *) echo "Well, the $hint value *is* secure." >&4
6322 $rm -f reflect flect
6323 echo "#!$ls" >reflect
6324 chmod +x,u+s reflect
6327 echo '"su" will (probably) prompt you for '"$ans's password."
6328 su $ans -c './reflect >flect'
6329 if $contains "/dev/fd" flect >/dev/null; then
6330 echo "Okay, it looks like setuid scripts are secure." >&4
6333 echo "I don't think setuid scripts are secure." >&4
6338 rp='Does your kernel have *secure* setuid scripts?'
6341 [yY]*) val="$define";;
6346 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
6347 echo "(That's for file descriptors, not floppy disks.)"
6353 $rm -f reflect flect
6355 : now see if they want to do setuid emulation
6356 if $test $patchlevel -lt 11; then
6359 case "$d_suidsafe" in
6362 echo "No need to emulate SUID scripts since they are secure here." >&4
6366 Some systems have disabled setuid scripts, especially systems where
6367 setuid scripts cannot be secure. On systems where setuid scripts have
6368 been disabled, the setuid/setgid bits on scripts are currently
6369 useless. It is possible for $package to detect those bits and emulate
6370 setuid/setgid in a secure fashion. This emulation will only work if
6371 setuid scripts have been disabled in your kernel.
6375 "$define") dflt=y ;;
6378 rp="Do you want to do setuid/setgid emulation?"
6381 [yY]*) val="$define";;
6393 SUID emulation has been removed for 5.12
6394 Please re-run Configure without -Dd_dosuid
6403 : Find perl5.005 or later.
6404 echo "Looking for a previously installed perl5.005 or later... "
6406 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
6407 : Check if this perl is recent and can load a simple module
6408 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6411 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6421 '') echo "None found. That's ok.";;
6422 *) echo "Using $perl5." ;;
6425 : Set the siteprefix variables
6428 After $package is installed, you may wish to install various
6429 add-on modules and utilities. Typically, these add-ons will
6430 be installed under $prefix with the rest
6431 of this package. However, you may wish to install such add-ons
6432 elsewhere under a different prefix.
6434 If you do not wish to put everything under a single prefix, that's
6435 ok. You will be prompted for the individual locations; this siteprefix
6436 is only used to suggest the defaults.
6438 The default should be fine for most people.
6442 rp='Installation prefix to use for add-on modules and utilities?'
6443 : XXX Here might be another good place for an installstyle setting.
6444 case "$siteprefix" in
6446 *) dflt=$siteprefix ;;
6449 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6451 case "$siteprefix" in
6455 *) oldsiteprefix="$prefix";;
6460 siteprefixexp="$ansexp"
6462 : determine where site specific libraries go.
6463 : Usual default is /usr/local/lib/perl5/site_perl/$version
6464 : The default "style" setting is made in installstyle.U
6465 : XXX No longer works with Prefixit stuff.
6466 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6468 '') case "$installstyle" in
6469 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
6470 *) dflt=$siteprefix/lib/site_$prog/$version ;;
6478 The installation process will create a directory for
6479 site-specific extensions and modules. Most users find it convenient
6480 to place all site-specific files in this directory rather than in the
6481 main distribution directory.
6485 rp='Pathname for the site-specific library files?'
6489 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6491 : Determine list of previous versions to include in @INC
6492 $cat > getverlist <<EOPL
6495 \$api_versionstring = "$api_versionstring";
6496 \$version = "$version";
6497 \$stem = "$sitelib_stem";
6498 \$archname = "$archname";
6500 $cat >> getverlist <<'EOPL'
6501 # The list found is store twice for each entry: the original name, and
6502 # the binary broken down version as pack "sss", so sorting is easy and
6503 # unambiguous. This will work for all versions that have a maximum of
6504 # three digit groups, separate by '.'s or '_'s. Names are extended with
6505 # ".0.0" to ensure at least three elements for the pack.
6506 # -- H.Merijn Brand (m)'06 23-10-2006
6508 # Can't have leading @ because metaconfig interprets it as a command!
6509 ;@inc_version_list=();
6510 # XXX Redo to do opendir/readdir?
6513 ;@candidates = map {
6514 [ $_, pack "sss", split m/[._]/, "$_.0.0" ] } glob("5.*");
6515 ;@candidates = sort { $a->[1] cmp $b->[1]} @candidates;
6521 ($pversion, $aversion, $vsn5005) = map {
6522 pack "sss", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005";
6523 foreach $d (@candidates) {
6524 if ($d->[1] lt $pversion) {
6525 if ($d->[1] ge $aversion) {
6526 unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]);
6528 elsif ($d->[1] ge $vsn5005) {
6529 unshift(@inc_version_list, grep { -d } $d->[0]);
6533 # Skip newer version. I.e. don't look in
6534 # 5.7.0 if we're installing 5.6.1.
6538 if (@inc_version_list) {
6539 print join(' ', @inc_version_list);
6542 # Blank space to preserve value for next Configure run.
6547 case "$inc_version_list" in
6548 '') if test -x "$perl5$exe_ext"; then
6549 dflt=`$perl5 getverlist`
6554 $undef) dflt='none' ;;
6555 *) eval dflt=\"$inc_version_list\" ;;
6558 ''|' ') dflt=none ;;
6565 In order to ease the process of upgrading, this version of perl
6566 can be configured to use modules built and installed with earlier
6567 versions of perl that were installed under $prefix. Specify here
6568 the list of earlier versions that this version of perl should check.
6569 If Configure detected no earlier versions of perl installed under
6570 $prefix, then the list will be empty. Answer 'none' to tell perl
6571 to not search earlier versions.
6573 The default should almost always be sensible, so if you're not sure,
6574 just accept the default.
6577 rp='List of earlier versions to include in @INC?'
6580 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
6581 *) inc_version_list="$ans" ;;
6583 case "$inc_version_list" in
6585 inc_version_list_init='0'
6586 d_inc_version_list="$undef"
6588 *) inc_version_list_init=`echo $inc_version_list |
6589 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
6590 d_inc_version_list="$define"
6595 : see if malloc/malloc.h has to be included
6596 set malloc/malloc.h i_mallocmalloc
6599 : see if this is a malloc.h system
6600 : we want a real compile instead of Inhdr because some systems have a
6601 : malloc.h that just gives a compile error saying to use stdlib.h instead
6606 #$i_mallocmalloc I_MALLOCMALLOC
6607 #ifdef I_MALLOCMALLOC
6608 # include <malloc/malloc.h>
6611 int main () { return 0; }
6614 if eval $compile; then
6615 echo "<malloc.h> found." >&4
6618 echo "<malloc.h> NOT found." >&4
6625 : check for void type
6627 echo "Checking to see how well your C compiler groks the void type..." >&4
6628 case "$voidflags" in
6640 extern void moo(); /* function returning void */
6641 void (*goo)(); /* ptr to func returning void */
6643 void *hue; /* generic ptr */
6656 int main() { sub(); }
6658 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
6659 voidflags=$defvoidused
6660 echo "Good. It appears to support void to the level $package wants.">&4
6661 if $contains warning .out >/dev/null 2>&1; then
6662 echo "However, you might get some warnings that look like this:"
6666 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
6667 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
6668 echo "It supports 1..."
6669 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
6670 echo "It also supports 2..."
6671 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
6673 echo "And it supports 4 but not 8 definitely."
6675 echo "It doesn't support 4..."
6676 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
6678 echo "But it supports 8."
6681 echo "Neither does it support 8."
6685 echo "It does not support 2..."
6686 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
6688 echo "But it supports 4 and 8."
6690 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
6692 echo "And it supports 4 but has not heard about 8."
6694 echo "However it supports 8 but not 4."
6699 echo "There is no support at all for void."
6704 case "$voidflags" in
6707 Support flag bits are:
6708 1: basic void declarations.
6709 2: arrays of pointers to functions returning void.
6710 4: operations between pointers to and addresses of void functions.
6711 8: generic void pointers.
6714 rp="Your void support flags add up to what?"
6721 : check for length of pointer
6725 echo "Checking to see how big your pointers are..." >&4
6726 if test "$voidflags" -gt 7; then
6727 echo '#define VOID_PTR char *' > try.c
6729 echo '#define VOID_PTR void *' > try.c
6739 printf("%d\n", (int)sizeof(VOID_PTR));
6744 if eval $compile_ok; then
6745 ptrsize=`$run ./try`
6746 echo "Your pointers are $ptrsize bytes long."
6749 echo "(I can't seem to compile the test program. Guessing...)" >&4
6750 rp="What is the size of a pointer (in bytes)?"
6757 case "$use64bitall" in
6758 "$define"|true|[yY]*)
6762 *** You have chosen a maximally 64-bit build,
6763 *** but your pointers are only 4 bytes wide.
6764 *** Please rerun Configure without -Duse64bitall.
6769 *** Since you have quads, you could possibly try with -Duse64bitint.
6774 *** Cannot continue, aborting.
6785 : determine whether to use malloc wrapping
6787 case "$usemallocwrap" in
6788 [yY]*|true|$define) dflt='y' ;;
6789 [nN]*|false|$undef) dflt='n' ;;
6790 *) case "$usedevel" in
6791 [yY]*|true|$define) dflt='y' ;;
6796 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
6798 usemallocwrap="$ans"
6801 usemallocwrap="$define" ;;
6803 usemallocwrap="$undef" ;;
6806 : determine which malloc to compile in
6808 case "$usemymalloc" in
6809 [yY]*|true|$define) dflt='y' ;;
6810 [nN]*|false|$undef) dflt='n' ;;
6811 *) case "$ptrsize" in
6815 if test "$useithreads" = "$define"; then dflt='n'; fi
6818 rp="Do you wish to attempt to use the malloc that comes with $package?"
6824 mallocsrc='malloc.c'
6825 mallocobj="malloc$_o"
6826 d_mymalloc="$define"
6829 : Remove malloc from list of libraries to use
6830 echo "Removing unneeded -lmalloc from library list" >&4
6831 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
6834 echo "libs = $libs" >&4
6846 : compute the return types of malloc and free
6848 $cat >malloc.c <<END
6852 #include <sys/types.h>
6866 case "$malloctype" in
6868 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
6875 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
6879 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
6886 echo "Your system uses $freetype free(), it would seem." >&4
6888 : determine where site specific architecture-dependent libraries go.
6889 : sitelib default is /usr/local/lib/perl5/site_perl/$version
6890 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6891 : sitelib may have an optional trailing /share.
6893 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
6894 dflt="$dflt/$archname"
6899 set sitearch sitearch none
6903 The installation process will also create a directory for
6904 architecture-dependent site-specific extensions and modules.
6908 rp='Pathname for the site-specific architecture-dependent library files?'
6912 if $test X"$sitearch" = X"$sitelib"; then
6915 d_sitearch="$define"
6918 : Set the vendorprefix variables
6921 The installation process will also create a directory for
6922 vendor-supplied add-ons. Vendors who supply perl with their system
6923 may find it convenient to place all vendor-supplied files in this
6924 directory rather than in the main distribution directory. This will
6925 ease upgrades between binary-compatible maintenance versions of perl.
6927 Of course you may also use these directories in whatever way you see
6928 fit. For example, you might use them to access modules shared over a
6929 company-wide network.
6931 The default answer should be fine for most people.
6932 This causes further questions about vendor add-ons to be skipped
6933 and no vendor-specific directories will be configured for perl.
6936 rp='Do you want to configure vendor-specific add-on directories?'
6937 case "$usevendorprefix" in
6938 define|true|[yY]*) dflt=y ;;
6939 *) : User may have set vendorprefix directly on Configure command line.
6940 case "$vendorprefix" in
6949 rp='Installation prefix to use for vendor-supplied add-ons?'
6950 case "$vendorprefix" in
6952 *) dflt=$vendorprefix ;;
6955 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6957 case "$vendorprefix" in
6961 *) oldvendorprefix="$prefix";;
6965 usevendorprefix="$define"
6967 vendorprefixexp="$ansexp"
6969 *) usevendorprefix="$undef"
6975 : Set the vendorlib variables
6976 case "$vendorprefix" in
6977 '') d_vendorlib="$undef"
6981 *) d_vendorlib="$define"
6982 : determine where vendor-supplied modules go.
6983 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
6984 case "$vendorlib" in
6986 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6987 case "$installstyle" in
6988 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
6989 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
6992 *) dflt="$vendorlib"
6996 rp='Pathname for the vendor-supplied library files?'
6999 vendorlibexp="$ansexp"
7002 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
7006 : Set the vendorarch variables
7007 case "$vendorprefix" in
7008 '') d_vendorarch="$undef"
7012 *) d_vendorarch="$define"
7013 : determine where vendor-supplied architecture-dependent libraries go.
7014 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
7015 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
7016 : vendorlib may have an optional trailing /share.
7017 case "$vendorarch" in
7018 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
7019 dflt="$dflt/$archname"
7021 *) dflt="$vendorarch" ;;
7024 rp='Pathname for vendor-supplied architecture-dependent files?'
7027 vendorarchexp="$ansexp"
7030 prefixvar=vendorarch
7032 if $test X"$vendorarch" = X"$vendorlib"; then
7033 d_vendorarch="$undef"
7035 d_vendorarch="$define"
7038 : Final catch-all directories to search
7041 Lastly, you can have perl look in other directories for extensions and
7042 modules in addition to those already specified.
7043 These directories will be searched after
7047 test X"$vendorlib" != "X" && echo ' ' $vendorlib
7048 test X"$vendorarch" != "X" && echo ' ' $vendorarch
7050 case "$otherlibdirs" in
7051 ''|' ') dflt='none' ;;
7052 *) dflt="$otherlibdirs" ;;
7055 Enter a colon-separated set of extra paths to include in perl's @INC
7056 search path, or enter 'none' for no extra paths.
7060 rp='Colon-separated list of additional directories for perl to search?'
7063 ' '|''|none) otherlibdirs=' ' ;;
7064 *) otherlibdirs="$ans" ;;
7066 case "$otherlibdirs" in
7070 set d_perl_otherlibdirs
7073 : Cruising for prototypes
7075 echo "Checking out function prototypes..." >&4
7076 $cat >prototype.c <<EOCP
7081 int main(int argc, char *argv[]) {
7084 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
7085 echo "Your C compiler appears to support function prototypes."
7088 echo "Your C compiler doesn't seem to understand function prototypes."
7095 : Check if ansi2knr is required
7096 case "$prototype" in
7098 *) ansi2knr='ansi2knr'
7103 This version of $package can only be compiled by a compiler that
7104 understands function prototypes. Unfortunately, your C compiler
7106 doesn't seem to understand them. Sorry about that.
7108 If GNU cc is available for your system, perhaps you could try that instead.
7110 Eventually, we hope to support building Perl with pre-ANSI compilers.
7111 If you would like to help in that effort, please contact <perlbug@perl.org>.
7113 Aborting Configure now.
7120 dflt_dtrace='/usr/sbin/dtrace'
7121 $test -x /usr/bin/dtrace && dflt_dtrace='/usr/bin/dtrace'
7125 Perl can be built to support DTrace on platforms that support it.
7126 DTrace is a diagnosis and performance analysis tool from Sun.
7128 If this doesn't make any sense to you, just accept the default '$dflt'.
7132 case "$usedtrace" in
7138 dflt_dtrace=$usedtrace
7145 rp='Support DTrace if available?'
7148 y|Y) val="$define" ;;
7154 test "X$usedtrace" != "X$define" && break
7157 rp='Where is the dtrace executable?'
7166 if $dtrace -h -s ../perldtrace.d \
7167 -o perldtrace.tmp >/dev/null 2>&1 \
7168 && rm -f perldtrace.tmp
7171 echo "Good: your $dtrace knows about the -h flag."
7175 *** $me: Fatal Error: $dtrace doesn't support -h flag
7177 *** Your installed dtrace doesn't support the -h switch to compile a D
7178 *** program into a C header. Can't continue.
7190 *** $me: Fatal Error: $dtrace not found.
7197 echo "*** $dtrace was not found."
7203 : See if we want extra modules installed
7210 Perl can be built with extra modules or bundles of modules which
7211 will be fetched from the CPAN and installed alongside Perl.
7213 Notice that you will need access to the CPAN; either via the Internet,
7214 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
7215 be asked later to configure the CPAN.pm module which will in turn do
7216 the installation of the rest of the extra modules or bundles.)
7218 Notice also that if the modules require any external software such as
7219 libraries and headers (the libz library and the zlib.h header for the
7220 Compress::Zlib module, for example) you MUST have any such software
7221 already installed, this configuration process will NOT install such
7224 If this doesn't make any sense to you, just accept the default '$dflt'.
7226 rp='Install any extra modules (y or n)?'
7232 Please list any extra modules or bundles to be installed from CPAN,
7233 with spaces between the names. The names can be in any format the
7234 'install' command of CPAN.pm will understand. (Answer 'none',
7235 without the quotes, to install no extra modules or bundles.)
7245 $rm -f ../extras.lst
7247 *) echo "(Saving the list of extras for later...)"
7248 echo "$extras" > ../extras.lst
7256 : determine where html pages for programs go
7257 set html1dir html1dir none
7261 If you wish to install html files for programs in $spackage, indicate
7262 the appropriate directory here. To skip installing html files,
7266 ''|none|$undef|' ') dflt=none ;;
7267 *) dflt=$html1dir ;;
7270 rp="Directory for the main $spackage html pages?"
7274 : Use ' ' for none so value is preserved next time through Configure
7275 $test X"$html1dir" = "X" && html1dir=' '
7277 : determine where html pages for libraries and modules go
7278 set html3dir html3dir none
7282 If you wish to install html files for modules associated with $spackage,
7283 indicate the appropriate directory here. To skip installing html files,
7286 : There is no obvious default. If they have specified html1dir, then
7287 : try to key off that, possibly changing .../html1 into .../html3.
7289 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
7290 *) dflt=$html3dir ;;
7293 rp="Directory for the $spackage module html pages?"
7297 : Use ' ' for none so value is preserved next time through Configure
7298 $test X"$html3dir" = "X" && html3dir=' '
7300 : determine whether to install perl also as /usr/bin/perl
7303 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
7305 Many scripts expect perl to be installed as /usr/bin/perl.
7307 If you want to, I can install the perl you are about to compile
7308 as /usr/bin/perl (in addition to $bin/perl).
7310 if test -f /usr/bin/perl; then
7313 However, please note that because you already have a /usr/bin/perl,
7314 overwriting that with a new Perl would very probably cause problems.
7315 Therefore I'm assuming you don't want to do that (unless you insist).
7318 case "$installusrbinperl" in
7319 "$define"|[yY]*) dflt='y';;
7325 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
7328 case "$installusrbinperl" in
7329 "$undef"|[nN]*) dflt='n';;
7333 rp="Do you want to install perl as /usr/bin/perl?"
7336 [yY]*) val="$define";;
7342 set installusrbinperl
7345 : Check if we are using the GNU C library
7347 echo "Checking for GNU C Library..." >&4
7349 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
7350 alone are insufficient to distinguish different versions, such as
7351 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
7352 libc version 2.1.0. A. Dougherty, June 3, 2002.
7358 # ifdef __GLIBC_MINOR__
7359 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus)
7360 # include <gnu/libc-version.h>
7361 printf("%s\n", gnu_get_libc_version());
7363 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
7366 printf("%d\n", __GLIBC__);
7375 if eval $compile_ok && $run ./try > glibc.ver; then
7377 gnulibc_version=`$cat glibc.ver`
7378 echo "You are using the GNU C Library version $gnulibc_version"
7382 echo "You are not using the GNU C Library"
7388 : see if nm is to be used to determine whether a symbol is defined or not
7392 case "$d_gnulibc" in
7395 echo "nm probably won't work on the GNU C Library." >&4
7401 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
7403 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
7404 echo "'nm' won't be sufficient on this sytem." >&4
7410 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
7411 if $test $dflt -gt 20; then
7421 true|$define) dflt=y;;
7428 I can use $nm to extract the symbols from your C libraries. This
7429 is a time consuming task which may generate huge output on the disk (up
7430 to 3 megabytes) but that should make the symbols extraction faster. The
7431 alternative is to skip the 'nm' extraction part and to compile a small
7432 test program instead to determine whether each symbol is present. If
7433 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
7434 this may be the best solution.
7436 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
7439 rp="Shall I use $nm to extract C symbols from the libraries?"
7442 [Nn]*) usenm=false;;
7451 : nm options which may be necessary
7453 '') if $test -f /mach_boot; then
7455 elif $test -d /usr/ccs/lib; then
7456 nm_opt='-p' # Solaris (and SunOS?)
7457 elif $test -f /dgux; then
7459 elif $test -f /lib64/rld; then
7460 nm_opt='-p' # 64-bit Irix
7466 : nm options which may be necessary for shared libraries but illegal
7467 : for archive libraries. Thank you, Linux.
7468 case "$nm_so_opt" in
7469 '') case "$myuname" in
7471 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
7472 nm_so_opt='--dynamic'
7479 : Figure out where the libc is located
7482 : get list of predefined functions in a handy place
7487 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
7493 *) for thislib in $libs; do
7496 : Handle C library specially below.
7499 thislib=`echo $thislib | $sed -e 's/^-l//'`
7500 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
7502 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
7504 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
7506 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
7508 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
7510 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
7512 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
7517 libnames="$libnames $try"
7519 *) libnames="$libnames $thislib" ;;
7528 for xxx in $libpth; do
7529 $test -r $1 || set $xxx/libc.$so
7530 : The messy sed command sorts on library version numbers.
7532 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
7533 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
7535 s/[0-9][0-9]*/0000&/g
7536 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
7539 $sort | $sed -e 's/^.* //'`
7542 $test -r $1 || set /usr/ccs/lib/libc.$so
7543 $test -r $1 || set /lib/libsys_s$_a
7549 if $test -r "$1"; then
7550 echo "Your (shared) C library seems to be in $1."
7552 elif $test -r /lib/libc && $test -r /lib/clib; then
7553 echo "Your C library seems to be in both /lib/clib and /lib/libc."
7555 libc='/lib/clib /lib/libc'
7556 if $test -r /lib/syslib; then
7557 echo "(Your math library is in /lib/syslib.)"
7558 libc="$libc /lib/syslib"
7560 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7561 echo "Your C library seems to be in $libc, as you said before."
7562 elif $test -r $incpath/usr/lib/libc$_a; then
7563 libc=$incpath/usr/lib/libc$_a;
7564 echo "Your C library seems to be in $libc. That's fine."
7565 elif $test -r /lib/libc$_a; then
7567 echo "Your C library seems to be in $libc. You're normal."
7569 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
7571 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
7572 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
7573 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
7575 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7577 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7580 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
7582 if $test -r "$tans"; then
7583 echo "Your C library seems to be in $tans, of all places."
7589 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7593 If the guess above is wrong (which it might be if you're using a strange
7594 compiler, or your machine supports multiple models), you can override it here.
7599 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
7601 I can't seem to find your C library. I've looked in the following places:
7604 $sed 's/^/ /' libpath
7607 None of these seems to contain your C library. I need to get its name...
7612 rp='Where is your C library?'
7617 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
7618 set X `cat libnames`
7621 case $# in 1) xxx=file; esac
7622 echo "Extracting names from the following $xxx for later perusal:" >&4
7624 $sed 's/^/ /' libnames >&4
7626 $echo $n "This may take a while...$c" >&4
7630 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
7631 *) $nm $nm_opt $file 2>/dev/null;;
7636 $grep fprintf libc.tmp > libc.ptf
7637 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
7638 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
7640 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
7642 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7644 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
7646 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7648 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
7650 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7652 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
7654 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7656 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
7658 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7660 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
7662 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7664 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
7665 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
7667 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7669 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
7671 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7673 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
7675 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7677 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
7679 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7681 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
7683 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7685 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
7687 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7689 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
7691 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7693 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
7695 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7698 $nm -p $* 2>/dev/null >libc.tmp
7699 $grep fprintf libc.tmp > libc.ptf
7700 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
7701 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
7707 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
7709 if $ar t $libc > libc.tmp && \
7710 $contains '^fprintf$' libc.tmp >/dev/null 2>&1
7712 for thisname in $libnames $libc; do
7713 $ar t $thisname >>libc.tmp
7715 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
7717 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
7718 for thisname in $libnames $libc; do
7719 $ar tv $thisname >>libc.tmp
7720 emximp -o tmp.imp $thisname \
7722 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
7723 < tmp.imp >>libc.tmp
7726 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
7729 echo "$ar didn't seem to work right." >&4
7730 echo "Maybe this is a Cray...trying bld instead..." >&4
7732 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list &&
7735 for thisname in $libnames; do
7737 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
7738 $ar t $thisname >>libc.tmp
7742 echo "That didn't work either. Giving up." >&4
7752 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
7753 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
7755 *) if $test -f /lib/syscalls.exp; then
7757 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
7758 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' \
7759 /lib/syscalls.exp >>libc.list
7765 $rm -f libnames libpath
7767 : see if dld is available
7771 : Check if we are using C++
7773 echo "Checking for C++..." >&4
7774 $cat >try.c <<'EOCP'
7786 if eval $compile_ok && $run ./try; then
7788 echo "You are using a C++ compiler."
7791 echo "You are not using a C++ compiler."
7797 : is a C symbol defined?
7800 -v) tf=libc.tmp; tdc="";;
7801 -a) tf=libc.tmp; tdc="[]";;
7802 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
7804 case "$d_cplusplus" in
7805 $define) extern_C="extern \"C\"" ;;
7806 *) extern_C="extern" ;;
7809 case "$reuseval-$4" in
7811 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
7816 if $test "$runnm" = true; then
7817 if $contains $tlook $tf >/dev/null 2>&1; then
7819 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
7820 echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7821 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
7822 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
7826 echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7827 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
7833 $define) tval=true;;
7840 : define an is-in-libc? function
7841 inlibc='echo " "; td=$define; tu=$undef;
7842 sym=$1; var=$2; eval "was=\$$2";
7844 case "$reuseval$was" in
7854 echo "$sym() found." >&4;
7855 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
7857 echo "$sym() NOT found." >&4;
7858 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
7862 $define) echo "$sym() found." >&4;;
7863 *) echo "$sym() NOT found." >&4;;
7867 : see if dlopen exists
7869 xxx_ccflags="$ccflags"
7871 : with g++ one needs -shared to get is-in-libc to work for dlopen
7872 case "$gccversion" in
7874 *) case "$d_cplusplus" in
7875 "$define") ccflags="$ccflags -shared" ;;
7882 ccflags="$xxx_ccflags"
7884 : see if this is a unistd.h system
7885 set unistd.h i_unistd
7888 : determine which dynamic loading, if any, to compile in
7890 dldir="ext/DynaLoader"
7903 $define) dflt='y' ;;
7906 $define) dflt='y' ;;
7908 : Does a dl_xxx.xs file exist for this operating system
7909 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
7912 rp="Do you wish to use dynamic loading?"
7920 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
7921 dflt="$dldir/dl_${osname}.xs"
7922 elif $test "$d_dlopen" = "$define" ; then
7923 dflt="$dldir/dl_dlopen.xs"
7924 elif $test "$i_dld" = "$define" ; then
7925 dflt="$dldir/dl_dld.xs"
7930 *) dflt="$dldir/$dlsrc"
7933 echo "The following dynamic loading files are available:"
7934 : Can not go over to $dldir because getfile has path hard-coded in.
7935 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
7936 rp="Source file to use for dynamic loading"
7942 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
7946 Some systems may require passing special flags to $cc -c to
7947 compile modules that will be used to create a shared library.
7948 To use no flags, say "none".
7951 case "$cccdlflags" in
7952 '') case "$gccversion" in
7953 '') case "$osname" in
7955 next) dflt='none' ;;
7956 irix*) dflt='-KPIC' ;;
7957 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
7958 sunos) dflt='-pic' ;;
7962 *) case "$osname" in
7963 darwin) dflt='none' ;;
7964 linux*|svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
7969 *) dflt="$cccdlflags" ;;
7971 rp="Any special flags to pass to $cc -c to compile shared library modules?"
7974 none) cccdlflags=' ' ;;
7975 *) cccdlflags="$ans" ;;
7980 Some systems use ld to create libraries that can be dynamically loaded,
7981 while other systems (such as those using ELF) use $cc.
7985 : Determine if this is ELF
7987 /* Test for whether ELF binaries are produced */
7999 int i = open("a.out",O_RDONLY);
8002 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
8003 exit(0); /* succeed (yes, it is ELF) */
8008 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
8014 '') if $test $bin_ELF = "$define"; then
8016 You appear to have ELF support. I'll use $cc to build dynamic libraries.
8020 echo "I'll use ld to build dynamic libraries."
8028 rp="What command should be used to create dynamic libraries?"
8034 Some systems may require passing special flags to $ld to create a
8035 library that can be dynamically loaded. If your ld flags include
8036 -L/other/path options to locate libraries outside your loader's normal
8037 search path, you may need to specify those -L options here as well. To
8038 use no flags, say "none".
8041 case "$lddlflags" in
8042 '') case "$osname" in
8043 haiku) dflt='-shared' ;;
8045 case "$gccversion" in
8046 '') dflt="$dflt +vnocompatwarnings" ;;
8049 linux|irix*|gnu*) dflt="-shared $optimize" ;;
8050 next) dflt='none' ;;
8051 solaris) dflt='-G' ;;
8052 sunos) dflt='-assert nodefinitions' ;;
8053 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
8057 *) dflt="$lddlflags" ;;
8060 : Try to guess additional flags to pick up local libraries.
8061 : Be careful not to append to a plain 'none'
8065 for thisflag in $ldflags; do
8070 *) dflt="$dflt $thisflag" ;;
8077 ''|' ') dflt='none' ;;
8081 *-fstack-protector*)
8083 *-fstack-protector*) ;; # Don't add it again
8084 *) dflt="$dflt -fstack-protector" ;;
8090 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
8093 none) lddlflags=' ' ;;
8094 *) lddlflags="$ans" ;;
8099 Some systems may require passing special flags to $cc to indicate that
8100 the resulting executable will use dynamic linking. To use no flags,
8104 case "$ccdlflags" in
8105 '') case "$osname" in
8106 linux|hpux|gnu*) dflt='-Wl,-E' ;;
8107 next|sunos) dflt='none' ;;
8111 *) dflt="$ccdlflags" ;;
8113 rp="Any special flags to pass to $cc to use dynamic linking?"
8116 none) ccdlflags=' ' ;;
8117 *) ccdlflags="$ans" ;;
8128 ld_can_script="$undef"
8129 case "$bin_ELF$usedl" in
8131 # Abuse try.h and a.out names for neat cleanup
8143 if $cc $cccdlflags $ccdlflags $ccflags \
8144 $ldflags $lddlflags -o a.out try.c \
8145 -Wl,--version-script=try.h >/dev/null 2>&1 \
8146 && $test -s a.out ; then
8147 echo "ld supports scripting" >&4
8148 ld_can_script="$define"
8150 echo "ld does not support scripting" >&4
8156 : Do we want a shared libperl?
8160 # No dynamic loading being used, so don't bother even to prompt.
8163 *) case "$useshrplib" in
8164 '') case "$osname" in
8165 svr4*|nonstopux|dgux|dynixptx|esix|powerux|haiku|cygwin*)
8167 also='Building a shared libperl is required for dynamic loading to work on your system.'
8172 also='Building a shared libperl is needed for MAB support.'
8190 The perl executable is normally obtained by linking perlmain.c with
8191 libperl${_a}, any static extensions (usually just DynaLoader), and
8192 any other libraries needed on this system (such as -lm, etc.). Since
8193 your system supports dynamic loading, it is probably possible to build
8194 a shared libperl.$so. If you will have more than one executable linked
8195 to libperl.$so, this will significantly reduce the size of each
8196 executable, but it may have a noticeable effect on performance. The
8197 default is probably sensible for your system.
8201 rp="Build a shared libperl.$so (y/n)"
8205 useshrplib='true' ;;
8206 *) useshrplib='false' ;;
8211 case "$useshrplib" in
8213 case "$userelocatableinc" in
8215 echo "Cannot build with both -Duserelocatableinc and -Duseshrplib" >&4
8216 echo "See INSTALL for an explanation why that won't work." >&4
8222 # Figure out a good name for libperl.so. Since it gets stored in
8223 # a version-specific architecture-dependent library, the version
8224 # number isn't really that important, except for making cc/ld happy.
8226 # A name such as libperl.so.10.1
8227 majmin="libperl.$so.$patchlevel.$subversion"
8228 # A name such as libperl.so.100
8229 majonly=`echo $patchlevel $subversion |
8230 $awk '{printf "%d%02d", $1, $2}'`
8231 majonly=libperl.$so.$majonly
8232 # I'd prefer to keep the os-specific stuff here to a minimum, and
8233 # rely on figuring it out from the naming of libc.
8234 case "${osname}${osvers}" in
8237 # XXX How handle the --version stuff for MAB?
8239 linux*|gnu*) # ld won't link with a bare -lperl otherwise.
8242 cygwin*) # ld links now against the dll directly
8243 majmin="cygperl5_${patchlevel}_${subversion}.${so}"
8244 majonly=`echo $patchlevel $subversion |
8245 $awk '{printf "%03d%03d", $1, $2}'`
8246 majonly=cygperl5.$majonly.$so
8249 *) # Try to guess based on whether libc has major.minor.
8251 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
8252 *libc.$so.[0-9]*) dflt=$majonly ;;
8253 *) dflt=libperl.$so ;;
8263 I need to select a good name for the shared libperl. If your system uses
8264 library names with major and minor numbers, then you might want something
8265 like $majmin. Alternatively, if your system uses a single version
8266 number for shared libraries, then you might want to use $majonly.
8267 Or, your system might be quite happy with a simple libperl.$so.
8269 Since the shared libperl will get installed into a version-specific
8270 architecture-dependent directory, the version number of the shared perl
8271 library probably isn't important, so the default should be o.k.
8274 rp='What name do you want to give to the shared libperl?'
8277 echo "Ok, I'll use $libperl"
8280 libperl="libperl${_a}"
8284 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
8288 WARNING: Use of the shrpdir variable for the installation location of
8289 the shared $libperl is not supported. It was never documented and
8290 will not work in this version. Let me (perlbug@perl.org)
8291 know of any problems this may cause.
8297 But your current setting of $shrpdir is
8298 the default anyway, so it's harmless.
8303 Further, your current attempted setting of $shrpdir
8304 conflicts with the value of $archlibexp/CORE
8305 that installperl will use.
8312 # How will the perl executable find the installed shared $libperl?
8313 # Add $xxx to ccdlflags.
8314 # If we can't figure out a command-line option, use $shrpenv to
8315 # set env LD_RUN_PATH. The main perl makefile uses this.
8316 shrpdir=$archlibexp/CORE
8319 if "$useshrplib"; then
8322 # We'll set it in Makefile.SH...
8327 freebsd|mirbsd|netbsd|openbsd|interix|dragonfly)
8328 xxx="-Wl,-R$shrpdir"
8330 bsdos|linux|irix*|dec_osf|gnu*)
8331 xxx="-Wl,-rpath,$shrpdir"
8334 # next doesn't like the default...
8337 # Haiku doesn't like the default, either.
8340 # hpux doesn't like the default, either.
8341 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
8344 # cygwin needs only ldlibpth
8347 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
8353 # Only add $xxx if it isn't already in ccdlflags.
8354 case " $ccdlflags " in
8356 *) ccdlflags="$ccdlflags $xxx"
8359 Adding $xxx to the flags
8360 passed to $ld so that the perl executable will find the
8361 installed shared $libperl.
8369 # Fix ccdlflags in AIX for building external extensions.
8370 # (For building Perl itself bare -bE:perl.exp is needed,
8371 # Makefile.SH takes care of this.)
8373 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8375 # Respect a hint or command-line value.
8377 '') shrpenv="$tmp_shrpenv" ;;
8379 case "$ldlibpthname" in
8380 '') ldlibpthname=LD_LIBRARY_PATH ;;
8381 none) ldlibpthname='' ;;
8384 : determine where manual pages are on this system
8388 syspath='/usr/share/man/man1 /usr/man/man1'
8389 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8390 syspath="$syspath /usr/man/u_man/man1"
8391 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8392 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8393 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8394 sysman=`./loc . /usr/man/man1 $syspath`
8397 if $test -d "$sysman"; then
8398 echo "System manual is in $sysman." >&4
8400 echo "Could not find manual pages in source form." >&4
8403 : determine where manual pages go
8404 set man1dir man1dir none
8408 $spackage has manual pages available in source form.
8412 echo "However, you don't have nroff, so they're probably useless to you."
8414 '') man1dir="none";;
8417 echo "If you don't want the manual sources installed, answer 'none'."
8422 lookpath="$prefixexp/share/man/man1"
8423 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8424 lookpath="$lookpath $prefixexp/man/p_man/man1"
8425 lookpath="$lookpath $prefixexp/man/u_man/man1"
8426 lookpath="$lookpath $prefixexp/man/man.1"
8428 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8429 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8439 rp="Where do the main $spackage manual pages (source) go?"
8441 if $test "X$man1direxp" != "X$ansexp"; then
8452 : What suffix to use on installed man pages
8459 rp="What suffix should be used for the main $spackage man pages?"
8461 '') case "$man1dir" in
8475 *) dflt="$man1ext";;
8482 : see if we can have long filenames
8484 first=123456789abcdef
8486 if (echo hi >$first) 2>/dev/null; then
8487 if $test -f 123456789abcde; then
8488 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8491 echo 'You can have filenames longer than 14 characters.'>&4
8496 You can't have filenames longer than 14 chars.
8497 You can't even think about them!
8503 $rm -rf 123456789abcde*
8505 : determine where library module manual pages go
8506 set man3dir man3dir none
8510 $spackage has manual pages for many of the library modules.
8516 However, you don't have nroff, so they're probably useless to you.
8519 '') man3dir="none";;
8523 case "$d_flexfnam" in
8526 However, your system can't handle the long file names like File::Basename.3.
8529 '') man3dir="none";;
8533 echo "If you don't want the manual sources installed, answer 'none'."
8534 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8536 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
8537 if $test -d "$privlib/man/man3"; then
8540 WARNING: Previous versions of perl installed man3 pages into
8541 $privlib/man/man3. This version will suggest a
8542 new default of $dflt.
8546 rp='Do you wish to preserve the old behavior?(y/n)'
8549 y*) dflt="$privlib/man/man3" ;;
8554 *) dflt="$man3dir" ;;
8561 rp="Where do the $package library man pages (source) go?"
8571 : What suffix to use on installed man pages
8577 rp="What suffix should be used for the $package library man pages?"
8579 '') case "$man3dir" in
8593 *) dflt="$man3ext";;
8600 : see if we have to deal with yellow pages, now NIS.
8601 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
8602 if $test -f /usr/etc/nibindd; then
8604 echo "I'm fairly confident you're on a NeXT."
8606 rp='Do you get the hosts file via NetInfo?'
8615 y*) hostcat='nidump hosts .';;
8616 *) case "$hostcat" in
8617 nidump*) hostcat='';;
8627 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
8635 rp='Are you getting the hosts file via yellow pages?'
8638 y*) hostcat='ypcat hosts';;
8639 *) hostcat='cat /etc/hosts';;
8645 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
8648 '') test -f /etc/group && groupcat='cat /etc/group';;
8651 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
8654 : now get the host name
8656 echo "Figuring out host name..." >&4
8657 case "$myhostname" in
8659 echo 'Maybe "hostname" will work...'
8660 if tans=`sh -c hostname 2>&1` ; then
8668 if $test "$cont"; then
8670 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
8671 if tans=`cat /etc/systemid 2>&1` ; then
8673 phostname='cat /etc/systemid'
8674 echo "Whadyaknow. Xenix always was a bit strange..."
8677 elif $test -r /etc/systemid; then
8678 echo "(What is a non-Xenix system doing with /etc/systemid?)"
8681 if $test "$cont"; then
8682 echo 'No, maybe "uuname -l" will work...'
8683 if tans=`sh -c 'uuname -l' 2>&1` ; then
8685 phostname='uuname -l'
8687 echo 'Strange. Maybe "uname -n" will work...'
8688 if tans=`sh -c 'uname -n' 2>&1` ; then
8690 phostname='uname -n'
8692 echo 'Oh well, maybe I can mine it out of whoami.h...'
8693 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
8694 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
8695 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
8697 case "$myhostname" in
8698 '') echo "Does this machine have an identity crisis or something?"
8701 echo "Well, you said $myhostname before..."
8702 phostname='echo $myhostname';;
8708 case "$myhostname" in
8709 '') myhostname=noname ;;
8711 : you do not want to know about this
8716 if $test "$myhostname" ; then
8718 rp='Your host name appears to be "'$myhostname'".'" Right?"
8726 : bad guess or no guess
8727 while $test "X$myhostname" = X ; do
8729 rp="Please type the (one word) name of your host:"
8734 : translate upper to lower if necessary
8735 case "$myhostname" in
8737 echo "(Normalizing case in your host name)"
8738 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
8742 case "$myhostname" in
8744 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
8745 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
8746 echo "(Trimming domain name from host name--host name is now $myhostname)"
8748 *) case "$mydomain" in
8751 test "X$hostcat" = "Xypcat hosts" &&
8752 ypmatch "$myhostname" hosts 2>/dev/null |\
8753 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
8756 test "X$hostcat" != "X" &&
8757 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
8758 /[ ]$myhostname[ . ]/p" > hosts
8761 if $test -f hosts; then
8762 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
8763 END { print sum }" hosts` = x1 || tmp_re="[ ]"
8764 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
8765 hosts | $sort | $uniq | \
8766 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
8767 case `$echo X$dflt` in
8768 X*\ *) echo "(Several hosts in the database matched hostname)"
8771 X.) echo "(You do not have fully-qualified names in the hosts database)"
8775 echo "(I cannot locate a hosts database anywhere)"
8780 tans=`./loc resolv.conf X /etc /usr/etc`
8781 if $test -f "$tans"; then
8782 echo "(Attempting domain name extraction from $tans)"
8783 dflt=.`$sed -n -e 's/ / /g' \
8784 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
8787 .) dflt=.`$sed -n -e 's/ / /g' \
8788 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
8796 .) echo "(No help from resolv.conf either -- attempting clever guess)"
8797 dflt=.`sh -c domainname 2>/dev/null`
8800 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
8804 case "$dflt$osname" in
8805 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
8806 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
8810 .) echo "(Lost all hope -- silly guess then)"
8816 *) dflt="$mydomain";;
8820 rp="What is your domain name?"
8830 : translate upper to lower if necessary
8833 echo "(Normalizing case in your domain name)"
8834 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
8838 : a little sanity check here
8839 case "$phostname" in
8842 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
8843 $myhostname$mydomain|$myhostname) ;;
8845 case "$phostname" in
8847 echo "(That doesn't agree with your whoami.h file, by the way.)"
8850 echo "(That doesn't agree with your $phostname command, by the way.)"
8858 : determine the e-mail address of the user who is running us
8861 I need to get your e-mail address in Internet format if possible, i.e.
8862 something like user@host.domain. Please answer accurately since I have
8863 no easy means to double check it. The default value provided below
8864 is most probably close to reality but may not be valid from outside
8865 your organization...
8869 while test "$cont"; do
8870 case "$MAILDOMAIN" in
8871 '') maildomain="$myhostname$mydomain";;
8872 *) maildomain="$MAILDOMAIN";;
8875 '') dflt="$cf_by@$maildomain";;
8876 *) dflt="$cf_email";;
8878 rp='What is your e-mail address?'
8884 rp='Address does not look like an Internet one. Use it anyway?'
8898 : Ask e-mail of administrator
8901 If you or somebody else will be maintaining perl at your site, please
8902 fill in the correct e-mail address here so that they may be contacted
8903 if necessary. Currently, the "perlbug" program included with perl
8904 will send mail to this address in addition to perlbug@perl.org. You may
8905 enter "none" for no administrator.
8908 case "$perladmin" in
8909 '') dflt="$cf_email";;
8910 *) dflt="$perladmin";;
8912 rp='Perl administrator e-mail address'
8916 : determine whether to only install version-specific parts.
8919 Do you want to install only the version-specific parts of the perl
8920 distribution? Usually you do *not* want to do this.
8922 case "$versiononly" in
8923 "$define"|[Yy]*|true) dflt='y' ;;
8926 rp="Do you want to install only the version-specific parts of perl?"
8929 [yY]*) val="$define";;
8935 case "$versiononly" in
8936 "$define") inc_version_list=''
8937 inc_version_list_init=0
8941 : figure out how to guarantee perl startup
8942 : XXX Note that this currently takes advantage of the bug that binexp ignores
8943 : the Configure -Dinstallprefix setting, which in turn means that under
8944 : relocatable @INC, initialinstalllocation is what binexp started as.
8945 case "$startperl" in
8947 case "$sharpbang" in
8951 I can use the #! construct to start perl on your system. This will
8952 make startup of perl scripts faster, but may cause problems if you
8953 want to share those scripts and perl is not in a standard place
8954 ($initialinstalllocation/perl) on all your platforms. The alternative
8955 is to force a shell by starting the script with a single ':' character.
8958 case "$versiononly" in
8959 "$define") dflt="$initialinstalllocation/perl$version";;
8960 *) dflt="$initialinstalllocation/perl";;
8962 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
8965 none) startperl=": # use perl";;
8966 *) startperl="#!$ans"
8967 if $test 30 -lt `echo "$ans" | wc -c`; then
8970 WARNING: Some systems limit the #! command to 32 characters.
8971 If you experience difficulty running Perl scripts with #!, try
8972 installing Perl in a directory with a shorter pathname.
8978 *) startperl=": # use perl"
8983 echo "I'll use $startperl to start perl scripts."
8985 : figure best path for perl in scripts
8988 case "$versiononly" in
8989 "$define") perlpath="$initialinstalllocation/perl$version";;
8990 *) perlpath="$initialinstalllocation/perl";;
8992 case "$startperl" in
8997 I will use the "eval 'exec'" idiom to start Perl on your system.
8998 I can use the full path of your Perl binary for this purpose, but
8999 doing so may cause problems if you want to share those scripts and
9000 Perl is not always in a standard place ($initialinstalllocation/perl).
9003 dflt="$initialinstalllocation/perl"
9004 rp="What path shall I use in \"eval 'exec'\"?"
9011 case "$startperl" in
9013 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
9016 : determine where public executable scripts go
9017 set scriptdir scriptdir
9019 case "$scriptdir" in
9022 : guess some guesses
9023 $test -d /usr/share/scripts && dflt=/usr/share/scripts
9024 $test -d /usr/share/bin && dflt=/usr/share/bin
9025 $test -d /usr/local/script && dflt=/usr/local/script
9026 $test -d /usr/local/scripts && dflt=/usr/local/scripts
9027 $test -d $prefixexp/script && dflt=$prefixexp/script
9031 *) dflt="$scriptdir"
9036 Some installations have a separate directory just for executable scripts so
9037 that they can mount it across multiple architectures but keep the scripts in
9038 one spot. You might, for example, have a subdirectory of /usr/share for this.
9039 Or you might just lump your scripts in with all your other executables.
9043 rp='Where do you keep publicly executable scripts?'
9045 if $test "X$ansexp" != "X$scriptdirexp"; then
9051 : A little fix up for an irregularly named variable.
9052 installscript="$installscriptdir"
9054 : determine where add-on public executables go
9056 '') dflt=$siteprefix/bin ;;
9060 rp='Pathname where the add-on public executables should be installed?'
9065 : determine where add-on html pages go
9066 : There is no standard location, so try to copy the previously-selected
9067 : directory structure for the core html pages.
9068 case "$sitehtml1dir" in
9069 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9070 *) dflt=$sitehtml1dir ;;
9073 ''|' ') dflt=none ;;
9076 rp='Pathname where the site-specific html pages should be installed?'
9078 prefixvar=sitehtml1dir
9081 : determine where add-on library html pages go
9082 : There is no standard location, so try to copy the previously-selected
9083 : directory structure for the core html pages.
9084 case "$sitehtml3dir" in
9085 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9086 *) dflt=$sitehtml3dir ;;
9089 ''|' ') dflt=none ;;
9092 rp='Pathname where the site-specific library html pages should be installed?'
9094 prefixvar=sitehtml3dir
9097 : determine where add-on manual pages go
9098 case "$siteman1dir" in
9099 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
9100 *) dflt=$siteman1dir ;;
9103 ''|' ') dflt=none ;;
9106 rp='Pathname where the site-specific manual pages should be installed?'
9108 prefixvar=siteman1dir
9111 : determine where add-on library man pages go
9112 case "$siteman3dir" in
9113 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
9114 *) dflt=$siteman3dir ;;
9117 ''|' ') dflt=none ;;
9120 rp='Pathname where the site-specific library manual pages should be installed?'
9122 prefixvar=siteman3dir
9125 : determine where add-on public executable scripts go
9126 case "$sitescript" in
9127 '') dflt=$siteprefix/script
9128 $test -d $dflt || dflt=$sitebin ;;
9129 *) dflt="$sitescript" ;;
9132 rp='Pathname where add-on public executable scripts should be installed?'
9134 prefixvar=sitescript
9137 : Check if faststdio is requested and available
9138 case "$usefaststdio" in
9139 $define|true|[yY]*|'')
9140 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
9150 Perl can be built to use 'fast stdio', which means using the stdio
9151 library but also directly manipulating the stdio buffers to enable
9152 faster I/O. Using stdio is better for backward compatibility (especially
9153 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
9154 interface has been preferred instead of stdio.
9156 If this doesn't make any sense to you, just accept the default '$dflt'.
9158 rp='Use the "fast stdio" if available?'
9161 y|Y) val="$define" ;;
9168 : define an is-a-typedef? function
9169 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9171 "") inclist="sys/types.h";;
9173 eval "varval=\$$var";
9177 for inc in $inclist; do
9178 echo "#include <$inc>" >>temp.c;
9180 echo "#ifdef $type" >> temp.c;
9181 echo "printf(\"We have $type\");" >> temp.c;
9182 echo "#endif" >> temp.c;
9183 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9184 if $contains $type temp.E >/dev/null 2>&1; then
9190 *) eval "$var=\$varval";;
9193 : define an is-a-typedef? function that prompts if the type is not available.
9194 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9196 "") inclist="sys/types.h";;
9198 eval "varval=\$$var";
9202 for inc in $inclist; do
9203 echo "#include <$inc>" >>temp.c;
9205 echo "#ifdef $type" >> temp.c;
9206 echo "printf(\"We have $type\");" >> temp.c;
9207 echo "#endif" >> temp.c;
9208 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9210 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
9211 if $contains $type temp.E >/dev/null 2>&1; then
9212 echo "$type found." >&4;
9215 echo "$type NOT found." >&4;
9221 *) eval "$var=\$varval";;
9224 : see what type lseek is declared as in the kernel
9225 rp="What is the type used for lseek's offset on this system?"
9226 set off_t lseektype long stdio.h sys/types.h
9230 echo "Checking to see how big your file offsets are..." >&4
9232 #include <sys/types.h>
9236 printf("%d\n", (int)sizeof($lseektype));
9241 if eval $compile_ok; then
9242 lseeksize=`$run ./try`
9243 echo "Your file offsets are $lseeksize bytes long."
9247 echo "(I can't seem to compile the test program. Guessing...)"
9248 rp="What is the size of your file offsets (in bytes)?"
9254 : see what type file positions are declared as in the library
9255 rp="What is the type for file position used by fsetpos()?"
9256 set fpos_t fpostype long stdio.h sys/types.h
9259 : Check size for Fpos_t
9262 *_t) zzz="$fpostype" ;;
9265 echo "Checking the size of $zzz..." >&4
9267 #include <sys/types.h>
9274 printf("%d\n", (int)sizeof($fpostype));
9279 if eval $compile_ok; then
9283 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9286 echo "Your $zzz is $fpossize bytes long."
9292 echo "(I can't compile the test program. Guessing...)" >&4
9293 rp="What is the size of your file positions (in bytes)?"
9298 : Check for large file support
9299 # Backward compatibility (uselfs is deprecated).
9301 "$define"|true|[yY]*)
9304 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
9306 uselargefiles="$define"
9310 case "$lseeksize:$fpossize" in
9313 You can have files larger than 2 gigabytes.
9316 *) case "$uselargefiles" in
9317 "$undef"|false|[nN]*) dflt='n' ;;
9322 Perl can be built to understand large files (files larger than 2 gigabytes)
9323 on some systems. To do so, Configure can be run with -Duselargefiles.
9325 If this doesn't make any sense to you, just accept the default '$dflt'.
9327 rp='Try to understand large files, if available?'
9330 y|Y) val="$define" ;;
9337 : Look for a hint-file generated 'call-back-unit'. If the
9338 : user has specified that a large files perl is to be built,
9339 : we may need to set or change some other defaults.
9340 if $test -f uselargefiles.cbu; then
9341 echo "Your platform has some specific hints regarding large file builds, using them..."
9342 . ./uselargefiles.cbu
9344 case "$uselargefiles" in
9346 if $test -f uselargefiles.cbu; then
9348 echo "Rechecking to see how big your file offsets are..." >&4
9350 #include <sys/types.h>
9354 printf("%d\n", (int)sizeof($lseektype));
9359 if eval $compile_ok; then
9360 lseeksize=`$run ./try`
9361 $echo "Your file offsets are now $lseeksize bytes long."
9365 echo "(I can't seem to compile the test program. Guessing...)"
9366 rp="What is the size of your file offsets (in bytes)?"
9371 *_t) zzz="$fpostype" ;;
9374 $echo $n "Rechecking the size of $zzz...$c" >&4
9376 #include <sys/types.h>
9383 printf("%d\n", (int)sizeof($fpostype));
9388 if eval $compile_ok; then
9393 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9396 echo " $fpossize bytes." >&4
9402 echo "(I can't compile the test program. Guessing...)" >&4
9403 rp="What is the size of your file positions (in bytes)?"
9412 : Check if we want perlio
9415 : Set the vendorbin variables
9416 case "$vendorprefix" in
9417 '') d_vendorbin="$undef"
9421 *) d_vendorbin="$define"
9422 : determine where vendor-supplied executables go.
9423 case "$vendorbin" in
9424 '') dflt=$vendorprefix/bin ;;
9425 *) dflt="$vendorbin" ;;
9428 rp='Pathname for the vendor-supplied executables directory?'
9431 vendorbinexp="$ansexp"
9437 : Set the vendorhtml1dir variables
9438 case "$vendorprefix" in
9439 '') vendorhtml1dir=''
9440 vendorhtml1direxp=''
9442 *) : determine where vendor-supplied html pages go.
9443 : There is no standard location, so try to copy the previously-selected
9444 : directory structure for the core html pages.
9445 : XXX Better default suggestions would be welcome.
9446 case "$vendorhtml1dir" in
9447 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9448 *) dflt=$vendorhtml1dir ;;
9451 ''|' ') dflt=none ;;
9454 rp='Pathname for the vendor-supplied html pages?'
9456 vendorhtml1dir="$ans"
9457 vendorhtml1direxp="$ansexp"
9460 : Use ' ' for none so value is preserved next time through Configure
9461 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9462 prefixvar=vendorhtml1dir
9465 : Set the vendorhtml3dir variables
9466 case "$vendorprefix" in
9467 '') vendorhtml3dir=''
9468 vendorhtml3direxp=''
9470 *) : determine where vendor-supplied module html pages go.
9471 : There is no standard location, so try to copy the previously-selected
9472 : directory structure for the core html pages.
9473 : XXX Better default suggestions would be welcome.
9474 case "$vendorhtml3dir" in
9475 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9476 *) dflt=$vendorhtml3dir ;;
9479 ''|' ') dflt=none ;;
9482 rp='Pathname for the vendor-supplied html pages?'
9484 vendorhtml3dir="$ans"
9485 vendorhtml3direxp="$ansexp"
9488 : Use ' ' for none so value is preserved next time through Configure
9489 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9490 prefixvar=vendorhtml3dir
9493 : Set the vendorman1dir variables
9494 case "$vendorprefix" in
9495 '') vendorman1dir=''
9498 *) : determine where vendor-supplied manual pages go.
9499 case "$vendorman1dir" in
9500 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9501 *) dflt=$vendorman1dir ;;
9504 ''|' ') dflt=none ;;
9507 rp='Pathname for the vendor-supplied manual section 1 pages?'
9509 vendorman1dir="$ans"
9510 vendorman1direxp="$ansexp"
9513 : Use ' ' for none so value is preserved next time through Configure
9514 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
9515 prefixvar=vendorman1dir
9518 : Set the vendorman3dir variables
9519 case "$vendorprefix" in
9520 '') vendorman3dir=''
9523 *) : determine where vendor-supplied module manual pages go.
9524 case "$vendorman3dir" in
9525 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9526 *) dflt=$vendorman3dir ;;
9529 ''|' ') dflt=none ;;
9532 rp='Pathname for the vendor-supplied manual section 3 pages?'
9534 vendorman3dir="$ans"
9535 vendorman3direxp="$ansexp"
9538 : Use ' ' for none so value is preserved next time through Configure
9539 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
9540 prefixvar=vendorman3dir
9543 : Set the vendorscript variables
9544 case "$vendorprefix" in
9545 '') d_vendorscript="$undef"
9549 *) d_vendorscript="$define"
9550 : determine where vendor-supplied scripts go.
9551 case "$vendorscript" in
9552 '') dflt=$vendorprefix/script
9553 $test -d $dflt || dflt=$vendorbin ;;
9554 *) dflt="$vendorscript" ;;
9558 The installation process will create a directory for
9559 vendor-supplied scripts.
9563 rp='Pathname for the vendor-supplied scripts directory?'
9566 vendorscriptexp="$ansexp"
9569 prefixvar=vendorscript
9572 : script used to emit important warnings
9575 if test \$# -gt 0; then
9580 echo "*** WARNING:" >&4
9581 sed -e 's/^/*** /' <msg >&4
9583 cat msg >>config.msg
9584 echo " " >>config.msg
9590 : see which of string.h or strings.h is needed
9592 strings=`./findhdr string.h`
9593 if $test "$strings" && $test -r "$strings"; then
9594 echo "Using <string.h> instead of <strings.h>." >&4
9598 strings=`./findhdr strings.h`
9599 if $test "$strings" && $test -r "$strings"; then
9600 echo "Using <strings.h> instead of <string.h>." >&4
9602 ./warn "No string header found -- You'll surely have problems."
9608 "$undef") strings=`./findhdr strings.h`;;
9609 *) strings=`./findhdr string.h`;;
9612 : see if qgcvt exists
9616 : Check print/scan long double stuff
9619 if $test X"$d_longdbl" = X"$define"; then
9621 echo "Checking how to print long doubles..." >&4
9623 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
9624 $cat >try.c <<'EOCP'
9625 #include <sys/types.h>
9629 printf("%.3f\n", d);
9633 if eval $compile; then
9637 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
9638 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
9639 echo "We will use %f."
9645 if $test X"$sPRIfldbl" = X; then
9646 $cat >try.c <<'EOCP'
9647 #include <sys/types.h>
9650 long double d = 123.456;
9651 printf("%.3Lf\n", d);
9655 if eval $compile; then
9659 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
9660 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
9661 echo "We will use %Lf."
9667 if $test X"$sPRIfldbl" = X; then
9668 $cat >try.c <<'EOCP'
9669 #include <sys/types.h>
9672 long double d = 123.456;
9673 printf("%.3llf\n", d);
9677 if eval $compile; then
9681 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
9682 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
9683 echo "We will use %llf."
9689 if $test X"$sPRIfldbl" = X; then
9690 $cat >try.c <<'EOCP'
9691 #include <sys/types.h>
9694 long double d = 123.456;
9695 printf("%.3lf\n", d);
9699 if eval $compile; then
9703 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
9704 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
9705 echo "We will use %lf."
9711 if $test X"$sPRIfldbl" = X; then
9712 echo "Cannot figure out how to print long doubles." >&4
9714 sSCNfldbl=$sPRIfldbl # expect consistency
9721 case "$sPRIfldbl" in
9722 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
9723 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
9724 d_SCNfldbl="$undef";
9726 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
9727 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
9728 d_SCNfldbl="$define";
9732 : Check how to convert floats to strings.
9734 if test "X$d_Gconvert" = X; then
9737 echo "Checking for an efficient way to convert floats to strings."
9739 case "$uselongdouble" in
9740 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
9742 case "$d_longdbl" in
9743 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
9745 case "$d_PRIgldbl" in
9746 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
9750 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
9751 char *myname = "gconvert";
9754 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
9755 char *myname = "gcvt";
9758 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
9759 char *myname = "qgcvt";
9760 #define DOUBLETYPE long double
9763 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9765 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
9767 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
9770 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
9772 char *myname = "sprintf";
9776 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9777 #define DOUBLETYPE long double
9779 #define DOUBLETYPE double
9791 # include <string.h>
9793 # include <strings.h>
9796 int checkit(char *expect, char *got)
9798 if (strcmp(expect, got)) {
9799 printf("%s oddity: Expected %s, got %s\n",
9800 myname, expect, got);
9810 /* This must be 1st test on (which?) platform */
9811 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
9812 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
9813 checkit("0.1", buf);
9815 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
9816 checkit("0.01", buf);
9818 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
9819 checkit("0.001", buf);
9821 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
9822 checkit("0.0001", buf);
9824 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
9825 if (strlen(buf) > 5)
9826 checkit("9e-005", buf); /* for Microsoft ?? */
9828 checkit("9e-05", buf);
9830 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
9833 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
9834 checkit("1.1", buf);
9836 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
9837 checkit("1.01", buf);
9839 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
9840 checkit("1.001", buf);
9842 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
9843 checkit("1.0001", buf);
9845 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
9846 checkit("1.00001", buf);
9848 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
9849 checkit("1.000001", buf);
9851 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
9854 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
9857 /* Some Linux gcvt's give 1.e+5 here. */
9858 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
9859 checkit("100000", buf);
9861 /* Some Linux gcvt's give -1.e+5 here. */
9862 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
9863 checkit("-100000", buf);
9865 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
9866 checkit("123.456", buf);
9868 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
9869 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
9870 /* 34 should be enough to scare even long double
9871 * places into using the e notation. */
9872 if (strlen(buf) > 5)
9873 checkit("1e+034", buf); /* for Microsoft */
9875 checkit("1e+34", buf);
9877 /* For Perl, if you add additional tests here, also add them to
9878 * t/base/num.t for benefit of platforms not using Configure or
9879 * overriding d_Gconvert */
9884 : first add preferred functions to our list
9886 for xxx_convert in $gconvert_preference; do
9887 case $xxx_convert in
9888 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
9889 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
9892 : then add any others
9893 for xxx_convert in gconvert gcvt sprintf; do
9896 *) xxx_list="$xxx_list $xxx_convert" ;;
9900 case "$d_longdbl$uselongdouble" in
9902 : again, add preferred functions to our list first
9904 for xxx_convert in $gconvert_ld_preference; do
9905 case $xxx_convert in
9906 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9907 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
9910 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
9911 for xxx_convert in qgcvt sprintf $xxx_list; do
9912 case "$xxx_ld_list" in
9913 $xxx_convert*|*" $xxx_convert"*) ;;
9914 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9917 : if sprintf cannot do long doubles, move it to the end
9918 if test "$d_PRIgldbl" != "$define"; then
9919 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
9921 : if no qgcvt, remove it
9922 if test "$d_qgcvt" != "$define"; then
9923 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
9926 xxx_list="$xxx_ld_list"
9930 for xxx_convert in $xxx_list; do
9931 echo "Trying $xxx_convert..."
9932 $rm -f try try$_o core
9933 set try -DTRY_$xxx_convert
9934 if eval $compile; then
9935 echo "$xxx_convert() found." >&4
9937 echo "I'll use $xxx_convert to convert floats into a string." >&4
9940 echo "...But $xxx_convert didn't work as I expected."
9944 echo "$xxx_convert NOT found." >&4
9948 if test X$xxx_convert = X; then
9949 echo "*** WHOA THERE!!! ***" >&4
9950 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
9954 case "$xxx_convert" in
9955 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
9956 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
9957 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
9958 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
9959 "$define$define$define")
9960 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
9961 "$define$define$undef")
9962 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
9963 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
9971 : see if _fwalk exists
9975 : Initialize h_fcntl
9978 : Initialize h_sysfile
9981 : access call always available on UNIX
9985 : locate the flags for 'access()'
9989 $cat >access.c <<EOCP
9990 #include <sys/types.h>
9995 #include <sys/file.h>
10000 #$i_stdlib I_STDLIB
10002 #include <stdlib.h>
10008 : check sys/file.h first, no particular reason here
10009 if $test `./findhdr sys/file.h` && \
10010 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
10012 echo "<sys/file.h> defines the *_OK access constants." >&4
10013 elif $test `./findhdr fcntl.h` && \
10014 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
10016 echo "<fcntl.h> defines the *_OK access constants." >&4
10017 elif $test `./findhdr unistd.h` && \
10018 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
10019 echo "<unistd.h> defines the *_OK access constants." >&4
10021 echo "I can't find the four *_OK access constants--I'll use mine." >&4
10027 : see if accessx exists
10028 set accessx d_accessx
10031 : see if aintl exists
10035 : see if alarm exists
10039 : see if 64bit time functions exists
10041 set ctime64 d_ctime64
10044 set localtime64 d_localtime64
10047 set gmtime64 d_gmtime64
10050 set mktime64 d_mktime64
10053 set difftime64 d_difftime64
10056 set asctime64 d_asctime64
10059 : see if POSIX threads are available
10060 set pthread.h i_pthread
10063 : define a function to check prototypes
10064 $cat > protochk <<EOSH
10067 optimize="$optimize"
10069 prototype="$prototype"
10072 usethreads=$usethreads
10073 i_pthread=$i_pthread
10074 pthread_h_first=$pthread_h_first
10077 $cat >> protochk <<'EOSH'
10082 while test $# -ge 2; do
10084 $define) echo "#include <$2>" >> try.c ;;
10085 literal) echo "$2" >> try.c ;;
10087 # Extra magic for the benefit of systems that need pthread.h
10088 # to be included early to correctly detect threadsafe functions.
10089 # Such functions must guarantee themselves, though, that the usethreads
10090 # and i_pthread have been defined, before calling protochk.
10091 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
10092 echo "#include <pthread.h>" >> try.c
10097 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
10098 cat >> try.c <<'EOCP'
10099 #ifdef CAN_PROTOTYPE
10100 #define _(args) args
10105 echo "$foo" >> try.c
10106 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
10107 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
10113 $eunicefix protochk
10115 : Define hasproto macro for Configure internal use
10116 hasproto='varname=$1; func=$2; shift; shift;
10117 while $test $# -ge 2; do
10119 $define) echo "#include <$2>";;
10123 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
10124 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
10125 echo "$func() prototype found.";
10128 echo "$func() prototype NOT found.";
10135 : see if sys/types.h has to be included
10136 set sys/types.h i_systypes
10139 : see if sys/select.h has to be included
10140 set sys/select.h i_sysselct
10143 : Define hasfield macro for Configure internal use
10144 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
10145 while $test $# -ge 2; do
10147 $define) echo "#include <$2>";;
10151 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
10153 if eval $compile; then
10162 : see if we should include time.h, sys/time.h, or both
10164 if test "X$timeincl" = X; then
10165 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
10166 $echo $n "I'm now running the test program...$c"
10168 #include <sys/types.h>
10173 #ifdef SYSTIMEKERNEL
10176 #include <sys/time.h>
10179 #include <sys/select.h>
10181 #$i_stdlib I_STDLIB
10183 #include <stdlib.h>
10189 struct timeval bar;
10192 struct timezone tzp;
10194 if (foo.tm_sec == foo.tm_sec)
10197 if (bar.tv_sec == bar.tv_sec)
10204 for s_timezone in '-DS_TIMEZONE' ''; do
10206 for s_timeval in '-DS_TIMEVAL' ''; do
10207 for i_systimek in '' '-DSYSTIMEKERNEL'; do
10208 for i_time in '' '-DI_TIME'; do
10209 for i_systime in '-DI_SYSTIME' ''; do
10212 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
10213 if eval $compile; then
10214 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
10218 $echo $n "Succeeded with $flags$c"
10230 *SYSTIMEKERNEL*) i_systimek="$define"
10231 timeincl=`./findhdr sys/time.h`
10232 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
10233 *) i_systimek="$undef";;
10236 *I_TIME*) i_time="$define"
10237 timeincl=`./findhdr time.h`" $timeincl"
10238 echo "We'll include <time.h>." >&4;;
10239 *) i_time="$undef";;
10242 *I_SYSTIME*) i_systime="$define"
10243 timeincl=`./findhdr sys/time.h`" $timeincl"
10244 echo "We'll include <sys/time.h>." >&4;;
10245 *) i_systime="$undef";;
10249 : see if struct tm knows about tm_zone
10250 case "$i_systime$i_time" in
10253 echo "Checking to see if your struct tm has tm_zone field..." >&4
10254 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
10262 case "$d_tm_tm_zone" in
10263 "$define") echo "Yes, it does." ;;
10264 *) echo "No, it doesn't." ;;
10266 : see if struct tm knows about tm_gmtoff
10267 case "$i_systime$i_time" in
10270 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
10271 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
10279 case "$d_tm_tm_gmtoff" in
10280 "$define") echo "Yes, it does." ;;
10281 *) echo "No, it doesn't." ;;
10284 : see if asctime_r exists
10285 set asctime_r d_asctime_r
10287 case "$d_asctime_r" in
10289 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10290 case "$d_asctime_r_proto:$usethreads" in
10291 ":define") d_asctime_r_proto=define
10292 set d_asctime_r_proto asctime_r $hdrs
10296 case "$d_asctime_r_proto" in
10298 case "$asctime_r_proto" in
10299 ''|0) try='char* asctime_r(const struct tm*, char*);'
10300 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SB ;;
10302 case "$asctime_r_proto" in
10303 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
10304 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SBI ;;
10306 case "$asctime_r_proto" in
10307 ''|0) try='int asctime_r(const struct tm*, char*);'
10308 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SB ;;
10310 case "$asctime_r_proto" in
10311 ''|0) try='int asctime_r(const struct tm*, char*, int);'
10312 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SBI ;;
10314 case "$asctime_r_proto" in
10315 ''|0) d_asctime_r=undef
10317 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
10318 * ) case "$asctime_r_proto" in
10319 REENTRANT_PROTO*) ;;
10320 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
10322 echo "Prototype: $try" ;;
10325 *) case "$usethreads" in
10326 define) echo "asctime_r has no prototype, not using it." >&4 ;;
10333 *) asctime_r_proto=0
10337 : see if atolf exists
10341 : see if atoll exists
10345 : Look for GCC-style attribute format
10346 case "$d_attribute_format" in
10349 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
10350 $cat >attrib.c <<'EOCP'
10352 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
10354 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10355 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10356 echo "Your C compiler doesn't support __attribute__((format))."
10359 echo "Your C compiler supports __attribute__((format))."
10363 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10367 *) val="$d_attribute_format" ;;
10369 set d_attribute_format
10373 : Look for GCC-style attribute format with null format allowed
10374 case "$d_printf_format_null" in
10375 '') case "$d_attribute_format" in
10378 echo "Checking whether your compiler allows __printf__ format to be null ..." >&4
10379 $cat >attrib.c <<EOCP
10381 #$i_stdlib I_STDLIB
10383 #include <stdlib.h>
10385 int null_printf (char* pat,...) __attribute__((__format__(__printf__,1,2)));
10386 int null_printf (char* pat,...) { return (int)pat; }
10387 int main () { exit(null_printf(NULL)); }
10389 if $cc $ccflags -o attrib attrib.c >attrib.out 2>&1 ; then
10390 : run the executable in case it produces a run-time warning
10391 if $run ./attrib >>attrib.out 2>&1; then
10392 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10393 echo "Your C compiler doesn't allow __printf__ format to be null."
10396 echo "Your C compiler allows __printf__ format to be null."
10400 echo "Your C compiler executable failed with __printf__ format null."
10404 echo "Your C compiler fails with __printf__ format null."
10411 *) val="$d_printf_format_null" ;;
10413 set d_printf_format_null
10417 : Look for GCC-style attribute malloc
10418 case "$d_attribute_malloc" in
10421 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
10422 $cat >attrib.c <<'EOCP'
10424 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
10426 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10427 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10428 echo "Your C compiler doesn't support __attribute__((malloc))."
10431 echo "Your C compiler supports __attribute__((malloc))."
10435 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10439 *) val="$d_attribute_malloc" ;;
10441 set d_attribute_malloc
10445 : Look for GCC-style attribute nonnull
10446 case "$d_attribute_nonnull" in
10449 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
10450 $cat >attrib.c <<'EOCP'
10452 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
10454 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10455 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10456 echo "Your C compiler doesn't support __attribute__((nonnull))."
10459 echo "Your C compiler supports __attribute__((nonnull))."
10463 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10467 *) val="$d_attribute_nonnull" ;;
10469 set d_attribute_nonnull
10473 : Look for GCC-style attribute noreturn
10474 case "$d_attribute_noreturn" in
10477 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
10478 $cat >attrib.c <<'EOCP'
10480 void fall_over_dead( void ) __attribute__((noreturn));
10482 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10483 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10484 echo "Your C compiler doesn't support __attribute__((noreturn))."
10487 echo "Your C compiler supports __attribute__((noreturn))."
10491 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10495 *) val="$d_attribute_noreturn" ;;
10497 set d_attribute_noreturn
10501 : Look for GCC-style attribute pure
10502 case "$d_attribute_pure" in
10505 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
10506 $cat >attrib.c <<'EOCP'
10508 int square( int n ) __attribute__((pure));
10510 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10511 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10512 echo "Your C compiler doesn't support __attribute__((pure))."
10515 echo "Your C compiler supports __attribute__((pure))."
10519 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10523 *) val="$d_attribute_pure" ;;
10525 set d_attribute_pure
10529 : Look for GCC-style attribute unused
10530 case "$d_attribute_unused" in
10533 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
10534 $cat >attrib.c <<'EOCP'
10536 int do_something( int dummy __attribute__((unused)), int n );
10538 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10539 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10540 echo "Your C compiler doesn't support __attribute__((unused))."
10543 echo "Your C compiler supports __attribute__((unused))."
10547 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10551 *) val="$d_attribute_unused" ;;
10553 set d_attribute_unused
10557 : Look for GCC-style attribute deprecated
10558 case "$d_attribute_deprecated" in
10561 echo "Checking whether your compiler can handle __attribute__((deprecated)) ..." >&4
10562 $cat >attrib.c <<'EOCP'
10564 int I_am_deprecated(void) __attribute__((deprecated));
10566 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10567 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10568 echo "Your C compiler doesn't support __attribute__((deprecated))."
10571 echo "Your C compiler supports __attribute__((deprecated))."
10575 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10579 *) val="$d_attribute_deprecated" ;;
10581 set d_attribute_deprecated
10585 : Look for GCC-style attribute warn_unused_result
10586 case "$d_attribute_warn_unused_result" in
10589 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
10590 $cat >attrib.c <<'EOCP'
10592 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
10594 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10595 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10596 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
10599 echo "Your C compiler supports __attribute__((warn_unused_result))."
10603 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10607 *) val="$d_attribute_warn_unused_result" ;;
10609 set d_attribute_warn_unused_result
10613 : see if bcmp exists
10617 : see if bcopy exists
10621 : see if getpgrp exists
10622 set getpgrp d_getpgrp
10625 case "$d_getpgrp" in
10628 echo "Checking to see which flavor of getpgrp is in use..."
10630 #$i_unistd I_UNISTD
10631 #include <sys/types.h>
10633 # include <unistd.h>
10635 #$i_stdlib I_STDLIB
10637 #include <stdlib.h>
10641 if (getuid() == 0) {
10642 printf("(I see you are running Configure as super-user...)\n");
10645 #ifdef TRY_BSD_PGRP
10646 if (getpgrp(1) == 0)
10655 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10656 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
10658 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10659 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
10662 echo "I can't seem to compile and run the test program."
10664 xxx="a USG one, i.e. you use getpgrp()."
10666 # SVR4 systems can appear rather BSD-ish.
10667 case "$i_unistd" in
10669 xxx="a BSD one, i.e. you use getpgrp(pid)."
10673 xxx="probably a USG one, i.e. you use getpgrp()."
10678 echo "Assuming your getpgrp is $xxx" >&4
10687 : see if setpgrp exists
10688 set setpgrp d_setpgrp
10691 case "$d_setpgrp" in
10694 echo "Checking to see which flavor of setpgrp is in use..."
10696 #$i_unistd I_UNISTD
10697 #include <sys/types.h>
10699 # include <unistd.h>
10701 #$i_stdlib I_STDLIB
10703 #include <stdlib.h>
10707 if (getuid() == 0) {
10708 printf("(I see you are running Configure as super-user...)\n");
10711 #ifdef TRY_BSD_PGRP
10712 if (-1 == setpgrp(1, 1))
10715 if (setpgrp() != -1)
10721 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10722 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
10724 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10725 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
10728 echo "(I can't seem to compile and run the test program.)"
10730 xxx="a USG one, i.e. you use setpgrp()."
10732 # SVR4 systems can appear rather BSD-ish.
10733 case "$i_unistd" in
10735 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
10739 xxx="probably a USG one, i.e. you use setpgrp()."
10744 echo "Assuming your setpgrp is $xxx" >&4
10753 : Look for GCC-style __builtin_choose_expr
10754 case "$d_builtin_choose_expr" in
10757 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
10758 $cat >try.c <<'EOCP'
10759 #include <assert.h>
10760 #include <stdlib.h>
10763 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
10766 assert( SYRINX(1) == 2112 );
10767 assert( SYRINX(1) != 5150 );
10768 assert( SYRINX(0) == 5150 );
10769 assert( SYRINX(0) != 2112 );
10770 puts( "All good!" );
10776 if eval $compile && $run ./try; then
10777 echo "Your C compiler supports __builtin_choose_expr."
10780 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
10784 *) val="$d_builtin_choose_expr" ;;
10787 set d_builtin_choose_expr
10791 : Look for GCC-style __builtin_expect
10792 case "$d_builtin_expect" in
10795 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
10796 $cat >try.c <<'EOCP'
10799 if ( __builtin_expect(n, 0) ) n = 1;
10800 /* Remember shell exit code truth is 0, C truth is non-zero */
10805 if eval $compile && $run ./try; then
10806 echo "Your C compiler supports __builtin_expect."
10809 echo "Your C compiler doesn't seem to understand __builtin_expect."
10813 *) val="$d_builtin_expect" ;;
10816 set d_builtin_expect
10820 : see if bzero exists
10824 : see if stdarg is available
10826 if $test `./findhdr stdarg.h`; then
10827 echo "<stdarg.h> found." >&4
10830 echo "<stdarg.h> NOT found." >&4
10834 : see if varags is available
10836 if $test `./findhdr varargs.h`; then
10837 echo "<varargs.h> found." >&4
10839 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
10842 : set up the varargs testing programs
10843 $cat > varargs.c <<EOP
10845 #include <stdarg.h>
10848 #include <varargs.h>
10852 int f(char *p, ...)
10866 p = va_arg(ap, char *);
10872 $cat > varargs <<EOP
10874 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
10883 : now check which varargs header should be included
10889 if `./varargs I_STDARG`; then
10891 elif `./varargs I_VARARGS`; then
10896 if `./varargs I_VARARGS`; then
10904 echo "*** WHOA THERE!!! ***" >&4
10905 echo " Your C compiler \"$cc\" doesn't seem to support stdarg or varargs!" >&4
10906 case "$knowitall" in
10908 echo " I'm giving up; maybe you can try again with a different compiler?" >&4
10912 echo "I could not find the definition for va_dcl... You have problems..." >&4
10913 val="$undef"; set i_stdarg; eval $setvar
10914 val="$undef"; set i_varargs; eval $setvar
10919 case "$i_varhdr" in
10921 val="$define"; set i_stdarg; eval $setvar
10922 val="$undef"; set i_varargs; eval $setvar
10925 val="$undef"; set i_stdarg; eval $setvar
10926 val="$define"; set i_varargs; eval $setvar
10929 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
10933 : see if the Compiler supports C99 variadic macros
10934 case "$i_stdarg$i_stdlib" in
10936 echo "You have <stdarg.h> and <stdlib.h>, so checking for C99 variadic macros." >&4
10939 #include <stdarg.h>
10941 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
10945 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
10951 if eval $compile && $run ./try 2>&1 >/dev/null; then
10952 case "`$run ./try`" in
10954 echo "You have C99 variadic macros." >&4
10955 d_c99_variadic_macros="$define"
10958 echo "You don't have functional C99 variadic macros." >&4
10959 d_c99_variadic_macros="$undef"
10963 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
10964 d_c99_variadic_macros="$undef"
10969 echo "You don't have <stdarg.h> and <stdlib.h>, so not checking for C99 variadic macros." >&4
10970 d_c99_variadic_macros="$undef"
10974 : see if signal is declared as pointer to function returning int or void
10976 xxx=`./findhdr signal.h`
10977 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
10978 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10979 echo "You have int (*signal())() instead of void." >&4
10981 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10982 echo "You have void (*signal())()." >&4
10984 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
10985 echo "You have int (*signal())() instead of void." >&4
10987 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
10988 echo "You have void (*signal())()." >&4
10991 case "$d_voidsig" in
10993 echo "I can't determine whether signal handler returns void or int..." >&4
10995 rp="What type does your signal handler return?"
10998 v*) val="$define";;
11002 echo "As you already told me, signal handler returns void." >&4
11005 *) echo "As you already told me, signal handler returns int." >&4
11012 case "$d_voidsig" in
11013 "$define") signal_t="void";;
11014 *) signal_t="int";;
11018 : check for ability to cast large floats to 32-bit ints.
11020 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
11021 if $test "$intsize" -ge 4; then
11028 #$i_stdlib I_STDLIB
11030 #include <stdlib.h>
11032 #include <sys/types.h>
11033 #include <signal.h>
11034 $signal_t blech(int s) { exit(3); }
11041 signal(SIGFPE, blech);
11043 /* Don't let compiler optimize the test away. Store the number
11044 in a writable string for gcc to pass to sscanf under HP-UX.
11046 sprintf(str, "2147483647");
11047 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
11051 /* x86 processors will probably give 0x8000 0000, which is a
11052 sign change. We don't want that. We want to mimic SPARC
11053 behavior here, which is to preserve the sign and give
11056 if (i32 != ($xxx) f)
11062 if eval $compile_ok; then
11066 echo "(I can't seem to compile the test program--assuming it can't)"
11071 echo "Yup, it can."
11074 echo "Nope, it can't."
11081 : check for ability to cast negative floats to unsigned
11083 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
11086 #$i_stdlib I_STDLIB
11088 #include <stdlib.h>
11090 #include <sys/types.h>
11091 #include <signal.h>
11092 $signal_t blech(int s) { exit(7); }
11093 $signal_t blech_in_list(int s) { exit(4); }
11094 unsigned long dummy_long(unsigned long p) { return p; }
11095 unsigned int dummy_int(unsigned int p) { return p; }
11096 unsigned short dummy_short(unsigned short p) { return p; }
11100 unsigned long along;
11102 unsigned short ashort;
11106 /* Frustrate gcc-2.7.2's optimizer which failed this test with
11107 a direct f = -123. assignment. gcc-2.8.0 reportedly
11108 optimized the whole file away
11110 /* Store the number in a writable string for gcc to pass to
11111 sscanf under HP-UX.
11113 sprintf(str, "-123");
11114 sscanf(str, "%lf", &f); /* f = -123.; */
11116 signal(SIGFPE, blech);
11117 along = (unsigned long)f;
11118 aint = (unsigned int)f;
11119 ashort = (unsigned short)f;
11120 if (along != (unsigned long)-123)
11122 if (aint != (unsigned int)-123)
11124 if (ashort != (unsigned short)-123)
11126 sprintf(str, "1073741824.");
11127 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
11130 along = (unsigned long)f;
11131 if (along != 0x80000000)
11135 along = (unsigned long)f;
11136 if (along != 0x7fffffff)
11140 along = (unsigned long)f;
11141 if (along != 0x80000001)
11145 signal(SIGFPE, blech_in_list);
11146 sprintf(str, "123.");
11147 sscanf(str, "%lf", &f); /* f = 123.; */
11148 along = dummy_long((unsigned long)f);
11149 aint = dummy_int((unsigned int)f);
11150 ashort = dummy_short((unsigned short)f);
11151 if (along != (unsigned long)123)
11153 if (aint != (unsigned int)123)
11155 if (ashort != (unsigned short)123)
11162 if eval $compile_ok; then
11166 echo "(I can't seem to compile the test program--assuming it can't)"
11169 case "$castflags" in
11171 echo "Yup, it can."
11174 echo "Nope, it can't."
11181 : see if vprintf exists
11183 if set vprintf val -f d_vprintf; eval $csym; $val; then
11184 echo 'vprintf() found.' >&4
11187 #$i_stdarg I_STDARG /* Only one of these can be defined by i_varhrd */
11188 #$i_varargs I_VARARGS
11190 #$i_stdlib I_STDLIB
11191 #$i_unistd I_UNISTD
11194 # include <stdarg.h>
11195 #else /* I_VARARGS */
11196 # include <varargs.h>
11200 # include <unistd.h>
11204 # include <stdlib.h>
11207 #include <stdio.h> /* vsprintf prototype */
11210 void xxx(int n, ...)
11215 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11217 int main() { xxx(1, "foo"); }
11219 #else /* I_VARARGS */
11227 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11229 int main() { xxx("foo"); }
11235 if eval $compile_ok; then
11236 if $run ./try; then
11237 echo "Your vsprintf() returns (int)." >&4
11240 echo "Your vsprintf() returns (char*)." >&4
11244 echo 'I am unable to compile the vsprintf() test program.' >&4
11245 # We shouldn't get here. If we do, assume the standard signature,
11246 # not the old BSD one.
11247 echo 'Guessing that vsprintf() returns (int).' >&4
11251 echo 'vprintf() NOT found.' >&4
11262 : see if chown exists
11266 : see if chroot exists
11267 set chroot d_chroot
11270 : see if chsize exists
11271 set chsize d_chsize
11274 : see if class exists
11278 : see if clearenv exists
11279 set clearenv d_clearenv
11282 : Define hasstruct macro for Configure internal use
11283 hasstruct='varname=$1; struct=$2; shift; shift;
11284 while $test $# -ge 2; do
11286 $define) echo "#include <$2>";;
11290 echo "int main () { struct $struct foo; }" >> try.c;
11292 if eval $compile; then
11301 : see whether socket exists
11305 $echo $n "Hmm... $c" >&4
11306 if set socket val -f d_socket; eval $csym; $val; then
11307 echo "Looks like you have Berkeley networking support." >&4
11309 if set setsockopt val -f; eval $csym; $val; then
11312 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
11313 d_oldsock="$define"
11316 if $contains socklib libc.list >/dev/null 2>&1; then
11317 echo "Looks like you have Berkeley networking support." >&4
11319 : we will have to assume that it supports the 4.2 BSD interface
11322 echo "You don't have Berkeley networking in libc$_a..." >&4
11323 if test "X$d_socket" = "X$define"; then
11324 echo "...but you seem to believe that you have sockets." >&4
11326 for net in net socket
11328 if test -f /usr/lib/lib$net$_a; then
11329 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
11330 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
11331 if $contains socket libc.list >/dev/null 2>&1; then
11336 echo "...but the Wollongong group seems to have hacked it in." >&4
11337 sockethdr="-I/usr/netinclude"
11340 echo "Found Berkeley sockets interface in lib$net." >&4
11341 if $contains setsockopt libc.list >/dev/null 2>&1; then
11344 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
11345 d_oldsock="$define"
11351 if test "X$d_socket" != "X$define"; then
11352 echo "or anywhere else I see." >&4
11360 : see if socketpair exists
11361 set socketpair d_sockpair
11366 echo "Checking the availability sa_len in the sock struct ..." >&4
11368 #include <sys/types.h>
11369 #include <sys/socket.h>
11371 struct sockaddr sa;
11372 return (sa.sa_len);
11376 set try; if eval $compile; then
11379 set d_sockaddr_sa_len; eval $setvar
11383 echo "Checking the availability struct sockaddr_in6 ..." >&4
11385 #include <sys/types.h>
11386 #include <sys/socket.h>
11387 #include <netinet/in.h>
11389 struct sockaddr_in6 sin6;
11390 return (sin6.sin6_family);
11394 set try; if eval $compile; then
11397 set d_sockaddr_in6; eval $setvar
11401 echo "Checking the availability sin6_scope_id in struct sockaddr_in6 ..." >&4
11403 #include <sys/types.h>
11404 #include <sys/socket.h>
11405 #include <netinet/in.h>
11407 struct sockaddr_in6 sin6;
11408 return (sin6.sin6_scope_id);
11412 set try; if eval $compile; then
11415 set d_sin6_scope_id; eval $setvar
11419 echo "Checking the availability struct ip_mreq ..." >&4
11421 #include <sys/types.h>
11422 #include <sys/socket.h>
11423 #include <netinet/in.h>
11425 struct ip_mreq mreq;
11426 return (mreq.imr_multiaddr.s_addr);
11430 set try; if eval $compile; then
11433 set d_ip_mreq; eval $setvar
11437 echo "Checking the availability struct ip_mreq_source ..." >&4
11439 #include <sys/types.h>
11440 #include <sys/socket.h>
11441 #include <netinet/in.h>
11443 struct ip_mreq_source mreq;
11444 return (mreq.imr_multiaddr.s_addr);
11448 set try; if eval $compile; then
11451 set d_ip_mreq_source; eval $setvar
11455 echo "Checking the availability struct ipv6_mreq ..." >&4
11457 #include <sys/types.h>
11458 #include <sys/socket.h>
11459 #include <netinet/in.h>
11461 struct ipv6_mreq mreq;
11462 return (mreq.ipv6mr_interface);
11466 set try; if eval $compile; then
11469 set d_ipv6_mreq; eval $setvar
11473 echo "Checking the availability struct ipv6_mreq_source ..." >&4
11475 #include <sys/types.h>
11476 #include <sys/socket.h>
11477 #include <netinet/in.h>
11479 struct ipv6_mreq_source mreq;
11480 return (mreq.imr_multiaddr.s_addr);
11484 set try; if eval $compile; then
11487 set d_ipv6_mreq_source; eval $setvar
11491 echo "Checking the availability of certain socket constants..." >&4
11492 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
11493 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
11495 #include <sys/types.h>
11496 #include <sys/socket.h>
11502 set try; if eval $compile; then
11505 set d_${enum}; eval $setvar
11509 : see if this is a sys/uio.h system
11510 set sys/uio.h i_sysuio
11513 : Check for cmsghdr support
11515 echo "Checking to see if your system supports struct cmsghdr..." >&4
11516 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
11518 case "$d_cmsghdr_s" in
11519 "$define") echo "Yes, it does." ;;
11520 *) echo "No, it doesn't." ;;
11524 : check for const keyword
11526 echo 'Checking to see if your C compiler knows about "const"...' >&4
11527 $cat >const.c <<'EOCP'
11528 typedef struct spug { int drokk; } spug;
11532 const spug y = { 0 };
11535 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
11537 echo "Yup, it does."
11540 echo "Nope, it doesn't."
11545 : see if copysignl exists
11546 set copysignl d_copysignl
11549 : see if crypt exists
11554 $define) cryptlib='' ;;
11555 *) if set crypt val -f d_crypt; eval $csym; $val; then
11556 echo 'crypt() found.' >&4
11560 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
11561 if $test -z "$cryptlib"; then
11562 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
11566 if $test -z "$cryptlib"; then
11567 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
11571 if $test -z "$cryptlib"; then
11572 cryptlib=`./loc libcrypt$_a "" $libpth`
11576 if $test -z "$cryptlib"; then
11577 echo 'crypt() NOT found.' >&4
11588 : see if this is a crypt.h system
11589 set crypt.h i_crypt
11592 : see if crypt_r exists
11593 set crypt_r d_crypt_r
11595 case "$d_crypt_r" in
11597 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
11598 case "$d_crypt_r_proto:$usethreads" in
11599 ":define") d_crypt_r_proto=define
11600 set d_crypt_r_proto crypt_r $hdrs
11604 case "$d_crypt_r_proto" in
11606 case "$crypt_r_proto" in
11607 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
11608 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCS ;;
11610 case "$crypt_r_proto" in
11611 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
11612 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCD ;;
11614 case "$crypt_r_proto" in
11615 ''|0) d_crypt_r=undef
11617 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
11618 * ) case "$crypt_r_proto" in
11619 REENTRANT_PROTO*) ;;
11620 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
11622 echo "Prototype: $try" ;;
11625 *) case "$usethreads" in
11626 define) echo "crypt_r has no prototype, not using it." >&4 ;;
11637 : get csh whereabouts
11639 'csh') val="$undef" ;;
11640 *) val="$define" ;;
11644 : Respect a hint or command line value for full_csh.
11645 case "$full_csh" in
11646 '') full_csh=$csh ;;
11649 : see if ctermid exists
11650 set ctermid d_ctermid
11653 : see if ctermid_r exists
11654 set ctermid_r d_ctermid_r
11656 case "$d_ctermid_r" in
11658 hdrs="$i_systypes sys/types.h define stdio.h "
11659 case "$d_ctermid_r_proto:$usethreads" in
11660 ":define") d_ctermid_r_proto=define
11661 set d_ctermid_r_proto ctermid_r $hdrs
11665 case "$d_ctermid_r_proto" in
11667 case "$ctermid_r_proto" in
11668 ''|0) try='char* ctermid_r(char*);'
11669 ./protochk "$extern_C $try" $hdrs && ctermid_r_proto=B_B ;;
11671 case "$ctermid_r_proto" in
11672 ''|0) d_ctermid_r=undef
11674 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
11675 * ) case "$ctermid_r_proto" in
11676 REENTRANT_PROTO*) ;;
11677 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
11679 echo "Prototype: $try" ;;
11682 *) case "$usethreads" in
11683 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
11690 *) ctermid_r_proto=0
11694 : see if ctime_r exists
11695 set ctime_r d_ctime_r
11697 case "$d_ctime_r" in
11699 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
11700 case "$d_ctime_r_proto:$usethreads" in
11701 ":define") d_ctime_r_proto=define
11702 set d_ctime_r_proto ctime_r $hdrs
11706 case "$d_ctime_r_proto" in
11708 case "$ctime_r_proto" in
11709 ''|0) try='char* ctime_r(const time_t*, char*);'
11710 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SB ;;
11712 case "$ctime_r_proto" in
11713 ''|0) try='char* ctime_r(const time_t*, char*, int);'
11714 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SBI ;;
11716 case "$ctime_r_proto" in
11717 ''|0) try='int ctime_r(const time_t*, char*);'
11718 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SB ;;
11720 case "$ctime_r_proto" in
11721 ''|0) try='int ctime_r(const time_t*, char*, int);'
11722 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SBI ;;
11724 case "$ctime_r_proto" in
11725 ''|0) d_ctime_r=undef
11727 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
11728 * ) case "$ctime_r_proto" in
11729 REENTRANT_PROTO*) ;;
11730 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
11732 echo "Prototype: $try" ;;
11735 *) case "$usethreads" in
11736 define) echo "ctime_r has no prototype, not using it." >&4 ;;
11747 : see if cuserid exists
11748 set cuserid d_cuserid
11751 : see if this is a limits.h system
11752 set limits.h i_limits
11755 : see if this is a float.h system
11756 set float.h i_float
11759 : See if number of significant digits in a double precision number is known
11761 $cat >dbl_dig.c <<EOM
11762 #$i_limits I_LIMITS
11765 #include <limits.h>
11771 printf("Contains DBL_DIG");
11774 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
11775 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
11776 echo "DBL_DIG found." >&4
11779 echo "DBL_DIG NOT found." >&4
11786 : see if dbm.h is available
11787 : see if dbmclose exists
11788 set dbmclose d_dbmclose
11791 case "$d_dbmclose" in
11801 *) set rpcsvc/dbm.h i_rpcsvcdbm
11806 *) echo "We won't be including <dbm.h>"
11816 : see if prototype for dbminit is available
11818 set d_dbminitproto dbminit $i_dbm dbm.h
11821 : see if difftime exists
11822 set difftime d_difftime
11825 : see if this is a dirent system
11827 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
11829 echo "<dirent.h> found." >&4
11832 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
11833 echo "<sys/dir.h> found." >&4
11836 xinc=`./findhdr sys/ndir.h`
11838 echo "<dirent.h> NOT found." >&4
11843 : Look for type of directory structure.
11845 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11847 case "$direntrytype" in
11849 case "$i_dirent" in
11850 $define) guess1='struct dirent' ;;
11851 *) guess1='struct direct' ;;
11854 *) guess1="$direntrytype"
11859 'struct dirent') guess2='struct direct' ;;
11860 *) guess2='struct dirent' ;;
11863 if $contains "$guess1" try.c >/dev/null 2>&1; then
11864 direntrytype="$guess1"
11865 echo "Your directory entries are $direntrytype." >&4
11866 elif $contains "$guess2" try.c >/dev/null 2>&1; then
11867 direntrytype="$guess2"
11868 echo "Your directory entries seem to be $direntrytype." >&4
11870 echo "I don't recognize your system's directory entries." >&4
11871 rp="What type is used for directory entries on this system?"
11874 direntrytype="$ans"
11878 : see if the directory entry stores field length
11880 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11881 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
11882 echo "Good, your directory entry keeps length information in d_namlen." >&4
11885 echo "Your directory entry does not know about the d_namlen field." >&4
11892 : Look for DIR.dd_fd
11893 case "$i_dirent" in
11895 echo "Checking to see if DIR has a dd_fd member variable" >&4
11897 #$i_stdlib I_STDLIB
11899 #include <stdlib.h>
11901 #include <dirent.h>
11911 if eval $compile; then
11912 echo "Yes, it does."
11915 echo "No, it does not."
11920 echo "You don't have a <dirent.h>, so not checking for dd_fd." >&4
11928 : see if this is an sysdir system
11929 set sys/dir.h i_sysdir
11932 : see if this is an sysndir system
11933 set sys/ndir.h i_sysndir
11938 $cat >dirfd.c <<EOM
11940 #$i_stdlib I_STDLIB
11942 #include <stdlib.h>
11944 #$i_dirent I_DIRENT /**/
11945 #$i_sysdir I_SYS_DIR /**/
11946 #$i_sysndir I_SYS_NDIR /**/
11947 #$i_systypes I_SYS_TYPES /**/
11948 #if defined(I_SYS_TYPES)
11949 #include <sys/types.h>
11951 #if defined(I_DIRENT)
11952 #include <dirent.h>
11953 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
11954 #include <sys/dir.h>
11958 #include <sys/ndir.h>
11962 #include <ndir.h> /* may be wrong in the future */
11964 #include <sys/dir.h>
11970 DIR *dirp = opendir(".");
11971 if (dirfd(dirp) >= 0)
11979 if eval $compile; then
11983 $define) echo "dirfd() found." >&4 ;;
11984 *) echo "dirfd() NOT found." >&4 ;;
11990 : see if dlerror exists
11993 set dlerror d_dlerror
11997 : see if dlfcn is available
11998 set dlfcn.h i_dlfcn
12001 : Check what extension to use for shared libs
12006 On a few systems, the dynamically loaded modules that perl generates and uses
12007 will need a different extension than shared libs. The default will probably
12013 *) dflt="$dlext" ;;
12015 rp='What is the extension of dynamically loaded modules'
12024 : Check if dlsym need a leading underscore
12030 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
12031 $cat >dyna.c <<'EOM'
12038 #$i_stdlib I_STDLIB
12040 #include <stdlib.h>
12044 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
12046 #include <sys/types.h>
12051 extern int fred() ;
12060 int mode = RTLD_LAZY ;
12062 handle = dlopen("./dyna.$dlext", mode) ;
12063 if (handle == NULL) {
12068 symbol = dlsym(handle, "fred") ;
12069 if (symbol == NULL) {
12070 /* try putting a leading underscore */
12071 symbol = dlsym(handle, "_fred") ;
12072 if (symbol == NULL) {
12085 : Call the object file tmp-dyna.o in case dlext=o.
12086 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
12087 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
12088 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
12089 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
12092 1) echo "Test program failed using dlopen." >&4
12093 echo "Perhaps you should not use dynamic loading." >&4;;
12094 2) echo "Test program failed using dlsym." >&4
12095 echo "Perhaps you should not use dynamic loading." >&4;;
12096 3) echo "dlsym needs a leading underscore" >&4
12098 4) echo "dlsym doesn't need a leading underscore." >&4;;
12101 echo "I can't compile and run the test program." >&4
12102 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
12107 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
12112 : see if drand48_r exists
12113 set drand48_r d_drand48_r
12115 case "$d_drand48_r" in
12117 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
12118 case "$d_drand48_r_proto:$usethreads" in
12119 ":define") d_drand48_r_proto=define
12120 set d_drand48_r_proto drand48_r $hdrs
12124 case "$d_drand48_r_proto" in
12126 case "$drand48_r_proto" in
12127 ''|0) try='int drand48_r(struct drand48_data*, double*);'
12128 ./protochk "$extern_C $try" $hdrs && drand48_r_proto=I_ST ;;
12130 case "$drand48_r_proto" in
12131 ''|0) d_drand48_r=undef
12133 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
12134 * ) case "$drand48_r_proto" in
12135 REENTRANT_PROTO*) ;;
12136 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
12138 echo "Prototype: $try" ;;
12141 *) case "$usethreads" in
12142 define) echo "drand48_r has no prototype, not using it." >&4 ;;
12149 *) drand48_r_proto=0
12153 : see if prototype for drand48 is available
12155 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
12158 : see if dup2 exists
12162 : see if eaccess exists
12163 set eaccess d_eaccess
12166 : see if endgrent exists
12167 set endgrent d_endgrent
12170 : see if this is an grp system
12176 xxx=`./findhdr grp.h`
12177 $cppstdin $cppflags $cppminus < $xxx >$$.h
12179 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
12191 set d_grpasswd; eval $setvar
12195 : see if endgrent_r exists
12196 set endgrent_r d_endgrent_r
12198 case "$d_endgrent_r" in
12200 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12201 case "$d_endgrent_r_proto:$usethreads" in
12202 ":define") d_endgrent_r_proto=define
12203 set d_endgrent_r_proto endgrent_r $hdrs
12207 case "$d_endgrent_r_proto" in
12209 case "$endgrent_r_proto" in
12210 ''|0) try='int endgrent_r(FILE**);'
12211 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=I_H ;;
12213 case "$endgrent_r_proto" in
12214 ''|0) try='void endgrent_r(FILE**);'
12215 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=V_H ;;
12217 case "$endgrent_r_proto" in
12218 ''|0) d_endgrent_r=undef
12220 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
12221 * ) case "$endgrent_r_proto" in
12222 REENTRANT_PROTO*) ;;
12223 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
12225 echo "Prototype: $try" ;;
12228 *) case "$usethreads" in
12229 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
12236 *) endgrent_r_proto=0
12240 : see if endhostent exists
12241 set endhostent d_endhent
12244 : see if this is a netdb.h system
12245 set netdb.h i_netdb
12248 : see if endhostent_r exists
12249 set endhostent_r d_endhostent_r
12251 case "$d_endhostent_r" in
12253 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12254 case "$d_endhostent_r_proto:$usethreads" in
12255 ":define") d_endhostent_r_proto=define
12256 set d_endhostent_r_proto endhostent_r $hdrs
12260 case "$d_endhostent_r_proto" in
12262 case "$endhostent_r_proto" in
12263 ''|0) try='int endhostent_r(struct hostent_data*);'
12264 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=I_D ;;
12266 case "$endhostent_r_proto" in
12267 ''|0) try='void endhostent_r(struct hostent_data*);'
12268 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=V_D ;;
12270 case "$endhostent_r_proto" in
12271 ''|0) d_endhostent_r=undef
12272 endhostent_r_proto=0
12273 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
12274 * ) case "$endhostent_r_proto" in
12275 REENTRANT_PROTO*) ;;
12276 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
12278 echo "Prototype: $try" ;;
12281 *) case "$usethreads" in
12282 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
12284 d_endhostent_r=undef
12285 endhostent_r_proto=0
12289 *) endhostent_r_proto=0
12293 : see if endnetent exists
12294 set endnetent d_endnent
12297 : see if endnetent_r exists
12298 set endnetent_r d_endnetent_r
12300 case "$d_endnetent_r" in
12302 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12303 case "$d_endnetent_r_proto:$usethreads" in
12304 ":define") d_endnetent_r_proto=define
12305 set d_endnetent_r_proto endnetent_r $hdrs
12309 case "$d_endnetent_r_proto" in
12311 case "$endnetent_r_proto" in
12312 ''|0) try='int endnetent_r(struct netent_data*);'
12313 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=I_D ;;
12315 case "$endnetent_r_proto" in
12316 ''|0) try='void endnetent_r(struct netent_data*);'
12317 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=V_D ;;
12319 case "$endnetent_r_proto" in
12320 ''|0) d_endnetent_r=undef
12321 endnetent_r_proto=0
12322 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
12323 * ) case "$endnetent_r_proto" in
12324 REENTRANT_PROTO*) ;;
12325 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
12327 echo "Prototype: $try" ;;
12330 *) case "$usethreads" in
12331 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
12333 d_endnetent_r=undef
12334 endnetent_r_proto=0
12338 *) endnetent_r_proto=0
12342 : see if endprotoent exists
12343 set endprotoent d_endpent
12346 : see if endprotoent_r exists
12347 set endprotoent_r d_endprotoent_r
12349 case "$d_endprotoent_r" in
12351 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12352 case "$d_endprotoent_r_proto:$usethreads" in
12353 ":define") d_endprotoent_r_proto=define
12354 set d_endprotoent_r_proto endprotoent_r $hdrs
12358 case "$d_endprotoent_r_proto" in
12360 case "$endprotoent_r_proto" in
12361 ''|0) try='int endprotoent_r(struct protoent_data*);'
12362 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=I_D ;;
12364 case "$endprotoent_r_proto" in
12365 ''|0) try='void endprotoent_r(struct protoent_data*);'
12366 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=V_D ;;
12368 case "$endprotoent_r_proto" in
12369 ''|0) d_endprotoent_r=undef
12370 endprotoent_r_proto=0
12371 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
12372 * ) case "$endprotoent_r_proto" in
12373 REENTRANT_PROTO*) ;;
12374 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
12376 echo "Prototype: $try" ;;
12379 *) case "$usethreads" in
12380 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
12382 d_endprotoent_r=undef
12383 endprotoent_r_proto=0
12387 *) endprotoent_r_proto=0
12391 : see if endpwent exists
12392 set endpwent d_endpwent
12395 : see if this is a pwd.h system
12401 xxx=`./findhdr pwd.h`
12402 $cppstdin $cppflags $cppminus < $xxx >$$.h
12404 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
12412 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
12420 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
12428 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
12436 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
12444 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
12452 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
12460 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
12472 set d_pwquota; eval $setvar
12473 set d_pwage; eval $setvar
12474 set d_pwchange; eval $setvar
12475 set d_pwclass; eval $setvar
12476 set d_pwexpire; eval $setvar
12477 set d_pwcomment; eval $setvar
12478 set d_pwgecos; eval $setvar
12479 set d_pwpasswd; eval $setvar
12483 : see if endpwent_r exists
12484 set endpwent_r d_endpwent_r
12486 case "$d_endpwent_r" in
12488 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
12489 case "$d_endpwent_r_proto:$usethreads" in
12490 ":define") d_endpwent_r_proto=define
12491 set d_endpwent_r_proto endpwent_r $hdrs
12495 case "$d_endpwent_r_proto" in
12497 case "$endpwent_r_proto" in
12498 ''|0) try='int endpwent_r(FILE**);'
12499 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=I_H ;;
12501 case "$endpwent_r_proto" in
12502 ''|0) try='void endpwent_r(FILE**);'
12503 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=V_H ;;
12505 case "$endpwent_r_proto" in
12506 ''|0) d_endpwent_r=undef
12508 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
12509 * ) case "$endpwent_r_proto" in
12510 REENTRANT_PROTO*) ;;
12511 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
12513 echo "Prototype: $try" ;;
12516 *) case "$usethreads" in
12517 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
12524 *) endpwent_r_proto=0
12528 : see if endservent exists
12529 set endservent d_endsent
12532 : see if endservent_r exists
12533 set endservent_r d_endservent_r
12535 case "$d_endservent_r" in
12537 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12538 case "$d_endservent_r_proto:$usethreads" in
12539 ":define") d_endservent_r_proto=define
12540 set d_endservent_r_proto endservent_r $hdrs
12544 case "$d_endservent_r_proto" in
12546 case "$endservent_r_proto" in
12547 ''|0) try='int endservent_r(struct servent_data*);'
12548 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=I_D ;;
12550 case "$endservent_r_proto" in
12551 ''|0) try='void endservent_r(struct servent_data*);'
12552 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=V_D ;;
12554 case "$endservent_r_proto" in
12555 ''|0) d_endservent_r=undef
12556 endservent_r_proto=0
12557 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
12558 * ) case "$endservent_r_proto" in
12559 REENTRANT_PROTO*) ;;
12560 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
12562 echo "Prototype: $try" ;;
12565 *) case "$usethreads" in
12566 define) echo "endservent_r has no prototype, not using it." >&4 ;;
12568 d_endservent_r=undef
12569 endservent_r_proto=0
12573 *) endservent_r_proto=0
12577 : Locate the flags for 'open()'
12580 #include <sys/types.h>
12585 #include <sys/file.h>
12587 #$i_stdlib I_STDLIB
12589 #include <stdlib.h>
12600 : check sys/file.h first to get FREAD on Sun
12601 if $test `./findhdr sys/file.h` && \
12602 set try -DI_SYS_FILE && eval $compile; then
12604 echo "<sys/file.h> defines the O_* constants..." >&4
12605 if $run ./try; then
12606 echo "and you have the 3 argument form of open()." >&4
12609 echo "but not the 3 argument form of open(). Oh, well." >&4
12612 elif $test `./findhdr fcntl.h` && \
12613 set try -DI_FCNTL && eval $compile; then
12615 echo "<fcntl.h> defines the O_* constants..." >&4
12616 if $run ./try; then
12617 echo "and you have the 3 argument form of open()." >&4
12620 echo "but not the 3 argument form of open(). Oh, well." >&4
12625 echo "I can't find the O_* constant definitions! You got problems." >&4
12631 : see if this is a sys/file.h system
12636 : do we need to include sys/file.h ?
12640 if $h_sysfile; then
12642 echo "We'll be including <sys/file.h>." >&4
12645 echo "We won't be including <sys/file.h>." >&4
12655 : see if fcntl.h is there
12660 : see if we can include fcntl.h
12666 echo "We'll be including <fcntl.h>." >&4
12669 if $h_sysfile; then
12670 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
12672 echo "We won't be including <fcntl.h>." >&4
12684 : see if fork exists
12688 : see if pipe exists
12692 : check for non-blocking I/O stuff
12693 case "$h_sysfile" in
12694 true) echo "#include <sys/file.h>" > head.c;;
12697 true) echo "#include <fcntl.h>" > head.c;;
12698 *) echo "#include <sys/fcntl.h>" > head.c;;
12703 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
12704 case "$o_nonblock" in
12706 $cat head.c > try.c
12707 $cat >>try.c <<EOCP
12709 #$i_stdlib I_STDLIB
12711 #include <stdlib.h>
12719 printf("O_NONBLOCK\n");
12723 printf("O_NDELAY\n");
12727 printf("FNDELAY\n");
12734 if eval $compile_ok; then
12735 o_nonblock=`$run ./try`
12736 case "$o_nonblock" in
12737 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
12738 *) echo "Seems like we can use $o_nonblock.";;
12741 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
12744 *) echo "Using $hint value $o_nonblock.";;
12749 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
12752 case "$d_fork:$d_pipe" in
12754 $cat head.c > try.c
12755 $cat >>try.c <<EOCP
12757 #include <sys/types.h>
12758 #include <signal.h>
12760 #$i_stdlib I_STDLIB
12762 #include <stdlib.h>
12768 #define MY_O_NONBLOCK $o_nonblock
12769 #ifndef errno /* XXX need better Configure test */
12772 #$i_unistd I_UNISTD
12774 #include <unistd.h>
12776 #$i_string I_STRING
12778 #include <string.h>
12780 #include <strings.h>
12782 $signal_t blech(int x) { exit(3); }
12784 $cat >> try.c <<'EOCP'
12792 pipe(pd); /* Down: child -> parent */
12793 pipe(pu); /* Up: parent -> child */
12796 close(pd[1]); /* Parent reads from pd[0] */
12797 close(pu[0]); /* Parent writes (blocking) to pu[1] */
12799 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
12804 signal(SIGALRM, blech);
12806 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
12808 sprintf(string, "%d\n", ret);
12809 write(2, string, strlen(string));
12812 if (errno == EAGAIN) {
12813 printf("EAGAIN\n");
12818 if (errno == EWOULDBLOCK)
12819 printf("EWOULDBLOCK\n");
12822 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
12823 sleep(2); /* Give it time to close our pipe */
12825 ret = read(pd[0], buf, 1); /* Should read EOF */
12827 sprintf(string, "%d\n", ret);
12828 write(4, string, strlen(string));
12832 close(pd[0]); /* We write to pd[1] */
12833 close(pu[1]); /* We read from pu[0] */
12834 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
12835 close(pd[1]); /* Pipe pd is now fully closed! */
12836 exit(0); /* Bye bye, thank you for playing! */
12840 if eval $compile_ok; then
12841 echo "$startsh" >mtry
12842 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
12844 ./mtry >/dev/null 2>&1
12846 0) eagain=`$cat try.out`;;
12847 1) echo "Could not perform non-blocking setting!";;
12848 2) echo "I did a successful read() for something that was not there!";;
12849 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
12850 4) echo "Could not find F_SETFL!";;
12851 *) echo "Something terribly wrong happened during testing.";;
12853 rd_nodata=`$cat try.ret`
12854 echo "A read() system call with no data present returns $rd_nodata."
12855 case "$rd_nodata" in
12858 echo "(That's peculiar, fixing that to be -1.)"
12864 echo "Forcing errno EAGAIN on read() with no data available."
12868 echo "Your read() sets errno to $eagain when no data is available."
12871 status=`$cat try.err`
12873 0) echo "And it correctly returns 0 to signal EOF.";;
12874 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
12875 *) echo "However, your read() returns '$status' on EOF??";;
12878 if test "$status" = "$rd_nodata"; then
12879 echo "WARNING: you can't distinguish between EOF and no data!"
12883 echo "I can't compile the test program--assuming errno EAGAIN will do."
12887 *) echo "Can't figure out how to test this--assuming errno EAGAIN will do."
12896 echo "Using $hint value $eagain."
12897 echo "Your read() returns $rd_nodata when no data is present."
12898 case "$d_eofnblk" in
12899 "$define") echo "And you can see EOF because read() returns 0.";;
12900 "$undef") echo "But you can't see EOF status from read() returned value.";;
12902 echo "(Assuming you can't see EOF status from read anyway.)"
12908 $rm_try head.c mtry
12910 : see if _ptr and _cnt from stdio act std
12913 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
12914 echo "(Looks like you have stdio.h from BSD.)"
12915 case "$stdio_ptr" in
12916 '') stdio_ptr='((fp)->_p)'
12919 *) ptr_lval=$d_stdio_ptr_lval;;
12921 case "$stdio_cnt" in
12922 '') stdio_cnt='((fp)->_r)'
12925 *) cnt_lval=$d_stdio_cnt_lval;;
12927 case "$stdio_base" in
12928 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
12930 case "$stdio_bufsiz" in
12931 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
12933 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
12934 echo "(Looks like you have stdio.h from Linux.)"
12935 case "$stdio_ptr" in
12936 '') stdio_ptr='((fp)->_IO_read_ptr)'
12939 *) ptr_lval=$d_stdio_ptr_lval;;
12941 case "$stdio_cnt" in
12942 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
12945 *) cnt_lval=$d_stdio_cnt_lval;;
12947 case "$stdio_base" in
12948 '') stdio_base='((fp)->_IO_read_base)';;
12950 case "$stdio_bufsiz" in
12951 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
12954 case "$stdio_ptr" in
12955 '') stdio_ptr='((fp)->_ptr)'
12958 *) ptr_lval=$d_stdio_ptr_lval;;
12960 case "$stdio_cnt" in
12961 '') stdio_cnt='((fp)->_cnt)'
12964 *) cnt_lval=$d_stdio_cnt_lval;;
12966 case "$stdio_base" in
12967 '') stdio_base='((fp)->_base)';;
12969 case "$stdio_bufsiz" in
12970 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
12974 : test whether _ptr and _cnt really work
12975 echo "Checking how std your stdio is..." >&4
12978 #$i_stdlib I_STDLIB
12980 #include <stdlib.h>
12982 #define FILE_ptr(fp) $stdio_ptr
12983 #define FILE_cnt(fp) $stdio_cnt
12985 FILE *fp = fopen("try.c", "r");
12988 18 <= FILE_cnt(fp) &&
12989 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12997 if eval $compile && $to try.c; then
12998 if $run ./try; then
12999 echo "Your stdio acts pretty std."
13002 echo "Your stdio isn't very std."
13005 echo "Your stdio doesn't appear very std."
13009 # glibc 2.2.90 and above apparently change stdio streams so Perl's
13010 # direct buffer manipulation no longer works. The Configure tests
13011 # should be changed to correctly detect this, but until then,
13012 # the following check should at least let perl compile and run.
13013 # (This quick fix should be updated before 5.8.1.)
13014 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
13015 # A. Dougherty, June 3, 2002.
13016 case "$d_gnulibc" in
13018 case "$gnulibc_version" in
13022 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
13031 : Can _ptr be used as an lvalue?
13032 case "$d_stdstdio$ptr_lval" in
13033 $define$define) val=$define ;;
13036 set d_stdio_ptr_lval
13039 : Can _cnt be used as an lvalue?
13040 case "$d_stdstdio$cnt_lval" in
13041 $define$define) val=$define ;;
13044 set d_stdio_cnt_lval
13048 : test whether setting _ptr sets _cnt as a side effect
13049 d_stdio_ptr_lval_sets_cnt="$undef"
13050 d_stdio_ptr_lval_nochange_cnt="$undef"
13051 case "$d_stdio_ptr_lval$d_stdstdio" in
13053 echo "Checking to see what happens if we set the stdio ptr..." >&4
13056 /* Can we scream? */
13057 /* Eat dust sed :-) */
13058 /* In the buffer space, no one can hear you scream. */
13059 #$i_stdlib I_STDLIB
13061 #include <stdlib.h>
13063 #define FILE_ptr(fp) $stdio_ptr
13064 #define FILE_cnt(fp) $stdio_cnt
13065 #include <sys/types.h>
13067 FILE *fp = fopen("try.c", "r");
13072 puts("Fail even to read");
13075 c = getc(fp); /* Read away the first # */
13077 puts("Fail even to read");
13081 18 <= FILE_cnt(fp) &&
13082 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
13084 puts("Fail even to read");
13087 ptr = (char*) FILE_ptr(fp);
13088 cnt = (size_t)FILE_cnt(fp);
13090 FILE_ptr(fp) += 42;
13092 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
13093 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
13096 if (FILE_cnt(fp) <= 20) {
13097 printf ("Fail (<20 chars to test)");
13100 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
13101 puts("Fail compare");
13104 if (cnt == FILE_cnt(fp)) {
13105 puts("Pass_unchanged");
13108 if (FILE_cnt(fp) == (cnt - 42)) {
13109 puts("Pass_changed");
13112 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
13118 if eval $compile && $to try.c; then
13119 case `$run ./try` in
13121 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
13122 d_stdio_ptr_lval_sets_cnt="$define" ;;
13124 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
13125 d_stdio_ptr_lval_nochange_cnt="$define" ;;
13127 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
13129 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
13132 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
13138 : see if _base is also standard
13140 case "$d_stdstdio" in
13144 #$i_stdlib I_STDLIB
13146 #include <stdlib.h>
13148 #define FILE_base(fp) $stdio_base
13149 #define FILE_bufsiz(fp) $stdio_bufsiz
13151 FILE *fp = fopen("try.c", "r");
13154 19 <= FILE_bufsiz(fp) &&
13155 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
13162 if eval $compile && $to try.c; then
13163 if $run ./try; then
13164 echo "And its _base field acts std."
13167 echo "But its _base field isn't std."
13170 echo "However, it seems to be lacking the _base field."
13178 : see if fast_stdio exists
13180 case "$d_stdstdio:$d_stdio_ptr_lval" in
13182 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
13184 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
13195 : see if fchdir exists
13196 set fchdir d_fchdir
13199 : see if fchmod exists
13200 set fchmod d_fchmod
13203 : see if fchown exists
13204 set fchown d_fchown
13207 : see if this is an fcntl system
13211 : See if fcntl-based locking works.
13214 #$i_stdlib I_STDLIB
13216 #include <stdlib.h>
13218 #include <unistd.h>
13220 #include <signal.h>
13221 $signal_t blech(int x) { exit(3); }
13223 #if defined(F_SETLK) && defined(F_SETLKW)
13224 struct flock flock;
13226 fd = open("try.c", O_RDONLY);
13227 flock.l_type = F_RDLCK;
13228 flock.l_whence = SEEK_SET;
13229 flock.l_start = flock.l_len = 0;
13230 signal(SIGALRM, blech);
13232 retval = fcntl(fd, F_SETLK, &flock);
13234 (retval < 0 ? exit(2) : exit(0));
13240 echo "Checking if fcntl-based file locking works... "
13244 if eval $compile_ok; then
13245 if $run ./try; then
13246 echo "Yes, it seems to work."
13249 echo "Nope, it didn't work."
13254 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
13255 *** This is (almost) impossible.
13256 *** If your NFS lock daemons are not feeling well, something like
13257 *** this may happen, please investigate. Cannot continue, aborting.
13265 echo "I'm unable to compile the test program, so I'll assume not."
13270 echo "Nope, since you don't even have fcntl()."
13273 set d_fcntl_can_lock
13277 : check for fd_set items
13280 Checking to see how well your C compiler handles fd_set and friends ...
13283 #$i_stdlib I_STDLIB
13285 #include <stdlib.h>
13287 #$i_systime I_SYS_TIME
13288 #$i_sysselct I_SYS_SELECT
13289 #$d_socket HAS_SOCKET
13290 #include <sys/types.h>
13292 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
13295 #include <sys/time.h>
13297 #ifdef I_SYS_SELECT
13298 #include <sys/select.h>
13307 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
13315 if eval $compile; then
13316 d_fds_bits="$define"
13318 echo "Well, your system knows about the normal fd_set typedef..." >&4
13319 if $run ./try; then
13320 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
13321 d_fd_macros="$define"
13324 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
13326 d_fd_macros="$undef"
13330 Hmm, your compiler has some difficulty with fd_set. Checking further...
13333 if eval $compile; then
13334 d_fds_bits="$undef"
13336 echo "Well, your system has some sort of fd_set available..." >&4
13337 if $run ./try; then
13338 echo "and you have the normal fd_set macros." >&4
13339 d_fd_macros="$define"
13342 but not the normal fd_set macros! Gross! More work for me...
13344 d_fd_macros="$undef"
13347 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
13349 d_fds_bits="$undef"
13350 d_fd_macros="$undef"
13355 : see if fgetpos exists
13356 set fgetpos d_fgetpos
13359 : see if finite exists
13360 set finite d_finite
13363 : see if finitel exists
13364 set finitel d_finitel
13367 : see if flock exists
13371 : see if prototype for flock is available
13373 set d_flockproto flock $i_sysfile sys/file.h
13376 : see if fp_class exists
13377 set fp_class d_fp_class
13380 : see if pathconf exists
13381 set pathconf d_pathconf
13384 : see if fpathconf exists
13385 set fpathconf d_fpathconf
13388 : see if fpclass exists
13389 set fpclass d_fpclass
13392 : see if fpclassify exists
13393 set fpclassify d_fpclassify
13396 : see if fpclassl exists
13397 set fpclassl d_fpclassl
13400 : check for fpos64_t
13402 echo "Checking to see if you have fpos64_t..." >&4
13405 int main() { fpos64_t x = 7; }
13408 if eval $compile; then
13410 echo "You have fpos64_t."
13413 echo "You do not have fpos64_t."
13414 case "$fpossize" in
13415 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
13422 : see if frexpl exists
13423 set frexpl d_frexpl
13426 : see if this is a sys/param system
13427 set sys/param.h i_sysparam
13430 : see if this is a sys/mount.h system
13431 set sys/mount.h i_sysmount
13434 : Check for fs_data_s
13436 echo "Checking to see if your system supports struct fs_data..." >&4
13437 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
13439 case "$d_fs_data_s" in
13440 "$define") echo "Yes, it does." ;;
13441 *) echo "No, it doesn't." ;;
13444 : see if fseeko exists
13445 set fseeko d_fseeko
13447 case "$longsize" in
13448 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
13451 : see if fsetpos exists
13452 set fsetpos d_fsetpos
13455 : see if fstatfs exists
13456 set fstatfs d_fstatfs
13459 : see if statvfs exists
13460 set statvfs d_statvfs
13463 : see if fstatvfs exists
13464 set fstatvfs d_fstatvfs
13468 : see if fsync exists
13472 : see if ftello exists
13473 set ftello d_ftello
13475 case "$longsize" in
13476 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
13479 : check for a working futimes
13482 echo "Checking if you have a working futimes()" >&4
13485 #include <sys/time.h>
13492 fd = open ("try.c", O_RDWR);
13493 if (-1 == fd) exit (1);
13494 rv = futimes (fd, NULL);
13495 exit (rv == -1 ? errno : 0);
13499 if eval $compile; then
13503 0) echo "Yes, you have" >&4
13504 d_futimes="$define"
13506 *) echo "No, you have futimes, but it isn't working ($rc) (probably harmless)" >&4
13510 echo "No, it does not (probably harmless)" >&4
13514 : see if ndbm.h is available
13517 : Compatibility location for RedHat 7.1
13518 set gdbm/ndbm.h i_gdbmndbm
13520 : Compatibility location for Debian 4.0
13521 set gdbm-ndbm.h i_gdbm_ndbm
13525 if $test "$i_ndbm" = "$define" -o "$i_gdbmndbm" = "$define" -o "$i_gdbm_ndbm" = "$define"; then
13526 : see if dbm_open exists
13527 set dbm_open d_dbm_open
13529 case "$d_dbm_open" in
13532 i_gdbmndbm="$undef"
13533 i_gdbm_ndbm="$undef"
13534 echo "We won't be including <ndbm.h>"
13544 ndbm_hdr_protochk='name=$1; hdr=$2;
13545 eval "ihdr=\$""i_$name";
13547 if $test "$ihdr" = "$define"; then
13548 $echo "Checking if your <$hdr> uses prototypes..." >&4;
13549 case "$d_cplusplus" in
13550 $define) ./protochk "$extern_C void dbm_close(DBM *);" literal "extern \"C\" {" $ihdr $hdr literal "}" && val="$define" ;;
13551 *) ./protochk "$extern_C void dbm_close(int, int);" $ihdr $hdr || val="$define" ;;
13554 $define) $echo "Your <$hdr> seems to have prototypes";;
13555 *) $echo "Your <$hdr> does not seem to have prototypes";;
13558 set "d_${name}_h_uses_prototypes";
13562 eval $ndbm_hdr_protochk
13563 set gdbmndbm gdbm/ndbm.h
13564 eval $ndbm_hdr_protochk
13565 set gdbm_ndbm gdbm-ndbm.h
13566 eval $ndbm_hdr_protochk
13568 : see if getaddrinfo exists
13569 set getaddrinfo d_getaddrinfo
13572 : see if getcwd exists
13573 set getcwd d_getcwd
13576 : see if getespwnam exists
13577 set getespwnam d_getespwnam
13580 : see if getfsstat exists
13581 set getfsstat d_getfsstat
13584 : see if getgrent exists
13585 set getgrent d_getgrent
13588 : see if getgrent_r exists
13589 set getgrent_r d_getgrent_r
13591 case "$d_getgrent_r" in
13593 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13594 case "$d_getgrent_r_proto:$usethreads" in
13595 ":define") d_getgrent_r_proto=define
13596 set d_getgrent_r_proto getgrent_r $hdrs
13600 case "$d_getgrent_r_proto" in
13602 case "$getgrent_r_proto" in
13603 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
13604 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBWR ;;
13606 case "$getgrent_r_proto" in
13607 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
13608 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIR ;;
13610 case "$getgrent_r_proto" in
13611 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
13612 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBW ;;
13614 case "$getgrent_r_proto" in
13615 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
13616 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBI ;;
13618 case "$getgrent_r_proto" in
13619 ''|0) try='int getgrent_r(struct group*, char*, int);'
13620 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBI ;;
13622 case "$getgrent_r_proto" in
13623 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
13624 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIH ;;
13626 case "$getgrent_r_proto" in
13627 ''|0) d_getgrent_r=undef
13629 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
13630 * ) case "$getgrent_r_proto" in
13631 REENTRANT_PROTO*) ;;
13632 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
13634 echo "Prototype: $try" ;;
13637 *) case "$usethreads" in
13638 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
13645 *) getgrent_r_proto=0
13649 : see if getgrgid_r exists
13650 set getgrgid_r d_getgrgid_r
13652 case "$d_getgrgid_r" in
13654 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13655 case "$d_getgrgid_r_proto:$usethreads" in
13656 ":define") d_getgrgid_r_proto=define
13657 set d_getgrgid_r_proto getgrgid_r $hdrs
13661 case "$d_getgrgid_r_proto" in
13663 case "$getgrgid_r_proto" in
13664 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
13665 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
13667 case "$getgrgid_r_proto" in
13668 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
13669 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
13671 case "$getgrgid_r_proto" in
13672 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
13673 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
13675 case "$getgrgid_r_proto" in
13676 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
13677 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
13679 case "$getgrgid_r_proto" in
13680 ''|0) d_getgrgid_r=undef
13682 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
13683 * ) case "$getgrgid_r_proto" in
13684 REENTRANT_PROTO*) ;;
13685 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
13687 echo "Prototype: $try" ;;
13690 *) case "$usethreads" in
13691 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
13698 *) getgrgid_r_proto=0
13702 : see if getgrnam_r exists
13703 set getgrnam_r d_getgrnam_r
13705 case "$d_getgrnam_r" in
13707 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13708 case "$d_getgrnam_r_proto:$usethreads" in
13709 ":define") d_getgrnam_r_proto=define
13710 set d_getgrnam_r_proto getgrnam_r $hdrs
13714 case "$d_getgrnam_r_proto" in
13716 case "$getgrnam_r_proto" in
13717 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
13718 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
13720 case "$getgrnam_r_proto" in
13721 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
13722 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
13724 case "$getgrnam_r_proto" in
13725 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
13726 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CBI ;;
13728 case "$getgrnam_r_proto" in
13729 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
13730 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
13732 case "$getgrnam_r_proto" in
13733 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
13734 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
13736 case "$getgrnam_r_proto" in
13737 ''|0) d_getgrnam_r=undef
13739 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
13740 * ) case "$getgrnam_r_proto" in
13741 REENTRANT_PROTO*) ;;
13742 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
13744 echo "Prototype: $try" ;;
13747 *) case "$usethreads" in
13748 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
13755 *) getgrnam_r_proto=0
13759 : see if gethostbyaddr exists
13760 set gethostbyaddr d_gethbyaddr
13763 : see if gethostbyname exists
13764 set gethostbyname d_gethbyname
13767 : see if gethostent exists
13768 set gethostent d_gethent
13771 : see how we will look up host name
13774 if set gethostname val -f d_gethname; eval $csym; $val; then
13775 echo 'gethostname() found.' >&4
13776 d_gethname="$define"
13779 if set uname val -f d_uname; eval $csym; $val; then
13782 uname() was found, but you're running xenix, and older versions of xenix
13783 have a broken uname(). If you don't really know whether your xenix is old
13784 enough to have a broken system call, use the default answer.
13789 "$define") dflt=n;;
13791 rp='Is your uname() broken?'
13794 n*) d_uname="$define"; call=uname;;
13797 echo 'uname() found.' >&4
13804 case "$d_gethname" in
13805 '') d_gethname="$undef";;
13808 '') d_uname="$undef";;
13810 case "$d_uname$d_gethname" in
13815 Every now and then someone has a $call() that lies about the hostname
13816 but can't be fixed for political or economic reasons. If you wish, I can
13817 pretend $call() isn't there and maybe compute hostname at run-time
13818 thanks to the '$phostname' command.
13821 rp="Shall I ignore $call() from now on?"
13824 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
13827 case "$phostname" in
13828 '') aphostname='';;
13829 *) case "$aphostname" in
13831 *) set X $phostname
13835 file=`./loc $file $file $pth`
13836 aphostname=`echo $file $*`
13841 case "$d_uname$d_gethname" in
13844 case "$phostname" in
13846 echo "There will be no way for $package to get your hostname." >&4;;
13848 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
13852 case "$d_phostname" in
13853 '') d_phostname="$undef";;
13856 : see if gethostbyaddr_r exists
13857 set gethostbyaddr_r d_gethostbyaddr_r
13859 case "$d_gethostbyaddr_r" in
13861 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13862 case "$d_gethostbyaddr_r_proto:$usethreads" in
13863 ":define") d_gethostbyaddr_r_proto=define
13864 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
13868 case "$d_gethostbyaddr_r_proto" in
13870 case "$gethostbyaddr_r_proto" in
13871 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13872 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
13874 case "$gethostbyaddr_r_proto" in
13875 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
13876 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
13878 case "$gethostbyaddr_r_proto" in
13879 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
13880 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
13882 case "$gethostbyaddr_r_proto" in
13883 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
13884 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
13886 case "$gethostbyaddr_r_proto" in
13887 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
13888 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
13890 case "$gethostbyaddr_r_proto" in
13891 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
13892 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
13894 case "$gethostbyaddr_r_proto" in
13895 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
13896 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
13898 case "$gethostbyaddr_r_proto" in
13899 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
13900 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
13902 case "$gethostbyaddr_r_proto" in
13903 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
13904 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
13906 case "$gethostbyaddr_r_proto" in
13907 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
13908 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
13910 case "$gethostbyaddr_r_proto" in
13911 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13912 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
13914 case "$gethostbyaddr_r_proto" in
13915 ''|0) d_gethostbyaddr_r=undef
13916 gethostbyaddr_r_proto=0
13917 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
13918 * ) case "$gethostbyaddr_r_proto" in
13919 REENTRANT_PROTO*) ;;
13920 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
13922 echo "Prototype: $try" ;;
13925 *) case "$usethreads" in
13926 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
13928 d_gethostbyaddr_r=undef
13929 gethostbyaddr_r_proto=0
13933 *) gethostbyaddr_r_proto=0
13937 : see if gethostbyname_r exists
13938 set gethostbyname_r d_gethostbyname_r
13940 case "$d_gethostbyname_r" in
13942 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13943 case "$d_gethostbyname_r_proto:$usethreads" in
13944 ":define") d_gethostbyname_r_proto=define
13945 set d_gethostbyname_r_proto gethostbyname_r $hdrs
13949 case "$d_gethostbyname_r_proto" in
13951 case "$gethostbyname_r_proto" in
13952 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
13953 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
13955 case "$gethostbyname_r_proto" in
13956 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
13957 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
13959 case "$gethostbyname_r_proto" in
13960 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
13961 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
13963 case "$gethostbyname_r_proto" in
13964 ''|0) d_gethostbyname_r=undef
13965 gethostbyname_r_proto=0
13966 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
13967 * ) case "$gethostbyname_r_proto" in
13968 REENTRANT_PROTO*) ;;
13969 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
13971 echo "Prototype: $try" ;;
13974 *) case "$usethreads" in
13975 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
13977 d_gethostbyname_r=undef
13978 gethostbyname_r_proto=0
13982 *) gethostbyname_r_proto=0
13986 : see if gethostent_r exists
13987 set gethostent_r d_gethostent_r
13989 case "$d_gethostent_r" in
13991 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13992 case "$d_gethostent_r_proto:$usethreads" in
13993 ":define") d_gethostent_r_proto=define
13994 set d_gethostent_r_proto gethostent_r $hdrs
13998 case "$d_gethostent_r_proto" in
14000 case "$gethostent_r_proto" in
14001 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
14002 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
14004 case "$gethostent_r_proto" in
14005 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
14006 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBIE ;;
14008 case "$gethostent_r_proto" in
14009 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
14010 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBIE ;;
14012 case "$gethostent_r_proto" in
14013 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
14014 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBI ;;
14016 case "$gethostent_r_proto" in
14017 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
14018 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBI ;;
14020 case "$gethostent_r_proto" in
14021 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
14022 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SD ;;
14024 case "$gethostent_r_proto" in
14025 ''|0) d_gethostent_r=undef
14026 gethostent_r_proto=0
14027 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
14028 * ) case "$gethostent_r_proto" in
14029 REENTRANT_PROTO*) ;;
14030 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
14032 echo "Prototype: $try" ;;
14035 *) case "$usethreads" in
14036 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
14038 d_gethostent_r=undef
14039 gethostent_r_proto=0
14043 *) gethostent_r_proto=0
14047 : see if prototypes for various gethostxxx netdb.h functions are available
14049 set d_gethostprotos gethostent $i_netdb netdb.h
14052 : see if getitimer exists
14053 set getitimer d_getitimer
14056 : see if getlogin exists
14057 set getlogin d_getlogin
14060 : see if getlogin_r exists
14061 set getlogin_r d_getlogin_r
14063 case "$d_getlogin_r" in
14065 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
14066 case "$d_getlogin_r_proto:$usethreads" in
14067 ":define") d_getlogin_r_proto=define
14068 set d_getlogin_r_proto getlogin_r $hdrs
14072 case "$d_getlogin_r_proto" in
14074 case "$getlogin_r_proto" in
14075 ''|0) try='int getlogin_r(char*, size_t);'
14076 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BW ;;
14078 case "$getlogin_r_proto" in
14079 ''|0) try='int getlogin_r(char*, int);'
14080 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BI ;;
14082 case "$getlogin_r_proto" in
14083 ''|0) try='char* getlogin_r(char*, size_t);'
14084 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BW ;;
14086 case "$getlogin_r_proto" in
14087 ''|0) try='char* getlogin_r(char*, int);'
14088 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BI ;;
14090 case "$getlogin_r_proto" in
14091 ''|0) d_getlogin_r=undef
14093 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
14094 * ) case "$getlogin_r_proto" in
14095 REENTRANT_PROTO*) ;;
14096 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
14098 echo "Prototype: $try" ;;
14101 *) case "$usethreads" in
14102 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
14109 *) getlogin_r_proto=0
14113 : see if getmnt exists
14114 set getmnt d_getmnt
14117 : see if getmntent exists
14118 set getmntent d_getmntent
14121 : see if getnameinfo exists
14122 set getnameinfo d_getnameinfo
14125 : see if getnetbyaddr exists
14126 set getnetbyaddr d_getnbyaddr
14129 : see if getnetbyname exists
14130 set getnetbyname d_getnbyname
14133 : see if getnetent exists
14134 set getnetent d_getnent
14137 : see if getnetbyaddr_r exists
14138 set getnetbyaddr_r d_getnetbyaddr_r
14140 case "$d_getnetbyaddr_r" in
14142 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14143 case "$d_getnetbyaddr_r_proto:$usethreads" in
14144 ":define") d_getnetbyaddr_r_proto=define
14145 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
14149 case "$d_getnetbyaddr_r_proto" in
14151 case "$getnetbyaddr_r_proto" in
14152 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
14153 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
14155 case "$getnetbyaddr_r_proto" in
14156 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
14157 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
14159 case "$getnetbyaddr_r_proto" in
14160 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
14161 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
14163 case "$getnetbyaddr_r_proto" in
14164 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
14165 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
14167 case "$getnetbyaddr_r_proto" in
14168 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
14169 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
14171 case "$getnetbyaddr_r_proto" in
14172 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
14173 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
14175 case "$getnetbyaddr_r_proto" in
14176 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
14177 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
14179 case "$getnetbyaddr_r_proto" in
14180 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
14181 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
14183 case "$getnetbyaddr_r_proto" in
14184 ''|0) d_getnetbyaddr_r=undef
14185 getnetbyaddr_r_proto=0
14186 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
14187 * ) case "$getnetbyaddr_r_proto" in
14188 REENTRANT_PROTO*) ;;
14189 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
14191 echo "Prototype: $try" ;;
14194 *) case "$usethreads" in
14195 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
14197 d_getnetbyaddr_r=undef
14198 getnetbyaddr_r_proto=0
14202 *) getnetbyaddr_r_proto=0
14206 : see if getnetbyname_r exists
14207 set getnetbyname_r d_getnetbyname_r
14209 case "$d_getnetbyname_r" in
14211 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14212 case "$d_getnetbyname_r_proto:$usethreads" in
14213 ":define") d_getnetbyname_r_proto=define
14214 set d_getnetbyname_r_proto getnetbyname_r $hdrs
14218 case "$d_getnetbyname_r_proto" in
14220 case "$getnetbyname_r_proto" in
14221 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
14222 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
14224 case "$getnetbyname_r_proto" in
14225 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
14226 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
14228 case "$getnetbyname_r_proto" in
14229 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
14230 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
14232 case "$getnetbyname_r_proto" in
14233 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
14234 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
14236 case "$getnetbyname_r_proto" in
14237 ''|0) d_getnetbyname_r=undef
14238 getnetbyname_r_proto=0
14239 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
14240 * ) case "$getnetbyname_r_proto" in
14241 REENTRANT_PROTO*) ;;
14242 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
14244 echo "Prototype: $try" ;;
14247 *) case "$usethreads" in
14248 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
14250 d_getnetbyname_r=undef
14251 getnetbyname_r_proto=0
14255 *) getnetbyname_r_proto=0
14259 : see if getnetent_r exists
14260 set getnetent_r d_getnetent_r
14262 case "$d_getnetent_r" in
14264 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14265 case "$d_getnetent_r_proto:$usethreads" in
14266 ":define") d_getnetent_r_proto=define
14267 set d_getnetent_r_proto getnetent_r $hdrs
14271 case "$d_getnetent_r_proto" in
14273 case "$getnetent_r_proto" in
14274 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
14275 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
14277 case "$getnetent_r_proto" in
14278 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
14279 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBIE ;;
14281 case "$getnetent_r_proto" in
14282 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
14283 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBIE ;;
14285 case "$getnetent_r_proto" in
14286 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
14287 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBI ;;
14289 case "$getnetent_r_proto" in
14290 ''|0) try='int getnetent_r(struct netent*, char*, int);'
14291 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBI ;;
14293 case "$getnetent_r_proto" in
14294 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
14295 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SD ;;
14297 case "$getnetent_r_proto" in
14298 ''|0) d_getnetent_r=undef
14299 getnetent_r_proto=0
14300 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
14301 * ) case "$getnetent_r_proto" in
14302 REENTRANT_PROTO*) ;;
14303 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
14305 echo "Prototype: $try" ;;
14308 *) case "$usethreads" in
14309 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
14311 d_getnetent_r=undef
14312 getnetent_r_proto=0
14316 *) getnetent_r_proto=0
14320 : see if prototypes for various getnetxxx netdb.h functions are available
14322 set d_getnetprotos getnetent $i_netdb netdb.h
14325 : see if getpagesize exists
14326 set getpagesize d_getpagsz
14329 : Optional checks for getprotobyname and getprotobynumber
14331 : see if getprotobyname exists
14332 set getprotobyname d_getpbyname
14335 : see if getprotobynumber exists
14336 set getprotobynumber d_getpbynumber
14339 : see if getprotoent exists
14340 set getprotoent d_getpent
14343 : see if getpgid exists
14344 set getpgid d_getpgid
14347 : see if getpgrp2 exists
14348 set getpgrp2 d_getpgrp2
14351 : see if getppid exists
14352 set getppid d_getppid
14355 : see if getpriority exists
14356 set getpriority d_getprior
14359 : see if getprotobyname_r exists
14360 set getprotobyname_r d_getprotobyname_r
14362 case "$d_getprotobyname_r" in
14364 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14365 case "$d_getprotobyname_r_proto:$usethreads" in
14366 ":define") d_getprotobyname_r_proto=define
14367 set d_getprotobyname_r_proto getprotobyname_r $hdrs
14371 case "$d_getprotobyname_r_proto" in
14373 case "$getprotobyname_r_proto" in
14374 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
14375 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
14377 case "$getprotobyname_r_proto" in
14378 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
14379 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
14381 case "$getprotobyname_r_proto" in
14382 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
14383 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
14385 case "$getprotobyname_r_proto" in
14386 ''|0) d_getprotobyname_r=undef
14387 getprotobyname_r_proto=0
14388 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
14389 * ) case "$getprotobyname_r_proto" in
14390 REENTRANT_PROTO*) ;;
14391 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
14393 echo "Prototype: $try" ;;
14396 *) case "$usethreads" in
14397 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
14399 d_getprotobyname_r=undef
14400 getprotobyname_r_proto=0
14404 *) getprotobyname_r_proto=0
14408 : see if getprotobynumber_r exists
14409 set getprotobynumber_r d_getprotobynumber_r
14411 case "$d_getprotobynumber_r" in
14413 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14414 case "$d_getprotobynumber_r_proto:$usethreads" in
14415 ":define") d_getprotobynumber_r_proto=define
14416 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
14420 case "$d_getprotobynumber_r_proto" in
14422 case "$getprotobynumber_r_proto" in
14423 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
14424 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
14426 case "$getprotobynumber_r_proto" in
14427 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
14428 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
14430 case "$getprotobynumber_r_proto" in
14431 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
14432 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
14434 case "$getprotobynumber_r_proto" in
14435 ''|0) d_getprotobynumber_r=undef
14436 getprotobynumber_r_proto=0
14437 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
14438 * ) case "$getprotobynumber_r_proto" in
14439 REENTRANT_PROTO*) ;;
14440 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
14442 echo "Prototype: $try" ;;
14445 *) case "$usethreads" in
14446 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
14448 d_getprotobynumber_r=undef
14449 getprotobynumber_r_proto=0
14453 *) getprotobynumber_r_proto=0
14457 : see if getprotoent_r exists
14458 set getprotoent_r d_getprotoent_r
14460 case "$d_getprotoent_r" in
14462 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14463 case "$d_getprotoent_r_proto:$usethreads" in
14464 ":define") d_getprotoent_r_proto=define
14465 set d_getprotoent_r_proto getprotoent_r $hdrs
14469 case "$d_getprotoent_r_proto" in
14471 case "$getprotoent_r_proto" in
14472 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
14473 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
14475 case "$getprotoent_r_proto" in
14476 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
14477 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBI ;;
14479 case "$getprotoent_r_proto" in
14480 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
14481 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=S_SBI ;;
14483 case "$getprotoent_r_proto" in
14484 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
14485 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SD ;;
14487 case "$getprotoent_r_proto" in
14488 ''|0) d_getprotoent_r=undef
14489 getprotoent_r_proto=0
14490 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
14491 * ) case "$getprotoent_r_proto" in
14492 REENTRANT_PROTO*) ;;
14493 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
14495 echo "Prototype: $try" ;;
14498 *) case "$usethreads" in
14499 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
14501 d_getprotoent_r=undef
14502 getprotoent_r_proto=0
14506 *) getprotoent_r_proto=0
14510 : see if prototypes for various getprotoxxx netdb.h functions are available
14512 set d_getprotoprotos getprotoent $i_netdb netdb.h
14515 : see if getprpwnam exists
14516 set getprpwnam d_getprpwnam
14519 : see if getpwent exists
14520 set getpwent d_getpwent
14523 : see if getpwent_r exists
14524 set getpwent_r d_getpwent_r
14526 case "$d_getpwent_r" in
14528 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14529 case "$d_getpwent_r_proto:$usethreads" in
14530 ":define") d_getpwent_r_proto=define
14531 set d_getpwent_r_proto getpwent_r $hdrs
14535 case "$d_getpwent_r_proto" in
14537 case "$getpwent_r_proto" in
14538 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
14539 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBWR ;;
14541 case "$getpwent_r_proto" in
14542 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
14543 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIR ;;
14545 case "$getpwent_r_proto" in
14546 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
14547 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBW ;;
14549 case "$getpwent_r_proto" in
14550 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
14551 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBI ;;
14553 case "$getpwent_r_proto" in
14554 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
14555 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBI ;;
14557 case "$getpwent_r_proto" in
14558 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
14559 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIH ;;
14561 case "$getpwent_r_proto" in
14562 ''|0) d_getpwent_r=undef
14564 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
14565 * ) case "$getpwent_r_proto" in
14566 REENTRANT_PROTO*) ;;
14567 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
14569 echo "Prototype: $try" ;;
14572 *) case "$usethreads" in
14573 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
14580 *) getpwent_r_proto=0
14584 : see if getpwnam_r exists
14585 set getpwnam_r d_getpwnam_r
14587 case "$d_getpwnam_r" in
14589 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14590 case "$d_getpwnam_r_proto:$usethreads" in
14591 ":define") d_getpwnam_r_proto=define
14592 set d_getpwnam_r_proto getpwnam_r $hdrs
14596 case "$d_getpwnam_r_proto" in
14598 case "$getpwnam_r_proto" in
14599 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
14600 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
14602 case "$getpwnam_r_proto" in
14603 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
14604 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
14606 case "$getpwnam_r_proto" in
14607 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
14608 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
14610 case "$getpwnam_r_proto" in
14611 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
14612 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
14614 case "$getpwnam_r_proto" in
14615 ''|0) d_getpwnam_r=undef
14617 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
14618 * ) case "$getpwnam_r_proto" in
14619 REENTRANT_PROTO*) ;;
14620 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
14622 echo "Prototype: $try" ;;
14625 *) case "$usethreads" in
14626 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
14633 *) getpwnam_r_proto=0
14637 : see if getpwuid_r exists
14638 set getpwuid_r d_getpwuid_r
14640 case "$d_getpwuid_r" in
14642 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14643 case "$d_getpwuid_r_proto:$usethreads" in
14644 ":define") d_getpwuid_r_proto=define
14645 set d_getpwuid_r_proto getpwuid_r $hdrs
14649 case "$d_getpwuid_r_proto" in
14651 case "$getpwuid_r_proto" in
14652 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
14653 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
14655 case "$getpwuid_r_proto" in
14656 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
14657 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
14659 case "$getpwuid_r_proto" in
14660 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
14661 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
14663 case "$getpwuid_r_proto" in
14664 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
14665 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
14667 case "$getpwuid_r_proto" in
14668 ''|0) d_getpwuid_r=undef
14670 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
14671 * ) case "$getpwuid_r_proto" in
14672 REENTRANT_PROTO*) ;;
14673 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
14675 echo "Prototype: $try" ;;
14678 *) case "$usethreads" in
14679 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
14686 *) getpwuid_r_proto=0
14690 : Optional checks for getsbyname and getsbyport
14692 : see if getservbyname exists
14693 set getservbyname d_getsbyname
14696 : see if getservbyport exists
14697 set getservbyport d_getsbyport
14700 : see if getservent exists
14701 set getservent d_getsent
14704 : see if getservbyname_r exists
14705 set getservbyname_r d_getservbyname_r
14707 case "$d_getservbyname_r" in
14709 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14710 case "$d_getservbyname_r_proto:$usethreads" in
14711 ":define") d_getservbyname_r_proto=define
14712 set d_getservbyname_r_proto getservbyname_r $hdrs
14716 case "$d_getservbyname_r_proto" in
14718 case "$getservbyname_r_proto" in
14719 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
14720 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
14722 case "$getservbyname_r_proto" in
14723 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
14724 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
14726 case "$getservbyname_r_proto" in
14727 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
14728 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
14730 case "$getservbyname_r_proto" in
14731 ''|0) d_getservbyname_r=undef
14732 getservbyname_r_proto=0
14733 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
14734 * ) case "$getservbyname_r_proto" in
14735 REENTRANT_PROTO*) ;;
14736 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
14738 echo "Prototype: $try" ;;
14741 *) case "$usethreads" in
14742 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
14744 d_getservbyname_r=undef
14745 getservbyname_r_proto=0
14749 *) getservbyname_r_proto=0
14753 : see if getservbyport_r exists
14754 set getservbyport_r d_getservbyport_r
14756 case "$d_getservbyport_r" in
14758 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14759 case "$d_getservbyport_r_proto:$usethreads" in
14760 ":define") d_getservbyport_r_proto=define
14761 set d_getservbyport_r_proto getservbyport_r $hdrs
14765 case "$d_getservbyport_r_proto" in
14767 case "$getservbyport_r_proto" in
14768 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
14769 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
14771 case "$getservbyport_r_proto" in
14772 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
14773 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
14775 case "$getservbyport_r_proto" in
14776 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
14777 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
14779 case "$getservbyport_r_proto" in
14780 ''|0) d_getservbyport_r=undef
14781 getservbyport_r_proto=0
14782 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
14783 * ) case "$getservbyport_r_proto" in
14784 REENTRANT_PROTO*) ;;
14785 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
14787 echo "Prototype: $try" ;;
14790 *) case "$usethreads" in
14791 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
14793 d_getservbyport_r=undef
14794 getservbyport_r_proto=0
14798 *) getservbyport_r_proto=0
14802 : see if getservent_r exists
14803 set getservent_r d_getservent_r
14805 case "$d_getservent_r" in
14807 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14808 case "$d_getservent_r_proto:$usethreads" in
14809 ":define") d_getservent_r_proto=define
14810 set d_getservent_r_proto getservent_r $hdrs
14814 case "$d_getservent_r_proto" in
14816 case "$getservent_r_proto" in
14817 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
14818 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBWR ;;
14820 case "$getservent_r_proto" in
14821 ''|0) try='int getservent_r(struct servent*, char*, int);'
14822 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBI ;;
14824 case "$getservent_r_proto" in
14825 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
14826 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=S_SBI ;;
14828 case "$getservent_r_proto" in
14829 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
14830 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SD ;;
14832 case "$getservent_r_proto" in
14833 ''|0) d_getservent_r=undef
14834 getservent_r_proto=0
14835 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
14836 * ) case "$getservent_r_proto" in
14837 REENTRANT_PROTO*) ;;
14838 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
14840 echo "Prototype: $try" ;;
14843 *) case "$usethreads" in
14844 define) echo "getservent_r has no prototype, not using it." >&4 ;;
14846 d_getservent_r=undef
14847 getservent_r_proto=0
14851 *) getservent_r_proto=0
14855 : see if prototypes for various getservxxx netdb.h functions are available
14857 set d_getservprotos getservent $i_netdb netdb.h
14860 : see if getspnam exists
14861 set getspnam d_getspnam
14864 : see if this is a shadow.h system
14865 set shadow.h i_shadow
14868 : see if getspnam_r exists
14869 set getspnam_r d_getspnam_r
14871 case "$d_getspnam_r" in
14873 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
14874 case "$d_getspnam_r_proto:$usethreads" in
14875 ":define") d_getspnam_r_proto=define
14876 set d_getspnam_r_proto getspnam_r $hdrs
14880 case "$d_getspnam_r_proto" in
14882 case "$getspnam_r_proto" in
14883 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
14884 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
14886 case "$getspnam_r_proto" in
14887 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
14888 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=S_CSBI ;;
14890 case "$getspnam_r_proto" in
14891 ''|0) d_getspnam_r=undef
14893 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
14894 * ) case "$getspnam_r_proto" in
14895 REENTRANT_PROTO*) ;;
14896 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
14898 echo "Prototype: $try" ;;
14901 *) case "$usethreads" in
14902 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
14909 *) getspnam_r_proto=0
14913 : see if gettimeofday or ftime exists
14914 set gettimeofday d_gettimeod
14916 case "$d_gettimeod" in
14922 val="$undef"; set d_ftime; eval $setvar
14925 case "$d_gettimeod$d_ftime" in
14928 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
14932 : see if gmtime_r exists
14933 set gmtime_r d_gmtime_r
14935 case "$d_gmtime_r" in
14937 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14938 case "$d_gmtime_r_proto:$usethreads" in
14939 ":define") d_gmtime_r_proto=define
14940 set d_gmtime_r_proto gmtime_r $hdrs
14944 case "$d_gmtime_r_proto" in
14946 case "$gmtime_r_proto" in
14947 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
14948 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=S_TS ;;
14950 case "$gmtime_r_proto" in
14951 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
14952 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=I_TS ;;
14954 case "$gmtime_r_proto" in
14955 ''|0) d_gmtime_r=undef
14957 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
14958 * ) case "$gmtime_r_proto" in
14959 REENTRANT_PROTO*) ;;
14960 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
14962 echo "Prototype: $try" ;;
14965 *) case "$usethreads" in
14966 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
14973 *) gmtime_r_proto=0
14977 : see if hasmntopt exists
14978 set hasmntopt d_hasmntopt
14981 : see if this is a netinet/in.h or sys/in.h system
14982 set netinet/in.h i_niin sys/in.h i_sysin
14985 : see if arpa/inet.h has to be included
14986 set arpa/inet.h i_arpainet
14989 : see if htonl --and friends-- exists
14994 : Maybe they are macros.
14997 $cat >htonl.c <<EOM
14999 #include <sys/types.h>
15000 #$i_niin I_NETINET_IN
15002 #$i_arpainet I_ARPA_INET
15003 #ifdef I_NETINET_IN
15004 #include <netinet/in.h>
15007 #include <sys/in.h>
15010 #include <arpa/inet.h>
15013 printf("Defined as a macro.");
15016 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
15017 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
15019 echo "But it seems to be defined as a macro." >&4
15027 : see if ilogbl exists
15028 set ilogbl d_ilogbl
15033 if set index val -f; eval $csym; $val; then
15034 if set strchr val -f d_strchr; eval $csym; $val; then
15035 if $contains strchr "$strings" >/dev/null 2>&1 ; then
15038 echo "strchr() found." >&4
15042 echo "index() found." >&4
15047 echo "index() found." >&4
15050 if set strchr val -f d_strchr; eval $csym; $val; then
15053 echo "strchr() found." >&4
15055 echo "No index() or strchr() found!" >&4
15060 set d_strchr; eval $setvar
15062 set d_index; eval $setvar
15064 : check whether inet_aton exists
15065 set inet_aton d_inetaton
15068 : see if inet_ntop exists
15069 set inet_ntop d_inetntop
15072 : see if inet_pton exists
15073 set inet_pton d_inetpton
15078 $cat >isascii.c <<EOCP
15081 #$i_stdlib I_STDLIB
15083 #include <stdlib.h>
15094 if eval $compile; then
15095 echo "isascii() found." >&4
15098 echo "isascii() NOT found." >&4
15107 $cat >isblank.c <<'EOCP'
15118 if $cc $ccflags $ldflags -o isblank isblank.c $libs >/dev/null 2>&1 ; then
15119 echo "isblank() found." >&4
15122 echo "isblank() NOT found." >&4
15129 : see if isfinite exists
15130 set isfinite d_isfinite
15133 : see if isinf exists
15137 : see if isnan exists
15141 : see if isnanl exists
15142 set isnanl d_isnanl
15145 : see if killpg exists
15146 set killpg d_killpg
15149 : see if lchown exists
15151 $cat > try.c <<'EOCP'
15152 /* System header to define __stub macros and hopefully few prototypes,
15153 which can conflict with char lchown(); below. */
15154 #include <assert.h>
15155 /* Override any gcc2 internal prototype to avoid an error. */
15156 /* We use char because int might match the return type of a gcc2
15157 builtin and then its argument prototype would still apply. */
15160 /* The GNU C library defines this for functions which it implements
15161 to always fail with ENOSYS. Some functions are actually named
15162 something starting with __ and the normal name is an alias. */
15163 #if defined (__stub_lchown) || defined (__stub___lchown)
15171 if eval $compile; then
15172 $echo "lchown() found." >&4
15175 $echo "lchown() NOT found." >&4
15181 : See if number of significant digits in a double precision number is known
15183 $cat >ldbl_dig.c <<EOM
15184 #$i_limits I_LIMITS
15187 #include <limits.h>
15193 printf("Contains LDBL_DIG");
15196 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
15197 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
15198 echo "LDBL_DIG found." >&4
15201 echo "LDBL_DIG NOT found." >&4
15208 : see if this is a math.h system
15212 : check to see if math.h defines _LIB_VERSION
15213 d_libm_lib_version="$undef"
15217 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
15219 #include <unistd.h>
15221 int main (int argc, char *argv[])
15223 printf ("%d\n", _LIB_VERSION);
15228 if eval $compile; then
15230 echo "Yes, it does ($foo)" >&4
15231 d_libm_lib_version="$define"
15233 echo "No, it does not (probably harmless)" >&4
15240 : see if link exists
15244 : see if localtime_r exists
15245 set localtime_r d_localtime_r
15247 case "$d_localtime_r" in
15249 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
15250 case "$d_localtime_r_proto:$usethreads" in
15251 ":define") d_localtime_r_proto=define
15252 set d_localtime_r_proto localtime_r $hdrs
15256 case "$d_localtime_r_proto" in
15258 case "$localtime_r_proto" in
15259 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
15260 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=S_TS ;;
15262 case "$localtime_r_proto" in
15263 ''|0) try='int localtime_r(const time_t*, struct tm*);'
15264 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=I_TS ;;
15266 case "$localtime_r_proto" in
15267 ''|0) d_localtime_r=undef
15268 localtime_r_proto=0
15269 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
15270 * ) case "$localtime_r_proto" in
15271 REENTRANT_PROTO*) ;;
15272 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
15274 echo "Prototype: $try" ;;
15277 *) case "$usethreads" in
15278 define) echo "localtime_r has no prototype, not using it." >&4 ;;
15280 d_localtime_r=undef
15281 localtime_r_proto=0
15285 *) localtime_r_proto=0
15289 : see if localtime_r calls tzset
15290 case "$localtime_r_proto" in
15293 /* Does our libc's localtime_r call tzset ?
15294 * return 0 if so, 1 otherwise.
15296 #$i_systypes I_SYS_TYPES
15297 #$i_unistd I_UNISTD
15299 #$i_stdlib I_STDLIB
15300 #$i_string I_STRING
15301 #$i_malloc I_MALLOC
15303 # include <sys/types.h>
15306 # include <unistd.h>
15312 #include <stdlib.h>
15315 # include <string.h>
15317 # include <strings.h>
15320 # include <malloc.h>
15324 time_t t = time(0L);
15325 char w_tz[]="TZ" "=GMT+5",
15326 e_tz[]="TZ" "=GMT-5",
15327 *tz_e = (char*)malloc(16),
15328 *tz_w = (char*)malloc(16);
15329 struct tm tm_e, tm_w;
15330 memset(&tm_e,'\0',sizeof(struct tm));
15331 memset(&tm_w,'\0',sizeof(struct tm));
15336 localtime_r(&t, &tm_e);
15339 localtime_r(&t, &tm_w);
15341 if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 )
15347 if eval $compile; then
15348 if $run ./try; then
15349 d_localtime_r_needs_tzset=undef;
15351 d_localtime_r_needs_tzset=define;
15354 d_localtime_r_needs_tzset=undef;
15358 d_localtime_r_needs_tzset=undef;
15363 : see if localeconv exists
15364 set localeconv d_locconv
15367 : see if lockf exists
15371 : see if prototype for lseek is available
15373 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
15376 : see if lstat exists
15380 : see if madvise exists
15381 set madvise d_madvise
15384 : see if malloc_size exists
15385 set malloc_size d_malloc_size
15388 : see if malloc_size_good exists
15389 set malloc_good_size d_malloc_good_size
15392 : see if mblen exists
15396 : see if mbstowcs exists
15397 set mbstowcs d_mbstowcs
15400 : see if mbtowc exists
15401 set mbtowc d_mbtowc
15404 : see if memchr exists
15405 set memchr d_memchr
15408 : see if memcmp exists
15409 set memcmp d_memcmp
15412 : see if memcpy exists
15413 set memcpy d_memcpy
15416 : see if memmove exists
15417 set memmove d_memmove
15420 : see if memset exists
15421 set memset d_memset
15424 : see if mkdir exists
15428 : see if mkdtemp exists
15429 set mkdtemp d_mkdtemp
15432 : see if mkfifo exists
15433 set mkfifo d_mkfifo
15436 : see if mkstemp exists
15437 set mkstemp d_mkstemp
15440 : see if mkstemps exists
15441 set mkstemps d_mkstemps
15444 : see if mktime exists
15445 set mktime d_mktime
15448 : see if this is a sys/mman.h system
15449 set sys/mman.h i_sysmman
15452 : see if mmap exists
15455 : see what shmat returns
15456 : default to something harmless
15458 case "$i_sysmman$d_mmap" in
15460 $cat >mmap.c <<'END'
15461 #include <sys/mman.h>
15464 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
15469 echo "and it returns ($mmaptype)." >&4
15475 : see if sqrtl exists
15479 : see if scalbnl exists
15480 set scalbnl d_scalbnl
15483 : see if modfl exists
15487 : see if prototype for modfl is available
15489 set d_modflproto modfl $i_math math.h
15492 d_modfl_pow32_bug="$undef"
15494 case "$d_longdbl$d_modfl" in
15497 Checking to see whether your modfl() is okay for large values...
15503 if $test "X$d_modflproto" != "X$define"; then
15504 $cat >>try.c <<EOCP
15505 /* Sigh. many current glibcs provide the function, but do not prototype it. */
15506 long double modfl (long double, long double *);
15509 $cat >>try.c <<EOCP
15511 long double nv = 4294967303.15;
15517 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
15521 case "$osname:$gccversion" in
15522 aix:) saveccflags="$ccflags"
15523 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
15526 if eval $compile; then
15529 *" 4294967303.150000 1.150000 4294967302.000000")
15530 echo >&4 "Your modfl() is broken for large values."
15531 d_modfl_pow32_bug="$define"
15533 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
15537 *" 4294967303.150000 0.150000 4294967303.000000")
15538 echo >&4 "Your modfl() seems okay for large values."
15540 *) echo >&4 "I don't understand your modfl() at all."
15546 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
15549 case "$osname:$gccversion" in
15550 aix:) ccflags="$saveccflags" ;; # restore
15555 if $test "$uselongdouble" = "$define"; then
15557 if $test "$d_sqrtl" != "$define"; then
15558 message="$message sqrtl"
15560 if $test "$d_modfl" != "$define"; then
15561 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
15562 echo "You have both aintl and copysignl, so I can emulate modfl."
15564 message="$message modfl"
15567 if $test "$d_frexpl" != "$define"; then
15568 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
15569 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
15571 message="$message frexpl"
15575 if $test "$message" != ""; then
15578 *** You requested the use of long doubles but you do not seem to have
15579 *** the following mathematical functions needed for long double support:
15581 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
15582 *** Cannot continue, aborting.
15590 : see if mprotect exists
15591 set mprotect d_mprotect
15594 : see if msgctl exists
15595 set msgctl d_msgctl
15598 : see if msgget exists
15599 set msgget d_msgget
15602 : see if msgsnd exists
15603 set msgsnd d_msgsnd
15606 : see if msgrcv exists
15607 set msgrcv d_msgrcv
15610 : see how much of the 'msg*(2)' library is present.
15613 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
15614 *"$undef"*) h_msg=false;;
15618 case "`ipcs 2>&1`" in
15619 "SVID messages"*"not configured"*)
15620 echo "Your $osname does not have the msg*(2) configured." >&4
15623 set msgctl d_msgctl
15625 set msgget d_msgget
15627 set msgsnd d_msgsnd
15629 set msgrcv d_msgrcv
15635 : we could also check for sys/ipc.h ...
15636 if $h_msg && $test `./findhdr sys/msg.h`; then
15637 echo "You have the full msg*(2) library." >&4
15640 echo "You don't have the full msg*(2) library." >&4
15646 : Check for msghdr_s
15648 echo "Checking to see if your system supports struct msghdr..." >&4
15649 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
15651 case "$d_msghdr_s" in
15652 "$define") echo "Yes, it does." ;;
15653 *) echo "No, it doesn't." ;;
15657 : see if msync exists
15661 : see if munmap exists
15662 set munmap d_munmap
15665 : see if nice exists
15669 : see if this is a langinfo.h system
15670 set langinfo.h i_langinfo
15673 : see if nl_langinfo exists
15674 set nl_langinfo d_nl_langinfo
15677 : check for volatile keyword
15679 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
15680 $cat >try.c <<'EOCP'
15683 typedef struct _goo_struct goo_struct;
15684 goo_struct * volatile goo = ((goo_struct *)0);
15685 struct _goo_struct {
15690 typedef unsigned short foo_t;
15691 char *volatile foo;
15693 volatile foo_t blech;
15697 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
15699 echo "Yup, it does."
15702 echo "Nope, it doesn't."
15708 : Check basic sizes
15710 $echo "Choosing the C types to be used for Perl's internal types..." >&4
15712 case "$use64bitint:$d_quad:$quadtype" in
15715 uvtype="$uquadtype"
15720 uvtype="unsigned long"
15726 case "$uselongdouble:$d_longdbl" in
15728 nvtype="long double"
15729 nvsize=$longdblsize
15736 $echo "(IV will be "$ivtype", $ivsize bytes)"
15737 $echo "(UV will be "$uvtype", $uvsize bytes)"
15738 $echo "(NV will be "$nvtype", $nvsize bytes)"
15741 #$i_inttypes I_INTTYPES
15743 #include <inttypes.h>
15748 int8_t i = INT8_MAX;
15749 uint8_t u = UINT8_MAX;
15750 printf("int8_t\n");
15753 int16_t i = INT16_MAX;
15754 uint16_t i = UINT16_MAX;
15755 printf("int16_t\n");
15758 int32_t i = INT32_MAX;
15759 uint32_t u = UINT32_MAX;
15760 printf("int32_t\n");
15765 i8type="signed char"
15766 u8type="unsigned char"
15771 '') case "$shortsize" in
15773 u16type="unsigned short"
15781 '') set try -DINT16
15782 if eval $compile; then
15783 case "`$run ./try`" in
15795 '') if $test $shortsize -ge 2; then
15797 u16type="unsigned short"
15805 '') case "$longsize" in
15807 u32type="unsigned long"
15811 *) case "$intsize" in
15813 u32type="unsigned int"
15823 '') set try -DINT32
15824 if eval $compile; then
15825 case "`$run ./try`" in
15837 '') if $test $intsize -ge 4; then
15839 u32type="unsigned int"
15847 '') case "$d_quad:$quadtype" in
15849 i64type="$quadtype"
15850 u64type="$uquadtype"
15858 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
15859 : volatile so that the compiler has to store it out to memory.
15860 if test X"$d_volatile" = X"$define"; then
15865 #$i_stdlib I_STDLIB
15867 #include <stdlib.h>
15869 #include <sys/types.h>
15870 #include <signal.h>
15872 $volatile int bletched = 0;
15873 $signal_t blech(int s) { bletched = 1; }
15878 int n = 8 * $uvsize;
15881 signal(SIGFPE, blech);
15884 for (i = 0; i < n; i++) {
15885 u = u << 1 | ($uvtype)1;
15887 if (($uvtype)d != u)
15891 d = ($nvtype)(u - 1);
15892 if (($uvtype)d != (u - 1))
15899 printf("%d\n", ((i == n) ? -n : i));
15905 d_nv_preserves_uv="$undef"
15906 if eval $compile; then
15907 nv_preserves_uv_bits="`$run ./try`"
15909 case "$nv_preserves_uv_bits" in
15911 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
15912 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
15913 d_nv_preserves_uv="$define"
15915 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
15916 d_nv_preserves_uv="$undef" ;;
15917 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
15918 nv_preserves_uv_bits="0" ;;
15922 $echo "Checking to find the largest integer value your NVs can hold..." >&4
15923 : volatile so that the compiler has to store it out to memory.
15924 if test X"$d_volatile" = X"$define"; then
15930 typedef $nvtype NV;
15937 while(count < 256) {
15938 $volatile NV up = value + 1.0;
15939 $volatile NV negated = -value;
15940 $volatile NV down = negated - 1.0;
15941 $volatile NV got_up = up - value;
15942 int up_good = got_up == 1.0;
15943 int got_down = down - negated;
15944 int down_good = got_down == -1.0;
15946 if (down_good != up_good) {
15948 "Inconsistency - up %d %f; down %d %f; for 2**%d (%.20f)\n",
15949 up_good, (double) got_up, down_good, (double) got_down,
15950 count, (double) value);
15957 fputs("256.0", stdout);
15960 fputs("2.0", stdout);
15966 fputs("*", stdout);
15972 fprintf(stderr, "Cannot overflow integer range, even at 2**%d (%.20f)\n",
15973 count, (double) value);
15979 nv_overflows_integers_at='0'
15980 if eval $compile; then
15986 The largest integer your NVs can preserve is equal to $xxx
15988 nv_overflows_integers_at="$xxx"
15991 Cannot determine the largest integer value your NVs can hold, unexpected output
15998 Cannot determine the largest integer value your NVs can hold
16005 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
16006 : volatile so that the compiler has to store it out to memory.
16007 if test X"$d_volatile" = X"$define"; then
16012 #$i_stdlib I_STDLIB
16014 #include <stdlib.h>
16016 #$i_string I_STRING
16018 # include <string.h>
16020 # include <strings.h>
16022 #include <sys/types.h>
16023 #include <signal.h>
16025 $volatile int bletched = 0;
16026 $signal_t blech(int s) { bletched = 1; }
16029 int checkit($nvtype d, char *where) {
16030 unsigned char *p = (char *)&d;
16031 unsigned char *end = p + sizeof(d);
16041 printf("No - %s: 0x", where);
16043 printf ("%02X", *p++);
16048 int main(int argc, char **argv) {
16051 fail += checkit(d, "0.0");
16053 /* The compiler shouldn't be assuming that bletched is 0 */
16056 fail += checkit(d, "bleched");
16059 signal(SIGFPE, blech);
16062 /* Paranoia - the compiler should have no way of knowing that ANSI says
16063 that argv[argc] will always be NULL. Actually, if it did assume this it
16064 would be buggy, as this is C and main() can be called from elsewhere in
16066 d = argv[argc] ? 1 : 0;
16069 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
16072 fail += checkit(d, "ternary");
16074 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
16077 printf("No - memset doesn't give 0.0\n");
16078 /* This might just blow up: */
16079 printf("(gives %g)\n", d);
16085 printf("No - something bleched\n");
16090 printf("No - %d fail(s)\n", fail);
16099 d_nv_zero_is_allbits_zero="$undef"
16100 if eval $compile; then
16106 0.0 is represented as all bits zero in memory
16108 d_nv_zero_is_allbits_zero="$define"
16111 0.0 is not represented as all bits zero in memory
16113 d_nv_zero_is_allbits_zero="$undef"
16118 0.0 is not represented as all bits zero in memory
16120 d_nv_zero_is_allbits_zero="$undef"
16126 : check for off64_t
16128 echo "Checking to see if you have off64_t..." >&4
16130 #include <sys/types.h>
16131 #include <unistd.h>
16132 int main() { off64_t x = 7; }
16135 if eval $compile; then
16137 echo "You have off64_t."
16140 echo "You do not have off64_t."
16141 case "$lseeksize" in
16142 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
16149 : how to create joinable pthreads
16150 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
16152 echo "Checking what constant to use for creating joinable pthreads..." >&4
16153 $cat >try.c <<'EOCP'
16154 #include <pthread.h>
16156 int detachstate = JOINABLE;
16159 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
16160 if eval $compile; then
16161 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
16162 val="$undef" # Yes, undef.
16163 set d_old_pthread_create_joinable
16166 set old_pthread_create_joinable
16169 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
16170 if eval $compile; then
16171 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
16173 set d_old_pthread_create_joinable
16175 val=PTHREAD_CREATE_UNDETACHED
16176 set old_pthread_create_joinable
16179 set try -DJOINABLE=__UNDETACHED
16180 if eval $compile; then
16181 echo "You seem to use __UNDETACHED." >&4
16183 set d_old_pthread_create_joinable
16186 set old_pthread_create_joinable
16189 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
16191 set d_old_pthread_create_joinable
16194 set old_pthread_create_joinable
16201 d_old_pthread_create_joinable="$undef"
16202 old_pthread_create_joinable=""
16205 : see if pause exists
16209 : see if poll exists
16213 : see if prctl exists
16217 : see if prctl supports PR_SET_NAME
16218 d_prctl_set_name=$undef
16222 #include <sys/prctl.h>
16224 int main (int argc, char *argv[])
16226 return (prctl (PR_SET_NAME, "Test"));
16230 if eval $compile_ok && $run ./try; then
16231 echo "Your prctl (PR_SET_NAME, ...) works"
16232 d_prctl_set_name=$define
16238 : see if readlink exists
16239 set readlink d_readlink
16242 : Check if exe is symlink to abs path of executing program
16246 case "$d_readlink" in
16248 : NetBSD first as /proc/self is a symlink to /proc/curproc, and it feels
16249 : more tidy to avoid an extra level of symlink
16250 set NetBSD /proc/curproc/exe Linux /proc/self/exe FreeBSD /proc/curproc/file Solaris /proc/self/path/a.out
16251 while test $# -gt 0; do
16254 if $issymlink $try; then
16255 $ls -l $try > reflect
16256 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
16257 echo "You have $type-like $try."
16258 procselfexe='"'$try'"'
16260 : This will break out of the loop
16271 : backward compatibility for d_hvfork
16272 if test X$d_hvfork != X; then
16273 d_vfork="$d_hvfork"
16276 : see if there is a vfork
16281 d_pseudofork=$undef
16283 : Ok, but do we want to use it. vfork is reportedly unreliable in
16284 : perl on Solaris 2.x, and probably elsewhere.
16288 case "$usevfork" in
16294 Perl can only use a vfork() that doesn't suffer from strict
16295 restrictions on calling functions or modifying global data in
16296 the child. For example, glibc-2.1 contains such a vfork()
16297 that is unsuitable. If your system provides a proper fork()
16298 call, chances are that you do NOT want perl to use vfork().
16301 rp="Do you still want to use vfork()?"
16306 echo "Ok, we won't use vfork()."
16315 $define) usevfork='true';;
16316 *) usevfork='false';;
16319 : see whether the pthread_atfork exists
16321 #include <pthread.h>
16324 #ifdef PTHREAD_ATFORK
16325 pthread_atfork(NULL,NULL,NULL);
16330 : see if pthread_atfork exists
16331 set try -DPTHREAD_ATFORK
16332 if eval $compile; then
16337 case "$usethreads" in
16340 $define) echo 'pthread_atfork found.' >&4 ;;
16341 *) echo 'pthread_atfork NOT found.' >&4 ;;
16344 set d_pthread_atfork
16347 : see if pthread_attr_setscope exists
16348 set pthread_attr_setscope d_pthread_attr_setscope
16351 : see whether the various POSIXish _yields exist
16353 #include <pthread.h>
16359 #ifdef PTHREAD_YIELD
16362 #ifdef PTHREAD_YIELD_NULL
16363 pthread_yield(NULL);
16369 : see if sched_yield exists
16370 set try -DSCHED_YIELD
16371 if eval $compile; then
16373 sched_yield='sched_yield()'
16377 case "$usethreads" in
16380 $define) echo 'sched_yield() found.' >&4 ;;
16381 *) echo 'sched_yield() NOT found.' >&4 ;;
16387 : see if pthread_yield exists
16388 set try -DPTHREAD_YIELD
16389 if eval $compile; then
16391 case "$sched_yield" in
16392 '') sched_yield='pthread_yield()' ;;
16395 set try -DPTHREAD_YIELD_NULL
16396 if eval $compile; then
16398 case "$sched_yield" in
16399 '') sched_yield='pthread_yield(NULL)' ;;
16405 case "$usethreads" in
16408 $define) echo 'pthread_yield() found.' >&4 ;;
16409 *) echo 'pthread_yield() NOT found.' >&4 ;;
16413 set d_pthread_yield
16415 case "$sched_yield" in
16416 '') sched_yield=undef ;;
16420 : see if random_r exists
16421 set random_r d_random_r
16423 case "$d_random_r" in
16425 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
16426 case "$d_random_r_proto:$usethreads" in
16427 ":define") d_random_r_proto=define
16428 set d_random_r_proto random_r $hdrs
16432 case "$d_random_r_proto" in
16434 case "$random_r_proto" in
16435 ''|0) try='int random_r(int*, struct random_data*);'
16436 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_iS ;;
16438 case "$random_r_proto" in
16439 ''|0) try='int random_r(long*, struct random_data*);'
16440 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_lS ;;
16442 case "$random_r_proto" in
16443 ''|0) try='int random_r(struct random_data*, int32_t*);'
16444 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_St ;;
16446 case "$random_r_proto" in
16447 ''|0) d_random_r=undef
16449 echo "Disabling random_r, cannot determine prototype." >&4 ;;
16450 * ) case "$random_r_proto" in
16451 REENTRANT_PROTO*) ;;
16452 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
16454 echo "Prototype: $try" ;;
16457 *) case "$usethreads" in
16458 define) echo "random_r has no prototype, not using it." >&4 ;;
16465 *) random_r_proto=0
16469 : see if readdir and friends exist
16470 set readdir d_readdir
16472 set seekdir d_seekdir
16474 set telldir d_telldir
16476 set rewinddir d_rewinddir
16479 : see if readdir64_r exists
16480 set readdir64_r d_readdir64_r
16482 case "$d_readdir64_r" in
16484 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
16485 case "$d_readdir64_r_proto:$usethreads" in
16486 ":define") d_readdir64_r_proto=define
16487 set d_readdir64_r_proto readdir64_r $hdrs
16491 case "$d_readdir64_r_proto" in
16493 case "$readdir64_r_proto" in
16494 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
16495 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TSR ;;
16497 case "$readdir64_r_proto" in
16498 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
16499 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TS ;;
16501 case "$readdir64_r_proto" in
16502 ''|0) d_readdir64_r=undef
16503 readdir64_r_proto=0
16504 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
16505 * ) case "$readdir64_r_proto" in
16506 REENTRANT_PROTO*) ;;
16507 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
16509 echo "Prototype: $try" ;;
16512 *) case "$usethreads" in
16513 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
16515 d_readdir64_r=undef
16516 readdir64_r_proto=0
16520 *) readdir64_r_proto=0
16524 : see if readdir_r exists
16525 set readdir_r d_readdir_r
16527 case "$d_readdir_r" in
16529 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
16530 case "$d_readdir_r_proto:$usethreads" in
16531 ":define") d_readdir_r_proto=define
16532 set d_readdir_r_proto readdir_r $hdrs
16536 case "$d_readdir_r_proto" in
16538 case "$readdir_r_proto" in
16539 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
16540 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TSR ;;
16542 case "$readdir_r_proto" in
16543 ''|0) try='int readdir_r(DIR*, struct dirent*);'
16544 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TS ;;
16546 case "$readdir_r_proto" in
16547 ''|0) d_readdir_r=undef
16549 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
16550 * ) case "$readdir_r_proto" in
16551 REENTRANT_PROTO*) ;;
16552 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
16554 echo "Prototype: $try" ;;
16557 *) case "$usethreads" in
16558 define) echo "readdir_r has no prototype, not using it." >&4 ;;
16565 *) readdir_r_proto=0
16569 : see if readv exists
16573 : see if recvmsg exists
16574 set recvmsg d_recvmsg
16577 : see if rename exists
16578 set rename d_rename
16581 : see if rmdir exists
16585 : see if memory.h is available.
16590 : See if it conflicts with string.h
16596 $cppstdin $cppflags $cppminus < $strings > mem.h
16597 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
16599 echo "We won't be including <memory.h>."
16609 : can bcopy handle overlapping blocks?
16612 case "$d_memmove" in
16613 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
16614 *) case "$d_bcopy" in
16616 echo "Checking to see if bcopy() can do overlapping copies..." >&4
16618 #$i_memory I_MEMORY
16619 #$i_stdlib I_STDLIB
16620 #$i_string I_STRING
16621 #$i_unistd I_UNISTD
16623 $cat >>try.c <<'EOCP'
16626 # include <memory.h>
16629 # include <stdlib.h>
16632 # include <string.h>
16634 # include <strings.h>
16637 # include <unistd.h> /* Needed for NetBSD */
16641 char buf[128], abc[128];
16647 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16648 try to store the string in read-only memory. */
16649 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
16651 for (align = 7; align >= 0; align--) {
16652 for (len = 36; len; len--) {
16654 bcopy(abc, b, len);
16655 for (off = 1; off <= len; off++) {
16656 bcopy(b, b+off, len);
16657 bcopy(b+off, b, len);
16658 if (bcmp(b, abc, len))
16667 if eval $compile_ok; then
16668 if $run ./try 2>/dev/null; then
16669 echo "Yes, it can."
16672 echo "It can't, sorry."
16675 echo "(I can't compile the test program, so we'll assume not...)"
16685 : can memcpy handle overlapping blocks?
16688 case "$d_memmove" in
16689 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
16690 *) case "$d_memcpy" in
16692 echo "Checking to see if memcpy() can do overlapping copies..." >&4
16694 #$i_memory I_MEMORY
16695 #$i_stdlib I_STDLIB
16696 #$i_string I_STRING
16697 #$i_unistd I_UNISTD
16699 $cat >>try.c <<'EOCP'
16702 # include <memory.h>
16705 # include <stdlib.h>
16708 # include <string.h>
16710 # include <strings.h>
16713 # include <unistd.h> /* Needed for NetBSD */
16717 char buf[128], abc[128];
16723 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16724 try to store the string in read-only memory. */
16725 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
16727 for (align = 7; align >= 0; align--) {
16728 for (len = 36; len; len--) {
16730 memcpy(b, abc, len);
16731 for (off = 1; off <= len; off++) {
16732 memcpy(b+off, b, len);
16733 memcpy(b, b+off, len);
16734 if (memcmp(b, abc, len))
16743 if eval $compile_ok; then
16744 if $run ./try 2>/dev/null; then
16745 echo "Yes, it can."
16748 echo "It can't, sorry."
16751 echo "(I can't compile the test program, so we'll assume not...)"
16761 : can memcmp be trusted to compare relative magnitude?
16763 case "$d_memcmp" in
16766 echo "Checking if your memcmp() can compare relative magnitude..." >&4
16768 #$i_memory I_MEMORY
16769 #$i_stdlib I_STDLIB
16770 #$i_string I_STRING
16771 #$i_unistd I_UNISTD
16773 $cat >>try.c <<'EOCP'
16776 # include <memory.h>
16779 # include <stdlib.h>
16782 # include <string.h>
16784 # include <strings.h>
16787 # include <unistd.h> /* Needed for NetBSD */
16793 if ((a < b) && memcmp(&a, &b, 1) < 0)
16799 if eval $compile_ok; then
16800 if $run ./try 2>/dev/null; then
16801 echo "Yes, it can."
16804 echo "No, it can't (it uses signed chars)."
16807 echo "(I can't compile the test program, so we'll assume not...)"
16815 : see if prototype for sbrk is available
16817 set d_sbrkproto sbrk $i_unistd unistd.h
16820 : see if select exists
16821 set select d_select
16824 : see if semctl exists
16825 set semctl d_semctl
16828 : see if semget exists
16829 set semget d_semget
16832 : see if semop exists
16836 : see how much of the 'sem*(2)' library is present.
16839 case "$d_semctl$d_semget$d_semop" in
16840 *"$undef"*) h_sem=false;;
16844 case "`ipcs 2>&1`" in
16845 "SVID messages"*"not configured"*)
16846 echo "Your $osname does not have the sem*(2) configured." >&4
16849 set semctl d_semctl
16851 set semget d_semget
16859 : we could also check for sys/ipc.h ...
16860 if $h_sem && $test `./findhdr sys/sem.h`; then
16861 echo "You have the full sem*(2) library." >&4
16864 echo "You don't have the full sem*(2) library." >&4
16870 : see whether sys/sem.h defines union semun
16872 $cat > try.c <<'END'
16873 #include <sys/types.h>
16874 #include <sys/ipc.h>
16875 #include <sys/sem.h>
16876 int main () { union semun semun; semun.buf = 0; }
16879 if eval $compile; then
16880 echo "You have union semun in <sys/sem.h>." >&4
16883 echo "You do not have union semun in <sys/sem.h>." >&4
16890 : see how to do semctl IPC_STAT
16894 $cat > tryh.h <<END
16897 # define S_IRUSR S_IREAD
16898 # define S_IWUSR S_IWRITE
16899 # define S_IXUSR S_IEXEC
16901 # define S_IRUSR 0400
16902 # define S_IWUSR 0200
16903 # define S_IXUSR 0100
16905 # define S_IRGRP (S_IRUSR>>3)
16906 # define S_IWGRP (S_IWUSR>>3)
16907 # define S_IXGRP (S_IXUSR>>3)
16908 # define S_IROTH (S_IRUSR>>6)
16909 # define S_IWOTH (S_IWUSR>>6)
16910 # define S_IXOTH (S_IXUSR>>6)
16913 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
16914 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
16915 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
16918 : see whether semctl IPC_STAT can use union semun
16919 case "$d_semctl_semun" in
16923 #include <sys/types.h>
16924 #include <sys/ipc.h>
16925 #include <sys/sem.h>
16926 #include <sys/stat.h>
16933 #$d_union_semun HAS_UNION_SEMUN
16936 #ifndef HAS_UNION_SEMUN
16939 struct semid_ds *buf;
16940 unsigned short *array;
16946 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16947 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16949 struct semid_ds argbuf;
16952 st = semctl(sem, 0, IPC_STAT, arg);
16956 # endif /* IPC_STAT */
16957 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16959 if (semctl(sem, 0, IPC_RMID, arg) != 0)
16960 # endif /* IPC_RMID */
16961 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16963 #endif /* IPC_PRIVATE && ... */
16964 printf("semget failed: errno = %d\n", errno);
16969 if eval $compile; then
16972 semun) val="$define" ;;
16980 case "$d_semctl_semun" in
16982 echo "You can use union semun for semctl IPC_STAT." >&4
16985 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
16990 : see whether semctl IPC_STAT can use struct semid_ds pointer
16991 case "$d_semctl_semid_ds" in
16994 $cat > try.c <<'END'
16995 #include <sys/types.h>
16996 #include <sys/ipc.h>
16997 #include <sys/sem.h>
16998 #include <sys/stat.h>
17006 struct semid_ds arg;
17009 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
17010 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
17013 st = semctl(sem, 0, IPC_STAT, &arg);
17015 printf("semid_ds\n");
17017 # endif /* IPC_STAT */
17018 printf("semctl IPC_STAT failed: errno = %d\n", errno);
17020 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
17021 # endif /* IPC_RMID */
17022 printf("semctl IPC_RMID failed: errno = %d\n", errno);
17024 #endif /* IPC_PRIVATE && ... */
17025 printf("semget failed: errno = %d\n", errno);
17031 if eval $compile; then
17034 semid_ds) val="$define" ;;
17038 set d_semctl_semid_ds
17042 case "$d_semctl_semid_ds" in
17044 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
17046 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
17052 # We do not have the full sem*(2) library, so assume we can not
17058 set d_semctl_semid_ds
17064 : see if sendmsg exists
17065 set sendmsg d_sendmsg
17068 : see if setegid exists
17069 set setegid d_setegid
17072 : see if seteuid exists
17073 set seteuid d_seteuid
17076 : see if setgrent exists
17077 set setgrent d_setgrent
17080 : see if setgrent_r exists
17081 set setgrent_r d_setgrent_r
17083 case "$d_setgrent_r" in
17085 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
17086 case "$d_setgrent_r_proto:$usethreads" in
17087 ":define") d_setgrent_r_proto=define
17088 set d_setgrent_r_proto setgrent_r $hdrs
17092 case "$d_setgrent_r_proto" in
17094 case "$setgrent_r_proto" in
17095 ''|0) try='int setgrent_r(FILE**);'
17096 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=I_H ;;
17098 case "$setgrent_r_proto" in
17099 ''|0) try='void setgrent_r(FILE**);'
17100 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=V_H ;;
17102 case "$setgrent_r_proto" in
17103 ''|0) d_setgrent_r=undef
17105 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
17106 * ) case "$setgrent_r_proto" in
17107 REENTRANT_PROTO*) ;;
17108 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
17110 echo "Prototype: $try" ;;
17113 *) case "$usethreads" in
17114 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
17121 *) setgrent_r_proto=0
17125 : see if sethostent exists
17126 set sethostent d_sethent
17129 : see if sethostent_r exists
17130 set sethostent_r d_sethostent_r
17132 case "$d_sethostent_r" in
17134 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17135 case "$d_sethostent_r_proto:$usethreads" in
17136 ":define") d_sethostent_r_proto=define
17137 set d_sethostent_r_proto sethostent_r $hdrs
17141 case "$d_sethostent_r_proto" in
17143 case "$sethostent_r_proto" in
17144 ''|0) try='int sethostent_r(int, struct hostent_data*);'
17145 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=I_ID ;;
17147 case "$sethostent_r_proto" in
17148 ''|0) try='void sethostent_r(int, struct hostent_data*);'
17149 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=V_ID ;;
17151 case "$sethostent_r_proto" in
17152 ''|0) d_sethostent_r=undef
17153 sethostent_r_proto=0
17154 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
17155 * ) case "$sethostent_r_proto" in
17156 REENTRANT_PROTO*) ;;
17157 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
17159 echo "Prototype: $try" ;;
17162 *) case "$usethreads" in
17163 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
17165 d_sethostent_r=undef
17166 sethostent_r_proto=0
17170 *) sethostent_r_proto=0
17174 : see if setitimer exists
17175 set setitimer d_setitimer
17178 : see if setlinebuf exists
17179 set setlinebuf d_setlinebuf
17182 : see if setlocale exists
17183 set setlocale d_setlocale
17186 : see if locale.h is available
17187 set locale.h i_locale
17190 : see if setlocale_r exists
17191 set setlocale_r d_setlocale_r
17193 case "$d_setlocale_r" in
17195 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
17196 case "$d_setlocale_r_proto:$usethreads" in
17197 ":define") d_setlocale_r_proto=define
17198 set d_setlocale_r_proto setlocale_r $hdrs
17202 case "$d_setlocale_r_proto" in
17204 case "$setlocale_r_proto" in
17205 ''|0) try='int setlocale_r(int, const char*, char*, int);'
17206 ./protochk "$extern_C $try" $hdrs && setlocale_r_proto=I_ICBI ;;
17208 case "$setlocale_r_proto" in
17209 ''|0) d_setlocale_r=undef
17210 setlocale_r_proto=0
17211 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
17212 * ) case "$setlocale_r_proto" in
17213 REENTRANT_PROTO*) ;;
17214 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
17216 echo "Prototype: $try" ;;
17219 *) case "$usethreads" in
17220 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
17222 d_setlocale_r=undef
17223 setlocale_r_proto=0
17227 *) setlocale_r_proto=0
17231 : see if setnetent exists
17232 set setnetent d_setnent
17235 : see if setnetent_r exists
17236 set setnetent_r d_setnetent_r
17238 case "$d_setnetent_r" in
17240 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17241 case "$d_setnetent_r_proto:$usethreads" in
17242 ":define") d_setnetent_r_proto=define
17243 set d_setnetent_r_proto setnetent_r $hdrs
17247 case "$d_setnetent_r_proto" in
17249 case "$setnetent_r_proto" in
17250 ''|0) try='int setnetent_r(int, struct netent_data*);'
17251 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=I_ID ;;
17253 case "$setnetent_r_proto" in
17254 ''|0) try='void setnetent_r(int, struct netent_data*);'
17255 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=V_ID ;;
17257 case "$setnetent_r_proto" in
17258 ''|0) d_setnetent_r=undef
17259 setnetent_r_proto=0
17260 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
17261 * ) case "$setnetent_r_proto" in
17262 REENTRANT_PROTO*) ;;
17263 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
17265 echo "Prototype: $try" ;;
17268 *) case "$usethreads" in
17269 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
17271 d_setnetent_r=undef
17272 setnetent_r_proto=0
17276 *) setnetent_r_proto=0
17280 : see if setprotoent exists
17281 set setprotoent d_setpent
17284 : see if setpgid exists
17285 set setpgid d_setpgid
17288 : see if setpgrp2 exists
17289 set setpgrp2 d_setpgrp2
17292 : see if setpriority exists
17293 set setpriority d_setprior
17296 : see if setproctitle exists
17297 set setproctitle d_setproctitle
17300 : see if setprotoent_r exists
17301 set setprotoent_r d_setprotoent_r
17303 case "$d_setprotoent_r" in
17305 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17306 case "$d_setprotoent_r_proto:$usethreads" in
17307 ":define") d_setprotoent_r_proto=define
17308 set d_setprotoent_r_proto setprotoent_r $hdrs
17312 case "$d_setprotoent_r_proto" in
17314 case "$setprotoent_r_proto" in
17315 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
17316 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=I_ID ;;
17318 case "$setprotoent_r_proto" in
17319 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
17320 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=V_ID ;;
17322 case "$setprotoent_r_proto" in
17323 ''|0) d_setprotoent_r=undef
17324 setprotoent_r_proto=0
17325 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
17326 * ) case "$setprotoent_r_proto" in
17327 REENTRANT_PROTO*) ;;
17328 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
17330 echo "Prototype: $try" ;;
17333 *) case "$usethreads" in
17334 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
17336 d_setprotoent_r=undef
17337 setprotoent_r_proto=0
17341 *) setprotoent_r_proto=0
17345 : see if setpwent exists
17346 set setpwent d_setpwent
17349 : see if setpwent_r exists
17350 set setpwent_r d_setpwent_r
17352 case "$d_setpwent_r" in
17354 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
17355 case "$d_setpwent_r_proto:$usethreads" in
17356 ":define") d_setpwent_r_proto=define
17357 set d_setpwent_r_proto setpwent_r $hdrs
17361 case "$d_setpwent_r_proto" in
17363 case "$setpwent_r_proto" in
17364 ''|0) try='int setpwent_r(FILE**);'
17365 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=I_H ;;
17367 case "$setpwent_r_proto" in
17368 ''|0) try='void setpwent_r(FILE**);'
17369 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=V_H ;;
17371 case "$setpwent_r_proto" in
17372 ''|0) d_setpwent_r=undef
17374 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
17375 * ) case "$setpwent_r_proto" in
17376 REENTRANT_PROTO*) ;;
17377 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
17379 echo "Prototype: $try" ;;
17382 *) case "$usethreads" in
17383 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
17390 *) setpwent_r_proto=0
17394 : see if setregid exists
17395 set setregid d_setregid
17397 set setresgid d_setresgid
17400 : see if setreuid exists
17401 set setreuid d_setreuid
17403 set setresuid d_setresuid
17406 : see if setrgid exists
17407 set setrgid d_setrgid
17410 : see if setruid exists
17411 set setruid d_setruid
17414 : see if setservent exists
17415 set setservent d_setsent
17418 : see if setservent_r exists
17419 set setservent_r d_setservent_r
17421 case "$d_setservent_r" in
17423 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17424 case "$d_setservent_r_proto:$usethreads" in
17425 ":define") d_setservent_r_proto=define
17426 set d_setservent_r_proto setservent_r $hdrs
17430 case "$d_setservent_r_proto" in
17432 case "$setservent_r_proto" in
17433 ''|0) try='int setservent_r(int, struct servent_data*);'
17434 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=I_ID ;;
17436 case "$setservent_r_proto" in
17437 ''|0) try='void setservent_r(int, struct servent_data*);'
17438 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=V_ID ;;
17440 case "$setservent_r_proto" in
17441 ''|0) d_setservent_r=undef
17442 setservent_r_proto=0
17443 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
17444 * ) case "$setservent_r_proto" in
17445 REENTRANT_PROTO*) ;;
17446 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
17448 echo "Prototype: $try" ;;
17451 *) case "$usethreads" in
17452 define) echo "setservent_r has no prototype, not using it." >&4 ;;
17454 d_setservent_r=undef
17455 setservent_r_proto=0
17459 *) setservent_r_proto=0
17463 : see if setsid exists
17464 set setsid d_setsid
17467 : see if setvbuf exists
17468 set setvbuf d_setvbuf
17471 : see if sfio.h is available
17475 : see if sfio library is available
17486 : Ok, but do we want to use it.
17490 true|$define|[yY]*) dflt='y';;
17493 echo "$package can use the sfio library, but it is experimental."
17494 rp="You seem to have sfio available, do you want to try using it?"
17497 y|Y) echo "Ok, turning on sfio then."
17500 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
17505 *) case "$usesfio" in
17506 true|$define|[yY]*)
17507 echo "Sorry, cannot find sfio on this machine." >&4
17508 echo "Ignoring your setting of usesfio=$usesfio." >&4
17517 $define) usesfio='true';;
17518 *) usesfio='false';;
17522 *) : Remove sfio from list of libraries to use
17525 echo "Removing unneeded -lsfio from library list" >&4
17526 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
17529 echo "libs = $libs" >&4
17536 : see if shmctl exists
17537 set shmctl d_shmctl
17540 : see if shmget exists
17541 set shmget d_shmget
17544 : see if shmat exists
17547 : see what shmat returns
17550 $cat >shmat.c <<'END'
17551 #include <sys/shm.h>
17554 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
17559 echo "and it returns ($shmattype)." >&4
17560 : see if a prototype for shmat is available
17561 xxx=`./findhdr sys/shm.h`
17562 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
17563 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
17574 set d_shmatprototype
17577 : see if shmdt exists
17581 : see how much of the 'shm*(2)' library is present.
17584 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
17585 *"$undef"*) h_shm=false;;
17589 case "`ipcs 2>&1`" in
17590 "SVID shared memory"*"not configured"*)
17591 echo "Your $osname does not have the shm*(2) configured." >&4
17594 set shmctl d_shmctl
17596 set shmget d_shmget
17606 : we could also check for sys/ipc.h ...
17607 if $h_shm && $test `./findhdr sys/shm.h`; then
17608 echo "You have the full shm*(2) library." >&4
17611 echo "You don't have the full shm*(2) library." >&4
17617 : see if we have sigaction
17619 if set sigaction val -f d_sigaction; eval $csym; $val; then
17620 echo 'sigaction() found.' >&4
17623 #include <sys/types.h>
17624 #include <signal.h>
17625 #$i_stdlib I_STDLIB
17627 #include <stdlib.h>
17631 struct sigaction act, oact;
17633 oact.sa_handler = 0;
17634 /* so that act and oact are used */
17635 exit(act.sa_flags == 0 && oact.sa_handler == 0);
17639 if eval $compile_ok; then
17642 echo "But you don't seem to have a useable struct sigaction." >&4
17646 echo 'sigaction NOT found.' >&4
17649 set d_sigaction; eval $setvar
17652 : see if this is a sunmath.h system
17653 set sunmath.h i_sunmath
17656 : see if signbit exists
17657 $echo $n "Checking to see if you have signbit() available to work on $nvtype... $c" >&4
17660 #$i_sunmath I_SUNMATH
17664 #ifdef I_SUNMATH /* Solaris special math library */
17665 # include <sunmath.h>
17668 int main(int argc, char **argv)
17672 if ((signbit(x) == 0) && (signbit(y) != 0))
17680 if eval $compile; then
17681 if $run ./try; then
17685 $echo "Signbit seems to be available, but doesn't work as I expected."
17686 $echo "I won't use it." >&4
17697 : see if sigprocmask exists
17698 set sigprocmask d_sigprocmask
17701 : see if sigsetjmp exists
17703 case "$d_sigsetjmp" in
17706 #include <setjmp.h>
17707 #$i_stdlib I_STDLIB
17709 #include <stdlib.h>
17715 if (sigsetjmp(env,1))
17718 siglongjmp(env, 1);
17723 if eval $compile; then
17724 if $run ./try >/dev/null 2>&1; then
17725 echo "POSIX sigsetjmp found." >&4
17729 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
17735 echo "sigsetjmp not found." >&4
17739 *) val="$d_sigsetjmp"
17740 case "$d_sigsetjmp" in
17741 $define) echo "POSIX sigsetjmp found." >&4;;
17742 $undef) echo "sigsetjmp not found." >&4;;
17750 : see if snprintf exists
17751 set snprintf d_snprintf
17754 : see if vsnprintf exists
17755 set vsnprintf d_vsnprintf
17758 case "$d_snprintf-$d_vsnprintf" in
17761 Checking whether your snprintf() and vsnprintf() work okay...
17763 $cat >try.c <<'EOCP'
17764 /* v?snprintf testing logic courtesy of Russ Allbery.
17765 * According to C99:
17766 * - if the buffer is too short it still must be \0-terminated
17767 * - if the buffer is too short the potentially required length
17768 * must be returned and not -1
17769 * - if the buffer is NULL the potentially required length
17770 * must be returned and not -1 or core dump
17773 #include <stdarg.h>
17777 int test (char *format, ...)
17782 va_start (args, format);
17783 count = vsnprintf (buf, sizeof buf, format, args);
17790 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
17791 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
17795 if eval $compile; then
17798 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
17800 Your snprintf() and snprintf() don't seem to be working okay.
17802 d_snprintf="$undef"
17803 d_vsnprintf="$undef"
17807 echo "(I can't seem to compile the test program--assuming they don't)"
17808 d_snprintf="$undef"
17809 d_vsnprintf="$undef"
17815 : see if sockatmark exists
17816 set sockatmark d_sockatmark
17819 : see if prototype for sockatmark is available
17821 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
17824 : see if socks5_init exists
17825 set socks5_init d_socks5_init
17828 : see if sprintf returns the length of the string in the buffer as per ANSI
17829 $echo "Checking whether sprintf returns the length of the string..." >&4
17832 #$i_stdlib I_STDLIB
17834 #include <stdlib.h>
17836 #$i_string I_STRING
17838 # include <string.h>
17840 # include <strings.h>
17849 int check (size_t expect, int test) {
17850 size_t got = strlen(buffer);
17854 printf("expected %ld, got %ld in test %d '%s'\n", (long) expect, (long) got,
17859 int main(int argc, char **argv) {
17862 check(sprintf(buffer, ""), ++test);
17863 check(sprintf(buffer, "%s %s", "perl", "rules"), ++test);
17864 check(sprintf(buffer, "I like %g", atan2(0,-1)), ++test);
17871 if eval $compile; then
17875 sprintf returns the length of the string (as ANSI says it should)
17877 d_sprintf_returns_strlen="$define"
17880 sprintf does not return the length of the string (how old is this system?)
17882 d_sprintf_returns_strlen="$undef"
17886 echo "(I can't seem to compile the test program--assuming it doesn't)" >&4
17887 d_sprintf_returns_strlen="$undef"
17891 : see if srand48_r exists
17892 set srand48_r d_srand48_r
17894 case "$d_srand48_r" in
17896 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17897 case "$d_srand48_r_proto:$usethreads" in
17898 ":define") d_srand48_r_proto=define
17899 set d_srand48_r_proto srand48_r $hdrs
17903 case "$d_srand48_r_proto" in
17905 case "$srand48_r_proto" in
17906 ''|0) try='int srand48_r(long, struct drand48_data*);'
17907 ./protochk "$extern_C $try" $hdrs && srand48_r_proto=I_LS ;;
17909 case "$srand48_r_proto" in
17910 ''|0) d_srand48_r=undef
17912 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
17913 * ) case "$srand48_r_proto" in
17914 REENTRANT_PROTO*) ;;
17915 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
17917 echo "Prototype: $try" ;;
17920 *) case "$usethreads" in
17921 define) echo "srand48_r has no prototype, not using it." >&4 ;;
17928 *) srand48_r_proto=0
17932 : see if srandom_r exists
17933 set srandom_r d_srandom_r
17935 case "$d_srandom_r" in
17937 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17938 case "$d_srandom_r_proto:$usethreads" in
17939 ":define") d_srandom_r_proto=define
17940 set d_srandom_r_proto srandom_r $hdrs
17944 case "$d_srandom_r_proto" in
17946 case "$srandom_r_proto" in
17947 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
17948 ./protochk "$extern_C $try" $hdrs && srandom_r_proto=I_TS ;;
17950 case "$srandom_r_proto" in
17951 ''|0) d_srandom_r=undef
17953 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
17954 * ) case "$srandom_r_proto" in
17955 REENTRANT_PROTO*) ;;
17956 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
17958 echo "Prototype: $try" ;;
17961 *) case "$usethreads" in
17962 define) echo "srandom_r has no prototype, not using it." >&4 ;;
17969 *) srandom_r_proto=0
17973 : see if prototype for setresgid is available
17975 set d_sresgproto setresgid $i_unistd unistd.h
17978 : see if prototype for setresuid is available
17980 set d_sresuproto setresuid $i_unistd unistd.h
17983 : see if sys/stat.h is available
17984 set sys/stat.h i_sysstat
17987 : see if stat knows about block sizes
17989 echo "Checking to see if your struct stat has st_blocks field..." >&4
17990 set d_statblks stat st_blocks $i_sysstat sys/stat.h
17993 : see if this is a sys/vfs.h system
17994 set sys/vfs.h i_sysvfs
17997 : see if this is a sys/statfs.h system
17998 set sys/statfs.h i_sysstatfs
18001 : Check for statfs_s
18003 echo "Checking to see if your system supports struct statfs..." >&4
18004 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
18006 case "$d_statfs_s" in
18007 "$define") echo "Yes, it does." ;;
18008 *) echo "No, it doesn't." ;;
18012 : see if struct statfs knows about f_flags
18013 case "$d_statfs_s" in
18016 echo "Checking to see if your struct statfs has f_flags field..." >&4
18017 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
18021 set d_statfs_f_flags
18025 case "$d_statfs_f_flags" in
18026 "$define") echo "Yes, it does." ;;
18027 *) echo "No, it doesn't." ;;
18030 : see what flavor, if any, of static inline is supported
18032 echo "Checking to see if your system supports static inline..."
18033 $cat > try.c <<'EOCP'
18034 #include <stdlib.h>
18035 extern int f_via_a(int x);
18036 extern int f_via_b(int x);
18037 int main(int argc, char **argv)
18046 return EXIT_SUCCESS;
18049 return EXIT_FAILURE;
18053 $cat > a.c <<'EOCP'
18054 static INLINE int f(int x) {
18065 $cat > b.c <<'EOCP'
18066 extern int f(int x);
18074 # Respect a hint (or previous) value for perl_static_inline, if there is one.
18075 case "$perl_static_inline" in
18076 '') # Check the various possibilities, and break out on success.
18077 # For gcc, prefer __inline__, which will still permit
18078 # cflags.SH to add in -ansi.
18079 case "$gccversion" in
18080 '') xxx="inline __inline__ __inline _inline";;
18081 *) xxx="__inline__ inline __inline _inline";;
18083 for inline in $xxx; do
18084 set try -DINLINE=$inline a.c
18085 if eval $compile && $run ./try; then
18086 # Now make sure there is no external linkage of static
18088 set try -DINLINE=$inline -DUSE_B a.c b.c
18089 if eval $compile && $run ./try; then
18090 $echo "Your compiler supports static $inline, " >&4
18091 $echo "but it also creates an external definition," >&4
18092 $echo "so I won't use it." >&4
18095 $echo "Your compiler supports static $inline." >&4
18097 perl_static_inline="static $inline";
18101 $echo "Your compiler does NOT support static $inline." >&4
18106 *inline*) # Some variant of inline exists.
18107 echo "Keeping your $hint value of $perl_static_inline."
18110 static) # No inline capabilities
18111 echo "Keeping your $hint value of $perl_static_inline."
18114 *) # Unrecognized previous value -- blindly trust the supplied
18115 # value and hope it makes sense. Use old value for
18116 # d_static_inline, if there is one.
18117 echo "Keeping your $hint value of $perl_static_inline."
18118 case "$d_static_inline" in
18120 *) val=$d_static_inline ;;
18124 # Fallback to plain 'static' if nothing worked.
18125 case "$perl_static_inline" in
18127 perl_static_inline="static"
18131 set d_static_inline
18133 $rm -f a.[co] b.[co]
18136 : Check stream access
18138 Checking how to access stdio streams by file descriptor number...
18140 case "$stdio_stream_array" in
18141 '') $cat >try.c <<EOCP
18144 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
18148 for s in _iob __iob __sF
18150 set try -DSTDIO_STREAM_ARRAY=$s
18151 if eval $compile; then
18152 case "`$run ./try`" in
18153 yes) stdio_stream_array=$s; break ;;
18159 case "$stdio_stream_array" in
18161 I can't figure out how to access stdio streams by file descriptor number.
18163 d_stdio_stream_array="$undef"
18166 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
18168 d_stdio_stream_array="$define"
18172 : see if strcoll exists
18173 set strcoll d_strcoll
18176 : check for structure copying
18178 echo "Checking to see if your C compiler can copy structs..." >&4
18179 $cat >try.c <<'EOCP'
18189 if $cc -c try.c >/dev/null 2>&1 ; then
18191 echo "Yup, it can."
18194 echo "Nope, it can't."
18200 : see if strerror and/or sys_errlist[] exist
18202 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
18203 if set strerror val -f d_strerror; eval $csym; $val; then
18204 echo 'strerror() found.' >&4
18205 d_strerror="$define"
18206 d_strerrm='strerror(e)'
18207 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
18208 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
18209 d_syserrlst="$define"
18211 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
18212 d_syserrlst="$undef"
18214 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
18215 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
18216 echo 'strerror() found in string header.' >&4
18217 d_strerror="$define"
18218 d_strerrm='strerror(e)'
18219 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
18220 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
18221 d_syserrlst="$define"
18223 echo "(You don't appear to have any sys_errlist[], how can this be?)"
18224 d_syserrlst="$undef"
18226 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
18227 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
18228 d_strerror="$undef"
18229 d_syserrlst="$define"
18230 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
18232 echo 'strerror() and sys_errlist[] NOT found.' >&4
18233 d_strerror="$undef"
18234 d_syserrlst="$undef"
18235 d_strerrm='"unknown"'
18239 : see if strerror_r exists
18240 set strerror_r d_strerror_r
18242 case "$d_strerror_r" in
18244 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
18245 case "$d_strerror_r_proto:$usethreads" in
18246 ":define") d_strerror_r_proto=define
18247 set d_strerror_r_proto strerror_r $hdrs
18251 case "$d_strerror_r_proto" in
18253 case "$strerror_r_proto" in
18254 ''|0) try='int strerror_r(int, char*, size_t);'
18255 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBW ;;
18257 case "$strerror_r_proto" in
18258 ''|0) try='int strerror_r(int, char*, int);'
18259 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBI ;;
18261 case "$strerror_r_proto" in
18262 ''|0) try='char* strerror_r(int, char*, size_t);'
18263 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=B_IBW ;;
18265 case "$strerror_r_proto" in
18266 ''|0) d_strerror_r=undef
18268 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
18269 * ) case "$strerror_r_proto" in
18270 REENTRANT_PROTO*) ;;
18271 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
18273 echo "Prototype: $try" ;;
18276 *) case "$usethreads" in
18277 define) echo "strerror_r has no prototype, not using it." >&4 ;;
18284 *) strerror_r_proto=0
18288 : see if strftime exists
18289 set strftime d_strftime
18292 : see if strlcat exists
18293 set strlcat d_strlcat
18296 : see if strlcpy exists
18297 set strlcpy d_strlcpy
18300 : see if strtod exists
18301 set strtod d_strtod
18304 : see if strtol exists
18305 set strtol d_strtol
18308 : see if strtold exists
18309 set strtold d_strtold
18312 : see if strtoll exists
18313 set strtoll d_strtoll
18316 case "$d_longlong-$d_strtoll" in
18319 Checking whether your strtoll() works okay...
18321 $cat >try.c <<'EOCP'
18324 #define strtoll __strtoll
18327 #define strtoll _strtoll
18330 extern long long int strtoll(char *s, char **, int);
18331 static int bad = 0;
18332 int check(char *s, long long ell, int een) {
18335 gll = strtoll(s, 0, 10);
18336 if (!((gll == ell) && (errno == een)))
18340 check(" 1", 1LL, 0);
18341 check(" 0", 0LL, 0);
18342 check("-1", -1LL, 0);
18343 check("-9223372036854775808", -9223372036854775808LL, 0);
18344 check("-9223372036854775808", -9223372036854775808LL, 0);
18345 check(" 9223372036854775807", 9223372036854775807LL, 0);
18346 check("-9223372036854775808", -9223372036854775808LL, 0);
18347 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
18348 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
18354 if eval $compile; then
18357 ok) echo "Your strtoll() seems to be working okay." ;;
18359 Your strtoll() doesn't seem to be working okay.
18365 echo "(I can't seem to compile the test program--assuming it doesn't)"
18371 : see if strtoq exists
18372 set strtoq d_strtoq
18375 : see if strtoul exists
18376 set strtoul d_strtoul
18379 case "$d_strtoul" in
18382 Checking whether your strtoul() works okay...
18384 $cat >try.c <<'EOCP'
18387 extern unsigned long int strtoul(char *s, char **, int);
18388 static int bad = 0;
18389 void check(char *s, unsigned long eul, int een) {
18392 gul = strtoul(s, 0, 10);
18393 if (!((gul == eul) && (errno == een)))
18397 check(" 1", 1L, 0);
18398 check(" 0", 0L, 0);
18400 case "$longsize" in
18402 $cat >>try.c <<'EOCP'
18403 check("18446744073709551615", 18446744073709551615UL, 0);
18404 check("18446744073709551616", 18446744073709551615UL, ERANGE);
18405 #if 0 /* strtoul() for /^-/ strings is undefined. */
18406 check("-1", 18446744073709551615UL, 0);
18407 check("-18446744073709551614", 2, 0);
18408 check("-18446744073709551615", 1, 0);
18409 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
18410 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
18415 $cat >>try.c <<'EOCP'
18416 check("4294967295", 4294967295UL, 0);
18417 check("4294967296", 4294967295UL, ERANGE);
18418 #if 0 /* strtoul() for /^-/ strings is undefined. */
18419 check("-1", 4294967295UL, 0);
18420 check("-4294967294", 2, 0);
18421 check("-4294967295", 1, 0);
18422 check("-4294967296", 4294967295UL, ERANGE);
18423 check("-4294967297", 4294967295UL, ERANGE);
18428 : Should we write these tests to be more portable by sprintf-ing
18429 : ~0 and then manipulating that char string as input for strtol?
18432 $cat >>try.c <<'EOCP'
18439 if eval $compile; then
18440 case "`$run ./try`" in
18441 ok) echo "Your strtoul() seems to be working okay." ;;
18443 Your strtoul() doesn't seem to be working okay.
18449 echo "(I can't seem to compile the test program--assuming it doesn't)"
18455 : see if strtoull exists
18456 set strtoull d_strtoull
18459 case "$d_longlong-$d_strtoull" in
18462 Checking whether your strtoull() works okay...
18464 $cat >try.c <<'EOCP'
18467 #define strtoull __strtoull
18470 extern unsigned long long int strtoull(char *s, char **, int);
18471 static int bad = 0;
18472 int check(char *s, long long eull, int een) {
18475 gull = strtoull(s, 0, 10);
18476 if (!((gull == eull) && (errno == een)))
18480 check(" 1", 1LL, 0);
18481 check(" 0", 0LL, 0);
18482 check("18446744073709551615", 18446744073709551615ULL, 0);
18483 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
18484 #if 0 /* strtoull() for /^-/ strings is undefined. */
18485 check("-1", 18446744073709551615ULL, 0);
18486 check("-18446744073709551614", 2LL, 0);
18487 check("-18446744073709551615", 1LL, 0);
18488 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
18489 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
18496 if eval $compile; then
18497 case "`$run ./try`" in
18498 ok) echo "Your strtoull() seems to be working okay." ;;
18500 Your strtoull() doesn't seem to be working okay.
18502 d_strtoull="$undef"
18506 echo "(I can't seem to compile the test program--assuming it doesn't)"
18507 d_strtoull="$undef"
18512 : see if strtouq exists
18513 set strtouq d_strtouq
18516 case "$d_strtouq" in
18519 Checking whether your strtouq() works okay...
18521 $cat >try.c <<'EOCP'
18524 extern unsigned long long int strtouq(char *s, char **, int);
18525 static int bad = 0;
18526 void check(char *s, unsigned long long eull, int een) {
18527 unsigned long long gull;
18529 gull = strtouq(s, 0, 10);
18530 if (!((gull == eull) && (errno == een)))
18534 check(" 1", 1LL, 0);
18535 check(" 0", 0LL, 0);
18536 check("18446744073709551615", 18446744073709551615ULL, 0);
18537 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
18538 #if 0 /* strtouq() for /^-/ strings is undefined. */
18539 check("-1", 18446744073709551615ULL, 0);
18540 check("-18446744073709551614", 2LL, 0);
18541 check("-18446744073709551615", 1LL, 0);
18542 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
18543 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
18551 if eval $compile; then
18552 case "`$run ./try`" in
18553 ok) echo "Your strtouq() seems to be working okay." ;;
18555 Your strtouq() doesn't seem to be working okay.
18561 echo "(I can't seem to compile the test program--assuming it doesn't)"
18567 : see if strxfrm exists
18568 set strxfrm d_strxfrm
18571 : see if symlink exists
18572 set symlink d_symlink
18575 : see if syscall exists
18576 set syscall d_syscall
18579 : see if prototype for syscall is available
18581 set d_syscallproto syscall $i_unistd unistd.h
18584 : see if sysconf exists
18585 set sysconf d_sysconf
18588 : see if system exists
18589 set system d_system
18592 : see if tcgetpgrp exists
18593 set tcgetpgrp d_tcgetpgrp
18596 : see if tcsetpgrp exists
18597 set tcsetpgrp d_tcsetpgrp
18600 : see if prototype for telldir is available
18602 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
18605 : see if time exists
18607 if test "X$d_time" = X -o X"$timetype" = X; then
18608 if set time val -f d_time; eval $csym; $val; then
18609 echo 'time() found.' >&4
18611 rp="What is the type returned by time() on this system?"
18612 set time_t timetype long stdio.h sys/types.h
18615 echo 'time() not found, hope that will do.' >&4
18623 : see if timegm exists
18624 set timegm d_timegm
18627 : see if this is a sys/times.h system
18628 set sys/times.h i_systimes
18631 : see if times exists
18633 if set times val -f d_times; eval $csym; $val; then
18634 echo 'times() found.' >&4
18637 case "$i_systimes" in
18638 "$define") inc='sys/times.h';;
18640 rp="What is the type returned by times() on this system?"
18641 set clock_t clocktype long stdio.h sys/types.h $inc
18644 echo 'times() NOT found, hope that will do.' >&4
18649 : see if tmpnam_r exists
18650 set tmpnam_r d_tmpnam_r
18652 case "$d_tmpnam_r" in
18654 hdrs="$i_systypes sys/types.h define stdio.h "
18655 case "$d_tmpnam_r_proto:$usethreads" in
18656 ":define") d_tmpnam_r_proto=define
18657 set d_tmpnam_r_proto tmpnam_r $hdrs
18661 case "$d_tmpnam_r_proto" in
18663 case "$tmpnam_r_proto" in
18664 ''|0) try='char* tmpnam_r(char*);'
18665 ./protochk "$extern_C $try" $hdrs && tmpnam_r_proto=B_B ;;
18667 case "$tmpnam_r_proto" in
18668 ''|0) d_tmpnam_r=undef
18670 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
18671 * ) case "$tmpnam_r_proto" in
18672 REENTRANT_PROTO*) ;;
18673 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
18675 echo "Prototype: $try" ;;
18678 *) case "$usethreads" in
18679 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
18686 *) tmpnam_r_proto=0
18690 : see if truncate exists
18691 set truncate d_truncate
18694 : see if ttyname_r exists
18695 set ttyname_r d_ttyname_r
18697 case "$d_ttyname_r" in
18699 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
18700 case "$d_ttyname_r_proto:$usethreads" in
18701 ":define") d_ttyname_r_proto=define
18702 set d_ttyname_r_proto ttyname_r $hdrs
18706 case "$d_ttyname_r_proto" in
18708 case "$ttyname_r_proto" in
18709 ''|0) try='int ttyname_r(int, char*, size_t);'
18710 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBW ;;
18712 case "$ttyname_r_proto" in
18713 ''|0) try='int ttyname_r(int, char*, int);'
18714 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBI ;;
18716 case "$ttyname_r_proto" in
18717 ''|0) try='char* ttyname_r(int, char*, int);'
18718 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=B_IBI ;;
18720 case "$ttyname_r_proto" in
18721 ''|0) d_ttyname_r=undef
18723 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
18724 * ) case "$ttyname_r_proto" in
18725 REENTRANT_PROTO*) ;;
18726 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
18728 echo "Prototype: $try" ;;
18731 *) case "$usethreads" in
18732 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
18739 *) ttyname_r_proto=0
18743 : see if tzname[] exists
18745 if set tzname val -a d_tzname; eval $csym; $val; then
18747 echo 'tzname[] found.' >&4
18750 echo 'tzname[] NOT found.' >&4
18755 : Check if is a multiplatform env
18757 next|darwin) multiarch="$define" ;;
18759 case "$multiarch" in
18760 ''|[nN]*) multiarch="$undef" ;;
18763 : check for ordering of bytes in a UV
18765 case "$usecrosscompile$multiarch" in
18768 You seem to be either cross-compiling or doing a multiarchitecture build,
18769 skipping the byteorder check.
18775 case "$byteorder" in
18778 In the following, larger digits indicate more significance. A big-endian
18779 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
18780 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
18781 machines may have weird orders like 3412. A Cray will report 87654321,
18782 an Alpha will report 12345678. If the test program works the default is
18784 I'm now running the test program...
18788 #$i_stdlib I_STDLIB
18790 #include <stdlib.h>
18792 #include <sys/types.h>
18793 typedef $uvtype UV;
18803 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
18805 u.l = (UV)0x04030201;
18806 for (i = 0; i < $uvsize; i++)
18807 printf("%c", u.c[i]+'0');
18814 if eval $compile && $run ./try > /dev/null; then
18817 [1-4][1-4][1-4][1-4]|12345678|87654321)
18818 echo "(The test program ran ok.)"
18819 echo "byteorder=$dflt"
18822 ????|????????) echo "(The test program ran ok.)" ;;
18823 *) echo "(The test program didn't run right for some reason.)" ;;
18828 (I can't seem to compile the test program. Guessing big-endian...)
18831 case "$xxx_prompt" in
18833 rp="What is the order of bytes in $uvtype?"
18846 : Checking 32bit alignedness
18849 Checking to see whether you can access character data unalignedly...
18851 case "$d_u32align" in
18852 '') $cat >try.c <<EOCP
18854 #$i_stdlib I_STDLIB
18856 #include <stdlib.h>
18858 #define U32 $u32type
18859 #define BYTEORDER 0x$byteorder
18861 #include <signal.h>
18863 $signal_t bletch(int s) { exit(4); }
18866 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
18867 volatile U8 buf[8];
18871 if (sizeof(U32) != 4) {
18872 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
18879 signal(SIGBUS, bletch);
18891 for (i = 0; i < 4; i++) {
18892 up = (U32*)(buf + i);
18893 if (! ((*up == 1 << (8*i)) || /* big-endian */
18894 (*up == 1 << (8*(3-i))) /* little-endian */
18898 printf("read failed (%x)\n", *up);
18904 for (i = 0; i < 4; i++) {
18905 up = (U32*)(buf + i);
18907 if (*up != 0xBeef) {
18908 printf("write failed (%x)\n", *up);
18922 if eval $compile_ok; then
18923 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
18924 $run ./try 2>&1 >/dev/null
18927 You can access character data pretty unalignedly.
18929 d_u32align="$undef"
18932 It seems that you must access character data in an aligned manner.
18934 d_u32align="$define"
18938 rp='Can you access character data at unaligned addresses?'
18942 [yY]*) d_u32align="$undef" ;;
18943 *) d_u32align="$define" ;;
18950 : see if ualarm exists
18951 set ualarm d_ualarm
18954 : see if umask exists
18958 : see if unordered exists
18959 set unordered d_unordered
18962 : see if unsetenv exists
18963 set unsetenv d_unsetenv
18966 : see if usleep exists
18967 set usleep d_usleep
18970 : see if prototype for usleep is available
18972 set d_usleepproto usleep $i_unistd unistd.h
18975 : see if ustat exists
18979 : see if closedir exists
18980 set closedir d_closedir
18983 case "$d_closedir" in
18986 echo "Checking whether closedir() returns a status..." >&4
18988 #$i_dirent I_DIRENT /**/
18989 #$i_sysdir I_SYS_DIR /**/
18990 #$i_sysndir I_SYS_NDIR /**/
18991 #$i_systypes I_SYS_TYPES /**/
18993 #if defined(I_SYS_TYPES)
18994 #include <sys/types.h>
18996 #if defined(I_DIRENT)
18997 #include <dirent.h>
18998 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
18999 #include <sys/dir.h>
19003 #include <sys/ndir.h>
19007 #include <ndir.h> /* may be wrong in the future */
19009 #include <sys/dir.h>
19014 int main() { return closedir(opendir(".")); }
19017 if eval $compile_ok; then
19018 if $run ./try > /dev/null 2>&1 ; then
19019 echo "Yes, it does."
19022 echo "No, it doesn't."
19026 echo "(I can't seem to compile the test program--assuming it doesn't)"
19034 set d_void_closedir
19038 : see if there is a wait4
19042 : see if waitpid exists
19043 set waitpid d_waitpid
19046 : see if wcstombs exists
19047 set wcstombs d_wcstombs
19050 : see if wctomb exists
19051 set wctomb d_wctomb
19054 : see if writev exists
19055 set writev d_writev
19058 : preserve RCS keywords in files with variable substitution, grrr
19063 Revision='$Revision'
19065 : check for alignment requirements
19067 case "$usecrosscompile" in
19070 You seem to be cross-compiling. Skipping the memory alignment check.
19073 case "$alignbytes" in
19074 '') alignbytes=8 ;;
19078 case "$alignbytes" in
19079 '') echo "Checking alignment constraints..." >&4
19080 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
19081 $cat >try.c <<'EOCP'
19082 typedef long double NV;
19085 $cat >try.c <<'EOCP'
19089 $cat >>try.c <<'EOCP'
19097 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
19102 if eval $compile_ok; then
19106 echo "(I can't seem to compile the test program...)"
19108 case "$multiarch" in
19110 : The usual safe value is 8, but Darwin with -Duselongdouble
19111 : needs 16. Hence, we will take 8 as a minimum, but allow
19112 : Configure to pick a larger value if needed.
19113 if $test "$dflt" -lt 8; then
19115 echo "Setting alignment to 8 for multiarch support.">&4
19120 *) dflt="$alignbytes"
19123 rp="Doubles must be aligned on a how-many-byte boundary?"
19131 : set the base revision
19134 : Determine if this is an EBCDIC system
19136 echo "Determining whether or not we are on an EBCDIC system..." >&4
19137 $cat >try.c <<'EOM'
19140 if ('M'==0xd4) return 0;
19145 case "$BOOTSTRAP_CHARSET" in
19146 Y|y|define) bootstrap_charset=$define ;;
19147 *) bootstrap_charset=$undef ;;
19152 if eval $compile_ok; then
19153 if $run ./try; then
19154 echo "You seem to speak EBCDIC." >&4
19157 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
19160 echo "I'm unable to compile the test program." >&4
19161 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
19167 : length of character in bytes. Is always 1, otherwise it isnt C
19168 : This used to be a test using sizeof
19171 : Check for the number of bits in a character
19172 case "$charbits" in
19173 '') echo "Checking how long a character is (in bits)..." >&4
19180 for (c = 1, n = 0; c; c <<= 1, n++) ;
19181 printf ("%d\n", n);
19186 if eval $compile_ok; then
19190 echo "(I can't seem to compile the test program. Guessing...)"
19197 rp="What is the length of a character (in bits)?"
19201 case "$charbits" in
19204 Your system has an unsigned character size of $charbits bits, which
19205 is rather unusual (normally it is 8 bits). Perl likely will not work
19206 correctly on your system, with subtle bugs in various places.
19208 rp='Do you really want to continue?'
19212 [yY]) echo >&4 "Okay, continuing." ;;
19217 : how do we concatenate cpp tokens here?
19219 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
19220 $cat >cpp_stuff.c <<'EOCP'
19221 #define RCAT(a,b)a/**/b
19222 #define ACAT(a,b)a ## b
19226 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
19227 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
19228 echo "Oh! Smells like ANSI's been here." >&4
19229 echo "We can catify or stringify, separately or together!"
19231 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
19232 echo "Ah, yes! The good old days!" >&4
19233 echo "However, in the good old days we don't know how to stringify and"
19234 echo "catify at the same time."
19238 Hmm, I don't seem to be able to concatenate tokens with your cpp.
19239 You're going to have to edit the values of CAT[2-5] in config.h...
19241 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
19245 : see if this is a db.h system
19251 : Check db version.
19253 echo "Checking Berkeley DB version ..." >&4
19259 #include <sys/types.h>
19261 #$i_stdlib I_STDLIB
19263 #include <stdlib.h>
19266 int main(int argc, char *argv[])
19268 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
19269 int Major, Minor, Patch ;
19270 unsigned long Version ;
19271 (void)db_version(&Major, &Minor, &Patch) ;
19273 printf("%d %d %d %d %d %d\n",
19274 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
19275 Major, Minor, Patch);
19278 printf("You have Berkeley DB Version 2 or greater.\n");
19280 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
19281 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
19282 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
19283 Major, Minor, Patch) ;
19285 /* check that db.h & libdb are compatible */
19286 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
19287 printf("db.h and libdb are incompatible.\n") ;
19291 printf("db.h and libdb are compatible.\n") ;
19293 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
19294 + DB_VERSION_PATCH ;
19296 /* needs to be >= 2.3.4 */
19297 if (Version < 2003004) {
19298 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
19299 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
19305 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
19310 printf("You have Berkeley DB Version 1.\n");
19311 exit(0); /* DB version < 2: the coast is clear. */
19313 exit(1); /* <db.h> not Berkeley DB? */
19319 if eval $compile_ok && $run ./try; then
19320 echo 'Looks OK.' >&4
19322 db_version_major=$1
19323 db_version_minor=$2
19324 db_version_patch=$3
19326 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
19330 : Remove db from list of libraries to use
19331 echo "Removing unusable -ldb from library list" >&4
19332 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
19335 echo "libs = $libs" >&4
19345 : Check the return type needed for hash
19347 echo "Checking return type needed for hash for Berkeley DB ..." >&4
19353 #include <sys/types.h>
19356 #ifndef DB_VERSION_MAJOR
19357 u_int32_t hash_cb (ptr, size)
19365 info.hash = hash_cb;
19369 if $cc $ccflags -c try.c >try.out 2>&1 ; then
19370 if $contains warning try.out >>/dev/null 2>&1 ; then
19373 db_hashtype='u_int32_t'
19376 : XXX Maybe we should just give up here.
19377 db_hashtype=u_int32_t
19379 echo "Help: I can't seem to compile the db test program." >&4
19380 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
19383 echo "Your version of Berkeley DB uses $db_hashtype for hash."
19385 *) db_hashtype=u_int32_t
19390 : Check the return type needed for prefix
19392 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
19398 #include <sys/types.h>
19401 #ifndef DB_VERSION_MAJOR
19402 size_t prefix_cb (key1, key2)
19410 info.prefix = prefix_cb;
19414 if $cc $ccflags -c try.c >try.out 2>&1 ; then
19415 if $contains warning try.out >>/dev/null 2>&1 ; then
19416 db_prefixtype='int'
19418 db_prefixtype='size_t'
19421 db_prefixtype='size_t'
19422 : XXX Maybe we should just give up here.
19424 echo "Help: I can't seem to compile the db test program." >&4
19425 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
19428 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
19430 *) db_prefixtype='size_t'
19434 : How can we generate normalized random numbers ?
19436 echo "Looking for a random number function..." >&4
19437 case "$randfunc" in
19439 if set drand48 val -f; eval $csym; $val; then
19441 echo "Good, found drand48()." >&4
19442 elif set random val -f; eval $csym; $val; then
19444 echo "OK, found random()." >&4
19447 echo "Yick, looks like I have to use rand()." >&4
19458 *-Dmy_rand=*|*-Dmy_srand=*)
19459 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
19460 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
19461 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
19462 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
19466 while $test "$cont"; do
19467 rp="Use which function to generate random numbers?"
19469 if $test "$ans" = "$dflt"; then
19475 if set $ans val -f; eval $csym; $val; then
19479 rp="I cannot find function $ans. Use that name anyway?"
19488 case "$randfunc" in
19490 drand01="drand48()"
19496 case "$randbits" in
19498 echo "Checking to see how many bits your $randfunc() function produces..." >&4
19500 #$i_unistd I_UNISTD
19501 #$i_stdlib I_STDLIB
19504 # include <unistd.h>
19507 # include <stdlib.h>
19513 unsigned long max = 0L;
19515 for (i = 1000; i; i--) {
19516 tmp = (unsigned long) $randfunc();
19517 if (tmp > max) max = tmp;
19519 for (i = 0; max; i++)
19525 if eval $compile_ok; then
19529 echo "(I can't seem to compile the test program...)"
19536 rp="How many bits does your $randfunc() function produce?"
19540 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
19541 seedfunc="s$randfunc"
19542 randseedtype=unsigned
19546 rp="How many bits does your $randfunc() function produce?"
19549 seedfunc="s$randfunc"
19550 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
19551 if set $seedfunc val -f; eval $csym; $val; then
19552 echo "(Using $seedfunc() to seed random generator)"
19554 echo "(Warning: no $seedfunc() to seed random generator)"
19557 randseedtype=unsigned
19564 : Check how to flush
19567 Checking how to flush all pending stdio output...
19569 # I only know how to find the first 32 possibly open files on SunOS.
19570 # See also hints/sunos_4_1.sh and util.c --AD
19572 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
19574 $cat >>try.c <<EOCP
19576 #$i_stdlib I_STDLIB
19578 #include <stdlib.h>
19580 #$i_unistd I_UNISTD
19582 # include <unistd.h>
19584 #$d_sysconf HAS_SYSCONF
19585 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
19586 #ifdef HAS_STDIO_STREAM_ARRAY
19587 # define STDIO_STREAM_ARRAY $stdio_stream_array
19592 p = fopen("try.out", "w");
19596 # ifdef TRY_FPRINTF
19600 #ifdef TRY_FFLUSH_NULL
19603 #ifdef TRY_FFLUSH_ALL
19605 long open_max = -1;
19606 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
19607 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
19609 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
19610 open_max = sysconf(_SC_OPEN_MAX);
19613 open_max = FOPEN_MAX;
19616 open_max = OPEN_MAX;
19625 # ifdef HAS_STDIO_STREAM_ARRAY
19626 if (open_max > 0) {
19628 for (i = 0; i < open_max; i++)
19629 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
19630 STDIO_STREAM_ARRAY[i]._file < open_max &&
19631 STDIO_STREAM_ARRAY[i]._flag)
19632 fflush(&STDIO_STREAM_ARRAY[i]);
19640 : first we have to find out how _not_ to flush
19642 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
19644 set try -DTRY_FPUTC
19645 if eval $compile; then
19646 $run ./try 2>/dev/null
19649 if $test ! -s try.out -a "X$code" = X42; then
19655 set try -DTRY_FPRINTF
19656 if eval $compile; then
19657 $run ./try 2>/dev/null
19660 if $test ! -s try.out -a "X$code" = X42; then
19661 output=-DTRY_FPRINTF
19667 : check for fflush NULL behaviour
19668 case "$fflushNULL" in
19669 '') set try -DTRY_FFLUSH_NULL $output
19670 if eval $compile; then
19671 $run ./try 2>/dev/null
19674 if $test -s try.out -a "X$code" = X42; then
19675 fflushNULL="`$cat try.out`"
19677 if $test "X$code" != X42; then
19679 (If this test failed, don't worry, we'll try another method shortly.)
19684 $rm -f core try.core core.try.*
19685 case "$fflushNULL" in
19687 Your fflush(NULL) works okay for output streams.
19688 Let's see if it clobbers input pipes...
19690 # As of mid-March 2000 all versions of Solaris appear to have a stdio
19691 # bug that improperly flushes the input end of pipes. So we avoid the
19692 # autoflush on fork/system/exec support for now. :-(
19693 $cat >tryp.c <<EOCP
19696 main(int argc, char **argv)
19702 while ((i = getc(stdin)) != -1
19703 && (*bp++ = i) != '\n'
19704 && bp < &buf[1024])
19707 fprintf(stdout, "%s", buf);
19715 fflushNULL="$define"
19717 if eval $compile; then
19719 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
19720 if cmp tryp.c tryp.out >/dev/null 2>&1; then
19722 fflush(NULL) seems to behave okay with input streams.
19724 fflushNULL="$define"
19727 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
19729 fflushNULL="$undef"
19732 $rm -f core tryp.c tryp.core core.tryp.*
19735 Your fflush(NULL) isn't working (contrary to ANSI C).
19737 fflushNULL="$undef"
19740 Cannot figure out whether your fflush(NULL) works or not.
19741 I'm assuming it doesn't (contrary to ANSI C).
19743 fflushNULL="$undef"
19747 $define|true|[yY]*)
19748 fflushNULL="$define"
19751 fflushNULL="$undef"
19754 : check explicit looping only if NULL did not work, and if the pipe
19755 : bug does not show up on an explicit flush too
19756 case "$fflushNULL" in
19758 $cat >tryp.c <<EOCP
19761 main(int argc, char **argv)
19767 while ((i = getc(stdin)) != -1
19768 && (*bp++ = i) != '\n'
19769 && bp < &buf[1024])
19772 fprintf(stdout, "%s", buf);
19781 if eval $compile; then
19783 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
19784 if cmp tryp.c tryp.out >/dev/null 2>&1; then
19786 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
19788 : now check for fflushall behaviour
19789 case "$fflushall" in
19790 '') set try -DTRY_FFLUSH_ALL $output
19791 if eval $compile; then
19793 (Now testing the other method--but note that this also may fail.)
19795 $run ./try 2>/dev/null
19798 if $test -s try.out -a "X$code" = X42; then
19799 fflushall="`$cat try.out`"
19803 case "$fflushall" in
19805 Whew. Flushing explicitly all the stdio streams works.
19807 fflushall="$define"
19810 Sigh. Flushing explicitly all the stdio streams doesn't work.
19815 Cannot figure out whether flushing stdio streams explicitly works or not.
19816 I'm assuming it doesn't.
19822 "$define"|true|[yY]*)
19823 fflushall="$define"
19831 All is futile. Even fflush(stdin) clobbers input pipes!
19838 $rm -f core tryp.c tryp.core core.tryp.*
19840 *) fflushall="$undef"
19844 case "$fflushNULL$fflushall" in
19847 OK, I give up. I cannot figure out how to flush pending stdio output.
19848 We won't be flushing handles at all before fork/exec/popen.
19854 : Store the full pathname to the ar program for use in the C program
19855 : Respect a hint or command line value for full_ar.
19860 : Store the full pathname to the sed program for use in the C program
19863 : see what type gids are declared as in the kernel
19865 echo "Looking for the type for group ids returned by getgid()."
19866 set gid_t gidtype xxx stdio.h sys/types.h
19870 xxx=`./findhdr sys/user.h`
19871 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
19873 unsigned) dflt="$1 $2" ;;
19877 *) dflt="$gidtype";;
19880 gid_t) echo "gid_t found." ;;
19881 *) rp="What is the type for group ids returned by getgid()?"
19887 : Check the size of GID
19890 *_t) zzz="$gidtype" ;;
19893 echo "Checking the size of $zzz..." >&4
19895 #include <sys/types.h>
19897 #$i_stdlib I_STDLIB
19899 #include <stdlib.h>
19902 printf("%d\n", (int)sizeof($gidtype));
19907 if eval $compile_ok; then
19911 echo "(I can't execute the test program--guessing $gidsize.)" >&4
19914 echo "Your $zzz is $gidsize bytes long."
19919 echo "(I can't compile the test program--guessing $gidsize.)" >&4
19923 : Check if GID is signed
19926 *_t) zzz="$gidtype" ;;
19929 echo "Checking the sign of $zzz..." >&4
19931 #include <sys/types.h>
19942 if eval $compile; then
19946 echo "(I can't execute the test program--guessing unsigned.)" >&4
19950 1) echo "Your $zzz is unsigned." ;;
19951 -1) echo "Your $zzz is signed." ;;
19957 echo "(I can't compile the test program--guessing unsigned.)" >&4
19961 : Check 64bit sizes
19964 if $test X"$quadtype" != X; then
19966 echo "Checking how to print 64-bit integers..." >&4
19968 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
19969 $cat >try.c <<'EOCP'
19970 #include <sys/types.h>
19973 int q = 12345678901;
19974 printf("%ld\n", q);
19978 if eval $compile; then
19982 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
19983 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
19984 echo "We will use %d."
19990 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
19991 $cat >try.c <<'EOCP'
19992 #include <sys/types.h>
19995 long q = 12345678901;
19996 printf("%ld\n", q);
20000 if eval $compile; then
20004 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
20005 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
20006 echo "We will use %ld."
20012 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
20013 $cat >try.c <<'EOCP'
20014 #include <sys/types.h>
20015 #include <inttypes.h>
20018 int64_t q = 12345678901;
20019 printf("%" PRId64 "\n", q);
20023 if eval $compile; then
20027 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
20028 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
20029 echo "We will use the C9X style."
20035 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
20037 #include <sys/types.h>
20040 $quadtype q = 12345678901;
20041 printf("%Ld\n", q);
20045 if eval $compile; then
20049 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
20050 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
20051 echo "We will use %Ld."
20057 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
20058 $cat >try.c <<'EOCP'
20059 #include <sys/types.h>
20062 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
20063 printf("%lld\n", q);
20067 if eval $compile; then
20071 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
20072 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
20073 echo "We will use the %lld style."
20079 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
20081 #include <sys/types.h>
20084 $quadtype q = 12345678901;
20085 printf("%qd\n", q);
20089 if eval $compile; then
20093 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
20094 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
20095 echo "We will use %qd."
20101 if $test X"$sPRId64" = X; then
20102 echo "Cannot figure out how to print 64-bit integers." >&4
20109 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
20110 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
20112 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
20113 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
20117 : Check format strings for internal types
20119 $echo "Checking the format strings to be used for Perl's internal types..." >&4
20121 if $test X"$ivsize" = X8; then
20122 ivdformat="$sPRId64"
20123 uvuformat="$sPRIu64"
20124 uvoformat="$sPRIo64"
20125 uvxformat="$sPRIx64"
20126 uvXUformat="$sPRIXU64"
20128 if $test X"$ivsize" = X"$longsize"; then
20135 if $test X"$ivsize" = X"$intsize"; then
20143 if $test X"$ivsize" = X"$shortsize"; then
20154 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
20155 nveformat="$sPRIeldbl"
20156 nvfformat="$sPRIfldbl"
20157 nvgformat="$sPRIgldbl"
20158 nvEUformat="$sPRIEUldbl"
20159 nvFUformat="$sPRIFUldbl"
20160 nvGUformat="$sPRIGUldbl"
20170 case "$ivdformat" in
20171 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
20176 : Check format string for GID
20179 $echo "Checking the format string to be used for gids..." >&4
20182 -1) if $test X"$gidsize" = X"$ivsize"; then
20183 gidformat="$ivdformat"
20185 if $test X"$gidsize" = X"$longsize"; then
20188 if $test X"$gidsize" = X"$intsize"; then
20191 if $test X"$gidsize" = X"$shortsize"; then
20198 *) if $test X"$gidsize" = X"$uvsize"; then
20199 gidformat="$uvuformat"
20201 if $test X"$gidsize" = X"$longsize"; then
20204 if $test X"$gidsize" = X"$intsize"; then
20207 if $test X"$gidsize" = X"$shortsize"; then
20216 : see if getgroups exists
20217 set getgroups d_getgrps
20220 : see if setgroups exists
20221 set setgroups d_setgrps
20224 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
20226 case "$d_getgrps$d_setgrps" in
20228 case "$groupstype" in
20229 '') dflt="$gidtype" ;;
20230 *) dflt="$groupstype" ;;
20233 What type of pointer is the second argument to getgroups() and setgroups()?
20234 Usually this is the same as group ids, $gidtype, but not always.
20237 rp='What type pointer is the second argument to getgroups() and setgroups()?'
20241 *) groupstype="$gidtype";;
20244 : MAD = Misc Attribute Definition
20246 if $test $patchlevel -lt 9; then
20247 : MAD is not available in 5.8.x or earlier.
20251 $define|true|[yY]*) dflt='y' ;;
20256 Would you like to build with Misc Attribute Decoration? This is development
20257 work leading to a Perl 5 to Perl 6 convertor, which imposes a space and speed
20258 overhead on the interpreter.
20260 If this doesn't make any sense to you, just accept the default '$dflt'.
20262 rp='Build Perl with MAD?'
20267 madlyh='madly.h madly.act madly.tab'
20269 madlyobj="madly$_o" ;;
20278 : check whether make sets MAKE
20280 echo "Checking if your $make program sets \$(MAKE)..." >&4
20281 case "$make_set_make" in
20283 $sed 's/^X //' > testmake.mak << 'EOF'
20285 X @echo 'maketemp="$(MAKE)"'
20287 case "`$make -f testmake.mak 2>/dev/null`" in
20288 *maketemp=*) make_set_make='#' ;;
20289 *) make_set_make="MAKE=$make" ;;
20291 $rm -f testmake.mak
20294 case "$make_set_make" in
20295 '#') echo "Yup, it does.";;
20296 *) echo "Nope, it doesn't.";;
20299 : see what type is used for mode_t
20300 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
20301 set mode_t modetype int stdio.h sys/types.h
20304 : see if we need va_copy
20306 case "$i_stdarg" in
20309 #include <stdarg.h>
20311 #$i_stdlib I_STDLIB
20313 #include <stdlib.h>
20315 #include <signal.h>
20318 ivfprintf(FILE *f, const char *fmt, va_list *valp)
20320 return vfprintf(f, fmt, *valp);
20324 myvfprintf(FILE *f, const char *fmt, va_list val)
20326 return ivfprintf(f, fmt, &val);
20330 myprintf(char *fmt, ...)
20333 va_start(val, fmt);
20334 return myvfprintf(stdout, fmt, val);
20338 main(int ac, char **av)
20340 signal(SIGSEGV, exit);
20342 myprintf("%s%cs all right, then\n", "that", '\'');
20347 if eval $compile && $run ./try 2>&1 >/dev/null; then
20348 case "`$run ./try`" in
20349 "that's all right, then")
20355 yes) echo "It seems that you don't need va_copy()." >&4
20356 need_va_copy="$undef"
20358 *) echo "It seems that va_copy() or similar will be needed." >&4
20359 need_va_copy="$define"
20364 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
20365 need_va_copy="$undef"
20369 : see what type is used for size_t
20370 rp="What is the type used for the length parameter for string functions?"
20371 set size_t sizetype 'unsigned int' stdio.h sys/types.h
20374 : check for type of arguments to gethostbyaddr.
20375 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
20376 case "$d_gethbyaddr" in
20380 Checking to see what type of arguments are accepted by gethostbyaddr().
20382 hdrs="$define sys/types.h
20383 $d_socket sys/socket.h
20384 $i_niin netinet/in.h
20386 $i_unistd unistd.h"
20387 : The first arg can 'char *' or 'void *'
20388 : The second arg is some of integral type
20389 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
20390 for yyy in size_t long int; do
20391 case "$netdb_host_type" in
20392 '') try="$extern_C struct hostent *gethostbyaddr($xxx, $yyy, int);"
20393 if ./protochk "$try" $hdrs; then
20394 echo "Your system accepts $xxx for the first arg."
20395 echo "...and $yyy for the second arg."
20396 netdb_host_type="$xxx"
20397 netdb_hlen_type="$yyy"
20403 : In case none of those worked, prompt the user.
20404 case "$netdb_host_type" in
20405 '') rp='What is the type for the 1st argument to gethostbyaddr?'
20408 netdb_host_type=$ans
20409 rp='What is the type for the 2nd argument to gethostbyaddr?'
20412 netdb_hlen_type=$ans
20416 *) : no gethostbyaddr, so pick harmless defaults
20417 netdb_host_type='char *'
20418 netdb_hlen_type="$sizetype"
20421 # Remove the "const" if needed. -- but then we'll have a
20423 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
20426 : check for type of argument to gethostbyname.
20427 if test "X$netdb_name_type" = X ; then
20428 case "$d_gethbyname" in
20432 Checking to see what type of argument is accepted by gethostbyname().
20434 hdrs="$define sys/types.h
20435 $d_socket sys/socket.h
20436 $i_niin netinet/in.h
20438 $i_unistd unistd.h"
20439 for xxx in "const char *" "char *"; do
20440 case "$netdb_name_type" in
20441 '') try="$extern_C struct hostent *gethostbyname($xxx);"
20442 if ./protochk "$try" $hdrs; then
20443 echo "Your system accepts $xxx."
20444 netdb_name_type="$xxx"
20449 : In case none of those worked, prompt the user.
20450 case "$netdb_name_type" in
20451 '') rp='What is the type for the 1st argument to gethostbyname?'
20454 netdb_name_type=$ans
20458 *) : no gethostbyname, so pick harmless default
20459 netdb_name_type='char *'
20464 : check for type of 1st argument to getnetbyaddr.
20465 if test "X$netdb_net_type" = X ; then
20466 case "$d_getnbyaddr" in
20470 Checking to see what type of 1st argument is accepted by getnetbyaddr().
20472 hdrs="$define sys/types.h
20473 $d_socket sys/socket.h
20474 $i_niin netinet/in.h
20476 $i_unistd unistd.h"
20477 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
20478 case "$netdb_net_type" in
20479 '') try="$extern_C struct netent *getnetbyaddr($xxx, int);"
20480 if ./protochk "$try" $hdrs; then
20481 echo "Your system accepts $xxx."
20482 netdb_net_type="$xxx"
20487 : In case none of those worked, prompt the user.
20488 case "$netdb_net_type" in
20489 '') rp='What is the type for the 1st argument to getnetbyaddr?'
20492 netdb_net_type=$ans
20496 *) : no getnetbyaddr, so pick harmless default
20497 netdb_net_type='long'
20501 : locate the preferred pager for this system
20508 [a-zA-Z]:/*) dflt=$pg;;
20512 [a-zA-Z]:/*) dflt=$more;;
20516 [a-zA-Z]:/*) dflt=$less;;
20519 '') dflt=/usr/ucb/more;;
20527 rp='What pager is used on your system?'
20531 : see what type pids are declared as in the kernel
20532 rp="What is the type of process ids on this system?"
20533 set pid_t pidtype int stdio.h sys/types.h
20536 : see if ar generates random libraries by itself
20538 echo "Checking how to generate random libraries on your machine..." >&4
20539 echo 'int bar1() { return bar2(); }' > bar1.c
20540 echo 'int bar2() { return 2; }' > bar2.c
20542 #$i_stdlib I_STDLIB
20544 #include <stdlib.h>
20546 int main() { printf("%d\n", bar1()); exit(0); }
20548 $cc $ccflags -c bar1.c >/dev/null 2>&1
20549 $cc $ccflags -c bar2.c >/dev/null 2>&1
20550 $cc $ccflags -c foo.c >/dev/null 2>&1
20551 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
20552 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20553 $run ./foobar >/dev/null 2>&1; then
20554 echo "$ar appears to generate random libraries itself."
20556 if [ "X$ranlib" = "X" ]; then
20559 elif $ar s bar$_a >/dev/null 2>&1 &&
20560 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20561 $run ./foobar >/dev/null 2>&1; then
20562 echo "a table of contents needs to be added with '$ar s'."
20565 elif $ar ts bar$_a >/dev/null 2>&1 &&
20566 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20567 $run ./foobar >/dev/null 2>&1; then
20568 echo "a table of contents needs to be added with '$ar ts'."
20575 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
20576 $test -f $ranlib || ranlib=''
20579 if $test -n "$ranlib"; then
20580 echo "your system has '$ranlib'; we'll use that."
20583 echo "your system doesn't seem to support random libraries"
20584 echo "so we'll use lorder and tsort to order the libraries."
20591 : see if this is a values.h system
20592 set values.h i_values
20595 : Check the max offset that gmtime and localtime accept
20596 echo "Checking max offsets that gmtime () accepts"
20599 define) yyy="#include <values.h>" ;;
20603 case "$sGMTIME_min/$sGMTIME_max" in
20606 #include <sys/types.h>
20615 void gm_check (time_t t, int min_year, int max_year)
20618 if ( tmp == NULL ||
20619 /* Check tm_year overflow */
20620 tmp->tm_year < min_year || tmp->tm_year > max_year)
20631 gm_check (MAXLONG, 69, 0x7fffffff);
20633 if (tmp == NULL || tmp->tm_year < 0) {
20634 for (i = 63; i >= 0; i--) {
20635 time_t x = pt | ((time_t)1 << i);
20636 if (x < 0 || x < pt) continue;
20637 gm_check (x, 69, 0x7fffffff);
20640 printf ("sGMTIME_max=%ld\n", pt);
20649 gm_check (MINLONG, -1900, 70);
20652 for (i = 36; i >= 0; i--) {
20653 time_t x = pt - ((time_t)1 << i);
20654 if (x > 0) continue;
20655 gm_check (x, -1900, 70);
20658 printf ("sGMTIME_min=%ld\n", pt);
20662 int main (int argc, char *argv[])
20664 fprintf (stderr, "Sizeof time_t = %ld\n", sizeof (time_t));
20671 if eval $compile; then
20674 echo "Cannot determine sGMTIME_max and sGMTIME_min." >&4
20680 echo "Checking max offsets that localtime () accepts"
20682 case "$sLOCALTIME_min/$sLOCALTIME_max" in
20685 #include <sys/types.h>
20694 void local_check (time_t t, int min_year, int max_year)
20696 if (sizeof (time_t) > 4 && t > 0x7ffffffffffff000LL)
20699 tmp = localtime (&t);
20700 if ( tmp == NULL ||
20701 /* Check tm_year overflow */
20702 tmp->tm_year < min_year || tmp->tm_year > max_year)
20706 } /* local_check */
20713 local_check (MAXLONG, 69, 0x7fffffff);
20715 if (tmp == NULL || tmp->tm_year < 0) {
20716 for (i = 63; i >= 0; i--) {
20717 time_t x = pt | ((time_t)1 << i);
20718 if (x < 0 || x < pt) continue;
20719 local_check (x, 69, 0x7fffffff);
20722 printf ("sLOCALTIME_max=%ld\n", pt);
20731 local_check (MINLONG, -1900, 70);
20734 for (i = 36; i >= 0; i--) {
20735 time_t x = pt - ((time_t)1 << i);
20736 if (x > 0) continue;
20737 local_check (x, -1900, 70);
20740 printf ("sLOCALTIME_min=%ld\n", pt);
20744 int main (int argc, char *argv[])
20752 if eval $compile; then
20755 echo "Cannot determine sLOCALTIME_max and sLOCALTIME_min." >&4
20761 : check for type of arguments to select.
20762 case "$selecttype" in
20763 '') case "$d_select" in
20767 Checking to see what type of arguments are accepted by select().
20769 hdrs="$define sys/types.h
20770 $i_systime sys/time.h
20771 $i_sysselct sys/select.h
20772 $d_socket sys/socket.h"
20773 : The first arg can be int, unsigned, or size_t
20774 : The last arg may or may not be 'const'
20776 : void pointer has been seen but using that
20777 : breaks the selectminbits test
20778 for xxx in 'fd_set *' 'int *'; do
20779 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
20780 for tmo in 'struct timeval *' 'const struct timeval *'; do
20782 '') try="$extern_C select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
20783 if ./protochk "$try" $hdrs; then
20784 echo "Your system accepts $xxx."
20793 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
20794 case "$d_fd_set" in
20795 $define) dflt="fd_set *" ;;
20804 *) : no select, so pick a harmless default
20811 : check for the select 'width'
20812 case "$selectminbits" in
20813 '') safebits=`expr $ptrsize \* 8`
20814 case "$d_select" in
20818 Checking to see on how many bits at a time your select() operates...
20821 #include <sys/types.h>
20823 #$i_systime I_SYS_TIME
20824 #$i_systimek I_SYS_TIME_KERNEL
20829 # ifdef I_SYS_TIME_KERNEL
20832 # include <sys/time.h>
20833 # ifdef I_SYS_TIME_KERNEL
20837 #$i_sysselct I_SYS_SELECT
20838 #ifdef I_SYS_SELECT
20839 #include <sys/select.h>
20841 #$d_socket HAS_SOCKET
20843 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
20846 #$i_stdlib I_STDLIB
20848 #include <stdlib.h>
20851 #define S sizeof(*(b))
20853 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
20854 #define NBITS (NBYTES * 8)
20856 char *s = (char *)malloc(NBYTES);
20865 fp = fopen("try.c", "r");
20871 b = ($selecttype)s;
20872 for (i = 0; i < NBITS; i++)
20876 select(fd + 1, b, 0, 0, &t);
20877 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
20879 printf("%d\n", i + 1);
20884 if eval $compile_ok; then
20885 selectminbits=`$run ./try`
20886 case "$selectminbits" in
20888 Cannot figure out on how many bits at a time your select() operates.
20889 I'll play safe and guess it is $safebits bits.
20891 selectminbits=$safebits
20892 bits="$safebits bits"
20895 *) bits="$selectminbits bits" ;;
20897 echo "Your select() operates on $bits at a time." >&4
20899 rp='What is the minimum number of bits your select() operates on?'
20900 case "$byteorder" in
20901 12345678) dflt=64 ;;
20907 selectminbits="$val"
20911 *) : no select, so pick a harmless default
20912 selectminbits=$safebits
20918 : Trace out the files included by signal.h, then look for SIGxxx names.
20919 if [ "X$fieldn" = X ]; then
20920 : Just make some guesses. We check them later.
20921 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
20923 xxx=`echo '#include <signal.h>' |
20924 $cppstdin $cppminus $cppflags 2>/dev/null |
20925 $grep '^[ ]*#.*include' |
20926 $awk "{print \\$$fieldn}" | $sed 's!"!!g' |\
20927 $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
20930 for xx in $xxx /dev/null ; do
20931 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
20933 case "$xxxfiles" in
20934 '') xxxfiles=`./findhdr signal.h` ;;
20937 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
20938 print substr($2, 4, 20)
20940 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
20941 print substr($3, 4, 20)
20943 : Append some common names just in case the awk scan failed.
20944 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
20945 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
20946 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
20947 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
20948 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
20950 : generate a few handy files for later
20951 $cat > signal.c <<EOCP
20952 #include <sys/types.h>
20953 #include <signal.h>
20954 #$i_stdlib I_STDLIB
20956 #include <stdlib.h>
20961 /* Strange style to avoid deeply-nested #if/#else/#endif */
20964 # define NSIG (_NSIG)
20970 # define NSIG (SIGMAX+1)
20976 # define NSIG (SIG_MAX+1)
20982 # define NSIG (_SIG_MAX+1)
20988 # define NSIG (MAXSIG+1)
20994 # define NSIG (MAX_SIG+1)
20999 # ifdef SIGARRAYSIZE
21000 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
21006 # define NSIG (_sys_nsig) /* Solaris 2.5 */
21010 /* Default to some arbitrary number that's big enough to get most
21011 of the common signals.
21017 printf("NSIG %d\n", NSIG);
21023 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
21025 printf "#ifdef SIG"; printf $1; printf "\n"
21026 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
21027 printf $1; printf ");\n"
21031 printf "#endif /* JUST_NSIG */\n";
21032 printf "exit(0);\n}\n";
21035 $cat >signal.awk <<'EOP'
21036 BEGIN { ndups = 0 }
21037 $1 ~ /^NSIG$/ { nsig = $2 }
21038 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
21039 if ($2 > maxsig) { maxsig = $2 }
21040 if (sig_name[$2]) {
21041 dup_name[ndups] = $1
21042 dup_num[ndups] = $2
21054 printf("NSIG %d\n", nsig);
21055 for (n = 1; n < nsig; n++) {
21057 printf("%s %d\n", sig_name[n], sig_num[n])
21060 printf("NUM%d %d\n", n, n)
21063 for (n = 0; n < ndups; n++) {
21064 printf("%s %d\n", dup_name[n], dup_num[n])
21068 $cat >signal_cmd <<EOS
21070 if $test -s signal.lst; then
21071 echo "Using your existing signal.lst file"
21076 $cat >>signal_cmd <<'EOS'
21079 if eval $compile_ok; then
21080 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) |\
21081 $uniq | $awk -f signal.awk >signal.lst
21083 echo "(I can't seem be able to compile the whole test program)" >&4
21084 echo "(I'll try it in little pieces.)" >&4
21085 set signal -DJUST_NSIG
21086 if eval $compile_ok; then
21087 $run ./signal$_exe > signal.nsg
21090 echo "I can't seem to figure out how many signals you have." >&4
21091 echo "Guessing 50." >&4
21092 echo 'NSIG 50' > signal.nsg
21094 : Now look at all the signal names, one at a time.
21095 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
21096 $cat > signal.c <<EOCP
21097 #include <sys/types.h>
21098 #include <signal.h>
21101 printf("$xx %d\n", SIG${xx});
21106 if eval $compile; then
21107 echo "SIG${xx} found."
21108 $run ./signal$_exe >> signal.ls1
21110 echo "SIG${xx} NOT found."
21113 if $test -s signal.ls1; then
21114 $cat signal.nsg signal.ls1 |
21115 $sort -n | $uniq | $awk -f signal.awk >signal.lst
21119 if $test -s signal.lst; then
21122 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
21123 echo 'kill -l' >signal
21124 set X `csh -f <signal`
21128 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
21130 echo $@ | $tr ' ' $trnl | \
21131 $awk '{ printf "%s %d\n", $1, ++s; }
21132 END { printf "NSIG %d\n", ++s }' >signal.lst
21134 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
21136 chmod a+x signal_cmd
21137 $eunicefix signal_cmd
21139 : generate list of signal names
21141 case "$sig_name_init" in
21143 *) case "$sig_num_init" in
21144 ''|*,*) doinit=yes ;;
21149 echo "Generating a list of signal names and numbers..." >&4
21151 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
21152 sig_name=`$awk 'BEGIN { printf "ZERO " }
21153 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
21154 sig_num=`$awk 'BEGIN { printf "0 " }
21155 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
21156 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
21157 !/^NSIG/ { printf "\"%s\", ", $1 }
21158 END { printf "0\n" }' signal.lst`
21159 sig_num_init=`$awk 'BEGIN { printf "0, " }
21160 !/^NSIG/ { printf "%d, ", $2}
21161 END { printf "0\n"}' signal.lst`
21164 echo "The following $sig_count signals are available:"
21166 echo $sig_name | $awk \
21167 'BEGIN { linelen = 0 }
21169 for (i = 1; i <= NF; i++) {
21170 name = "SIG" $i " "
21171 linelen = linelen + length(name)
21172 if (linelen > 70) {
21174 linelen = length(name)
21180 sig_size=`echo $sig_name | awk '{print NF}'`
21181 $rm -f signal signal.c signal.awk signal.lst signal_cmd
21183 : Check size of size
21185 case "$sizetype" in
21186 *_t) zzz="$sizetype" ;;
21187 *) zzz="filesize" ;;
21189 echo "Checking the size of $zzz..." >&4
21191 #include <sys/types.h>
21193 #$i_stdlib I_STDLIB
21195 #include <stdlib.h>
21198 printf("%d\n", (int)sizeof($sizetype));
21203 if eval $compile_ok; then
21207 echo "(I can't execute the test program--guessing $sizesize.)" >&4
21210 echo "Your $zzz size is $sizesize bytes."
21215 echo "(I can't compile the test program--guessing $sizesize.)" >&4
21219 : check for socklen_t
21221 echo "Checking to see if you have socklen_t..." >&4
21223 #include <sys/types.h>
21224 #$d_socket HAS_SOCKET
21226 #include <sys/socket.h>
21228 int main() { socklen_t x = 16; }
21231 if eval $compile; then
21233 echo "You have socklen_t."
21236 echo "You do not have socklen_t."
21237 case "$sizetype" in
21238 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
21245 : see if this is a socks.h system
21246 set socks.h i_socks
21249 : check for type of the size argument to socket calls
21250 case "$d_socket" in
21254 Checking to see what type is the last argument of accept().
21257 case "$d_socklen_t" in
21258 "$define") yyy="$yyy socklen_t"
21260 yyy="$yyy $sizetype int long unsigned"
21261 for xxx in $yyy; do
21262 case "$socksizetype" in
21263 '') try="$extern_C int accept(int, struct sockaddr *, $xxx *);"
21264 case "$usesocks" in
21266 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
21267 echo "Your system accepts '$xxx *' for the last argument of accept()."
21268 socksizetype="$xxx"
21271 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
21272 echo "Your system accepts '$xxx *' for the last argument of accept()."
21273 socksizetype="$xxx"
21280 : In case none of those worked, prompt the user.
21281 case "$socksizetype" in
21282 '') rp='What is the type for socket address structure sizes?'
21289 *) : no sockets, so pick relatively harmless default
21294 : see what type is used for signed size_t
21295 set ssize_t ssizetype int stdio.h sys/types.h
21300 #$i_stdlib I_STDLIB
21302 #include <stdlib.h>
21304 #include <sys/types.h>
21305 #define Size_t $sizetype
21306 #define SSize_t $dflt
21309 if (sizeof(Size_t) == sizeof(SSize_t))
21311 else if (sizeof(Size_t) == sizeof(int))
21320 if eval $compile_ok && $run ./try > /dev/null; then
21321 ssizetype=`$run ./try`
21322 echo "I'll be using $ssizetype for functions returning a byte count." >&4
21325 Help! I can't compile and run the ssize_t test program: please enlighten me!
21326 (This is probably a misconfiguration in your system or libraries, and
21327 you really ought to fix it. Still, I'll try anyway.)
21329 I need a type that is the same size as $sizetype, but is guaranteed to
21330 be signed. Common values are ssize_t, int and long.
21333 rp="What signed type is the same size as $sizetype?"
21339 : Check the size of st_ino
21341 $echo "Checking the size of st_ino..." >&4
21342 $cat > try.c <<EOCP
21343 #include <sys/stat.h>
21345 #$i_stdlib I_STDLIB
21347 #include <stdlib.h>
21351 printf("%d\n", (int)sizeof(st.st_ino));
21356 if eval $compile_ok; then
21360 $echo "(I can't execute the test program--guessing $st_ino_size.)" >&4
21362 *) st_ino_size=$val
21363 $echo "Your st_ino is $st_ino_size bytes long."
21368 $echo "(I can't compile the test program--guessing $st_ino_size.)" >&4
21372 : Check if st_ino is signed
21374 $echo "Checking the sign of st_ino..." >&4
21375 $cat > try.c <<EOCP
21376 #include <sys/stat.h>
21381 if (foo.st_ino < 0)
21388 if eval $compile; then
21392 $echo "(I can't execute the test program--guessing unsigned.)" >&4
21394 *) st_ino_sign=$val
21395 case "$st_ino_sign" in
21396 1) $echo "Your st_ino is unsigned." ;;
21397 -1) $echo "Your st_ino is signed." ;;
21403 $echo "(I can't compile the test program--guessing unsigned.)" >&4
21407 : see what type of char stdio uses.
21409 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
21410 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
21411 echo "Your stdio uses unsigned chars." >&4
21412 stdchar="unsigned char"
21414 echo "Your stdio uses signed chars." >&4
21419 : see what type uids are declared as in the kernel
21421 echo "Looking for the type for user ids returned by getuid()."
21422 set uid_t uidtype xxx stdio.h sys/types.h
21426 xxx=`./findhdr sys/user.h`
21427 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
21429 unsigned) dflt="$1 $2" ;;
21433 *) dflt="$uidtype";;
21436 uid_t) echo "uid_t found." ;;
21437 *) rp="What is the type for user ids returned by getuid()?"
21443 : Check size of UID
21446 *_t) zzz="$uidtype" ;;
21449 echo "Checking the size of $zzz..." >&4
21451 #include <sys/types.h>
21453 #$i_stdlib I_STDLIB
21455 #include <stdlib.h>
21458 printf("%d\n", (int)sizeof($uidtype));
21463 if eval $compile_ok; then
21467 echo "(I can't execute the test program--guessing $uidsize.)" >&4
21470 echo "Your $zzz is $uidsize bytes long."
21475 echo "(I can't compile the test program--guessing $uidsize.)" >&4
21478 : Check if UID is signed
21481 *_t) zzz="$uidtype" ;;
21484 echo "Checking the sign of $zzz..." >&4
21486 #include <sys/types.h>
21497 if eval $compile; then
21501 echo "(I can't execute the test program--guessing unsigned.)" >&4
21505 1) echo "Your $zzz is unsigned." ;;
21506 -1) echo "Your $zzz is signed." ;;
21512 echo "(I can't compile the test program--guessing unsigned.)" >&4
21516 : Check format string for UID
21518 $echo "Checking the format string to be used for uids..." >&4
21521 -1) if $test X"$uidsize" = X"$ivsize"; then
21522 uidformat="$ivdformat"
21524 if $test X"$uidsize" = X"$longsize"; then
21527 if $test X"$uidsize" = X"$intsize"; then
21530 if $test X"$uidsize" = X"$shortsize"; then
21537 *) if $test X"$uidsize" = X"$uvsize"; then
21538 uidformat="$uvuformat"
21540 if $test X"$uidsize" = X"$longsize"; then
21543 if $test X"$uidsize" = X"$intsize"; then
21546 if $test X"$uidsize" = X"$shortsize"; then
21555 : Determine if we can use sysctl with KERN_PROC_PATHNAME to find executing program
21557 echo "Determining whether we can use sysctl with KERN_PROC_PATHNAME to find executing program..." >&4
21558 $cat >try.c <<'EOM'
21559 /* Intentionally a long probe as I'd like to sanity check that the exact
21560 approach is going to work, as thinking it will work, but only having it
21561 part working at runtime is worse than not having it. */
21563 #include <sys/types.h>
21564 #include <sys/sysctl.h>
21565 #include <sys/param.h>
21567 #include <string.h>
21568 #include <stdlib.h>
21569 #include <unistd.h>
21572 main(int argc, char **argv) {
21574 char *argv_leaf = strrchr(argv[0], '/');
21580 mib[1] = KERN_PROC;
21581 mib[2] = KERN_PROC_PATHNAME;
21585 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
21589 if (sysctl(mib, 4, NULL, &size, NULL, 0)) {
21594 if (size < strlen(argv_leaf) + 1) {
21595 fprintf(stderr, "size %lu is too short for a path\n",
21596 (unsigned long) size);
21600 if (size > MAXPATHLEN * MAXPATHLEN) {
21601 fprintf(stderr, "size %lu is too long for a path\n",
21602 (unsigned long) size);
21606 buffer = malloc(size);
21612 if (sysctl(mib, 4, buffer, &size, NULL, 0)) {
21617 if (strlen(buffer) + 1 != size) {
21618 fprintf(stderr, "size != strlen(buffer) + 1 (%lu != %lu)\n",
21619 (unsigned long)size, (unsigned long)strlen(buffer) + 1);
21624 if (*buffer != '/') {
21625 fprintf(stderr, "Not an absolute path: '%s'\n", buffer);
21629 if (strstr(buffer, "/./")) {
21630 fprintf(stderr, "Contains /./: '%s'\n", buffer);
21634 if (strstr(buffer, "/../")) {
21635 fprintf(stderr, "Contains /../: '%s'\n", buffer);
21639 buffer_leaf = strrchr(buffer, '/');
21640 if (strcmp(buffer_leaf, argv_leaf) != 0) {
21641 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], buffer);
21653 if eval $compile; then
21654 if $run ./try; then
21655 echo "You can use sysctl with KERN_PROC_PATHNAME to find the executing program." >&4
21658 echo "Nope, sysctl with KERN_PROC_PATHNAME doesn't work here." >&4
21662 echo "I'm unable to compile the test program." >&4
21663 echo "I'll assume no sysctl with KERN_PROC_PATHNAME here." >&4
21667 set usekernprocpathname
21670 : Determine if we can use _NSGetExecutablePath to find executing program
21672 echo "Determining whether we can use _NSGetExecutablePath to find executing program..." >&4
21673 $cat >try.c <<'EOM'
21674 /* Intentionally a long probe as I'd like to sanity check that the exact
21675 approach is going to work, as thinking it will work, but only having it
21676 part working at runtime is worse than not having it. */
21677 #include <mach-o/dyld.h>
21679 #include <stdlib.h>
21680 #include <sys/param.h>
21681 #include <string.h>
21684 main(int argc, char **argv) {
21686 uint32_t size = sizeof(buf);
21690 char *argv_leaf = strrchr(argv[0], '/');
21694 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
21698 _NSGetExecutablePath(buf, &size);
21699 if (size > MAXPATHLEN * MAXPATHLEN) {
21700 fprintf(stderr, "_NSGetExecutablePath size %u is too long for a path\n",
21701 (unsigned int) size);
21705 buffer = malloc(size);
21711 result = _NSGetExecutablePath(buffer, &size);
21713 fprintf(stderr, "_NSGetExecutablePath returned %i for a size of %u\n",
21714 result, (unsigned int) size);
21718 tidied = realpath(buffer, NULL);
21720 perror("realpath");
21726 if (*tidied != '/') {
21727 fprintf(stderr, "Not an absolute path: '%s'\n", tidied);
21731 if (strstr(tidied, "/./")) {
21732 fprintf(stderr, "Contains /./: '%s'\n", tidied);
21736 if (strstr(tidied, "/../")) {
21737 fprintf(stderr, "Contains /../: '%s'\n", tidied);
21741 tidied_leaf = strrchr(tidied, '/');
21742 if (strcmp(tidied_leaf, argv_leaf) != 0) {
21743 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], tidied);
21755 if eval $compile; then
21756 if $run ./try; then
21757 echo "You can use _NSGetExecutablePath to find the executing program." >&4
21760 echo "Nope, _NSGetExecutablePath doesn't work here." >&4
21763 echo "I'm unable to compile the test program." >&4
21764 echo "I'll assume no _NSGetExecutablePath here." >&4
21767 set usensgetexecutablepath
21770 : Check if site customization support was requested
21771 case "$usesitecustomize" in
21772 $define|true|[Yy]*)
21773 usesitecustomize="$define"
21776 usesitecustomize="$undef"
21780 : see if prototypes support variable argument declarations
21782 case "$prototype$i_stdarg" in
21784 echo "It appears we'll be able to prototype varargs functions." >&4
21788 echo "Too bad... We won't be using prototyped varargs functions..." >&4
21795 : determine compiler compiler
21804 if $test -f "$byacc$_exe"; then
21806 comp="byacc or $comp"
21808 if $test -f "$bison$_exe"; then
21809 comp="$comp or bison -y"
21811 rp="Which compiler compiler ($comp) shall I use?"
21820 echo "(Adding -y option to bison to get yacc-compatible behaviour.)"
21826 : see if this is a assert.h system
21827 set assert.h i_assert
21830 : see if this is a fp.h system
21834 : see if this is a fp_class.h system
21835 set fp_class.h i_fp_class
21838 : see if gdbm.h is available
21843 : see if gdbm_open exists
21844 set gdbm_open d_gdbm_open
21846 case "$d_gdbm_open" in
21849 echo "We won't be including <gdbm.h>"
21858 : see if this is a ieeefp.h system
21859 case "$i_ieeefp" in
21860 '' ) set ieeefp.h i_ieeefp
21865 : see if this is a libutil.h system
21866 set libutil.h i_libutil
21869 : see if mach cthreads are available
21870 if test "X$usethreads" = "X$define"; then
21871 set mach/cthreads.h i_machcthr
21874 i_machcthr="$undef"
21877 : see if this is a mntent.h system
21878 set mntent.h i_mntent
21881 : see if net/errno.h is available
21883 set net/errno.h val
21886 : Unfortunately, it causes problems on some systems. Arrgh.
21889 cat > try.c <<'EOM'
21892 #include <net/errno.h>
21898 if $cc $ccflags -c try.c >/dev/null 2>&1; then
21899 echo "We'll be including <net/errno.h>." >&4
21901 echo "We won't be including <net/errno.h>." >&4
21910 : see if netinet/tcp.h is available
21911 set netinet/tcp.h i_netinettcp
21914 : see if this is a poll.h system
21918 : see if this is a prot.h system
21922 : Preprocessor symbols
21924 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
21925 $cat <<'EOSH' > Cppsym.know
21926 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
21927 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
21928 alliant alpha am29000 AM29000 AMD64 amd64 amiga AMIGAOS AMIX
21929 ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
21930 BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
21931 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
21932 bull c cadmus clipper CMU COFF COMPILER_VERSION
21933 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
21934 CYGWIN DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
21935 Dynix DynixPTX ELF encore EPI EXTENSIONS FAVOR_BSD
21936 FILE_OFFSET_BITS FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
21938 GNU_SOURCE GNUC GNUC_MINOR GNU_LIBRARY GO32 gould GOULD_PN
21939 H3050R H3050RX hbullx20 hcx host_mips
21940 hp200 hp300 hp700 HP700 hp800 hp9000
21941 hp9000s200 hp9000s300 hp9000s400 hp9000s500
21942 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
21943 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
21944 IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
21945 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
21946 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
21947 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
21948 LIBCATAMOUNT Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
21949 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
21950 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
21951 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
21952 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
21953 MATH_HAS_NO_SIDE_EFFECTS
21954 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
21955 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
21956 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
21957 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
21958 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
21959 NetBSD news1500 news1700 news1800 news1900 news3700
21960 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
21961 ns32016 ns32332 ns32k nsc32000
21962 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
21963 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
21964 pc532 pdp11 PGC PIC plexus PORTAR posix
21965 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
21966 POSIX_C_SOURCE POSIX_SOURCE POWER
21967 PROTOTYPES PWB pyr QNX QK_USER R3000 REENTRANT RES Rhapsody RISC6000
21968 riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
21969 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
21970 sony sony_news sonyrisc sparc sparclite spectrum
21971 stardent stdc STDC_EXT stratos sun sun3 sun386
21972 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
21973 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
21974 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
21975 sysV68 sysV88 Tek4132 Tek4300 titan
21976 TM3200 TM5400 TM5600
21977 tower tower32 tower32_200 tower32_600 tower32_700
21978 tower32_800 tower32_850 tss
21979 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
21980 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
21981 unix UNIX95 UNIX99 unixpc unos
21982 USE_BSD USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE USE_LARGEFILE64
21983 USE_MISC USE_POSIX USE_POSIX199309 USE_POSIX199506 USE_POSIX2
21984 USE_REENTRANT USE_SVID USE_UNIX98 USE_XOPEN USE_XOPEN_EXTENDED
21986 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms x86_64 xenix Xenix286
21987 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
21988 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
21991 # Maybe put other stuff here too.
21992 cat <<EOSH >>Cppsym.know
21995 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
21996 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
21997 $cat Cppsym.know > Cppsym.c
21998 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
21999 $rm -f Cppsym.a Cppsym.b Cppsym.c
22000 cat <<EOSH > Cppsym
22002 if $test \$# -gt 0; then
22003 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
22004 if $test -s Cppsym.got; then
22011 $tr " " "$trnl" | ./Cppsym.try
22017 cat <<EOSH > Cppsym.try
22019 cat <<'EOCP' > try.c
22022 #define STRINGIFY(a) "a"
22024 #if cpp_stuff == 42
22025 #define StGiFy(a) #a
22026 #define STRINGIFY(a) StGiFy(a)
22028 #if $cpp_stuff != 1 && $cpp_stuff != 42
22029 # include "Bletch: How does this C preprocessor stringify macros?"
22035 cat <<'EOSH' >> Cppsym.try
22037 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
22038 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
22039 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
22040 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
22042 echo 'return 0;}' >> try.c
22044 cat <<EOSH >> Cppsym.try
22046 case "$osname-$gccversion" in
22047 irix-) ccflags="\$ccflags -woff 1178" ;;
22048 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
22050 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs && $run ./try | $sed 's/ /\\\\ /g'
22052 chmod +x Cppsym.try
22053 $eunicefix Cppsym.try
22054 ./Cppsym < Cppsym.know | $sort | $uniq > Cppsym.true
22055 : Add in any linux cpp "predefined macros":
22056 case "$osname::$gccversion" in
22057 *linux*::*.*|*gnukfreebsd*::*.*|gnu::*.*)
22059 rm -f $tHdrH'.h' $tHdrH
22061 # Filter out macro arguments, such as Linux's __INT8_C(c)
22062 if $cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
22063 sed -e 's/#define[\ \ ]*//;s/[\ \ ].*$//' -e 's/(.*//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
22064 if [ -s $tHdrH'_cppsym.real' ]; then
22065 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
22068 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
22071 : now check the C compiler for additional symbols
22072 postprocess_cc_v=''
22074 aix) postprocess_cc_v="|$tr , ' '" ;;
22081 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
22084 -D*) echo "\$i" | $sed 's/^-D//';;
22085 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
22090 postprocess_cc_v=''
22093 ./ccsym > ccsym1.raw
22094 if $test -s ccsym1.raw; then
22095 $sort ccsym1.raw | $uniq >ccsym.raw
22097 mv ccsym1.raw ccsym.raw
22100 $awk '/\=/ { print $0; next }
22101 { print $0"=1" }' ccsym.raw >ccsym.list
22102 $comm -13 Cppsym.true ccsym.list >ccsym.own
22103 $comm -12 Cppsym.true ccsym.list >ccsym.com
22104 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
22106 if $test -z ccsym.raw; then
22107 echo "Your C compiler doesn't seem to define any symbols!" >&4
22109 echo "However, your C preprocessor defines the following symbols:"
22112 cppsymbols=`$cat Cppsym.true`
22113 cppsymbols=`echo $cppsymbols`
22114 cppccsymbols="$cppsymbols"
22116 if $test -s ccsym.com; then
22117 echo "Your C compiler and pre-processor define these symbols:"
22118 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
22121 cppccsymbols=`$cat ccsym.com`
22122 cppccsymbols=`echo $cppccsymbols`
22123 $test "$silent" || sleep 1
22125 if $test -s ccsym.cpp; then
22126 $test "$also" && echo " "
22127 echo "Your C pre-processor ${also}defines the following symbols:"
22128 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
22130 cppsymbols=`$cat ccsym.cpp`
22131 cppsymbols=`echo $cppsymbols`
22132 $test "$silent" || sleep 1
22134 if $test -s ccsym.own; then
22135 $test "$also" && echo " "
22136 echo "Your C compiler ${also}defines the following cpp symbols:"
22137 $sed -e 's/\(..*\)=1/\1/' ccsym.own
22138 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
22139 ccsymbols=`$cat ccsym.own`
22140 ccsymbols=`echo $ccsymbols`
22141 $test "$silent" || sleep 1
22145 : see if this is a termio system
22149 if $test `./findhdr termios.h`; then
22150 set tcsetattr i_termios
22156 "$define") echo "You have POSIX termios.h... good!" >&4;;
22157 *) if ./Cppsym pyr; then
22158 case "`/bin/universe`" in
22159 ucb) if $test `./findhdr sgtty.h`; then
22161 echo "<sgtty.h> found." >&4
22163 echo "System is pyramid with BSD universe."
22164 ./warn "<sgtty.h> not found--you could have problems."
22166 *) if $test `./findhdr termio.h`; then
22168 echo "<termio.h> found." >&4
22170 echo "System is pyramid with USG universe."
22171 ./warn "<termio.h> not found--you could have problems."
22175 if $test `./findhdr termio.h`; then
22176 echo "<termio.h> found." >&4
22178 elif $test `./findhdr sgtty.h`; then
22179 echo "<sgtty.h> found." >&4
22182 ./warn "Neither <termio.h> nor <sgtty.h> found--cross fingers!"
22185 if $test `./findhdr sgtty.h`; then
22186 echo "<sgtty.h> found." >&4
22188 elif $test `./findhdr termio.h`; then
22189 echo "<termio.h> found." >&4
22192 ./warn "Neither <sgtty.h> nor <termio.h> found--cross fingers!"
22196 set i_termio; eval $setvar
22197 val=$val2; set i_sgtty; eval $setvar
22198 val=$val3; set i_termios; eval $setvar
22200 : see if stdbool is available
22201 : we want a real compile instead of Inhdr because some Solaris systems
22202 : have stdbool.h, but it can only be used if the compiler indicates it
22203 : is sufficiently c99-compliant.
22207 #include <stdbool.h>
22212 int main(int argc, char **argv)
22218 if eval $compile; then
22219 echo "<stdbool.h> found." >&4
22222 echo "<stdbool.h> NOT found." >&4
22229 : see if stddef is available
22230 set stddef.h i_stddef
22233 : see if sys/access.h is available
22234 set sys/access.h i_sysaccess
22237 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
22238 set sys/filio.h i_sysfilio
22241 if $test `./findhdr sys/ioctl.h`; then
22243 echo '<sys/ioctl.h> found.' >&4
22246 if $test $i_sysfilio = "$define"; then
22247 echo '<sys/ioctl.h> NOT found.' >&4
22249 $test $i_sgtty = "$define" && xxx="sgtty.h"
22250 $test $i_termio = "$define" && xxx="termio.h"
22251 $test $i_termios = "$define" && xxx="termios.h"
22252 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
22258 : see if socket ioctl defs are in sys/sockio.h
22260 xxx=`./findhdr sys/sockio.h`
22261 if $test "$xxx"; then
22262 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
22264 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
22267 echo "No socket ioctls found in <sys/sockio.h>." >&4
22272 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
22278 : see if this is a syslog.h system
22279 set syslog.h i_syslog
22282 : see if this is a sys/mode.h system
22283 set sys/mode.h i_sysmode
22286 : see if there is a sys/poll.h file
22287 set sys/poll.h i_syspoll
22290 : see if sys/resource.h has to be included
22291 set sys/resource.h i_sysresrc
22294 : see if sys/security.h is available
22295 set sys/security.h i_syssecrt
22298 : see if this is a sys/statvfs.h system
22299 set sys/statvfs.h i_sysstatvfs
22302 : see if this is a sys/un.h system
22303 set sys/un.h i_sysun
22306 : see if this is a sys/utsname.h system
22307 set sys/utsname.h i_sysutsname
22310 : see if this is a syswait system
22311 set sys/wait.h i_syswait
22314 : see if this is a ustat.h system
22315 set ustat.h i_ustat
22318 : see if this is an utime system
22319 set utime.h i_utime
22322 : see if this is a vfork system
22325 set vfork.h i_vfork
22335 echo "Looking for extensions..." >&4
22336 : If we are using the old config.sh, known_extensions may contain
22337 : old or inaccurate or duplicate values.
22338 known_extensions=''
22339 nonxs_extensions=''
22340 : We do not use find because it might not be available.
22341 : We do not just use MANIFEST because the user may have dropped
22342 : some additional extensions into the source tree and expect them
22345 : Function to recursively find available extensions, ignoring DynaLoader
22346 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
22347 : In 5.10.1 and later, extensions are stored in directories
22348 : like File-Glob instead of the older File/Glob/.
22352 DynaLoader|dynaload) ;;
22354 this_ext=`echo $xxx | $sed -e s/-/\\\//g`;
22355 leaf=`echo $xxx | $sed -e s/.*-//`;
22356 if $test -d File; then
22357 if $test -f $xxx/$leaf.xs -o -f $xxx/$leaf.c; then
22358 known_extensions="$known_extensions $1$this_ext";
22359 elif $test -f $xxx/Makefile.PL; then
22360 nonxs_extensions="$nonxs_extensions $1$this_ext";
22362 if $test -d $xxx -a $# -lt 10; then
22365 eval $find_extensions;
22371 echo " $known_extensions $nonxs_extensions" > $$.tmp;
22372 if $contains " $this_ext " $$.tmp; then
22374 echo "Duplicate directories detected for extension $xxx" >&4;
22375 echo "Configure cannot correctly recover from this - shall I abort?" >&4;
22376 case "$knowitall" in
22384 echo "Ok. Stopping Configure." >&4;
22385 echo "Please remove the duplicate directory (eg using git clean) and then re-run Configure" >&4;
22388 echo "Ok. You will need to correct config.sh before running make." >&4;
22390 $ls -1 $xxx > $$.tmp;
22391 if $contains "\.xs$" $$.tmp > /dev/null 2>&1; then
22392 known_extensions="$known_extensions $this_ext";
22393 elif $contains "\.c$" $$.tmp > /dev/null 2>&1; then
22394 known_extensions="$known_extensions $this_ext";
22395 elif $test -d $xxx; then
22396 nonxs_extensions="$nonxs_extensions $this_ext";
22407 eval $find_extensions
22411 eval $find_extensions
22415 eval $find_extensions
22416 if $test -d File-Glob; then
22417 : All ext/ flattened
22419 # Special case: Add in modules that nest beyond the first level.
22420 # Currently threads/shared and Hash/Util/FieldHash, since they are
22421 # not picked up by the recursive find above (and adding in general
22422 # recursive finding breaks SDBM_File/sdbm).
22423 # A.D. 20011025 (SDBM), ajgough 20071008 (FieldHash)
22424 known_extensions="$known_extensions threads/shared Hash/Util/FieldHash"
22426 set X $known_extensions
22428 known_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
22429 set X $nonxs_extensions
22431 nonxs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
22434 : Now see which are supported on this system.
22436 for xxx in $known_extensions ; do
22440 $define) avail_ext="$avail_ext $xxx" ;;
22443 GDBM_File|gdbm_fil)
22445 $define) avail_ext="$avail_ext $xxx" ;;
22448 I18N/Langinfo|i18n_lan)
22449 case "$i_langinfo$d_nl_langinfo" in
22450 $define$define) avail_ext="$avail_ext $xxx" ;;
22454 : XXX Do we need a useipcsysv variable here
22455 case "${d_msg}${d_sem}${d_shm}" in
22456 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
22459 NDBM_File|ndbm_fil)
22462 case "$osname-$use64bitint" in
22465 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
22468 *) avail_ext="$avail_ext $xxx" ;;
22473 ODBM_File|odbm_fil)
22474 case "${i_dbm}${i_rpcsvcdbm}" in
22476 case "$d_cplusplus" in
22477 define) ;; # delete as a function name will not work
22478 *) case "$osname-$use64bitint" in
22481 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
22484 *) avail_ext="$avail_ext $xxx" ;;
22492 case "$useopcode" in
22493 true|define|y) avail_ext="$avail_ext $xxx" ;;
22497 case "$useposix" in
22498 true|define|y) avail_ext="$avail_ext $xxx" ;;
22502 case "$d_socket" in
22503 true|$define|y) avail_ext="$avail_ext $xxx" ;;
22506 Sys/Syslog|sys/syslog)
22507 : XXX syslog requires socket
22508 case "$d_socket" in
22509 true|$define|y) avail_ext="$avail_ext $xxx" ;;
22513 case "$usethreads" in
22515 case "$use5005threads" in
22516 $define|true|[yY]*) avail_ext="$avail_ext $xxx" ;;
22520 threads|threads/shared)
22521 # threads and threads::shared are special cases.
22522 # To stop people from asking "Perl 5.8.0 was supposed
22523 # to have this new fancy threads implementation but my
22524 # perl doesn't have it" and from people trying to
22525 # (re)install the threads module using CPAN.pm and
22526 # CPAN.pm then offering to reinstall Perl 5.8.0,
22527 # the threads.pm and threads/shared.pm will always be
22528 # there, croaking informatively ("you need to rebuild
22529 # all of Perl with threads, sorry") when threads haven't
22530 # been compiled in.
22532 avail_ext="$avail_ext $xxx"
22538 cygwin) avail_ext="$avail_ext $xxx" ;;
22541 XS/APItest|xs/apitest)
22542 # This is just for testing. Skip it unless we have dynamic loading.
22545 $define) avail_ext="$avail_ext $xxx" ;;
22548 XS/Typemap|xs/typemap)
22549 # This is just for testing. Skip it unless we have dynamic loading.
22551 $define) avail_ext="$avail_ext $xxx" ;;
22554 *) avail_ext="$avail_ext $xxx"
22563 case "$onlyextensions" in
22565 *) keepextensions=''
22566 echo "You have requested that only certain extensions be included..." >&4
22567 for i in $onlyextensions; do
22568 case " $avail_ext " in
22570 echo "Keeping extension $i."
22571 keepextensions="$keepextensions $i"
22573 *) echo "Ignoring extension $i." ;;
22576 avail_ext="$keepextensions"
22580 case "$noextensions" in
22582 *) keepextensions=''
22583 echo "You have requested that certain extensions be ignored..." >&4
22584 for i in $avail_ext; do
22585 case " $noextensions " in
22586 *" $i "*) echo "Ignoring extension $i." ;;
22587 *) echo "Keeping extension $i.";
22588 keepextensions="$keepextensions $i"
22592 avail_ext="$keepextensions"
22596 : Now see which nonxs extensions are supported on this system.
22597 : For now assume all are.
22599 for xxx in $nonxs_extensions ; do
22601 *) nonxs_ext="$nonxs_ext $xxx"
22613 A number of extensions are supplied with $package. You may choose to
22614 compile these extensions for dynamic loading (the default), compile
22615 them into the $package executable (static loading), or not include
22616 them at all. Answer "none" to include no extensions.
22617 Note that DynaLoader is always built and need not be mentioned here.
22620 case "$dynamic_ext" in
22622 : Exclude those listed in static_ext
22624 for xxx in $avail_ext; do
22625 case " $static_ext " in
22627 *) dflt="$dflt $xxx" ;;
22634 *) dflt="$dynamic_ext"
22635 # Perhaps we are reusing an old out-of-date config.sh.
22638 if test X"$dynamic_ext" != X"$avail_ext"; then
22640 NOTICE: Your previous config.sh list may be incorrect.
22641 The extensions now available to you are
22643 but the default list from your previous config.sh is
22655 rp="What extensions do you wish to load dynamically?"
22658 none) dynamic_ext=' ' ;;
22659 *) dynamic_ext="$ans" ;;
22662 case "$static_ext" in
22664 : Exclude those already listed in dynamic linking
22666 for xxx in $avail_ext; do
22667 case " $dynamic_ext " in
22669 *) dflt="$dflt $xxx" ;;
22676 *) dflt="$static_ext"
22683 rp="What extensions do you wish to load statically?"
22686 none) static_ext=' ' ;;
22687 *) static_ext="$ans" ;;
22692 A number of extensions are supplied with $package. Answer "none"
22693 to include no extensions.
22694 Note that DynaLoader is always built and need not be mentioned here.
22697 case "$static_ext" in
22698 '') dflt="$avail_ext" ;;
22699 *) dflt="$static_ext"
22700 # Perhaps we are reusing an old out-of-date config.sh.
22703 if test X"$static_ext" != X"$avail_ext"; then
22705 NOTICE: Your previous config.sh list may be incorrect.
22706 The extensions now available to you are
22708 but the default list from your previous config.sh is
22717 : Exclude those that are not xs extensions
22721 rp="What extensions do you wish to include?"
22724 none) static_ext=' ' ;;
22725 *) static_ext="$ans" ;;
22730 # Encode is a special case. If we are building Encode as a static
22731 # extension, we need to explicitly list its subextensions as well.
22732 # For other nested extensions, this is handled automatically by
22733 # the appropriate Makefile.PL.
22734 case " $static_ext " in
22735 *" Encode "*) # Add the subextensions of Encode
22737 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
22738 static_ext="$static_ext Encode/$xxx"
22744 set X $dynamic_ext $static_ext $nonxs_ext
22748 # Sanity check: We require an extension suitable for use with
22749 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
22750 # should show up as failures in the test suite, but it's helpful to
22751 # catch them now.) The 'extensions' list is normally sorted
22752 # alphabetically, so we need to accept either
22753 # DB_File ... Fcntl ... IO ....
22754 # or something like
22755 # Fcntl ... NDBM_File ... IO ....
22756 case " $extensions" in
22757 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
22758 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
22759 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
22760 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
22761 echo "WARNING: The Perl you are building will be quite crippled." >& 4
22765 : Remove libraries needed only for extensions
22766 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
22767 : The exception is SunOS 4.x, which needs them.
22768 case "${osname}X${osvers}" in
22772 *) case "$usedl" in
22773 $define|true|[yY]*)
22774 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -lgdbm_compat @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
22778 *) perllibs="$libs"
22784 : Remove build directory name from cppstdin so it can be used from
22785 : either the present location or the final installed location.
22787 : Get out of the UU directory to get correct path name.
22789 case "$cppstdin" in
22791 echo "Stripping down cppstdin path name"
22797 : end of configuration questions
22799 echo "End of configuration questions."
22802 : back to where it started
22803 if test -d ../UU; then
22807 : configuration may be unconditionally patched via a 'config.arch' file
22808 if $test -f config.arch; then
22809 echo "I see a config.arch file, loading it." >&4
22813 : configuration may be patched via a 'config.over' file
22814 if $test -f config.over; then
22817 rp='I see a config.over file. Do you wish to load it?'
22820 n*) echo "OK, I'll ignore it.";;
22822 echo "Configuration override changes have been loaded."
22827 : in case they want portability, strip down executable paths
22828 case "$d_portable" in
22831 echo "Stripping down executable paths..." >&4
22832 for file in $loclist $trylist; do
22834 eval $file=`basename $temp`
22839 : create config.sh file
22841 echo "Creating config.sh..." >&4
22842 $spitshell <<EOT >config.sh
22845 # This file was produced by running the Configure script. It holds all the
22846 # definitions figured out by Configure. Should you modify one of these values,
22847 # do not forget to propagate your changes by running "Configure -der". You may
22848 # instead choose to run each of the .SH files by yourself, or "Configure -S".
22851 # Package name : $package
22852 # Source directory : $src
22853 # Configuration time: $cf_time
22854 # Configured by : $cf_by
22855 # Target system : $myuname
22858 : Add in command line options if available
22859 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
22861 $spitshell <<EOT >>config.sh
22870 Revision='$Revision'
22878 alignbytes='$alignbytes'
22879 ansi2knr='$ansi2knr'
22880 aphostname='$aphostname'
22881 api_revision='$api_revision'
22882 api_subversion='$api_subversion'
22883 api_version='$api_version'
22884 api_versionstring='$api_versionstring'
22887 archlibexp='$archlibexp'
22888 archname64='$archname64'
22889 archname='$archname'
22890 archobjs='$archobjs'
22891 asctime_r_proto='$asctime_r_proto'
22899 bootstrap_charset='$bootstrap_charset'
22901 byteorder='$byteorder'
22903 castflags='$castflags'
22906 cccdlflags='$cccdlflags'
22907 ccdlflags='$ccdlflags'
22909 ccflags_uselargefiles='$ccflags_uselargefiles'
22911 ccsymbols='$ccsymbols'
22912 ccversion='$ccversion'
22914 cf_email='$cf_email'
22916 charbits='$charbits'
22917 charsize='$charsize'
22921 clocktype='$clocktype'
22923 compress='$compress'
22924 contains='$contains'
22928 cpp_stuff='$cpp_stuff'
22929 cppccsymbols='$cppccsymbols'
22930 cppflags='$cppflags'
22932 cppminus='$cppminus'
22934 cppstdin='$cppstdin'
22935 cppsymbols='$cppsymbols'
22936 crypt_r_proto='$crypt_r_proto'
22937 cryptlib='$cryptlib'
22939 ctermid_r_proto='$ctermid_r_proto'
22940 ctime_r_proto='$ctime_r_proto'
22941 d_Gconvert='$d_Gconvert'
22942 d_PRIEUldbl='$d_PRIEUldbl'
22943 d_PRIFUldbl='$d_PRIFUldbl'
22944 d_PRIGUldbl='$d_PRIGUldbl'
22945 d_PRIXU64='$d_PRIXU64'
22946 d_PRId64='$d_PRId64'
22947 d_PRIeldbl='$d_PRIeldbl'
22948 d_PRIfldbl='$d_PRIfldbl'
22949 d_PRIgldbl='$d_PRIgldbl'
22950 d_PRIi64='$d_PRIi64'
22951 d_PRIo64='$d_PRIo64'
22952 d_PRIu64='$d_PRIu64'
22953 d_PRIx64='$d_PRIx64'
22954 d_SCNfldbl='$d_SCNfldbl'
22955 d__fwalk='$d__fwalk'
22956 d_access='$d_access'
22957 d_accessx='$d_accessx'
22960 d_archlib='$d_archlib'
22961 d_asctime64='$d_asctime64'
22962 d_asctime_r='$d_asctime_r'
22965 d_attribute_deprecated='$d_attribute_deprecated'
22966 d_attribute_format='$d_attribute_format'
22967 d_attribute_malloc='$d_attribute_malloc'
22968 d_attribute_nonnull='$d_attribute_nonnull'
22969 d_attribute_noreturn='$d_attribute_noreturn'
22970 d_attribute_pure='$d_attribute_pure'
22971 d_attribute_unused='$d_attribute_unused'
22972 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
22976 d_bsdgetpgrp='$d_bsdgetpgrp'
22977 d_bsdsetpgrp='$d_bsdsetpgrp'
22978 d_builtin_choose_expr='$d_builtin_choose_expr'
22979 d_builtin_expect='$d_builtin_expect'
22981 d_c99_variadic_macros='$d_c99_variadic_macros'
22982 d_casti32='$d_casti32'
22983 d_castneg='$d_castneg'
22984 d_charvspr='$d_charvspr'
22986 d_chroot='$d_chroot'
22987 d_chsize='$d_chsize'
22989 d_clearenv='$d_clearenv'
22990 d_closedir='$d_closedir'
22991 d_cmsghdr_s='$d_cmsghdr_s'
22993 d_copysignl='$d_copysignl'
22994 d_cplusplus='$d_cplusplus'
22996 d_crypt_r='$d_crypt_r'
22998 d_ctermid='$d_ctermid'
22999 d_ctermid_r='$d_ctermid_r'
23000 d_ctime64='$d_ctime64'
23001 d_ctime_r='$d_ctime_r'
23002 d_cuserid='$d_cuserid'
23003 d_dbl_dig='$d_dbl_dig'
23004 d_dbminitproto='$d_dbminitproto'
23005 d_difftime64='$d_difftime64'
23006 d_difftime='$d_difftime'
23007 d_dir_dd_fd='$d_dir_dd_fd'
23009 d_dirnamlen='$d_dirnamlen'
23010 d_dlerror='$d_dlerror'
23011 d_dlopen='$d_dlopen'
23012 d_dlsymun='$d_dlsymun'
23013 d_dosuid='$d_dosuid'
23014 d_drand48_r='$d_drand48_r'
23015 d_drand48proto='$d_drand48proto'
23017 d_eaccess='$d_eaccess'
23018 d_endgrent='$d_endgrent'
23019 d_endgrent_r='$d_endgrent_r'
23020 d_endhent='$d_endhent'
23021 d_endhostent_r='$d_endhostent_r'
23022 d_endnent='$d_endnent'
23023 d_endnetent_r='$d_endnetent_r'
23024 d_endpent='$d_endpent'
23025 d_endprotoent_r='$d_endprotoent_r'
23026 d_endpwent='$d_endpwent'
23027 d_endpwent_r='$d_endpwent_r'
23028 d_endsent='$d_endsent'
23029 d_endservent_r='$d_endservent_r'
23030 d_eofnblk='$d_eofnblk'
23031 d_eunice='$d_eunice'
23032 d_faststdio='$d_faststdio'
23033 d_fchdir='$d_fchdir'
23034 d_fchmod='$d_fchmod'
23035 d_fchown='$d_fchown'
23037 d_fcntl_can_lock='$d_fcntl_can_lock'
23038 d_fd_macros='$d_fd_macros'
23039 d_fd_set='$d_fd_set'
23040 d_fds_bits='$d_fds_bits'
23041 d_fgetpos='$d_fgetpos'
23042 d_finite='$d_finite'
23043 d_finitel='$d_finitel'
23044 d_flexfnam='$d_flexfnam'
23046 d_flockproto='$d_flockproto'
23048 d_fp_class='$d_fp_class'
23049 d_fpathconf='$d_fpathconf'
23050 d_fpclass='$d_fpclass'
23051 d_fpclassify='$d_fpclassify'
23052 d_fpclassl='$d_fpclassl'
23053 d_fpos64_t='$d_fpos64_t'
23054 d_frexpl='$d_frexpl'
23055 d_fs_data_s='$d_fs_data_s'
23056 d_fseeko='$d_fseeko'
23057 d_fsetpos='$d_fsetpos'
23058 d_fstatfs='$d_fstatfs'
23059 d_fstatvfs='$d_fstatvfs'
23061 d_ftello='$d_ftello'
23063 d_futimes='$d_futimes'
23064 d_gdbm_ndbm_h_uses_prototypes='$d_gdbm_ndbm_h_uses_prototypes'
23065 d_gdbmndbm_h_uses_prototypes='$d_gdbmndbm_h_uses_prototypes'
23066 d_getaddrinfo='$d_getaddrinfo'
23067 d_getcwd='$d_getcwd'
23068 d_getespwnam='$d_getespwnam'
23069 d_getfsstat='$d_getfsstat'
23070 d_getgrent='$d_getgrent'
23071 d_getgrent_r='$d_getgrent_r'
23072 d_getgrgid_r='$d_getgrgid_r'
23073 d_getgrnam_r='$d_getgrnam_r'
23074 d_getgrps='$d_getgrps'
23075 d_gethbyaddr='$d_gethbyaddr'
23076 d_gethbyname='$d_gethbyname'
23077 d_gethent='$d_gethent'
23078 d_gethname='$d_gethname'
23079 d_gethostbyaddr_r='$d_gethostbyaddr_r'
23080 d_gethostbyname_r='$d_gethostbyname_r'
23081 d_gethostent_r='$d_gethostent_r'
23082 d_gethostprotos='$d_gethostprotos'
23083 d_getitimer='$d_getitimer'
23084 d_getlogin='$d_getlogin'
23085 d_getlogin_r='$d_getlogin_r'
23086 d_getmnt='$d_getmnt'
23087 d_getmntent='$d_getmntent'
23088 d_getnameinfo='$d_getnameinfo'
23089 d_getnbyaddr='$d_getnbyaddr'
23090 d_getnbyname='$d_getnbyname'
23091 d_getnent='$d_getnent'
23092 d_getnetbyaddr_r='$d_getnetbyaddr_r'
23093 d_getnetbyname_r='$d_getnetbyname_r'
23094 d_getnetent_r='$d_getnetent_r'
23095 d_getnetprotos='$d_getnetprotos'
23096 d_getpagsz='$d_getpagsz'
23097 d_getpbyname='$d_getpbyname'
23098 d_getpbynumber='$d_getpbynumber'
23099 d_getpent='$d_getpent'
23100 d_getpgid='$d_getpgid'
23101 d_getpgrp2='$d_getpgrp2'
23102 d_getpgrp='$d_getpgrp'
23103 d_getppid='$d_getppid'
23104 d_getprior='$d_getprior'
23105 d_getprotobyname_r='$d_getprotobyname_r'
23106 d_getprotobynumber_r='$d_getprotobynumber_r'
23107 d_getprotoent_r='$d_getprotoent_r'
23108 d_getprotoprotos='$d_getprotoprotos'
23109 d_getprpwnam='$d_getprpwnam'
23110 d_getpwent='$d_getpwent'
23111 d_getpwent_r='$d_getpwent_r'
23112 d_getpwnam_r='$d_getpwnam_r'
23113 d_getpwuid_r='$d_getpwuid_r'
23114 d_getsbyname='$d_getsbyname'
23115 d_getsbyport='$d_getsbyport'
23116 d_getsent='$d_getsent'
23117 d_getservbyname_r='$d_getservbyname_r'
23118 d_getservbyport_r='$d_getservbyport_r'
23119 d_getservent_r='$d_getservent_r'
23120 d_getservprotos='$d_getservprotos'
23121 d_getspnam='$d_getspnam'
23122 d_getspnam_r='$d_getspnam_r'
23123 d_gettimeod='$d_gettimeod'
23124 d_gmtime64='$d_gmtime64'
23125 d_gmtime_r='$d_gmtime_r'
23126 d_gnulibc='$d_gnulibc'
23127 d_grpasswd='$d_grpasswd'
23128 d_hasmntopt='$d_hasmntopt'
23130 d_ilogbl='$d_ilogbl'
23131 d_inc_version_list='$d_inc_version_list'
23133 d_inetaton='$d_inetaton'
23134 d_inetntop='$d_inetntop'
23135 d_inetpton='$d_inetpton'
23136 d_int64_t='$d_int64_t'
23137 d_ip_mreq='$d_ip_mreq'
23138 d_ip_mreq_source='$d_ip_mreq_source'
23139 d_ipv6_mreq='$d_ipv6_mreq'
23140 d_ipv6_mreq_source='$d_ipv6_mreq_source'
23141 d_isascii='$d_isascii'
23142 d_isblank='$d_isblank'
23143 d_isfinite='$d_isfinite'
23146 d_isnanl='$d_isnanl'
23147 d_killpg='$d_killpg'
23148 d_lchown='$d_lchown'
23149 d_ldbl_dig='$d_ldbl_dig'
23150 d_libm_lib_version='$d_libm_lib_version'
23152 d_localtime64='$d_localtime64'
23153 d_localtime_r='$d_localtime_r'
23154 d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset'
23155 d_locconv='$d_locconv'
23157 d_longdbl='$d_longdbl'
23158 d_longlong='$d_longlong'
23159 d_lseekproto='$d_lseekproto'
23161 d_madvise='$d_madvise'
23162 d_malloc_good_size='$d_malloc_good_size'
23163 d_malloc_size='$d_malloc_size'
23165 d_mbstowcs='$d_mbstowcs'
23166 d_mbtowc='$d_mbtowc'
23167 d_memchr='$d_memchr'
23168 d_memcmp='$d_memcmp'
23169 d_memcpy='$d_memcpy'
23170 d_memmove='$d_memmove'
23171 d_memset='$d_memset'
23173 d_mkdtemp='$d_mkdtemp'
23174 d_mkfifo='$d_mkfifo'
23175 d_mkstemp='$d_mkstemp'
23176 d_mkstemps='$d_mkstemps'
23177 d_mktime64='$d_mktime64'
23178 d_mktime='$d_mktime'
23181 d_modfl_pow32_bug='$d_modfl_pow32_bug'
23182 d_modflproto='$d_modflproto'
23183 d_mprotect='$d_mprotect'
23185 d_msg_ctrunc='$d_msg_ctrunc'
23186 d_msg_dontroute='$d_msg_dontroute'
23187 d_msg_oob='$d_msg_oob'
23188 d_msg_peek='$d_msg_peek'
23189 d_msg_proxy='$d_msg_proxy'
23190 d_msgctl='$d_msgctl'
23191 d_msgget='$d_msgget'
23192 d_msghdr_s='$d_msghdr_s'
23193 d_msgrcv='$d_msgrcv'
23194 d_msgsnd='$d_msgsnd'
23196 d_munmap='$d_munmap'
23197 d_mymalloc='$d_mymalloc'
23199 d_ndbm_h_uses_prototypes='$d_ndbm_h_uses_prototypes'
23201 d_nl_langinfo='$d_nl_langinfo'
23202 d_nv_preserves_uv='$d_nv_preserves_uv'
23203 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
23204 d_off64_t='$d_off64_t'
23205 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
23206 d_oldpthreads='$d_oldpthreads'
23207 d_oldsock='$d_oldsock'
23209 d_pathconf='$d_pathconf'
23211 d_perl_otherlibdirs='$d_perl_otherlibdirs'
23212 d_phostname='$d_phostname'
23215 d_portable='$d_portable'
23217 d_prctl_set_name='$d_prctl_set_name'
23218 d_printf_format_null='$d_printf_format_null'
23219 d_procselfexe='$d_procselfexe'
23220 d_pseudofork='$d_pseudofork'
23221 d_pthread_atfork='$d_pthread_atfork'
23222 d_pthread_attr_setscope='$d_pthread_attr_setscope'
23223 d_pthread_yield='$d_pthread_yield'
23225 d_pwchange='$d_pwchange'
23226 d_pwclass='$d_pwclass'
23227 d_pwcomment='$d_pwcomment'
23228 d_pwexpire='$d_pwexpire'
23229 d_pwgecos='$d_pwgecos'
23230 d_pwpasswd='$d_pwpasswd'
23231 d_pwquota='$d_pwquota'
23234 d_random_r='$d_random_r'
23235 d_readdir64_r='$d_readdir64_r'
23236 d_readdir='$d_readdir'
23237 d_readdir_r='$d_readdir_r'
23238 d_readlink='$d_readlink'
23240 d_recvmsg='$d_recvmsg'
23241 d_rename='$d_rename'
23242 d_rewinddir='$d_rewinddir'
23244 d_safebcpy='$d_safebcpy'
23245 d_safemcpy='$d_safemcpy'
23246 d_sanemcmp='$d_sanemcmp'
23247 d_sbrkproto='$d_sbrkproto'
23248 d_scalbnl='$d_scalbnl'
23249 d_sched_yield='$d_sched_yield'
23250 d_scm_rights='$d_scm_rights'
23251 d_seekdir='$d_seekdir'
23252 d_select='$d_select'
23254 d_semctl='$d_semctl'
23255 d_semctl_semid_ds='$d_semctl_semid_ds'
23256 d_semctl_semun='$d_semctl_semun'
23257 d_semget='$d_semget'
23259 d_sendmsg='$d_sendmsg'
23260 d_setegid='$d_setegid'
23261 d_seteuid='$d_seteuid'
23262 d_setgrent='$d_setgrent'
23263 d_setgrent_r='$d_setgrent_r'
23264 d_setgrps='$d_setgrps'
23265 d_sethent='$d_sethent'
23266 d_sethostent_r='$d_sethostent_r'
23267 d_setitimer='$d_setitimer'
23268 d_setlinebuf='$d_setlinebuf'
23269 d_setlocale='$d_setlocale'
23270 d_setlocale_r='$d_setlocale_r'
23271 d_setnent='$d_setnent'
23272 d_setnetent_r='$d_setnetent_r'
23273 d_setpent='$d_setpent'
23274 d_setpgid='$d_setpgid'
23275 d_setpgrp2='$d_setpgrp2'
23276 d_setpgrp='$d_setpgrp'
23277 d_setprior='$d_setprior'
23278 d_setproctitle='$d_setproctitle'
23279 d_setprotoent_r='$d_setprotoent_r'
23280 d_setpwent='$d_setpwent'
23281 d_setpwent_r='$d_setpwent_r'
23282 d_setregid='$d_setregid'
23283 d_setresgid='$d_setresgid'
23284 d_setresuid='$d_setresuid'
23285 d_setreuid='$d_setreuid'
23286 d_setrgid='$d_setrgid'
23287 d_setruid='$d_setruid'
23288 d_setsent='$d_setsent'
23289 d_setservent_r='$d_setservent_r'
23290 d_setsid='$d_setsid'
23291 d_setvbuf='$d_setvbuf'
23295 d_shmatprototype='$d_shmatprototype'
23296 d_shmctl='$d_shmctl'
23298 d_shmget='$d_shmget'
23299 d_sigaction='$d_sigaction'
23300 d_signbit='$d_signbit'
23301 d_sigprocmask='$d_sigprocmask'
23302 d_sigsetjmp='$d_sigsetjmp'
23303 d_sin6_scope_id='$d_sin6_scope_id'
23304 d_sitearch='$d_sitearch'
23305 d_snprintf='$d_snprintf'
23306 d_sockaddr_in6='$d_sockaddr_in6'
23307 d_sockaddr_sa_len='$d_sockaddr_sa_len'
23308 d_sockatmark='$d_sockatmark'
23309 d_sockatmarkproto='$d_sockatmarkproto'
23310 d_socket='$d_socket'
23311 d_socklen_t='$d_socklen_t'
23312 d_sockpair='$d_sockpair'
23313 d_socks5_init='$d_socks5_init'
23314 d_sprintf_returns_strlen='$d_sprintf_returns_strlen'
23316 d_srand48_r='$d_srand48_r'
23317 d_srandom_r='$d_srandom_r'
23318 d_sresgproto='$d_sresgproto'
23319 d_sresuproto='$d_sresuproto'
23320 d_statblks='$d_statblks'
23321 d_statfs_f_flags='$d_statfs_f_flags'
23322 d_statfs_s='$d_statfs_s'
23323 d_static_inline='$d_static_inline'
23324 d_statvfs='$d_statvfs'
23325 d_stdio_cnt_lval='$d_stdio_cnt_lval'
23326 d_stdio_ptr_lval='$d_stdio_ptr_lval'
23327 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
23328 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
23329 d_stdio_stream_array='$d_stdio_stream_array'
23330 d_stdiobase='$d_stdiobase'
23331 d_stdstdio='$d_stdstdio'
23332 d_strchr='$d_strchr'
23333 d_strcoll='$d_strcoll'
23334 d_strctcpy='$d_strctcpy'
23335 d_strerrm='$d_strerrm'
23336 d_strerror='$d_strerror'
23337 d_strerror_r='$d_strerror_r'
23338 d_strftime='$d_strftime'
23339 d_strlcat='$d_strlcat'
23340 d_strlcpy='$d_strlcpy'
23341 d_strtod='$d_strtod'
23342 d_strtol='$d_strtol'
23343 d_strtold='$d_strtold'
23344 d_strtoll='$d_strtoll'
23345 d_strtoq='$d_strtoq'
23346 d_strtoul='$d_strtoul'
23347 d_strtoull='$d_strtoull'
23348 d_strtouq='$d_strtouq'
23349 d_strxfrm='$d_strxfrm'
23350 d_suidsafe='$d_suidsafe'
23351 d_symlink='$d_symlink'
23352 d_syscall='$d_syscall'
23353 d_syscallproto='$d_syscallproto'
23354 d_sysconf='$d_sysconf'
23355 d_sysernlst='$d_sysernlst'
23356 d_syserrlst='$d_syserrlst'
23357 d_system='$d_system'
23358 d_tcgetpgrp='$d_tcgetpgrp'
23359 d_tcsetpgrp='$d_tcsetpgrp'
23360 d_telldir='$d_telldir'
23361 d_telldirproto='$d_telldirproto'
23363 d_timegm='$d_timegm'
23365 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
23366 d_tm_tm_zone='$d_tm_tm_zone'
23367 d_tmpnam_r='$d_tmpnam_r'
23368 d_truncate='$d_truncate'
23369 d_ttyname_r='$d_ttyname_r'
23370 d_tzname='$d_tzname'
23371 d_u32align='$d_u32align'
23372 d_ualarm='$d_ualarm'
23375 d_union_semun='$d_union_semun'
23376 d_unordered='$d_unordered'
23377 d_unsetenv='$d_unsetenv'
23378 d_usleep='$d_usleep'
23379 d_usleepproto='$d_usleepproto'
23381 d_vendorarch='$d_vendorarch'
23382 d_vendorbin='$d_vendorbin'
23383 d_vendorlib='$d_vendorlib'
23384 d_vendorscript='$d_vendorscript'
23386 d_void_closedir='$d_void_closedir'
23387 d_voidsig='$d_voidsig'
23388 d_voidtty='$d_voidtty'
23389 d_volatile='$d_volatile'
23390 d_vprintf='$d_vprintf'
23391 d_vsnprintf='$d_vsnprintf'
23393 d_waitpid='$d_waitpid'
23394 d_wcstombs='$d_wcstombs'
23395 d_wctomb='$d_wctomb'
23396 d_writev='$d_writev'
23399 db_hashtype='$db_hashtype'
23400 db_prefixtype='$db_prefixtype'
23401 db_version_major='$db_version_major'
23402 db_version_minor='$db_version_minor'
23403 db_version_patch='$db_version_patch'
23404 defvoidused='$defvoidused'
23405 direntrytype='$direntrytype'
23408 doublesize='$doublesize'
23410 drand48_r_proto='$drand48_r_proto'
23412 dynamic_ext='$dynamic_ext'
23418 endgrent_r_proto='$endgrent_r_proto'
23419 endhostent_r_proto='$endhostent_r_proto'
23420 endnetent_r_proto='$endnetent_r_proto'
23421 endprotoent_r_proto='$endprotoent_r_proto'
23422 endpwent_r_proto='$endpwent_r_proto'
23423 endservent_r_proto='$endservent_r_proto'
23424 eunicefix='$eunicefix'
23427 extensions='$extensions'
23428 extern_C='$extern_C'
23430 fflushNULL='$fflushNULL'
23431 fflushall='$fflushall'
23433 firstmakefile='$firstmakefile'
23435 fpossize='$fpossize'
23436 fpostype='$fpostype'
23437 freetype='$freetype'
23440 full_csh='$full_csh'
23441 full_sed='$full_sed'
23442 gccansipedantic='$gccansipedantic'
23443 gccosandvers='$gccosandvers'
23444 gccversion='$gccversion'
23445 getgrent_r_proto='$getgrent_r_proto'
23446 getgrgid_r_proto='$getgrgid_r_proto'
23447 getgrnam_r_proto='$getgrnam_r_proto'
23448 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
23449 gethostbyname_r_proto='$gethostbyname_r_proto'
23450 gethostent_r_proto='$gethostent_r_proto'
23451 getlogin_r_proto='$getlogin_r_proto'
23452 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
23453 getnetbyname_r_proto='$getnetbyname_r_proto'
23454 getnetent_r_proto='$getnetent_r_proto'
23455 getprotobyname_r_proto='$getprotobyname_r_proto'
23456 getprotobynumber_r_proto='$getprotobynumber_r_proto'
23457 getprotoent_r_proto='$getprotoent_r_proto'
23458 getpwent_r_proto='$getpwent_r_proto'
23459 getpwnam_r_proto='$getpwnam_r_proto'
23460 getpwuid_r_proto='$getpwuid_r_proto'
23461 getservbyname_r_proto='$getservbyname_r_proto'
23462 getservbyport_r_proto='$getservbyport_r_proto'
23463 getservent_r_proto='$getservent_r_proto'
23464 getspnam_r_proto='$getspnam_r_proto'
23465 gidformat='$gidformat'
23471 gmtime_r_proto='$gmtime_r_proto'
23472 gnulibc_version='$gnulibc_version'
23474 groupcat='$groupcat'
23475 groupstype='$groupstype'
23478 h_sysfile='$h_sysfile'
23481 html1dir='$html1dir'
23482 html1direxp='$html1direxp'
23483 html3dir='$html3dir'
23484 html3direxp='$html3direxp'
23493 i_arpainet='$i_arpainet'
23494 i_assert='$i_assert'
23495 i_bsdioctl='$i_bsdioctl'
23499 i_dirent='$i_dirent'
23505 i_fp_class='$i_fp_class'
23507 i_gdbm_ndbm='$i_gdbm_ndbm'
23508 i_gdbmndbm='$i_gdbmndbm'
23510 i_ieeefp='$i_ieeefp'
23511 i_inttypes='$i_inttypes'
23512 i_langinfo='$i_langinfo'
23513 i_libutil='$i_libutil'
23514 i_limits='$i_limits'
23515 i_locale='$i_locale'
23516 i_machcthr='$i_machcthr'
23517 i_malloc='$i_malloc'
23518 i_mallocmalloc='$i_mallocmalloc'
23520 i_memory='$i_memory'
23521 i_mntent='$i_mntent'
23524 i_neterrno='$i_neterrno'
23525 i_netinettcp='$i_netinettcp'
23529 i_pthread='$i_pthread'
23531 i_rpcsvcdbm='$i_rpcsvcdbm'
23534 i_shadow='$i_shadow'
23536 i_stdarg='$i_stdarg'
23537 i_stdbool='$i_stdbool'
23538 i_stddef='$i_stddef'
23539 i_stdlib='$i_stdlib'
23540 i_string='$i_string'
23541 i_sunmath='$i_sunmath'
23542 i_sysaccess='$i_sysaccess'
23543 i_sysdir='$i_sysdir'
23544 i_sysfile='$i_sysfile'
23545 i_sysfilio='$i_sysfilio'
23547 i_sysioctl='$i_sysioctl'
23548 i_syslog='$i_syslog'
23549 i_sysmman='$i_sysmman'
23550 i_sysmode='$i_sysmode'
23551 i_sysmount='$i_sysmount'
23552 i_sysndir='$i_sysndir'
23553 i_sysparam='$i_sysparam'
23554 i_syspoll='$i_syspoll'
23555 i_sysresrc='$i_sysresrc'
23556 i_syssecrt='$i_syssecrt'
23557 i_sysselct='$i_sysselct'
23558 i_syssockio='$i_syssockio'
23559 i_sysstat='$i_sysstat'
23560 i_sysstatfs='$i_sysstatfs'
23561 i_sysstatvfs='$i_sysstatvfs'
23562 i_systime='$i_systime'
23563 i_systimek='$i_systimek'
23564 i_systimes='$i_systimes'
23565 i_systypes='$i_systypes'
23566 i_sysuio='$i_sysuio'
23568 i_sysutsname='$i_sysutsname'
23569 i_sysvfs='$i_sysvfs'
23570 i_syswait='$i_syswait'
23571 i_termio='$i_termio'
23572 i_termios='$i_termios'
23574 i_unistd='$i_unistd'
23577 i_values='$i_values'
23578 i_varargs='$i_varargs'
23579 i_varhdr='$i_varhdr'
23581 ignore_versioned_solibs='$ignore_versioned_solibs'
23582 inc_version_list='$inc_version_list'
23583 inc_version_list_init='$inc_version_list_init'
23586 initialinstalllocation='$initialinstalllocation'
23587 installarchlib='$installarchlib'
23588 installbin='$installbin'
23589 installhtml1dir='$installhtml1dir'
23590 installhtml3dir='$installhtml3dir'
23591 installman1dir='$installman1dir'
23592 installman3dir='$installman3dir'
23593 installprefix='$installprefix'
23594 installprefixexp='$installprefixexp'
23595 installprivlib='$installprivlib'
23596 installscript='$installscript'
23597 installsitearch='$installsitearch'
23598 installsitebin='$installsitebin'
23599 installsitehtml1dir='$installsitehtml1dir'
23600 installsitehtml3dir='$installsitehtml3dir'
23601 installsitelib='$installsitelib'
23602 installsiteman1dir='$installsiteman1dir'
23603 installsiteman3dir='$installsiteman3dir'
23604 installsitescript='$installsitescript'
23605 installstyle='$installstyle'
23606 installusrbinperl='$installusrbinperl'
23607 installvendorarch='$installvendorarch'
23608 installvendorbin='$installvendorbin'
23609 installvendorhtml1dir='$installvendorhtml1dir'
23610 installvendorhtml3dir='$installvendorhtml3dir'
23611 installvendorlib='$installvendorlib'
23612 installvendorman1dir='$installvendorman1dir'
23613 installvendorman3dir='$installvendorman3dir'
23614 installvendorscript='$installvendorscript'
23616 issymlink='$issymlink'
23617 ivdformat='$ivdformat'
23620 known_extensions='$known_extensions'
23623 ld_can_script='$ld_can_script'
23624 lddlflags='$lddlflags'
23626 ldflags_uselargefiles='$ldflags_uselargefiles'
23627 ldlibpthname='$ldlibpthname'
23634 libsdirs='$libsdirs'
23635 libsfiles='$libsfiles'
23636 libsfound='$libsfound'
23637 libspath='$libspath'
23638 libswanted='$libswanted'
23639 libswanted_uselargefiles='$libswanted_uselargefiles'
23645 localtime_r_proto='$localtime_r_proto'
23646 locincpth='$locincpth'
23647 loclibpth='$loclibpth'
23648 longdblsize='$longdblsize'
23649 longlongsize='$longlongsize'
23650 longsize='$longsize'
23654 lseeksize='$lseeksize'
23655 lseektype='$lseektype'
23658 madlyobj='$madlyobj'
23659 madlysrc='$madlysrc'
23663 make_set_make='$make_set_make'
23664 mallocobj='$mallocobj'
23665 mallocsrc='$mallocsrc'
23666 malloctype='$malloctype'
23668 man1direxp='$man1direxp'
23671 man3direxp='$man3direxp'
23673 mips_type='$mips_type'
23674 mistrustnm='$mistrustnm'
23676 mmaptype='$mmaptype'
23677 modetype='$modetype'
23679 multiarch='$multiarch'
23681 myarchname='$myarchname'
23682 mydomain='$mydomain'
23683 myhostname='$myhostname'
23686 need_va_copy='$need_va_copy'
23687 netdb_hlen_type='$netdb_hlen_type'
23688 netdb_host_type='$netdb_host_type'
23689 netdb_name_type='$netdb_name_type'
23690 netdb_net_type='$netdb_net_type'
23693 nm_so_opt='$nm_so_opt'
23694 nonxs_ext='$nonxs_ext'
23696 nvEUformat='$nvEUformat'
23697 nvFUformat='$nvFUformat'
23698 nvGUformat='$nvGUformat'
23699 nv_overflows_integers_at='$nv_overflows_integers_at'
23700 nv_preserves_uv_bits='$nv_preserves_uv_bits'
23701 nveformat='$nveformat'
23702 nvfformat='$nvfformat'
23703 nvgformat='$nvgformat'
23706 o_nonblock='$o_nonblock'
23708 old_pthread_create_joinable='$old_pthread_create_joinable'
23709 optimize='$optimize'
23710 orderlib='$orderlib'
23713 otherlibdirs='$otherlibdirs'
23717 patchlevel='$patchlevel'
23718 path_sep='$path_sep'
23721 perl_patchlevel='$perl_patchlevel'
23722 perl_static_inline='$perl_static_inline'
23723 perladmin='$perladmin'
23724 perllibs='$perllibs'
23725 perlpath='$perlpath'
23727 phostname='$phostname'
23733 prefixexp='$prefixexp'
23735 privlibexp='$privlibexp'
23736 procselfexe='$procselfexe'
23737 prototype='$prototype'
23739 quadkind='$quadkind'
23740 quadtype='$quadtype'
23741 randbits='$randbits'
23742 randfunc='$randfunc'
23743 random_r_proto='$random_r_proto'
23744 randseedtype='$randseedtype'
23746 rd_nodata='$rd_nodata'
23747 readdir64_r_proto='$readdir64_r_proto'
23748 readdir_r_proto='$readdir_r_proto'
23749 revision='$revision'
23755 sGMTIME_max='$sGMTIME_max'
23756 sGMTIME_min='$sGMTIME_min'
23757 sLOCALTIME_max='$sLOCALTIME_max'
23758 sLOCALTIME_min='$sLOCALTIME_min'
23759 sPRIEUldbl='$sPRIEUldbl'
23760 sPRIFUldbl='$sPRIFUldbl'
23761 sPRIGUldbl='$sPRIGUldbl'
23762 sPRIXU64='$sPRIXU64'
23764 sPRIeldbl='$sPRIeldbl'
23765 sPRIfldbl='$sPRIfldbl'
23766 sPRIgldbl='$sPRIgldbl'
23771 sSCNfldbl='$sSCNfldbl'
23772 sched_yield='$sched_yield'
23773 scriptdir='$scriptdir'
23774 scriptdirexp='$scriptdirexp'
23776 seedfunc='$seedfunc'
23777 selectminbits='$selectminbits'
23778 selecttype='$selecttype'
23779 sendmail='$sendmail'
23780 setgrent_r_proto='$setgrent_r_proto'
23781 sethostent_r_proto='$sethostent_r_proto'
23782 setlocale_r_proto='$setlocale_r_proto'
23783 setnetent_r_proto='$setnetent_r_proto'
23784 setprotoent_r_proto='$setprotoent_r_proto'
23785 setpwent_r_proto='$setpwent_r_proto'
23786 setservent_r_proto='$setservent_r_proto'
23789 sharpbang='$sharpbang'
23790 shmattype='$shmattype'
23791 shortsize='$shortsize'
23794 sig_count='$sig_count'
23795 sig_name='$sig_name'
23796 sig_name_init='$sig_name_init'
23798 sig_num_init='$sig_num_init'
23799 sig_size='$sig_size'
23800 signal_t='$signal_t'
23801 sitearch='$sitearch'
23802 sitearchexp='$sitearchexp'
23804 sitebinexp='$sitebinexp'
23805 sitehtml1dir='$sitehtml1dir'
23806 sitehtml1direxp='$sitehtml1direxp'
23807 sitehtml3dir='$sitehtml3dir'
23808 sitehtml3direxp='$sitehtml3direxp'
23810 sitelib_stem='$sitelib_stem'
23811 sitelibexp='$sitelibexp'
23812 siteman1dir='$siteman1dir'
23813 siteman1direxp='$siteman1direxp'
23814 siteman3dir='$siteman3dir'
23815 siteman3direxp='$siteman3direxp'
23816 siteprefix='$siteprefix'
23817 siteprefixexp='$siteprefixexp'
23818 sitescript='$sitescript'
23819 sitescriptexp='$sitescriptexp'
23820 sizesize='$sizesize'
23821 sizetype='$sizetype'
23825 sockethdr='$sockethdr'
23826 socketlib='$socketlib'
23827 socksizetype='$socksizetype'
23829 spackage='$spackage'
23830 spitshell='$spitshell'
23831 srand48_r_proto='$srand48_r_proto'
23832 srandom_r_proto='$srandom_r_proto'
23834 ssizetype='$ssizetype'
23835 st_ino_sign='$st_ino_sign'
23836 st_ino_size='$st_ino_size'
23837 startperl='$startperl'
23839 static_ext='$static_ext'
23841 stdio_base='$stdio_base'
23842 stdio_bufsiz='$stdio_bufsiz'
23843 stdio_cnt='$stdio_cnt'
23844 stdio_filbuf='$stdio_filbuf'
23845 stdio_ptr='$stdio_ptr'
23846 stdio_stream_array='$stdio_stream_array'
23847 strerror_r_proto='$strerror_r_proto'
23850 subversion='$subversion'
23854 targetarch='$targetarch'
23858 timeincl='$timeincl'
23859 timetype='$timetype'
23860 tmpnam_r_proto='$tmpnam_r_proto'
23866 ttyname_r_proto='$ttyname_r_proto'
23875 uidformat='$uidformat'
23881 uquadtype='$uquadtype'
23882 use5005threads='$use5005threads'
23883 use64bitall='$use64bitall'
23884 use64bitint='$use64bitint'
23885 usecrosscompile='$usecrosscompile'
23886 usedevel='$usedevel'
23888 usedtrace='$usedtrace'
23889 usefaststdio='$usefaststdio'
23890 useithreads='$useithreads'
23891 usekernprocpathname='$usekernprocpathname'
23892 uselargefiles='$uselargefiles'
23893 uselongdouble='$uselongdouble'
23894 usemallocwrap='$usemallocwrap'
23895 usemorebits='$usemorebits'
23896 usemultiplicity='$usemultiplicity'
23897 usemymalloc='$usemymalloc'
23899 usensgetexecutablepath='$usensgetexecutablepath'
23900 useopcode='$useopcode'
23901 useperlio='$useperlio'
23902 useposix='$useposix'
23903 usereentrant='$usereentrant'
23904 userelocatableinc='$userelocatableinc'
23906 useshrplib='$useshrplib'
23907 usesitecustomize='$usesitecustomize'
23908 usesocks='$usesocks'
23909 usethreads='$usethreads'
23910 usevendorprefix='$usevendorprefix'
23911 useversionedarchname='$useversionedarchname'
23912 usevfork='$usevfork'
23915 uvXUformat='$uvXUformat'
23916 uvoformat='$uvoformat'
23919 uvuformat='$uvuformat'
23920 uvxformat='$uvxformat'
23922 vendorarch='$vendorarch'
23923 vendorarchexp='$vendorarchexp'
23924 vendorbin='$vendorbin'
23925 vendorbinexp='$vendorbinexp'
23926 vendorhtml1dir='$vendorhtml1dir'
23927 vendorhtml1direxp='$vendorhtml1direxp'
23928 vendorhtml3dir='$vendorhtml3dir'
23929 vendorhtml3direxp='$vendorhtml3direxp'
23930 vendorlib='$vendorlib'
23931 vendorlib_stem='$vendorlib_stem'
23932 vendorlibexp='$vendorlibexp'
23933 vendorman1dir='$vendorman1dir'
23934 vendorman1direxp='$vendorman1direxp'
23935 vendorman3dir='$vendorman3dir'
23936 vendorman3direxp='$vendorman3direxp'
23937 vendorprefix='$vendorprefix'
23938 vendorprefixexp='$vendorprefixexp'
23939 vendorscript='$vendorscript'
23940 vendorscriptexp='$vendorscriptexp'
23942 version_patchlevel_string='$version_patchlevel_string'
23943 versiononly='$versiononly'
23945 voidflags='$voidflags'
23948 yaccflags='$yaccflags'
23953 : add special variables
23954 $test -f $src/patchlevel.h && \
23955 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
23956 echo "PERL_PATCHLEVEL='$perl_patchlevel'" >>config.sh
23957 echo "PERL_CONFIG_SH=true" >>config.sh
23959 : propagate old symbols
23960 if $test -f UU/config.sh; then
23961 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
23962 $sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' \
23963 config.sh config.sh UU/oldconfig.sh |\
23964 $sort | $uniq -u >UU/oldsyms
23965 set X `$cat UU/oldsyms`
23971 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
23973 echo ": Variables propagated from previous config.sh file." >>config.sh
23974 for sym in `$cat UU/oldsyms`; do
23975 echo " Propagating $hint variable "'$'"$sym..."
23976 eval 'tmp="$'"${sym}"'"'
23978 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
23984 : Finish up by extracting the .SH files
23988 echo "Extraction done."
23998 If you'd like to make any changes to the config.sh file before I begin
23999 to configure things, do it as a shell escape now (e.g. !vi config.sh).
24002 rp="Press return or use a shell escape to edit config.sh:"
24007 *) : in case they cannot read
24008 sh 1>&4 -c "$ans";;
24013 : if this fails, just run all the .SH files by hand
24022 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
24029 Now you need to generate make dependencies by running "$make depend".
24030 You might prefer to run it in background: "$make depend > makedepend.out &"
24031 It can take a while, so you might not want to run it right now.
24036 rp="Run $make depend now?"
24040 $make depend && echo "Now you must run '$make'."
24043 echo "You must run '$make depend' then '$make'."
24046 elif test -f [Mm]akefile; then
24048 echo "Now you must run a $make."
24050 echo "Configure done."
24053 if $test -f Policy.sh; then
24056 If you compile $package on a different machine or from a different object
24057 directory, copy the Policy.sh file from this object directory to the
24058 new one before you run Configure -- this will help you with most of
24059 the policy defaults.
24063 if $test -f config.msg; then
24064 echo "Hmm. I also noted the following information while running:"
24066 $cat config.msg >&4
24069 $rm -f kit*isdone ark*isdone